| | |
| | | <el-button size="mini" type="primary" icon="el-icon-setting" @click="openAttributesForm(null, -1)">属性设置</el-button> |
| | | </div> |
| | | |
| | | <el-dialog :visible.sync="propertyFormModelVisible" title="属性配置" width="600px" append-to-body destroy-on-close> |
| | | <div v-for="item in canConfigPropertyList"> |
| | | <div v-if="item.vueType === 'switch'"> |
| | | <el-switch |
| | | <el-dialog :visible.sync="propertyFormModelVisible" title="属性配置" width="600px" @close="closeProperty" append-to-body :destroy-on-close="true" :close-on-click-modal="false"> |
| | | <div v-for="item in canConfigPropertyList" style="margin-bottom: 20px; display: flex; align-items: center;"> |
| | | <!-- Name --> |
| | | <span style="flex: 0 0 100px; text-align: right; margin-right: 20px;">{{ item.name }}</span> |
| | | <!-- 组件 --> |
| | | <div > |
| | | <!-- Switch --> |
| | | <div v-if="item.vueType === 'switch'"> |
| | | <el-switch |
| | | v-model="item.value" |
| | | :inactive-text="item.name" |
| | | @change="(val) => item.method(item.name, val === true ? '是' : '否')" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949"> |
| | | </el-switch> |
| | | inactive-color="#ff4949" |
| | | > |
| | | </el-switch> |
| | | </div> |
| | | <!-- Select --> |
| | | <div v-if="item.vueType === 'select'"> |
| | | <el-select |
| | | v-model="item.value" |
| | | @change="(val) => item.method(item.name, val)" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="option in item.options" |
| | | :key="option.value" |
| | | :label="option.label" |
| | | :value="option.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <el-form :model="propertyForm" label-width="80px" size="mini" ref="attributeFormRef" @submit.native.prevent>--> |
| | |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-form>--> |
| | | <template slot="footer"> |
| | | <el-button size="mini" @click="propertyFormModelVisible = false">关 闭</el-button> |
| | | <el-button size="mini" @click="closeProperty">关 闭</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | return { |
| | | canConfigPropertyList: [ |
| | | { |
| | | name: '该节点是审批节点', |
| | | name: '是否审批节点', |
| | | value: false, |
| | | vueType: 'switch', |
| | | method: (name, value) => { |
| | | this.propertyForm.name = name |
| | | this.propertyForm.value = value |
| | | this.saveAttribute() |
| | | } |
| | | }, |
| | | { |
| | | name: '是否允许跳过', |
| | | value: false, |
| | | vueType: 'switch', |
| | | method: (name, value) => { |
| | | this.propertyForm.name = name |
| | | this.propertyForm.value = value |
| | | this.saveAttribute() |
| | | } |
| | | }, |
| | | { |
| | | name: '是否允许容缺', |
| | | value: false, |
| | | vueType: 'switch', |
| | | method: (name, value) => { |
| | | this.propertyForm.name = name |
| | | this.propertyForm.value = value |
| | | this.saveAttribute() |
| | | } |
| | | }, |
| | | { |
| | | name: '是否允许挂起', |
| | | value: false, |
| | | vueType: 'switch', |
| | | method: (name, value) => { |
| | | this.propertyForm.name = name |
| | | this.propertyForm.value = value |
| | | this.saveAttribute() |
| | | } |
| | | }, |
| | | { |
| | | name: '项目阶段', |
| | | value: null, |
| | | vueType: 'select', |
| | | options: [ |
| | | {label: '储备规划阶段',value: '储备规划阶段'}, |
| | | {label: '项目前期阶段',value: '项目前期阶段'}, |
| | | {label: '实施阶段',value: '实施阶段'}, |
| | | {label: '竣工投用阶段',value: '竣工投用阶段'} |
| | | ], |
| | | method: (name, value) => { |
| | | this.propertyForm.name = name |
| | | this.propertyForm.value = value |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | closeProperty() { |
| | | this.propertyFormModelVisible = false |
| | | // this.resetList() |
| | | }, |
| | | resetList() { |
| | | this.canConfigPropertyList = [ |
| | | { |
| | | name: '是否审批节点', |
| | | value: false, |
| | | vueType: 'switch', |
| | | method: (name, value) => { |
| | | this.propertyForm.name = name |
| | | this.propertyForm.value = value |
| | | this.saveAttribute() |
| | | } |
| | | }, |
| | | { |
| | | name: '是否允许跳过', |
| | | value: false, |
| | | vueType: 'switch', |
| | | method: (name, value) => { |
| | | this.propertyForm.name = name |
| | | this.propertyForm.value = value |
| | | this.saveAttribute() |
| | | } |
| | | }, |
| | | { |
| | | name: '是否允许容缺', |
| | | value: false, |
| | | vueType: 'switch', |
| | | method: (name, value) => { |
| | | this.propertyForm.name = name |
| | | this.propertyForm.value = value |
| | | this.saveAttribute() |
| | | } |
| | | } |
| | | ] |
| | | }, |
| | | resetAttributesList() { |
| | | this.bpmnElement = this.modelerStore.element; |
| | | this.otherExtensionList = []; // 其他扩展配置 |
| | |
| | | return ex.$type === `flowable:Properties`; |
| | | }) ?? []; |
| | | // 保存所有的 扩展属性字段 |
| | | this.bpmnElementPropertyList = this.bpmnElementProperties.reduce((pre, current) => pre.concat(current.values), []); |
| | | |
| | | this.bpmnElementPropertyList = this.bpmnElementProperties.reduce((pre, current) => { |
| | | // 检查 current.values 是否是数组,如果不是则使用空数组 |
| | | const values = current.values ? current.values : []; |
| | | return pre.concat(values); |
| | | }, []); |
| | | console.log("bpmnElementProperties",this.bpmnElementProperties) |
| | | // 回显 |
| | | this.canConfigPropertyList.forEach(item => { |
| | | const find = this.bpmnElementPropertyList.find(el => el.name === item.name); |
| | | if (find) { |
| | | if (item.vueType === 'switch') { |
| | | item.value = find.value === '是' ? true : false |
| | | }else if (item.vueType === 'select') { |
| | | item.value = find.value |
| | | } |
| | | |
| | | } else { |
| | | item.value = null |
| | | } |
| | | }) |
| | | console.log(this.canConfigPropertyList, "这是什么鬼") |
| | | this.elementPropertyList = JSON.parse(JSON.stringify(this.bpmnElementPropertyList ?? [])); |
| | | }, |
| | | openAttributesForm(attr, index) { |