Showing
1 changed file
with
22 additions
and
5 deletions
... | ... | @@ -90,6 +90,10 @@ |
90 | 90 | type: Array, |
91 | 91 | default: () => [], |
92 | 92 | }, |
93 | + provideOrgid: { | |
94 | + type: String, | |
95 | + default: '', | |
96 | + }, | |
93 | 97 | }); |
94 | 98 | const isAddClearRule = computed(() => clearRuleList.value.length < props.triggerData.length); |
95 | 99 | const refItem = { |
... | ... | @@ -141,16 +145,25 @@ |
141 | 145 | }; |
142 | 146 | const resetFieldsValueFunc = () => resetFields(); |
143 | 147 | |
148 | + const orgIdItem = ref(''); | |
149 | + const isUpdateItem = ref(''); | |
150 | + const deviceListItem = ref([]); | |
151 | + | |
144 | 152 | //TODO-fengtao |
145 | - const updateFieldDeviceId = (deviceList, e, i, masterList) => { | |
146 | - console.log(deviceList, e, i); | |
147 | - console.log(masterList.value); | |
148 | - const options = masterList.value.map((m) => { | |
153 | + const updateFieldDeviceId = (deviceList, orgId, isUpdate, getMasterDeviceList) => { | |
154 | + if (isUpdate.value) { | |
155 | + orgIdItem.value = orgId.value; | |
156 | + } | |
157 | + orgIdItem.value = orgId.value; | |
158 | + isUpdateItem.value = isUpdate.value; | |
159 | + const options = getMasterDeviceList.value.map((m) => { | |
149 | 160 | return { |
150 | 161 | value: m.id, |
151 | 162 | label: m.name, |
152 | 163 | }; |
153 | 164 | }); |
165 | + deviceListItem.value = deviceList.value; | |
166 | + console.log(' deviceListItem.value', deviceListItem.value); | |
154 | 167 | updateSchema({ |
155 | 168 | field: 'deviceId', |
156 | 169 | componentProps: { |
... | ... | @@ -202,7 +215,11 @@ |
202 | 215 | |
203 | 216 | function setFields(refs) { |
204 | 217 | unref(refs).map((item) => { |
205 | - item.updateFieldDeviceId(props.deviceList); | |
218 | + item.updateFieldDeviceId( | |
219 | + deviceListItem.value, | |
220 | + props.provideOrgid || orgIdItem.value, | |
221 | + isUpdateItem.value | |
222 | + ); | |
206 | 223 | }); |
207 | 224 | } |
208 | 225 | const deleteClearRule = (index) => { | ... | ... |