From 6ae0fcef149ddbe614746023a58a3885b3ac4bde Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期二, 25 三月 2025 11:31:04 +0800
Subject: [PATCH] Merge branch 'dev'

---
 src/components/Process/panel/PropertiesPanel.vue |  138 +++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 125 insertions(+), 13 deletions(-)

diff --git a/src/components/Process/panel/PropertiesPanel.vue b/src/components/Process/panel/PropertiesPanel.vue
index 959fc1a..e7bc2dc 100644
--- a/src/components/Process/panel/PropertiesPanel.vue
+++ b/src/components/Process/panel/PropertiesPanel.vue
@@ -14,16 +14,38 @@
       <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>-->
@@ -35,7 +57,7 @@
 <!--        </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>
@@ -56,9 +78,55 @@
     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: '绔e伐鎶曠敤闃舵',value: '绔e伐鎶曠敤闃舵'}
+          ],
           method: (name, value) => {
             this.propertyForm.name = name
             this.propertyForm.value = value
@@ -84,6 +152,44 @@
     }
   },
   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 = []; // 鍏朵粬鎵╁睍閰嶇疆
@@ -95,19 +201,25 @@
           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) {

--
Gitblit v1.8.0