Ver Fonte

去掉示例按钮

tianxinyu há 2 semanas atrás
pai
commit
18833cf047

+ 90 - 90
src/business/platform/data/templaterender/templates/list.vue

@@ -595,11 +595,11 @@ export default {
     setting() {
       return this.$store.getters.setting
     },
-    exampleList() {
-      return this.$store.getters.exampleList
-        ? this.$store.getters.exampleList.filter((t) => t)
-        : []
-    }
+    // exampleList() {
+    //   return this.$store.getters.exampleList
+    //     ? this.$store.getters.exampleList.filter((t) => t)
+    //     : []
+    // }
   },
   watch: {
     value: {
@@ -712,23 +712,23 @@ export default {
       this.key = pkKey
     },
     initUI() {
-      const item =
-        this.template &&
-        this.exampleList &&
-        this.exampleList.find(
-          (t) =>
-            t.DEFAULT_URL_ && t.DEFAULT_URL_.includes(this.template.template_id)
-        )
-      console.log('this.exampleList==>', this.template, item)
-      if (item) {
-        if (this.template.attrs) {
-          this.template.attrs.formExample = item.shi_li_shang_chua || ''
-        } else {
-          this.template.attrs = {
-            formExample: item.shi_li_shang_chua || ''
-          }
-        }
-      }
+      // const item =
+      //   this.template &&
+      //   this.exampleList &&
+      //   this.exampleList.find(
+      //     (t) =>
+      //       t.DEFAULT_URL_ && t.DEFAULT_URL_.includes(this.template.template_id)
+      //   )
+      // console.log('this.exampleList==>', this.template, item)
+      // if (item) {
+      //   if (this.template.attrs) {
+      //     this.template.attrs.formExample = item.shi_li_shang_chua || ''
+      //   } else {
+      //     this.template.attrs = {
+      //       formExample: item.shi_li_shang_chua || ''
+      //     }
+      //   }
+      // }
       this.initialization = false
       if (!this.initialization) {
         this.initJTemplate()
@@ -1337,51 +1337,51 @@ export default {
             break
           case 'custom': // 自定义按钮
             break
-          case 'example': // 示例
-            const { data: data1 } = await this.getRemoteByIdFunc(
-              this.template.attrs.formExample
-            )
-            console.log('data---->', data1)
-            if (fileTypes.images.includes(data1.ext)) {
-              this.file = data1
-              this.filePreviewVisible2 = false
-              this.filePreviewVisible = true
-            } else if (data1.ext === 'pdf' || data1.ext === 'PDF') {
-              this.$nextTick(() => {
-                const newTab = window.open()
-                const link = newTab.document.createElement('link')
-                const url =
-                  BASE_API() +
-                  SYSTEM_URL() +
-                  '/file/download?attachmentId=' +
-                  data1.id
-                const hasRole = localStorage.getItem('hasHighRole') || 0
-                link.rel = 'shortcut icon'
-                link.type = 'image/x-icon'
-                link.href = 'favicon.ico'
-                // newTab.document.write('<link rel="icon" type="image/x-icon" href="favicon.ico">')
-                newTab.document.write(
-                  `<title>文件预览页-${data1.fileName}</title>`
-                )
-                newTab.document.write('<style>body { margin: 0px; }</style>')
-                newTab.document.head.appendChild(link)
-                newTab.document.write(
-                  `<iframe src="${
-                    this.$baseUrl
-                  }lib/pdfjs-dist/web/viewer.html?file=${encodeURIComponent(
-                    url
-                  )}&hasRole=${hasRole}" style="width:100%; height:100%;" frameborder="0";>`
-                )
-              })
-            } else {
-              this.file.url = `${this.$onlyofficeApi}/file/download?attachmentId=${data1.id}`
-              this.file.editUrl = `${this.$onlyofficeApi}/file/editCallback?fileName=${data1.fileName}&fileType=${data1.ext}&id=${data1.id}`
-              this.file.title = data1.fileName // 文件名称
-              this.file.fileType = data1.ext // 类型
-              this.filePreviewVisible = false
-              this.filePreviewVisible2 = true
-            }
-            break
+          // case 'example': // 示例
+          //   const { data: data1 } = await this.getRemoteByIdFunc(
+          //     this.template.attrs.formExample
+          //   )
+          //   console.log('data---->', data1)
+          //   if (fileTypes.images.includes(data1.ext)) {
+          //     this.file = data1
+          //     this.filePreviewVisible2 = false
+          //     this.filePreviewVisible = true
+          //   } else if (data1.ext === 'pdf' || data1.ext === 'PDF') {
+          //     this.$nextTick(() => {
+          //       const newTab = window.open()
+          //       const link = newTab.document.createElement('link')
+          //       const url =
+          //         BASE_API() +
+          //         SYSTEM_URL() +
+          //         '/file/download?attachmentId=' +
+          //         data1.id
+          //       const hasRole = localStorage.getItem('hasHighRole') || 0
+          //       link.rel = 'shortcut icon'
+          //       link.type = 'image/x-icon'
+          //       link.href = 'favicon.ico'
+          //       // newTab.document.write('<link rel="icon" type="image/x-icon" href="favicon.ico">')
+          //       newTab.document.write(
+          //         `<title>文件预览页-${data1.fileName}</title>`
+          //       )
+          //       newTab.document.write('<style>body { margin: 0px; }</style>')
+          //       newTab.document.head.appendChild(link)
+          //       newTab.document.write(
+          //         `<iframe src="${
+          //           this.$baseUrl
+          //         }lib/pdfjs-dist/web/viewer.html?file=${encodeURIComponent(
+          //           url
+          //         )}&hasRole=${hasRole}" style="width:100%; height:100%;" frameborder="0";>`
+          //       )
+          //     })
+          //   } else {
+          //     this.file.url = `${this.$onlyofficeApi}/file/download?attachmentId=${data1.id}`
+          //     this.file.editUrl = `${this.$onlyofficeApi}/file/editCallback?fileName=${data1.fileName}&fileType=${data1.ext}&id=${data1.id}`
+          //     this.file.title = data1.fileName // 文件名称
+          //     this.file.fileType = data1.ext // 类型
+          //     this.filePreviewVisible = false
+          //     this.filePreviewVisible2 = true
+          //   }
+          //   break
           case 'openTask': // 编制,开启对应流程
             if (!button.deflow) {
               return this.$message.warning('请先配置对应流程!')
@@ -1717,29 +1717,29 @@ export default {
       // 显示字段
       const columns = []
       this.setDisplayColumns(this.template.display_columns || [], columns)
-      if (
-        this.setting &&
-        this.setting.system &&
-        this.setting.system.exampleButton &&
-        this.template.attrs &&
-        this.template.attrs.formExample
-      ) {
-        toolbarButtons.push({
-          $index: toolbarButtons.length,
-          key: 'example',
-          button_type: 'example',
-          code: 'example',
-          label: '示例',
-          icon: 'el-icon-view',
-          type: 'warning',
-          deflow: null,
-          isEditOnHis: false,
-          initAddDataCont: null,
-          disabled: false,
-          hidden: false,
-          position: 'toolbar'
-        })
-      }
+      // if (
+      //   this.setting &&
+      //   this.setting.system &&
+      //   this.setting.system.exampleButton &&
+      //   this.template.attrs &&
+      //   this.template.attrs.formExample
+      // ) {
+      //   toolbarButtons.push({
+      //     $index: toolbarButtons.length,
+      //     key: 'example',
+      //     button_type: 'example',
+      //     code: 'example',
+      //     label: '示例',
+      //     icon: 'el-icon-view',
+      //     type: 'warning',
+      //     deflow: null,
+      //     isEditOnHis: false,
+      //     initAddDataCont: null,
+      //     disabled: false,
+      //     hidden: false,
+      //     position: 'toolbar'
+      //   })
+      // }
       this.listConfig = {
         toolbars: toolbarButtons,
         columns: columns,

+ 2 - 2
src/store/getters.js

@@ -96,6 +96,6 @@ export default {
   setting: (state) =>
     state.ibps.param && state.ibps.param.setting ? state.ibps.param.setting : {},
   // 获取示例列表
-  exampleList: (state) =>
-    state.ibps.page && state.ibps.page.exampleList ? state.ibps.page.exampleList : []
+  // exampleList: (state) =>
+  //   state.ibps.page && state.ibps.page.exampleList ? state.ibps.page.exampleList : []
 }

+ 22 - 22
src/store/modules/ibps/modules/page.js

@@ -23,7 +23,7 @@ export default {
     // 需要缓存的页面 name
     keepAlive: [],
     // 当前页面示例集合
-    exampleList: []
+    // exampleList: []
   },
   actions: {
     /**
@@ -40,24 +40,24 @@ export default {
         }, 10)
       })
     },
-    getExampleList({ commit }) {
-      common
-        .request('query', {
-          key: 'getFormAttr',
-          params: [null]
-        })
-        .then((res) => {
-          const { data = [] } = res.variables || {}
-          commit('setExampleList', data)
-          // dispatch('ibps/param/setUserList', data, {
-          //   root: true
-          // })
-        })
-        .catch((error) => {
-          console.log(error)
-          alert('获取所有用户信息失败!')
-        })
-    },
+    // getExampleList({ commit }) {
+    //   common
+    //     .request('query', {
+    //       key: 'getFormAttr',
+    //       params: [null]
+    //     })
+    //     .then((res) => {
+    //       const { data = [] } = res.variables || {}
+    //       commit('setExampleList', data)
+    //       // dispatch('ibps/param/setUserList', data, {
+    //       //   root: true
+    //       // })
+    //     })
+    //     .catch((error) => {
+    //       console.log(error)
+    //       alert('获取所有用户信息失败!')
+    //     })
+    // },
     /**
      * @class opened
      * @description 从持久化数据载入标签页列表
@@ -455,9 +455,9 @@ export default {
         .filter((item) => isKeepAlive(item))
         .map((e) => e.name)
     },
-    setExampleList(state, data) {
-      state.exampleList = data
-    },
+    // setExampleList(state, data) {
+    //   state.exampleList = data
+    // },
     /**
      * @description 删除一个页面的缓存设置
      * @param {Object} state state

+ 1 - 1
src/store/modules/ibps/modules/user.js

@@ -140,7 +140,7 @@ export default {
                 await dispatch('getUserList', level)
                 // 获取所有部门信息
                 await dispatch('getDeptList', level)
-                await dispatch('ibps/page/getExampleList', null, { root: true })
+                // await dispatch('ibps/page/getExampleList', null, { root: true })
                 // 获取当前子系统
                 await dispatch('ibps/system/loadSystem', null, {
                   root: true

+ 8 - 8
src/views/business/deviceManagement/components/barCharto.vue

@@ -80,16 +80,16 @@ export default {
       },
       correspondenceCondition: {
         // numAll: '设备总数',
-        numLimit: '限用',
-        numR: '使用',
-        numScrap: '报废',
-        numS: '停用'
+        // numLimit: '限用',
+        numR: '正常使用',
+        numScrap: '停止使用',
+        numS: '使用'
       },
       dynamicMappingCondition: {
-        限用: '限用数',
-        使用: '使用数',
-        报废: '报废数',
-        停用: '停用数'
+        // 限用: '限用数',
+        正常使用: '正常使用数',
+        停止使用: '停止使用数',
+        使用: '使用数'
       },
       // color: ['rgb(78,203,115)', 'rgb(251,211,55)', 'rgb(16,142,233)']
       color: ['#5470c6', '#339933', '#FF0033', 'rgb(251,211,55)'],

+ 1 - 1
src/views/component/device/index.vue

@@ -806,7 +806,7 @@ export default {
           ? '设备编号(必填,且不可重复)'
           : '原设备编号(必填,且不可重复)',
         sheBeiZhuangTa: '设备状态(正常使用/暂停使用/停止使用)',
-        sheBeiLeiXing: setting?.syatem?.isJYB ?  '设备类型(检验系统/通用设备/软件/信息系统)' : '设备类型(检测设备/辅助仪器设备/信息系统/环境监测设备)',
+        sheBeiLeiXing: setting?.system?.isJYB ?  '设备类型(检验系统/通用设备/软件/信息系统)' : '设备类型(检测设备/辅助仪器设备/信息系统/环境监测设备)',
         shiFouWeiHu: '是否维护(是/否)',
         shiFouXiaoZhun: '是否校准(是/否)',
         weiHuFangShi: '岗位/分组',