Commit 18e954ba authored by LiXuyang's avatar LiXuyang

审核配置/通用配置

parent c21f4104
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
width="60%" width="60%"
@ok="handleSubmit" @ok="handleSubmit"
> >
<Tabs v-model:activeKey="activeKey"> <Tabs v-model:activeKey="activeKey" style="margin-left: 20px">
<TabPane key="1" tab="最新版本"> <TabPane key="1" tab="最新版本">
<BasicTable @register="registerLatestVersionTable"> <BasicTable @register="registerLatestVersionTable">
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
...@@ -28,12 +28,16 @@ ...@@ -28,12 +28,16 @@
/> />
</template> </template>
</template> </template>
<template #toolbar> </BasicTable>
<a-button type="primary" @click="addNode()">新增节点</a-button> <div class="button-group">
<div class="bt-g-left">
<a-button type="primary" @click="addNode()"><PlusOutlined />新增节点</a-button>
</div>
<div class="bt-g-right">
<a-button type="primary" @click="startWork()">立即生效</a-button> <a-button type="primary" @click="startWork()">立即生效</a-button>
<a-button type="primary" @click="handleSave()">保存</a-button> <a-button type="primary" @click="handleSave()">保存</a-button>
</template> </div>
</BasicTable> </div>
</TabPane> </TabPane>
<TabPane key="2" tab="生效版本"> <TabPane key="2" tab="生效版本">
<BasicTable @register="registerVersionHistoryTable"> <BasicTable @register="registerVersionHistoryTable">
...@@ -47,7 +51,7 @@ ...@@ -47,7 +51,7 @@
title: '是否应用该版本', title: '是否应用该版本',
placement: 'left', placement: 'left',
confirm: handleApply.bind(null, record), confirm: handleApply.bind(null, record),
disabled: record.workStatus === '生效中' disabled: record.workStatus === '生效中',
}, },
}, },
]" ]"
...@@ -60,30 +64,31 @@ ...@@ -60,30 +64,31 @@
</BasicModal> </BasicModal>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import {ref, unref} from 'vue'; import { ref, unref } from 'vue';
import {BasicModal, useModalInner} from '@/components/Modal'; import {BasicModal, ModalProps, useModalInner} 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 {Tabs, TabPane} from 'ant-design-vue'; import { Tabs, TabPane } from 'ant-design-vue';
import { import { PlusOutlined } from '@ant-design/icons-vue';
import {
processEditListData, processEditListData,
processVersionColumns, processVersionColumns,
versionHistoryListData, versionHistoryListData,
versionHistoryColumns, versionHistoryColumns,
} from "@/views/dataSharingAndExchange/auditConfig/auditConfig.data.ts" } from '@/views/dataSharingAndExchange/auditConfig/auditConfig.data.ts';
defineOptions({name: 'ProcessEditModal'}); defineOptions({ name: 'ProcessEditModal' });
const emit = defineEmits(['success', 'register']); const emit = defineEmits(['success', 'register']);
const {createMessage} = useMessage(); const { createMessage } = useMessage();
const isUpdate = ref(false); const isUpdate = ref(false);
const activeKey = ref('1'); const activeKey = ref('1');
const TabPane = Tabs.TabPane; const TabPane = Tabs.TabPane;
const processEditDataList = ref([]); const processEditDataList = ref([]);
//初始化 "最新版本" 表格 //初始化 "最新版本" 表格
const [registerLatestVersionTable, {reload}] = useTable({ const [registerLatestVersionTable, { reload }] = useTable({
api: async () => { api: async () => {
processEditDataList.value = processEditListData processEditDataList.value = processEditListData;
const response = { const response = {
pageNum: '1', pageNum: '1',
pageSize: '10', pageSize: '10',
...@@ -93,7 +98,7 @@ const [registerLatestVersionTable, {reload}] = useTable({ ...@@ -93,7 +98,7 @@ const [registerLatestVersionTable, {reload}] = useTable({
message: '', message: '',
data: [], data: [],
}; };
return {...response, data: processEditDataList.value}; return { ...response, data: processEditDataList.value };
}, },
pagination: false, pagination: false,
columns: processVersionColumns, columns: processVersionColumns,
...@@ -110,23 +115,21 @@ const [registerLatestVersionTable, {reload}] = useTable({ ...@@ -110,23 +115,21 @@ const [registerLatestVersionTable, {reload}] = useTable({
showTableSetting: false, showTableSetting: false,
bordered: true, bordered: true,
showIndexColumn: false, showIndexColumn: false,
}); });
//初始化 "生效版本" 表格 //初始化 "生效版本" 表格
const [registerVersionHistoryTable, { const [registerVersionHistoryTable, { reload: reloadVersionHistory }] = useTable({
reload: reloadVersionHistory
}] = useTable({
api: async (params) => { api: async (params) => {
const response = { const response = {
pageNu: "1", pageNu: '1',
pageSize: "10", pageSize: '10',
pages: "1", pages: '1',
total: versionHistoryListData.length, total: versionHistoryListData.length,
code: '', code: '',
message: '', message: '',
data: versionHistoryListData, data: versionHistoryListData,
}; };
return {...response, data: versionHistoryListData}; return { ...response, data: versionHistoryListData };
}, },
columns: versionHistoryColumns, columns: versionHistoryColumns,
rowSelection: false, rowSelection: false,
...@@ -139,53 +142,74 @@ const [registerVersionHistoryTable, { ...@@ -139,53 +142,74 @@ const [registerVersionHistoryTable, {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
}, },
}); });
// 初始化弹窗 // 初始化弹窗
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => { const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
setModalProps({loading: false, confirmLoading: false}); setModalProps({
}); loading: false,
confirmLoading: false,
showOkBtn: false,
cancelText: '关闭',
} as ModalProps);
});
/**新增节点*/ /**新增节点*/
function addNode() { function addNode() {
const data = { const data = {
"nodeIndex": Math.max(...processEditDataList.value.map(item => item.nodeIndex)) + 1, nodeIndex: Math.max(...processEditDataList.value.map((item) => item.nodeIndex)) + 1,
"approver": [], approver: [],
"approveType": "1", approveType: '1',
}; };
processEditDataList.value.push(data); processEditDataList.value.push(data);
reload(); reload();
}; }
/** 立即生效 */ /** 立即生效 */
function startWork() { function startWork() {
createMessage.success('成功生效!'); createMessage.success('成功生效!');
reload(); reload();
}; }
/** 保存 */ /** 保存 */
function handleSave() { function handleSave() {
createMessage.success('保存成功!'); createMessage.success('保存成功!');
reload(); reload();
}; }
/** 删除 按钮 */ /** 删除 按钮 */
function handleDelete(record: Recordable) { function handleDelete(record: Recordable) {
processEditDataList.value.splice( processEditDataList.value.splice(
processEditDataList.value.findIndex((item) => item.nodeIndex === record.nodeIndex), processEditDataList.value.findIndex((item) => item.nodeIndex === record.nodeIndex),
1, 1,
); );
createMessage.success('删除成功!'); createMessage.success('删除成功!');
reload(); reload();
} }
/** 应用 按钮 */ /** 应用 按钮 */
function handleApply(record: Recordable) { function handleApply(record: Recordable) {
createMessage.success('应用成功'); createMessage.success('应用成功');
} }
/** 确认按钮 */ /** 确认按钮 */
async function handleSubmit() { async function handleSubmit() {
closeModal() closeModal();
} }
</script> </script>
<style scoped lang="scss">
::v-deep .vben-basic-table {
height: auto;
}
.button-group {
display: flex;
margin-top: 15px;
.bt-g-left {
flex: 1;
}
.bt-g-right {
display: flex;
gap: 10px;
}
}
</style>
...@@ -32,6 +32,7 @@ export const columns: BasicColumn[any] = [ ...@@ -32,6 +32,7 @@ export const columns: BasicColumn[any] = [
title: '需要审批的资产类型', title: '需要审批的资产类型',
dataIndex: 'assetType', dataIndex: 'assetType',
width: 150, width: 150,
slots: { customRender: 'assetType' },
}, },
{ {
title: '流程发布状态', title: '流程发布状态',
......
// 权限管理 列表数据 // 权限管理 列表数据
export const auditConfigListData: any[] = [ export const auditConfigListData: any[] = [
{ {
"id": 0, id: 0,
"applicationType": "上架", applicationType: '上架',
"assetType": ['数据集', '标签', '文件'], assetType: [
"processReleaseStatus": "已发布", {
"delFlag": "0", name: '数据集',
"flag": "1", checked: true,
"createBy": "admin", icon: 'ant-design:insert-row-above-outlined',
"createDate": "2024-10-24 10:04:04", },
"updateBy": "admin", {
"updateDate": "2024-10-24 10:04:04" name: '标签',
}, checked: true,
{ icon: 'ant-design:tag-outlined',
"id": 1, },
"applicationType": "下架", {
"assetType": ['数据集', '标签', '文件'], name: '文件',
"processReleaseStatus": "已发布", checked: true,
"delFlag": "0", icon: 'ant-design:file-text-outlined',
"flag": "1", },
"createBy": "admin", ],
"createDate": "2024-10-24 18:44:16", processReleaseStatus: '已发布',
"updateBy": "admin", delFlag: '0',
"updateDate": "2024-10-24 18:44:16" flag: '1',
}, createBy: 'admin',
{ createDate: '2024-10-24 10:04:04',
"id": 2, updateBy: 'admin',
"applicationType": "下载", updateDate: '2024-10-24 10:04:04',
"assetType": ['数据集', '标签', '文件'], },
"processReleaseStatus": "已发布", {
"delFlag": "0", id: 1,
"flag": "1", applicationType: '下架',
"createBy": "admin", assetType: [
"createDate": "2024-10-25 11:05:05", {
"updateBy": "admin", name: '数据集',
"updateDate": "2024-10-25 11:05:05" checked: true,
}, icon: 'ant-design:insert-row-above-outlined',
{ },
"id": 3, {
"applicationType": "推送", name: '标签',
"assetType": ['数据集', '标签'], checked: true,
"processReleaseStatus": "已发布", icon: 'ant-design:tag-outlined',
"delFlag": "0", },
"flag": "1", {
"createBy": "admin", name: '文件',
"createDate": "2024-10-27 09:27:29", checked: true,
"updateBy": "admin", icon: 'ant-design:file-text-outlined',
"updateDate": "2024-10-27 09:27:29" },
} ],
processReleaseStatus: '已发布',
delFlag: '0',
flag: '1',
createBy: 'admin',
createDate: '2024-10-24 18:44:16',
updateBy: 'admin',
updateDate: '2024-10-24 18:44:16',
},
{
id: 2,
applicationType: '下载',
assetType: [
{
name: '数据集',
checked: true,
icon: 'ant-design:insert-row-above-outlined',
},
{
name: '标签',
checked: true,
icon: 'ant-design:tag-outlined',
},
{
name: '文件',
checked: true,
icon: 'ant-design:file-text-outlined',
},
],
processReleaseStatus: '已发布',
delFlag: '0',
flag: '1',
createBy: 'admin',
createDate: '2024-10-25 11:05:05',
updateBy: 'admin',
updateDate: '2024-10-25 11:05:05',
},
{
id: 3,
applicationType: '推送',
assetType: [
{
name: '数据集',
checked: true,
icon: 'ant-design:insert-row-above-outlined',
},
{
name: '标签',
checked: true,
icon: 'ant-design:tag-outlined',
},
],
processReleaseStatus: '已发布',
delFlag: '0',
flag: '1',
createBy: 'admin',
createDate: '2024-10-27 09:27:29',
updateBy: 'admin',
updateDate: '2024-10-27 09:27:29',
},
];
export const typeOptions = [
{ label: '上架', value: '1' },
{ label: '下架', value: '2' },
{ label: '下载', value: '3' },
{ label: '推送', value: '4' },
{ label: 'API调用-拉取', value: '5' },
{ label: 'API调用-推送', value: '6' },
]; ];
<template> <template>
<!-- 审核配置 --> <!-- 审核配置 -->
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex"> <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<template #headerContent>
<div class="flex">
<div class="flex-1 header">
<AuditOutlined class="h-icon" />
<div class="h-des">审核配置</div>
</div>
<a-button type="link" style="font-size: 20px" @click="handleRefresh"
><SyncOutlined
/></a-button>
</div>
</template>
<BasicTable @register="registerTable" :searchInfo="searchInfo"> <BasicTable @register="registerTable" :searchInfo="searchInfo">
<template #toolbar> <template #headerTop>
<Select
style="width: 200px"
v-model:value="queryParams.type"
placeholder="申请类型"
:options="typeOptions"
/>
</template> </template>
<template #toolbar> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'assetType'"> <template v-if="column.key === 'assetType'">
<Tag <Tag color="blue" v-for="item in record.assetType" :key="item" style="margin: 2px">
color="blue"
v-for="item in record.assetType"
:key="item"
style="margin: 2px;"
>
{{ item }} {{ item }}
</Tag> </Tag>
</template> </template>
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<TableAction <TableAction
:actions="[ :actions="[
{ // {
icon: 'ant-design:tool-outlined', // icon: 'ant-design:tool-outlined',
// label: '审批总产配置', // // label: '审批总产配置',
onClick: handleConfig.bind(null, record), // onClick: handleConfig.bind(null, record),
}, // },
{ {
icon: 'clarity:note-edit-line', icon: 'clarity:note-edit-line',
// label: '编辑', // label: '编辑',
...@@ -32,64 +45,77 @@ ...@@ -32,64 +45,77 @@
/> />
</template> </template>
</template> </template>
<template #assetType="{ record }">
<div class="asset-list" v-for="item in record.assetType" :key="item">
<div class="asset-type">
<div class="t-d">
<Icon class="t-icon" v-if="item.icon" :icon="item.icon" />
<div class="t-des">
{{ item.name }}
</div>
</div>
<div class="t-bt">
<Switch class="t-switch" v-model:checked="item.checked" />
</div>
</div>
</div>
</template>
</BasicTable> </BasicTable>
</PageWrapper> </PageWrapper>
<!-- 流程编辑 - 弹窗 --> <!-- 流程编辑 - 弹窗 -->
<ProcessEditModal @register="registerProcessEditModal" @success="handleSuccess"/> <ProcessEditModal @register="registerProcessEditModal" @success="handleSuccess" />
<!-- 需要审批的资产类型 - 弹窗 --> <!-- 需要审批的资产类型 - 弹窗 -->
<AssetTypeModal @register="registerAssetTypeModal" @success="handleSuccess"/> <AssetTypeModal @register="registerAssetTypeModal" @success="handleSuccess" />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import {reactive, ref} from 'vue'; import { reactive, ref } from 'vue';
import {BasicTable, useTable, TableAction} from '@/components/Table'; import { BasicTable, useTable, TableAction } from '@/components/Table';
import {Tag} from 'ant-design-vue'; import { Tag, Select, Switch } from 'ant-design-vue';
import {PageWrapper} from '@/components/Page'; import { AuditOutlined, SyncOutlined } from '@ant-design/icons-vue';
import {useMessage} from '@/hooks/web/useMessage'; import Icon from '@/components/Icon/Icon.vue';
import {useModal} from '@/components/Modal'; import { PageWrapper } from '@/components/Page';
import ProcessEditModal from '@/views/dataSharingAndExchange/auditConfig/ProcessEditModal.vue' import { useMessage } from '@/hooks/web/useMessage';
import AssetTypeModal from '@/views/dataSharingAndExchange/auditConfig/AssetTypeModal.vue' import { useModal } from '@/components/Modal';
import { import ProcessEditModal from '@/views/dataSharingAndExchange/auditConfig/ProcessEditModal.vue';
columns, import AssetTypeModal from '@/views/dataSharingAndExchange/auditConfig/AssetTypeModal.vue';
searchFormSchema import { columns } from '@/views/dataSharingAndExchange/auditConfig/auditConfig.data';
} from "@/views/dataSharingAndExchange/auditConfig/auditConfig.data"; import {
import {auditConfigListData} from "@/views/dataSharingAndExchange/auditConfig/auditConfigData"; auditConfigListData,
typeOptions,
} from '@/views/dataSharingAndExchange/auditConfig/auditConfigData';
defineOptions({name: 'AuditConfig'}); const queryParams = {};
const {createMessage} = useMessage(); const { createMessage } = useMessage();
const [registerProcessEditModal, {openModal: openProcessEditModal}] = useModal(); const [registerProcessEditModal, { openModal: openProcessEditModal }] = useModal();
const [registerAssetTypeModal, {openModal: openAssetTypeModal}] = useModal(); const [registerAssetTypeModal, { openModal: openAssetTypeModal }] = useModal();
const searchInfo = reactive<Recordable>({}); const searchInfo = reactive<Recordable>({});
const tableData = ref([]) const tableData = ref([]);
const [registerTable, { const [
reload, registerTable,
updateTableDataRecord, { reload, updateTableDataRecord, getSearchInfo, getForm, getRowSelection },
getSearchInfo, ] = useTable({
getForm,
getRowSelection
}] = useTable({
title: '', title: '',
api: async (params) => { api: async (params) => {
var data = []; var data = [];
const response = { const response = {
pageNu: "1", pageNu: '1',
pageSize: "10", pageSize: '10',
pages: "1", pages: '1',
total: data.length, total: data.length,
code: '', code: '',
message: '', message: '',
data: [], data: [],
}; };
return {...response, data: auditConfigListData}; return { ...response, data: auditConfigListData };
}, },
rowKey: 'id', rowKey: 'id',
columns, columns,
rowSelection: true, // formConfig: {
formConfig: { // labelWidth: 10,
labelWidth: 10, // schemas: searchFormSchema,
schemas: searchFormSchema, // autoSubmitOnEnter: false,
autoSubmitOnEnter: false, // },
}, // useSearchForm: true,
useSearchForm: true,
showTableSetting: false, showTableSetting: false,
showIndexColumn: false, showIndexColumn: false,
bordered: true, bordered: true,
...@@ -101,26 +127,67 @@ const [registerTable, { ...@@ -101,26 +127,67 @@ const [registerTable, {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
}, },
}); });
/** 刷新 按钮 */ /** 刷新 按钮 */
function handleReload() { function handleReload() {
createMessage.success('刷新成功!') createMessage.success('刷新成功!');
reload(); reload();
} }
/** 审批总产配置 按钮 */ /** 审批总产配置 按钮 */
function handleConfig(record: Recordable) { function handleConfig(record: Recordable) {
openAssetTypeModal(true, {}); openAssetTypeModal(true, {});
} }
/** 编辑 按钮 */ /** 编辑 按钮 */
function handleEdit(record: Recordable) { function handleEdit(record: Recordable) {
openProcessEditModal(true, {}); openProcessEditModal(true, {});
} }
/** 成功时返回的方法 */ /** 成功时返回的方法 */
function handleSuccess() { function handleSuccess() {
reload(); reload();
} }
function handleRefresh() {
createMessage.success('刷新成功!');
}
</script> </script>
<style scoped>
.header {
display: flex;
flex-direction: row;
gap: 10px;
.h-icon {
font-size: 30px;
color: #03aabb;
}
.h-des {
font-size: 18px;
font-weight: bolder;
}
}
.asset-list {
margin: 5px 0;
.asset-type {
display: flex;
gap: 10px;
padding: 0 20px;
.t-d {
display: flex;
gap: 10px;
flex: 1;
text-align: left;
.t-icon {
font-size: 18px;
color: #1ab3c5;
}
.t-des {}
}
.t-bt {
flex: 1;
.t-switch {}
}
}
}
</style>
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
<PageWrapper class="page-wrapper"> <PageWrapper class="page-wrapper">
<template #headerContent> <template #headerContent>
<div class="headerContent"> <div class="headerContent">
<div> <div style="display: flex">
<Icon icon="grommet-icons:settings-option" :size="40" :color="'#61aaff'" /> <Icon icon="grommet-icons:settings-option" :size="40" :color="'#61aaff'" />
<span class="title">通用配置</span> <div class="title" style="margin-left: 10px; line-height: 40px">通用配置</div>
</div> </div>
</div> </div>
</template> </template>
......
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