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