From 8ffe1d6c0e0dbf78381746f36fd56e31c8638040 Mon Sep 17 00:00:00 2001 From: Xia Zekun Date: Tue, 30 Jul 2024 10:43:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BD=E6=A0=87=E6=96=B0=E5=A2=9E=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E9=80=89=E6=8B=A9=E4=BB=A3=E6=9B=BF=E6=A0=87?= =?UTF-8?q?=E5=87=86=E5=8F=B7=E5=90=8E=E8=87=AA=E5=8A=A8=E5=B8=A6=E5=87=BA?= =?UTF-8?q?=E6=89=80=E9=9C=80=E6=A0=87=E5=87=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Conflicts: # src/components/customField/AddForm.vue --- src/components/STreeSelect.vue | 8 +- src/components/customField/AddForm.vue | 73 ++++++++++++++++++- .../selection/StandardSelection.vue | 3 +- .../selection/StandardSelectionModal.vue | 3 + 4 files changed, 83 insertions(+), 4 deletions(-) diff --git a/src/components/STreeSelect.vue b/src/components/STreeSelect.vue index de9dc080..b03815c7 100644 --- a/src/components/STreeSelect.vue +++ b/src/components/STreeSelect.vue @@ -37,11 +37,15 @@ export default { }, watch: { value: { - handler () { + handler (val) { + // console.log('watch value:',val) + // this.value = val if (typeof this.value !== 'string' && this.value) { this.treeValue = JSON.parse(JSON.stringify(this.value)) + // console.log('typeof this.value !== \'string\' this.treeValue:',this.treeValue) } else { this.treeValue = this.value + // console.log('typeof this.value === \'string\' this.treeValue:',this.treeValue) } }, immediate: true @@ -93,4 +97,4 @@ export default { /deep/ .ant-select-tree-dropdown { max-height: 50vh !important; } - \ No newline at end of file + diff --git a/src/components/customField/AddForm.vue b/src/components/customField/AddForm.vue index feaae7f2..20657bc4 100644 --- a/src/components/customField/AddForm.vue +++ b/src/components/customField/AddForm.vue @@ -58,7 +58,8 @@ :disabledSourceSearch="!selectStandardCanUpdateTypeField.includes(item.dbFieldName)" :disabled="disabled || disabledFieldList.includes(item.dbFieldName)" :exclude-standard-numbers="excludeStandardFields.includes(item.dbFieldName) ? excludeStandardNumbers : null" - v-model="formInline[item.dbFieldName]" /> + v-model="formInline[item.dbFieldName]" + @listChange="standardSelectionListChange(item.dbFieldName, $event)"/> acc.concat(cur), []) + const treeMultipleField = formList.filter(tt => tt.fieldShowType === FieldType.TREE.value) + treeMultipleField.forEach(field => { + const valueArr = [] + if (this.formInline[field.dbFieldName]) { + const values = this.formInline[field.dbFieldName].split(',') + for (let i = 0; i < values.length; i++) { + valueArr[i] = { + value: values[i] + } + } + this.formInline[field.dbFieldName] = valueArr + console.log(this.formInline[field.dbFieldName]) + } else { + this.formInline[field.dbFieldName] = undefined + } + }) + }, // 选择用户得到用户名 userSelectNameChange (value, fieldName) { this.formInline[fieldName + '_dictText'] = value diff --git a/src/components/selection/StandardSelection.vue b/src/components/selection/StandardSelection.vue index 745fecfe..24c24b93 100644 --- a/src/components/selection/StandardSelection.vue +++ b/src/components/selection/StandardSelection.vue @@ -20,7 +20,8 @@ :value="value" @change="modalInput" @nameChange="modalNameChange" - @listChange="modalListChange"> + @listChange="modalListChange"> + diff --git a/src/components/selection/StandardSelectionModal.vue b/src/components/selection/StandardSelectionModal.vue index 1775cce1..73d52b89 100644 --- a/src/components/selection/StandardSelectionModal.vue +++ b/src/components/selection/StandardSelectionModal.vue @@ -301,6 +301,9 @@ export default { serialNumber.push(res.standardNumber) serialNameArr.push(res.standardName) }) + // console.log('this.selectedRowKeys', this.selectedRowKeys) + // console.log('serialNameArr', serialNameArr) + // console.log('this.selectedRowList', this.selectedRowList) this.$emit('change', this.selectedRowKeys.join(',')) this.$emit('nameChange', serialNameArr.join(',')) this.$emit('listChange', this.selectedRowList)