whj 1 سال پیش
والد
کامیت
2099c08a33

+ 5 - 0
package-lock.json

@@ -11008,6 +11008,11 @@
         "graceful-fs": "^4.1.6"
       }
     },
+    "jsplumb": {
+      "version": "2.15.6",
+      "resolved": "https://registry.npmmirror.com/jsplumb/-/jsplumb-2.15.6.tgz",
+      "integrity": "sha512-sIpbpz5eMVM+vV+MQzFCidlaa1RsknrQs6LOTKYDjYUDdTAi2AN2bFi94TxB33TifcIsRNV1jebcaxg0tCoPzg=="
+    },
     "jsprim": {
       "version": "1.4.1",
       "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",

+ 1 - 0
package.json

@@ -23,6 +23,7 @@
     "echarts": "^5.4.1",
     "enquire.js": "^2.1.6",
     "jquery": "^3.2.1",
+    "jsplumb": "^2.15.6",
     "jssha": "^2.3.1",
     "lodash.get": "^4.4.2",
     "lodash.pick": "^4.4.0",

+ 0 - 1
src/views/custom/form/CustomForm.vue

@@ -63,7 +63,6 @@
             <template>
               <a @click="handleView(record)">查看</a>
               <operation-button
-                v-if="$auth('custom-form-edit')"
                 @click="handleEdit(record)"
               >修改</operation-button>
               <operation-button

+ 13 - 7
src/views/custom/form/modules/BaseForm.vue

@@ -70,11 +70,15 @@
         :labelCol="BaseTool.Constant.labelCol"
         :wrapperCol="BaseTool.Constant.wrapperCol"
       >
-        <a-select mode="multiple" :options="formComponentConfig.components" v-model="formValue.queryField">
-        <!-- <a-select-option v-for="item in detail.options" :value="item.value" :key="item.value">
-          {{ item.label }}
-        </a-select-option> -->
-        </a-select>
+        <a-checkbox-group v-model="formValue.queryField" @change="onChange">
+          <a-row>
+            <a-col :span="8" v-for="item in formComponentConfig.components" :key="item.value">
+              <a-checkbox :value="item.value">
+                {{ item.label }}
+              </a-checkbox>
+            </a-col>
+          </a-row>
+        </a-checkbox-group>
       </a-form-item>
     </a-form>
   </a-card>
@@ -120,14 +124,16 @@ export default {
       this.modalTitle = '编辑'
       const { form: { setFieldsValue } } = this
       // 日期处理
+      this.formValue = record
       this.$nextTick(() => {
         setFieldsValue(Object.assign(pick(record, [
           'id',
           'type',
-          'jsonString',
-          'flowId',
+          'name',
+          'category',
           'remark'
         ])))
+        this.$refs.formComponent.base(record.jsonString)
       })
     },
     next () {

+ 5 - 0
src/views/custom/form/modules/component/index.vue

@@ -133,6 +133,11 @@ export default {
     this.handleSelect({}, this.config)
   },
   methods: {
+    base (json) {
+      const jsonData = JSON.parse(json)
+      this.list2 = jsonData.components
+      this.config = jsonData.config
+    },
     onClone (element) {
       // 生成随机id
       const val = {