fix
This commit is contained in:
parent
ffa3631986
commit
cac4ff2bfa
13 changed files with 74 additions and 37 deletions
|
|
@ -45,9 +45,11 @@ interface tableType {
|
|||
}
|
||||
|
||||
const rows = ref<tableType[]>([]);
|
||||
const rowsMain = ref<tableType[]>([]);
|
||||
const type = ref<string>("citizenId");
|
||||
const search = ref<string>("");
|
||||
const selected = ref<any>([]);
|
||||
const isSelect = ref<boolean>(false);
|
||||
|
||||
const employeeClass = ref<string>("officer");
|
||||
const employeeClassOption = ref<typeOp[]>([
|
||||
|
|
@ -105,6 +107,8 @@ const emit = defineEmits(["returnData"]);
|
|||
async function close() {
|
||||
modal.value = false;
|
||||
rows.value = [];
|
||||
rowsMain.value = [];
|
||||
selected.value = [];
|
||||
employeeClass.value = "officer";
|
||||
search.value = "";
|
||||
}
|
||||
|
|
@ -196,24 +200,26 @@ async function getSearch() {
|
|||
child3DnaId: e.child3DnaId,
|
||||
child4DnaId: e.child4DnaId,
|
||||
}));
|
||||
rowsMain.value = list;
|
||||
rows.value = list;
|
||||
|
||||
if (route.name == "disciplineInvestigatefactsEdit") {
|
||||
const idIsSend = mainStore.rowsAdd
|
||||
.filter(
|
||||
(item: any) => item.isSend === "DONE" || item.isAncestorDNA === true
|
||||
)
|
||||
.map((item: any) => item.personId);
|
||||
rows.value = list.filter(
|
||||
(item: any) => !idIsSend.includes(item.personId)
|
||||
);
|
||||
} else {
|
||||
const idIsSend = mainStore.rowsAdd
|
||||
.filter((item: any) => item.isAncestorDNA === true)
|
||||
.map((item: any) => item.personId);
|
||||
rows.value = list.filter(
|
||||
(item: any) => !idIsSend.includes(item.personId)
|
||||
);
|
||||
}
|
||||
// if (route.name == "disciplineInvestigatefactsEdit") {
|
||||
// const idIsSend = mainStore.rowsAdd
|
||||
// .filter(
|
||||
// (item: any) => item.isSend === "DONE" || item.isAncestorDNA === true
|
||||
// )
|
||||
// .map((item: any) => item.personId);
|
||||
// rows.value = list.filter(
|
||||
// (item: any) => !idIsSend.includes(item.personId)
|
||||
// );
|
||||
// } else {
|
||||
// const idIsSend = mainStore.rowsAdd
|
||||
// .filter((item: any) => item.isAncestorDNA === true)
|
||||
// .map((item: any) => item.personId);
|
||||
// rows.value = list.filter(
|
||||
// (item: any) => !idIsSend.includes(item.personId)
|
||||
// );
|
||||
// }
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -226,20 +232,33 @@ async function getSearch() {
|
|||
function updateSelect() {
|
||||
search.value = "";
|
||||
}
|
||||
watch(
|
||||
() => props.selectedData,
|
||||
() => {
|
||||
if (props.selectedData) {
|
||||
selected.value = props.selectedData;
|
||||
}
|
||||
}
|
||||
);
|
||||
// watch(
|
||||
// () => props.selectedData,
|
||||
// () => {
|
||||
// if (props.selectedData) {
|
||||
// selected.value = props.selectedData;
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
|
||||
function updatePagination(newPagination: any) {
|
||||
pagination.value.page = 1;
|
||||
pagination.value.rowsPerPage = newPagination.rowsPerPage;
|
||||
}
|
||||
|
||||
function checkList(propsRow: tableType) {
|
||||
// const filterCondition =
|
||||
// route.name === "disciplineInvestigatefactsEdit"
|
||||
// ? (item: any) => item.isSend === "DONE" || item.isAncestorDNA === true
|
||||
// : (item: any) => item.isAncestorDNA === true;
|
||||
|
||||
const idIsSend = mainStore.rowsAdd
|
||||
// .filter(filterCondition)
|
||||
.map((item: any) => item.personId);
|
||||
|
||||
return !idIsSend.includes(propsRow.personId);
|
||||
}
|
||||
|
||||
watch(
|
||||
() => pagination.value.rowsPerPage,
|
||||
async () => {
|
||||
|
|
@ -384,11 +403,20 @@ watch(
|
|||
<q-tr :props="props" class="cursor-pointer">
|
||||
<td class="text-center">
|
||||
<q-checkbox
|
||||
v-if="checkList(props.row)"
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
<q-checkbox
|
||||
v-else
|
||||
disable
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="isSelect"
|
||||
/>
|
||||
</td>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name == 'no'">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue