Commit 08121ca0 authored by baiyinhao's avatar baiyinhao

修改质量任务

parent 6123b78f
import { BasicColumn, FormSchema } from '@/components/Table';
export const columns: BasicColumn[] = [
{
title: '名称',
dataIndex: 'name',
width: 120,
},
{
title: '类型',
dataIndex: 'category',
width: 120,
},
{
title: '拥有者',
dataIndex: 'owner',
width: 120,
},
{
title: '创建时间',
dataIndex: 'createDate',
width: 140,
},
];
export const SearchFormSchema: FormSchema[] = [
{
field: 'name',
label: '名称',
component: 'Input',
colProps: { span: 8 },
},
{
field: 'isKinship',
component: 'Checkbox',
label: '仅看血缘对象',
colProps: { span: 8 },
labelWidth: 120,
},
];
export const storageManagementColumns: BasicColumn[] = [
{
title: '清理开始时间',
dataIndex: 'startTime',
width: 120,
},
{
title: '清理结束时间',
dataIndex: 'endTime',
width: 120,
},
{
title: '执行耗时',
dataIndex: 'useTime',
width: 80,
},
{
title: '执行状态',
dataIndex: 'status',
width: 120,
},
{
title: '清理策略',
dataIndex: 'type',
width: 120,
},
{
title: '清理表顶点数',
dataIndex: 'pointNum',
width: 120,
},
{
title: '清理血缘关系数',
dataIndex: 'num',
width: 120,
},
{
title: '操作者',
dataIndex: 'user',
width: 80,
},
];
export const storageManagementFormSchema: FormSchema[] = [
{
field: 'startTime',
label: '清理开始时间',
component: 'DatePicker',
colProps: { lg: 4, md: 4 },
},
{
field: 'endTime',
label: '清理结束时间',
component: 'DatePicker',
colProps: { lg: 4, md: 4 },
},
{
field: 'user',
label: '清理者',
component: 'Input',
colProps: { lg: 4, md: 4 },
},
{
field: 'type',
label: '清理策略',
component: 'Select',
componentProps: {
options: [
{ label: '手动清理', value: '1' },
{ label: '自动清理', value: '2' },
],
},
colProps: { lg: 4, md: 4 },
},
];
export const storageManagementData: any[] = [
{
id: '1',
startTime: '2024-10-01 08:00:00',
endTime: '2024-10-01 10:30:00',
useTime: '2小时30分钟',
status: '1',
type: '手动清理',
pointNum: '5000',
num: '2000',
user: '张三',
},
{
id: '2',
startTime: '2024-10-02 09:00:00',
endTime: '2024-10-02 11:45:00',
useTime: '2小时45分钟',
status: '0',
type: '自动清理',
pointNum: '7000',
num: '3500',
user: '李四',
},
{
id: '3',
startTime: '2024-10-03 10:00:00',
endTime: '2024-10-03 12:15:00',
useTime: '2小时15分钟',
status: '1',
type: '手动清理',
pointNum: '6000',
num: '3000',
user: '王五',
},
{
id: '4',
startTime: '2024-10-04 11:00:00',
endTime: '2024-10-04 13:20:00',
useTime: '2小时20分钟',
status: '1',
type: '自动清理',
pointNum: '4500',
num: '2250',
user: '赵六',
},
{
id: '5',
startTime: '2024-10-05 12:00:00',
endTime: '2024-10-05 14:30:00',
useTime: '2小时30分钟',
status: '1',
type: '手动清理',
pointNum: '5500',
num: '2750',
user: '孙七',
},
];
<template>
<BasicModal
width="80%"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<div style="display: flex; justify-content: flex-end; padding-bottom: 10px">
<a-button style="margin-right: 5px" type="primary" @click="deleteAll">批量删除</a-button>
<a-button style="margin-right: 5px" type="primary" @click="handleImport">规则设置</a-button>
</div>
<template #footer>
<a-button type="primary" @click="handleSubmit">关闭</a-button>
</template>
<BasicTable @register="registerTable">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'">
<Tag color="error" v-if="record.status === '0'">失败</Tag>
</template>
<template v-if="column.key === 'status'">
<Tag color="success" v-if="record.status === '1'">成功</Tag>
</template>
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
//配置详情
icon: 'clarity:note-edit-line',
label: '',
onClick: handleEdit.bind(null),
},
{
icon: 'ant-design:delete-outlined',
color: 'error',
label: '',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null),
},
},
{
//失败日志
icon: 'clarity:contract-line',
label: '',
ifShow: record.status === '0',
onClick: handleDetail.bind(null),
},
]"
/>
</template>
</template>
</BasicTable>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref, reactive, onMounted } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { useMessage } from '@/hooks/web/useMessage';
import { BasicTable, TableAction, useTable } from '@/components/Table';
import {
storageManagementColumns,
storageManagementFormSchema,
storageManagementData,
} from './QualityTaskRunSetting.data';
// import { storageManagementData } from './analysisData';
import { Tag } from 'ant-design-vue';
defineOptions({ name: 'KnowledgeModal' });
const emit = defineEmits(['success', 'register']);
const { createMessage, createConfirm } = useMessage();
const title = ref();
const isRunning = ref(false);
const getTitle = computed(() => (!unref(isRunning) ? '配置运行' : '配置运行'));
const tableData = ref([]);
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerTable, { reload }] = useTable({
api: async () => {
const response = {
pageNum: '1',
pageSize: '10',
pages: '1',
total: tableData.value.length,
code: '',
message: '',
data: [],
};
//过滤data中的数据,取出等于params.deptId的数据
var data = [];
data = tableData.value;
return { ...response, data: data };
},
pagination: false,
columns: storageManagementColumns,
useSearchForm: true,
showTableSetting: false,
formConfig: {
labelWidth: 120,
schemas: storageManagementFormSchema,
autoSubmitOnEnter: true,
},
rowKey: 'id',
rowSelection: true,
bordered: true,
showIndexColumn: false,
actionColumn: {
width: 150,
title: '操作',
dataIndex: 'action',
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
await reload();
setModalProps({ confirmLoading: false });
title.value = data.title;
});
async function handleSubmit() {
closeModal();
}
function handleDetail() {
createMessage.success('提交成功');
}
function handleEdit() {
createMessage.success('提交成功');
}
function handleDelete() {
createMessage.success('删除成功');
}
function deleteAll() {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '确认批量删除选中数据吗?',
onOk() {
createMessage.success('批量删除成功!');
},
});
}
function handleImport() {
createMessage.success('导出完成');
}
onMounted(() => {
tableData.value = storageManagementData;
});
</script>
......@@ -31,7 +31,7 @@
import { formSchemaNewFolder } from './tempalte.data';
import TreeTwo from './treeTwo.vue';
import { useMessage } from '@/hooks/web/useMessage';
import { treeDataList } from '@/views/dataQuality/template/mock';
import { treeDataList } from '@/views/dataQuality/task/mock';
defineOptions({ name: 'AccountModal' });
......@@ -69,7 +69,7 @@
});
});
const getTitle = computed(() => (!unref(isUpdate) ? '新建主体' : '编辑主体'));
const getTitle = computed(() => (!unref(isUpdate) ? '新建文件夹' : '编辑文件夹'));
async function handleSubmit() {
try {
......
......@@ -16,13 +16,44 @@
<a-button type="primary" @click="handleImport">导入</a-button>
<a-button type="primary" @click="handleAdd">新增文件夹</a-button>
<a-button type="primary" @click="handleAddMainBody">新增质量任务文件</a-button>
<a-button type="primary" @click="handleQualityTaskSetting">配置质量任务文件</a-button>
<a-button type="primary" @click="handleQualityTaskRunSetting">配置运行</a-button>
<a-button type="primary" @click="handleQualityTaskRun">运行</a-button>
<a-button type="primary" @click="handleQualityTaskRunLog">查看报告</a-button>
<a-button type="primary" @click="handleQualityTaskOnline" v-if="true">上线</a-button>
<a-button
type="primary"
@click="handleQualityTaskSetting"
:disabled="getRowSelection().selectedRowKeys <= 0"
>配置质量任务文件</a-button
>
<a-button
type="primary"
@click="handleQualityTaskRunSetting"
:disabled="getRowSelection().selectedRowKeys <= 0"
>配置运行</a-button
>
<a-button
type="primary"
@click="handleQualityTaskRun"
:disabled="getRowSelection().selectedRowKeys <= 0"
>运行</a-button
>
<a-button
type="primary"
@click="handleQualityTaskRunLog"
:disabled="getRowSelection().selectedRowKeys <= 0"
>查看报告</a-button
>
<a-button
type="primary"
@click="handleQualityTaskOnline"
v-if="true"
:disabled="getRowSelection().selectedRowKeys <= 0"
>上线</a-button
>
<a-button type="primary" @click="handleQualityTaskOffline" v-if="false">下线</a-button>
<a-button type="primary" @click="handleQualityTaskService">跳转运维</a-button>
<a-button
type="primary"
@click="handleQualityTaskService"
:disabled="getRowSelection().selectedRowKeys <= 0"
>跳转运维</a-button
>
</a-scrollbar>
</template>
<template #name="{ text, record }">
......@@ -58,6 +89,7 @@
<AddFolder @register="register" />
<remove-modal @register="registerRemove" />
<main-body-modal @register="registerMain" />
<quality-Run-setting-modal @register="registerRunSetting" />
</PageWrapper>
</template>
<script lang="ts" setup>
......@@ -79,6 +111,8 @@
import AddFolder from '@/views/dataQuality/task/addFolder.vue';
import RemoveModal from '@/views/dataQuality/task/removeModal.vue';
import MainBodyModal from '@/views/dataQuality/task/mainBodyModal.vue';
import QualityRunSettingModal from './QualityTaskRunSetting.vue';
import { Modal } from 'ant-design-vue';
defineOptions({ name: 'AccountManagement' });
const { createMessage, createConfirm } = useMessage();
......@@ -89,6 +123,7 @@
const [registerImport, { openModal: openImportModal }] = useModal();
const [registerRemove, { openModal: openRemoveModal }] = useModal();
const [registerMain, { openModal: openMainModal }] = useModal();
const [registerRunSetting, { openModal: openRunSettingModal }] = useModal();
const searchInfo = reactive<Recordable>({});
const [
registerTable,
......@@ -161,15 +196,23 @@
function handleQualityTaskSetting() {
go('/dataQuality/task');
}
/** 配置运行 未完成 应为弹窗*/
/** 配置运行 正在做 应为弹窗*/
function handleQualityTaskRunSetting() {
go('/dataQuality/task');
openRunSettingModal(true, {
isRunning: false,
});
}
/** 任务运行 未完成 应为弹窗*/
/** 任务运行*/
function handleQualityTaskRun() {
go('/dataQuality/task');
Modal.confirm({
title: '确认运行',
content: '是否运行选中的任务?',
onOk: () => {
createMessage.success('运行成功!');
},
});
}
/** 查看报告 未完成 应为弹窗*/
/** 查看报告 正在做 应为跳转到报告页面*/
function handleQualityTaskRunLog() {
go('/dataQuality/task');
}
......@@ -181,7 +224,7 @@
function handleQualityTaskOffline() {
go('/dataQuality/task');
}
/** 跳转运维 未完成 应为弹窗*/
/** 跳转运维 未完成 应为跳转到运维界面*/
function handleQualityTaskService() {
go('/dataQuality/task');
}
......
......@@ -118,12 +118,11 @@ export const formSchemaMain: any = [
field: 'path',
label: '路径',
component: 'TreeSelect',
rules: [
{
required: true,
message: '请选择上级菜单',
},
],
// rules: [
// {
// message: '请选择上级菜单',
// },
// ],
componentProps: {
fieldNames: {
label: 'label',
......@@ -135,27 +134,33 @@ export const formSchemaMain: any = [
{
field: 'name',
label: '主体名称',
component: 'Input',
colProps: { span: 8 },
componentProps: {
placeholder: '输入主体名称',
},
},
{
field: 'des',
label: '描述',
label: '文件名称',
component: 'Input',
rules: [
{
required: true,
message: '请输入文件名称',
},
],
colProps: { span: 8 },
componentProps: {
placeholder: '输入描述',
placeholder: '输入文件名称',
},
},
// {
// field: 'des',
// label: '描述',
// component: 'Input',
// colProps: { span: 8 },
// componentProps: {
// placeholder: '输入描述',
// },
// },
{
field: 'fileType',
label: '文件类型',
component: 'Input',
defaultValue: '主体管理',
defaultValue: '质量任务',
colProps: { span: 8 },
componentProps: {
readOnly: true,
......@@ -167,7 +172,7 @@ export const formSchemaMain: any = [
field: 'menuModal',
label: '目录权属模式',
component: 'Input',
defaultValue: '资源自定义',
defaultValue: '本级定义',
colProps: { span: 8 },
componentProps: {
readOnly: true,
......@@ -184,6 +189,7 @@ export const formSchemaMain: any = [
componentProps: {
placeholder: '输入描述',
options: [{ label: '默认工作组', value: '默认工作组' }],
disabled: true,
},
},
];
......@@ -227,16 +233,16 @@ export const searchFormSchema: FormSchema[] = [
placeholder: '输入关键字搜索',
},
},
{
field: 'flag',
label: ' ',
component: 'Select',
componentProps: {
placeholder: '按来源过滤',
options: [{ label: '指标汇总表', value: '1' }],
},
colProps: { span: 8 },
},
// {
// field: 'flag',
// label: ' ',
// component: 'Select',
// componentProps: {
// placeholder: '按来源过滤',
// options: [{ label: '指标汇总表', value: '1' }],
// },
// colProps: { span: 8 },
// },
];
export const resetPasswordFormSchema: any[] = [
{
......
......@@ -96,13 +96,20 @@ export const treeDataList = [
];
export const treeDataListTwo = [
{
label: '默认工作组',
label: '主体管理',
businessId: 1,
children: [
{ label: '默认工作组01', businessId: 2 },
{ label: '默认工作组02', businessId: 3 },
{ label: '默认工作组03', businessId: 4 },
{ label: '默认工作组04', businessId: 5 },
{
label: 'admin_个人工作区',
businessId: 2,
children: [
{ label: '个人工作区1', businessId: 6 },
{ label: '个人工作区2', businessId: 7 },
],
},
{ label: '共享工作区', businessId: 3 },
{ label: '商城工作区', businessId: 4 },
{ label: '指标工作区', businessId: 5 },
],
},
];
......@@ -16,11 +16,12 @@
</div>
</template>
<script lang="ts" setup>
import {nextTick, onMounted, ref, unref} from 'vue';
import {BasicTree, TreeActionType, TreeItem} from '@/components/Tree';
import { nextTick, onMounted, ref, unref } from 'vue';
import { BasicTree, TreeActionType, TreeItem } from '@/components/Tree';
import { getDeptList } from '@/api/system/dept/dept';
import {Nullable} from "@vben/types";
import {treeDataListTwo} from "./mock";
import { Nullable } from '@vben/types';
import { treeDataListTwo } from './mock';
defineOptions({ name: 'DeptTree' });
const emit = defineEmits(['select']);
......@@ -28,21 +29,19 @@ import {nextTick, onMounted, ref, unref} from 'vue';
const treeData = ref<TreeItem[]>([]);
const treeRef = ref<Nullable<TreeActionType>>(null);
async function fetch() {
treeData.value = treeDataListTwo
await nextTick(() => {
getTree().expandAll(true)
})
async function fetch() {
treeData.value = treeDataListTwo;
await nextTick(() => {
getTree().expandAll(true);
});
}
function getTree() {
const tree = unref(treeRef);
if (!tree) {
throw new Error('tree is null!');
function getTree() {
const tree = unref(treeRef);
if (!tree) {
throw new Error('tree is null!');
}
return tree;
}
return tree;
}
function handleSelect(keys) {
emit('select', keys[0]);
......@@ -53,10 +52,11 @@ function getTree() {
});
</script>
<style lang="scss" scoped>
.bg-white{
width: 97%;
}
::v-deep(.vben-tree){
background-color: #E8ECF7!important;
}
.bg-white {
width: 97%;
}
::v-deep(.vben-tree) {
background-color: #e8ecf7 !important;
}
</style>
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