feat: 高级筛选交互补全及逻辑优化

pull/45/head
刘释隆 2 years ago
parent d2d4e9cf90
commit 14f203c0ea

@ -147,7 +147,6 @@ function rowProps(row: RowData) {
}
function handleCheck(rowKeys: DataTableRowKey[]) {
console.log(rowKeys, selectionIds.value, "handleCheck");
selectionIds.value = rowKeys;
}
@ -191,6 +190,7 @@ function deleteSelection(id = "") {
}
deleteCondition({ ids: selectionIds.value.join(",") }).then(() => {
selectionIds.value = [];
query(pagination.page, pagination.pageSize);
});
}

@ -219,6 +219,7 @@ function deleteSelection(id = "") {
}
deleteCondition({ ids: selectionIds.value.join(",") }).then(() => {
selectionIds.value = [];
query(pagination.page, pagination.pageSize);
});
}
@ -308,6 +309,10 @@ const inputHandler = debounce((word) => {
keyword.value = word;
query(1, 5);
}, 300);
const showSearch = computed(() => {
return selectionIds.value.length > 0;
});
</script>
<template>
@ -336,27 +341,49 @@ const inputHandler = debounce((word) => {
>
</div>
</div>
<div class="wrapper-form">
<div class="wrapper-form" v-if="!showSearch">
<n-input
:style="{ width: '360px', border: '1px solid #cad2dd' }"
placeholder="请输入过滤条件名称搜索"
@input="inputHandler"
>
<template #suffix>
<SvgIcon size="14px" name="magnifying-1" color="#fff" />
<SvgIcon size="14px" name="magnifying-1" />
</template>
</n-input>
<n-button type="info" style="background: #507afd" @click="handleClick">
<n-button type="info" @click="handleClick">
创建
<template #icon>
<img
src="../../../../../assets/images/addIcon.png"
style="width: 16px; height: 16px"
/>
<SvgIcon size="14px" name="magnifying-1" />
</template>
</n-button>
</div>
<div class="wrapper-form" v-else>
<div class="del_btn">
<n-button icon-placement="left" size="medium" @click="deleteSelection">
<template #icon>
<SvgIcon name="delete-history" size="16" />
</template>
删除</n-button
>
</div>
<div class="msg">
<span
>已选中
<span style="color: #507afd; font-size: 16px">{{
selectionIds.length
}}</span>
</span
>
<a @click="selectionIds = []">清空</a>
</div>
</div>
<div class="wrapper-table">
<NDataTable
ref="tableRef"
@ -372,6 +399,7 @@ const inputHandler = debounce((word) => {
@update-page-size="handlePageSizeChange"
@update:checked-row-keys="handleCheck"
@update:sorter="sortData"
:checked-row-keys="selectionIds"
/>
</div>
</div>

@ -178,11 +178,15 @@ function handleSubmit(e) {
const { data: userInfo } = await userStore.getInformation();
message.destroyAll();
const toPath = decodeURIComponent((route.query?.redirect || "/") as string);
message.success("登录成功,即将进入系统");
if (route.name === LOGIN_NAME)
if (userInfo.frontmenuTList && userInfo.frontmenuTList.length) {
message.success("登录成功,即将进入系统");
router.replace(
userInfo.frontmenuTList ? userInfo.frontmenuTList[0]["resUrl"] : "/"
);
} else {
message.error("用户无菜单权限,请联系管理员");
}
else router.replace(toPath);
} else {
loginSuccess.value = false;
@ -249,12 +253,18 @@ function handleSmsSubmit(e) {
const { data: userInfo } = await userStore.getInformation();
message.destroyAll();
const toPath = decodeURIComponent((route.query?.redirect || "/") as string);
if (route.name === LOGIN_NAME) {
if (userInfo.frontmenuTList && userInfo.frontmenuTList.length) {
message.success("登录成功,即将进入系统");
if (route.name === LOGIN_NAME)
router.replace(
userInfo.frontmenuTList ? userInfo.frontmenuTList[0]["resUrl"] : "/"
);
else router.replace(toPath);
} else {
message.error("用户无菜单权限,请联系管理员");
}
} else {
router.replace(toPath);
}
} else {
message.destroyAll();
message.info(msg || "登录失败");
@ -300,10 +310,10 @@ async function sendCode(value) {
phone: formSms.phone,
agentcode: formSms.agentcode,
});
if(res.code == 'OK'){
if (res.code == "OK") {
startCount();
}else{
message.error(res.message)
} else {
message.error(res.message);
}
}

@ -645,7 +645,7 @@ function switchBatch() {
@reject="rejectHandler"
@approval="approvalHandler"
/>
<CustomSettingModal ref="CustomSettingModalRef" />
<CustomSettingModal ref="CustomSettingModalRef" @onOk="getDetail"/>
</div>
</template>

Loading…
Cancel
Save