Commit 432872ff authored by baiyinhao's avatar baiyinhao

修改质量参数新建编辑 修改服务管理按钮位置

parent 21ba825a
...@@ -3,7 +3,12 @@ ...@@ -3,7 +3,12 @@
<BasicTable @register="registerTable" :searchInfo="searchInfo"> <BasicTable @register="registerTable" :searchInfo="searchInfo">
<template #toolbar> <template #toolbar>
<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
type="primary"
@click="handleExport"
:disabled="getRowSelection().selectedRowKeys <= 0"
>导出</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 }">
...@@ -109,6 +114,14 @@ ...@@ -109,6 +114,14 @@
isUpdate: false, isUpdate: false,
}); });
} }
/** 编辑按钮*/
function handleEdit(record: Recordable, disabled: number) {
isAdd.value = false;
openRuleEditModel(true, {
isUpdate: true,
record,
});
}
/** 导入按钮*/ /** 导入按钮*/
function handleImport() { function handleImport() {
openImportModal(true, {}); openImportModal(true, {});
...@@ -120,17 +133,7 @@ ...@@ -120,17 +133,7 @@
const data = await exportRoleList(params); const data = await exportRoleList(params);
downloadByData(data, '质量参数' + '.xlsx'); downloadByData(data, '质量参数' + '.xlsx');
} }
/** 编辑按钮*/
function handleEdit(record: Recordable, disabled: number) {
// console.log('record', record.businessId);
router.push({
path: '/dataQuality/edit',
query: {
id: record.businessId,
disabled: String(disabled),
},
});
}
/** 重置密码弹窗确定按钮*/ /** 重置密码弹窗确定按钮*/
/** 删除按钮*/ /** 删除按钮*/
function handleDelete(record: Recordable) { function handleDelete(record: Recordable) {
......
...@@ -20,8 +20,6 @@ ...@@ -20,8 +20,6 @@
label: '规则组2', label: '规则组2',
value: '规则组2', value: '规则组2',
}, },
]" ]"
v-model:value="model[field]" v-model:value="model[field]"
/> />
...@@ -81,15 +79,16 @@ ...@@ -81,15 +79,16 @@
</BasicModal> </BasicModal>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import {ref, computed, unref, defineProps} from 'vue'; import { ref, computed, unref, defineProps } from 'vue';
import { Select } from 'ant-design-vue'; import { Select } from 'ant-design-vue';
import { BasicModal, useModalInner, useModal } from '@/components/Modal'; import { BasicModal, useModalInner, useModal } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form'; import { BasicForm, useForm } from '@/components/Form';
import { import {
configColumn, configColumn,
ruleEditModelFormSchema, ruleModelFormSchema, ruleEditModelFormSchema,
ruleModelFormSchema,
taskColumn, taskColumn,
} from '@/views/dataQuality/dataSheet/rule/parameter/parameterType.data'; } from '@/views/dataQuality/dataSheet/rule/parameter/parameterType.data';
import BasicTable from '@/components/Table/src/BasicTable.vue'; import BasicTable from '@/components/Table/src/BasicTable.vue';
import { useTable } from '@/components/Table'; import { useTable } from '@/components/Table';
...@@ -101,7 +100,7 @@ import { ...@@ -101,7 +100,7 @@ import {
}); });
const isUpdate = ref(true); const isUpdate = ref(true);
const rowId = ref(''); const rowId = ref('');
const getTitle = computed(() => (isUpdate.value ? '质量规则详情' : '新建规则')); const getTitle = computed(() => (!isUpdate.value ? '新建参数' : '编辑参数'));
function handleAddGroup() { function handleAddGroup() {
openRuleGroupAddModel(true, { openRuleGroupAddModel(true, {
isUpdate: false, isUpdate: false,
...@@ -138,11 +137,18 @@ import { ...@@ -138,11 +137,18 @@ import {
}); });
await resetSchema([...ruleEditModelFormSchema]); await resetSchema([...ruleEditModelFormSchema]);
} else { } else {
await resetSchema([...ruleModelFormSchema]); await resetSchema([...ruleEditModelFormSchema]);
}
if (unref(isUpdate)) {
// 获取行数据的id
rowId.value = data.record.businessId;
// 塞值
await setFieldsValue({
...data.record,
});
} }
}); });
const [configTable] = const [configTable] = useTable({
useTable({
title: '', title: '',
// 定高 // 定高
scroll: { y: 175 }, scroll: { y: 175 },
......
import { BasicColumn, FormSchema } from '@/components/Table'; import { BasicColumn, FormSchema } from '@/components/Table';
// 引入开关组件 // 引入开关组件
...@@ -11,7 +10,6 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -11,7 +10,6 @@ export const searchFormSchema: FormSchema[] = [
component: 'Input', component: 'Input',
colProps: { span: 4 }, colProps: { span: 4 },
componentProps: { componentProps: {
placeholder: '搜索关键字', placeholder: '搜索关键字',
}, },
}, },
...@@ -39,8 +37,6 @@ export const columns: BasicColumn[] = [ ...@@ -39,8 +37,6 @@ export const columns: BasicColumn[] = [
dataIndex: 'ParameterValues', dataIndex: 'ParameterValues',
width: 140, width: 140,
}, },
]; ];
/** 新增编辑表单字段*/ /** 新增编辑表单字段*/
...@@ -81,10 +77,7 @@ export const formSchema: any[] = [ ...@@ -81,10 +77,7 @@ export const formSchema: any[] = [
label: '检查数据源', label: '检查数据源',
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: [ options: [{ label: 'inceptor', value: 'inceptor' }],
{ label: 'inceptor', value: 'inceptor' },
],
}, },
rules: [ rules: [
{ {
...@@ -97,10 +90,8 @@ export const formSchema: any[] = [ ...@@ -97,10 +90,8 @@ export const formSchema: any[] = [
field: 'params', field: 'params',
label: '关联模板', label: '关联模板',
component: 'Input', component: 'Input',
}, },
];
]
export const ruleModelFormSchema: any[] = [ export const ruleModelFormSchema: any[] = [
{ {
...@@ -140,7 +131,6 @@ export const ruleModelFormSchema: any[] = [ ...@@ -140,7 +131,6 @@ export const ruleModelFormSchema: any[] = [
{ label: '质量模板', value: '质量模板' }, { label: '质量模板', value: '质量模板' },
{ label: '内置模版', value: '内置模版' }, { label: '内置模版', value: '内置模版' },
{ label: '非空检查(不为NULL)', value: '非空检查(不为NULL)' }, { label: '非空检查(不为NULL)', value: '非空检查(不为NULL)' },
], ],
}, },
colProps: { lg: 24, md: 24 }, colProps: { lg: 24, md: 24 },
...@@ -162,75 +152,99 @@ export const ruleModelFormSchema: any[] = [ ...@@ -162,75 +152,99 @@ export const ruleModelFormSchema: any[] = [
}, },
colProps: { lg: 24, md: 24 }, colProps: { lg: 24, md: 24 },
}, },
]; ];
export const ruleEditModelFormSchema: any[] = [ export const ruleEditModelFormSchema: any[] = [
{ {
field: 'rule', field: 'name',
label: '规则名称', label: '参数名称',
required: true, required: true,
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 }, colProps: { lg: 24, md: 24 },
}, },
{ {
field: 'distinct', field: 'describe',
label: '规则描述', label: '参数说明',
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 }, colProps: { lg: 24, md: 24 },
}, },
{ {
field: 'group', field: 'type',
label: '所属规则组', label: '参数类型',
slot: 'group', component: 'Input',
colProps: { lg: 24, md: 24 },
},
{
field: 'dataSource',
label: '检查数据源',
required: true,
slot: 'dataSource',
component: 'Select',
colProps: { lg: 24, md: 24 },
},
{
field: 'dataSource',
label: '数据源',
slot: 'dataSourceTxt',
colProps: { lg: 24, md: 24 },
},
{
field: 'model',
label: '关键模板',
required: true,
component: 'Select',
componentProps: {
options: [{ label: '公民身份号码', value: '公民身份号码' }],
},
colProps: { lg: 24, md: 24 }, colProps: { lg: 24, md: 24 },
}, },
{ {
field: 'config', field: 'ParameterValues',
label: '参数配置', label: '参数',
slot: 'config', component: 'Input',
colProps: { lg: 24, md: 24 }, colProps: { lg: 24, md: 24 },
}, },
// {
// field: 'rule',
// label: '规则名称',
// required: true,
// component: 'Input',
// colProps: { lg: 24, md: 24 },
// },
// {
// field: 'distinct',
// label: '规则描述',
// component: 'Input',
// colProps: { lg: 24, md: 24 },
// },
// {
// field: 'group',
// label: '所属规则组',
// slot: 'group',
// colProps: { lg: 24, md: 24 },
// },
// {
// field: 'dataSource',
// label: '检查数据源',
// required: true,
// slot: 'dataSource',
// component: 'Select',
// colProps: { lg: 24, md: 24 },
// },
// {
// field: 'dataSource',
// label: '数据源',
// slot: 'dataSourceTxt',
// colProps: { lg: 24, md: 24 },
// },
// {
// field: 'model',
// label: '关键模板',
// required: true,
// component: 'Select',
// componentProps: {
// options: [{ label: '公民身份号码', value: '公民身份号码' }],
// },
// colProps: { lg: 24, md: 24 },
// },
// {
// field: 'config',
// label: '参数配置',
// slot: 'config',
// colProps: { lg: 24, md: 24 },
// },
{ // {
field: 'preview', // field: 'preview',
label: 'SQL预览', // label: 'SQL预览',
component: 'InputTextArea', // component: 'InputTextArea',
componentProps: { // componentProps: {
placeholder: '请输入描述', // placeholder: '请输入描述',
rows: 4, // rows: 4,
}, // },
colProps: { lg: 24, md: 24 }, // colProps: { lg: 24, md: 24 },
}, // },
{ // {
field: 'task', // field: 'task',
label: '关联质量任务', // label: '关联质量任务',
slot: 'task', // slot: 'task',
colProps: { lg: 24, md: 24 }, // colProps: { lg: 24, md: 24 },
}, // },
]; ];
export const configColumn: BasicColumn[] = [ export const configColumn: BasicColumn[] = [
{ {
......
<template> <template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex"> <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<div class="all-of-all" style="display: flex">
<PageWrapper class="w-1/3 xl:w-2/9" dense style="height: 100vh"> <PageWrapper class="w-1/3 xl:w-2/9" dense style="height: 100vh">
<GroupTree @select="onNodeSelect" style="height: 100%; overflow-y: auto" /> <GroupTree @select="onNodeSelect" style="height: 100%; overflow-y: auto" />
</PageWrapper> </PageWrapper>
...@@ -39,6 +40,7 @@ ...@@ -39,6 +40,7 @@
</div> </div>
</template> </template>
</PageWrapper> </PageWrapper>
</div>
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -137,4 +139,8 @@ ...@@ -137,4 +139,8 @@
} }
} }
} }
.all-of-all {
background-color: #fff;
}
</style> </style>
...@@ -146,7 +146,7 @@ export const tableList: any[] = [ ...@@ -146,7 +146,7 @@ export const tableList: any[] = [
callFailNum: '10', callFailNum: '10',
}, },
{ {
businessId: 1, businessId: 2,
account: 'admin', account: 'admin',
name: 'admin', name: 'admin',
serviceNum: '17', serviceNum: '17',
...@@ -155,7 +155,25 @@ export const tableList: any[] = [ ...@@ -155,7 +155,25 @@ export const tableList: any[] = [
callFailNum: '10', callFailNum: '10',
}, },
{ {
businessId: 1, businessId: 3,
account: 'admin',
name: 'admin',
serviceNum: '17',
callNum: '28',
callSuccessNum: '18',
callFailNum: '10',
},
{
businessId: 4,
account: 'admin',
name: 'admin',
serviceNum: '17',
callNum: '28',
callSuccessNum: '18',
callFailNum: '10',
},
{
businessId: 5,
account: 'admin', account: 'admin',
name: 'admin', name: 'admin',
serviceNum: '17', serviceNum: '17',
......
...@@ -17,7 +17,12 @@ ...@@ -17,7 +17,12 @@
<BasicTable @register="registerTable" :rowSelection="rowSelection"> <BasicTable @register="registerTable" :rowSelection="rowSelection">
<template #headerTop> <template #headerTop>
<a-Input-Search placeholder="输入关键字搜索" style="width: 200px" /> <a-Input-Search placeholder="输入关键字搜索" style="width: 200px" />
<a-button type="primary" @click="handleNew" style="margin-left: 10px">新建</a-button> <a-button
type="primary"
@click="handleNew"
style=" margin-right: 20px;margin-left: 10px; float: right"
>新建</a-button
>
</template> </template>
<template #toolbar> </template> <template #toolbar> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
......
...@@ -16,7 +16,12 @@ ...@@ -16,7 +16,12 @@
<BasicTable @register="registerTable" :rowSelection="rowSelection"> <BasicTable @register="registerTable" :rowSelection="rowSelection">
<template #headerTop> <template #headerTop>
<a-Input-Search placeholder="输入关键字搜索" style="width: 200px" /> <a-Input-Search placeholder="输入关键字搜索" style="width: 200px" />
<a-button type="primary" @click="handleNew" style="margin-left: 10px">新建</a-button> <a-button
type="primary"
@click="handleNew"
style="margin-right: 20px; margin-left: 10px; float: right"
>新建</a-button
>
</template> </template>
<template #toolbar> </template> <template #toolbar> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
......
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