Commit 8ea250c6 authored by ZhangKai's avatar ZhangKai

审核配置-列表页、流程编辑 页面代码初步提交

parent fffeb5db
<template>
<!-- "需要审批的资产类型" 弹窗 -->
<BasicModal
v-bind="$attrs"
@register="registerModal"
showFooter
title="需要审批的资产类型"
width="35%"
@ok="handleSubmit"
>
<BasicTable @register="registerTable">
<!-- <template #bodyCell="{ column, record }">-->
<!-- <template v-if="column.key === 'action'">-->
<!-- <TableAction-->
<!-- :actions="[-->
<!-- {-->
<!-- color: 'error',-->
<!-- icon: 'ant-design:delete-outlined',-->
<!-- popConfirm: {-->
<!-- title: '是否确认删除',-->
<!-- placement: 'left',-->
<!-- confirm: handleDelete.bind(null, record),-->
<!-- },-->
<!-- },-->
<!-- ]"-->
<!-- />-->
<!-- </template>-->
<!-- </template>-->
</BasicTable>
</BasicModal>
</template>
<script lang="ts" setup>
import {BasicModal,useModalInner} from '@/components/Modal';
import {useMessage} from "@/hooks/web/useMessage";
import {BasicTable, TableAction, useTable} from "@/components/Table";
import {
assetTypeListData,
assetTypeColumns,
} from "@/views/dataSharingAndExchange/auditConfig/auditConfig.data.ts"
defineOptions({name: 'AssetTypeModal'});
const emit = defineEmits(['success', 'register']);
const {createMessage} = useMessage();
//初始化表格
const [registerTable, {reload}] = useTable({
api: async () => {
const response = {
pageNum: '1',
pageSize: '10',
pages: '1',
total: assetTypeListData.length,
code: '',
message: '',
data: [],
};
return {...response, data: assetTypeListData};
},
pagination: false,
columns: assetTypeColumns,
useSearchForm: false,
// actionColumn: {
// width: 50,
// title: '操作',
// dataIndex: 'action',
// },
scroll: {
y: 300,
},
editRow: true,
showTableSetting: false,
bordered: true,
showIndexColumn: false,
});
// 初始化弹窗
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
setModalProps({loading: false, confirmLoading: false});
});
/** 删除 按钮 */
function handleDelete(record: Recordable) {
createMessage.success('删除成功!');
}
/** 确认按钮 */
async function handleSubmit() {
createMessage.success('保存成功');
closeModal()
}
</script>
<template>
<!-- 流程编辑 弹窗 -->
<BasicModal
v-bind="$attrs"
@register="registerModal"
showFooter
title="流程编辑"
width="60%"
@ok="handleSubmit"
>
<Tabs v-model:activeKey="activeKey">
<TabPane key="1" tab="最新版本">
<BasicTable @register="registerLatestVersionTable">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
color: 'error',
icon: 'ant-design:delete-outlined',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record),
},
},
]"
/>
</template>
</template>
<template #toolbar>
<a-button type="primary" @click="addNode()">新增节点</a-button>
<a-button type="primary" @click="startWork()">立即生效</a-button>
<a-button type="primary" @click="handleSave()">保存</a-button>
</template>
</BasicTable>
</TabPane>
<TabPane key="2" tab="生效版本">
<BasicTable @register="registerVersionHistoryTable">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
icon: 'ant-design:file-sync-outlined',
popConfirm: {
title: '是否应用该版本',
placement: 'left',
confirm: handleApply.bind(null, record),
disabled: record.workStatus === '生效中'
},
},
]"
/>
</template>
</template>
</BasicTable>
</TabPane>
</Tabs>
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, unref} from 'vue';
import {BasicModal, useModalInner} from '@/components/Modal';
import {useMessage} from "@/hooks/web/useMessage";
import {BasicTable, TableAction, useTable} from "@/components/Table";
import {Tabs, TabPane} from 'ant-design-vue';
import {
processEditListData,
processVersionColumns,
versionHistoryListData,
versionHistoryColumns,
} from "@/views/dataSharingAndExchange/auditConfig/auditConfig.data.ts"
defineOptions({name: 'ProcessEditModal'});
const emit = defineEmits(['success', 'register']);
const {createMessage} = useMessage();
const isUpdate = ref(false);
const activeKey = ref('1');
const TabPane = Tabs.TabPane;
const processEditDataList = ref([]);
//初始化 "最新版本" 表格
const [registerLatestVersionTable, {reload}] = useTable({
api: async () => {
processEditDataList.value = processEditListData
const response = {
pageNum: '1',
pageSize: '10',
pages: '1',
total: processEditDataList.value.length,
code: '',
message: '',
data: [],
};
return {...response, data: processEditDataList.value};
},
pagination: false,
columns: processVersionColumns,
useSearchForm: false,
actionColumn: {
width: 50,
title: '操作',
dataIndex: 'action',
},
scroll: {
y: 300,
},
editRow: true,
showTableSetting: false,
bordered: true,
showIndexColumn: false,
});
//初始化 "生效版本" 表格
const [registerVersionHistoryTable, {
reload: reloadVersionHistory
}] = useTable({
api: async (params) => {
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: versionHistoryListData.length,
code: '',
message: '',
data: versionHistoryListData,
};
return {...response, data: versionHistoryListData};
},
columns: versionHistoryColumns,
rowSelection: false,
useSearchForm: false,
showTableSetting: false,
showIndexColumn: true,
bordered: true,
actionColumn: {
width: 100,
title: '操作',
dataIndex: 'action',
},
});
// 初始化弹窗
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
setModalProps({loading: false, confirmLoading: false});
});
/**新增节点*/
function addNode() {
const data = {
"nodeIndex": Math.max(...processEditDataList.value.map(item => item.nodeIndex)) + 1,
"approver": [],
"approveType": "1",
};
processEditDataList.value.push(data);
reload();
};
/** 立即生效 */
function startWork() {
createMessage.success('成功生效!');
reload();
};
/** 保存 */
function handleSave() {
createMessage.success('保存成功!');
reload();
};
/** 删除 按钮 */
function handleDelete(record: Recordable) {
processEditDataList.value.splice(
processEditDataList.value.findIndex((item) => item.nodeIndex === record.nodeIndex),
1,
);
createMessage.success('删除成功!');
reload();
}
/** 应用 按钮 */
function handleApply(record: Recordable) {
createMessage.success('应用成功');
}
/** 确认按钮 */
async function handleSubmit() {
closeModal()
}
</script>
import {BasicColumn, FormSchema} from "@/components/Table";
// 搜索栏参数
export const searchFormSchema: FormSchema[] = [
{
field: 'applicationType',
label: ' ',
component: 'Select',
componentProps: {
placeholder: '申请类型',
options: [
{label: '上架', value: '1'},
{label: '下架', value: '2'},
{label: '下载', value: '3'},
{label: '推送', value: '4'},
{label: 'API调用-拉取', value: '5'},
{label: 'API调用-推送', value: '6'},
],
},
colProps: {span: 2},
},
];
// 表头列表头
export const columns: BasicColumn[any] = [
{
title: '申请类型',
dataIndex: 'applicationType',
width: 150,
},
{
title: '需要审批的资产类型',
dataIndex: 'assetType',
width: 150,
},
{
title: '流程发布状态',
dataIndex: 'processReleaseStatus',
width: 150,
},
];
// 审核配置 - 流程编辑 弹窗”最新版本“表单数据
export const processVersionColumns: BasicColumn[any] = [
{
title: '节点级数',
dataIndex: 'nodeIndex',
editable: true,
edit: true,
width: 60,
},
{
title: '审批人',
dataIndex: 'approver',
editable: true,
edit: true,
editComponent: 'Select',
editComponentProps: {
mode: 'multiple',
options: [
{label: '商城审批员', value: '商城审批员'},
{label: '需求管理员', value: '需求管理员'},
{label: '日志管理员', value: '日志管理员'},
{label: '安全管理员', value: '安全管理员'},
],
},
width: 120,
},
{
title: '审批方式',
dataIndex: 'approveType',
editable: true,
edit: true,
editComponent: 'Select',
editComponentProps: {
options: [
{label: '或签', value: '1'},
{label: '会签', value: '2'},
],
},
width: 120,
},
];
// 审核配置 - 流程编辑 弹窗”最新版本“列表数据
export const processEditListData: any[] = [
{
"nodeIndex": 1,
"approver": ['商城审批员', '需求管理员'],
"approveType": "1",
},
{
"nodeIndex": 2,
"approver": ['日志管理员'],
"approveType": "1",
}
];
// 审核配置 - 流程编辑 弹窗”生效版本“表单数据
export const versionHistoryColumns: BasicColumn[any] = [
{
title: '版本名称',
dataIndex: 'versionName',
width: 150,
},
{
title: '提交人',
dataIndex: 'createBy',
width: 150,
},
{
title: '提交时间',
dataIndex: 'createDate',
width: 150,
},
{
title: '生效状态',
dataIndex: 'workStatus',
width: 150,
},
]
// 审核配置 - 流程编辑 弹窗”生效版本“列表数据
export const versionHistoryListData: any[] = [
{
"id": 3,
"versionName": "v1.2",
"workStatus": "生效中",
"createBy": "admin",
"createDate": "2024-11-04 23:09:27",
},
{
"id": 2,
"versionName": "v1.1",
"workStatus": "已失效",
"createBy": "admin",
"createDate": "2024-11-02 18:44:16",
},
{
"id": 1,
"versionName": "v1.0",
"workStatus": "已失效",
"createBy": "admin",
"createDate": "2024-10-24 10:04:04",
},
];
// 审核配置 - 流程编辑 - 需要审批的资产类型 弹窗表头数据
export const assetTypeColumns: BasicColumn[any] = [
{
title: '资源名称',
dataIndex: 'resourceName',
width: 150,
},
{
title: '是否审核',
dataIndex: 'openStatus',
editable: true,
edit: true,
editComponent: 'RadioGroup',
editComponentProps: {
options: [
{
label: '开启',
value: '开启',
},
{
label: '关闭',
value: '关闭',
},
],
},
width: 150,
},
]
// 审核配置 - 流程编辑 - 需要审批的资产类型 弹窗列表数据
export const assetTypeListData: any[] = [
{
"id": 1,
"resourceName": "数据集",
"openStatus": "开启",
},
{
"id": 2,
"resourceName": "标签",
"openStatus": "开启",
},
{
"id": 3,
"resourceName": "文件",
"openStatus": "开启",
},
];
// 权限管理 列表数据
export const auditConfigListData: any[] = [
{
"id": 0,
"applicationType": "上架",
"assetType": ['数据集', '标签', '文件'],
"processReleaseStatus": "已发布",
"delFlag": "0",
"flag": "1",
"createBy": "admin",
"createDate": "2024-10-24 10:04:04",
"updateBy": "admin",
"updateDate": "2024-10-24 10:04:04"
},
{
"id": 1,
"applicationType": "下架",
"assetType": ['数据集', '标签', '文件'],
"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": ['数据集', '标签', '文件'],
"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": ['数据集', '标签'],
"processReleaseStatus": "已发布",
"delFlag": "0",
"flag": "1",
"createBy": "admin",
"createDate": "2024-10-27 09:27:29",
"updateBy": "admin",
"updateDate": "2024-10-27 09:27:29"
}
];
<template>
<!-- 审核配置 -->
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<BasicTable @register="registerTable" :searchInfo="searchInfo">
<template #toolbar>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'assetType'">
<Tag
color="blue"
v-for="item in record.assetType"
:key="item"
style="margin: 2px;"
>
{{ item }}
</Tag>
</template>
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
icon: 'ant-design:tool-outlined',
// label: '审批总产配置',
onClick: handleConfig.bind(null, record),
},
{
icon: 'clarity:note-edit-line',
// label: '编辑',
onClick: handleEdit.bind(null, record),
},
]"
/>
</template>
</template>
</BasicTable>
</PageWrapper>
<!-- 流程编辑 - 弹窗 -->
<ProcessEditModal @register="registerProcessEditModal" @success="handleSuccess"/>
<!-- 需要审批的资产类型 - 弹窗 -->
<AssetTypeModal @register="registerAssetTypeModal" @success="handleSuccess"/>
</template>
<script lang="ts" setup>
import {reactive, ref} from 'vue';
import {BasicTable, useTable, TableAction} from '@/components/Table';
import {Tag} from 'ant-design-vue';
import {PageWrapper} from '@/components/Page';
import {useMessage} from '@/hooks/web/useMessage';
import {useModal} from '@/components/Modal';
import ProcessEditModal from '@/views/dataSharingAndExchange/auditConfig/ProcessEditModal.vue'
import AssetTypeModal from '@/views/dataSharingAndExchange/auditConfig/AssetTypeModal.vue'
import {
columns,
searchFormSchema
} from "@/views/dataSharingAndExchange/auditConfig/auditConfig.data";
import {auditConfigListData} from "@/views/dataSharingAndExchange/auditConfig/auditConfigData";
defineOptions({name: 'AuditConfig'});
const {createMessage} = useMessage();
const [registerProcessEditModal, {openModal: openProcessEditModal}] = useModal();
const [registerAssetTypeModal, {openModal: openAssetTypeModal}] = useModal();
const searchInfo = reactive<Recordable>({});
const tableData = ref([])
const [registerTable, {
reload,
updateTableDataRecord,
getSearchInfo,
getForm,
getRowSelection
}] = useTable({
title: '',
api: async (params) => {
var data = [];
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: data.length,
code: '',
message: '',
data: [],
};
return {...response, data: auditConfigListData};
},
rowKey: 'id',
columns,
rowSelection: true,
formConfig: {
labelWidth: 10,
schemas: searchFormSchema,
autoSubmitOnEnter: false,
},
useSearchForm: true,
showTableSetting: false,
showIndexColumn: false,
bordered: true,
handleSearchInfoFn(info) {
return info;
},
actionColumn: {
width: 100,
title: '操作',
dataIndex: 'action',
},
});
/** 刷新 按钮 */
function handleReload() {
createMessage.success('刷新成功!')
reload();
}
/** 审批总产配置 按钮 */
function handleConfig(record: Recordable) {
openAssetTypeModal(true, {});
}
/** 编辑 按钮 */
function handleEdit(record: Recordable) {
openProcessEditModal(true, {});
}
/** 成功时返回的方法 */
function handleSuccess() {
reload();
}
</script>
import {BasicColumn, FormSchema} from "@/components/Table";
// 搜索栏参数
export const searchFormSchema: FormSchema[] = [
{
field: 'keyWord',
component: 'Input',
componentProps: {
placeholder: '搜索资源名称或申请标题',
},
colProps: {span: 4},
},
{
field: 'resourceCataloging',
label: ' ',
component: 'Select',
componentProps: {
placeholder: '资源编目',
options: [
{ label: '医疗数据', value: '1' },
{ label: '财务数据', value: '2' },
],
},
colProps: { span: 2 },
},
{
field: 'permissionType',
label: ' ',
component: 'Select',
componentProps: {
placeholder: '权限类型',
options: [
{ label: '上传', value: '1' },
{ label: '下载', value: '2' },
{ label: '数据集采集', value: '3' },
{ label: '数据集推送', value: '4' },
{ label: 'API调用-拉取数据', value: '5' },
{ label: 'API调用-推送数据', value: '6' },
],
},
colProps: { span: 2 },
},
{
field: 'permissionState',
label: ' ',
component: 'Select',
componentProps: {
placeholder: '权限状态',
options: [
{ label: '有效', value: '1' },
{ label: '无效', value: '2' },
],
},
colProps: { span: 3 },
},
];
// 表头列表头
export const columns: BasicColumn[any] = [
{
title: '资源名称',
dataIndex: 'resourceName',
width: 150,
},
{
title: '用户名',
dataIndex: 'createBy',
width: 150,
},
{
title: '权属机构',
dataIndex: 'affiliatedOrganization',
width: 150,
},
{
title: '权限类型',
dataIndex: 'permissionType',
width: 150,
},
{
title: '目标端',
dataIndex: 'destinationTerminal',
width: 150,
},
{
title: '对应申请',
dataIndex: 'correspondingApplication',
width: 150,
},
{
title: '权限状态',
dataIndex: 'permissionState',
width: 150,
},
{
title: '无效原因',
dataIndex: 'invalidReason',
width: 150,
},
];
// 权限管理 列表数据
export const authorityManagementListData: any[] = [
{
"id": 0,
"resourceName": "医疗服务库",
"affiliatedOrganization": "研发部门",
"permissionType": "数据集推送",
"destinationTerminal": "local-Inceptor/discover/user",
"correspondingApplication": "申请推送;医疗服务库",
"permissionState": "有效",
"invalidReason": "-",
"delFlag": "0",
"flag": "1",
"createBy": "admin",
"createDate": "2024-10-24 10:04:04",
"updateBy": "admin",
"updateDate": "2024-10-24 10:04:04"
},
{
"id": 1,
"resourceName": "医疗服务库",
"affiliatedOrganization": "测试部门",
"permissionType": "下载",
"destinationTerminal": "-",
"correspondingApplication": "申请下载;医疗服务库",
"permissionState": "有效",
"invalidReason": "-",
"delFlag": "0",
"flag": "1",
"createBy": "admin",
"createDate": "2024-10-24 18:44:16",
"updateBy": "admin",
"updateDate": "2024-10-24 18:44:16"
},
{
"id": 2,
"resourceName": "薪资类型",
"affiliatedOrganization": "财务部门",
"permissionType": "下载",
"destinationTerminal": "-",
"correspondingApplication": "申请下载;薪资类型",
"permissionState": "有效",
"invalidReason": "-",
"delFlag": "0",
"flag": "1",
"createBy": "admin",
"createDate": "2024-10-25 11:05:05",
"updateBy": "admin",
"updateDate": "2024-10-25 11:05:05"
},
{
"id": 3,
"resourceName": "医疗服务库",
"affiliatedOrganization": "数据部门",
"permissionType": "API调用-拉取数据",
"destinationTerminal": "https://192.168.0.1:28180",
"correspondingApplication": "申请API调用-推送数据<医疗服务库>;",
"permissionState": "有效",
"invalidReason": "-",
"delFlag": "0",
"flag": "1",
"createBy": "admin",
"createDate": "2024-10-27 09:27:29",
"updateBy": "admin",
"updateDate": "2024-10-27 09:27:29"
}
];
<template>
<!-- 权限管理 -->
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<BasicTable @register="registerTable" :searchInfo="searchInfo">
<template #toolbar>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
icon: 'ant-design:delete-outlined',
// label: '删除',
onClick: handleDelete.bind(null, record),
},
]"
/>
</template>
</template>
</BasicTable>
</PageWrapper>
</template>
<script lang="ts" setup>
import { reactive,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 {columns, searchFormSchema} from "@/views/dataSharingAndExchange/authorityManagement/authorityManagement.data";
import {authorityManagementListData} from "@/views/dataSharingAndExchange/authorityManagement/authorityManagementData";
defineOptions({ name: 'AuthorityManagement' });
const { createMessage } = useMessage();
const [registerModal, { openModal }] = useModal();
const searchInfo = reactive<Recordable>({});
const tableData = ref([])
const [registerTable, { reload, updateTableDataRecord, getSearchInfo,getForm,getRowSelection }] = useTable({
title: '',
api: async (params) => {
var data = [];
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: data.length,
code:'',
message:'',
data: [],
};
return { ...response,data: authorityManagementListData };
},
rowKey: 'id',
columns,
rowSelection: true,
formConfig: {
labelWidth: 10,
schemas: searchFormSchema,
autoSubmitOnEnter: false,
},
useSearchForm: true,
showTableSetting: false,
showIndexColumn:false,
bordered: true,
handleSearchInfoFn(info) {
return info;
},
actionColumn: {
width: 100,
title: '操作',
dataIndex: 'action',
},
});
/** 刷新 按钮 */
function handleReload() {
createMessage.success('刷新成功!')
reload();
}
/** 删除 按钮 */
async function handleDelete(record: Recordable) {
createMessage.success('删除成功!');
}
</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