Commit b785bd3a authored by 罗林杰's avatar 罗林杰

Merge remote-tracking branch 'origin/master'

parents 2b66ad5c f0a3bfb6
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex"> <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<BasicTable @register="registerTable" :searchInfo="searchInfo"> <BasicTable @register="registerTable" :searchInfo="searchInfo">
<template #toolbar> <template #toolbar>
<a-button :disabled="getRowSelection().selectedRowKeys <=0" type="primary" @click="handleExport">删除</a-button>
<a-button type="primary" @click="handleCreate">新增</a-button> <a-button type="primary" @click="handleCreate">新增</a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
...@@ -54,7 +55,7 @@ const [registerModal, { openModal }] = useModal(); ...@@ -54,7 +55,7 @@ const [registerModal, { openModal }] = useModal();
const [registerResetPassword, { openModal: openResetPasswordModal }] = useModal(); const [registerResetPassword, { openModal: openResetPasswordModal }] = useModal();
const [registerImport, { openModal: openImportModal }] = useModal(); const [registerImport, { openModal: openImportModal }] = useModal();
const searchInfo = reactive<Recordable>({}); const searchInfo = reactive<Recordable>({});
const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm }] = useTable({ const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm,getRowSelection }] = useTable({
title: '脱敏算法', title: '脱敏算法',
api: async (params) => { api: async (params) => {
console.log(params) console.log(params)
...@@ -70,7 +71,8 @@ const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm }] ...@@ -70,7 +71,8 @@ const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm }]
return { ...response}; return { ...response};
}, },
rowKey: 'id', rowKey: 'businessId',
rowSelection: true,
columns, columns,
formConfig: { formConfig: {
labelWidth: 10, labelWidth: 10,
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
export const tableList: any[] = [ export const tableList: any[] = [
{ {
businessId: 1,
"name" : "Blur", "name" : "Blur",
"functionName" : "blur", "functionName" : "blur",
"algorithmDes" : "将整数或小数混淆...", "algorithmDes" : "将整数或小数混淆...",
...@@ -11,6 +12,7 @@ export const tableList: any[] = [ ...@@ -11,6 +12,7 @@ export const tableList: any[] = [
"updateDate" : "2024-10-24 10:04:04", "updateDate" : "2024-10-24 10:04:04",
}, },
{ {
businessId: 2,
"name" : "random", "name" : "random",
"functionName" : "random", "functionName" : "random",
"algorithmDes" : "返回一个介于x和y...", "algorithmDes" : "返回一个介于x和y...",
...@@ -20,6 +22,7 @@ export const tableList: any[] = [ ...@@ -20,6 +22,7 @@ export const tableList: any[] = [
"updateDate" : "2024-10-24 10:04:04", "updateDate" : "2024-10-24 10:04:04",
}, },
{ {
businessId: 3,
"name" : "Blur", "name" : "Blur",
"functionName" : "blur", "functionName" : "blur",
"algorithmDes" : "将整数或小数混淆...", "algorithmDes" : "将整数或小数混淆...",
...@@ -29,6 +32,7 @@ export const tableList: any[] = [ ...@@ -29,6 +32,7 @@ export const tableList: any[] = [
"updateDate" : "2024-10-24 10:04:04", "updateDate" : "2024-10-24 10:04:04",
}, },
{ {
businessId: 4,
"name" : "random", "name" : "random",
"functionName" : "random", "functionName" : "random",
"algorithmDes" : "返回一个介于x和y...", "algorithmDes" : "返回一个介于x和y...",
...@@ -38,6 +42,7 @@ export const tableList: any[] = [ ...@@ -38,6 +42,7 @@ export const tableList: any[] = [
"updateDate" : "2024-10-24 10:04:04", "updateDate" : "2024-10-24 10:04:04",
}, },
{ {
businessId: 5,
"name" : "Blur", "name" : "Blur",
"functionName" : "blur", "functionName" : "blur",
"algorithmDes" : "将整数或小数混淆...", "algorithmDes" : "将整数或小数混淆...",
...@@ -47,6 +52,7 @@ export const tableList: any[] = [ ...@@ -47,6 +52,7 @@ export const tableList: any[] = [
"updateDate" : "2024-10-24 10:04:04", "updateDate" : "2024-10-24 10:04:04",
}, },
{ {
businessId: 6,
"name" : "random", "name" : "random",
"functionName" : "random", "functionName" : "random",
"algorithmDes" : "返回一个介于x和y...", "algorithmDes" : "返回一个介于x和y...",
...@@ -56,6 +62,7 @@ export const tableList: any[] = [ ...@@ -56,6 +62,7 @@ export const tableList: any[] = [
"updateDate" : "2024-10-24 10:04:04", "updateDate" : "2024-10-24 10:04:04",
}, },
{ {
businessId: 7,
"name" : "Blur", "name" : "Blur",
"functionName" : "blur", "functionName" : "blur",
"algorithmDes" : "将整数或小数混淆...", "algorithmDes" : "将整数或小数混淆...",
...@@ -64,13 +71,5 @@ export const tableList: any[] = [ ...@@ -64,13 +71,5 @@ export const tableList: any[] = [
"createDate" : "2024-10-24 10:04:04", "createDate" : "2024-10-24 10:04:04",
"updateDate" : "2024-10-24 10:04:04", "updateDate" : "2024-10-24 10:04:04",
}, },
{
"name" : "random",
"functionName" : "random",
"algorithmDes" : "返回一个介于x和y...",
"source" : "自定义",
"owner" : "admin",
"createDate" : "2024-10-24 10:04:04",
"updateDate" : "2024-10-24 10:04:04",
},
] ]
<template>
<BasicModal min-height="100" width="30%" v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit">
<div class="modalBody">
<div class="title">导入文件选择</div>
<a-button style="margin-right: 10px" >下载模板</a-button>
<a-button style="margin-right: 10px" type="primary" >选择</a-button>
<div style="width: 200px">只能导入单个Excel文件,且单次导入不超过100000条数据</div>
</div>
</BasicModal>
</template>
<script lang="ts" setup>
import {Radio,RadioGroup} from 'ant-design-vue'
import {ref, computed, unref, reactive} from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
// import { formSchema } from './gradingResults.data';
import Icon from '@/components/Icon/Icon.vue';
import { useMessage } from '@/hooks/web/useMessage';
defineOptions({ name: 'AccountModal' });
const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage();
const isUpdate = ref(true);
const rowId = ref('');
const value = ref<string>('1');
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 24, md: 24 },
// schemas: formSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
// 通过id获取行详情信息
// 塞值
setFieldsValue({
...data.record,
});
}
});
const getTitle = computed(() => ( '分类分级导入'));
async function handleSubmit() {
try {
const values = await validate();
setModalProps({ confirmLoading: true });
// TODO custom api
closeModal();
emit('success', { isUpdate: unref(isUpdate), values: { ...values, id: rowId.value } });
} finally {
setModalProps({ confirmLoading: false });
}
}
</script>
<style lang="scss" scoped>
.modalBody{
display: flex;
align-items: center;
.title{
padding-right: 15px;
}
}
</style>
...@@ -2,9 +2,10 @@ ...@@ -2,9 +2,10 @@
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex"> <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<BasicTable @register="registerTable" :searchInfo="searchInfo"> <BasicTable @register="registerTable" :searchInfo="searchInfo">
<template #toolbar> <template #toolbar>
<a-button :disabled="getRowSelection().selectedRowKeys <=0" type="primary" @click="handleExport">删除</a-button>
<a-button type="primary" @click="handleCreate">新增</a-button> <a-button type="primary" @click="handleCreate">新增</a-button>
<a-button type="primary" @click="handleImport">导入</a-button> <a-button type="primary" @click="handleImport">导入</a-button>
<a-button type="primary" @click="handleExport">导出</a-button> <a-button :disabled="getRowSelection().selectedRowKeys <=0" type="primary" @click="handleExport">导出</a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
...@@ -33,6 +34,7 @@ ...@@ -33,6 +34,7 @@
</template> </template>
</BasicTable> </BasicTable>
<protectionRulesModal @register="registerModal" @success="handleSuccess" /> <protectionRulesModal @register="registerModal" @success="handleSuccess" />
<importModal @register="registerImport" @success="handleImportSuccess" />
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -42,7 +44,7 @@ import { PageWrapper } from '@/components/Page'; ...@@ -42,7 +44,7 @@ import { PageWrapper } from '@/components/Page';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import { useModal } from '@/components/Modal'; import { useModal } from '@/components/Modal';
import protectionRulesModal from './protectionRulesModal.vue'; import protectionRulesModal from './protectionRulesModal.vue';
import importModal from './importModal.vue';
import { columns, searchFormSchema } from './protectionRules.data'; import { columns, searchFormSchema } from './protectionRules.data';
import {tableList} from "./mock"; import {tableList} from "./mock";
...@@ -56,7 +58,7 @@ const [registerModal, { openModal }] = useModal(); ...@@ -56,7 +58,7 @@ const [registerModal, { openModal }] = useModal();
const [registerResetPassword, { openModal: openResetPasswordModal }] = useModal(); const [registerResetPassword, { openModal: openResetPasswordModal }] = useModal();
const [registerImport, { openModal: openImportModal }] = useModal(); const [registerImport, { openModal: openImportModal }] = useModal();
const searchInfo = reactive<Recordable>({}); const searchInfo = reactive<Recordable>({});
const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm }] = useTable({ const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm,getRowSelection }] = useTable({
title: '保护规则', title: '保护规则',
api: async (params) => { api: async (params) => {
console.log('tableList',tableList) console.log('tableList',tableList)
...@@ -72,7 +74,8 @@ const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm }] ...@@ -72,7 +74,8 @@ const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm }]
return { ...response}; return { ...response};
}, },
rowKey: 'id', rowKey: 'businessId',
rowSelection: true,
columns, columns,
formConfig: { formConfig: {
labelWidth: 10, labelWidth: 10,
...@@ -100,6 +103,11 @@ function handleCreate() { ...@@ -100,6 +103,11 @@ function handleCreate() {
isUpdate: false, isUpdate: false,
}); });
} }
function handleImport() {
openImportModal(true, {
});
}
/** 编辑按钮*/ /** 编辑按钮*/
function handleEdit(record: Recordable) { function handleEdit(record: Recordable) {
openModal(true, { openModal(true, {
......
...@@ -3,6 +3,7 @@ import {TreeItem} from "@/components/Tree"; ...@@ -3,6 +3,7 @@ import {TreeItem} from "@/components/Tree";
export const tableList: any[] = [ export const tableList: any[] = [
{ {
businessId: 1,
"object" : "全部", "object" : "全部",
"sensitiveType" : "员工号(对外员工)", "sensitiveType" : "员工号(对外员工)",
"safetyLevel" : "G5", "safetyLevel" : "G5",
...@@ -10,6 +11,7 @@ export const tableList: any[] = [ ...@@ -10,6 +11,7 @@ export const tableList: any[] = [
"protectiveAction" : "放行", "protectiveAction" : "放行",
}, },
{ {
businessId: 2,
"object" : "全部", "object" : "全部",
"sensitiveType" : "钱包类型", "sensitiveType" : "钱包类型",
"safetyLevel" : "G1", "safetyLevel" : "G1",
...@@ -17,6 +19,7 @@ export const tableList: any[] = [ ...@@ -17,6 +19,7 @@ export const tableList: any[] = [
"protectiveAction" : "放行", "protectiveAction" : "放行",
}, },
{ {
businessId: 3,
"object" : "全部", "object" : "全部",
"sensitiveType" : "办公电话(对外员工)", "sensitiveType" : "办公电话(对外员工)",
"safetyLevel" : "G4", "safetyLevel" : "G4",
...@@ -24,6 +27,7 @@ export const tableList: any[] = [ ...@@ -24,6 +27,7 @@ export const tableList: any[] = [
"protectiveAction" : "脱敏", "protectiveAction" : "脱敏",
}, },
{ {
businessId: 4,
"object" : "全部", "object" : "全部",
"sensitiveType" : "员工号(对外员工)", "sensitiveType" : "员工号(对外员工)",
"safetyLevel" : "G5", "safetyLevel" : "G5",
...@@ -31,6 +35,7 @@ export const tableList: any[] = [ ...@@ -31,6 +35,7 @@ export const tableList: any[] = [
"protectiveAction" : "放行", "protectiveAction" : "放行",
}, },
{ {
businessId: 5,
"object" : "全部", "object" : "全部",
"sensitiveType" : "钱包类型", "sensitiveType" : "钱包类型",
"safetyLevel" : "G1", "safetyLevel" : "G1",
...@@ -38,6 +43,7 @@ export const tableList: any[] = [ ...@@ -38,6 +43,7 @@ export const tableList: any[] = [
"protectiveAction" : "放行", "protectiveAction" : "放行",
}, },
{ {
businessId: 6,
"object" : "全部", "object" : "全部",
"sensitiveType" : "办公电话(对外员工)", "sensitiveType" : "办公电话(对外员工)",
"safetyLevel" : "G4", "safetyLevel" : "G4",
...@@ -45,26 +51,13 @@ export const tableList: any[] = [ ...@@ -45,26 +51,13 @@ export const tableList: any[] = [
"protectiveAction" : "脱敏", "protectiveAction" : "脱敏",
}, },
{ {
businessId: 7,
"object" : "全部", "object" : "全部",
"sensitiveType" : "员工号(对外员工)", "sensitiveType" : "员工号(对外员工)",
"safetyLevel" : "G5", "safetyLevel" : "G5",
"priority" : "中", "priority" : "中",
"protectiveAction" : "放行", "protectiveAction" : "放行",
}, },
{
"object" : "全部",
"sensitiveType" : "钱包类型",
"safetyLevel" : "G1",
"priority" : "低",
"protectiveAction" : "放行",
},
{
"object" : "全部",
"sensitiveType" : "办公电话(对外员工)",
"safetyLevel" : "G4",
"priority" : "低",
"protectiveAction" : "脱敏",
},
] ]
......
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex"> <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<BasicTable @register="registerTable" :searchInfo="searchInfo"> <BasicTable @register="registerTable" :searchInfo="searchInfo">
<template #toolbar> <template #toolbar>
<a-button :disabled="getRowSelection().selectedRowKeys <=0" type="primary" @click="handleExport">删除</a-button>
<a-button :disabled="getRowSelection().selectedRowKeys <=0" type="primary" @click="handleExport">导出</a-button>
<a-button type="primary" @click="handleCreate">新增</a-button> <a-button type="primary" @click="handleCreate">新增</a-button>
<a-button type="primary" @click="handleExport">导出</a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
...@@ -55,7 +56,7 @@ const [registerModal, { openModal }] = useModal(); ...@@ -55,7 +56,7 @@ const [registerModal, { openModal }] = useModal();
const [registerResetPassword, { openModal: openResetPasswordModal }] = useModal(); const [registerResetPassword, { openModal: openResetPasswordModal }] = useModal();
const [registerImport, { openModal: openImportModal }] = useModal(); const [registerImport, { openModal: openImportModal }] = useModal();
const searchInfo = reactive<Recordable>({}); const searchInfo = reactive<Recordable>({});
const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm }] = useTable({ const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm,getRowSelection }] = useTable({
title: '敏感规则', title: '敏感规则',
api: async (params) => { api: async (params) => {
console.log(params) console.log(params)
...@@ -71,7 +72,8 @@ const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm }] ...@@ -71,7 +72,8 @@ const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm }]
return { ...response}; return { ...response};
}, },
rowKey: 'id', rowKey: 'businessId',
rowSelection: true,
columns, columns,
formConfig: { formConfig: {
labelWidth: 10, labelWidth: 10,
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
export const tableList: any[] = [ export const tableList: any[] = [
{ {
businessId: 1,
"name" : "ip地址", "name" : "ip地址",
"describe" : "-------", "describe" : "-------",
"type" : "ip地址", "type" : "ip地址",
...@@ -11,6 +12,7 @@ export const tableList: any[] = [ ...@@ -11,6 +12,7 @@ export const tableList: any[] = [
"updateDate" : "2024-10-24 10:04:04", "updateDate" : "2024-10-24 10:04:04",
}, },
{ {
businessId: 2,
"name" : "军官证", "name" : "军官证",
"describe" : "-------", "describe" : "-------",
"type" : "军官证", "type" : "军官证",
...@@ -20,6 +22,7 @@ export const tableList: any[] = [ ...@@ -20,6 +22,7 @@ export const tableList: any[] = [
"updateDate" : "2024-10-24 10:04:04", "updateDate" : "2024-10-24 10:04:04",
}, },
{ {
businessId: 3,
"name" : "手机号码(美国)", "name" : "手机号码(美国)",
"describe" : "-------", "describe" : "-------",
"type" : "固定电话", "type" : "固定电话",
...@@ -29,6 +32,7 @@ export const tableList: any[] = [ ...@@ -29,6 +32,7 @@ export const tableList: any[] = [
"updateDate" : "2024-10-24 10:04:04", "updateDate" : "2024-10-24 10:04:04",
}, },
{ {
businessId: 4,
"name" : "ip地址", "name" : "ip地址",
"describe" : "-------", "describe" : "-------",
"type" : "ip地址", "type" : "ip地址",
...@@ -38,6 +42,7 @@ export const tableList: any[] = [ ...@@ -38,6 +42,7 @@ export const tableList: any[] = [
"updateDate" : "2024-10-24 10:04:04", "updateDate" : "2024-10-24 10:04:04",
}, },
{ {
businessId: 5,
"name" : "军官证", "name" : "军官证",
"describe" : "-------", "describe" : "-------",
"type" : "军官证", "type" : "军官证",
...@@ -47,6 +52,7 @@ export const tableList: any[] = [ ...@@ -47,6 +52,7 @@ export const tableList: any[] = [
"updateDate" : "2024-10-24 10:04:04", "updateDate" : "2024-10-24 10:04:04",
}, },
{ {
businessId: 6,
"name" : "手机号码(美国)", "name" : "手机号码(美国)",
"describe" : "-------", "describe" : "-------",
"type" : "固定电话", "type" : "固定电话",
...@@ -56,6 +62,7 @@ export const tableList: any[] = [ ...@@ -56,6 +62,7 @@ export const tableList: any[] = [
"updateDate" : "2024-10-24 10:04:04", "updateDate" : "2024-10-24 10:04:04",
}, },
{ {
businessId: 7,
"name" : "ip地址", "name" : "ip地址",
"describe" : "-------", "describe" : "-------",
"type" : "ip地址", "type" : "ip地址",
...@@ -64,22 +71,4 @@ export const tableList: any[] = [ ...@@ -64,22 +71,4 @@ export const tableList: any[] = [
"createDate" : "2024-10-24 10:04:04", "createDate" : "2024-10-24 10:04:04",
"updateDate" : "2024-10-24 10:04:04", "updateDate" : "2024-10-24 10:04:04",
}, },
{
"name" : "军官证",
"describe" : "-------",
"type" : "军官证",
"safetyLevel" : "G2",
"owner" : "admin",
"createDate" : "2024-10-24 10:04:04",
"updateDate" : "2024-10-24 10:04:04",
},
{
"name" : "手机号码(美国)",
"describe" : "-------",
"type" : "固定电话",
"safetyLevel" : "G3",
"owner" : "admin",
"createDate" : "2024-10-24 10:04:04",
"updateDate" : "2024-10-24 10:04:04",
},
] ]
<template>
<BasicModal min-height="100" width="30%" v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit">
<div class="modalBody">
<div class="title">导入文件选择</div>
<a-button style="margin-right: 10px" >下载模板</a-button>
<a-button style="margin-right: 10px" type="primary" >选择</a-button>
<div style="width: 200px">只能导入单个Excel文件,且单次导入不超过100000条数据</div>
</div>
<div>
<span style="padding-right: 20px">敏感类型重名</span>
<RadioGroup v-model:value="value" name="radioGroup">
<Radio value="1">全部放弃</Radio>
<Radio value="2">全部替换</Radio>
<Radio value="3">自动重命名</Radio>
</RadioGroup>
</div>
</BasicModal>
</template>
<script lang="ts" setup>
import {Radio,RadioGroup} from 'ant-design-vue'
import {ref, computed, unref, reactive} from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
// import { formSchema } from './gradingResults.data';
import Icon from '@/components/Icon/Icon.vue';
import { useMessage } from '@/hooks/web/useMessage';
defineOptions({ name: 'AccountModal' });
const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage();
const isUpdate = ref(true);
const rowId = ref('');
const value = ref<string>('1');
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 24, md: 24 },
// schemas: formSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
// 通过id获取行详情信息
// 塞值
setFieldsValue({
...data.record,
});
}
});
const getTitle = computed(() => ( '分类分级导入'));
async function handleSubmit() {
try {
const values = await validate();
setModalProps({ confirmLoading: true });
// TODO custom api
closeModal();
emit('success', { isUpdate: unref(isUpdate), values: { ...values, id: rowId.value } });
} finally {
setModalProps({ confirmLoading: false });
}
}
</script>
<style lang="scss" scoped>
.modalBody{
display: flex;
align-items: center;
.title{
padding-right: 15px;
}
}
</style>
<template> <template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex"> <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<BasicTable @register="registerTable" :searchInfo="searchInfo"> <BasicTable @register="registerTable" :searchInfo="searchInfo" :rowSelection="rowSelection">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate">新增</a-button> <a-button :disabled="getRowSelection().selectedRowKeys <=0" type="primary" @click="handleExport">删除</a-button>
<a-button type="primary" @click="handleExport">导出</a-button> <a-button :disabled="getRowSelection().selectedRowKeys <=0" type="primary" @click="handleExport">导出</a-button>
<a-button type="primary" @click="handleImport">导入</a-button> <a-button type="primary" @click="handleImport">导入</a-button>
<a-button type="primary" @click="handleCreate">新增</a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
...@@ -33,16 +34,17 @@ ...@@ -33,16 +34,17 @@
</template> </template>
</BasicTable> </BasicTable>
<sensitiveTypeModal @register="registerModal" @success="handleSuccess" /> <sensitiveTypeModal @register="registerModal" @success="handleSuccess" />
<importModal @register="registerImport" @success="handleImportSuccess" />
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { reactive, onMounted } from 'vue'; import { reactive, onMounted,ref } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table'; import { BasicTable, useTable, TableAction } from '@/components/Table';
import { PageWrapper } from '@/components/Page'; import { PageWrapper } from '@/components/Page';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import { useModal } from '@/components/Modal'; import { useModal } from '@/components/Modal';
import sensitiveTypeModal from './sensitiveTypeModal.vue'; import sensitiveTypeModal from './sensitiveTypeModal.vue';
import importModal from './importModal.vue';
import { columns, searchFormSchema } from './sensitiveType.data'; import { columns, searchFormSchema } from './sensitiveType.data';
import {tableList} from "@/views/dataSecurity/sensitiveType/mock"; import {tableList} from "@/views/dataSecurity/sensitiveType/mock";
...@@ -56,7 +58,7 @@ const [registerModal, { openModal }] = useModal(); ...@@ -56,7 +58,7 @@ const [registerModal, { openModal }] = useModal();
const [registerResetPassword, { openModal: openResetPasswordModal }] = useModal(); const [registerResetPassword, { openModal: openResetPasswordModal }] = useModal();
const [registerImport, { openModal: openImportModal }] = useModal(); const [registerImport, { openModal: openImportModal }] = useModal();
const searchInfo = reactive<Recordable>({}); const searchInfo = reactive<Recordable>({});
const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm }] = useTable({ const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm,getRowSelection }] = useTable({
title: '敏感类型', title: '敏感类型',
api: async (params) => { api: async (params) => {
console.log(params) console.log(params)
...@@ -72,7 +74,8 @@ const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm }] ...@@ -72,7 +74,8 @@ const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm }]
return { ...response}; return { ...response};
}, },
rowKey: 'id', rowKey: 'businessId',
rowSelection: true,
columns, columns,
formConfig: { formConfig: {
labelWidth: 120, labelWidth: 120,
...@@ -96,6 +99,14 @@ const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm }] ...@@ -96,6 +99,14 @@ const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm }]
// slots: { customRender: 'action' }, // slots: { customRender: 'action' },
}, },
}); });
function handleImport() {
openImportModal(true, {
});
}
/** 新增按钮*/ /** 新增按钮*/
function handleCreate() { function handleCreate() {
openModal(true, { openModal(true, {
...@@ -113,7 +124,8 @@ function handleEdit(record: Recordable) { ...@@ -113,7 +124,8 @@ function handleEdit(record: Recordable) {
/** 重置密码弹窗确定按钮*/ /** 重置密码弹窗确定按钮*/
/** 删除按钮*/ /** 删除按钮*/
function handleDelete(record: Recordable) { function handleDelete(record: Recordable) {
console.log(record); const rowSelection = getRowSelection().selectedRowKeys;
console.log('11111111111',rowSelection);
createMessage.success('删除成功!'); createMessage.success('删除成功!');
reload(); reload();
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
export const tableList: any[] = [ export const tableList: any[] = [
{ {
"name" : "zc_fo", "name" : "zc_fo",
businessId: 309,
"describe" : "-------", "describe" : "-------",
"sort" : "G5", "sort" : "G5",
"protectAction" : "Delete", "protectAction" : "Delete",
...@@ -12,6 +13,7 @@ export const tableList: any[] = [ ...@@ -12,6 +13,7 @@ export const tableList: any[] = [
}, },
{ {
"name" : "血缘关系", "name" : "血缘关系",
businessId: 310,
"describe" : "-------", "describe" : "-------",
"sort" : "G4", "sort" : "G4",
"protectAction" : "Mask", "protectAction" : "Mask",
...@@ -21,6 +23,7 @@ export const tableList: any[] = [ ...@@ -21,6 +23,7 @@ export const tableList: any[] = [
}, },
{ {
"name" : "钱包类型", "name" : "钱包类型",
businessId: 311,
"describe" : "-------", "describe" : "-------",
"sort" : "G1", "sort" : "G1",
"protectAction" : "Base64", "protectAction" : "Base64",
...@@ -30,6 +33,7 @@ export const tableList: any[] = [ ...@@ -30,6 +33,7 @@ export const tableList: any[] = [
}, },
{ {
"name" : "zc_fo", "name" : "zc_fo",
businessId: 312,
"describe" : "-------", "describe" : "-------",
"sort" : "G5", "sort" : "G5",
"protectAction" : "Delete", "protectAction" : "Delete",
...@@ -39,6 +43,7 @@ export const tableList: any[] = [ ...@@ -39,6 +43,7 @@ export const tableList: any[] = [
}, },
{ {
"name" : "血缘关系", "name" : "血缘关系",
businessId: 313,
"describe" : "-------", "describe" : "-------",
"sort" : "G4", "sort" : "G4",
"protectAction" : "Mask", "protectAction" : "Mask",
...@@ -48,6 +53,7 @@ export const tableList: any[] = [ ...@@ -48,6 +53,7 @@ export const tableList: any[] = [
}, },
{ {
"name" : "钱包类型", "name" : "钱包类型",
businessId: 314,
"describe" : "-------", "describe" : "-------",
"sort" : "G1", "sort" : "G1",
"protectAction" : "Base64", "protectAction" : "Base64",
...@@ -57,6 +63,7 @@ export const tableList: any[] = [ ...@@ -57,6 +63,7 @@ export const tableList: any[] = [
}, },
{ {
"name" : "zc_fo", "name" : "zc_fo",
businessId: 315,
"describe" : "-------", "describe" : "-------",
"sort" : "G5", "sort" : "G5",
"protectAction" : "Delete", "protectAction" : "Delete",
...@@ -66,6 +73,7 @@ export const tableList: any[] = [ ...@@ -66,6 +73,7 @@ export const tableList: any[] = [
}, },
{ {
"name" : "血缘关系", "name" : "血缘关系",
businessId: 316,
"describe" : "-------", "describe" : "-------",
"sort" : "G4", "sort" : "G4",
"protectAction" : "Mask", "protectAction" : "Mask",
...@@ -75,6 +83,7 @@ export const tableList: any[] = [ ...@@ -75,6 +83,7 @@ export const tableList: any[] = [
}, },
{ {
"name" : "钱包类型", "name" : "钱包类型",
businessId: 317,
"describe" : "-------", "describe" : "-------",
"sort" : "G1", "sort" : "G1",
"protectAction" : "Base64", "protectAction" : "Base64",
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<BasicTable @register="registerTable" :searchInfo="searchInfo"> <BasicTable @register="registerTable" :searchInfo="searchInfo">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate">新增</a-button> <a-button type="primary" @click="handleCreate">新增</a-button>
<a-button :disabled="getRowSelection().selectedRowKeys <=0" type="primary" @click="handleExport">删除</a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
...@@ -54,7 +55,7 @@ const [registerModal, { openModal }] = useModal(); ...@@ -54,7 +55,7 @@ const [registerModal, { openModal }] = useModal();
const [registerResetPassword, { openModal: openResetPasswordModal }] = useModal(); const [registerResetPassword, { openModal: openResetPasswordModal }] = useModal();
const [registerImport, { openModal: openImportModal }] = useModal(); const [registerImport, { openModal: openImportModal }] = useModal();
const searchInfo = reactive<Recordable>({}); const searchInfo = reactive<Recordable>({});
const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm }] = useTable({ const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm,getRowSelection }] = useTable({
title: '脱敏算法', title: '脱敏算法',
api: async (params) => { api: async (params) => {
console.log(params) console.log(params)
...@@ -70,7 +71,8 @@ const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm }] ...@@ -70,7 +71,8 @@ const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm }]
return { ...response}; return { ...response};
}, },
rowKey: 'id', rowKey: 'businessId',
rowSelection: true,
columns, columns,
formConfig: { formConfig: {
labelWidth: 10, labelWidth: 10,
......
...@@ -2,36 +2,43 @@ ...@@ -2,36 +2,43 @@
export const tableList: any[] = [ export const tableList: any[] = [
{ {
businessId: 1,
"name" : "aqlbook_founction_buidin_rule", "name" : "aqlbook_founction_buidin_rule",
"des" : "自定义函数内置", "des" : "自定义函数内置",
"module" : "自定义函数", "module" : "自定义函数",
}, },
{ {
businessId: 2,
"name" : "aqlbook_founction_buidin_rule", "name" : "aqlbook_founction_buidin_rule",
"des" : "自定义函数内置", "des" : "自定义函数内置",
"module" : "自定义函数", "module" : "自定义函数",
}, },
{ {
businessId: 3,
"name" : "aqlbook_founction_buidin_rule", "name" : "aqlbook_founction_buidin_rule",
"des" : "自定义函数内置", "des" : "自定义函数内置",
"module" : "自定义函数", "module" : "自定义函数",
}, },
{ {
businessId: 4,
"name" : "aqlbook_founction_buidin_rule", "name" : "aqlbook_founction_buidin_rule",
"des" : "自定义函数内置", "des" : "自定义函数内置",
"module" : "自定义函数", "module" : "自定义函数",
}, },
{ {
businessId: 5,
"name" : "aqlbook_founction_buidin_rule", "name" : "aqlbook_founction_buidin_rule",
"des" : "自定义函数内置", "des" : "自定义函数内置",
"module" : "自定义函数", "module" : "自定义函数",
}, },
{ {
businessId: 6,
"name" : "aqlbook_founction_buidin_rule", "name" : "aqlbook_founction_buidin_rule",
"des" : "自定义函数内置", "des" : "自定义函数内置",
"module" : "自定义函数", "module" : "自定义函数",
}, },
{ {
businessId: 7,
"name" : "aqlbook_founction_buidin_rule", "name" : "aqlbook_founction_buidin_rule",
"des" : "自定义函数内置", "des" : "自定义函数内置",
"module" : "自定义函数", "module" : "自定义函数",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment