/*
* XmlDigitalTeaching v0.0.1
* Copyright ©Wed Jun 12 2024 12:02:25 GMT+0800 (中国标准时间) smile
* Released under the ISC License.
*/
var epub = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAoCAMAAAChHKjRAAAAAXNSR0IArs4c6QAAAjdQTFRFAAAAiXb/kG/0inD6inX6jW72jXL2eGLpe2fuinL2i3H3iHf6i3L5dmTvjHH3inP4inH2i3L2d2TuhW7vjHH5d2TqjnH5fWnyd2bskHb5jXX1jHH2i3H3i3H4i3H4d2Xsd2Xqi3H4cmLoi3L4inH3i3L3inL3i3L3jHL3hG3zi3L3jHL4jnT5i3L3i3L3jHH2bFPvbl/nb2DncF/ncVP1cWHncWHocWHpclP2cmLpc2Lpc2Lqc2Ppc2PqdGPpdGPqd1r1d1z0d2TreFv2eFz0eFz1eGDxeGbseVv1eVz1el31el32el71el72e133e1/2e2TxfGD1fGXxfWD3fWH2fmjxf2T2f2rwgGX3gGnygWX2gWb2gWb3gWrzgWzzgmb3gmf2gmzyg23zhGj3hGn2hGr2hGr3hG3zhWr3hWv2hWv3hWz3hW7zhW70hmz3h233h273iG34iG/3iW34iW74iW/3iXD3iXH2inD4inH3inP2i3D4i3H3i3H4i3L3i3L4i3P4jHL3jHL4jHP3jHP4jHT2jHT3jHrxjHryjXP4jXT3jXT5jXX3jXvyjnT5jnX4j3T5j3T6j3b3lYH2l4H4mIL4mYP4movynY/xpJL3pJfzpZL5pZjzqJX5q5n5r576saD6uaz3va/7zMT5zcP7z8X70Mb70sj708n708r71c381c761s382ND72db4393549z+4+H55+b66OL96+b+6+r67+v+8/L99PD/9vT+///9///+////0H5GmAAAADB0Uk5TAA0XMjI6OkZNVVpefX+HjJCRkpSeoausra2vs7W2t7i5v8TN1tbd3t/o6+7v8PH8u0jmrQAAAapJREFUOMtjYGBgYBZQ1sMAOpoKHAwIwF+HDfSlG9nzElADVGRuZScEVcNWiVORvY29KESRZDluRfb2VhJgRSp1OBQlgRTZW8uDFKn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MyMAgSUNPEBSqh+PCq0eaElIgsgsq6eliBliIPE1ABAEFwqt5aEHsEAAAAAElFTkSuQmCC";

var image = {
  leaflet: {
    epub,
    resource
  }
};

//
// import { OuchnOss } from '@/api/business/file/OuchnOss'
// import { defaultCover } from '@/assets/remote'

