Commit defa2a6d authored by liwei's avatar liwei

补数页面

parent 0a141e52
......@@ -901,6 +901,15 @@ export const taskSchedulingRoute: AppRouteRecordRaw = {
icon: '',
},
},
{
path: 'supplyNumber/addTask',
name: 'addTask',
component: () => import('@/views/taskScheduling/taskFlowMaintenance/supplyNumber/addTask.vue'),
meta: {
title: '新建补数任务',
icon: '',
},
},
],
};
......
<template>
<div class="center">
<div class="center1">
<div class="center1-1">
<div class="center1-1-1">新建补数</div>
</div>
<div>
<a-button type="primary" style="margin-right: 10px" @click="cancelButton">取消</a-button>
<a-button type="primary" style="margin-right: 10px" @click="confirmButton">确认</a-button>
</div>
</div>
<div class="selectCss">
<BasicForm @register="registerForm1"/>
<Alert
show-icon
style="font-size: 14px;margin-bottom: 20px"
:message="message"
type="info"
/>
</div>
<div class="center2">
<div class="center2-1">手动选择任务流</div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-input-search
v-model:value="value"
placeholder="input search text"
style="width: 200px;margin-right: 80%"
@search="onSearch"
/>
<a-button type="primary" @click="addTaskStreamButton">添加任务流</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
icon: 'icon-park-twotone:setting',
// label: '编辑',
onClick: resetNameButton.bind(null, record),
},
{
icon: 'jam:stop-sign',
// label: '编辑',
onClick: resetNameButton.bind(null, record),
},
{
icon: 'material-symbols:delete-outline',
// label: '编辑',
onClick: resetNameButton.bind(null, record),
},
]"
/>
</template>
</template>
</BasicTable>
</div>
<!-- 重命名 弹窗-->
<ResetNameModal @register="registerResetNameModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup>
import { Card, Col, Row,Alert} from 'ant-design-vue';
import Icon from '@/components/Icon/Icon.vue';
import { reactive,unref,onDeactivated,onMounted,ref,watch,Ref } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { PageWrapper } from '@/components/Page';
import { useMessage } from '@/hooks/web/useMessage';
import { useModal } from '@/components/Modal';
import { useGo } from '@/hooks/web/usePage';
import { useRoute } from 'vue-router';
import { router } from '@/router';
import {downloadByData} from "@/utils/file/download";
import {addTaskFormSchema1, addTaskFormSchema2, columns, searchFormSchema} from './supplyNumber.data';
import { tableData,TreeData } from './supplyNumberData'
import { BasicForm, useForm } from '@/components/Form';
import { useECharts } from '@/hooks/web/useECharts';
defineOptions({ name: 'AccountManagement' });
const chartRef = ref<HTMLDivElement | null>(null);
const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>);
const { createMessage, createConfirm } = useMessage();
const route = useRoute();
const go = useGo();
const message = ref('1、默认包含选中任务流在“补数时间范围”内有执行的相关上游和下游,故相关任务流需要处于发布中;\n' +
'2、若执行记录已经存在,则忽略不会产生补数记录;\n' +
'3、补数时会按照当前选中资源的最新版本配置执行。');
const [registerResetNameModal, { openModal: openResetNameModal }] = useModal();
const [registerTable, { reload,getForm,getRowSelection }] = useTable({
title: '',
api: async (params) => {
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: tableData.length,
code:'',
message:'',
data: [],
};
return { ...response,data: tableData };
},
rowKey: 'businessId',
columns,
rowSelection: true,
useSearchForm: false,
showTableSetting: false,
showIndexColumn:false,
bordered: true,
actionColumn: {
width: 150,
title: '操作',
dataIndex: 'action',
},
});
//初始化表单
const [registerForm1, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 80,
schemas: addTaskFormSchema1,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
const [registerForm2] = useForm({
labelWidth: 80,
schemas: addTaskFormSchema2,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
/**修改 按钮*/
function resetNameButton(record){
openResetNameModal(true,{
record
})
}
/**添加任务流 按钮*/
function addTaskStreamButton(record){
openResetNameModal(true,{
record
})
}
/** 转成树 */
function handleTree(data, id, parentId, children, rootId) {
id = id || 'id'
parentId = parentId || 'parentId'
children = children || 'children'
rootId = rootId || Math.min.apply(Math, data.map(item => { return item[parentId] })) || 0
// 对源数据深度克隆
const cloneData = JSON.parse(JSON.stringify(data))
// 循环所有项
const treeData = cloneData.filter(father => {
const branchArr = cloneData.filter(child => {
// 返回每一项的子级数组
return father[id] === child[parentId]
})
branchArr.length > 0 ? father.children = branchArr : ''
// 返回第一层
return father[parentId] === rootId
})
return treeData !== '' ? treeData : data
}
onMounted(() => {
const treeData = handleTree(TreeData, 'businessId',undefined,undefined,undefined)
updateSchema([
{
field: 'tree',
componentProps: {
treeData: treeData
},
},
]);
});
</script>
<style lang="less" scoped>
.selectCss{
::v-deep(.ant-select-selector){
width:200px!important;
}
::v-deep(.ant-select){
width:200px!important;
}
}
.center{
width: 100%;
height: 100%;
background-color: white;
.center1{
width: 100%;
height: 10%;
display: flex;
justify-content: space-between;
align-items: center;
.center1-1{
display:flex;
height: 30px;
margin-left: 20px;
.center1-1-1{
display: flex;
align-items: center;
font-weight: bold;
font-size: 20px;
}
}
}
.center2{
width: 100%;
height:90%;
.center2-1{
margin-bottom: 20px;
margin-left: 10px;
font-weight: bold;
ont-size: 15px
}
}
}
</style>
<template>
<div class="center">
<div class="center1">
<div class="center1-1">
<Icon icon="material-symbols:sync" :size="35" :color="'rgb(121, 74, 235)'"/>
<div class="center1-1-1">补数记录</div>
<div class="selectCss">
<BasicForm @register="registerForm"/>
</div>
</div>
<div>
<a-button type="primary" style="margin-right: 10px" @click="reloadButton">手动刷新</a-button>
<a-button type="primary" style="margin-right: 10px" @click="cancelButton">取消</a-button>
<a-button type="primary" style="margin-right: 10px" @click="deleteButton">删除</a-button>
<a-button type="primary" style="margin-right: 10px" @click="addSupplyNumberButton">新增补数</a-button>
</div>
</div>
<div class="center2">
<div class="center2-1">
<div style="margin-left: 10px">
<BasicForm @register="registerForm2"/>
</div>
</div>
<BasicTable @register="registerTable">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
icon: 'icon-park-twotone:setting',
// label: '编辑',
onClick: addSupplyNumberButton.bind(null, record),
},
{
icon: 'jam:stop-sign',
// label: '编辑',
onClick: addSupplyNumberButton.bind(null, record),
},
{
icon: 'material-symbols:delete-outline',
// label: '编辑',
onClick: addSupplyNumberButton.bind(null, record),
},
]"
/>
</template>
</template>
<template #latestEventTime="{ text, record }">
<a @click="showDetails(record)"> {{ text }}</a>
</template>
</BasicTable>
</div>
<!-- 重命名 弹窗-->
<ResetNameModal @register="registerResetNameModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup>
import { Card, Col, Row} from 'ant-design-vue';
import Icon from '@/components/Icon/Icon.vue';
import { reactive,unref,onDeactivated,onMounted,ref,watch,Ref } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { PageWrapper } from '@/components/Page';
import { useMessage } from '@/hooks/web/useMessage';
import { useModal } from '@/components/Modal';
import { useGo } from '@/hooks/web/usePage';
import { useRoute } from 'vue-router';
import { router } from '@/router';
import {downloadByData} from "@/utils/file/download";
import { columns,searchFormSchema,selectFormSchema } from './supplyNumber.data';
import { tableData,TreeData } from './supplyNumberData'
import { BasicForm, useForm } from '@/components/Form';
import { useECharts } from '@/hooks/web/useECharts';
defineOptions({ name: 'AccountManagement' });
const chartRef = ref<HTMLDivElement | null>(null);
const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>);
const { createMessage, createConfirm } = useMessage();
const route = useRoute();
const go = useGo();
const [registerResetNameModal, { openModal: openResetNameModal }] = useModal();
const [registerTable, { reload,getForm,getRowSelection }] = useTable({
title: '',
api: async (params) => {
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: tableData.length,
code:'',
message:'',
data: [],
};
return { ...response,data: tableData };
},
rowKey: 'businessId',
columns,
rowSelection: true,
useSearchForm: false,
showTableSetting: false,
showIndexColumn:false,
bordered: true,
actionColumn: {
width: 150,
title: '操作',
dataIndex: 'action',
},
});
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelAlign: 'left',
labelWidth: 100,
schemas: selectFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
const [registerForm2] = useForm({
labelWidth: 80,
schemas: searchFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
/**新建补数任务*/
function addSupplyNumberButton(record){
router.push({
path: '/taskScheduling/taskFlowMaintenance/supplyNumber/addTask',
query: {
}
})
}
/** 转成树 */
function handleTree(data, id, parentId, children, rootId) {
id = id || 'id'
parentId = parentId || 'parentId'
children = children || 'children'
rootId = rootId || Math.min.apply(Math, data.map(item => { return item[parentId] })) || 0
// 对源数据深度克隆
const cloneData = JSON.parse(JSON.stringify(data))
// 循环所有项
const treeData = cloneData.filter(father => {
const branchArr = cloneData.filter(child => {
// 返回每一项的子级数组
return father[id] === child[parentId]
})
branchArr.length > 0 ? father.children = branchArr : ''
// 返回第一层
return father[parentId] === rootId
})
return treeData !== '' ? treeData : data
}
onMounted(() => {
const treeData = handleTree(TreeData, 'businessId',undefined,undefined,undefined)
updateSchema([
{
field: 'tree',
componentProps: {
treeData: treeData
},
},
]);
});
</script>
<style lang="less" scoped>
.selectCss{
margin-left: 30px;
::v-deep(.ant-select-selector){
width:200px!important;
}
::v-deep(.ant-select){
width:200px!important;
}
}
.center{
width: 100%;
height: 100%;
background-color: white;
.center1{
width: 100%;
height: 10%;
display: flex;
justify-content: space-between;
align-items: center;
.center1-1{
display:flex;
height: 30px;
margin-left: 20px;
.center1-1-1{
display: flex;
align-items: center;
font-weight: bold
}
}
}
.center2{
width: 100%;
height:90%;
.center2-1{
display: flex;
justify-content: space-between
}
}
}
</style>
import {getAllRoleList} from '@/api/system/role/role';
import { BasicColumn, FormSchema } from '@/components/Table';
import {h} from "vue";
import {Input, Select, Tag} from "ant-design-vue";
import { Switch } from 'ant-design-vue';
import {useMessage} from "@/hooks/web/useMessage";
import {changeFlagApi} from "@/api/system/user/user";
import {DescItem} from "@/components/Description";
import {uploadApi} from "@/api/sys/upload"; // 引入开关组件
type CheckedType = boolean | string | number;
/**首页-table列表*/
export const columns: BasicColumn[] = [
{
title: '补数名称',
dataIndex: 'supplyNumberName',
width: 120
},
{
title: '创建者',
dataIndex: 'createBy',
width: 120
},
{
title: '补数状态',
dataIndex: 'supplyNumberState',
width: 120
},
{
title: '创建时间',
dataIndex: 'createTime',
width: 120
},
{
title: '完成时间',
dataIndex: 'completionTime',
width: 120
},
{
title: '补数日期',
dataIndex: 'supplyNumberTime',
width: 120
},
];
/**首页-搜索表单*/
export const searchFormSchema: FormSchema[] = [
{
field: 'supplyNumberName',
label: '',
component: 'Input',
componentProps: {
placeholder: '请输入关键字搜索',
},
},
{
field: 'createTime',
label: '创建时间',
component: 'DatePicker',
componentProps: {
placeholder: '请选择创建时间',
},
},
{
field: 'supplyState',
label: '补数状态',
component: 'Select',
required: true,
componentProps: {
placeholder: '请选择补数状态',
options: [
{
label: '已取消',
value: '已取消',
},
{
label: '已完成',
value: '已完成',
},
],
},
},
];
/**首页-下拉框表单*/
export const selectFormSchema: FormSchema[] = [
{
field: 'tree',
label: '',
component: 'TreeSelect',
colProps: { span: 3 },
componentProps: {
maxTagCount:1,//最大tag数量
showArrow: true,//箭头
treeCheckable: true,
fieldNames: {
label: 'treeName',
value: 'businessId',
},
getPopupContainer: () => document.body,
},
},
];
/**新建任务页-表单1*/
export const addTaskFormSchema1: FormSchema[] = [
{
field: 'supplyNumberName',
label: '补数名称',
component: 'Input',
componentProps: {
placeholder: '请输入补数名称',
},
},
{
field: 'rangeTime',
label: ' 补数时间范围',
labelWidth:120,
component: 'RangePicker',
componentProps: {
placeholder: ['开始时间', '结束时间'],
},
},
];
/**新建任务页-表单2*/
export const addTaskFormSchema2: FormSchema[] = [
{
field: 'taskStreamName',
label: '',
component: 'Input',
componentProps: {
placeholder: '任务流名称搜索',
},
},
];
import {getAllRoleList} from '@/api/system/role/role';
import { BasicColumn, FormSchema } from '@/components/Table';
import {h} from "vue";
import {Tag} from "ant-design-vue";
import { Switch } from 'ant-design-vue';
import {useMessage} from "@/hooks/web/useMessage";
import {changeFlagApi} from "@/api/system/user/user";
import {relatedQualityColumns} from "@/views/dataStandards/basicStandards/basicStandards.data";
import {GrowCardItem} from "@/views/dashboard/analysis/data"; // 引入开关组件
type CheckedType = boolean | string | number;
/**主页面树/列表 数据*/
export const TreeData: any[] = [
{
businessId: 100,
treeName: '全选',
anotherName: '全选',
parentId: 0,
},
{
businessId: 201,
treeName: '共享工作区',
anotherName: '共享工作区',
parentId: 100,
},
{
businessId: 202,
treeName: '商城工作区',
anotherName: '商城工作区',
parentId: 100,
},
{
businessId: 203,
treeName: 'admin个人工作区',
anotherName: 'admin个人工作区',
parentId: 100,
},
];
/**主页面列表 数据*/
export const tableData: any[] =[
{
businessId:'1',
supplyNumberName: 'bxwang-补数测试1',
createBy:'admin',
supplyNumberState: '已取消',
createTime: '2024-01-01 08:00:00',
completionTime: '2024-01-01 09:00:00',
supplyNumberTime: '2024-01-01 09:00:00 - 2024-01-10 09:00:00',
},
{
businessId:'2',
supplyNumberName: '补数-WARP-94793',
createBy:'admin',
supplyNumberState: '已完成',
createTime: '2024-01-01 08:00:00',
completionTime: '2024-01-01 09:00:00',
supplyNumberTime: '2024-01-01 09:00:00 - 2024-01-10 09:00:00',
},
{
businessId:'3',
supplyNumberName: '补数-WARP-94794',
createBy:'admin',
supplyNumberState: '已完成',
createTime: '2024-01-01 08:00:00',
completionTime: '2024-01-01 09:00:00',
supplyNumberTime: '2024-01-01 09:00:00 - 2024-01-10 09:00:00',
},
{
businessId:'4',
supplyNumberName: '补数-0 0 * * * ? *',
createBy:'admin',
supplyNumberState: '已完成',
createTime: '2024-01-01 08:00:00',
completionTime: '2024-01-01 09:00:00',
supplyNumberTime: '2024-01-01 09:00:00 - 2024-01-10 09:00:00',
},
{
businessId:'5',
supplyNumberName: '补数-0 1 * * * ? *',
createBy:'admin',
supplyNumberState: '已取消',
createTime: '2024-01-01 08:00:00',
completionTime: '2024-01-01 09:00:00',
supplyNumberTime: '2024-01-01 09:00:00 - 2024-01-10 09:00:00',
},
{
businessId:'6',
supplyNumberName: 'TEST',
createBy:'admin',
supplyNumberState: '已取消',
createTime: '2024-01-01 08:00:00',
completionTime: '2024-01-01 09:00:00',
supplyNumberTime: '2024-01-01 09:00:00 - 2024-01-10 09:00:00',
},
]
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