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

检测项目表单名称显示为检测项目名称,获取检测项目信息存储在store中

cfort 3 лет назад
Родитель
Сommit
fd97865621

+ 5 - 0
src/business/platform/bpmn/form/dialog.vue

@@ -16,6 +16,7 @@
       :def-id="defId"
       :pro-inst-id="proInstId"
       :flowName ="title"
+      :processName="processName"
       :task-id="taskId"
       :waiJian="waiJian"
       :instance-id="instanceId"
@@ -66,6 +67,10 @@ export default {
     waiJian: { // 新增参数
       type: String
     },
+    processName: { // 流程名称
+        type: String,
+        default: ''
+    }
   },
   data() {
     return {

+ 5 - 0
src/business/platform/bpmn/form/index.vue

@@ -226,6 +226,10 @@ export default {
     closeable: {
       type: Boolean,
       default: true
+    },
+    processName: { // 流程名称
+      type: String,
+      default: ''
     }
   },
   data() {
@@ -389,6 +393,7 @@ export default {
         // 表单定义
         this.formDef = this.$utils.parseData(formModel.formData) || {}
         this.formDef.flowName = this.flowName
+        this.formDef.processName = this.processName
 
         this.formData = {
           // 表单数据

+ 663 - 664
src/business/platform/form/formrender/dynamic-form/dynamic-form.vue

@@ -5,20 +5,62 @@
             <!--表头-->
             <div v-if="hasHeader" class="form-header">
                 <div v-if="hasHeader" class="title" style="font-size: 22px; font-family: SimHei" :class="titlePosition">
-                    {{ formDef.name }}
+                    {{ formDef.processName ? formDef.processName : formDef.name }}
                     <span v-if="formDef && formDef.flowName">{{ formDef.flowName }}</span>
-                    <relevance-table v-if="titleList.length > 0 && formParams.formAttrs.customClass.indexOf('true') != -1" :list="titleList" :form="form" />
-                    <Statis-or-record-table v-if="StaOrRec.length > 0" :StaOrRec="StaOrRec" :form="form" />
+                    <relevance-table
+                        v-if="titleList.length > 0 && formParams.formAttrs.customClass.includes('true')"
+                        :list="titleList"
+                        :form="form"
+                    />
+                    <Statis-or-record-table
+                        v-if="StaOrRec.length > 0"
+                        :StaOrRec="StaOrRec"
+                        :form="form"
+                    />
                 </div>
                 <div v-if="hasDesc" class="desc" v-html="$utils.formatText(formDef.desc)"></div>
             </div>
             <!--表单-->
-            <el-form ref="form" :model="models" :inline="inline" :label-suffix="labelSuffix" :label-width="labelWidth" :label-position="labelPosition" :status-icon="statusIcon" :size="size" :hide-required-asterisk="hideRequiredAsterisk" :class="customClass" @submit.native.prevent>
+            <el-form
+                ref="form"
+                :model="models"
+                :inline="inline"
+                :label-suffix="labelSuffix"
+                :label-width="labelWidth"
+                :label-position="labelPosition"
+                :status-icon="statusIcon"
+                :size="size"
+                :hide-required-asterisk="hideRequiredAsterisk"
+                :class="customClass"
+                @submit.native.prevent
+            >
                 <template v-for="(item, index) in formDef.fields">
                     <!--嵌套布局-->
-                    <component :is="'ibps-dynamic-form-' + item.field_type" v-if="item.field_type === 'grid' || item.field_type === 'tabs' || item.field_type === 'collapse' || item.field_type === 'steps'" :ref="'formItem' + item.name" :key="index" :models.sync="models" :rights.sync="rights" :form-data="models" :field="item" :code="code" :params="formParams" :cur-active-step.sync="activeStep" />
+                    <component
+                        :is="'ibps-dynamic-form-' + item.field_type"
+                        v-if="item.field_type === 'grid' || item.field_type === 'tabs' || item.field_type === 'collapse' || item.field_type === 'steps'"
+                        :ref="'formItem' + item.name"
+                        :key="index"
+                        :models.sync="models"
+                        :rights.sync="rights"
+                        :form-data="models"
+                        :field="item"
+                        :code="code"
+                        :params="formParams"
+                        :cur-active-step.sync="activeStep"
+                    />
                     <!--其他类型-->
-                    <ibps-dynamic-form-item v-else :ref="'formItem' + item.name" :key="index" :models.sync="models" :rights.sync="rights" :form-data="models" :field="item" :code="code" :params="formParams" />
+                    <ibps-dynamic-form-item
+                        v-else
+                        :ref="'formItem' + item.name"
+                        :key="index"
+                        :models.sync="models"
+                        :rights.sync="rights"
+                        :form-data="models"
+                        :field="item"
+                        :code="code"
+                        :params="formParams"
+                    />
                 </template>
             </el-form>
         </div>
@@ -26,720 +68,677 @@
 </template>
 
 <script>
-import Vue from 'vue'
+    import Vue from 'vue'
 
-import { nestedFieldTypes } from '@/business/platform/form/constants/fieldTypes'
-import FormOptions from '../../constants/formOptions'
-import FormUtils from '../../utils/formUtil'
-import relevanceTable from './mixins/relevanceTable'
-import StatisOrRecordTable from './mixins/StatisOrRecordTable'
+    import { nestedFieldTypes } from '@/business/platform/form/constants/fieldTypes'
+    import FormOptions from '../../constants/formOptions'
+    import FormUtils from '../../utils/formUtil'
+    import relevanceTable from './mixins/relevanceTable'
+    import StatisOrRecordTable from './mixins/StatisOrRecordTable'
 
-import DynamicFormItem from './dynamic-form-item'
-import DynamicFormField from './dynamic-form-field'
-import DynamicFormOther from './dynamic-form-other'
-import DynamicFormOpinion from './components/approval-opinion'
-import DynamicFormGrid from './dynamic-form-grid'
-import DynamicFormTabs from './dynamic-form-tabs'
-import DynamicFormSteps from './dynamic-form-steps'
-import DynamicFormCollapse from './dynamic-form-collapse'
-import DynamicFormTable from './dynamic-form-table'
-import DynamicFormTableItem from './dynamic-form-table-item'
-import DynamicFormTableBlock from './dynamic-form-table-block'
-/* import templateList from '@/views/platform/data/dataTemplate/template-list.vue' */
+    import DynamicFormItem from './dynamic-form-item'
+    import DynamicFormField from './dynamic-form-field'
+    import DynamicFormOther from './dynamic-form-other'
+    import DynamicFormOpinion from './components/approval-opinion'
+    import DynamicFormGrid from './dynamic-form-grid'
+    import DynamicFormTabs from './dynamic-form-tabs'
+    import DynamicFormSteps from './dynamic-form-steps'
+    import DynamicFormCollapse from './dynamic-form-collapse'
+    import DynamicFormTable from './dynamic-form-table'
+    import DynamicFormTableItem from './dynamic-form-table-item'
+    import DynamicFormTableBlock from './dynamic-form-table-block'
+    // import templateList from '@/views/platform/data/dataTemplate/template-list.vue'
 
-Vue.component('ibps-dynamic-form-item', DynamicFormItem)
-Vue.component('ibps-dynamic-form-field', DynamicFormField)
-Vue.component('ibps-dynamic-form-other', DynamicFormOther)
-Vue.component('ibps-dynamic-form-opinion', DynamicFormOpinion)
-Vue.component('ibps-dynamic-form-grid', DynamicFormGrid)
-Vue.component('ibps-dynamic-form-tabs', DynamicFormTabs)
-Vue.component('ibps-dynamic-form-steps', DynamicFormSteps)
-Vue.component('ibps-dynamic-form-collapse', DynamicFormCollapse)
-Vue.component('ibps-dynamic-form-table', DynamicFormTable)
-Vue.component('ibps-dynamic-form-table-item', DynamicFormTableItem)
-Vue.component('ibps-dynamic-form-table-block', DynamicFormTableBlock)
-/* Vue.component('template-list', templateList) */
+    Vue.component('ibps-dynamic-form-item', DynamicFormItem)
+    Vue.component('ibps-dynamic-form-field', DynamicFormField)
+    Vue.component('ibps-dynamic-form-other', DynamicFormOther)
+    Vue.component('ibps-dynamic-form-opinion', DynamicFormOpinion)
+    Vue.component('ibps-dynamic-form-grid', DynamicFormGrid)
+    Vue.component('ibps-dynamic-form-tabs', DynamicFormTabs)
+    Vue.component('ibps-dynamic-form-steps', DynamicFormSteps)
+    Vue.component('ibps-dynamic-form-collapse', DynamicFormCollapse)
+    Vue.component('ibps-dynamic-form-table', DynamicFormTable)
+    Vue.component('ibps-dynamic-form-table-item', DynamicFormTableItem)
+    Vue.component('ibps-dynamic-form-table-block', DynamicFormTableBlock)
+    // Vue.component('template-list', templateList)
 
-// Vue.component('ibps-dynamic-form-layout-table', DynamicFormLayoutTable)
+    // Vue.component('ibps-dynamic-form-layout-table', DynamicFormLayoutTable)
 
-export default {
-    components: {
-        relevanceTable,
-        StatisOrRecordTable
-    },
-    provide() {
-        return {
-            dynamicForm: this
-        }
-    },
-    props: {
-        isDialog: {
-            type: Boolean,
-            default: false
-        },
-        form: {
-            type: Object
-        },
-        dynamicParams: {
-            type: Object
-        },
-        formDef: {
-            type: Object,
-            required: true
-        },
-        value: {
-            type: Object
-        },
-        readonly: {
-            type: Boolean,
-            default: false
-        },
-        permissions: {
-            type: Object
-        },
-        BpmnForm: {
-            type: Boolean,
-            default: false
-        },
-        validateImmediately: {
-            // 是否初始验证
-            type: Boolean,
-            default: true
-        },
-        initialization: {
-            type: Boolean,
-            default: false
-        },
-        // 扩展参数
-        params: Object,
-        // 当前激活步骤
-        curActiveStep: Number
-    },
-    data() {
-        return {
-            models: {}, // 表单model对象数据
-            rights: {}, // 表单权限
-            responseFormula: {}, // 公式
-            responseLinkages: {}, // 联动数据
-            responseVerifys: [], // 表单提交校验
-            responseOpinionFields: {}, // 表单的意见字段
-            responseFormOpinionData: {}, // 已填写的表单意见
-            responseLabelFields: {}, // 表单的文本字段
-            invalidFields: {},
-            activeStep: 0,
-            titleList: [],
-            StaOrRec: []
-        }
-    },
-    computed: {
-        formAttrs() {
-            return this.formDef ? this.formDef.attrs || {} : {}
-        },
-        hasHeader() {
-            return this.formAttrs && !this.formAttrs.hide_name
-        },
-        hasDesc() {
-            return this.formAttrs && !this.formAttrs.hide_desc && this.formDef.desc
-        },
-        titlePosition() {
-            if (this.formAttrs.title_position === 'center') {
-                return 'ibps-tc'
-            } else if (this.formAttrs.title_position === 'right') {
-                return 'ibps-tr'
-            } else {
-                return ''
+    export default {
+        components: {
+            relevanceTable,
+            StatisOrRecordTable
+        },
+        provide() {
+            return {
+                dynamicForm: this
             }
         },
-        size() {
-            return this.formAttrs.size || (this.$ELEMENT || {}).size
-        },
-        inline() {
-            return this.formAttrs.inline || false
-        },
-        labelSuffix() {
-            return this.formAttrs ? (this.formAttrs.colon ? this.formAttrs.labelSuffix || ':' : '') : ''
-        },
-        labelWidth() {
-            if (this.$utils.isNotEmpty(this.formAttrs.labelWidth) && this.$utils.isNotEmpty(this.formAttrs.labelWidthUnit)) {
-                return this.formAttrs.labelWidth + this.formAttrs.labelWidthUnit
-            } else {
-                return '100px'
+        props: {
+            isDialog: {
+                type: Boolean,
+                default: false
+            },
+            form: {
+                type: Object
+            },
+            dynamicParams: {
+                type: Object
+            },
+            formDef: {
+                type: Object,
+                required: true
+            },
+            value: {
+                type: Object
+            },
+            readonly: {
+                type: Boolean,
+                default: false
+            },
+            permissions: {
+                type: Object
+            },
+            BpmnForm: {
+                type: Boolean,
+                default: false
+            },
+            validateImmediately: {
+                // 是否初始验证
+                type: Boolean,
+                default: true
+            },
+            initialization: {
+                type: Boolean,
+                default: false
+            },
+            // 扩展参数
+            params: Object,
+            // 当前激活步骤
+            curActiveStep: Number
+        },
+        data() {
+            return {
+                models: {}, // 表单model对象数据
+                rights: {}, // 表单权限
+                responseFormula: {}, // 公式
+                responseLinkages: {}, // 联动数据
+                responseVerifys: [], // 表单提交校验
+                responseOpinionFields: {}, // 表单的意见字段
+                responseFormOpinionData: {}, // 已填写的表单意见
+                responseLabelFields: {}, // 表单的文本字段
+                invalidFields: {},
+                activeStep: 0,
+                titleList: [],
+                StaOrRec: []
             }
         },
-        labelPosition() {
-            return this.$utils.isNotEmpty(this.formAttrs.labelPosition) ? this.formAttrs.labelPosition : 'right'
-        },
-        descPosition() {
-            return this.$utils.isNotEmpty(this.formAttrs.descPosition) ? this.formAttrs.descPosition || 'inline' : 'inline'
-        },
-        customClass() {
-            return this.$utils.isNotEmpty(this.formAttrs.customClass) ? this.formAttrs.customClass : null
-        },
-        statusIcon() {
-            return this.$utils.isNotEmpty(this.formAttrs.statusIcon) ? this.formAttrs.statusIcon : false
-        },
-        hideRequiredAsterisk() {
-            return this.$utils.toBoolean(this.formAttrs.hideRequiredAsterisk, false)
-        },
-        code() {
-            return this.formDef.code
-        },
-        readonlyRights() {
-            return this.readonly
-        },
-        readonlyStyle() {
-            return this.formAttrs && this.formAttrs.read_style ? this.formAttrs.read_style : 'text'
-        },
-        hasScript() {
-            return this.formAttrs ? this.$utils.isNotEmpty(this.formAttrs.script) : false
-        },
-        formParams() {
-            const params = {
-                responseFormula: this.responseFormula,
-                responseLinkages: this.responseLinkages,
-                responseFormOpinionData: this.responseFormOpinionData,
-                readonly: this.readonly,
-                readonlyStyle: this.readonlyStyle,
-                labelWidth: this.labelWidth,
-                labelSuffix: this.labelSuffix,
-                descPosition: this.descPosition,
-                formAttrs: this.formAttrs,
-                invalidFields: this.invalidFields
-            }
-            console.log('5555', Object.assign(params, this.params))
-            return Object.assign(params, this.params)
-        }
-    },
-    watch: {
-        formDef: {
-            handler(val) {
-                this.initResponseFields()
-            },
-            deep: true,
-            immediate: true
-        }
-        /* models: {
-      handler(val) {
-        // 延迟验证
-        this.$nextTick(() => {
-          this.validate(() => {})
-        })
-      },
-      deep: true
-    },
-    initialization(val) {
-      if (val && this.hasScript) {
-        this.$emit('load-script')
-      }
-    },
-    curActiveStep(val) {
-      this.activeStep = val
-    },
-    activeStep(val, oldVal) {
-      if (val !== oldVal) {
-        this.$emit('update:cur-active-step', val)
-      }
-    }
-  },
-
-  mounted() {
-    // 初始化脚本
-   /* this.$nextTick(() => {
-      if (this.validateImmediately) {
-        this.validate(() => {})
-      }
-    }) */
-    },
-    mounted() {
-        this.titleList = []
-        this.StaOrRec = []
-        /*   form:{
-       type: Object
-    },
-    dynamicParams:{
-       type: Object
-      },
-    formDef: {
-      type: Object,
-      required: true
-    },
-    value: {
-      type: Object
-    },
-    readonly: {
-      type: Boolean,
-      default: false
-    },
-    permissions: {
-      type: Object
-    },
-    BpmnForm:{
-      type: Boolean,
-      default: false
-    },*/
-    },
-    methods: {
-        /**
-         * 初始化字段
-         */
-        async initResponseFields() {
-            let fields
-            if (this.formDef && this.formDef.fields) fields = this.formDef.fields
-            if (!fields) {
-                return
+        computed: {
+            formAttrs() {
+                return this.formDef ? this.formDef.attrs || {} : {}
+            },
+            hasHeader() {
+                return this.formAttrs && !this.formAttrs.hide_name
+            },
+            hasDesc() {
+                return this.formAttrs && !this.formAttrs.hide_desc && this.formDef.desc
+            },
+            titlePosition() {
+                if (this.formAttrs.title_position === 'center') {
+                    return 'ibps-tc'
+                } else if (this.formAttrs.title_position === 'right') {
+                    return 'ibps-tr'
+                } else {
+                    return ''
+                }
+            },
+            size() {
+                return this.formAttrs.size || (this.$ELEMENT || {}).size
+            },
+            inline() {
+                return this.formAttrs.inline || false
+            },
+            labelSuffix() {
+                return this.formAttrs ? (this.formAttrs.colon ? this.formAttrs.labelSuffix || ':' : '') : ''
+            },
+            labelWidth() {
+                if (this.$utils.isNotEmpty(this.formAttrs.labelWidth) && this.$utils.isNotEmpty(this.formAttrs.labelWidthUnit)) {
+                    return this.formAttrs.labelWidth + this.formAttrs.labelWidthUnit
+                } else {
+                    return '100px'
+                }
+            },
+            labelPosition() {
+                return this.$utils.isNotEmpty(this.formAttrs.labelPosition) ? this.formAttrs.labelPosition : 'right'
+            },
+            descPosition() {
+                return this.$utils.isNotEmpty(this.formAttrs.descPosition) ? this.formAttrs.descPosition || 'inline' : 'inline'
+            },
+            customClass() {
+                return this.$utils.isNotEmpty(this.formAttrs.customClass) ? this.formAttrs.customClass : null
+            },
+            statusIcon() {
+                return this.$utils.isNotEmpty(this.formAttrs.statusIcon) ? this.formAttrs.statusIcon : false
+            },
+            hideRequiredAsterisk() {
+                return this.$utils.toBoolean(this.formAttrs.hideRequiredAsterisk, false)
+            },
+            code() {
+                return this.formDef.code
+            },
+            readonlyRights() {
+                return this.readonly
+            },
+            readonlyStyle() {
+                return this.formAttrs && this.formAttrs.read_style ? this.formAttrs.read_style : 'text'
+            },
+            hasScript() {
+                return this.formAttrs ? this.$utils.isNotEmpty(this.formAttrs.script) : false
+            },
+            formParams() {
+                const params = {
+                    responseFormula: this.responseFormula,
+                    responseLinkages: this.responseLinkages,
+                    responseFormOpinionData: this.responseFormOpinionData,
+                    readonly: this.readonly,
+                    readonlyStyle: this.readonlyStyle,
+                    labelWidth: this.labelWidth,
+                    labelSuffix: this.labelSuffix,
+                    descPosition: this.descPosition,
+                    formAttrs: this.formAttrs,
+                    invalidFields: this.invalidFields
+                }
+                return Object.assign(params, this.params)
             }
-            await this.generateModles(fields)
-            // 初始化运行公式计算
-            await this.initRunCalFormula()
-            // 初始化表单意见
-            await this.initResponseOpinionData()
         },
-        /**
-         * 生成modles
-         */
-        async generateModles(fields) {
-            for (let i = 0; i < fields.length; i++) {
-                const field = fields[i]
-                const fieldName = field.name
-                const fieldType = field.field_type
-                const fieldOptions = field.field_options
+        watch: {
+            formDef: {
+                handler(val) {
+                    this.initResponseFields()
+                },
+                deep: true,
+                immediate: true
+            },
+            // models: {
+            //     handler (val) {
+            //         // 延迟验证
+            //         this.$nextTick(() => {
+            //             this.validate(() => { })
+            //         })
+            //     },
+            //     deep: true
+            // },
+            // initialization (val) {
+            //     if (val && this.hasScript) {
+            //         this.$emit('load-script')
+            //     }
+            // },
+            // curActiveStep (val) {
+            //     this.activeStep = val
+            // },
+            // activeStep (val, oldVal) {
+            //     if (val !== oldVal) {
+            //         this.$emit('update:cur-active-step', val)
+            //     }
+            // }
+        },
+        mounted() {
+            // 初始化脚本
+            // this.$nextTick(() => {
+            //     if (this.validateImmediately) {
+            //         this.validate(() => {})
+            //     }
+            // }) 
+            this.titleList = []
+            this.StaOrRec = []
+        },
+        methods: {
+            /**
+             * 初始化字段
+             */
+            async initResponseFields() {
+                let fields
+                if (this.formDef && this.formDef.fields) fields = this.formDef.fields
+                if (!fields) {
+                    return
+                }
+                await this.generateModles(fields)
+                // 初始化运行公式计算
+                await this.initRunCalFormula()
+                // 初始化表单意见
+                await this.initResponseOpinionData()
+            },
+            /**
+             * 生成modles
+             */
+            async generateModles(fields) {
+                for (let i = 0; i < fields.length; i++) {
+                    const field = fields[i]
+                    const fieldName = field.name
+                    const fieldType = field.field_type
+                    const fieldOptions = field.field_options
 
-                if (nestedFieldTypes.includes(fieldType)) {
-                    // 嵌套布局
-                    if (this.$utils.isNotEmpty(fieldOptions) && this.$utils.isNotEmpty(fieldOptions.columns)) {
-                        // 循环遍历所有字段
-                        fieldOptions.columns.forEach((item) => {
-                            this.generateModles(item.fields)
-                        })
-                    }
-                } else if (fieldType === 'table') {
-                    // 子表单
-                    const data = this.value ? this.value[fieldName] : []
-                    if (fieldOptions.mode === 'block') {
-                        if (this.$utils.isEmpty(data)) {
-                            this.$set(this.models, fieldName, [])
-                            const defaultValue = await FormUtils.getTableDefaultData(field)
-                            this.models[fieldName].push(JSON.parse(JSON.stringify(defaultValue)))
+                    if (nestedFieldTypes.includes(fieldType)) {
+                        // 嵌套布局
+                        if (this.$utils.isNotEmpty(fieldOptions) && this.$utils.isNotEmpty(fieldOptions.columns)) {
+                            // 循环遍历所有字段
+                            fieldOptions.columns.forEach(item => {
+                                this.generateModles(item.fields)
+                            })
+                        }
+                    } else if (fieldType === 'table') {
+                        // 子表单
+                        const data = this.value ? this.value[fieldName] : []
+                        if (fieldOptions.mode === 'block') {
+                            if (this.$utils.isEmpty(data)) {
+                                this.$set(this.models, fieldName, [])
+                                const defaultValue = await FormUtils.getTableDefaultData(field)
+                                this.models[fieldName].push(JSON.parse(JSON.stringify(defaultValue)))
+                            } else {
+                                this.models[fieldName] = data || []
+                            }
                         } else {
                             this.models[fieldName] = data || []
                         }
+                        // 初始化表单扩展参数
+                        this.initFormFieldParameter(field)
+                    } else if (fieldType === 'approval_opinion') {
+                        // 审批意见
+                        this.models[fieldName] = ''
+                        this.responseOpinionFields[fieldName] = field
+                        // ====== 初始化表单权限
+                        this.initFormApprovalOpinionRights(field)
                     } else {
-                        this.models[fieldName] = data || []
-                    }
-                    // 初始化表单扩展参数
-                    this.initFormFieldParameter(field)
-                } else if (fieldType === 'approval_opinion') {
-                    // 审批意见
-                    this.models[fieldName] = ''
-                    this.responseOpinionFields[fieldName] = field
-                    // ====== 初始化表单权限
-                    this.initFormApprovalOpinionRights(field)
-                } else {
-                    if (fieldType === 'label') {
-                        // 文本字段
-                        this.responseLabelFields[fieldName] = field
-                    }
-                    // 不是只读字段
-                    if (!FormOptions.t.NON_MODEL_FIELD_TYPES.includes(fieldType)) {
-                        // 空值默认
-                        const defaultValueEmpty = this.$utils.toBoolean(fieldOptions.default_value_empty, true)
-                        if (this.value && Object.keys(this.value).indexOf(fieldName) >= 0) {
-                            // 有值
-                            const data = this.value[fieldName]
-                            if (this.$utils.isEmpty(data)) {
-                                if (defaultValueEmpty) {
-                                    const defaultValue = await FormUtils.getFieldDefaultValue(field)
-                                    this.models[fieldName] = defaultValue
+                        if (fieldType === 'label') {
+                            // 文本字段
+                            this.responseLabelFields[fieldName] = field
+                        }
+                        // 不是只读字段
+                        if (!FormOptions.t.NON_MODEL_FIELD_TYPES.includes(fieldType)) {
+                            // 空值默认
+                            const defaultValueEmpty = this.$utils.toBoolean(fieldOptions.default_value_empty, true)
+                            if (this.value && Object.keys(this.value).indexOf(fieldName) >= 0) {
+                                // 有值
+                                const data = this.value[fieldName]
+                                if (this.$utils.isEmpty(data)) {
+                                    if (defaultValueEmpty) {
+                                        const defaultValue = await FormUtils.getFieldDefaultValue(field)
+                                        this.models[fieldName] = defaultValue
+                                    }
+                                } else {
+                                    this.models[fieldName] = await this.getInitData(field, data)
                                 }
                             } else {
-                                this.models[fieldName] = await this.getInitData(field, data)
-                            }
-                        } else {
-                            // 默认值
-                            this.models[fieldName] = await FormUtils.getFieldDefaultValue(field)
-                            if (this.dynamicParams && this.dynamicParams[field.field_name]) {
-                                this.models[fieldName] = this.dynamicParams[field.field_name]
+                                // 默认值
+                                this.models[fieldName] = await FormUtils.getFieldDefaultValue(field)
+                                if (this.dynamicParams && this.dynamicParams[field.field_name]) {
+                                    this.models[fieldName] = this.dynamicParams[field.field_name]
+                                }
                             }
                         }
+                        // 初始化表单扩展参数
+                        this.initFormFieldParameter(field)
                     }
-                    // 初始化表单扩展参数
-                    this.initFormFieldParameter(field)
                 }
-            }
-        },
-        async getInitData(field, data) {
-            const fieldType = field.field_type
-            const copyFlow = this.$utils.toBoolean(this.formParams ? this.formParams.copyFlow : false, false)
-            if (fieldType === 'autoNumber' && copyFlow) {
-                // 复制流程初始化数据
-                return await FormUtils.getFieldDefaultValue(field)
-            }
-            return data
-        },
-        /**
-         *  初始化表单扩展参数
-         */
-        initFormFieldParameter(field) {
-            // ====== 初始化表单权限
-            this.initFormRights(field)
-            // ====== 初始化需要进行公式计算的字段
-            this.initResponseFormula(field)
-            // ======  初始化需要进行联动数据的字段
-            this.initResponseLinkages(field)
-        },
-        initFormApprovalOpinionRights(field) {
-            this.rights[field.name] = FormUtils.getDefaultApprovalOpinionRigths(field, this.params) || this.getPermissions(this.permissions, field) || FormUtils.getDefaultRigths(field)
-        },
-        /**
-         *  初始化表单权限
-         */
-        initFormRights(field) {
-            this.rights[field.name] = this.getPermissions(this.permissions, field) || FormUtils.getDefaultRigths(field)
-        },
-        // 获取权限
-        getPermissions(permissions, field) {
-            if (this.$utils.isEmpty(permissions)) {
-                return
-            }
-            const fieldType = field.field_type
-            const name = field.name
-            let rightsValue = null
-            const isNonInputField = FormOptions.t.NON_INPUT_FIELD_TYPES.includes(fieldType)
-            let isSpecial = false
-            if (isNonInputField && permissions.fields) {
-                // 非输入字段
-                rightsValue = permissions.fields[name] ? permissions.fields[name] : null
-            } else if (fieldType === 'approval_opinion' && permissions.opinions) {
-                // 意见 特殊处理
-                rightsValue = permissions.opinions[name] ? permissions.opinions[name] : null
-            } else if (fieldType === 'table' && permissions.tables) {
-                // 子表
-                isSpecial = true
-                rightsValue = permissions.tables[name] ? permissions.tables[name] : null
-            } else {
-                // 字段
-                rightsValue = permissions.fields[name] ? permissions.fields[name] : null
-            }
-            if (this.readonly && !isNonInputField && !isSpecial) {
-                // 只读权限
-                // 修复空权限默认值的bug
-                if (this.$utils.isEmpty(rightsValue)) {
-                    rightsValue = FormUtils.getDefaultRigths(field)
+            },
+            async getInitData(field, data) {
+                const fieldType = field.field_type
+                const copyFlow = this.$utils.toBoolean(this.formParams ? this.formParams.copyFlow : false, false)
+                if (fieldType === 'autoNumber' && copyFlow) {
+                    // 复制流程初始化数据
+                    return await FormUtils.getFieldDefaultValue(field)
                 }
-                rightsValue = rightsValue !== FormOptions.t.PERMISSIONS.HIDE ? FormOptions.t.PERMISSIONS.READ : rightsValue
-            }
-            return rightsValue
-        },
-        // 初始化需要进行公式计算的字段
-        initResponseFormula(item) {
-            FormUtils.setResponseFormula(this.responseFormula, item, this.code)
-        },
-        // 初始化运行公式计算
-        initRunCalFormula() {
-            // 不需要字段的进行公式计算 比如获取但其当前时间
-            FormUtils.runCalFormula(this, this.responseFormula[FormUtils.NOT_NEED_FIELD], this.formDef.code)
-        },
-        // 初始化联动数据
-        initResponseLinkages(item) {
-            FormUtils.setResponseLinkages(this.responseLinkages, item, this.code)
-        },
-        // 初始化表单意见
-        initResponseOpinionData() {
-            this.responseFormOpinionData = {}
-            const opinionData = this.params ? this.params.formOpinionData || {} : {}
-            if (this.$utils.isEmpty(opinionData) || !this.hasFormOpinion()) {
-                return
-            }
-            const hasBindNode = opinionData.hasBindNode
-            const formOpinionConfig = opinionData.formOpinionConfig
-            if (hasBindNode) {
-                // 1、有流程节点绑定的流程意见
-                const nodeData = opinionData.formOpinionNodeData
-                for (const key in this.responseOpinionFields) {
-                    if (this.responseOpinionFields.hasOwnProperty(key)) {
-                        if (formOpinionConfig[key]) {
-                            this.responseFormOpinionData[key] = nodeData[key]
-                        } /* else {
-              this.responseFormOpinionData[key] = opinionData.opinionList
-            } */
+                return data
+            },
+            /**
+             *  初始化表单扩展参数
+             */
+            initFormFieldParameter(field) {
+                // ====== 初始化表单权限
+                this.initFormRights(field)
+                // ====== 初始化需要进行公式计算的字段
+                this.initResponseFormula(field)
+                // ======  初始化需要进行联动数据的字段
+                this.initResponseLinkages(field)
+            },
+            initFormApprovalOpinionRights(field) {
+                this.rights[field.name] = FormUtils.getDefaultApprovalOpinionRigths(field, this.params) || this.getPermissions(this.permissions, field) || FormUtils.getDefaultRigths(field)
+            },
+            /**
+             *  初始化表单权限
+             */
+            initFormRights(field) {
+                this.rights[field.name] = this.getPermissions(this.permissions, field) || FormUtils.getDefaultRigths(field)
+            },
+            // 获取权限
+            getPermissions(permissions, field) {
+                if (this.$utils.isEmpty(permissions)) {
+                    return
+                }
+                const fieldType = field.field_type
+                const name = field.name
+                let rightsValue = null
+                const isNonInputField = FormOptions.t.NON_INPUT_FIELD_TYPES.includes(fieldType)
+                let isSpecial = false
+                if (isNonInputField && permissions.fields) {
+                    // 非输入字段
+                    rightsValue = permissions.fields[name] ? permissions.fields[name] : null
+                } else if (fieldType === 'approval_opinion' && permissions.opinions) {
+                    // 意见 特殊处理
+                    rightsValue = permissions.opinions[name] ? permissions.opinions[name] : null
+                } else if (fieldType === 'table' && permissions.tables) {
+                    // 子表
+                    isSpecial = true
+                    rightsValue = permissions.tables[name] ? permissions.tables[name] : null
+                } else {
+                    // 字段
+                    rightsValue = permissions.fields[name] ? permissions.fields[name] : null
+                }
+                if (this.readonly && !isNonInputField && !isSpecial) {
+                    // 只读权限
+                    // 修复空权限默认值的bug
+                    if (this.$utils.isEmpty(rightsValue)) {
+                        rightsValue = FormUtils.getDefaultRigths(field)
                     }
+                    rightsValue = rightsValue !== FormOptions.t.PERMISSIONS.HIDE ? FormOptions.t.PERMISSIONS.READ : rightsValue
                 }
-            } else {
-                for (const key in this.responseOpinionFields) {
-                    if (this.responseOpinionFields.hasOwnProperty(key)) {
-                        this.responseFormOpinionData[key] = opinionData.opinionList
+                return rightsValue
+            },
+            // 初始化需要进行公式计算的字段
+            initResponseFormula(item) {
+                FormUtils.setResponseFormula(this.responseFormula, item, this.code)
+            },
+            // 初始化运行公式计算
+            initRunCalFormula() {
+                // 不需要字段的进行公式计算 比如获取但其当前时间
+                FormUtils.runCalFormula(this, this.responseFormula[FormUtils.NOT_NEED_FIELD], this.formDef.code)
+            },
+            // 初始化联动数据
+            initResponseLinkages(item) {
+                FormUtils.setResponseLinkages(this.responseLinkages, item, this.code)
+            },
+            // 初始化表单意见
+            initResponseOpinionData() {
+                this.responseFormOpinionData = {}
+                const opinionData = this.params ? this.params.formOpinionData || {} : {}
+                if (this.$utils.isEmpty(opinionData) || !this.hasFormOpinion()) {
+                    return
+                }
+                const hasBindNode = opinionData.hasBindNode
+                const formOpinionConfig = opinionData.formOpinionConfig
+                if (hasBindNode) {
+                    // 1、有流程节点绑定的流程意见
+                    const nodeData = opinionData.formOpinionNodeData
+                    for (const key in this.responseOpinionFields) {
+                        if (this.responseOpinionFields.hasOwnProperty(key)) {
+                            if (formOpinionConfig[key]) {
+                                this.responseFormOpinionData[key] = nodeData[key]
+                            } /* else {
+                                this.responseFormOpinionData[key] = opinionData.opinionList
+                            } */
+                        }
+                    }
+                } else {
+                    for (const key in this.responseOpinionFields) {
+                        if (this.responseOpinionFields.hasOwnProperty(key)) {
+                            this.responseFormOpinionData[key] = opinionData.opinionList
+                        }
                     }
                 }
-            }
-        },
-        /**
-         * 表单提交校验
-         */
-        formSubmitVerify(callback) {
-            let flag = true
-            const verifys = this.formAttrs ? this.formAttrs.verifys : []
-            if (this.$utils.isEmpty(verifys)) {
-                callback(flag)
-                return
-            }
-            const formData = this.getFormData()
-            for (let i = 0; i < verifys.length; i++) {
-                const verify = verifys[i]
-                if (!FormUtils.runFormSubmitVerify(verify.formula, formData, this.formDef.code)) {
-                    flag = false
-                    callback(flag, verify.msg)
+            },
+            /**
+             * 表单提交校验
+             */
+            formSubmitVerify(callback) {
+                let flag = true
+                const verifys = this.formAttrs ? this.formAttrs.verifys : []
+                if (this.$utils.isEmpty(verifys)) {
+                    callback(flag)
                     return
                 }
-            }
-            flag = true
-            callback(flag)
-        },
-        /**
-         * 获取表单数据
-         */
-        getFormData() {
-            const data = {}
-            // 去除文本字段,表单意见字段
-            for (var key in this.models) {
-                if (!this.responseOpinionFields[key] && !this.responseLabelFields[key]) {
-                    data[key] = this.models[key]
+                const formData = this.getFormData()
+                for (let i = 0; i < verifys.length; i++) {
+                    const verify = verifys[i]
+                    if (!FormUtils.runFormSubmitVerify(verify.formula, formData, this.formDef.code)) {
+                        flag = false
+                        callback(flag, verify.msg)
+                        return
+                    }
                 }
-            }
-            return data
-        },
-        /**
-         * 设置表单字段数据
-         */
-        setFieldData(name, value) {
-            this.models[name] = value
-        },
-        /**
-         * 设置表单权限
-         */
-        getFormRights(name) {
-            return this.rights[name]
-        },
-        /**
-         * 设置表单权限
-         */
-        setFormRights(name, value) {
-            this.rights[name] = value
-        },
-        /**
-         *  是否有审批意见字段
-         */
-        hasFormOpinion() {
-            return this.$utils.isNotEmpty(this.responseOpinionFields)
-        },
-        /**
-         * 获取审批意见数据
-         */
-        getFormOpinionData() {
-            const data = {}
-            for (var key in this.models) {
-                if (this.responseOpinionFields[key] && (this.$utils.isEmpty(this.rights[key]) || this.rights[key] === FormOptions.t.PERMISSIONS.EDIT || this.rights[key] === FormOptions.t.PERMISSIONS.REQUIRED)) {
-                    data[key] = this.models[key]
+                flag = true
+                callback(flag)
+            },
+            /**
+             * 获取表单数据
+             */
+            getFormData() {
+                const data = {}
+                // 去除文本字段,表单意见字段
+                for (var key in this.models) {
+                    if (!this.responseOpinionFields[key] && !this.responseLabelFields[key]) {
+                        data[key] = this.models[key]
+                    }
                 }
-            }
-            return data
-        },
-        /**
-         * 获取审批意见验证
-         */
-        formOpinionValidate(callback, flag = false) {
-            if (this.$utils.isEmpty(this.responseOpinionFields)) {
-                callback(true)
-                return
-            }
-            let i = 0
-            if (flag) {
-                for (const key in this.responseOpinionFields) {
-                    if (this.$utils.isEmpty(this.models[key]) && (this.$utils.isEmpty(this.rights[key]) || this.rights[key] === FormOptions.t.PERMISSIONS.EDIT || this.rights[key] === FormOptions.t.PERMISSIONS.REQUIRED)) {
-                        this.models[key] = '退回修改 / 驳回'
+                return data
+            },
+            /**
+             * 设置表单字段数据
+             */
+            setFieldData(name, value) {
+                this.models[name] = value
+            },
+            /**
+             * 设置表单权限
+             */
+            getFormRights(name) {
+                return this.rights[name]
+            },
+            /**
+             * 设置表单权限
+             */
+            setFormRights(name, value) {
+                this.rights[name] = value
+            },
+            /**
+             *  是否有审批意见字段
+             */
+            hasFormOpinion() {
+                return this.$utils.isNotEmpty(this.responseOpinionFields)
+            },
+            /**
+             * 获取审批意见数据
+             */
+            getFormOpinionData() {
+                const data = {}
+                for (var key in this.models) {
+                    if (this.responseOpinionFields[key] && (this.$utils.isEmpty(this.rights[key]) || this.rights[key] === FormOptions.t.PERMISSIONS.EDIT || this.rights[key] === FormOptions.t.PERMISSIONS.REQUIRED)) {
+                        data[key] = this.models[key]
                     }
                 }
-            } else {
-                for (const key in this.responseOpinionFields) {
-                    if (this.$utils.isEmpty(this.models[key]) && this.rights[key] === FormOptions.t.PERMISSIONS.REQUIRED) {
-                        i++
+                return data
+            },
+            /**
+             * 获取审批意见验证
+             */
+            formOpinionValidate(callback, flag = false) {
+                if (this.$utils.isEmpty(this.responseOpinionFields)) {
+                    callback(true)
+                    return
+                }
+                let i = 0
+                if (flag) {
+                    for (const key in this.responseOpinionFields) {
+                        if (this.$utils.isEmpty(this.models[key]) && (this.$utils.isEmpty(this.rights[key]) || this.rights[key] === FormOptions.t.PERMISSIONS.EDIT || this.rights[key] === FormOptions.t.PERMISSIONS.REQUIRED)) {
+                            this.models[key] = '退回修改 / 驳回'
+                        }
+                    }
+                } else {
+                    for (const key in this.responseOpinionFields) {
+                        if (this.$utils.isEmpty(this.models[key]) && this.rights[key] === FormOptions.t.PERMISSIONS.REQUIRED) {
+                            i++
+                        }
                     }
                 }
-            }
 
-            if (i > 0) {
-                callback(false)
-            } else {
-                callback(true)
+                if (i > 0) {
+                    callback(false)
+                } else {
+                    callback(true)
+                }
+            },
+            /**
+             * 表单验证
+             */
+            validate(callback) {
+                // 先移除校验再进行校验
+                this.$refs.form.clearValidate()
+                this.$refs.form.validate((valid, invalidFields) => {
+                    this.invalidFields = invalidFields
+                    if (callback) callback(valid, invalidFields)
+                })
+            },
+            //表单关联
+            getTableList(list) {
+                this.titleList = list
+            },
+            // 将对象参数传入, 进行渲染
+            getStatisOrRecord(type) {
+                this.StaOrRec = type
             }
-        },
-        /**
-         * 表单验证
-         */
-        validate(callback) {
-            // 先移除校验再进行校验
-            this.$refs.form.clearValidate()
-            this.$refs.form.validate((valid, invalidFields) => {
-                this.invalidFields = invalidFields
-                if (callback) callback(valid, invalidFields)
-            })
-        },
-        /**
-         * 表单关联
-         */
-        getTableList(list) {
-            this.titleList = list
-        },
-        /* 将对象参数传入, 进行渲染 */
-        getStatisOrRecord(type) {
-            this.StaOrRec = type
-        }
-        /**
-         * 获取表单字段的具体控件组件实例
-         */
-        /*  getRefsField(fieldName) {
-      const refs = this.getRefs(fieldName)
-      if (this.$utils.isEmpty(refs) || this.$utils.isEmpty(refs[0]) || this.$utils.isEmpty(refs[0].$refs) || this.$utils.isEmpty(refs[0].$refs['formField'])) {
-        return null
-      }
-      return refs[0].$refs.formField
-    },
-    getRefs(fieldName) {
-      const key = 'formItem' + fieldName
-      return this.getDynamicRefs(this.$refs, key)
-    },
-    getDynamicRefs(formRefs, key) {
-      if (this.$utils.isEmpty(formRefs)) {
-        return
-      }
-      for (const refKey in formRefs) {
-        const formRef = formRefs[refKey]
-        if (refKey === key) { return formRef }
-        for (let j = 0; j < formRef.length; j++) {
-          const refs = formRef[j]
-          const v = this.getDynamicRefs(refs.$refs, key)
-          if (v) {
-            return v
-          }
+            /**
+             * 获取表单字段的具体控件组件实例
+             */
+            // getRefsField (fieldName) {
+            //     const refs = this.getRefs(fieldName)
+            //     if (this.$utils.isEmpty(refs) || this.$utils.isEmpty(refs[0]) || this.$utils.isEmpty(refs[0].$refs) || this.$utils.isEmpty(refs[0].$refs['formField'])) {
+            //         return null
+            //     }
+            //     return refs[0].$refs.formField
+            // },
+            // getRefs (fieldName) {
+            //     const key = 'formItem' + fieldName
+            //     return this.getDynamicRefs(this.$refs, key)
+            // },
+            // getDynamicRefs (formRefs, key) {
+            //     if (this.$utils.isEmpty(formRefs)) {
+            //         return
+            //     }
+            //     for (const refKey in formRefs) {
+            //         const formRef = formRefs[refKey]
+            //         if (refKey === key) { return formRef }
+            //         for (let j = 0; j < formRef.length; j++) {
+            //             const refs = formRef[j]
+            //             const v = this.getDynamicRefs(refs.$refs, key)
+            //             if (v) {
+            //                 return v
+            //             }
+            //         }
+            //     }
+            // }
         }
-      }
-    } */
     }
-}
 </script>
 
 <style lang="scss">
-.jbd-form {
-    padding: 0;
-    margin: 0;
-    margin-top: 85px !important;
-}
-
-.jbd-form-cont {
-    background-color: #ffffff;
-    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
-    margin: 0 auto;
-    padding: 10px;
-    min-height: 92vh;
-    width: 84%;
-}
-.jbd-replce {
-    height: 5px;
-}
-.dynamic-form {
-    .el-input {
-        width: 100%;
+    .jbd-form {
+        padding: 0;
+        margin: 0;
+        margin-top: 85px !important;
     }
-    .el-select {
-        width: 100%;
+    .jbd-form-cont {
+        background-color: #ffffff;
+        box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+        margin: 0 auto;
+        padding: 10px;
+        min-height: 92vh;
+        width: 84%;
     }
-
-    .el-collapse-item__header.is-active {
-        border-bottom: 1px solid #ebeef5;
-        margin-bottom: 5px;
+    .jbd-replce {
+        height: 5px;
     }
-    .form-header {
-        border-bottom: 1px solid #2b34410d;
-        margin-bottom: 5px;
-        .title {
-            font-weight: bold;
-            color: #222;
-            text-align: left;
-            padding: 8px 10px 10px;
-            margin: 0;
-        }
-        .desc {
-            word-wrap: break-word;
-            word-break: normal;
-            text-indent: 0;
-            line-height: 1.6;
-            margin: 0 0 11px;
-            padding: 3px 30px 8px;
+    .dynamic-form {
+        .el-input {
+            width: 100%;
         }
-    }
-    .dynamic-form-table-item__readonly {
-        margin-bottom: 0;
-    }
-
-    //===================border-form====================
-    .ibps-border-form {
-        border: 1px solid #cfd7e5;
-
-        .el-form-item {
-            border-top: 1px solid #cfd7e5;
+        .el-select {
+            width: 100%;
         }
-
-        .el-form-item__content:before {
-            width: 1px;
-            background: #cfd7e5;
-            display: block;
-            content: '';
-            position: absolute;
-            left: 0;
-            top: 0;
-            bottom: -20px;
+        .el-collapse-item__header.is-active {
+            border-bottom: 1px solid #ebeef5;
+            margin-bottom: 5px;
         }
-
-        .el-form-item__content .el-form-item__error {
-            left: 5px;
-        }
-
-        .el-form--label-top .el-form-item__content:before,
-        .no-label-form-item .el-form-item__content:before {
-            background: transparent;
-        }
-
-        .el-row + .el-row {
-            border-top: 1px solid #cfd7e5;
-        }
-
-        .el-col + .el-col {
-            border-left: 1px solid #cfd7e5;
-        }
-
-        .el-col {
-            overflow: hidden;
-        }
-
-        .el-form-item__content {
-            padding: 5px;
-            padding-bottom: 0;
+        .form-header {
+            border-bottom: 1px solid #2b34410d;
+            margin-bottom: 5px;
+            .title {
+                font-weight: bold;
+                color: #222;
+                text-align: left;
+                padding: 8px 10px 10px;
+                margin: 0;
+            }
+            .desc {
+                word-wrap: break-word;
+                word-break: normal;
+                text-indent: 0;
+                line-height: 1.6;
+                margin: 0 0 11px;
+                padding: 3px 30px 8px;
+            }
         }
-
-        .el-form-item__label {
-            padding: 5px;
+        .dynamic-form-table-item__readonly {
+            margin-bottom: 0;
         }
-
-        .el-table {
+        //===================border-form====================
+        .ibps-border-form {
+            border: 1px solid #cfd7e5;
             .el-form-item {
-                border-top: 0;
+                border-top: 1px solid #cfd7e5;
             }
             .el-form-item__content:before {
-                width: 0;
+                width: 1px;
+                background: #cfd7e5;
+                display: block;
+                content: '';
+                position: absolute;
+                left: 0;
+                top: 0;
+                bottom: -20px;
+            }
+            .el-form-item__content .el-form-item__error {
+                left: 5px;
+            }
+            .el-form--label-top .el-form-item__content:before,
+            .no-label-form-item .el-form-item__content:before {
+                background: transparent;
+            }
+            .el-row + .el-row {
+                border-top: 1px solid #cfd7e5;
+            }
+            .el-col + .el-col {
+                border-left: 1px solid #cfd7e5;
+            }
+            .el-col {
+                overflow: hidden;
             }
             .el-form-item__content {
-                padding: 0;
+                padding: 5px;
+                padding-bottom: 0;
+            }
+            .el-form-item__label {
+                padding: 5px;
+            }
+            .el-table {
+                .el-form-item {
+                    border-top: 0;
+                }
+                .el-form-item__content:before {
+                    width: 0;
+                }
+                .el-form-item__content {
+                    padding: 0;
+                }
             }
         }
     }
-}
 </style>

+ 39 - 24
src/business/platform/form/utils/JForm.js

@@ -16,9 +16,13 @@ import getserial from './custom/serialNumber' //编码规则
 import pintText from './custom/pintText.js' //打印规则
 import repostCurd from './custom/joinCURD.js' //增删改查规则
 import getDate from './custom/getDateRule.js' //获取年月日
-import { snapshoot,seal,sealPre,
+import {
+  snapshoot,
+  seal,
+  sealPre,
   getSigPageUrl,
-  generateUUID, } from '@/api/platform/file/attachment' //印章,快照
+  generateUUID,
+} from '@/api/platform/file/attachment' //印章,快照
 const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
 import pinyin4js from 'pinyin4js';
 import store from '@/store'
@@ -32,14 +36,14 @@ if (!window.JForm) {
   JForm = window.JForm
 }
 /**
-   * 封装自定义代码扩展接口
-   */
+ * 封装自定义代码扩展接口
+ */
 _.extend(JForm, {
   // 已经初始化
   _isInitialization: false,
   _isLoadJavaScriptFile: false,
   // 初始化表单
-  _init: function(form) {
+  _init: function (form) {
     if (this._isInitialization) return
     this.$form = form
     this.$vue = Vue
@@ -49,13 +53,14 @@ _.extend(JForm, {
     this.$pyjs = pinyin4js
     this.$getDate = getDate //获取封装好的年月日
     this.$getNumBer = getserial //封装获取流水号
-    this.$getPint =  pintText //封装打开报表
+    this.$getPint = pintText //封装打开报表
     this.$curdPost = repostCurd //封装通用增删改查
-    this.$snapshoot = snapshoot //报表快照
+    this.$snapshoot = snapshoot //报表快照(经过润乾)
     this.$seal = seal //对报表进行印章
     this.$sealPre = sealPre // 对报表进行手动印章->预处理
     this.$getSigPageUrl = getSigPageUrl // 对报表进行手动印章->预处理->签章页面url
     this.$generateUUID = generateUUID // 自定义规则自动生成uuid
+    
     this._ = _
     this.$store = store
     this.$router = router //添加router对象
@@ -63,7 +68,7 @@ _.extend(JForm, {
   },
 
   // 表单加载
-  _onLoad: function(form) {
+  _onLoad: function (form) {
     this._init(form)
     if (_.isFunction(this.onLoad)) {
       this.onLoad(form)
@@ -71,61 +76,71 @@ _.extend(JForm, {
   },
 
   // 加载按钮
-  _onLoadActions: function(form, action, button, type) {
+  _onLoadActions: function (form, action, button, type) {
     if (_.isFunction(this.onLoadActions)) {
       return this.onLoadActions(form, action, button, type)
     }
   },
 
   // 表单校验
-  _onValidate: function(form, callback) {
+  _onValidate: function (form, callback) {
     if (_.isFunction(this.onValidate)) {
       return this.onValidate(form, callback)
     }
-    if (_.isFunction(callback)) { callback(true) }
+    if (_.isFunction(callback)) {
+      callback(true)
+    }
   },
 
   // 按钮提交前事件
-  _beforeSubmit: function(form, action, postValue, callback) {
+  _beforeSubmit: function (form, action, postValue, callback) {
     if (_.isFunction(this.beforeSubmit)) {
-      try{
-        return  this.beforeSubmit(form, action, postValue, callback)
-      }catch(e){
+      try {
+        return this.beforeSubmit(form, action, postValue, callback)
+      } catch (e) {
         return callback(true)
       }
     }
-    if (_.isFunction(callback)) { callback(true) }
+    if (_.isFunction(callback)) {
+      callback(true)
+    }
   },
 
   // 按钮提交后事件
-  _afterSubmit: function(form, action, postValue, callback) {
+  _afterSubmit: function (form, action, postValue, callback) {
     if (_.isFunction(this.afterSubmit)) {
       return this.afterSubmit(form, action, postValue, callback)
     }
-    if (_.isFunction(callback)) { callback(true) }
+    if (_.isFunction(callback)) {
+      callback(true)
+    }
   },
   // 子表按钮的提交前事件
-  _beforeSubButton: function(tableForm, action, position, params, callback) {
+  _beforeSubButton: function (tableForm, action, position, params, callback) {
     if (_.isFunction(this.beforeSubButton)) {
       return this.beforeSubButton(tableForm, action, position, params, callback)
     }
-    if (_.isFunction(callback)) { callback(true) }
+    if (_.isFunction(callback)) {
+      callback(true)
+    }
   },
   // 子表按钮的提交后事件
-  _afterSubButton: function(tableForm, action, position, params, callback) {
+  _afterSubButton: function (tableForm, action, position, params, callback) {
     if (_.isFunction(this.afterSubButton)) {
       return this.afterSubButton(tableForm, action, position, params, callback)
     }
-    if (_.isFunction(callback)) { callback(true) }
+    if (_.isFunction(callback)) {
+      callback(true)
+    }
   },
   // 子表统计
-  _summaryMethod: function(tableForm, tableName, params) {
+  _summaryMethod: function (tableForm, tableName, params) {
     if (_.isFunction(this.summaryMethod)) {
       return this.summaryMethod(tableForm, tableName, params)
     }
   },
   // 清理所有自定义事件
-  cleanEvents: function() {
+  cleanEvents: function () {
     this.onLoad = null
     this.onLoadActions = null
     this.onValidate = null

+ 3 - 1
src/store/getters.js

@@ -32,5 +32,7 @@ export default {
   permissions: state => state.ibps.menu.permissions, //  拥有的权限
   jianCeDuiXiangId: state => state.ibps.jianCeDuiXiangId ? state.ibps.jianCeDuiXiangId : '',
   myform: state => state.ibps.myform ? state.ibps.myform : '',
-  jianCeCanShuId: state => state.ibps.jianCeCanShuId ? state.ibps.jianCeCanShuId : ''
+  jianCeCanShuId: state => state.ibps.jianCeCanShuId ? state.ibps.jianCeCanShuId : '',
+  // 所有检测项目名称及流程key数组
+  testingList: state => state.ibps.param && state.ibps.param.testingList ? state.ibps.param.testingList : []
 }

+ 26 - 20
src/store/modules/ibps/modules/param.js

@@ -1,24 +1,30 @@
-
-
 export default {
-  namespaced: true,
-  state: {
-    // 所有菜单
-    jianCeDuiXiangId: '',
-    jianCeCanShuId:'',
-    myform: '',
-  },
-
-  mutations: {
-
-    jianCeDuiXiangIdSet(state, jianCeDuiXiang) {
-      state.jianCeDuiXiangId = jianCeDuiXiang.jianCeDuiXiangId || ''
+    namespaced: true,
+    state: {
+        // 所有菜单
+        jianCeDuiXiangId: '',
+        jianCeCanShuId: '',
+        myform: '',
+        // 所有检测项目名称及流程key数组
+        testingList: []
     },
-    myformSet(state, myform) {
-      state.myform = myform.myform || ''
+    mutations: {
+        jianCeDuiXiangIdSet(state, jianCeDuiXiang) {
+            state.jianCeDuiXiangId = jianCeDuiXiang.jianCeDuiXiangId || ''
+        },
+        myformSet(state, myform) {
+            state.myform = myform.myform || ''
+        },
+        jianCeCanShuIdSet(state, jianCeCanShu) {
+            state.jianCeCanShuId = jianCeCanShu.jianCeCanShuId || ''
+        },
+        testingList(state, data) {
+            state.testingList = data.length ? data : []
+        }
     },
-    jianCeCanShuIdSet(state, jianCeCanShu) {
-      state.jianCeCanShuId = jianCeCanShu.jianCeCanShuId || ''
-    },
-  }
+    actions: {
+        setTestingList({ commit }, data){
+            commit('testingList', data)
+        }
+    }
 }

+ 409 - 351
src/views/platform/bpmn/bpmTask/list.vue

@@ -1,369 +1,427 @@
 <template>
-  <div class="main-container">
-    <ibps-crud
-      ref="crud"
-      :height="height"
-      :data="listData"
-      :toolbars="listConfig.toolbars"
-      :search-form="listConfig.searchForm"
-      :pk-key="pkKey"
-      :columns="listConfig.columns"
-      :row-handle="listConfig.rowHandle"
-      :pagination="pagination"
-      :loading="loading"
-      :index-row="false"
-      @column-link-click="handleLinkClick"
-      @action-event="handleAction"
-      @sort-change="handleSortChange"
-      @pagination-change="handlePaginationChange"
-    >
-      <template slot="headerIcon" slot-scope="scope">
-        <span>{{ scope.column.label }}</span>
-        <el-tooltip
-          class="item"
-          effect="light"
-          placement="bottom"
+    <div class="main-container">
+        <ibps-crud
+            ref="crud"
+            :height="height"
+            :data="listData"
+            :toolbars="listConfig.toolbars"
+            :search-form="listConfig.searchForm"
+            :pk-key="pkKey"
+            :columns="listConfig.columns"
+            :row-handle="listConfig.rowHandle"
+            :pagination="pagination"
+            :loading="loading"
+            :index-row="false"
+            @column-link-click="handleLinkClick"
+            @action-event="handleAction"
+            @sort-change="handleSortChange"
+            @pagination-change="handlePaginationChange"
         >
-          <div slot="content">
-            此列是查询“流程定义-增加用户设置”的所有用户信息;<br>
-            当为空的时候,可在‘候选范围’知道原因,如:<br>
-            设置用户类型为“某组织负责人”且不抽取,在‘用户管理’模块下未配置相关基础数据时,则在审批运行中此列会为空;<br>
-            此时,可在“候选范围”显示的“某组织负责人”信息快速定位原因!<br>
-          </div>
-          <ibps-icon name="help" style="color:#dd5b44;" />
-        </el-tooltip>
-      </template>
-    </ibps-crud>
-    <approve-dialog
-      :visible="dialogFormVisible"
-      :title="title"
-      :task-id="editId"
-      :action="action"
-      class="bpm-task-dialog"
-      @callback="search"
-      @close="visible => dialogFormVisible = visible"
-    />
-    <!-- 人员选择器 -->
-    <ibps-employee-selector-dialog
-      :visible="selectorVisible"
-      :value="[]"
-      multiple
-      @close="visible => selectorVisible = visible"
-      @action-event="handleSelectorActionEvent"
-    />
+            <template slot="headerIcon" slot-scope="scope">
+                <span>{{ scope.column.label }}</span>
+                <el-tooltip class="item" effect="light" placement="bottom">
+                    <div slot="content">
+                        此列是查询“流程定义-增加用户设置”的所有用户信息;<br />
+                        当为空的时候,可在‘候选范围’知道原因,如:<br />
+                        设置用户类型为“某组织负责人”且不抽取,在‘用户管理’模块下未配置相关基础数据时,则在审批运行中此列会为空;<br />
+                        此时,可在“候选范围”显示的“某组织负责人”信息快速定位原因!<br />
+                    </div>
+                    <ibps-icon name="help" style="color: #dd5b44" />
+                </el-tooltip>
+            </template>
+        </ibps-crud>
+        <approve-dialog
+            :visible="dialogFormVisible"
+            :title="title"
+            :task-id="editId"
+            :action="action"
+            class="bpm-task-dialog"
+            @callback="search"
+            @close="visible => (dialogFormVisible = visible)"
+        />
+        <!-- 人员选择器 -->
+        <ibps-employee-selector-dialog
+            :visible="selectorVisible"
+            :value="[]"
+            multiple
+            @close="visible => (selectorVisible = visible)"
+            @action-event="handleSelectorActionEvent"
+        />
 
-    <bpmn-formrender
-      :visible="bpmnFormrenderDialogVisible"
-      :task-id="editId"
-      :title="flowName"
-      @callback="search"
-      @close="visible => bpmnFormrenderDialogVisible = visible"
-    />
-  </div>
+        <bpmn-formrender
+            :visible="bpmnFormrenderDialogVisible"
+            :task-id="editId"
+            :title="flowName"
+            :processName="processName"
+            @callback="search"
+            @close="visible => (bpmnFormrenderDialogVisible = visible)"
+        />
+    </div>
 </template>
 
 <script>
-import { queryPageList, remove, batchSuspendProcess, batchRecoverProcess, assignee } from '@/api/platform/bpmn/bpmTask'
-import ActionUtils from '@/utils/action'
-import FixHeight from '@/mixins/height'
-import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
-//import getFormDataFlag from '@/api/platform/form/common.js'
-import request from '@/utils/request'
-import { FORM_URL } from '@/api/baseUrl'
-import { BUSINESS_BASE_URL } from '@/api/baseUrl'
+    import { queryPageList, remove, batchSuspendProcess, batchRecoverProcess, assignee } from '@/api/platform/bpmn/bpmTask'
+    import ActionUtils from '@/utils/action'
+    import FixHeight from '@/mixins/height'
+    import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
+    //import getFormDataFlag from '@/api/platform/form/common.js'
+    import request from '@/utils/request'
+    import { FORM_URL } from '@/api/baseUrl'
+    import { BUSINESS_BASE_URL } from '@/api/baseUrl'
 
-export default {
-  components: {
-    'ibps-employee-selector-dialog': () => import('@/business/platform/org/employee/dialog'),
-    'approve-dialog': () => import('@/business/platform/bpmn/form-ext/approve'),
-    'bpmn-formrender': () => import('@/business/platform/bpmn/form/dialog')
-  },
-  mixins: [FixHeight],
-  data() {
-    return {
-      dialogFormVisible: false, // 弹窗
-      bpmnFormrenderDialogVisible: false, // 表单
-      editId: '', // 编辑dialog需要使用
-      action: 'agree', // 打开弹窗的动作
-      pkKey: 'id', // 主键  如果主键不是pk需要传主键
-      flowName:'',
-      selectorVisible: false,
-      ids: '',
-      title: '',
-      loading: true,
-      height: document.clientHeight,
+    export default {
+        components: {
+            'ibps-employee-selector-dialog': () => import('@/business/platform/org/employee/dialog'),
+            'approve-dialog': () => import('@/business/platform/bpmn/form-ext/approve'),
+            'bpmn-formrender': () => import('@/business/platform/bpmn/form/dialog')
+        },
+        mixins: [FixHeight],
+        data() {
+            return {
+                dialogFormVisible: false, // 弹窗
+                bpmnFormrenderDialogVisible: false, // 表单
+                editId: '', // 编辑dialog需要使用
+                action: 'agree', // 打开弹窗的动作
+                pkKey: 'id', // 主键  如果主键不是pk需要传主键
+                flowName: '',
+                processName: '',
+                selectorVisible: false,
+                ids: '',
+                title: '',
+                loading: true,
+                height: document.clientHeight,
 
-      listData: [],
-      pagination: {},
-      sorts: {},
-      listConfig: {
-        toolbars: [
-          { key: 'search' },
-          { key: 'agree', label: '同意', icon: 'ibps-icon-check-square-o' },
-          { key: 'stop', label: '终止', icon: 'ibps-icon-stop' },
-          { key: 'suspend', label: '挂起', icon: 'ibps-icon-ioxhost' },
-          { key: 'recover', label: '恢复', icon: 'ibps-icon-ioxhost' },
-          { key: 'assignee', label: '指定执行人', icon: 'ibps-icon-cog' }
-        ],
-        searchForm: {
-          forms: [
-            { prop: 'Q^subject_^SL', label: '请求标题' },
-            { prop: 'Q^NAME_^SL', label: '当前节点' },
-            {
-              prop: ['Q^CREATE_TIME_^DL', 'Q^CREATE_TIME_^DG'],
-              label: '创建时间',
-              fieldType: 'daterange'
+                listData: [],
+                pagination: {},
+                sorts: {},
+                listConfig: {
+                    toolbars: [
+                        {
+                            key: 'search'
+                        },
+                        {
+                            key: 'agree',
+                            label: '同意',
+                            icon: 'ibps-icon-check-square-o'
+                        },
+                        {
+                            key: 'stop',
+                            label: '终止',
+                            icon: 'ibps-icon-stop'
+                        },
+                        {
+                            key: 'suspend',
+                            label: '挂起',
+                            icon: 'ibps-icon-ioxhost'
+                        },
+                        {
+                            key: 'recover',
+                            label: '恢复',
+                            icon: 'ibps-icon-ioxhost'
+                        },
+                        {
+                            key: 'assignee',
+                            label: '指定执行人',
+                            icon: 'ibps-icon-cog'
+                        }
+                    ],
+                    searchForm: {
+                        forms: [
+                            {
+                                prop: 'Q^subject_^SL',
+                                label: '请求标题'
+                            },
+                            {
+                                prop: 'Q^NAME_^SL',
+                                label: '当前节点'
+                            },
+                            {
+                                prop: ['Q^CREATE_TIME_^DL', 'Q^CREATE_TIME_^DG'],
+                                label: '创建时间',
+                                fieldType: 'daterange'
+                            }
+                        ]
+                    },
+                    // 表格字段配置
+                    columns: [
+                        {
+                            prop: 'subject',
+                            label: '请求标题',
+                            link: 'dialog'
+                        },
+                        {
+                            prop: 'name',
+                            label: '当前节点',
+                            width: 200
+                        },
+                        {
+                            prop: 'ownerName',
+                            label: '候选人',
+                            width: 200,
+                            headerName: 'headerIcon'
+                        },
+                        {
+                            prop: 'partyTypeName',
+                            label: '候选人范围',
+                            width: 200
+                        },
+                        {
+                            prop: 'createTime',
+                            label: '创建时间',
+                            sortable: 'custom',
+                            width: 150
+                        }
+                    ],
+                    rowHandle: {
+                        actions: [
+                            {
+                                key: 'assignee',
+                                label: '指定执行人',
+                                icon: 'ibps-icon-cog'
+                            },
+                            {
+                                key: 'approve',
+                                label: '审批',
+                                icon: 'ibps-icon-edit'
+                            }
+                        ]
+                    }
+                }
             }
-          ]
         },
-        // 表格字段配置
-        columns: [
-          { prop: 'subject', label: '请求标题', link: 'dialog' },
-          { prop: 'name', label: '当前节点', width: 200 },
-          { prop: 'ownerName', label: '候选人', width: 200, headerName: 'headerIcon' },
-          { prop: 'partyTypeName', label: '候选人范围', width: 200 },
-          { prop: 'createTime', label: '创建时间', sortable: 'custom', width: 150 }
-        ],
-        rowHandle: {
-          actions: [{
-            key: 'assignee',
-            label: '指定执行人',
-            icon: 'ibps-icon-cog'
-          }, {
-            key: 'approve',
-            label: '审批',
-            icon: 'ibps-icon-edit'
-          }]
-        }
-      }
-    }
-  },
-  created() {
-    this.loadData()
-  },
-  methods: {
-    // 加载数据
-    loadData() {
-      this.loading = true
-      queryPageList(this.getSearcFormData()).then(response => {
-        ActionUtils.handleListData(this, response.data)
-        this.loading = false
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    /**
-     * 获取格式化参数
-     */
-    getSearcFormData() {
-      return ActionUtils.formatParams(
-        this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {},
-        this.pagination,
-        this.sorts)
-    },
-    /**
-     * 处理分页事件
-     */
-    handlePaginationChange(page) {
-      ActionUtils.setPagination(this.pagination, page)
-      this.loadData()
-    },
-    /**
-     * 处理排序
-     */
-    handleSortChange(sort) {
-      ActionUtils.setSorts(this.sorts, sort)
-      this.loadData()
-    },
-    /**
-     * 查询
-     */
-    search() {
-      this.loadData()
-    },
-    /**
-     * 处理按钮事件
-     */
-    handleAction(command, position, selection, data) {
-      switch (command) {
-        case 'search':// 查询
-          ActionUtils.setFirstPagination(this.pagination)
-          this.search()
-          break
-        case 'stop':// 终止
-          ActionUtils.selectedMultiRecord(selection).then((ids) => {
-            this.handleBatchApprove(ids, 'stop')
-            this.title = '批量终止流程'
-          }).catch(() => { })
-          break
-        case 'agree':// 同意
-          ActionUtils.selectedMultiRecord(selection).then((ids) => {
-            this.handleBatchApprove(ids, 'agree')
-            this.title = '批量同意审批'
-          }).catch(() => { })
-          break
-        case 'suspend':// 挂起
-          ActionUtils.selectedMultiRecord(selection).then((ids) => {
-            this.handleSuspend(ids)
-          }).catch(() => { })
-          break
-        case 'recover':// 恢复
-          ActionUtils.selectedMultiRecord(selection).then((ids) => {
-            this.handleRecover(ids)
-          }).catch(() => { })
-          break
-        case 'assignee':// 指定执行人
-          ActionUtils.selectedMultiRecord(selection).then((ids) => {
-            this.handleAssignee(ids)
-          }).catch(() => { })
-          break
-        case 'approve':// 审批
-          ActionUtils.selectedMultiRecord(selection).then((ids) => {
-            this.handleApprove(ids)
-          }).catch(() => { })
-          break
-        default:
-          break
-      }
-    },
-    /**
-     * 处理审批
-     */
-    handleBatchApprove(id = '', action = 'agree') {
-      this.editId = id
-      this.action = action
-      this.dialogFormVisible = true
-    },
-    /**
-     * 处理删除
-     */
-    handleRemove(ids) {
-      remove({ levelIds: ids }).then(response => {
-        ActionUtils.removeSuccessMessage()
-        this.search()
-      }).catch(() => {})
-    },
-    /**
-     * 批量挂起任务
-     */
-    handleSuspend(ids) {
-      this.$confirm('确认批量挂起流程任务?', '信息').then(() => {
-        batchSuspendProcess({ taskIds: ids }).then(() => {
-          ActionUtils.successMessage('挂起流程任务成功')
-          this.search()
-        }).catch(error => {
-          console.error(error)
-        })
-      })
-    },
-    /**
-     * 批量挂起任务
-     */
-    handleRecover(ids) {
-      this.$confirm('确认批量恢复流程任务?', '信息').then(() => {
-        batchRecoverProcess({ taskIds: ids }).then(() => {
-          ActionUtils.successMessage('恢复流程任务成功')
-          this.search()
-        }).catch(error => {
-          console.error(error)
-        })
-      })
-    },
-    /**
-     * 指定执行人
-     */
-    handleAssignee(ids) {
-      this.ids = ids
-      this.selectorVisible = true
-    },
-    handleSelectorActionEvent(buttonKey, data) {
-      switch (buttonKey) {
-        case 'confirm':// 确定
-          this.handleConfirm(data)
-          break
-      }
-    },
-    handleConfirm(data) {
-      assignee({
-        taskId: this.ids,
-        userId: data.map((d) => { return d.id }).join(',')
-      }).then(response => {
-        this.selectorVisible = false
-        ActionUtils.success('指定执行人成功!')
-        this.search()
-      })
-    },
-    /**
-     * 审批
-     */
-    handleApprove(id) {
-      let this_ = this
-// this_.editId = id
-//                             this_.bpmnFormrenderDialogVisible = true
-//                             return
-console.log("11111",request)
-        // getFormDataFlag(JSON.stringify({taskId:id})).then(response => {
-        //   console.log("111")
-        //   if( response.data.data=='Y'){
-        //     this_.editId = id
-        //     this_.bpmnFormrenderDialogVisible = true
-        //   }else{
-        //                    ActionUtils.success('任务生成中、请稍后重试...!')
-        //                    this_.search()
-        //   }
-        //  })
+        created() {
+            this.loadData()
+        },
+        methods: {
+            // 加载数据
+            loadData() {
+                this.loading = true
+                queryPageList(this.getSearcFormData()).then(response => {
+                    ActionUtils.handleListData(this, response.data)
+                    this.loading = false
+                }).catch(() => {
+                    this.loading = false
+                })
+            },
+            /**
+             * 获取格式化参数
+             */
+            getSearcFormData() {
+                return ActionUtils.formatParams(
+                    this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {},
+                    this.pagination,
+                    this.sorts
+                )
+            },
+            /**
+             * 处理分页事件
+             */
+            handlePaginationChange(page) {
+                ActionUtils.setPagination(this.pagination, page)
+                this.loadData()
+            },
+            /**
+             * 处理排序
+             */
+            handleSortChange(sort) {
+                ActionUtils.setSorts(this.sorts, sort)
+                this.loadData()
+            },
+            /**
+             * 查询
+             */
+            search() {
+                this.loadData()
+            },
+            /**
+             * 处理按钮事件
+             */
+            handleAction(command, position, selection, data) {
+                switch (command) {
+                    case 'search': // 查询
+                        ActionUtils.setFirstPagination(this.pagination)
+                        this.search()
+                        break
+                    case 'stop': // 终止
+                        ActionUtils.selectedMultiRecord(selection).then(ids => {
+                            this.handleBatchApprove(ids, 'stop')
+                            this.title = '批量终止流程'
+                        }).catch(() => {})
+                        break
+                    case 'agree': // 同意
+                        ActionUtils.selectedMultiRecord(selection).then(ids => {
+                            this.handleBatchApprove(ids, 'agree')
+                            this.title = '批量同意审批'
+                        }).catch(() => {})
+                        break
+                    case 'suspend': // 挂起
+                        ActionUtils.selectedMultiRecord(selection).then(ids => {
+                            this.handleSuspend(ids)
+                        }).catch(() => {})
+                        break
+                    case 'recover': // 恢复
+                        ActionUtils.selectedMultiRecord(selection).then(ids => {
+                            this.handleRecover(ids)
+                        }).catch(() => {})
+                        break
+                    case 'assignee': // 指定执行人
+                        ActionUtils.selectedMultiRecord(selection).then(ids => {
+                            this.handleAssignee(ids)
+                        }).catch(() => {})
+                        break
+                    case 'approve': // 审批
+                        ActionUtils.selectedMultiRecord(selection).then(ids => {
+                            this.handleApprove(ids)
+                        }).catch(() => {})
+                        break
+                    default:
+                        break
+                }
+            },
+            /**
+             * 处理审批
+             */
+            handleBatchApprove(id = '', action = 'agree') {
+                this.editId = id
+                this.action = action
+                this.dialogFormVisible = true
+            },
+            /**
+             * 处理删除
+             */
+            handleRemove(ids) {
+                remove({ levelIds: ids }).then(response => {
+                    ActionUtils.removeSuccessMessage()
+                    this.search()
+                }).catch(() => {})
+            },
+            /**
+             * 批量挂起任务
+             */
+            handleSuspend(ids) {
+                this.$confirm('确认批量挂起流程任务?', '信息').then(() => {
+                    batchSuspendProcess({ taskIds: ids }).then(() => {
+                        ActionUtils.successMessage('挂起流程任务成功')
+                        this.search()
+                    }).catch(error => {
+                        console.error(error)
+                    })
+                })
+            },
+            /**
+             * 批量挂起任务
+             */
+            handleRecover(ids) {
+                this.$confirm('确认批量恢复流程任务?', '信息').then(() => {
+                    batchRecoverProcess({ taskIds: ids }).then(() => {
+                        ActionUtils.successMessage('恢复流程任务成功')
+                        this.search()
+                    }).catch(error => {
+                        console.error(error)
+                    })
+                })
+            },
+            /**
+             * 指定执行人
+             */
+            handleAssignee(ids) {
+                this.ids = ids
+                this.selectorVisible = true
+            },
+            handleSelectorActionEvent(buttonKey, data) {
+                switch (buttonKey) {
+                    case 'confirm': // 确定
+                        this.handleConfirm(data)
+                        break
+                }
+            },
+            handleConfirm(data) {
+                assignee({
+                    taskId: this.ids,
+                    userId: data.map(d => { return d.id }).join(',')
+                }).then(response => {
+                    this.selectorVisible = false
+                    ActionUtils.success('指定执行人成功!')
+                    this.search()
+                })
+            },
+            /**
+             * 审批
+             */
+            handleApprove(id) {
+                // this_.editId = id
+                // this_.bpmnFormrenderDialogVisible = true
+                // return
 
-        // 打开表单前给给flowName赋值,避免流程节点状态bug
-        this.flowName = this.listData.find(item => item.id === id).name
-        
-         request({
-                   url: BUSINESS_BASE_URL() + '/getFormData/flag',
-                    method: 'post',
-                    data: JSON.stringify({taskId:id})
-                    }).then(response => {
+                // getFormDataFlag(JSON.stringify({taskId:id})).then(response => {
+                //     console.log("111")
+                //     if( response.data.data=='Y'){
+                //         this_.editId = id
+                //         this_.bpmnFormrenderDialogVisible = true
+                //     }else{
+                //         ActionUtils.success('任务生成中、请稍后重试...!')
+                //         this_.search()
+                //     }
+                // })
 
-          if( response.data!='N'){
-            this_.editId = id
-            this_.bpmnFormrenderDialogVisible = true
-          }else{
-                           ActionUtils.success('任务生成中、请稍后重试...!')
-                           this_.search()
-          }
-         })
+                // 打开表单前获取flowName和processName,避免流程节点状态bug
+                let selected = this.listData.find(item => item.id === id)
+                this.flowName = selected.name
+                this.processName = this.getProjectName(selected.procDefKey)
 
-                   //       let sql = "select ID_,HOT_READ_ from ibps_bpm_tasks where TASK_ID_='"+id+"'"
-                   //  curdPost('sql',sql).then(response => {
-                   //      if( response.variables.data.length>0){
-                   //        if( response.variables.data[0].HOT_READ_=='1'){
-                   //         this_.editId = id
-                   //         this_.bpmnFormrenderDialogVisible = true
+                request({
+                    url: BUSINESS_BASE_URL() + '/getFormData/flag',
+                    method: 'post',
+                    data: JSON.stringify({ taskId: id })
+                }).then(response => {
+                    if (response.data != 'N') {
+                        this.editId = id
+                        this.bpmnFormrenderDialogVisible = true
+                    } else {
+                        ActionUtils.success('任务生成中、请稍后重试...!')
+                        this.search()
+                    }
+                })
 
-                   //        }else{
-                   //         ActionUtils.success('任务生成中、请稍后重试...!')
-                   //         this_.search()
-                   //        }
-                   //      }else{
-                   //         ActionUtils.success('任务状态已过期、请刷新页面...!')
-                   //         this_.search()
-                   //        }
-                   // })
-    },
-    handleLinkClick(data, columns) {
-      this.flowName = data.name
-      this.handleApprove(data[this.pkKey])
+                // let sql = "select ID_,HOT_READ_ from ibps_bpm_tasks where TASK_ID_='"+id+"'"
+                // curdPost('sql',sql).then(response => {
+                //     if( response.variables.data.length>0){
+                //         if( response.variables.data[0].HOT_READ_=='1'){
+                //             this_.editId = id
+                //             this_.bpmnFormrenderDialogVisible = true
+                //         } else {
+                //             ActionUtils.success('任务生成中、请稍后重试...!')
+                //             this_.search()
+                //         }
+                //     } else {
+                //         ActionUtils.success('任务状态已过期、请刷新页面...!')
+                //         this_.search()
+                //     }
+                // })
+            },
+            handleLinkClick(data, columns) {
+                this.flowName = data.name
+                this.processName = this.getProjectName(data.procDefKey)
+                this.handleApprove(data[this.pkKey])
+            },
+            // 获取检测流程对应的检测项目名称
+            getProjectName(v) {
+                const { testingList } = this.$store.getters
+                let res = testingList.find(item => item.processKey === v)
+                return res ? res.name : ''
+            }
+        }
     }
-  }
-}
 </script>
 <style lang="scss">
-// .bpm-task-dialog{
-//   .el-dialog__body{
-//     height:  calc(27vh - 120px) !important;
-//   }
-// }
-// .bpm-employee-dialog{
-//   .el-dialog__body{
-//     height:  calc(67vh - 140px) !important;
-//   }
-// }
+    // .bpm-task-dialog {
+    //     .el-dialog__body {
+    //         height: calc(27vh - 120px) !important;
+    //     }
+    // }
+    // .bpm-employee-dialog {
+    //     .el-dialog__body {
+    //         height: calc(67vh - 140px) !important;
+    //     }
+    // }
 </style>

Разница между файлами не показана из-за своего большого размера
+ 401 - 552
src/views/system/dashboard/components/new-home.vue


+ 469 - 488
src/views/system/dashboard/page.vue

@@ -6,16 +6,9 @@
         :scroll-delay="scrollDelay"
         type="full"
         class="ibps-desktop-page"
-        @scroll="
-            ({ x, y }) => {
-                scrollTop = y
-            }
-        "
+        @scroll="({ x, y }) => { scrollTop = y }"
     >
-        <newHome
-            @handleApprove="handleApprove"
-            @handleUnreadMessage="handleUnreadMessage"
-        >
+        <newHome @handleApprove="handleApprove" @handleUnreadMessage="handleUnreadMessage">
             <template slot="myslot">
                 <el-upload
                     style="display: inline-block"
@@ -27,13 +20,7 @@
                     :on-error="fileErr"
                     :on-success="handleSuccess"
                 >
-                    <el-button
-                        size="small"
-                        icon="el-icon-s-management"
-                        plain
-                        type="primary"
-                        >导入委托单</el-button
-                    >
+                    <el-button size="small" icon="el-icon-s-management" plain type="primary">导入委托单</el-button>
                 </el-upload>
 
                 <el-upload
@@ -47,13 +34,7 @@
                     :on-error="fileErr"
                     :on-success="handleSuccess"
                 >
-                    <el-button
-                        size="small"
-                        plain
-                        icon="el-icon-s-order"
-                        type="primary"
-                        >替换/新增报表</el-button
-                    >
+                    <el-button size="small" plain icon="el-icon-s-order" type="primary">替换/新增报表</el-button>
                 </el-upload>
 
                 <el-button
@@ -79,14 +60,14 @@
             :visible="dialogPreviewVisible"
             title="全屏预览"
             screen
-            @close="(visible) => (dialogPreviewVisible = visible)"
+            @close="visible => (dialogPreviewVisible = visible)"
         />
         <bpmn-formrender
             :visible="bpmnFormrenderDialogVisible"
             :def-id="defId"
             :task-id="taskId"
             :instance-id="instanceId"
-            @close="(visible) => (bpmnFormrenderDialogVisible = visible)"
+            @close="visible => (bpmnFormrenderDialogVisible = visible)"
             @callback="handleFlowCallback"
         />
 
@@ -95,7 +76,7 @@
             title="公告栏目明细"
             :visible="ibpsNewsDialogVisible"
             :readonly="true"
-            @close="(visible) => (ibpsNewsDialogVisible = visible)"
+            @close="visible => (ibpsNewsDialogVisible = visible)"
         />
 
         <ibps-message-dialog
@@ -103,176 +84,186 @@
             title="消息明细"
             :readonly="true"
             :visible="ibpsMessageDialogVisible"
-            @close="(visible) => (ibpsMessageDialogVisible = visible)"
+            @close="visible => (ibpsMessageDialogVisible = visible)"
         />
-
-        <!-- <div class="footer">
-            <span>© 2022{{ year == '2022' ? '' : `-${year}` }}深圳市金源信通科技有限公司开发 |<a href="https://beian.miit.gov.cn" target="_blank">粤ICP备2022077950号</a></span>
-        </div> -->
     </ibps-container>
 
     <!-- <template v-if="initLoading">
-    <template v-if="localSystem">
-      <ibps-grid-layout  v-if="layout && layout.length >0"  :layout.sync="layout"
-        :col-num="colNum"  :row-height="rowHeight"  :is-draggable="isDraggable"
-        :is-resizable="isResizable"  :is-mirrored="isMirrored"  :vertical-compact="verticalCompact"
-        :margin="margin"  :use-css-transforms="useCssTransforms">
-        <ibps-grid-item    v-for="(item,index) in layout"  :key="item.i"  :x="item.x"
-          :y="item.y"  :w="item.w"  :h="item.h"  :i="item.i">
-          <component  :is="'ibps-desktop-'+item.alias"
-            v-if="hasComponent(item.alias)"  :id="item.i" :ref="item.alias"
-            :alias="item.alias" :height="getHeight(item.h)"
-            @action-event="(command,data)=> handleActionEvent(command,data,index)"/>
-        </ibps-grid-item>
-      </ibps-grid-layout>
-      <el-alert  v-else-if="!loading"  :closable="false"    type="warning"  show-icon  style="height:50px">
-        <span slot="title">
-          未设置个人桌面布局,可以通过“<a href="javascript:void(0)" @click="goMyLayout">个人办公-》个人桌面布局</a>”进行设置
-        </span>
-      </el-alert>
+        <template v-if="localSystem">
+            <ibps-grid-layout
+                v-if="layout && layout.length >0"
+                :layout.sync="layout"
+                :col-num="colNum"
+                :row-height="rowHeight"
+                :is-draggable="isDraggable"
+                :is-resizable="isResizable"
+                :is-mirrored="isMirrored"
+                :vertical-compact="verticalCompact"
+                :margin="margin"
+                :use-css-transforms="useCssTransforms"
+            >
+                <ibps-grid-item
+                    v-for="(item,index) in layout"
+                    :key="item.i"
+                    :x="item.x"
+                    :y="item.y"
+                    :w="item.w"
+                    :h="item.h"
+                    :i="item.i"
+                >
+                    <component
+                        :is="'ibps-desktop-'+item.alias"
+                        v-if="hasComponent(item.alias)"
+                        :id="item.i" :ref="item.alias"
+                        :alias="item.alias"
+                        :height="getHeight(item.h)"
+                        @action-event="(command,data)=> handleActionEvent(command,data,index)"
+                    />
+                </ibps-grid-item>
+            </ibps-grid-layout>
+            <el-alert
+                v-else-if="!loading"
+                :closable="false"
+                type="warning"
+                show-icon
+                style="height:50px"
+            >
+                <span slot="title">未设置个人桌面布局,可以通过“<a href="javascript:void(0)" @click="goMyLayout">个人办公-》个人桌面布局</a>”进行设置</span>
+            </el-alert>
+        </template>
+        <!==不是本地系统==>
+        <template v-else>
+            <!==iframe方式==>
+            <iframe
+                v-if="systemUrlType === 'iframe'"
+                ref="systemrender"
+                class="ibps-container-frame"
+                frameborder="0"
+            />
+            <!==vue组件方式==>
+            <component
+                v-else
+                ref="systemrender"
+                :is="systemUrlName"
+                :params="systemUrlParams"
+            />
+        </template>
     </template> -->
-    <!--不是本地系统-->
-    <!-- <template v-else> -->
-    <!--iframe方式-->
-    <!-- <iframe  v-if="systemUrlType === 'iframe'"  ref="systemrender"   class="ibps-container-frame"  frameborder="0"/> -->
-    <!--vue组件方式-->
-    <!-- <component  :is="systemUrlName"  v-else  ref="systemrender"    :params="systemUrlParams"/> -->
-    <!-- </template> -->
-    <!-- </template> -->
 </template>
 
 <script>
-import { getMyDesktop } from '@/api/platform/desktop/myLayout'
-import { initColumn, isInit, getComponents } from './components'
-import { BASE_API, BUSINESS_BASE_URL } from '@/api/baseUrl' //引用导出地址
-//  网格布局组件
-import { GridLayout, GridItem } from 'vue-grid-layout'
-import IbpsBackToTop from '@/components/ibps-back-to-top'
-import Preview from '@/views/platform/desktop/column/preview'
-import BpmnFormrender from '@/business/platform/bpmn/form/dialog'
+    import { getMyDesktop } from '@/api/platform/desktop/myLayout'
+    import { initColumn, isInit, getComponents } from './components'
+    import { BASE_API, BUSINESS_BASE_URL } from '@/api/baseUrl' //引用导出地址
+    //  网格布局组件
+    import { GridLayout, GridItem } from 'vue-grid-layout'
+    import IbpsBackToTop from '@/components/ibps-back-to-top'
+    import Preview from '@/views/platform/desktop/column/preview'
+    import BpmnFormrender from '@/business/platform/bpmn/form/dialog'
 
-import IbpsNewsDialog from '@/views/platform/system/news/cms'
-import IbpsMessageDialog from '@/views/platform/message/inner/detail/dialog'
-import { StatisticsData } from '@/api/platform/system/jbdHome'
-import { StatisticsSign } from '@/api/platform/system/jbdHome'
-import { getToken } from '@/utils/auth'
+    import IbpsNewsDialog from '@/views/platform/system/news/cms'
+    import IbpsMessageDialog from '@/views/platform/message/inner/detail/dialog'
+    import { StatisticsData } from '@/api/platform/system/jbdHome'
+    import { StatisticsSign } from '@/api/platform/system/jbdHome'
+    import { getToken } from '@/utils/auth'
 
-import newHome from './components/new-home'
+    import newHome from './components/new-home'
 
-const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
+    import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
 
-export default {
-    components: {
-        'ibps-news-dialog': IbpsNewsDialog,
-        'ibps-message-dialog': IbpsMessageDialog,
-        IbpsBackToTop,
-        Preview,
-        newHome,
-        BpmnFormrender,
-        'ibps-grid-layout': GridLayout,
-        'ibps-grid-item': GridItem
-    },
-    data() {
-        const date = new Date()
-        return {
-            infoMessage: [],
-            uloadPath:
-                BASE_API() + BUSINESS_BASE_URL() + '/ck/task/importExcel',
-            reportPath:
-                BASE_API() +
-                BUSINESS_BASE_URL() +
-                '/sys/SysDataContext/replaceReportFile',
-            layout: null,
-            colNum: 24,
-            rowHeight: 30,
-            isDraggable: false,
-            isResizable: false,
-            isMirrored: false,
-            verticalCompact: true,
-            margin: [15, 15],
-            useCssTransforms: true,
-            taskId: '',
-            ibpsNewsDialogVisible: false,
-            newsEditId: '',
-            showRepost: true,
+    const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
 
-            ibpsMessageDialogVisible: false,
-            messageEditId: '',
+    export default {
+        components: {
+            'ibps-news-dialog': IbpsNewsDialog,
+            'ibps-message-dialog': IbpsMessageDialog,
+            IbpsBackToTop,
+            Preview,
+            newHome,
+            BpmnFormrender,
+            'ibps-grid-layout': GridLayout,
+            'ibps-grid-item': GridItem
+        },
+        data() {
+            return {
+                infoMessage: [],
+                uloadPath: BASE_API() + BUSINESS_BASE_URL() + '/ck/task/importExcel',
+                reportPath: BASE_API() + BUSINESS_BASE_URL() + '/sys/SysDataContext/replaceReportFile',
+                layout: null,
+                colNum: 24,
+                rowHeight: 30,
+                isDraggable: false,
+                isResizable: false,
+                isMirrored: false,
+                verticalCompact: true,
+                margin: [15, 15],
+                useCssTransforms: true,
+                taskId: '',
+                ibpsNewsDialogVisible: false,
+                newsEditId: '',
+                showRepost: true,
 
-            scrollDelay: 0,
-            scrollTop: 0,
-            initLoading: false,
-            loading: false,
-            id: '',
-            dialogPreviewVisible: false, // 预览
-            defaultData: [],
+                ibpsMessageDialogVisible: false,
+                messageEditId: '',
 
-            bpmnFormrenderDialogVisible: false, // 流程
-            defId: '',
-            taskId: '',
-            instanceId: '',
-            layoutIndex: '',
-            initInterval: null,
+                scrollDelay: 0,
+                scrollTop: 0,
+                initLoading: false,
+                loading: false,
+                id: '',
+                dialogPreviewVisible: false, // 预览
+                defaultData: [],
 
-            systemUrlType: 'iframe',
-            systemUrlName: '',
-            systemUrlParams: {},
-            alias: '',
-            headers: {
-                'X-Authorization-access_token': getToken()
+                bpmnFormrenderDialogVisible: false, // 流程
+                defId: '',
+                taskId: '',
+                instanceId: '',
+                layoutIndex: '',
+                initInterval: null,
+
+                systemUrlType: 'iframe',
+                systemUrlName: '',
+                systemUrlParams: {},
+                alias: '',
+                headers: {
+                    'X-Authorization-access_token': getToken()
+                }
+            }
+        },
+        computed: {
+            system() {
+                return this.$store.getters.system ? this.$store.getters.system : null
             },
-            year: date.getFullYear()
-        }
-    },
-    computed: {
-        system() {
-            return this.$store.getters.system
-                ? this.$store.getters.system
-                : null
+            systemAlias() {
+                return this.$store.getters.system ? this.$store.getters.system.alias : ''
+            },
+            localSystem() {
+                return this.system.isLocal
+            }
         },
-        systemAlias() {
-            return this.$store.getters.system
-                ? this.$store.getters.system.alias
-                : ''
+        mounted() {
+            if ('isNormal' == localStorage.getItem('statistic')) this.showRepost = false
+            this.initLoading = false
+            this.initData()
         },
-        localSystem() {
-            return this.system.isLocal
-        }
-    },
-    mounted() {
-        if ('isNormal' == localStorage.getItem('statistic'))
-            this.showRepost = false
-        this.initLoading = false
-        this.initData()
-    },
-    created() {
-        StatisticsData().then((data) => {
-            //将参数替换成对应参数
-            if (data.state === 200 && data.variables.data.length > 0) {
-                let h = this.$createElement,
-                    cont = data.variables.data,
-                    _this = this
-                for (let i = 0; i < cont.length; i++) {
-                    window.setTimeout(() => {
-                        this.infoMessage[i] = this.$notify.info({
-                            title: '定时任务:' + cont[i].ren_wu_biao_ti_,
-                            message: h('p', null, [
-                                h(
-                                    'span',
-                                    null,
-                                    '任务时间: ' + cont[i].ren_wu_shi_jian_
-                                ),
-                                h('br'),
-                                h('span', null, '任务内容: '),
-                                h(
-                                    'span',
-                                    { style: 'color: #FF8C00;font-size:12px;' },
-                                    cont[i].ding_shi_ren_wu_n
-                                ),
-                                h('br'),
-                                h(
-                                    'el-button',
-                                    {
+        created() {
+            this.getTestingData()
+            StatisticsData().then(data => {
+                //将参数替换成对应参数
+                if (data.state === 200 && data.variables.data.length > 0) {
+                    let h = this.$createElement,
+                        cont = data.variables.data
+                    for (let i = 0; i < cont.length; i++) {
+                        window.setTimeout(() => {
+                            this.infoMessage[i] = this.$notify.info({
+                                title: '定时任务:' + cont[i].ren_wu_biao_ti_,
+                                message: h('p', null, [
+                                    h('span', null, '任务时间: ' + cont[i].ren_wu_shi_jian_),
+                                    h('br'),
+                                    h('span', null, '任务内容: '),
+                                    h('span', { style: 'color: #FF8C00;font-size:12px;' }, cont[i].ding_shi_ren_wu_n),
+                                    h('br'),
+                                    h('el-button',{
                                         attrs: {
                                             size: 'mini',
                                             plain: true
@@ -282,347 +273,337 @@ export default {
                                                 this.infoMessage[i].close()
                                             } // 路由加载之后,调用关闭消息弹窗的方法
                                         }
-                                    },
-                                    '忽略关闭'
-                                )
-                            ]),
-                            duration: 0
-                        })
-                    }, 0)
-                }
-            }
-        })
-    },
-    beforeDestroy() {
-        for (let i = 0; i < this.infoMessage.length; i++) {
-            this.infoMessage[i].close()
-        }
-    },
-    methods: {
-        cancelInfo(cronId, title, num, processData, taskId) {
-            /* 调用流程*/
-            if (taskId) {
-                this.$router.push({
-                    name: 'pendingItems'
-                })
-            } else if (processData) {
-                this.defId = processData
-                this.bpmnFormrenderDialogVisible = true
-            }
-            this.infoMessage[num].close()
-        },
-        downloadData() {
-            window.location.href =
-                BASE_API() +
-                BUSINESS_BASE_URL() +
-                '/sys/SysDataContext/downloadData'
-        },
-        scrollToTop() {
-            this.$refs.dashboardContainer.scrollToTop()
-        },
-        initData() {
-            this.initInterval = setInterval(() => {
-                if (this.$utils.isNotEmpty(this.systemAlias)) {
-                    this.initLoading = true
-                    if (this.localSystem) {
-                        // this.fetchData()
-                    } else {
-                        this.initSystemUrl(this.system.homePage)
+                                    }, '忽略关闭')
+                                ]),
+                                duration: 0
+                            })
+                        }, 0)
                     }
-                    clearInterval(this.initInterval)
                 }
-            }, 100)
-        },
-        // 抓取数据
-        // fetchData() {
-        //   initColumn(this.systemAlias)
-        //   this.loading = true
-        //    const interval = setInterval(() => {
-        //    if (isInit()) {
-        //   //     getMyDesktop({
-        //   //       systemAlias: this.systemAlias
-        //   //     }).then(response => {
-        //   //       try {
-        //   //         this.layout = this.$utils.parseData(response.data)
-        //   //         this.defaultData = this.$utils.parseData(response.data)
-        //   //       } catch (error) {
-        //   //         this.layout = []
-        //   //         this.defaultData = []
-        //   //       }
-        //   //       this.loading = false
-        //   //     }).catch(() => {
-        //   //       this.loading = false
-        //   //     })
-        //       clearInterval(interval)
-        //    }
-        //    }, 100)
-        // },
-        getHeight(h) {
-            return (h - 1) * (this.rowHeight + this.margin[1]) + this.margin[1]
+            })
         },
-        hasComponent(alias) {
-            const name = 'ibps-desktop-' + alias
-            const components = getComponents()
-            if (components) {
-                return components.includes(name)
-            } else {
-                return false
+        beforeDestroy() {
+            for (let i = 0; i < this.infoMessage.length; i++) {
+                this.infoMessage[i].close()
             }
         },
-        resizedHandler(i, newH, newW, newHPx, newWPx) {
-            if (!this.layout) return
-            this.layout.layout.find((n) => {
-                if (i === n.i) {
-                    n.widthPx = this.getWidth(n.w)
-                    n.heightPx = this.getHeight(n.h)
+        methods: {
+            cancelInfo(cronId, title, num, processData, taskId) {
+                /* 调用流程*/
+                if (taskId) {
+                    this.$router.push({
+                        name: 'pendingItems'
+                    })
+                } else if (processData) {
+                    this.defId = processData
+                    this.bpmnFormrenderDialogVisible = true
                 }
-            })
-        },
-        goMyLayout() {
-            this.$router.push({
-                path: '/officeDesk/grzlsw/desktopMyLayout'
-            })
-        },
-        handleActionEvent(command, params, index) {
-            this.layoutIndex = index
-            this.alias = params.$alias
-            switch (command) {
-                case 'fullscreen':
-                    this.handleFullscreen(params.id)
-                    break
-                case 'collapse':
-                case 'expansion':
-                    this.handleCollapseExpansion(index, command === 'collapse')
-                    break
-                case 'flow':
-                    this.handleFlow(params)
-                    break
-                case 'approve':
-                    this.handleApprove(params)
-                    break
-                case 'unRead':
-                    this.handleUnreadMessage(params)
-                    break
+                this.infoMessage[num].close()
+            },
+            downloadData() {
+                window.location.href = BASE_API() + BUSINESS_BASE_URL() + '/sys/SysDataContext/downloadData'
+            },
+            scrollToTop() {
+                this.$refs.dashboardContainer.scrollToTop()
+            },
+            initData() {
+                this.initInterval = setInterval(() => {
+                    if (this.$utils.isNotEmpty(this.systemAlias)) {
+                        this.initLoading = true
+                        if (this.localSystem) {
+                            // this.fetchData()
+                        } else {
+                            this.initSystemUrl(this.system.homePage)
+                        }
+                        clearInterval(this.initInterval)
+                    }
+                }, 100)
+            },
+            // 抓取数据
+            // fetchData() {
+            //   initColumn(this.systemAlias)
+            //   this.loading = true
+            //    const interval = setInterval(() => {
+            //    if (isInit()) {
+            //   //     getMyDesktop({
+            //   //       systemAlias: this.systemAlias
+            //   //     }).then(response => {
+            //   //       try {
+            //   //         this.layout = this.$utils.parseData(response.data)
+            //   //         this.defaultData = this.$utils.parseData(response.data)
+            //   //       } catch (error) {
+            //   //         this.layout = []
+            //   //         this.defaultData = []
+            //   //       }
+            //   //       this.loading = false
+            //   //     }).catch(() => {
+            //   //       this.loading = false
+            //   //     })
+            //       clearInterval(interval)
+            //    }
+            //    }, 100)
+            // },
+            getHeight(h) {
+                return (h - 1) * (this.rowHeight + this.margin[1]) + this.margin[1]
+            },
+            hasComponent(alias) {
+                const name = 'ibps-desktop-' + alias
+                const components = getComponents()
+                if (components) {
+                    return components.includes(name)
+                } else {
+                    return false
+                }
+            },
+            resizedHandler(i, newH, newW, newHPx, newWPx) {
+                if (!this.layout) return
+                this.layout.layout.find(n => {
+                    if (i === n.i) {
+                        n.widthPx = this.getWidth(n.w)
+                        n.heightPx = this.getHeight(n.h)
+                    }
+                })
+            },
+            goMyLayout() {
+                this.$router.push({ path: '/officeDesk/grzlsw/desktopMyLayout' })
+            },
+            handleActionEvent(command, params, index) {
+                this.layoutIndex = index
+                this.alias = params.$alias
+                switch (command) {
+                    case 'fullscreen':
+                        this.handleFullscreen(params.id)
+                        break
+                    case 'collapse':
+                    case 'expansion':
+                        this.handleCollapseExpansion(index, command === 'collapse')
+                        break
+                    case 'flow':
+                        this.handleFlow(params)
+                        break
+                    case 'approve':
+                        this.handleApprove(params)
+                        break
+                    case 'unRead':
+                        this.handleUnreadMessage(params)
+                        break
 
-                default:
-                    break
-            }
-        },
-        /**
-         * 全屏展示切换
-         */
-        handleFullscreen(id) {
-            this.dialogPreviewVisible = true
-            this.id = id
-        },
-        // 处理收缩/展开
-        handleCollapseExpansion(index, isCollapse) {
-            this.layout[index].h = isCollapse ? 2 : this.defaultData[index].h
-            this.layout.push({ i: '0' })
-            const deleteIndex = this.layout.findIndex((item) => item.i === '0')
-            this.layout.splice(deleteIndex, 1)
-        },
+                    default:
+                        break
+                }
+            },
+            /**
+             * 全屏展示切换
+             */
+            handleFullscreen(id) {
+                this.dialogPreviewVisible = true
+                this.id = id
+            },
+            // 处理收缩/展开
+            handleCollapseExpansion(index, isCollapse) {
+                this.layout[index].h = isCollapse ? 2 : this.defaultData[index].h
+                this.layout.push({ i: '0' })
+                const deleteIndex = this.layout.findIndex(item => item.i === '0')
+                this.layout.splice(deleteIndex, 1)
+            },
 
-        handleApprove(id) {
-            this.ibpsNewsDialogVisible = true
-            this.newsEditId = id
-        },
+            handleApprove(id) {
+                this.ibpsNewsDialogVisible = true
+                this.newsEditId = id
+            },
 
-        handleUnreadMessage(id) {
-            this.ibpsMessageDialogVisible = true
-            this.messageEditId = id
-        },
-        fileErr(err, file, fileList) {
-            this.$message.error('文件上传失败,请检查格式!')
-        },
-        handleFlow(params) {
-            this.defId = params.defId || null
-            this.taskId = params.taskId || null
-            this.instanceId = params.instanceId || null
+            handleUnreadMessage(id) {
+                this.ibpsMessageDialogVisible = true
+                this.messageEditId = id
+            },
+            fileErr(err, file, fileList) {
+                this.$message.error('文件上传失败,请检查格式!')
+            },
+            handleFlow(params) {
+                this.defId = params.defId || null
+                this.taskId = params.taskId || null
+                this.instanceId = params.instanceId || null
 
-            this.instanceId = params.instanceId || null
-            this.instanceId = params.instanceId || null
+                this.instanceId = params.instanceId || null
+                this.instanceId = params.instanceId || null
 
-            this.bpmnFormrenderDialogVisible = true
-        },
-        handleFlowCallback() {
-            this.$refs[this.alias]
-                ? this.$refs[this.alias][0].refreshData()
-                : null
-        },
+                this.bpmnFormrenderDialogVisible = true
+            },
+            handleFlowCallback() {
+                this.$refs[this.alias] ? this.$refs[this.alias][0].refreshData() : null
+            },
 
-        //
-        initSystemUrl(url) {
-            if (url.startsWith('http')) {
-                this.systemUrlType = 'iframe'
-                this.$nextTick(() => {
-                    this.$refs.systemrender.src = url
-                    // 传递消息
-                    // this.$refs.systemrender.contentWindow.postMessage({ data: this.attributes }, '*')
-                })
-            } else {
-                const component = url.split('?')[0]
-                this.systemUrlParams.attrs = this.urlParse(url)
-                this.systemUrlType = 'inner'
-                const systemUrlName = 'IbpsBpmnSystemUrl'
-                this.$options.components[systemUrlName] = _import(component)
-                this.systemUrlName = systemUrlName
-            }
-        },
-        urlParse(str) {
-            const obj = {}
-            if (str.indexOf('?') !== -1) {
-                const str1 = str.split('?')[1].split('&')
-                for (let i = 0; i < str1.length; i++) {
-                    const params = str1[i].split('=')
-                    obj[params[0]] = params[1]
+            //
+            initSystemUrl(url) {
+                if (url.startsWith('http')) {
+                    this.systemUrlType = 'iframe'
+                    this.$nextTick(() => {
+                        this.$refs.systemrender.src = url
+                        // 传递消息
+                        // this.$refs.systemrender.contentWindow.postMessage({ data: this.attributes }, '*')
+                    })
+                } else {
+                    const component = url.split('?')[0]
+                    this.systemUrlParams.attrs = this.urlParse(url)
+                    this.systemUrlType = 'inner'
+                    const systemUrlName = 'IbpsBpmnSystemUrl'
+                    this.$options.components[systemUrlName] = _import(component)
+                    this.systemUrlName = systemUrlName
                 }
-            }
-            return obj
-        },
-        /* 文件类型*/
-        beforeUpload(file) {
-            var testmsg = file.name.substring(file.name.lastIndexOf('.') + 1)
-            const extension = testmsg === 'xls'
-            const extension2 = testmsg === 'xlsx'
-            if (!extension && !extension2) {
-                this.$message({
-                    message: '上传文件只能是excel格式!',
-                    type: 'warning'
-                })
-                return false
-            }
-            return extension || extension2
-        },
-        /* 文件类型*/
-        ReportBeforeUpload(file) {
-            var testmsg = file.name.substring(file.name.lastIndexOf('.') + 1)
-            const extension = testmsg === 'rpx'
-            if (!extension) {
-                this.$message({
-                    message: '上传文件只能是rpx格式!',
-                    type: 'warning'
-                })
-                return false
-            }
-            return extension
-        },
+            },
+            urlParse(str) {
+                const obj = {}
+                if (str.indexOf('?') !== -1) {
+                    const str1 = str.split('?')[1].split('&')
+                    for (let i = 0; i < str1.length; i++) {
+                        const params = str1[i].split('=')
+                        obj[params[0]] = params[1]
+                    }
+                }
+                return obj
+            },
+            /* 文件类型*/
+            beforeUpload(file) {
+                var testmsg = file.name.substring(file.name.lastIndexOf('.') + 1)
+                const extension = testmsg === 'xls'
+                const extension2 = testmsg === 'xlsx'
+                if (!extension && !extension2) {
+                    this.$message({
+                        message: '上传文件只能是excel格式!',
+                        type: 'warning'
+                    })
+                    return false
+                }
+                return extension || extension2
+            },
+            /* 文件类型*/
+            ReportBeforeUpload(file) {
+                var testmsg = file.name.substring(file.name.lastIndexOf('.') + 1)
+                const extension = testmsg === 'rpx'
+                if (!extension) {
+                    this.$message({
+                        message: '上传文件只能是rpx格式!',
+                        type: 'warning'
+                    })
+                    return false
+                }
+                return extension
+            },
 
-        handleSuccess(res, file, fileList) {
-            if (res.state === 200) {
-                this.$message({
-                    message: '上传数据成功!',
-                    type: 'success'
-                })
-            } else {
-                this.$message({
-                    message: res.message,
-                    type: 'error'
-                })
+            handleSuccess(res, file, fileList) {
+                if (res.state === 200) {
+                    this.$message({
+                        message: '上传数据成功!',
+                        type: 'success'
+                    })
+                } else {
+                    this.$message({
+                        message: res.message,
+                        type: 'error'
+                    })
+                }
+            },
+            // 获取检测流程数据,存储到store中
+            getTestingData() {
+                let testingList = this.$store.getters.testingList
+                if (testingList.length) {
+                    return
+                } else {
+                    // let sql = 'select xiang_mu_ming_ as name, liu_cheng_bian_ha as processKey from t_jcxmlcpzb'
+                    let sql = 'select jian_ce_xiang_mu_ as name, defkey_ as processKey from t_mjjcnlfw where length(defkey_) > 0 order by xiang_mu_bian_hao + 0 asc'
+                    curdPost('sql', sql).then(res => {
+                        const { data } = res.variables
+                        this.$store.dispatch('ibps/param/setTestingList', data)
+                    }).catch(error => {
+                        this.$message.error('获取检测流程数据失败!')
+                        console.log(error)
+                    })
+                }
             }
         }
     }
-}
 </script>
 
 <style lang="scss" scoped>
-@import '~@/assets/styles/public.scss';
-.ibps-desktop-page {
-    .ibps-container-frame {
-        position: absolute;
-        top: 0px;
-        left: 0px;
-        height: 100%;
-        width: 100%;
-    }
+    @import '~@/assets/styles/public.scss';
+    .ibps-desktop-page {
+        .ibps-container-frame {
+            position: absolute;
+            top: 0px;
+            left: 0px;
+            height: 100%;
+            width: 100%;
+        }
 
-    .ibps-grid-item,
-    .el-card {
-        height: 100%;
-    }
-    .vue-grid-layout {
-        border-radius: 4px;
-        // margin: -10px;
-        .page_card {
+        .ibps-grid-item, .el-card {
             height: 100%;
-            @extend %unable-select;
         }
-        .vue-resizable-handle {
-            opacity: 0.3;
-            &:hover {
-                opacity: 1;
+        .vue-grid-layout {
+            border-radius: 4px;
+            // margin: -10px;
+            .page_card {
+                height: 100%;
+                @extend %unable-select;
+            }
+            .vue-resizable-handle {
+                opacity: 0.3;
+                &:hover {
+                    opacity: 1;
+                }
             }
         }
     }
-    .app-container {
-        min-height: calc(100vh - 160px);
-    }
-}
 </style>
 
-<style lang="scss" >
-.ibps-desktop-dashboard {
-    .item {
-        position: relative;
-        margin: 12px;
-        padding: 12px;
-        height: 90px;
-        border-radius: 4px;
-        box-sizing: border-box;
-        overflow: hidden;
-        color: #fff;
-    }
-    .item-header {
-        position: relative;
-        & > p {
-            margin: 0px;
-            font-size: 14px;
-        }
-        & > span {
-            position: absolute;
-            right: 0px;
-            top: 0px;
-            padding: 2px 8px;
+<style lang="scss">
+    .ibps-desktop-dashboard {
+        .item {
+            position: relative;
+            margin: 12px;
+            padding: 12px;
+            height: 90px;
             border-radius: 4px;
-            font-size: 12px;
-            background: rgba(255, 255, 255, 0.3);
+            box-sizing: border-box;
+            overflow: hidden;
+            color: #fff;
         }
-    }
-    .item-body {
-        & > h2 {
-            margin: 0;
-            font-size: 32px;
-            line-height: 60px;
+        .item-header {
+            position: relative;
+            & > p {
+                margin: 0px;
+                font-size: 14px;
+            }
+            & > span {
+                position: absolute;
+                right: 0px;
+                top: 0px;
+                padding: 2px 8px;
+                border-radius: 4px;
+                font-size: 12px;
+                background: rgba(255, 255, 255, 0.3);
+            }
+        }
+        .item-body {
+            & > h2 {
+                margin: 0;
+                font-size: 32px;
+                line-height: 60px;
+            }
+        }
+        .item-tip {
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            position: absolute;
+            width: 80px;
+            height: 80px;
+            bottom: -35px;
+            right: 50px;
+            border: 2px solid #fff;
+            border-radius: 100%;
+            font-size: 48px;
+            transform: rotate(-40deg);
+            opacity: 0.1;
         }
     }
-    .item-tip {
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        position: absolute;
-        width: 80px;
-        height: 80px;
-        bottom: -35px;
-        right: 50px;
-        border: 2px solid #fff;
-        border-radius: 100%;
-        font-size: 48px;
-        transform: rotate(-40deg);
-        opacity: 0.1;
-    }
-}
-// .footer {
-//     height: 50px;
-//     font-size: 12px;
-//     display: flex;
-//     justify-content: center;
-//     align-items: center;
-//     text-align: center;
-//     a {
-//         color: #000;
-//         &:hover {
-//             text-decoration: underline !important;
-//         }
-//     }
-// }
 </style>

+ 7 - 7
src/views/system/jbdHome/datav/DataView.vue

@@ -149,12 +149,12 @@ export default {
     box-sizing: border-box;
     padding-left:  0.8%;
   }
-  .block-top-content {
-    height: 55%;
-    display: flex;
-    flex-grow: 0;
-    box-sizing: border-box;
-    padding-bottom:  0.8%;
-  }
+  // .block-top-content {
+  //   height: 55%;
+  //   display: flex;
+  //   flex-grow: 0;
+  //   box-sizing: border-box;
+  //   padding-bottom:  0.8%;
+  // }
 }
 </style>

Некоторые файлы не были показаны из-за большого количества измененных файлов