|
|
@@ -182,14 +182,20 @@ const setTaskItemRef = (el, index) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-const handleUploadSuccess = () =>{
|
|
|
- console.log('handleUploadSuccess', taskItemRefs.value)
|
|
|
- getSimpleList();
|
|
|
+const handleUploadSuccess = async () =>{
|
|
|
+ // 先保存当前需要更新的 item id
|
|
|
+ const currentItemIds = taskList.value.map(item => item.id || item.workRecordId);
|
|
|
+
|
|
|
+ // 刷新列表
|
|
|
+ await getSimpleList();
|
|
|
+
|
|
|
+ // 等待 DOM 更新完成,refs 被重新收集
|
|
|
+ await nextTick();
|
|
|
+
|
|
|
// 更新所有task-item的triggerImg
|
|
|
taskItemRefs.value.forEach(ref => {
|
|
|
if (ref && ref.updateTriggerImg) {
|
|
|
ref.updateTriggerImg();
|
|
|
- console.log('updateTriggerImg', ref)
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -229,7 +235,7 @@ function getSimpleList() {
|
|
|
taskItemRefs.value = [];
|
|
|
const location = store.state.home.miniUserLocationPoint;
|
|
|
const startFlowStatus = getStartFlowStatus(activeIndex.value);
|
|
|
- VE_API.z_farm_work_record.getSimpleList({ role: 2, location, flowStatus: startFlowStatus }).then(({data}) => {
|
|
|
+ return VE_API.z_farm_work_record.getSimpleList({ role: 2, location, flowStatus: startFlowStatus }).then(({data}) => {
|
|
|
loading.value = false;
|
|
|
// 假设返回的数据结构是 { list: [], total: 0 } 或者直接是数组
|
|
|
if (Array.isArray(data) && data.length > 0) {
|