فهرست منبع

fix:补充在数据模板设置列表按钮在归档时是否显示的逻辑

liujiayin 2 سال پیش
والد
کامیت
5d2e76d551

+ 118 - 117
src/business/platform/data/templatebuilder/right-aside/editors/editor-button.vue

@@ -31,8 +31,7 @@
                     v-for="t in positionType"
                     v-for="t in positionType"
                     :key="t.value"
                     :key="t.value"
                     :label="t.value"
                     :label="t.value"
-                    >{{ t.label }}</el-radio-button
-                >
+                >{{ t.label }}</el-radio-button>
             </el-radio-group>
             </el-radio-group>
         </el-form-item>
         </el-form-item>
         <el-form-item label="按钮颜色" prop="style">
         <el-form-item label="按钮颜色" prop="style">
@@ -47,14 +46,16 @@
                         :underline="false"
                         :underline="false"
                         :type="item.type"
                         :type="item.type"
                         style="float: left;"
                         style="float: left;"
-                        >{{ item.label }}</el-link
-                    >
+                    >{{ item.label }}</el-link>
                 </el-option>
                 </el-option>
             </el-select>
             </el-select>
         </el-form-item>
         </el-form-item>
         <el-form-item label="按钮图标" prop="icon">
         <el-form-item label="按钮图标" prop="icon">
             <ibps-icon-select v-model="formData.icon" icon="el-icon-search" />
             <ibps-icon-select v-model="formData.icon" icon="el-icon-search" />
         </el-form-item>
         </el-form-item>
+        <el-form-item label="模板归档显示">
+            <el-switch v-model="formData.show_on_record" active-value="Y" inactive-value="N" />
+        </el-form-item>
         <el-form-item
         <el-form-item
             v-if="formData && formData.button_type === 'export'"
             v-if="formData && formData.button_type === 'export'"
             label="导出字段"
             label="导出字段"
@@ -99,131 +100,131 @@
     </el-form>
     </el-form>
 </template>
 </template>
 <script>
 <script>
