|
|
|
@ -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);
|
|
|
|
@ -136,6 +138,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 +169,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)"
|
|
|
|
|
/>
|
|
|
|
|