Commit 80903bfc authored by 曹泽华's avatar 曹泽华

数据治理 数据比标准-引用文档,命名字典

parent b4081aa7
......@@ -113,13 +113,14 @@
/**结束对比*/
function endContrast() {
createMessage.info('结束对比');
startContrastFlag.value = false
router.push({
path: '/dataStandards/basicStandards/detailStandard',
query: {
businessId:route.query.businessId,
},
});
router.go(-1);
// startContrastFlag.value = false
// router.push({
// path: '/dataStandards/basicStandards/detailStandard',
// query: {
// businessId:route.query.businessId,
// },
// });
}
......
<template>
<PageWrapper :title="title" class="content-padding" contentBackground @back="goBack">
<!-- <div class="relatedRelationships_module">-->
<BasicTable @register="registerTable1">
<template #toolbar>
<a-button type="primary" @click="createQualityButton">创建质量规则</a-button>
<a-button type="primary" @click="lookQualityButton">查看质量规则</a-button>
<a-button type="primary" @click="referenceTemplateButton">引用模版</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
//解绑
icon: 'ant-design:link-outlined',
onClick: unbindButton.bind(null, record),
},
]"
/>
</template>
</template>
<template #dataSource="{ text, record }">
<span v-for="(item, index) in text" :key="index">
{{ item.icon }}
</span>
</template>
</BasicTable>
<BasicTable @register="registerTable2">
<template #toolbar>
<a-button type="primary" @click="referenceFileButton">引用文档</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
//解绑
icon: 'ant-design:link-outlined',
onClick: unbindButton.bind(null, record),
},
]"
/>
</template>
</template>
</BasicTable>
<!-- <BasicTable @register="registerTable1">-->
<!-- <template #toolbar>-->
<!-- <a-button type="primary" @click="createQualityButton">创建质量规则</a-button>-->
<!-- <a-button type="primary" @click="lookQualityButton">查看质量规则</a-button>-->
<!-- <a-button type="primary" @click="referenceTemplateButton">引用模版</a-button>-->
<!-- </template>-->
<!-- <template #bodyCell="{ column, record }">-->
<!-- <template v-if="column.key === 'action'">-->
<!-- <TableAction-->
<!-- :actions="[-->
<!-- {-->
<!-- //解绑-->
<!-- icon: 'ant-design:link-outlined',-->
<!-- onClick: unbindButton.bind(null, record),-->
<!-- },-->
<!-- ]"-->
<!-- />-->
<!-- </template>-->
<!-- </template>-->
<!-- <template #dataSource="{ text, record }">-->
<!-- <span v-for="(item, index) in text" :key="index">-->
<!-- {{ item.icon }}-->
<!-- </span>-->
<!-- </template>-->
<!-- </BasicTable>-->
<!-- <BasicTable @register="registerTable2">-->
<!-- <template #toolbar>-->
<!-- <a-button type="primary" @click="referenceFileButton">引用文档</a-button>-->
<!-- </template>-->
<!-- <template #bodyCell="{ column, record }">-->
<!-- <template v-if="column.key === 'action'">-->
<!-- <TableAction-->
<!-- :actions="[-->
<!-- {-->
<!-- //解绑-->
<!-- icon: 'ant-design:link-outlined',-->
<!-- onClick: unbindButton.bind(null, record),-->
<!-- },-->
<!-- ]"-->
<!-- />-->
<!-- </template>-->
<!-- </template>-->
<!-- </BasicTable>-->
<BasicTable @register="registerTable3">
<template #toolbar>
<a-button type="primary" @click="referenceBasicStandardsButton">引用标准</a-button>
......@@ -62,61 +62,61 @@
</template>
</template>
</BasicTable>
<BasicTable @register="registerTable4">
<template #toolbar>
<a-button type="primary" @click="referencePublicCodeButton">引用公共代码</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
//解绑
icon: 'ant-design:link-outlined',
onClick: unbindButton.bind(null, record),
},
]"
/>
</template>
</template>
</BasicTable>
<BasicTable @register="registerTable5">
<template #toolbar>
<a-button type="primary" @click="referenceIndicatorStandardsButton">引用标准</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
//解绑
icon: 'ant-design:link-outlined',
onClick: unbindButton.bind(null, record),
},
]"
/>
</template>
</template>
</BasicTable>
<BasicTable @register="registerTable6">
<template #toolbar>
<a-button type="primary" @click="recommendMetaDataButton">智能推荐元数据</a-button>
<a-button type="primary" @click="referenceMetaDataButton">关联元数据</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
//解绑
icon: 'ant-design:link-outlined',
onClick: unbindButton.bind(null, record),
},
]"
/>
</template>
</template>
</BasicTable>
<!-- <BasicTable @register="registerTable4">-->
<!-- <template #toolbar>-->
<!-- <a-button type="primary" @click="referencePublicCodeButton">引用公共代码</a-button>-->
<!-- </template>-->
<!-- <template #bodyCell="{ column, record }">-->
<!-- <template v-if="column.key === 'action'">-->
<!-- <TableAction-->
<!-- :actions="[-->
<!-- {-->
<!-- //解绑-->
<!-- icon: 'ant-design:link-outlined',-->
<!-- onClick: unbindButton.bind(null, record),-->
<!-- },-->
<!-- ]"-->
<!-- />-->
<!-- </template>-->
<!-- </template>-->
<!-- </BasicTable>-->
<!-- <BasicTable @register="registerTable5">-->
<!-- <template #toolbar>-->
<!-- <a-button type="primary" @click="referenceIndicatorStandardsButton">引用标准</a-button>-->
<!-- </template>-->
<!-- <template #bodyCell="{ column, record }">-->
<!-- <template v-if="column.key === 'action'">-->
<!-- <TableAction-->
<!-- :actions="[-->
<!-- {-->
<!-- //解绑-->
<!-- icon: 'ant-design:link-outlined',-->
<!-- onClick: unbindButton.bind(null, record),-->
<!-- },-->
<!-- ]"-->
<!-- />-->
<!-- </template>-->
<!-- </template>-->
<!-- </BasicTable>-->
<!-- <BasicTable @register="registerTable6">-->
<!-- <template #toolbar>-->
<!-- <a-button type="primary" @click="recommendMetaDataButton">智能推荐元数据</a-button>-->
<!-- <a-button type="primary" @click="referenceMetaDataButton">关联元数据</a-button>-->
<!-- </template>-->
<!-- <template #bodyCell="{ column, record }">-->
<!-- <template v-if="column.key === 'action'">-->
<!-- <TableAction-->
<!-- :actions="[-->
<!-- {-->
<!-- //解绑-->
<!-- icon: 'ant-design:link-outlined',-->
<!-- onClick: unbindButton.bind(null, record),-->
<!-- },-->
<!-- ]"-->
<!-- />-->
<!-- </template>-->
<!-- </template>-->
<!-- </BasicTable>-->
<!-- </div>-->
<!-- 引用模版 弹窗-->
<RelatedQualityModal @register="registerRelatedQualityModal" />
......
<template>
<BasicModal
width="40%"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref, reactive } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { copyFormSchema } from './referenceDocument.data';
import { useMessage } from '@/hooks/web/useMessage';
import { options } from '@/views/dataStandards/referenceDocument/mock';
import {treeDataList} from "@/views/dataStandards/namingDictionary/mock";
defineOptions({ name: 'AccountModal' });
const emit = defineEmits(['success', 'register']);
const isUpdate = ref(true);
const { createMessage } = useMessage();
const rowId = ref('');
const getTitle = computed(() => '复制到');
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 24, md: 24 },
schemas: copyFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
// 通过id获取行详情信息
// 塞值
setFieldsValue({
...data.record,
});
}
updateSchema([
{
field: 'path',
componentProps: { options: treeDataList },
},
{
field: 'modal',
componentProps: { options: options },
},
]);
});
/**确定按钮*/
async function handleSubmit() {
createMessage.success('复制成功');
closeModal();
}
/**数组对象转成树*/
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;
}
</script>
<template>
<BasicModal
width="40%"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref, reactive } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { moveFormSchema } from './referenceDocument.data';
import { useMessage } from '@/hooks/web/useMessage';
import { options } from '@/views/dataStandards/referenceDocument/mock';
import {treeDataList} from "@/views/dataStandards/namingDictionary/mock";
defineOptions({ name: 'AccountModal' });
const emit = defineEmits(['success', 'register']);
const isUpdate = ref(true);
const { createMessage } = useMessage();
const rowId = ref('');
const getTitle = computed(() => '移动');
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 24, md: 24 },
schemas: moveFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
// 通过id获取行详情信息
// 塞值
setFieldsValue({
...data.record,
});
}
updateSchema([
{
field: 'path',
componentProps: { options: treeDataList },
},
{
field: 'modal',
componentProps: { options: options },
},
]);
});
/**确定按钮*/
async function handleSubmit() {
createMessage.success('移动成功');
closeModal();
}
/**数组对象转成树*/
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;
}
</script>
<template>
<BasicModal
width="40%"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref, reactive } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { copyFormSchema } from './referenceDocument.data';
import { useMessage } from '@/hooks/web/useMessage';
import { treeDataList2, options } from './mock';
defineOptions({ name: 'AccountModal' });
const emit = defineEmits(['success', 'register']);
const isUpdate = ref(true);
const { createMessage } = useMessage();
const rowId = ref('');
const getTitle = computed(() => '复制到');
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 24, md: 24 },
schemas: copyFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
// 通过id获取行详情信息
// 塞值
setFieldsValue({
...data.record,
});
}
updateSchema([
{
field: 'path',
componentProps: { options: treeDataList2 },
},
{
field: 'modal',
componentProps: { options: options },
},
]);
});
/**确定按钮*/
async function handleSubmit() {
createMessage.success('复制成功');
closeModal();
}
/**数组对象转成树*/
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;
}
</script>
<template>
<div class="m-4 mr-0 overflow-hidden bg-white">
<BasicTree
title="主体"
ref="treeRef"
toolbar
search
treeWrapperClassName="h-[calc(100%-35px)] overflow-auto"
:clickRowToExpand="false"
:defaultExpandAll="true"
:treeData="treeData"
:fieldNames="{ key: 'value', title: 'label' }"
@select="handleSelect"
:beforeRightClick="getRightMenuList"
:actionList="actionList"
/>
</div>
</template>
<script lang="ts" setup>
import {h, nextTick, onMounted, ref, unref} from 'vue';
import {BasicTree, ContextMenuItem, TreeActionType, TreeItem} from '@/components/Tree';
import { getDeptList } from '@/api/system/dept/dept';
import {Nullable} from "@vben/types";
import {treeDataList, treeDataList2} from "./mock";
import {EllipsisOutlined, FolderOutlined} from "@ant-design/icons-vue";
import {EventDataNode} from "ant-design-vue/es/vc-tree/interface";
import {router} from "@/router";
defineOptions({ name: 'DeptTree' });
const emit = defineEmits(['select','Classification','manage']);
// 树的操作列表
const actionList = [
{
//全部操作按钮
render: (node) => {
return h(EllipsisOutlined, {
class: 'ml-2',
onClick: () => {
getRightMenuList(node)
},
});
},
},
];
function getRightMenuList(node: EventDataNode): Promise<ContextMenuItem[]> {
const menu = [
{
label: '查看详情',
handler: () => {
handleDetail(node)
},
icon: 'ant-design:eye-outlined',
},
{
label: '编辑',
handler: () => {
handleEdit(node)
},
icon: 'ant-design:edit-outlined',
},
{
label: '标准分类信息',
handler: () => {
classificationInfo(node)
},
icon: 'ant-design:snippets-outlined',
},
{
label: '新建名词分类',
handler: () => {
handleAddDocumentClassification(node)
},
icon: 'bi:plus',
},
{
label: '新建名词',
handler: () => {
handleAddDocumentManage(node)
},
icon: 'bi:plus',
},
{
label: '复制到',
handler: () => {
handleCopy(node)
},
icon: 'ant-design:snippets-twotone',
},
{
label: '删除',
handler: () => {
handleDelete(node)
},
icon: 'ant-design:rest-outlined',
},
{
label: '移动',
handler: () => {
handleMove(node)
},
icon: 'ant-design:rest-outlined',
},
];
return new Promise((resolve) => {
resolve(menu);
});
}
function handleDetail(data) {
router.push({
path: '/dataStandards/referenceDocument/details',
});
}
function handleEdit(data) {
router.push({
path: '/dataStandards/referenceDocument/edit',
});
}
function classificationInfo(data) {
}
function handleAddDocumentClassification(data) {
emit('Classification', { });
}
function handleAddDocumentManage(data) {
emit('manage', { });
}
function handleCopy(data) {
}
function handleDelete(data) {
}
function handleMove(data) {
}
const treeData = ref<TreeItem[]>([]);
const treeRef = ref<Nullable<TreeActionType>>(null);
async function fetch() {
treeData.value = treeDataList2
await nextTick(() => {
getTree().expandAll(true)
})
}
function getTree() {
const tree = unref(treeRef);
if (!tree) {
throw new Error('tree is null!');
}
return tree;
}
function handleSelect(keys) {
emit('select', keys[0]);
}
onMounted(() => {
fetch();
});
</script>
<template>
<BasicModal
width="40%"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref, reactive } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { moveFormSchema } from './referenceDocument.data';
import { useMessage } from '@/hooks/web/useMessage';
import { options } from '@/views/dataStandards/referenceDocument/mock';
import {treeDataList} from "@/views/dataStandards/namingDictionary/mock";
import {treeDataList2} from "@/views/dataStandards/namingDictionary/domain/mock";
defineOptions({ name: 'AccountModal' });
const emit = defineEmits(['success', 'register']);
const isUpdate = ref(true);
const { createMessage } = useMessage();
const rowId = ref('');
const getTitle = computed(() => '移动');
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 24, md: 24 },
schemas: moveFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
// 通过id获取行详情信息
// 塞值
setFieldsValue({
...data.record,
});
}
updateSchema([
{
field: 'path',
componentProps: { options: treeDataList2 },
},
{
field: 'modal',
componentProps: { options: options },
},
]);
});
/**确定按钮*/
async function handleSubmit() {
createMessage.success('移动成功');
closeModal();
}
/**数组对象转成树*/
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;
}
</script>
<template>
<BasicModal
min-height="100"
width="30%"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm">
<template #fileMethods="{ model, field }">
<div style="display: flex">
<div>
<a-button>下载模板</a-button>
<a-button type="primary" style="margin-left: 5px">选择文件</a-button>
</div>
<div style="width: 200px; margin-left: 5px"
>只能导入单个Excel文件,且单次导入不超过100000条数据</div
>
</div>
</template>
</BasicForm>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { useMessage } from '@/hooks/web/useMessage';
import { importSchema } from './referenceDocument.data';
defineOptions({ name: 'ImportModal' });
const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage();
const isUpdate = ref(true);
const rowId = ref('');
const value = ref<string>('1');
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 24, md: 24 },
schemas: importSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
// 通过id获取行详情信息
// 塞值
setFieldsValue({
...data.record,
});
}
});
const getTitle = computed(() => '标准导入');
async function handleSubmit() {
try {
const values = await validate();
setModalProps({ confirmLoading: true });
// TODO custom api
closeModal();
emit('success', { isUpdate: unref(isUpdate), values: { ...values, id: rowId.value } });
} finally {
setModalProps({ confirmLoading: false });
}
createMessage.success('导入成功!');
}
</script>
<style lang="scss" scoped>
.modalBody {
display: flex;
align-items: center;
.title {
padding-right: 15px;
}
}
</style>
......@@ -34,23 +34,22 @@ export const tableList: any[] = [
flag: '已发布',
group: '共享工作组',
},
]
];
export const tableListRemove = [
{
businessId: 1,
name: '日期类',
dicName: '关联域样例',
path: '命名字典-关联域/关联域样例',
}
]
},
];
export const tableListDic = [
{
businessId: 1,
name: '关联域样例',
path: '命名字典-关联域/关联域样例',
},
]
];
export const treeDataList = [
{
label: '命名字典',
......@@ -61,17 +60,11 @@ export const treeDataList = [
label: '关联域',
value: 2,
icon: 'home|svg',
children: [
{ label: '关联域样例',
value: 3,
icon: 'home|svg',
children: [],
},
],
children: [{ label: '关联域样例', value: 3, icon: 'home|svg', children: [] }],
},
],
},
]
];
export const treeDataList2 = [
{
label: '域',
......@@ -82,18 +75,11 @@ export const treeDataList2 = [
label: '共享工作区',
value: 2,
icon: 'home|svg',
children: [
{ label: '日期类',
value: 3,
icon: 'home|svg',
children: [
],
},
],
children: [{ label: '短编号', value: 3, icon: 'home|svg', children: [] }],
},
],
},
]
];
export const treeDataListPath = [
{
label: '主体管理',
......@@ -105,7 +91,7 @@ export const treeDataListPath = [
{ label: '指标工作区', businessId: 5 },
],
},
]
];
export const treeDataListTwo = [
{
label: '默认工作组',
......@@ -117,7 +103,7 @@ export const treeDataListTwo = [
{ label: '默认工作组04', businessId: 5 },
],
},
]
];
export const options = [
{
value: '标准数据',
......@@ -126,13 +112,10 @@ export const options = [
{
value: '引用文档元模型',
label: '引用文档元模型',
children: [
],
children: [],
},
],
},
];
export const tableListTwo: any[] = [
{
......@@ -140,4 +123,4 @@ export const tableListTwo: any[] = [
name: '某领域办公办文格式撰写标准',
type: 'DOCX',
},
]
];
import {getAllRoleList} from '@/api/system/role/role';
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 {areaRecord} from "@/api/demo/cascader"; // 引入开关组件
import { h } from 'vue';
import { Tag, Switch } from 'ant-design-vue';
import { useMessage } from '@/hooks/web/useMessage';
import { changeFlagApi } from '@/api/system/user/user';
import { areaRecord } from '@/api/demo/cascader';
// 引入开关组件
type CheckedType = boolean | string | number;
export const dictionColumns: BasicColumn[] = [
......@@ -19,7 +19,7 @@ export const dictionColumns: BasicColumn[] = [
dataIndex: 'path',
width: 120,
},
]
];
export const removeColumns: BasicColumn[] = [
{
title: '域',
......@@ -36,7 +36,7 @@ export const removeColumns: BasicColumn[] = [
dataIndex: 'path',
width: 120,
},
]
];
export const columnsTwo: BasicColumn[] = [
{
title: '名称',
......@@ -48,7 +48,7 @@ export const columnsTwo: BasicColumn[] = [
dataIndex: 'type',
width: 120,
},
]
];
export const columns: BasicColumn[] = [
{
title: '域名称',
......@@ -82,12 +82,9 @@ export const searchFormSchema: FormSchema[] = [
placeholder: '输入域名称',
},
},
];
export const formSchema: FormSchema[] = [
{
field: 'path',
component: 'Cascader',
......@@ -113,9 +110,8 @@ export const formSchema: FormSchema[] = [
},
},
},
]
];
export const formSchemaManage: FormSchema[] = [
{
field: 'path',
component: 'Cascader',
......@@ -156,7 +152,7 @@ export const formSchemaManage: FormSchema[] = [
field: 'type',
label: '类型',
component: 'Input',
defaultValue:'域',
defaultValue: '域',
componentProps: {
readonly: true,
disabled: true,
......@@ -164,11 +160,9 @@ export const formSchemaManage: FormSchema[] = [
border: 'none',
backgroundColor: 'transparent',
},
}
},
},
]
];
/**详情表单1*/
export const detailSchema1: FormSchema[] = [
......@@ -192,7 +186,7 @@ export const detailSchema1: FormSchema[] = [
label: '域名称',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'短编号',
defaultValue: '短编号',
componentProps: {
style: {
border: 'none',
......@@ -221,7 +215,7 @@ export const detailSchema1: FormSchema[] = [
field: 'valueThree',
label: '字段示例',
component: 'Input',
defaultValue:'会员号/品种代码',
defaultValue: '会员号/品种代码',
colProps: { lg: 12, md: 8 },
componentProps: {
style: {
......@@ -236,7 +230,7 @@ export const detailSchema1: FormSchema[] = [
field: 'valueFour',
label: '数据类型',
component: 'Input',
defaultValue:'varchar',
defaultValue: 'varchar',
colProps: { lg: 12, md: 8 },
componentProps: {
style: {
......@@ -250,7 +244,7 @@ export const detailSchema1: FormSchema[] = [
field: 'valueFive',
label: '传统数据库数据类型',
component: 'Input',
defaultValue:'varchar',
defaultValue: 'varchar',
colProps: { lg: 12, md: 8 },
componentProps: {
style: {
......@@ -264,7 +258,7 @@ export const detailSchema1: FormSchema[] = [
field: 'valueSix',
label: '长度',
component: 'Input',
defaultValue:'10',
defaultValue: '10',
colProps: { lg: 12, md: 8 },
componentProps: {
style: {
......@@ -278,7 +272,7 @@ export const detailSchema1: FormSchema[] = [
field: 'valueSeven',
label: '精度',
component: 'Input',
defaultValue:'-',
defaultValue: '-',
colProps: { lg: 12, md: 8 },
componentProps: {
style: {
......@@ -295,7 +289,7 @@ export const detailSchema2: FormSchema[] = [
label: '域名称',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'短编号',
defaultValue: '短编号',
componentProps: {
placeholder: '请输入域名称',
},
......@@ -308,16 +302,14 @@ export const detailSchema2: FormSchema[] = [
colProps: { span: 8 },
componentProps: {
placeholder: '',
options: [
{ label: '字符型', value: '字符型' },
],
options: [{ label: '字符型', value: '字符型' }],
},
},
{
field: 'valueThree',
label: '字段示例',
component: 'Input',
defaultValue:'会员号/品种代码',
defaultValue: '会员号/品种代码',
colProps: { lg: 12, md: 8 },
componentProps: {
placeholder: '请输入字段示例',
......@@ -341,7 +333,7 @@ export const detailSchema2: FormSchema[] = [
field: 'valueFive',
label: '传统数据库类型',
component: 'Input',
defaultValue:'varchar',
defaultValue: 'varchar',
colProps: { lg: 12, md: 8 },
componentProps: {
placeholder: '请输入传统数据库类型',
......@@ -351,7 +343,7 @@ export const detailSchema2: FormSchema[] = [
field: 'valueSix',
label: '长度',
component: 'Input',
defaultValue:'10',
defaultValue: '10',
colProps: { lg: 12, md: 8 },
componentProps: {
placeholder: '请输入长度',
......@@ -361,7 +353,7 @@ export const detailSchema2: FormSchema[] = [
field: 'valueSeven',
label: '精度',
component: 'Input',
defaultValue:'-',
defaultValue: '-',
colProps: { lg: 12, md: 8 },
componentProps: {
placeholder: '请输入精度',
......@@ -389,7 +381,7 @@ export const detailSchema3: FormSchema[] = [
label: '关联域',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'日期类',
defaultValue: '日期类',
componentProps: {
style: {
border: 'none',
......@@ -399,8 +391,6 @@ export const detailSchema3: FormSchema[] = [
placeholder: '请输入名词中文名称',
},
},
];
export const detailSchema4: FormSchema[] = [
{
......@@ -408,7 +398,7 @@ export const detailSchema4: FormSchema[] = [
label: '域名称',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'日期类',
defaultValue: '日期类',
componentProps: {
style: {
border: 'none',
......@@ -424,7 +414,7 @@ export const detailSchema4: FormSchema[] = [
label: '父域',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'日期时间型',
defaultValue: '日期时间型',
componentProps: {
style: {
border: 'none',
......@@ -439,7 +429,7 @@ export const detailSchema4: FormSchema[] = [
label: '字段示例',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'成交日期',
defaultValue: '成交日期',
componentProps: {
style: {
border: 'none',
......@@ -454,7 +444,7 @@ export const detailSchema4: FormSchema[] = [
label: '数据类型',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'date',
defaultValue: 'date',
componentProps: {
style: {
border: 'none',
......@@ -469,7 +459,7 @@ export const detailSchema4: FormSchema[] = [
label: '传统数据库类型',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'date',
defaultValue: 'date',
componentProps: {
style: {
border: 'none',
......@@ -484,7 +474,7 @@ export const detailSchema4: FormSchema[] = [
label: '长度',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'123',
defaultValue: '123',
componentProps: {
style: {
border: 'none',
......@@ -499,7 +489,7 @@ export const detailSchema4: FormSchema[] = [
label: '精度',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'-',
defaultValue: '-',
componentProps: {
style: {
border: 'none',
......@@ -574,4 +564,75 @@ export const formSchemaImport: any = [
placeholder: '输入文件名',
},
},
]
];
export const moveFormSchema: any[] = [
{
field: 'path',
component: 'Cascader',
label: '路径',
componentProps: {
// dataField: 'data',
labelField: 'label',
valueField: 'value',
initFetchParams: {
parentCode: '',
},
isLeaf: (record) => {
return !(record.levelType < 3);
},
onChange: (e, ...v) => {
console.log('ApiCascader====>:', e, v);
},
},
},
];
export const copyFormSchema: any[] = [
{
field: 'path',
component: 'Cascader',
label: '路径',
rules: [
{
required: true,
message: '请输入路径',
},
],
componentProps: {
// dataField: 'data',
labelField: 'label',
valueField: 'value',
initFetchParams: {
parentCode: '',
},
isLeaf: (record) => {
return !(record.levelType < 3);
},
onChange: (e, ...v) => {
console.log('ApiCascader====>:', e, v);
},
},
},
];
export const importSchema: any[] = [
{
field: 'fileMethods',
label: '导入文件选择',
slot: 'fileMethods',
colProps: { lg: 24, md: 24 },
},
{
field: 'fileRename',
label: '文件重名',
component: 'RadioGroup',
required: true,
colProps: { lg: 24, md: 24 },
componentProps: {
options: [
{ label: '全部放弃', value: '1' },
{ label: '全部替换', value: '2' },
{ label: '自动重命名', value: '3' },
],
},
},
];
<template>
<BasicModal
min-height="100"
width="30%"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm">
<template #fileMethods="{ model, field }">
<div style="display: flex">
<div>
<a-button>下载模板</a-button>
<a-button type="primary" style="margin-left: 5px">选择文件</a-button>
</div>
<div style="width: 200px; margin-left: 5px"
>只能导入单个Excel文件,且单次导入不超过100000条数据</div
>
</div>
</template>
</BasicForm>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { useMessage } from '@/hooks/web/useMessage';
import { importSchema } from '@/views/dataStandards/referenceDocument/referenceDocument.data';
defineOptions({ name: 'ImportModal' });
const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage();
const isUpdate = ref(true);
const rowId = ref('');
const value = ref<string>('1');
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 24, md: 24 },
schemas: importSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
// 通过id获取行详情信息
// 塞值
setFieldsValue({
...data.record,
});
}
});
const getTitle = computed(() => '标准导入');
async function handleSubmit() {
try {
const values = await validate();
setModalProps({ confirmLoading: true });
// TODO custom api
closeModal();
emit('success', { isUpdate: unref(isUpdate), values: { ...values, id: rowId.value } });
} finally {
setModalProps({ confirmLoading: false });
}
createMessage.success('导入成功!');
}
</script>
<style lang="scss" scoped>
.modalBody {
display: flex;
align-items: center;
.title {
padding-right: 15px;
}
}
</style>
......@@ -113,6 +113,8 @@ function handleCancel() {
function handleSubmitApplication() {
closeModal();
createMessage.success('发布成功!');
}
async function handleSubmit() {
......
import {getAllRoleList} from '@/api/system/role/role';
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 {areaRecord} from "@/api/demo/cascader"; // 引入开关组件
import { h } from 'vue';
import { Tag, Switch } from 'ant-design-vue';
import { useMessage } from '@/hooks/web/useMessage';
import { changeFlagApi } from '@/api/system/user/user';
import { areaRecord } from '@/api/demo/cascader';
import { TreeData } from '@/views/metadata/metadataData';
// 引入开关组件
type CheckedType = boolean | string | number;
export const columnsTwo: BasicColumn[] = [
......@@ -19,7 +20,7 @@ export const columnsTwo: BasicColumn[] = [
dataIndex: 'type',
width: 120,
},
]
];
export const columns: BasicColumn[] = [
{
title: '文件中文名',
......@@ -78,9 +79,7 @@ export const searchFormSchema: FormSchema[] = [
},
];
export const formSchema: FormSchema[] = [
{
field: 'path',
component: 'Cascader',
......@@ -128,8 +127,11 @@ export const formSchema: FormSchema[] = [
required: true,
componentProps: {
// dataField: 'data',
labelField: 'value',
valueField: 'label',
fieldNames: {
title: 'modelName',
key: 'businessId',
},
treeData: TreeData,
initFetchParams: {
parentCode: '',
},
......@@ -141,9 +143,8 @@ export const formSchema: FormSchema[] = [
},
},
},
]
];
export const formSchemaManage: FormSchema[] = [
{
field: 'path',
component: 'Cascader',
......@@ -178,7 +179,7 @@ export const formSchemaManage: FormSchema[] = [
field: 'type',
label: '标准类型',
component: 'Input',
defaultValue:'命名字典',
defaultValue: '命名字典',
componentProps: {
readonly: true,
disabled: true,
......@@ -186,11 +187,9 @@ export const formSchemaManage: FormSchema[] = [
border: 'none',
backgroundColor: 'transparent',
},
}
},
},
]
];
/**详情表单1*/
export const detailSchema1: FormSchema[] = [
......@@ -214,7 +213,7 @@ export const detailSchema1: FormSchema[] = [
label: '名词中文名称',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'企业号',
defaultValue: '企业号',
rules: [
{
required: true,
......@@ -255,7 +254,7 @@ export const detailSchema1: FormSchema[] = [
field: 'valueThree',
label: '名词英文简称',
component: 'Input',
defaultValue:'标准文件A',
defaultValue: '标准文件A',
colProps: { lg: 12, md: 8 },
rules: [
{
......@@ -272,7 +271,6 @@ export const detailSchema1: FormSchema[] = [
placeholder: '请输入名词英文简称',
},
},
];
export const detailSchema2: FormSchema[] = [
{
......@@ -280,7 +278,7 @@ export const detailSchema2: FormSchema[] = [
label: '名词中文名称',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'企业号',
defaultValue: '企业号',
componentProps: {
placeholder: '请输入名词中文名称',
},
......@@ -299,7 +297,7 @@ export const detailSchema2: FormSchema[] = [
field: 'valueThree',
label: '名词英文简称',
component: 'Input',
defaultValue:'company_no',
defaultValue: 'company_no',
colProps: { lg: 12, md: 8 },
componentProps: {
placeholder: '请输入名词英文简称',
......@@ -327,7 +325,7 @@ export const detailSchema3: FormSchema[] = [
label: '关联域',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'日期类',
defaultValue: '日期类',
componentProps: {
style: {
border: 'none',
......@@ -337,8 +335,6 @@ export const detailSchema3: FormSchema[] = [
placeholder: '请输入名词中文名称',
},
},
];
export const detailSchema4: FormSchema[] = [
{
......@@ -346,7 +342,7 @@ export const detailSchema4: FormSchema[] = [
label: '域名称',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'日期类',
defaultValue: '日期类',
componentProps: {
style: {
border: 'none',
......@@ -362,7 +358,7 @@ export const detailSchema4: FormSchema[] = [
label: '父域',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'日期时间型',
defaultValue: '日期时间型',
componentProps: {
style: {
border: 'none',
......@@ -377,7 +373,7 @@ export const detailSchema4: FormSchema[] = [
label: '字段示例',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'成交日期',
defaultValue: '成交日期',
componentProps: {
style: {
border: 'none',
......@@ -392,7 +388,7 @@ export const detailSchema4: FormSchema[] = [
label: '数据类型',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'date',
defaultValue: 'date',
componentProps: {
style: {
border: 'none',
......@@ -407,7 +403,7 @@ export const detailSchema4: FormSchema[] = [
label: '传统数据库类型',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'date',
defaultValue: 'date',
componentProps: {
style: {
border: 'none',
......@@ -422,7 +418,7 @@ export const detailSchema4: FormSchema[] = [
label: '长度',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'123',
defaultValue: '123',
componentProps: {
style: {
border: 'none',
......@@ -437,7 +433,7 @@ export const detailSchema4: FormSchema[] = [
label: '精度',
component: 'Input',
colProps: { lg: 12, md: 8 },
defaultValue:'-',
defaultValue: '-',
componentProps: {
style: {
border: 'none',
......@@ -505,7 +501,7 @@ export const formSchemaPublishTwo: any = [
field: 'valueOne',
label: '数据标准路径',
component: 'Input',
defaultValue:'域/共享工作区/短编号',
defaultValue: '域/共享工作区/短编号',
componentProps: {
readonly: true,
disabled: true,
......@@ -513,9 +509,9 @@ export const formSchemaPublishTwo: any = [
border: 'none',
backgroundColor: 'transparent',
},
}
},
},
]
];
export const formSchemaPublish: any = [
{
field: 'title',
......@@ -551,7 +547,7 @@ export const formSchemaPublish: any = [
field: 'user',
label: '申请人',
component: 'Input',
defaultValue:'admin',
defaultValue: 'admin',
componentProps: {
readonly: true,
disabled: true,
......@@ -559,13 +555,13 @@ export const formSchemaPublish: any = [
border: 'none',
backgroundColor: 'transparent',
},
}
},
},
{
field: 'organization',
label: '申请人组织',
component: 'Input',
defaultValue:'-',
defaultValue: '-',
componentProps: {
readonly: true,
disabled: true,
......@@ -573,9 +569,9 @@ export const formSchemaPublish: any = [
border: 'none',
backgroundColor: 'transparent',
},
}
},
},
]
];
export const formSchemaImport: any = [
{
field: 'path',
......@@ -604,4 +600,48 @@ export const formSchemaImport: any = [
placeholder: '输入文件名',
},
},
]
];
export const moveFormSchema: any[] = [
{
field: 'path',
component: 'Cascader',
label: '路径',
componentProps: {
// dataField: 'data',
labelField: 'label',
valueField: 'value',
initFetchParams: {
parentCode: '',
},
isLeaf: (record) => {
return !(record.levelType < 3);
},
onChange: (e, ...v) => {
console.log('ApiCascader====>:', e, v);
},
},
},
];
export const copyFormSchema: any[] = [
{
field: 'path',
component: 'Cascader',
label: '路径',
componentProps: {
// dataField: 'data',
labelField: 'label',
valueField: 'value',
initFetchParams: {
parentCode: '',
},
isLeaf: (record) => {
return !(record.levelType < 3);
},
onChange: (e, ...v) => {
console.log('ApiCascader====>:', e, v);
},
},
},
];
<template>
<BasicModal
width="40%"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref, reactive } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { copyFormSchema } from './referenceDocument.data';
import { useMessage } from '@/hooks/web/useMessage';
import { options, treeDataList } from '@/views/dataStandards/referenceDocument/mock';
defineOptions({ name: 'AccountModal' });
const emit = defineEmits(['success', 'register']);
const isUpdate = ref(true);
const { createMessage } = useMessage();
const rowId = ref('');
const getTitle = computed(() => '复制到');
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 24, md: 24 },
schemas: copyFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
// 通过id获取行详情信息
// 塞值
setFieldsValue({
...data.record,
});
}
updateSchema([
{
field: 'path',
componentProps: { options: treeDataList },
},
{
field: 'modal',
componentProps: { options: options },
},
]);
});
/**确定按钮*/
async function handleSubmit() {
createMessage.success('复制成功');
closeModal();
}
/**数组对象转成树*/
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;
}
</script>
<template>
<BasicModal
width="40%"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref, reactive } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { moveFormSchema } from './referenceDocument.data';
import { useMessage } from '@/hooks/web/useMessage';
import { options, treeDataList } from '@/views/dataStandards/referenceDocument/mock';
defineOptions({ name: 'AccountModal' });
const emit = defineEmits(['success', 'register']);
const isUpdate = ref(true);
const { createMessage } = useMessage();
const rowId = ref('');
const getTitle = computed(() => '移动');
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 24, md: 24 },
schemas: moveFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
// 通过id获取行详情信息
// 塞值
setFieldsValue({
...data.record,
});
}
updateSchema([
{
field: 'path',
componentProps: { options: treeDataList },
},
{
field: 'modal',
componentProps: { options: options },
},
]);
});
/**确定按钮*/
async function handleSubmit() {
createMessage.success('移动成功');
closeModal();
}
/**数组对象转成树*/
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;
}
</script>
......@@ -65,6 +65,7 @@ function handleSubmitApplication() {
router.push({
path: '/dataStandards/referenceDocument/applyPublication',
});
createMessage.success('发布成功!');
}
async function handleSubmit() {
......
<template>
<BasicModal width="40%" v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit">
<BasicForm @register="registerForm" />
<BasicModal
width="40%"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm">
<template #file="{ field, model }">
<Upload
v-model:file-list="fileList"
name="file"
:headers="headers"
@change="handleChange(model)"
:max-count="1"
>
<a-button>
<UploadOutlined />
上传文件
</a-button>
</Upload>
<span style="color: #dbdcdd; font-size: 12px">仅支持上传单个文件或zip包</span>
</template>
</BasicForm>
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref, reactive} from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { formSchemaImport } from './referenceDocument.data';
import {treeDataListPath} from './mock'
import { useMessage } from '@/hooks/web/useMessage';
import {getMenuList} from "@/api/system/menu/menu";
defineOptions({ name: 'AccountModal' });
import { ref, computed, unref, reactive } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { formSchemaImport } from './referenceDocument.data';
import { treeDataListPath } from './mock';
import { useMessage } from '@/hooks/web/useMessage';
import { getMenuList } from '@/api/system/menu/menu';
import { UploadOutlined } from '@ant-design/icons-vue';
import { Upload } from 'ant-design-vue';
const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage();
const isUpdate = ref(true);
const rowId = ref('');
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 24, md: 24 },
schemas: formSchemaImport,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
console.log('1111111111111111111111111111111')
resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
defineOptions({ name: 'AccountModal' });
}
updateSchema({
field: 'path',
componentProps: { treeData:treeDataListPath },
const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage();
const fileList = ref([]);
const headers = {
authorization: 'authorization-text',
};
const isUpdate = ref(true);
const rowId = ref('');
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 24, md: 24 },
schemas: formSchemaImport,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
console.log('1111111111111111111111111111111');
resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
}
updateSchema({
field: 'path',
componentProps: { treeData: treeDataListPath },
});
});
});
const getTitle = computed(() => ('导入文件选择'));
const getTitle = computed(() => '导入文件选择');
async function handleSubmit() {
try {
const values = await validate();
setModalProps({ confirmLoading: true });
// TODO custom api
closeModal();
emit('success', { isUpdate: unref(isUpdate), values: { ...values, id: rowId.value } });
} finally {
setModalProps({ confirmLoading: false });
const handleChange = (model) => {
const type = fileList.value[0].name.slice(fileList.value[0].name.lastIndexOf('.') + 1);
console.log('type', type);
if (['xls', 'xlsx'].includes(type)) {
model.fileType = 'excel';
} else {
model.fileType = 'other';
}
model.fileName = fileList.value[0].name;
model.sheetName = 'Sheet1,Sheet2,Sheet3';
};
async function handleSubmit() {
try {
const values = await validate();
setModalProps({ confirmLoading: true });
// TODO custom api
closeModal();
emit('success', { isUpdate: unref(isUpdate), values: { ...values, id: rowId.value } });
} finally {
setModalProps({ confirmLoading: false });
}
}
}
</script>
<template>
<BasicModal
min-height="100"
width="30%"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm">
<template #fileMethods="{ model, field }">
<div style="display: flex">
<div>
<a-button>下载模板</a-button>
<a-button type="primary" style="margin-left: 5px">选择文件</a-button>
</div>
<div style="width: 200px; margin-left: 5px"
>只能导入单个Excel文件,且单次导入不超过100000条数据</div
>
</div>
</template>
</BasicForm>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { useMessage } from '@/hooks/web/useMessage';
import { importSchema } from './referenceDocument.data';
defineOptions({ name: 'ImportModal' });
const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage();
const isUpdate = ref(true);
const rowId = ref('');
const value = ref<string>('1');
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 24, md: 24 },
schemas: importSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
// 通过id获取行详情信息
// 塞值
setFieldsValue({
...data.record,
});
}
});
const getTitle = computed(() => '标准导入');
async function handleSubmit() {
try {
const values = await validate();
setModalProps({ confirmLoading: true });
// TODO custom api
closeModal();
emit('success', { isUpdate: unref(isUpdate), values: { ...values, id: rowId.value } });
} finally {
setModalProps({ confirmLoading: false });
}
createMessage.success('导入成功!');
}
</script>
<style lang="scss" scoped>
.modalBody {
display: flex;
align-items: center;
.title {
padding-right: 15px;
}
}
</style>
......@@ -110,7 +110,7 @@
const go = useGo();
const tableFlush = ref(true);
const [registerModal, { openModal }] = useModal();
const [registerImport, { openModal: openImportModal }] = useModal();
const [registerImport, { openModal: openImportModalInfo }] = useModal();
const [registerModalAdd, { openModal: openModalAdd }] = useModal();
const [registerMoveUser, { openModal: openMoveUserModal }] = useModal();
const [registerBaseImport, { openModal: openBaseImportUserModal }] = useModal();
......
......@@ -15,7 +15,7 @@
import { nextTick, onMounted, ref, unref } from 'vue';
import { BasicTree, TreeActionType, TreeItem } from '@/components/Tree';
import { Nullable } from '@vben/types';
import { TreeData } from './landData';
import { TreeData } from '../modelData';
import { useMessage } from '@/hooks/web/useMessage';
defineOptions({ name: 'DeptTree' });
......
......@@ -8,33 +8,31 @@
>
<div style="display: flex">
<div class="w-3/5">
<BasicForm @register="registerForm" >
<template #formFooter>
<a-button style="margin-left: 100px" @click="addField">添加</a-button>
<ModelTree @getNode="getNode" style="width: 50%"/>
</template>
</BasicForm>
<BasicForm @register="registerForm">
<template #formFooter>
<a-button style="margin-left: 100px" @click="addField">添加</a-button>
<ModelTree @get-node="getNode" style="width: 50%" />
</template>
</BasicForm>
</div>
<div class="w-2/5">
<span style="margin-left: 20px">已选项</span>
<span style="margin-left: 20px">字段{{ }}项</span>
<BasicTable @register="registerTable" :searchInfo="searchInfo">
<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>
<span style="margin-left: 20px">已选项</span>
<span style="margin-left: 20px">字段{{}}项</span>
<BasicTable @register="registerTable" :searchInfo="searchInfo">
<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>
</div>
</div>
</BasicModal>
......@@ -50,10 +48,10 @@
import { columnsDetail } from '@/views/dataWarehousePlanning/physicalModel/model.data';
import {
columns,
searchFormSchema
searchFormSchema,
} from '@/views/dataWarehousePlanning/physicalModel/modelDetail/modelData';
import ModelTree from "@/views/dataWarehousePlanning/physicalModel/landCheck/ModelTree.vue";
import {useMessage} from "@/hooks/web/useMessage";
import ModelTree from '@/views/dataWarehousePlanning/physicalModel/landCheck/ModelTree.vue';
import { useMessage } from '@/hooks/web/useMessage';
const { createMessage } = useMessage();
const isUpdate = ref(false);
......@@ -63,15 +61,16 @@
const tableData = reactive([]);
const title = ref();
//初始化表单
const [registerForm, { setFieldsValue, getFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 10,
baseColProps: { lg: 12, md: 24 },
schemas: ConnectionModelFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
const [registerForm, { setFieldsValue, getFieldsValue, updateSchema, resetFields, validate }] =
useForm({
labelWidth: 10,
baseColProps: { lg: 12, md: 24 },
schemas: ConnectionModelFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
const [
registerTable,
......@@ -161,13 +160,13 @@
if (title.value) {
tableData.push({ tableName: title.value });
} else {
createMessage.warning('请选择')
createMessage.warning('请选择');
}
reload();
}
function getNode(node) {
console.log('node', node)
title.value = node.modelName
console.log('node', node);
title.value = node.modelName;
}
/**确定按钮*/
async function handleSubmit() {
......
......@@ -54,6 +54,7 @@
{
// 编辑
icon: 'clarity:contract-line',
onClick: handleView.bind(null, record),
},
]"
/>
......@@ -70,6 +71,7 @@
</BasicTable>
</div>
</template>
<ModelPublishCheck @register="registerModal" />
</PageWrapper>
</template>
......@@ -90,11 +92,14 @@
import { reportColumn, reportFormSchema } from './detail.data';
import { reportData } from './detailData';
import { router } from '@/router';
import ModelPublishCheck from './modelPublishCheck.vue';
import { useModal } from '@/components/Modal';
type EChartsOption = echarts.EChartsOption;
const route = useRoute();
const modelName = route.query.name;
const selectBatch = ref('2023/06/07 19:45:59~2023/06/07 19:46:10');
const [registerModal, { openModal }] = useModal();
const timeList = computed(() => selectBatch.value.split('~'));
const options = reactive([
{
......@@ -326,6 +331,10 @@
option && myChart.setOption(option);
}
function handleView() {
console.log('asdasd');
openModal(true, {});
}
onMounted(() => {
getTimeDifference();
getEcharts1();
......
......@@ -7,7 +7,7 @@
<a-button type="primary" :disabled="isEdit" @click="handleEdit">编辑</a-button>
<a-button type="primary" :disabled="isEdit" @click="handleRun">运行</a-button>
</template>
<BasicForm @register="registerForm">
<BasicForm style="margin-top: 20px" @register="registerForm">
<template #libraryName="{ model, field }">
<span v-if="!isEdit">{{ model[field] }}</span>
<a-input v-else v-model:value="model[field]" style="width: 500px" />
......
import {FormSchema} from "@/components/Form";
import {BasicColumn} from "@/components/Table";
import { FormSchema } from '@/components/Form';
import { BasicColumn } from '@/components/Table';
/**新建文件*/
export const physicalModelFormSchema: any[] = [
......@@ -82,7 +82,6 @@ export const searchFormSchema: FormSchema[] = [
},
];
export const columnsSystem: BasicColumn[] = [
{
title: '名称',
......@@ -129,5 +128,33 @@ export const columnsSystem: BasicColumn[] = [
},
];
export const copyModalFormSchema: any[] = [
{
field: 'modelId',
label: '路径',
component: 'TreeSelect',
colProps: { lg: 24, md: 24 },
componentProps: {
fieldNames: {
label: 'modelName',
value: 'businessId',
},
getPopupContainer: () => document.body,
},
},
];
export const moveModalFormSchema: FormSchema[] = [
{
field: 'modelId',
label: '路径',
component: 'TreeSelect',
colProps: { lg: 24, md: 24 },
componentProps: {
fieldNames: {
label: 'modelName',
value: 'businessId',
},
getPopupContainer: () => document.body,
},
},
];
......@@ -149,8 +149,3 @@ export const TreeData: any[] = [
parentId: 203,
},
];
......@@ -340,7 +340,16 @@
}
// 回退
function handleBack() {}
function handleBack() {
createConfirm({
iconType: 'warning',
title: '回退版本',
content: '确认回退至该版本?',
onOk() {
createMessage.success('回退成功!');
},
});
}
// 退出查看
function handleExitLook() {
setVersionFlag(false);
......
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