Commit 35148a63 authored by baiyinhao's avatar baiyinhao

新增数据质量报告页面

parent be1b5992
import { BasicColumn, FormSchema } from '@/components/Table'; import { BasicColumn, FormSchema } from '@/components/Table';
import { DescItem } from '@/components/Description'; import { DescItem } from '@/components/Description';
import { c } from 'node_modules/vite/dist/node/types.d-aGj9QkWt';
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
...@@ -95,41 +96,58 @@ export const modEditColumns: BasicColumn[] = [ ...@@ -95,41 +96,58 @@ export const modEditColumns: BasicColumn[] = [
]; ];
export const ruleSchema: FormSchema[] = [ export const ruleSchema: FormSchema[] = [
{ {
field: 'type', field: 'path',
label: '过滤类型', label: '路径',
component: 'RadioGroup', component: 'TreeSelect',
colProps: { lg: 22 },
componentProps: { componentProps: {
options: [ treeData: [
{ label: '黑名单', value: '0' }, {
{ label: '白名单', value: '1' }, label: 'system',
value: 'system',
children: [
{ label: 'discover2', value: 'discover2' },
{ label: 'tmp', value: 'tmp' },
], ],
}, },
defaultValue: '0', { label: 'discover', value: 'discover' },
required: true, ],
}, },
{ colProps: { lg: 24 },
field: 'baseRule',
label: '库规则',
component: 'InputTextArea',
colProps: { lg: 22 },
defaultValue: 'system|discover|tmp', defaultValue: 'system|discover|tmp',
required: true, required: true,
}, },
{ {
field: 'tableRule', field: 'fileName',
label: '表规则', label: '文件名称',
component: 'InputTextArea', component: 'Input',
colProps: { lg: 22 }, colProps: { lg: 24 },
defaultValue: componentProps: {},
'tdt_,TDT_VIEW,baymax_tmp_,TDT_ROCK_VIEW_,TDT_ROCK_TABLE_,TDTTABLEEXTERNAL,TDTTABLE_PERSISTENT', defaultValue: '白名单test',
required: true, required: true,
}, },
{ {
field: 'rule', field: 'description',
label: '规则检验', label: '描述',
component: 'Input', component: 'Input',
colProps: { lg: 22 }, colProps: { lg: 24 },
},
{
field: 'fileType',
label: '文件类型',
component: 'Input',
componentProps: {
disabled: true,
},
colProps: { lg: 24 },
defaultValue: '质量白名单',
},
{
field: 'tableName',
label: '名单存储表名',
component: 'Input',
componentProps: {},
colProps: { lg: 24 },
required: true,
}, },
]; ];
export const detailHookColumns: BasicColumn[] = [ export const detailHookColumns: BasicColumn[] = [
......
...@@ -6,15 +6,22 @@ ...@@ -6,15 +6,22 @@
:title="title" :title="title"
@ok="handleSubmit" @ok="handleSubmit"
> >
<Description size="middle" :bordered="false" title="Hook插件" /> <BasicForm @register="registerForm" />
<Description size="middle" :bordered="false" title="问题数据示例" />
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleAddWhite" v-if="isWhite"
>添加问题数据到白名单</a-button
>
<a-button type="primary" @click="reload">设置问题规则</a-button>
</template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'"> <template v-if="column.key === 'status'">
<Tag color="success" v-if="record.status === '1'">up</Tag> <Tag color="success" v-if="record.status === '1'">up</Tag>
</template> </template>
</template> </template>
</BasicTable> </BasicTable>
<Description <!-- <Description
size="middle" size="middle"
:bordered="false" :bordered="false"
title="Kafka服务" title="Kafka服务"
...@@ -22,18 +29,22 @@ ...@@ -22,18 +29,22 @@
:data="refundData" :data="refundData"
:schema="refundSchema" :schema="refundSchema"
/> />
<BasicTable @register="registerKafkaTable" /> <BasicTable @register="registerKafkaTable" /> -->
</BasicModal> </BasicModal>
<whiteListModal @register="registerWhiteListModal" />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, ref } from 'vue'; import { onMounted, ref } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal'; import { BasicModal, useModalInner, useModal } from '@/components/Modal';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import { BasicTable, useTable } from '@/components/Table'; import { BasicTable, useTable } from '@/components/Table';
import Description from '@/components/Description/src/Description.vue'; import Description from '@/components/Description/src/Description.vue';
import { detailHookColumns, KafkaColumns, refundSchema } from './data'; import { detailHookColumns, KafkaColumns, refundSchema } from './data';
import { detailHookData, KafkaData, refundData } from './kinshipOperationsData'; import { detailHookData, KafkaData, detailModalSchema } from './kinshipOperationsData';
import { Tag } from 'ant-design-vue'; import { Tag } from 'ant-design-vue';
import { useForm, BasicForm } from '@/components/Form';
import { downloadByData } from '@/utils/file/download';
import whiteListModal from './modEditModal.vue';
defineOptions({ name: 'KnowledgeModal' }); defineOptions({ name: 'KnowledgeModal' });
...@@ -41,9 +52,14 @@ ...@@ -41,9 +52,14 @@
const { createMessage } = useMessage(); const { createMessage } = useMessage();
const title = ref(); const title = ref();
const tableData = ref([]); const tableData = ref([]);
const isWhite = ref(true);
const [
registerWhiteListModal,
{ setModalProps: setWhiteListModalProps, openModal: openWhiteListModal },
] = useModal();
//获取接口数据并放在下拉框里(这里是打开了一个弹框) //获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单 //初始化表单
const [registerTable, { reload }] = useTable({ const [registerTable, { reload, getForm, getRowSelection }] = useTable({
api: async () => { api: async () => {
const response = { const response = {
pageNum: '1', pageNum: '1',
...@@ -66,6 +82,10 @@ ...@@ -66,6 +82,10 @@
bordered: false, bordered: false,
showIndexColumn: false, showIndexColumn: false,
scroll: { y: 300 }, scroll: { y: 300 },
rowSelection: {
type: 'checkbox',
},
actionColumn: { actionColumn: {
width: '120px', width: '120px',
title: '操作', title: '操作',
...@@ -86,9 +106,19 @@ ...@@ -86,9 +106,19 @@
showIndexColumn: false, showIndexColumn: false,
scroll: { y: 300 }, scroll: { y: 300 },
}); });
const [registerForm] = useForm({
labelWidth: 100,
schemas: detailModalSchema,
showActionButtonGroup: false,
actionColOptions: { span: 24 },
});
async function handleSubmit() { async function handleSubmit() {
closeModal(); closeModal();
} }
/**添加数据到白名单按钮*/
function handleAddWhite() {
openWhiteListModal(true, {});
}
onMounted(() => { onMounted(() => {
tableData.value = detailHookData; tableData.value = detailHookData;
}); });
......
...@@ -5,6 +5,12 @@ ...@@ -5,6 +5,12 @@
fixedHeight fixedHeight
contentClass="flex flex-col overflow-y-auto h-screen" contentClass="flex flex-col overflow-y-auto h-screen"
> >
<div class="flex flex-row justify-end mb-3">
<a-button type="primary" @click="handleExport" class="w-1/10 xl:w-1/10"
>导出问题数据</a-button
>
<a-button type="primary" @click="handleExport" class="w-1/10 xl:w-1/10">导出报告</a-button>
</div>
<BasicForm @register="registerForm" class="h-1/5 xl:h-1/5" /> <BasicForm @register="registerForm" class="h-1/5 xl:h-1/5" />
<div class="h-1/5 xl:h-1/5">图表占位1</div> <div class="h-1/5 xl:h-1/5">图表占位1</div>
<div class="h-2/5 xl:h-2/5" contentClass="flex flex-row" <div class="h-2/5 xl:h-2/5" contentClass="flex flex-row"
...@@ -13,9 +19,7 @@ ...@@ -13,9 +19,7 @@
</div> </div>
<div class="h-1/5 xl:h-1/5 height-100"> <div class="h-1/5 xl:h-1/5 height-100">
<BasicTable @register="registerTableRight" :searchInfo="searchInfo" class="height-100"> <BasicTable @register="registerTableRight" :searchInfo="searchInfo" class="height-100">
<template #toolbar> <template #toolbar> </template>
<a-button type="primary" @click="refresh">刷新</a-button>
</template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<!-- <template v-if="column.key === 'status'"> <!-- <template v-if="column.key === 'status'">
<Tag color="error" v-if="record.status === '0'">失败</Tag> <Tag color="error" v-if="record.status === '0'">失败</Tag>
...@@ -37,7 +41,7 @@ ...@@ -37,7 +41,7 @@
label: '', label: '',
onClick: handleDetail.bind(null), onClick: handleDetail.bind(null),
tooltip: '查看详情', tooltip: '查看详情',
ifShow: record.result !== '通过', ifShow: record.status === '0',
}, },
// { // {
// icon: 'clarity:link-line', // icon: 'clarity:link-line',
...@@ -56,6 +60,7 @@ ...@@ -56,6 +60,7 @@
</BasicTable> </BasicTable>
</div> </div>
</PageWrapper> </PageWrapper>
<detail-modal @register="registerDetailModal" />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { reactive } from 'vue'; import { reactive } from 'vue';
...@@ -72,6 +77,8 @@ ...@@ -72,6 +77,8 @@
import detailModal from './detailModal.vue'; import detailModal from './detailModal.vue';
import { CheckOutlined, CloseOutlined } from '@ant-design/icons-vue'; import { CheckOutlined, CloseOutlined } from '@ant-design/icons-vue';
import { formSchema } from '../mainBody.data'; import { formSchema } from '../mainBody.data';
import { getRoleListByPage, deleteById, exportRoleList } from '@/api/system/role/role';
import { downloadByData } from '@/utils/file/download';
defineOptions({ name: 'KnowledgeBase' }); defineOptions({ name: 'KnowledgeBase' });
const state = reactive({ const state = reactive({
...@@ -103,7 +110,7 @@ ...@@ -103,7 +110,7 @@
// // dataIndex: 'action', // // dataIndex: 'action',
// // }, // // },
// }); // });
const [registerTableRight, { reload: reloadRight }] = useTable({ const [registerTableRight, { reload: reloadRight, getForm }] = useTable({
dataSource: DataRight, dataSource: DataRight,
title: '规则清单', title: '规则清单',
striped: false, striped: false,
...@@ -149,7 +156,14 @@ ...@@ -149,7 +156,14 @@
} }
function handleDetail() { function handleDetail() {
openDetailModal(true, { openDetailModal(true, {
title: '血缘插件详情', title: '问题规则',
}); });
} }
//导出报告
async function handleExport() {
console.log('导出----');
const params = Object.assign({}, getForm().getFieldsValue());
const data = await exportRoleList(params);
downloadByData(data, '报告' + '.xlsx');
}
</script> </script>
...@@ -256,3 +256,213 @@ export const formSchemaRight: any[] = [ ...@@ -256,3 +256,213 @@ export const formSchemaRight: any[] = [
}, },
}, },
]; ];
export const detailModalSchema: any[] = [
{
field: 'source',
component: 'Input',
label: '数据库:',
componentProps: {
disabled: true,
placeholder: 'mob_data',
style: { width: '100%' },
},
},
{
field: 'dataTable',
component: 'Input',
label: '数据表/主体:',
componentProps: {
disabled: true,
placeholder: 'menber_relationship_info',
style: { width: '100%' },
},
},
{
field: 'field',
component: 'Input',
label: '字段:',
componentProps: {
disabled: true,
placeholder: 'menber_identity',
style: { width: '100%' },
},
},
{
field: 'ruleName',
component: 'Input',
label: '规则名称:',
componentProps: {
disabled: true,
placeholder: 'menber_identity公民身份号码',
style: { width: '100%' },
},
},
{
field: 'ruleType',
component: 'Input',
label: '规则类型:',
componentProps: {
disabled: true,
placeholder: 'menber_identity公民身份号码',
style: { width: '100%' },
},
},
{
field: 'problemCount',
component: 'Input',
label: '问题记录数:',
componentProps: {
disabled: true,
placeholder: '16723',
style: { width: '100%' },
colProps: {
lg: 24,
md: 24,
},
},
},
{
field: 'reportDimension',
component: 'Input',
label: '报告维度:',
componentProps: {
disabled: true,
placeholder: '',
style: { width: '100%' },
},
},
{
field: 'ruleDesc',
component: 'Input',
label: '规则描述:',
componentProps: {
disabled: true,
placeholder: '',
style: { width: '100%' },
},
},
];
export const whiteListData: any[] = [
{
field: 'requestTitle',
component: 'Input',
label: '申请标题',
componentProps: {
required: true,
placeholder: '',
style: { width: '100%' },
},
},
{
field: 'requestReason',
component: 'Input',
label: '申请理由',
componentProps: {
required: true,
placeholder: '',
style: { width: '100%' },
},
},
{
field: 'requester',
component: 'Input',
label: '申请人',
componentProps: {
// required: true,
disabled: true,
placeholder: 'admin',
style: { width: '100%' },
},
},
{
field: 'requesterOrg',
component: 'Input',
label: '申请人组织',
componentProps: {
// required: true,
disabled: true,
placeholder: '-',
style: { width: '100%' },
},
},
{
field: 'whiteList',
component: 'Select',
label: '白名单',
componentProps: {
required: true,
// disabled: true,
placeholder: '-',
style: { width: '100%' },
options: [
{
label: 'tyh',
value: 'tyh',
},
{
label: 'tyh2',
value: 'tyh2',
},
],
},
},
{
field: 'LinkSubject',
component: 'Input',
label: '名单关联主体',
componentProps: {
// required: true,
disabled: true,
placeholder: '/质量主体/共享工作区/tyh',
style: { width: '100%' },
},
},
{
field: 'SourceInfo',
component: 'Input',
label: '来源信息',
componentProps: {
// required: true,
disabled: true,
placeholder: '',
style: { width: '100%' },
colProps: {
lg: 24,
md: 24,
},
},
},
{
field: 'QualityTask',
component: 'Input',
label: '质量任务',
componentProps: {
// required: true,
disabled: true,
placeholder: 'tyh',
style: { width: '100%' },
},
},
{
field: 'QualityRule',
component: 'Input',
label: '质量规则',
componentProps: {
// required: true,
disabled: true,
placeholder: 'tyh-1',
style: { width: '100%' },
},
},
{
field: 'TaskBatch',
component: 'Input',
label: '任务批次',
componentProps: {
// required: true,
disabled: true,
placeholder: '2023-08-16 14:30:00 ~ 2023-08-17 14:30:00',
style: { width: '100%' },
},
},
];
...@@ -6,13 +6,10 @@ ...@@ -6,13 +6,10 @@
:title="title" :title="title"
@ok="handleSubmit" @ok="handleSubmit"
> >
<Alert <BasicForm @register="registerForm" />
show-icon
message="维护血缘插件与数据连接的映射关系,标识插件中的血缘在以下连接所关联的数据源中展示。"
/>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleDeleteIds">新增映射</a-button> <a-button type="primary" @click="handleNewWhiteFast">快速创建白名单</a-button>
</template> </template>
<template #bodyCell="{ column }"> <template #bodyCell="{ column }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
...@@ -34,22 +31,34 @@ ...@@ -34,22 +31,34 @@
</template> </template>
</BasicTable> </BasicTable>
</BasicModal> </BasicModal>
<new-white-list-fast-modal @register="registerNewWhiteListFastModal" />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, ref } from 'vue'; import { onMounted, ref } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal'; import { BasicModal, useModalInner, useModal } from '@/components/Modal';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import { BasicTable, TableAction, useTable } from '@/components/Table'; import { BasicTable, TableAction, useTable } from '@/components/Table';
import { BasicForm, useForm } from '@/components/Form';
import { Alert } from 'ant-design-vue'; import { Alert } from 'ant-design-vue';
import { modEditColumns } from './data'; import { modEditColumns } from './data';
import { modEditData } from './kinshipOperationsData'; import { modEditData, whiteListData } from './kinshipOperationsData';
import newWhiteListFastModal from './newWhiteListFastModal.vue';
defineOptions({ name: 'KnowledgeModal' }); defineOptions({ name: 'KnowledgeModal' });
const emit = defineEmits(['success', 'register']); const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage(); const { createMessage } = useMessage();
const title = ref(); const title = '申请更新白名单';
const isNew = ref(true);
const tableData = ref([]); const tableData = ref([]);
const [registerNewWhiteListFastModal, { openModal: openNewWhiteFastModal }] = useModal();
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
baseColProps: { lg: 12, md: 24 },
schemas: whiteListData,
showActionButtonGroup: false,
actionColOptions: {},
labelWidth: 150,
});
//获取接口数据并放在下拉框里(这里是打开了一个弹框) //获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单 //初始化表单
const [registerTable, { reload }] = useTable({ const [registerTable, { reload }] = useTable({
...@@ -84,16 +93,16 @@ ...@@ -84,16 +93,16 @@
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
await reload(); await reload();
setModalProps({ confirmLoading: false }); setModalProps({ confirmLoading: false });
title.value = data.title; // title.value = data.title;
}); });
async function handleSubmit() { async function handleSubmit() {
closeModal(); closeModal();
createMessage.success('提交成功'); createMessage.success('提交成功');
} }
/** 批量删除按钮*/ /** 快速新建白名单弹窗按钮*/
function handleDeleteIds() { function handleNewWhiteFast() {
createMessage.success('刷新成功!'); openNewWhiteFastModal();
} }
/** 删除按钮*/ /** 删除按钮*/
function handleDelete() { function handleDelete() {
......
<template>
<BasicModal
width="40%"
v-bind="$attrs"
@register="registerModal"
:title="title"
@ok="handleSubmit"
>
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { useMessage } from '@/hooks/web/useMessage';
// import { recommendData } from '@/views/metadata/metadataData';
import { BasicForm, useForm } from '@/components/Form';
import { ruleSchema } from './data';
defineOptions({ name: 'KnowledgeModal' });
const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage();
const title = ref();
const tableData = ref([]);
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 12, md: 24 },
schemas: ruleSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
await resetFields();
setModalProps({ confirmLoading: false });
title.value = data.title;
});
async function handleSubmit() {
closeModal();
createMessage.success('提交成功');
await resetFields();
}
onMounted(() => {
// tableData.value = recommendData;
});
</script>
...@@ -148,4 +148,11 @@ ...@@ -148,4 +148,11 @@
title: '血缘插件详情', title: '血缘插件详情',
}); });
} }
//导出报告
async function handleExport() {
console.log('导出----');
const params = Object.assign({}, getForm().getFieldsValue());
const data = await exportRoleList(params);
downloadByData(data, '报告' + '.xlsx');
}
</script> </script>
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