var script = {
  name: 'XmlResourceRender',
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //属性中传递过来的块儿数据
    pBlockData: {},
    //块儿数据名
    blockDataName: String,
    //页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    officePreviewPath: {
      type: String,
      default: ''
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  watch: {
    pBlockData: {
      handler(newValue) {
        this.$nextTick(() => {
          this.blockData = Object.assign({}, this.blockData, newValue);
        });
      },
      deep: true,
      immediate: true
    }
  },
  data() {
    return {
      ouchnOss: null,
      image,
      blockId: 'blockId' + Math.random(),
      //当前块儿数据，一般用不到，因为一般的块儿中不会在块儿内更改数据
      blockData: {},
      //属性组件名
      propertyComponentsName: 'xml-resource-property'
    };
  },
  computed: {
    // isNotLocalView() {
    //   return !(process.env.VUE_APP_ENV === 'localview')
    // }
  },
  methods: {
    // 此方法必须要，用户注册块儿点击事件
    blockClick() {
      this.$emit('blockclick', {
        blockData: this.blockData,
        dataName: this.blockDataName,
        propertyComponentsName: this.propertyComponentsName,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    countFileSize(fileSize) {
      if (!fileSize) return;
      if (fileSize < 1024) {
        return fileSize + 'B';
      } else if (fileSize < 1024 * 1024) {
        var temp = fileSize / 1024;
        temp = temp.toFixed(2);
        return temp + 'KB';
      } else if (fileSize < 1024 * 1024 * 1024) {
        var temp = fileSize / (1024 * 1024);
        temp = temp.toFixed(2);
        return temp + 'MB';
      } else {
        var temp = fileSize / (1024 * 1024 * 1024);
        temp = temp.toFixed(2);
        return temp + 'GB';
      }
    },
    downloadFile(item) {
      let data = {
        ...item
      };
      data.coverFileUrl = this.resourceBasisPath + data.coverFileUrl.split('./')[1];
      data.uploadFileUrl = this.resourceBasisPath + data.uploadFileUrl.split('./')[1];
      this.$emit('downloadFile', data);
    },
    // 无数据时
    noFileUrlClick() {
      this.$message.warning('没有目标文件');
    },
    downloadFileUrl(item, fileName) {
      let data = {
        ...item
      };
      if (item.uploadFileUrl.indexOf('http') === -1) {
        data.coverFileUrl = this.resourceBasisPath + data.coverFileUrl.split('./')[1];
        data.uploadFileUrl = this.resourceBasisPath + data.uploadFileUrl.split('./')[1];
      }
      if (this.mode == 'preview') {
        this.$emit('downloadFileUrl', {
          item,
          fileName,
          resourceType: this.blockData.resourceType
        });
      } else {
        this.$message.warning('资源仅支持在预览时下载');
      }
    },
    //  跳转office在线预览
    previewToPathClick(item) {
      console.log(item);
      if (this.mode == 'preview') {
        // if (item.fileFormat == 'pdf') {
        //   // const pdfUrl = '/pdfjs/web/viewer.html?file=' + encodeURIComponent(item.uploadFileUrl)
        //   this.$router.push({
        //     path: '/webView',
        //     query: {
        //       baseUrl: encodeURIComponent('/pdfjs/web/viewer.html?file=' + item.uploadFileUrl),
        //       title: item.title
        //     }
        //   })
        //   return
        // }
        if (item.fileFormat == 'zip' || item.fileFormat == 'rar' || item.fileFormat == '7z') return;
        if (item.fileFormat == '无') {
          this.$message.warning('没有目标文件');
          return;
        }
        if (item.fileFormat == '外部链接' && !item.link) {
          this.$message.warning('获取资源链接失败，请检查链接地址');
          return;
        }
        if (item.fileFormat == '外部链接') {
          window.open(item.link);
          return;
        }
        let url = this.resourceBasisPath + item.uploadFileUrl.split('./')[1];
        this.$emit('showFileReader', {
          fileFormat: item.fileFormat,
          fileUrl: url,
          title: item.title
        });
        // if (item.uploadFileUrl.indexOf('http') === -1) {
        //   window.open(
        //     (this.officePreviewPath ? this.officePreviewPath : 'https://view.officeapps.live.com/op/view.aspx?src=') +
        //       this.resourceBasisPath +
        //       item.uploadFileUrl.split('./')[1]
        //   )
        // } else {
        //   window.open(
        //     (this.officePreviewPath ? this.officePreviewPath : 'https://view.officeapps.live.com/op/view.aspx?src=') +
        //       item.uploadFileUrl
        //   )
        // }
      }
    }
  },
  created() {
    // if (this.isNotLocalView) {
    //   this.ouchnOss = new OuchnOss(true)
    // }
  }
};

var __$_require_static_images_default_over_resource_png__ = "f25e95524c42aff3.png";

var __$_require_static_images_leaflet_icons_download_bule_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAWCAYAAADafVyIAAAAAXNSR0IArs4c6QAAAkVJREFUSEvtlEtoE1EUhv9zJ6lpCkYzBl3oSouioosiWII2kwas4gMXdeFSt0ViR0lXmu6UNpN0IejGunGhIPjowlczWdiN6ELFhYgbG8RHJglYsWSSe2QC1dqal5CF4F0Nc8//f3P/O+cQ2ryozf5oCRBOWpPMiCiCgo+j/vfNfFxLAM2wXgPYCpZHTD1wtw2AXAagPjBHTH3N9H/AsgQ041+IqOcKu/3FXOBRLPBh6RHqnSByIe8TSmnFw7PrPi/WLftNtVThHKQcJaKL6dP+kcXFtQB9qdwuIWkGwDdzWF1dH5DMB8E8BWAVBCbNqHpiQfATIDBgRtUHznstVTgMKe84z8QYTetqvC7A2ew1Zjs98DqNFAHwrGTL8Ews8FUzrCcAgkLQzumo/2UoacWJcd7RMLA/M6zeXxpr3U7WjNx1gI4D4pNS4s2VDk4AOMlwdTPKhwRgAPgOLvea+toXf2q8hqMibFjjDOgALAAfAWwD8TswbSTglbRxIBNTs7W6uiGgmrNhHQNw47dsmW6ndf/RRuOiKYBj0p/4okkSzvwhMF0ydf9QI/PBm6zQ3on8lMuW2+c8HT1Ph1Y6MdRc/WP5HVJwt6mrtxqZa+PWVSjYR7uvFdiXraDk5i1mLPCmkbDZfc2wZgGsp+DlXNFbgM/uog2ZU7Uvq1njhbp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oMPhE49C6xumQIrpO45cUuMN0OoclJw2yxqAcM5hHMQ0NJ9B6ccMts2UCuwvOp8JMVRGUysAAAAASUVORK5CYII=";

var __$_require_static_images_leaflet_icons_resource_elliptic_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIQAAAAaCAYAAAB2KPSUAAAAAXNSR0IArs4c6QAAB3VJREFUaEPtmttuJLcRhr+q7jlpd+WDhDgGBGOBXMW+i19gkQcP9gWcOztXARaGAMeBNra1kmamp8kKimzOQZqRRtqRIBsjgOKxe9isn1Wsvyjs//YrsLQCsl+N/Qosr8AeEHs8rKzAswaEmd1nfvcZ+xgwsG1fKiJbj932nbsa96SLuEHAy3OQtyCvQEYgfZD6HVLXyM8V0lPS2FqRSpCqq6vk9nNv68peL+XSXxZNyePv+ouwIrhouR66vJQPu/q8P2I+po15/CxiXwSsbbH2NdaAjcE+gL3Jv7H8OzfA8pQA2mph7lo4718j7PLuJOQ/gR68Q98PUBfsoEJ7FepC7CtaCzq5Sm1VUOpeRR2aXK6EKgqVempRL4t0OagKGlrU2zwFEClJUEC8zeeZ2mNqS+V132adgEyJpVx1gjPLbZ68LdWNWNXEmPuiGsHbvK41IRrB24IRqkhb9QmzQOvlWSAMD4itEZtIdHDNAnEaiA6koynx6jXxvxCvgWcFOLsCzYMAsSR8fz4J/ASq4Sl6PqDqV+i4ouop2o6pY01PKvr9GT2r6BPoo/RN6XnZc4PaIr1K6RPpI12y1NfD6CH0hFibUGPU4s9Ies4BUllSCimpORBiBoiRQZExkv7l/lv+pBNu3r0uf9x+JeH7m0u/QRBXGkYQJYjRGrQIbS5rizFDmAk5x2hSUpoQaURTXyuRGRVNyiNNKgeapsfMAo22zOoR7SwSR4HQBOLhlDA5IZ5CWAJMAstDQLIVIDoApMX8DvSLU2oXfNOjflnTu2oY1IGh1oxCZCjKUCKDoAzVGCIMzThQGJkwwuIIOPB2zOs+RjIIXPBQuWVIQjbqIugVgecxLtSKLHw3Fl4vyQ110hQZDEvJ0t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1ILRXEdMFeE7ADJRZR4X47KQT4aebyCmLkW52AkxdV3PPYi6NoZBGDh1LcYoCqNEXZuzl3FkMBJJdaevV6jrFKNwcCxILXdvPVahHqvozFHRNpm6dpJrYaJSuWMzS3v2ihZk2N3qPNPXxe/PFpVEGi12dCGQfNxm6nqh1jtyKcU/csyji21k6lqEiRnORo7NNFHWTl2rMTZhnKhrY2o+7imp69tW66HBLVr6vS6gtS645ZpEhV6MDDzvYhtOc/c88IV4QOvu4JZ5NDRHNCWV57S3OKDuDGyVb18EuCyBIlHSOQ5hHgn18pbBrdYDWF2QK9HS0ZipMvXcd/6m4NbMA101zbMKbt29lW4Pf3tAzO837CL8HdsUBk9RzBQGXxP+jlmTpABWAcM8JO7k76J946elsLfTyNUi1F1AkdrBtIt+PkX42+9PLAWqSoxkPv9tAlfbyPG+9nSbd25e5PU3oFbYzYdekPF7Ff7D5VLM8kWZ5Qsy216OKR+xfEmmXIDxvnJJpuR+j2F/Qeaj4HH3w/srdHev0a5HPKmG2PXk9+/b/QrsAbH7Nf1dv3EPiN+1+HY/+f8DdDLzV5L1opoAAAAASUVORK5CYII=";

var __$_require_static_images_leaflet_icons_download_white_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAAXNSR0IArs4c6QAAAjlJREFUSEvtlcurjWEUh59fSpFLJOUUcquDciuXRExkrkxMMDkGkpPEgAEDipJIIuU2MPAnKJLEQK4hhDoZSCEhcv1p7dbJbnf23t+3nW201+Sr911rPd+6vqJFsT0NeJ7mOyUdLONKZZSrdW1PBV7kWa+kI2V8/Qt4CvAyYVskHeuAG2Wgk+rC/WG701yDN062J0p6NVD+i6ba9gTgvaRv1X7qdrXtS8AqYI+kvbXwImDb64DzuVpnSnK/n0bgR8CsVNwnaXfNymzYXLY3AqfT5hcwVNLvIuAxwA2gO5X3S9rVb9goYtvrgbOpGyleKulOoVSHku3hwGNgchodkrQ972YAz/J8q6Sjed4DnMzz78AiSfdrS9V0c9keD1wHAhRSidz2WOBdnvVIOlWT3oh0uaRbAzVnU3BGMQ64CUxPJ5slHbf9BRgGrAA+A7fz/gewWNLdehupEDjhAYi/n53OLgArgS7gakQHDAG+AkskPWi0BguDEz4y0z6njtOALpD0pBE07kqBqxruIRDjVC0/gfmS4q6plAYnfFTWs7/mUdOItBC0ErHtgG8D3ko61/RXU8H26KxtfNdIulfCdlmA1wIX06hL0uuiDlrRsx1N+jHAO4AD6aRb0tNWHBa1yb3wJsC9wOH/GPGISlltbwDOJHhus/krGlk9Pdsxkh8CPAnoS8XLwGpJ8Zq0RWyfADZVxsl2PF/xjIV8Aq4B7YDPAyLQvwvE9hVgIRA1aKfEdutraYEMxl/9AUsz/weMzneQAAAAAElFTkSuQmCC";

function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
  if (typeof shadowMode !== 'boolean') {
    createInjectorSSR = createInjector;
    createInjector = shadowMode;
    shadowMode = false;
  }
  // Vue.extend constructor export interop.
  const options = typeof script === 'function' ? script.options : script;
  // render functions
  if (template && template.render) {
    options.render = template.render;
    options.staticRenderFns = template.staticRenderFns;
    options._compiled = true;
    // functional template
    if (isFunctionalTemplate) {
      options.functional = true;
    }
  }
  // scopedId
  if (scopeId) {
    options._scopeId = scopeId;
  }
  let hook;
  if (moduleIdentifier) {
    // server build
    hook = function (context) {
      // 2.3 injection
      context = context ||
      // cached call
      this.$vnode && this.$vnode.ssrContext ||
      // stateful
      this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional
      // 2.2 with runInNewContext: true
      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
        context = __VUE_SSR_CONTEXT__;
      }
      // inject component styles
      if (style) {
        style.call(this, createInjectorSSR(context));
      }
      // register component module identifier for async chunk inference
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier);
      }
    };
    // used by ssr in case component is cached and beforeCreate
    // never gets called
    options._ssrRegister = hook;
  } else if (style) {
    hook = shadowMode ? function (context) {
      style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
    } : function (context) {
      style.call(this, createInjector(context));
    };
  }
  if (hook) {
    if (options.functional) {
      // register for functional component in vue file
      const originalRender = options.render;
      options.render = function renderWithStyleInjection(h, context) {
        hook.call(context);
        return originalRender(h, context);
      };
    } else {
      // inject component registration as beforeCreate hook
      const existing = options.beforeCreate;
      options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
    }
  }
  return script;
}

/* script */
const __vue_script__ = script;
var __vue_render__ = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      class: "xml-resource-container-" + _vm.pageType,
      attrs: { id: _vm.blockId },
      on: { click: _vm.blockClick },
    },
    [
      _c("div", { staticClass: "resource-box" }, [
        _c(
          "div",
          {
            class: [
              "preview-container-resource",
              "preview-container-resource-" + _vm.mode,
            ],
          },
          [
            _vm.blockData.styleMode == "A" || !_vm.blockData.styleMode
              ? _c(
                  "div",
                  [
                    _vm.blockData.resourceSetList &&
                    _vm.blockData.resourceSetList.length
                      ? _vm._l(
                          _vm.blockData.resourceSetList,
                          function (item, index) {
                            return _c(
                              "div",
                              {
                                key: index,
                                staticClass:
                                  "workbench-shop-item resource-style1 xml-group-item",
                              },
                              [
                                _c(
                                  "div",
                                  {
                                    staticClass:
                                      "shop-item-img slip-over-cover",
                                    on: {
                                      click: function ($event) {
                                        return _vm.previewToPathClick(item)
                                      },
                                    },
                                  },
                                  [
                                    _c("el-image", {
                                      staticClass:
                                        "shop-item-img-resource xml-round-6",
                                      attrs: {
                                        src: item.coverFileUrl
                                          ? item.coverFileUrl.indexOf("./") !==
                                            -1
                                            ? _vm.resourceBasisPath +
                                              item.coverFileUrl.split("./")[1]
                                            : item.coverFileUrl
                                          : __$_require_static_images_default_over_resource_png__,
                                      },
                                    }),
                                  ],
                                  1
                                ),
                                _vm._v(" "),
                                _c("div", { staticClass: "shop-item-desc" }, [
                                  _c("div", { staticClass: "filecont" }, [
                                    _c(
                                      "div",
                                      {
                                        staticClass:
                                          "xml-resource-title shop-item-desc-title preview-item-file",
                                        on: {
                                          click: function ($event) {
                                            return _vm.previewToPathClick(item)
                                          },
                                        },
                                      },
                                      [
                                        _vm._v(
                                          "\n                  " +
                                            _vm._s(
                                              item.title
                                                ? item.title
                                                : "资源样例"
                                            ) +
                                            "\n                "
                                        ),
                                      ]
                                    ),
                                    _vm._v(" "),
                                    _c(
                                      "div",
                                      { staticClass: "shop-item-desc-detail" },
                                      [
                                        _vm._v(
                                          "\n                  文件格式：" +
                                            _vm._s(
                                              item.fileFormat
                                                ? item.fileFormat
                                                : "无"
                                            ) +
                                            "\n\n                  "
                                        ),
                                        _vm.blockData.resourceType == "0" &&
                                        item.source != ""
                                          ? _c(
                                              "div",
                                              {
                                                staticClass: "pointer",
                                                on: {
                                                  click: function ($event) {
                                                    return _vm.downloadFileUrl(
                                                      item,
                                                      item.title +
                                                        "." +
                                                        item.fileFormat
                                                    )
                                                  },
                                                },
                                              },
                                              [
                                                _c("img", {
                                                  staticClass:
                                                    "shop-item-img-resource",
                                                  attrs: {
                                                    src: __$_require_static_images_leaflet_icons_download_bule_png__,
                                                  },
                                                }),
                                                _vm._v(
                                                  "立即下载\n                  "
                                                ),
                                              ]
                                            )
                                          : _vm._e(),
                                      ]
                                    ),
                                    _vm._v(" "),
                                    _c(
                                      "div",
                                      { staticClass: "shop-item-desc-detail" },
                                      [
                                        _vm._v(
                                          "\n                  文件大小：" +
                                            _vm._s(
                                              _vm.countFileSize(item.fileSize)
                                                ? _vm.countFileSize(
                                                    item.fileSize
                                                  )
                                                : "无"
                                            ) +
                                            "\n                "
                                        ),
                                      ]
                                    ),
                                  ]),
                                ]),
                              ]
                            )
                          }
                        )
                      : [
                          _c(
                            "div",
                            {
                              staticClass:
                                "workbench-shop-item resource-style1 xml-group-item",
                            },
                            [
                              _c("div", { staticClass: "shop-item-img" }, [
                                _c("img", {
                                  staticClass: "shop-item-img-resource",
                                  attrs: {
                                    src: __$_require_static_images_default_over_resource_png__,
                                  },
                                }),
                              ]),
                              _vm._v(" "),
                              _c("div", { staticClass: "shop-item-desc" }, [
                                _vm._m(0),
                                _vm._v(" "),
                                _vm.blockData.resourceType == "0"
                                  ? _c(
                                      "div",
                                      { staticClass: "shop-item-desc-detail" },
                                      [
                                        _c("div", [
                                          _c("img", {
                                            staticClass:
                                              "shop-item-img-resource",
                                            attrs: {
                                              src: __$_require_static_images_leaflet_icons_download_bule_png__,
                                            },
                                          }),
                                          _vm._v("立即下载\n                "),
                                        ]),
                                      ]
                                    )
                                  : _vm._e(),
                              ]),
                            ]
                          ),
                        ],
                  ],
                  2
                )
              : _vm._e(),
            _vm._v(" "),
            _vm.blockData.styleMode == "B"
              ? _c(
                  "div",
                  [
                    _vm.blockData.resourceSetList &&
                    _vm.blockData.resourceSetList.length
                      ? _vm._l(
                          _vm.blockData.resourceSetList,
                          function (item, index) {
                            return _c(
                              "div",
                              {
                                key: index,
                                staticClass:
                                  "style-mode__item--body xml-group-item",
                              },
                              [
                                _c("div", { staticClass: "right" }, [
                                  _c(
                                    "div",
                                    {
                                      staticClass: "title",
                                      on: {
                                        click: function ($event) {
                                          return _vm.previewToPathClick(item)
                                        },
                                      },
                                    },
                                    [
                                      _c("img", {
                                        attrs: {
                                          src: __$_require_static_images_leaflet_icons_resource_icon_png__,
                                          alt: "",
                                        },
                                      }),
                                      _vm._v(" "),
                                      _c(
                                        "span",
                                        { staticClass: "xml-resource-title" },
                                        [
                                          _vm._v(
                                            _vm._s(
                                              item.title
                                                ? item.title
                                                : "资源样例"
                                            )
                                          ),
                                        ]
                                      ),
                                    ]
                                  ),
                                  _vm._v(" "),
                                  _c("div", { staticClass: "downloadbtn" }, [
                                    _vm.blockData.resourceType == "0" &&
                                    item.source != ""
                                      ? _c(
                                          "div",
                                          {
                                            staticClass: "pointer",
                                            on: {
                                              click: function ($event) {
                                                return _vm.downloadFileUrl(
                                                  item,
                                                  item.title +
                                                    "." +
                                                    item.fileFormat
                                                )
                                              },
                                            },
                                          },
                                          [
                                            _c("img", {
                                              staticClass:
                                                "shop-item-img-resource",
                                              attrs: {
                                                src: __$_require_static_images_leaflet_icons_download_bule_png__,
                                              },
                                            }),
                                            _vm._v(
                                              "立即下载\n                "
                                            ),
                                          ]
                                        )
                                      : _vm._e(),
                                  ]),
                                ]),
                                _vm._v(" "),
                                _c("div", { staticClass: "left" }, [
                                  _c(
                                    "div",
                                    {
                                      staticClass: "default-cover",
                                      on: {
                                        click: function ($event) {
                                          return _vm.previewToPathClick(item)
                                        },
                                      },
                                    },
                                    [
                                      _c("el-image", {
                                        staticClass:
                                          "shop-item-img-resource xml-round-6",
                                        attrs: {
                                          src: item.coverFileUrl
                                            ? item.coverFileUrl.indexOf(
                                                "./"
                                              ) !== -1
                                              ? _vm.resourceBasisPath +
                                                item.coverFileUrl.split("./")[1]
                                              : item.coverFileUrl
                                            : __$_require_static_images_default_over_resource_png__,
                                        },
                                      }),
                                    ],
                                    1
                                  ),
                                  _vm._v(" "),
                                  _c(
                                    "div",
                                    { staticClass: "cover-bot-elliptic" },
                                    [
                                      _c("img", {
                                        attrs: {
                                          src: __$_require_static_images_leaflet_icons_resource_elliptic_png__,
                                          alt: "",
                                        },
                                      }),
                                    ]
                                  ),
                                ]),
                              ]
                            )
                          }
                        )
                      : [
                          _c(
                            "div",
                            {
                              staticClass:
                                "style-mode__item--body xml-group-item",
                            },
                            [
                              _c("div", { staticClass: "right" }, [
                                _c("div", { staticClass: "title" }, [
                                  _c("img", {
                                    attrs: {
                                      src: __$_require_static_images_leaflet_icons_resource_icon_png__,
                                      alt: "",
                                    },
                                  }),
                                  _vm._v("资源名称\n              "),
                                ]),
                                _vm._v(" "),
                                _c("div", { staticClass: "downloadbtn" }, [
                                  _vm.blockData.resourceType == "0"
                                    ? _c("div", [
                                        _c("img", {
                                          staticClass: "shop-item-img-resource",
                                          attrs: {
                                            src: __$_require_static_images_leaflet_icons_download_bule_png__,
                                          },
                                        }),
                                        _vm._v("立即下载\n                "),
                                      ])
                                    : _vm._e(),
                                ]),
                              ]),
                              _vm._v(" "),
                              _c("div", { staticClass: "left" }, [
                                _c("div", { staticClass: "default-cover" }, [
                                  _c("img", {
                                    staticClass: "shop-item-img-resource",
                                    attrs: {
                                      src: __$_require_static_images_default_over_resource_png__,
                                    },
                                  }),
                                ]),
                                _vm._v(" "),
                                _c(
                                  "div",
                                  { staticClass: "cover-bot-elliptic" },
                                  [
                                    _c("img", {
                                      attrs: {
                                        src: __$_require_static_images_leaflet_icons_resource_elliptic_png__,
                                        alt: "",
                                      },
                                    }),
                                  ]
                                ),
                              ]),
                            ]
                          ),
                        ],
                  ],
                  2
                )
              : _vm._e(),
            _vm._v(" "),
            _vm.blockData.styleMode == "C"
              ? _c(
                  "div",
                  [
                    _vm.blockData.resourceSetList &&
                    _vm.blockData.resourceSetList.length
                      ? [
                          _c(
                            "div",
                            { staticClass: "style-mode__item--body" },
                            [
                              _c(
                                "el-row",
                                _vm._l(
                                  _vm.blockData.resourceSetList,
                                  function (item, index) {
                                    return _c(
                                      "el-col",
                                      { key: index, attrs: { span: 6 } },
                                      [
                                        _c(
                                          "div",
                                          {
                                            staticClass:
                                              "filecard xml-group-item",
                                          },
                                          [
                                            _c(
                                              "div",
                                              { staticClass: "default-cover" },
                                              [
                                                _c("el-image", {
                                                  staticClass:
                                                    "shop-item-img-resource xml-round-6",
                                                  attrs: {
                                                    src: item.coverFileUrl
                                                      ? item.coverFileUrl.indexOf(
                                                          "./"
                                                        ) !== -1
                                                        ? _vm.resourceBasisPath +
                                                          item.coverFileUrl.split(
                                                            "./"
                                                          )[1]
                                                        : item.coverFileUrl
                                                      : __$_require_static_images_default_over_resource_png__,
                                                  },
                                                }),
                                                _vm._v(" "),
                                                _vm.blockData.resourceType ==
                                                  "0" && item.source != ""
                                                  ? _c(
                                                      "div",
                                                      {
                                                        staticClass:
                                                          "downloadmask pointer",
                                                        on: {
                                                          click: function (
                                                            $event
                                                          ) {
                                                            return _vm.downloadFileUrl(
                                                              item,
                                                              item.title +
                                                                "." +
                                                                item.fileFormat
                                                            )
                                                          },
                                                        },
                                                      },
                                                      [
                                                        _c("img", {
                                                          staticClass:
                                                            "shop-item-img-resource",
                                                          attrs: {
                                                            src: __$_require_static_images_leaflet_icons_download_white_png__,
                                                          },
                                                        }),
                                                        _vm._v(
                                                          "\n                      立即下载\n                    "
                                                        ),
                                                      ]
                                                    )
                                                  : _vm._e(),
                                              ],
                                              1
                                            ),
                                            _vm._v(" "),
                                            _c(
                                              "div",
                                              {
                                                staticClass:
                                                  "xml-resource-title filename",
                                                on: {
                                                  click: function ($event) {
                                                    return _vm.previewToPathClick(
                                                      item
                                                    )
                                                  },
                                                },
                                              },
                                              [
                                                _vm._v(
                                                  "\n                    " +
                                                    _vm._s(
                                                      item.title
                                                        ? item.title
                                                        : "资源样例"
                                                    ) +
                                                    "\n                  "
                                                ),
                                              ]
                                            ),
                                          ]
                                        ),
                                      ]
                                    )
                                  }
                                ),
                                1
                              ),
                            ],
                            1
                          ),
                        ]
                      : [
                          _c(
                            "div",
                            { staticClass: "style-mode__item--body" },
                            [
                              _c(
                                "el-row",
                                [
                                  _c("el-col", { attrs: { span: 8 } }, [
                                    _c(
                                      "div",
                                      {
                                        staticClass: "filecard xml-group-item",
                                      },
                                      [
                                        _c(
                                          "div",
                                          { staticClass: "default-cover" },
                                          [
                                            _c("img", {
                                              staticClass:
                                                "shop-item-img-resource",
                                              attrs: {
                                                src: __$_require_static_images_default_over_resource_png__,
                                              },
                                            }),
                                            _vm._v(" "),
                                            _vm.blockData.resourceType == "0"
                                              ? _c(
                                                  "div",
                                                  {
                                                    staticClass: "downloadmask",
                                                  },
                                                  [
                                                    _c("img", {
                                                      staticClass:
                                                        "shop-item-img-resource",
                                                      attrs: {
                                                        src: __$_require_static_images_leaflet_icons_download_white_png__,
                                                      },
                                                    }),
                                                    _vm._v(
                                                      "\n                      立即下载\n                    "
                                                    ),
                                                  ]
                                                )
                                              : _vm._e(),
                                          ]
                                        ),
                                        _vm._v(" "),
                                        _c("div", { staticClass: "filename" }, [
                                          _vm._v(
                                            "资源名称资源名称资源名称资源名称资源名称"
                                          ),
                                        ]),
                                      ]
                                    ),
                                  ]),
                                ],
                                1
                              ),
                            ],
                            1
                          ),
                        ],
                  ],
                  2
                )
              : _vm._e(),
          ]
        ),
      ]),
    ]
  )
};
var __vue_staticRenderFns__ = [
  function () {
    var _vm = this;
    var _h = _vm.$createElement;
    var _c = _vm._self._c || _h;
    return _c("div", [
      _c("div", { staticClass: "shop-item-desc-title" }, [_vm._v("资源样例")]),
      _vm._v(" "),
      _c("div", { staticClass: "shop-item-desc-detail" }, [
        _vm._v("文件格式：无"),
      ]),
      _vm._v(" "),
      _c("div", { staticClass: "shop-item-desc-detail" }, [
        _vm._v("文件大小：0"),
      ]),
    ])
  },
];
__vue_render__._withStripped = true;

  /* style */
  const __vue_inject_styles__ = undefined;
  /* scoped */
  const __vue_scope_id__ = "data-v-2be4d8c2";
  /* module identifier */
  const __vue_module_identifier__ = undefined;
  /* functional template */
  const __vue_is_functional_template__ = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__ = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
    __vue_inject_styles__,
    __vue_script__,
    __vue_scope_id__,
    __vue_is_functional_template__,
    __vue_module_identifier__,
    false,
    undefined,
    undefined,
    undefined
  );

let componentNamespace = 'xml';
// 组件前缀命名只能更新一次，防止重复执行修改组件注册出错
let isUpdated = false;
function createNamespace(name, {
  prefix,
  isUnPrefix
}) {
  let useNamespace;
  if (!isUpdated) {
    isUpdated = true;
    useNamespace = prefix || componentNamespace; // 更改前缀
  }
  if (prefix) {
    if (name.indexOf(componentNamespace) === 0) {
      return name.replace(componentNamespace, prefix);
    }
    return useNamespace.charAt(0).toUpperCase() + useNamespace.substr(1) + name;
  }
  if (name.indexOf(componentNamespace) === 0 || name.indexOf(componentNamespace.charAt(0).toUpperCase()) === 0) {
    return name.charAt(0).toUpperCase() + name.substr(1);
  }
  return isUnPrefix ? name.charAt(0).toLowerCase() + name.substr(1) : componentNamespace + name.charAt(0).toUpperCase() + name.substr(1);
}

__vue_component__.install = (Vue, options = {}) => {
  Vue.component(createNamespace('resource-render', {
    prefix: options.prefix
  }), __vue_component__);
};

export { __vue_component__ as default };
