Merge pull request 'feat: 审批选择增加taskindex条件' (#222) from feat/20240417similarite into test

Reviewed-on: #222
pull/223/head
yaoshuli 1 year ago
commit 586c66de5a

@ -14,6 +14,7 @@ defineProps({
const taskStore = useTaskStore();
const data = ref<any[]>([]);
const activeId = ref("");
const taskIndex = ref("")
const el = ref<HTMLDivElement | null>(null);
const keyword = ref("");
const canloadMore = ref(true);
@ -27,6 +28,7 @@ const pagination = reactive({
function selectHandler(item, index: number) {
activeId.value = item.id;
taskIndex.value = item.taskIndex
console.log(activeId.value, item.id);
console.log(index);
taskStore.setActive(index, item.id);
@ -76,6 +78,7 @@ watch(
() => taskStore.activeId,
(newVal) => {
activeId.value = newVal;
taskIndex.value = taskStore.getApprovalList.find(i => i.id === newVal)?.taskIndex
},
);
@ -94,6 +97,7 @@ watch(
});
data.value = newlist;
activeId.value = newlist[index].id;
taskIndex.value = newlist[index]?.taskIndex
taskStore.setActive(index, newlist[index].id);
// taskStore.setActive(index)
@ -136,6 +140,7 @@ onMounted(() => {
searchId.value = id;
data.value = await fetchList();
activeId.value = data.value[0]?.id;
taskIndex.value = data.value[0]?.taskIndex
console.log(data.value);
});
});
@ -166,7 +171,7 @@ defineExpose({
v-for="(item, index) in data"
:key="item.id"
:show-field-list="showFieldList"
:selected="activeId === item.id"
:selected="`${activeId}_${taskIndex}` === `${item.id}_${item.taskIndex}`"
:list-item="item"
@click="selectHandler(item, index)"
/>

Loading…
Cancel
Save