Procházet zdrojové kódy

Merge branch '17025' of http://119.23.210.103:3000/wy/lh_firm_former into 17025

wy před 1 rokem
rodič
revize
ce3ffca018

+ 2 - 1
src/business/platform/cat/type/tree.vue

@@ -124,8 +124,9 @@ export default {
     methods: {
         loadTreeData () {
             findTreeData({ categoryKey: this.categoryKey }).then(response => {
-                const data = response.data || []
+                this.treeData = response.data || []
                 if (this.hasPermission) {
+                    const data = response.data || []
                     // this.treeData = this.treeData.filter(i => i.isShow !== '1')
                     // 处理isShow,父级节点不显示子节点都不显示
                     const noData = data.filter(item => item.isShow === '1')

+ 4 - 0
src/business/platform/data/constants/buttons.js

@@ -74,6 +74,10 @@ const buttons = {
         icon: 'ibps-icon-export',
         scope: ['toolbar'],
         menus: [
+            {
+                label: '导出模板',
+                key: 'exportTemplate'
+            },
             {
                 label: '导出选中',
                 key: 'exportSelected'

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

@@ -290,12 +290,10 @@
             :download="false"
             :readonly="true"
         />
-        <on-line-index :groove-data="grooveData" :groove-list="grooveList" :dialog-visible.sync="grooveDialogVisible" style="z-index: 9999;" />
 
     </div>
 </template>
 <script>
-import onLineIndex from '@/views/onLineEditing/onLineIndex'
 
 import { queryDataTable, removeFormData, exportData, checkExportData } from '@/api/platform/data/dataTemplate'
 import { startFlowFromList } from '@/api/platform/bpmn/bpmInst'
@@ -366,8 +364,7 @@ export default {
         Print: () => import('../components/print'),
         LabelPrint: () => import('../components/labelPrint'),
         xlsxFile,
-        generalModules,
-        onLineIndex
+        generalModules
 
         // BpmnFormrender
         // DataTemplateFormat
@@ -1024,6 +1021,7 @@ export default {
                 let src = ''
                 this.readonly = false
                 const { userId } = this.$store.getters || {}
+                const [path, ...rest] = button.reportPath.split('&') || []
                 switch (buttonType) {
                     case 'search': // 查询
                         ActionUtils.setFirstPagination(this.pagination)
@@ -1091,7 +1089,7 @@ export default {
                             if (!button.reportPath) {
                                 return this.$message.warning('请先配置对应报表路径!')
                             }
-                            src = this.$reportPath.replace('show', 'pdf') + button.reportPath.split('&')[0] + `&` + this.getReportParams(button.reportPath, selection, data)
+                            src = this.$reportPath.replace('show', 'pdf') + path + this.getReportParams(rest, selection, data)
                             this.$common.preview(this, src)
                         }
                         break
@@ -1100,7 +1098,7 @@ export default {
                             return this.$message.warning('请先配置对应报表路径!')
                         }
                         this.$common.snapshoot({
-                            url: this.$getReportFile(button.reportPath.split('&')[0], this.getReportParams(button.reportPath, selection, data)),
+                            url: this.$getReportFile(path, this.getReportParams(rest, selection, data)),
                             name: selection,
                             type: 'pdf'
                         }).then((res) => {
@@ -1360,26 +1358,7 @@ export default {
                 rowHandle: rowHandle,
                 searchForm: searchForms.length > 0 ? { forms: searchForms } : null
             }
-            // 判断地点是否第一层级
-            const position = this.$store.getters.userInfo.positions
-            let showBoolean = false
-            if (position && position.length > 0 && this.first) {
-                showBoolean = position.some((item) => item.id === this.first)
-            }
-            const columnsShow = this.listConfig.columns.some((item) => item.prop === 'di_dian_')
-            if (!showBoolean && columnsShow) {
-                this.listConfig.columns.forEach((item) => {
-                    if (item.prop === 'di_dian_') {
-                        item.hidden = true
-                    }
-                })
-            } else {
-                this.listConfig.columns.forEach((item) => {
-                    if (item.prop === 'di_dian_') {
-                        item.hidden = false
-                    }
-                })
-            }
+
             // 分页
             this.showPagination = this.template.attrs ? this.template.attrs.need_page === 'Y' : true
             this.pagination.limit = this.template.attrs ? parseInt(this.template.attrs.page_size, 10) || 20 : 20
@@ -2051,23 +2030,35 @@ export default {
             // conso
             this.handleAction(buttonTypeAct, buttonAct.position, selectAct, dataAct, indexAct, buttonAct)
         },
-        getReportParams (path, selection, data) {
-            /**
-             * 1、原报表路径:安全管理/紫外灯辐照度值测定记录表.rpx
-             * 2、补充报表路径:安全管理/紫外灯辐照度值测定记录表.rpx&id_=id_
-             * 2-1、最后那么id_表示在列上的字段属性,增加报表传参的便捷性;
-             * 2-2、有些列表需要展示的是子表的数据,但是报表需要展示的是主表数据,列表唯一字段只能是子表id_,所以主表的id_就不能也叫id_;
-             * 2-3、受限于报表快照生成的参数获取,当前只补充关于id_的逻辑;
-             */
-            const str = `org_=${this.orgId}&id_=`
-            const arr = path.split('&')
-            if (arr.length === 2) {
-                const fieldArr = arr[1].split('=')
-                return str + `${data[fieldArr[1]]}`
-            } else {
-                // 如果是没有传参,还是原报表路径
-                return str + `${selection}`
+        getReportParams (args, selection, data) {
+            const defaultParams = {
+                org_: this.first,
+                second_: this.second,
+                id_: selection
             }
+            // 无额外参数时直接返回默认参数字符串
+            if (!args || !args.length) {
+                return this.serializeParams(defaultParams)
+            }
+
+            // 解析额外参数,覆盖默认参数
+            const finalParams = args.reduce((acc, item) => {
+                const [key, field] = item.split('=') || []
+                // 无效参数跳过
+                if (!key || !field) return acc
+
+                // 若data中获取不到字段值,可能传参为值并非字段
+                const value = data[field] || field
+                if (this.$utils.isNotEmpty(value)) {
+                    // 同名参数覆盖
+                    acc[key] = value
+                }
+                return acc
+            }, { ...defaultParams })
+            return this.serializeParams(finalParams)
+        },
+        serializeParams (params) {
+            return '&' + Object.entries(params).map(([key, value]) => `${key}=${encodeURIComponent(value)}`).join('&')
         }
     }
 }

+ 4 - 4
src/views/infosManage/fileIE.vue

@@ -304,7 +304,7 @@ export default {
             this.listConfig.toolbars.push({ key: 'remove' })
             this.selection = true
         }
-        if (this.pageKey === 'nbwj') {
+        if (this.pageKey === 'skwjcy') {
             this.listConfig.searchForm.forms = [
                 { prop: 'wen_jian_bian_hao', label: '文件编号' },
                 { prop: 'wen_jian_ming_che', label: '文件名称' }
@@ -477,7 +477,7 @@ export default {
             }
             // fileType存放文件的id和有孩子的id
             if (fileType) {
-                if (this.pageKey === 'nbwj') {
+                if (this.pageKey === 'skwjcy') {
                     if (comAuthority.length !== 0) {
                         wheres1 =
                             wheres1 +
@@ -594,7 +594,7 @@ export default {
             const sqlArr = [comSql, buMenSql, authoritySql]
             let oldRecordSql = ''
             const buMenWhere = []
-            if (this.pageKey !== 'nbwj') {
+            if (this.pageKey !== 'skwjcy') {
                 if (this.$store.getters.deptList.length !== 0) {
                     // eslint-disable-next-line no-redeclare
                     if (this.pos) {
@@ -633,7 +633,7 @@ export default {
             const fileSearchSql = needSelType.join('union all')
             // ` order by  ${sorts.sortBy}  ${sorts.order === 'ascending' ? 'asc' : 'desc'}`
             const sql =
-                this.pageKey === 'nbwj'
+                this.pageKey === 'skwjcy'
                     ? `select sq.id,sq.cy_id_,sq.sc_id_,sq.shu_ju_lai_yuan_,sq.file_info_,sq.wen_jian_xi_lei_,sq.wen_jian_bian_hao,sq.wen_jian_ming_che,sq.ban_ben_,sq.ext_,sq.file_path_,COALESCE(wjxz.gai_zhang_fu_jian,sq.fu_jian_) AS fu_jian_,sq.fa_fang_shi_jian_,sq.cha_yue_jie_zhi_s from (${fileSearchSql}) sq LEFT JOIN t_wjxzxdjlb wjxz ON sq.shu_ju_lai_yuan_ = wjxz.id_ ORDER BY sq.wen_jian_bian_hao ${ascDesc},sq.wen_jian_ming_che DESC`
                     : oldRecordSql
             // console.log(sql, 'sssssssssssssssssss')