Просмотр исходного кода

update 地点在第一层级显示

linweizeng 2 лет назад
Родитель
Сommit
7c566c2607
1 измененных файлов с 58 добавлено и 30 удалено
  1. 58 30
      src/business/platform/data/templaterender/templates/list.vue

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

@@ -759,22 +759,26 @@ export default {
                             .catch(() => {})
                         break
                     case 'sefStartFlow': // 启动自定义流程
-                        ActionUtils.selectedMultiRecord(selection).then((ids) => {
-                            if (button.deflow) {
-                                this.$confirm('确定启动流程吗?', '消息', {
-                                    confirmButtonText: '确定',
-                                    cancelButtonText: '取消',
-                                    type: 'warning'
-                                }).then(() => {
-                                    this.$message.success('流程任务正在[异步操作]启动中...(期间可做其它操作!)')
-                                    this.handleStartFlowFromList(ids, button.deflow, this.getFormKey())
-                                }).catch(() => {})
-                            } else {
-                                this.dialogVisible = true
-                                this.dialogValue = {}
-                                this.sefStartFlowId = ids
-                            }
-                        }).catch(() => {})
+                        ActionUtils.selectedMultiRecord(selection)
+                            .then((ids) => {
+                                if (button.deflow) {
+                                    this.$confirm('确定启动流程吗?', '消息', {
+                                        confirmButtonText: '确定',
+                                        cancelButtonText: '取消',
+                                        type: 'warning'
+                                    })
+                                        .then(() => {
+                                            this.$message.success('流程任务正在[异步操作]启动中...(期间可做其它操作!)')
+                                            this.handleStartFlowFromList(ids, button.deflow, this.getFormKey())
+                                        })
+                                        .catch(() => {})
+                                } else {
+                                    this.dialogVisible = true
+                                    this.dialogValue = {}
+                                    this.sefStartFlowId = ids
+                                }
+                            })
+                            .catch(() => {})
                         break
                     case 'custom': // 自定义按钮
                         break
@@ -801,17 +805,19 @@ export default {
                             this.$message.warning('请先配置对应报表路径!')
                             return
                         }
-                        this.$common.snapshoot({
-                            url: this.$getReportFile(button.reportPath, `id_=${selection}`),
-                            name: selection,
-                            type: 'pdf'
-                        }).then(res => {
-                            if (!res.data || !res.data.id) {
-                                this.$message.error('生成文件失败,请重试!')
-                                return
-                            }
-                            this.$common.download(res.data)
-                        })
+                        this.$common
+                            .snapshoot({
+                                url: this.$getReportFile(button.reportPath, `id_=${selection}`),
+                                name: selection,
+                                type: 'pdf'
+                            })
+                            .then((res) => {
+                                if (!res.data || !res.data.id) {
+                                    this.$message.error('生成文件失败,请重试!')
+                                    return
+                                }
+                                this.$common.download(res.data)
+                            })
                         break
                     case 'print': // 打印
                         ActionUtils.selectedRecord(selection)
@@ -1076,6 +1082,28 @@ export default {
                 searchForm: searchForms.length > 0 ? { forms: searchForms } : null
             }
 
+            // 判断地点是否第一层级,如果是显示地点字段
+            const position = this.$store.getters.userInfo.positions
+            const first = this.$store.getters.level.first
+            let showBoolean = false
+            if (position && position.length > 0 && first) {
+                showBoolean = position.some((item) => item.id === 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
@@ -1524,14 +1552,14 @@ export default {
                     obj[item.label] = item.name
                 })
                 return obj
-            }else{
+            } else {
                 return obj
             }
         },
-        xlsxFileClick(){
+        xlsxFileClick() {
             this.xlsxFileVisible = true
         },
-        xlsxFileClose(){
+        xlsxFileClose() {
             this.xlsxFileVisible = false
         },