-    import { hasPermission } from '@/business/platform/data/constants/buttons'
-    import BpmDefSelector from '@/business/platform/bpmn/definition/selector'
-    import RightsSelector from '@/business/platform/rights/config/selector'
-    import ExportColumn from '../components/export-column'
+import { hasPermission } from '@/business/platform/data/constants/buttons'
+import BpmDefSelector from '@/business/platform/bpmn/definition/selector'
+import RightsSelector from '@/business/platform/rights/config/selector'
+import ExportColumn from '../components/export-column'
 
 
-    export default {
-        components: {
-            RightsSelector,
-            BpmDefSelector,
-            ExportColumn
+export default {
+    components: {
+        RightsSelector,
+        BpmDefSelector,
+        ExportColumn
+    },
+    props: {
+        data: {
+            type: Object
         },
         },
-        props: {
-            data: {
-                type: Object
-            },
-            template: {
-                type: Object
+        template: {
+            type: Object
+        },
+        formKey: String,
+        type: {
+            type: String,
+            default: 'function'
+        }
+    },
+    data () {
+        return {
+            colors: [
+                { type: 'default', label: '默认' },
+                { type: 'primary', label: '主要' },
+                { type: 'success', label: '成功' },
+                { type: 'info', label: '信息' },
+                { type: 'warning', label: '警告' },
+                { type: 'danger', label: '危险' }
+            ],
+            exportFieldDialogVisible: false,
+            formName: 'form',
+            formData: {
+                style: 'primary'
             },
             },
-            formKey: String,
-            type: {
-                type: String,
-                default: 'function'
+            rules: {
+                label: [
+                    {
+                        required: true,
+                        message: this.$t('validate.required')
+                    }
+                ]
             }
             }
-        },
-        data() {
-            return {
-                colors: [
-                    { type: 'default', label: '默认' },
-                    { type: 'primary', label: '主要' },
-                    { type: 'success', label: '成功' },
-                    { type: 'info', label: '信息' },
-                    { type: 'warning', label: '警告' },
-                    { type: 'danger', label: '危险' }
-                ],
-                exportFieldDialogVisible: false,
-                formName: 'form',
-                formData: {
-                    style: 'primary'
-                },
-                rules: {
-                    label: [
-                        {
-                            required: true,
-                            message: this.$t('validate.required')
-                        }
-                    ]
-                }
+        }
+    },
+    computed: {
+        positionType () {
+            const positionType = []
+            positionType.push({
+                value: 'all',
+                label: '所有'
+            })
+            const buttonType = this.formData.button_type || ''
+            if (hasPermission(buttonType, 'toolbar') && this.type === 'function') {
+                positionType.push({
+                    value: 'toolbar',
+                    label: '仅顶部'
+                })
             }
             }
-        },
-        computed: {
-            positionType() {
-                const positionType = []
+            if (hasPermission(buttonType, 'manage') && this.type === 'function') {
                 positionType.push({
                 positionType.push({
-                    value: 'all',
-                    label: '所有'
+                    value: 'manage',
+                    label: '仅管理列'
                 })
                 })
-                const buttonType = this.formData.button_type || ''
-                if (hasPermission(buttonType, 'toolbar') && this.type === 'function') {
-                    positionType.push({
-                        value: 'toolbar',
-                        label: '仅顶部'
-                    })
-                }
-                if (hasPermission(buttonType, 'manage') && this.type === 'function') {
-                    positionType.push({
-                        value: 'manage',
-                        label: '仅管理列'
-                    })
-                }
-                // if (hasPermission(buttonType, 'search') && this.type === 'function') {
-                //   positionType.push({
-                //     value: 'search',
-                //     label: '仅查询列'
-                //   })
-                // }
-                if (hasPermission(buttonType, 'edit') && this.type === 'edit') {
-                    positionType.push({
-                        value: 'edit',
-                        label: '仅编辑'
-                    })
-                }
-                return positionType
             }
             }
-        },
-        watch: {
-            data: {
-                handler(val) {
-                    if (val) {
-                        this.formData = val
-                        const spicialType = ['custom', 'sefStartFlow', 'openTask']
-                        if (spicialType.includes(this.formData.button_type)) {
-                            this.rules['code'] = [
-                                {
-                                    required: true,
-                                    message: this.$t('validate.required')
-                                }
-                            ]
-                        } else {
-                            this.rules['code'] = null
-                        }
-                    }
-                },
-                immediate: true
+            // if (hasPermission(buttonType, 'search') && this.type === 'function') {
+            //   positionType.push({
+            //     value: 'search',
+            //     label: '仅查询列'
+            //   })
+            // }
+            if (hasPermission(buttonType, 'edit') && this.type === 'edit') {
+                positionType.push({
+                    value: 'edit',
+                    label: '仅编辑'
+                })
             }
             }
-        },
-        methods: {
-            // 获取表单数据
-            getFormData(callback) {
-                this.$refs[this.formName].validate((valid) => {
-                    if (valid) {
-                        callback(this.formData)
+            return positionType
+        }
+    },
+    watch: {
+        data: {
+            handler (val) {
+                if (val) {
+                    this.formData = val
+                    const spicialType = ['custom', 'sefStartFlow', 'openTask']
+                    if (spicialType.includes(this.formData.button_type)) {
+                        this.rules['code'] = [
+                            {
+                                required: true,
+                                message: this.$t('validate.required')
+                            }
+                        ]
                     } else {
                     } else {
-                        callback()
+                        this.rules['code'] = null
                     }
                     }
-                })
-            },
-            handleExportFields() {
-                this.exportFieldDialogVisible = true
-            },
-            handleExportColumn(data) {
-                this.handleData('export_columns', data)
+                }
             },
             },
-            handleData(key, value) {
-                this.$emit('callback', key, value)
-            }
+            immediate: true
+        }
+    },
+    methods: {
+        // 获取表单数据
+        getFormData (callback) {
+            this.$refs[this.formName].validate((valid) => {
+                if (valid) {
+                    callback(this.formData)
+                } else {
+                    callback()
+                }
+            })
+        },
+        handleExportFields () {
+            this.exportFieldDialogVisible = true
+        },
+        handleExportColumn (data) {
+            this.handleData('export_columns', data)
+        },
+        handleData (key, value) {
+            this.$emit('callback', key, value)
         }
         }
     }
     }
+}
 </script>
 </script>

+ 3 - 2
src/views/platform/data/dataTemplate/template-list.vue

@@ -163,11 +163,12 @@ export default {
             return [data]
             return [data]
         },
         },
         dealButtom (buttons) {
         dealButtom (buttons) {
-            const keys = ['search', 'remove', 'consult']
+            // const keys = ['search', 'remove', 'consult', 'custom']
             if (!buttons.length) {
             if (!buttons.length) {
                 return []
                 return []
             }
             }
-            const btn = buttons.filter(i => keys.includes(i.button_type))
+            // const btn = buttons.filter(i => keys.includes(i.button_type))
+            const btn = buttons.filter(i => i.show_on_record == 'Y')
             btn.push({
             btn.push({
                 button_type: 'detail',
                 button_type: 'detail',
                 label: '明细',
                 label: '明细',