Commit 55c55214 authored by 罗林杰's avatar 罗林杰

Merge remote-tracking branch 'origin/master'

parents 2def4cb4 4bca22f6
...@@ -383,42 +383,42 @@ export const DataStandardRoute: AppRouteRecordRaw = { ...@@ -383,42 +383,42 @@ export const DataStandardRoute: AppRouteRecordRaw = {
icon: '', icon: '',
}, },
}, },
{ // {
path: 'publicCode/detailPublicCode', // path: 'publicCode/detailPublicCode',
name: 'detailPublicCode', // name: 'detailPublicCode',
component: () => import('@/views/dataStandards/publicCode/detailPublicCode.vue'), // component: () => import('@/views/dataStandards/publicCode/detailPublicCode.vue'),
meta: { // meta: {
title: '公共代码详情', // title: '公共代码详情',
icon: '', // icon: '',
}, // },
}, // },
{ // {
path: 'publicCode/editDetail', // path: 'publicCode/editDetail',
name: 'editDetail', // name: 'editDetail',
component: () => import('@/views/dataStandards/publicCode/editDetail.vue'), // component: () => import('@/views/dataStandards/publicCode/editDetail.vue'),
meta: { // meta: {
title: '公共代码编辑', // title: '公共代码编辑',
icon: '', // icon: '',
}, // },
}, // },
{ // {
path: 'publicCode/publicCodeContrast', // path: 'publicCode/publicCodeContrast',
name: 'publicCodeContrast', // name: 'publicCodeContrast',
component: () => import('@/views/dataStandards/publicCode/publicCodeContrast.vue'), // component: () => import('@/views/dataStandards/publicCode/publicCodeContrast.vue'),
meta: { // meta: {
title: '公共代码对比', // title: '公共代码对比',
icon: '', // icon: '',
}, // },
}, // },
{ // {
path: 'publicCode/relatedRelationships', // path: 'publicCode/relatedRelationships',
name: 'relatedRelationships2', // name: 'relatedRelationships2',
component: () => import('@/views/dataStandards/publicCode/relatedRelationships.vue'), // component: () => import('@/views/dataStandards/publicCode/relatedRelationships.vue'),
meta: { // meta: {
title: '公共代码关联关系', // title: '公共代码关联关系',
icon: '', // icon: '',
}, // },
}, // },
], ],
}; };
......
...@@ -68,14 +68,14 @@ function getRightMenuList(node: EventDataNode): Promise<ContextMenuItem[]> { ...@@ -68,14 +68,14 @@ function getRightMenuList(node: EventDataNode): Promise<ContextMenuItem[]> {
icon: 'ant-design:snippets-outlined', icon: 'ant-design:snippets-outlined',
}, },
{ {
label: '新建文档分类', label: '新建名词分类',
handler: () => { handler: () => {
handleAddDocumentClassification(node) handleAddDocumentClassification(node)
}, },
icon: 'bi:plus', icon: 'bi:plus',
}, },
{ {
label: '新建文档管理', label: '新建名词',
handler: () => { handler: () => {
handleAddDocumentManage(node) handleAddDocumentManage(node)
}, },
...@@ -95,7 +95,13 @@ function getRightMenuList(node: EventDataNode): Promise<ContextMenuItem[]> { ...@@ -95,7 +95,13 @@ function getRightMenuList(node: EventDataNode): Promise<ContextMenuItem[]> {
}, },
icon: 'ant-design:rest-outlined', icon: 'ant-design:rest-outlined',
}, },
{
label: '移动',
handler: () => {
handleMove(node)
},
icon: 'ant-design:rest-outlined',
},
]; ];
return new Promise((resolve) => { return new Promise((resolve) => {
resolve(menu); resolve(menu);
...@@ -125,6 +131,9 @@ function handleCopy(data) { ...@@ -125,6 +131,9 @@ function handleCopy(data) {
} }
function handleDelete(data) { function handleDelete(data) {
}
function handleMove(data) {
} }
const treeData = ref<TreeItem[]>([]); const treeData = ref<TreeItem[]>([]);
......
...@@ -94,7 +94,7 @@ import {detailSchema1,} from './referenceDocument.data.ts'; ...@@ -94,7 +94,7 @@ import {detailSchema1,} from './referenceDocument.data.ts';
import {tableListTwo} from "./mock"; import {tableListTwo} from "./mock";
import {onMounted, ref} from "vue"; import {onMounted, ref} from "vue";
import {useRoute} from "vue-router"; import {useRoute} from "vue-router";
import VersionModal from './VersionModal.vue' import VersionModal from '@/views/dataStandards/basicStandards/VersionModal.vue'
import {useModal} from "@/components/Modal"; import {useModal} from "@/components/Modal";
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import { columnsTwo } from './referenceDocument.data'; import { columnsTwo } from './referenceDocument.data';
...@@ -153,7 +153,7 @@ const options = ref<any>([ ...@@ -153,7 +153,7 @@ const options = ref<any>([
/**编辑标准*/ /**编辑标准*/
function editButton(record) { function editButton(record) {
router.push({ router.push({
path: '/dataStandards/referenceDocument/edit', path: '/dataStandards/namingDictionary/edit',
}); });
} }
function handleImport() { function handleImport() {
......
...@@ -72,10 +72,10 @@ import {router} from "@/router"; ...@@ -72,10 +72,10 @@ import {router} from "@/router";
import { BasicTable, useTable, TableAction } from '@/components/Table'; import { BasicTable, useTable, TableAction } from '@/components/Table';
import { BasicForm, useForm } from '@/components/Form'; import { BasicForm, useForm } from '@/components/Form';
import {detailSchema2,} from './referenceDocument.data.ts'; import {detailSchema2,} from './referenceDocument.data.ts';
import {tableListTwo} from "./mock"; import {tableListTwo} from "./mock"
import {onMounted, ref} from "vue"; import {onMounted, ref} from "vue";
import {useRoute} from "vue-router"; import {useRoute} from "vue-router";
import VersionModal from './VersionModal.vue' import VersionModal from '@/views/dataStandards/basicStandards/VersionModal.vue'
import {useModal} from "@/components/Modal"; import {useModal} from "@/components/Modal";
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import { columnsTwo } from './referenceDocument.data'; import { columnsTwo } from './referenceDocument.data';
...@@ -132,7 +132,7 @@ const options = ref<any>([ ...@@ -132,7 +132,7 @@ const options = ref<any>([
/**编辑标准*/ /**编辑标准*/
function editButton(record) { function editButton(record) {
router.push({ router.push({
path: '/dataStandards/referenceDocument/details', path: '/dataStandards/namingDictionary/details',
}); });
} }
function handleDelete() {} function handleDelete() {}
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
<a-button :disabled="getRowSelection().selectedRowKeys <=0" type="primary" >复制到</a-button> <a-button :disabled="getRowSelection().selectedRowKeys <=0" type="primary" >复制到</a-button>
<a-button :disabled="getRowSelection().selectedRowKeys <=0" type="primary" @click="handleDeleteIds" >删除</a-button> <a-button :disabled="getRowSelection().selectedRowKeys <=0" type="primary" @click="handleDeleteIds" >删除</a-button>
<a-button :disabled="getRowSelection().selectedRowKeys <=0" type="primary" >移动</a-button> <a-button :disabled="getRowSelection().selectedRowKeys <=0" type="primary" >移动</a-button>
<a-button :disabled="getRowSelection().selectedRowKeys <=0" type="primary" >导出</a-button> <a-button :disabled="getRowSelection().selectedRowKeys <=0" type="primary" >导出命名字典</a-button>
<a-button :disabled="getRowSelection().selectedRowKeys <=0" type="primary" >批量发布</a-button> <a-button :disabled="getRowSelection().selectedRowKeys <=0" type="primary" >批量发布</a-button>
<a-button type="primary" @click="handleAddDocumentClassification" >新增文档分类</a-button> <a-button type="primary" @click="handleAddDocumentClassification" >新增名词分类</a-button>
<a-button :disabled="getRowSelection().selectedRowKeys <=0" @click="handleAddManage" type="primary" >新增文档管理</a-button> <a-button :disabled="getRowSelection().selectedRowKeys <=0" @click="handleAddManage" type="primary" >新增名词</a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
...@@ -102,7 +102,7 @@ const [registerTable, { reload, updateTableDataRecord, getSearchInfo,getForm,get ...@@ -102,7 +102,7 @@ const [registerTable, { reload, updateTableDataRecord, getSearchInfo,getForm,get
return info; return info;
}, },
actionColumn: { actionColumn: {
width: 200, width: 230,
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
// slots: { customRender: 'action' }, // slots: { customRender: 'action' },
...@@ -145,7 +145,7 @@ async function handleExport() { ...@@ -145,7 +145,7 @@ async function handleExport() {
} }
function handleView(record: Recordable) { function handleView(record: Recordable) {
router.push({ router.push({
path: '/dataStandards/referenceDocument/details', path: '/dataStandards/namingDictionary/details',
}); });
} }
/**关联关系*/ /**关联关系*/
......
<template> <template>
<BasicModal width="40%" v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit"> <BasicModal width="40%" v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit">
<BasicForm @register="registerForm" /> <BasicForm @register="registerForm" />
<div class="modalRow">
<div>可见范围</div>
<div class="right">
<div class="clearAll">
清空
</div>
<div>
<a-button type="primary">添加工作组</a-button>
</div>
</div>
</div>
<div class="addDialogBG">
<TreeTwo class="w-1/4 xl:w-1/5" @select="handleSelect" />
</div>
</BasicModal> </BasicModal>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
......
export const tableList: any[] = [ export const tableList: any[] = [
{ {
businessId: 1, businessId: 1,
name: '目录示例', name: '一般用户',
num: '111', englishName: '--',
flag: '已发布', abbreviation: '--',
group: '默认工作组', flag: '--',
group: '共享工作组',
}, },
{ {
businessId: 2, businessId: 2,
name: '目录示例', name: '一般用户',
num: '222', englishName: '--',
flag: '已发布', abbreviation: '--',
group: '默认工作组', flag: '--',
group: '共享工作组',
}, },
{ {
businessId: 3, businessId: 3,
name: '目录示例', name: '一般用户',
num: '333', englishName: '--',
flag: '已发布', abbreviation: '--',
group: '默认工作组', flag: '--',
group: '共享工作组',
}, },
{ {
businessId: 4, businessId: 4,
name: '目录示例', name: '一般用户',
num: '444', englishName: '--',
flag: '已发布', abbreviation: '--',
group: '默认工作组', flag: '--',
group: '共享工作组',
}, },
{ {
businessId: 5, businessId: 5,
name: '目录示例', name: '一般用户',
num: '555', englishName: '--',
flag: '已发布', abbreviation: '--',
group: '默认工作组', flag: '--',
group: '共享工作组',
}, },
] ]
export const treeDataList = [ export const treeDataList = [
{ {
label: '引用文档管理', label: '命名字典',
value: 1, value: 1,
icon: 'home|svg', icon: 'home|svg',
children: [ children: [
{ label: '共享工作区', value: 2 }, {
{ label: '商城工作区', value: 3 }, label: 'admin_个人工作区',
{ label: '数据中台工作区02', value: 4 }, value: 2,
{ label: '数据中台工作区03', value: 5 }, icon: 'home|svg',
children: [
{ label: '企业',
value: 3,
icon: 'home|svg',
children: [
{ label: '企业号',
value: 4,
},
],
},
],
},
], ],
}, },
] ]
......
...@@ -22,13 +22,18 @@ export const columnsTwo: BasicColumn[] = [ ...@@ -22,13 +22,18 @@ export const columnsTwo: BasicColumn[] = [
] ]
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
title: '文档名称', title: '文件中文名',
dataIndex: 'name', dataIndex: 'name',
width: 120, width: 120,
}, },
{ {
title: '文档编号', title: '文件英文全称',
dataIndex: 'num', dataIndex: 'englishName',
width: 120,
},
{
title: '名词英文简称',
dataIndex: 'abbreviation',
width: 120, width: 120,
}, },
{ {
...@@ -41,26 +46,34 @@ export const columns: BasicColumn[] = [ ...@@ -41,26 +46,34 @@ export const columns: BasicColumn[] = [
dataIndex: 'group', dataIndex: 'group',
width: 120, width: 120,
}, },
]; ];
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{ {
field: 'name', field: 'name',
label: '文档名称', label: '名词中文名',
component: 'Input', component: 'Input',
colProps: { span: 8 }, colProps: { span: 6 },
componentProps: { componentProps: {
placeholder: '输入文档名称', placeholder: '输入名词中文名',
}, },
}, },
{ {
field: 'num', field: 'english',
label: '文档编号', label: '名词英文名',
component: 'Input', component: 'Input',
colProps: { span: 8 }, colProps: { span: 6 },
componentProps: {
placeholder: '输入名词英文名',
},
},
{
field: 'abbreviation',
label: '名词英文简称',
component: 'Input',
colProps: { span: 6 },
componentProps: { componentProps: {
placeholder: '输入文档编号', placeholder: '输入名词英文简称',
}, },
}, },
]; ];
...@@ -89,12 +102,12 @@ export const formSchema: FormSchema[] = [ ...@@ -89,12 +102,12 @@ export const formSchema: FormSchema[] = [
}, },
{ {
field: 'name', field: 'name',
label: '文档分类名称', label: '名词分类名称',
component: 'Input', component: 'Input',
rules: [ rules: [
{ {
required: true, required: true,
message: '请输入文档分类名称', message: '请输入名词分类名称',
}, },
], ],
}, },
...@@ -128,29 +141,6 @@ export const formSchema: FormSchema[] = [ ...@@ -128,29 +141,6 @@ export const formSchema: FormSchema[] = [
}, },
}, },
}, },
{
field: 'flag',
label: '权限模式',
component: 'RadioGroup',
colProps: { lg: 24, md: 24 },
componentProps: {
options: [
{ label: '本级定义', value: '1' },
{ label: '资源自定义', value: '0' },
],
},
},
{
field: 'group',
label: '权属工作组',
component: 'Select',
componentProps: {
options: [
{ label: '默认工作组', value: '1' },
{ label: '默认工作组2', value: '0' },
],
},
},
] ]
export const formSchemaManage: FormSchema[] = [ export const formSchemaManage: FormSchema[] = [
...@@ -175,12 +165,12 @@ export const formSchemaManage: FormSchema[] = [ ...@@ -175,12 +165,12 @@ export const formSchemaManage: FormSchema[] = [
}, },
{ {
field: 'name', field: 'name',
label: '文档名称', label: '名词中文名',
component: 'Input', component: 'Input',
rules: [ rules: [
{ {
required: true, required: true,
message: '请输入文档分类名称', message: '请输入名词中文名',
}, },
], ],
}, },
...@@ -188,7 +178,7 @@ export const formSchemaManage: FormSchema[] = [ ...@@ -188,7 +178,7 @@ export const formSchemaManage: FormSchema[] = [
field: 'type', field: 'type',
label: '标准类型', label: '标准类型',
component: 'Input', component: 'Input',
defaultValue:'引用文档管理', defaultValue:'命名字典',
componentProps: { componentProps: {
readonly: true, readonly: true,
disabled: true, disabled: true,
......
<template> <template>
<BasicModal width="40%" v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit"> <BasicModal width="40%" v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit">
<BasicForm @register="registerForm" /> <BasicForm @register="registerForm" />
<div class="modalRow">
<div>可见范围</div>
<div class="right">
<div class="clearAll">
清空
</div>
<div>
<a-button type="primary">添加工作组</a-button>
</div>
</div>
</div>
<div class="addDialogBG">
<TreeTwo class="w-1/4 xl:w-1/5" @select="handleSelect" />
</div>
</BasicModal> </BasicModal>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
......
...@@ -3,10 +3,9 @@ ...@@ -3,10 +3,9 @@
<BasicTree <BasicTree
ref="treeRef" ref="treeRef"
treeWrapperClassName="h-[calc(100%-35px)] overflow-auto" treeWrapperClassName="h-[calc(100%-35px)] overflow-auto"
:clickRowToExpand="true"
:defaultExpandAll="true" :defaultExpandAll="true"
:treeData="treeData" :fieldNames="{ key: 'key', title: 'title' }"
:fieldNames="{ key: 'businessId', title: 'modelName' }" :treeData="TreeData"
@select="handleSelect" @select="handleSelect"
/> />
</div> </div>
...@@ -21,57 +20,9 @@ ...@@ -21,57 +20,9 @@
const emit = defineEmits(['select']); const emit = defineEmits(['select']);
const treeData = ref<TreeItem[]>([]);
const treeRef = ref<Nullable<TreeActionType>>(null); const treeRef = ref<Nullable<TreeActionType>>(null);
function getTree() {
const tree = unref(treeRef);
if (!tree) {
throw new Error('tree is null!');
}
return tree;
}
async function fetch() {
const data = TreeData;
treeData.value = handleTree(data, 'businessId', undefined, undefined, undefined);
await nextTick(() => {
getTree().expandAll(true);
});
}
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;
}
function handleSelect(keys) { function handleSelect(keys) {
emit('select', keys[0]); emit('select', keys[0]);
} }
onMounted(() => {
fetch();
});
</script> </script>
...@@ -4,28 +4,70 @@ ...@@ -4,28 +4,70 @@
<BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo"> <BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleVersion">转换记录</a-button> <a-button type="primary" @click="handleVersion">转换记录</a-button>
<a-button type="primary" :disabled="getRowSelection().selectedRowKeys <=0" @click="handleTurnPhy">转物理模型</a-button> <a-button
<a-button type="primary" :disabled="getRowSelection().selectedRowKeys <=0" @click="handleWaitUpload">设为待发布</a-button> type="primary"
<a-button type="primary" :disabled="getRowSelection().selectedRowKeys <=0">发布</a-button> :disabled="getRowSelection().selectedRowKeys <= 0"
<a-button type="primary" :disabled="getRowSelection().selectedRowKeys <=0" @click="handleImport">导入</a-button> @click="handleTurnPhy"
>转物理模型</a-button
>
<a-button
type="primary"
:disabled="getRowSelection().selectedRowKeys <= 0"
@click="handleWaitUpload"
>设为待发布</a-button
>
<a-button type="primary" :disabled="getRowSelection().selectedRowKeys <= 0">发布</a-button>
<a-button
type="primary"
:disabled="getRowSelection().selectedRowKeys <= 0"
@click="handleImport"
>导入</a-button
>
<a-button type="primary" @click="handleExport">导出</a-button> <a-button type="primary" @click="handleExport">导出</a-button>
<a-button type="primary" @click="handleCreateFile">新建文件夹</a-button> <!-- <a-button type="primary" @click="handleCreateFile">新建文件夹</a-button>-->
<a-button type="primary" @click="handleCreateModel">新建文件</a-button> <a-button type="primary" v-if="modelLevel > 1" @click="handleCreateModel"
<a-button type="primary" :disabled="getRowSelection().selectedRowKeys <=0" @click="handleDelete">删除</a-button> >新建文件</a-button
>
<a-button
type="primary"
:disabled="getRowSelection().selectedRowKeys <= 0"
@click="handleDelete"
>删除</a-button
>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<TableAction <TableAction
:actions="[ :actions="
{ modelLevel > 1
icon: 'clarity:note-edit-line', ? [
onClick: handleEdit.bind(null, record), {
}, icon: 'clarity:contract-line',
{ onClick: goEdit.bind(null, record),
icon: 'ion:ellipsis-horizontal-outline', },
onClick: handleMove.bind(null, record), {
}, // 重命名
]" icon: 'ant-design:edit-outlined',
onClick: handleRename.bind(null, record),
},
{
// 删除
icon: 'ant-design:delete-outlined',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleRemove.bind(null, record),
},
color: 'error',
},
]
: [
{
icon: 'clarity:note-edit-line',
onClick: handleEdit.bind(null, record),
},
]
"
/> />
</template> </template>
</template> </template>
...@@ -37,6 +79,7 @@ ...@@ -37,6 +79,7 @@
<ModelEdit @register="registerModelEdit" @success="handleSuccess" /> <ModelEdit @register="registerModelEdit" @success="handleSuccess" />
<ImportModel @register="importModel" @success="handleSuccess" /> <ImportModel @register="importModel" @success="handleSuccess" />
<TurnPhysicalModel @register="turnPhysicalModel" @success="handleSuccess" /> <TurnPhysicalModel @register="turnPhysicalModel" @success="handleSuccess" />
<RenameModel @register="renameModel" @success="handleSuccess" />
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -52,9 +95,10 @@ ...@@ -52,9 +95,10 @@
import { columns, searchFormSchema } from './model.data'; import { columns, searchFormSchema } from './model.data';
import { useGo } from '@/hooks/web/usePage'; import { useGo } from '@/hooks/web/usePage';
import { useFilterStore } from '@/store/modules/filterData'; import { useFilterStore } from '@/store/modules/filterData';
import { TreeData } from '@/views/dataWarehousePlanning/logicalModel/modelData'; import { logicalData, TreeData } from '@/views/dataWarehousePlanning/logicalModel/modelData';
import ImportModel from './importModel.vue'; import ImportModel from './importModel.vue';
import TurnPhysicalModel from '@/views/dataWarehousePlanning/logicalModel/modelDetail/turnPhysicalModel.vue'; import TurnPhysicalModel from '@/views/dataWarehousePlanning/logicalModel/modelDetail/turnPhysicalModel.vue';
import RenameModel from './renameModel.vue';
defineOptions({ name: 'AccountManagement' }); defineOptions({ name: 'AccountManagement' });
const { createMessage, createConfirm } = useMessage(); const { createMessage, createConfirm } = useMessage();
...@@ -68,11 +112,13 @@ ...@@ -68,11 +112,13 @@
const [registerAddUserModal, { openModal: addUserModal }] = useModal(); const [registerAddUserModal, { openModal: addUserModal }] = useModal();
const [registerMoveUser, { openModal: openMoveUserModal }] = useModal(); const [registerMoveUser, { openModal: openMoveUserModal }] = useModal();
const [turnPhysicalModel, { openModal: openTurnPhysicalModel }] = useModal(); const [turnPhysicalModel, { openModal: openTurnPhysicalModel }] = useModal();
const [renameModel, { openModal: openRenameModel }] = useModal();
const searchInfo = reactive<Recordable>({}); const searchInfo = reactive<Recordable>({});
const tableData = ref([]); const tableData = ref([]);
let modelLevel = ref(1);
const [ const [
registerTable, registerTable,
{ reload, updateTableDataRecord, getSearchInfo, getForm, getRowSelection }, { reload, updateTableDataRecord, setTableData, getSearchInfo, getForm, getRowSelection },
] = useTable({ ] = useTable({
title: '逻辑模型', title: '逻辑模型',
api: async (params) => { api: async (params) => {
...@@ -89,7 +135,7 @@ ...@@ -89,7 +135,7 @@
//过滤data中的数据,取出等于params.deptId的数据 //过滤data中的数据,取出等于params.deptId的数据
//按照部门筛选 如果有进行过滤相应部门的 没有就赋值全部 //按照部门筛选 如果有进行过滤相应部门的 没有就赋值全部
let data = []; let data = [];
data = tableData.value.filter((item) => item.businessId !== 100); data = tableData.value.filter((item) => item.type === 'theme');
return { ...response, data: data }; return { ...response, data: data };
}, },
rowKey: 'businessId', rowKey: 'businessId',
...@@ -155,14 +201,9 @@ ...@@ -155,14 +201,9 @@
}); });
} }
/** 移动按钮*/ function handleRemove(record) {
function handleMove(record: Recordable) { createMessage.success('删除成功!');
openMoveUserModal(true, {
record,
isMove: true,
});
} }
/** 编辑按钮*/ /** 编辑按钮*/
function handleEdit(record: Recordable) { function handleEdit(record: Recordable) {
openEditUserModal(true, { openEditUserModal(true, {
...@@ -213,6 +254,12 @@ ...@@ -213,6 +254,12 @@
query: record, query: record,
}); });
} }
function handleRename(record) {
openRenameModel(true, {
record,
isUpdate: true,
});
}
/** 移动*/ /** 移动*/
function handleMoveSuccess({ isMove, values }) { function handleMoveSuccess({ isMove, values }) {
const rowSelection = getRowSelection().selectedRowKeys; const rowSelection = getRowSelection().selectedRowKeys;
...@@ -229,9 +276,21 @@ ...@@ -229,9 +276,21 @@
} }
/** 部门树的select*/ /** 部门树的select*/
function handleSelect(modelId = '') { function handleSelect(key) {
searchInfo.modelId = modelId; if (key !== null && key !== undefined) {
reload(); modelLevel.value = key.split('-').length - 1;
} else {
modelLevel.value = 0;
}
if (modelLevel.value > 0) {
const regex = new RegExp(key, 'i');
const data = tableData.value.filter((item) => item.type === 'model' && regex.test(item.themeId));
setTableData(data);
} else {
const regex = new RegExp(key, 'i');
const data = tableData.value.filter((item) => item.type === 'theme' && regex.test(item.themeId));
setTableData(data);
}
} }
function handleView(record: Recordable) { function handleView(record: Recordable) {
...@@ -248,7 +307,7 @@ ...@@ -248,7 +307,7 @@
} }
onMounted(() => { onMounted(() => {
tableData.value = TreeData; tableData.value = logicalData;
const path = route.path; const path = route.path;
if (filterStore.getSearchParams[path]) { if (filterStore.getSearchParams[path]) {
if (JSON.parse(filterStore.getSearchParams[path] !== {})) { if (JSON.parse(filterStore.getSearchParams[path] !== {})) {
......
...@@ -108,11 +108,23 @@ export const modelFormSchema: any[] = [ ...@@ -108,11 +108,23 @@ export const modelFormSchema: any[] = [
colProps: { lg: 24, md: 24 }, colProps: { lg: 24, md: 24 },
}, },
]; ];
export const renameFormSchema = [
{
field: 'modelName',
label: '名称',
required: true,
component: 'Input',
colProps: { lg: 24, md: 24 },
},
];
export const editFormSchema: any[] = [ export const editFormSchema: any[] = [
{ {
field: 'modelName', field: 'modelName',
label: '文件夹名称', label: '文件夹名称',
component: 'Input', component: 'Input',
componentProps: {
disabled: true,
},
colProps: { lg: 24, md: 24 }, colProps: { lg: 24, md: 24 },
rules: [ rules: [
{ {
...@@ -128,16 +140,24 @@ export const editFormSchema: any[] = [ ...@@ -128,16 +140,24 @@ export const editFormSchema: any[] = [
componentProps: { componentProps: {
options: [ options: [
{ {
label: '知识库模型1', label: '概念元模型',
value: '101', value: '概念元模型',
},
{
label: '默认元模型',
value: '默认元模型',
},
{
label: 'rac元模型',
value: 'rac元模型',
}, },
{ {
label: '知识库模型2', label: 'cor元模型',
value: '102', value: 'cor元模型',
}, },
{ {
label: '知识库模型3', label: 'acc元模型',
value: '103', value: 'acc元模型',
}, },
], ],
getPopupContainer: () => document.body, getPopupContainer: () => document.body,
......
...@@ -7,75 +7,131 @@ import { changeFlagApi } from '@/api/system/user/user'; ...@@ -7,75 +7,131 @@ import { changeFlagApi } from '@/api/system/user/user';
// 引入开关组件 // 引入开关组件
type CheckedType = boolean | string | number; type CheckedType = boolean | string | number;
export const TreeData: any[] = [ export const TreeData = [
{
key: '1',
title: '主体域',
level: '0',
children: [
{
key: '1-1',
title: '一级主体域1',
level: '1',
children: [
{ key: '1-1-1', title: '二级主体域1', level: '2' },
{ key: '1-1-2', title: '二级主体域2', level: '2' },
],
},
{
key: '1-2',
title: '一级主体域2',
level: '1',
children: [
{ key: '1-2-1', title: '二级主体域3', level: '2' },
{ key: '1-2-2', title: '二级主体域4', level: '2' },
],
},
{
key: '1-3',
title: '一级主体域3',
level: '1',
children: [
{ key: '1-3-1', title: '二级主体域3', level: '2' },
{ key: '1-3-2', title: '二级主体域4', level: '2' },
],
},
],
},
];
export const logicalData: any[] = [
{ {
delFlag: '0', modelName: '逻辑模型1',
flag: '1', EngName: 'modelOne',
businessId: 100, describe: '逻辑模型1,数据多',
modelName: '知识库模型', workArea: '默认工作组',
parentId: 0, createDate: '2024-10-24 10:04:04',
'code:': '001', updateDate: '2024-10-24 10:04:04',
ancestors: '0',
orderNum: 0,
holder: 'admin', holder: 'admin',
type: 'model',
themeId: '1-1-1',
},
{
modelName: '逻辑模型2',
EngName: 'modelTwo',
describe: '逻辑模型2,数据少',
workArea: '默认工作组',
createDate: '2024-10-24 10:04:04', createDate: '2024-10-24 10:04:04',
updateDate: '2024-10-24 10:04:04', updateDate: '2024-10-24 10:04:04',
// "children" : [ ], holder: 'admin',
selectType: null, type: 'model',
themeId: '1-1-1',
}, },
{ {
delFlag: '0', modelName: '逻辑模型3',
flag: '1', EngName: 'modelThree',
businessId: 101, describe: '逻辑模型3,数据很多',
modelName: '知识库模型1', workArea: '默认工作组',
EngName:'modelOne', createDate: '2024-10-24 10:04:04',
describe:'知识库模型1,数据多', updateDate: '2024-10-24 10:04:04',
workArea:'默认工作组',
parentId: 100,
'code:': '002',
ancestors: '0,100',
orderNum: 1,
// "children" : [ ],
selectType: null,
holder: 'admin', holder: 'admin',
type: 'model',
themeId: '1-1-2',
},
{
modelName: '逻辑模型4',
EngName: 'model4',
describe: '逻辑模型4,数据少',
workArea: '默认工作组',
createDate: '2024-10-24 10:04:04', createDate: '2024-10-24 10:04:04',
updateDate: '2024-10-24 10:04:04', updateDate: '2024-10-24 10:04:04',
holder: 'admin',
type: 'model',
themeId: '1-1-2',
}, },
{ {
delFlag: '0', modelName: '逻辑模型5',
flag: '1', EngName: 'model5',
businessId: 102, describe: '逻辑模型5,数据很多',
modelName: '知识库模型2', workArea: '默认工作组',
EngName:'modelTwo', createDate: '2024-10-24 10:04:04',
describe:'知识库模型2,数据少', updateDate: '2024-10-24 10:04:04',
workArea:'默认工作组',
parentId: 100,
'code:': '002',
ancestors: '0,100',
orderNum: 1,
// "children" : [ ],
selectType: null,
holder: 'admin', holder: 'admin',
type: 'model',
themeId: '1-2-1',
},
{
modelName: '一级主体域1',
EngName: 'themeOne',
describe: '知识库模型3,数据很多',
workArea: '默认工作组',
createDate: '2024-10-24 10:04:04', createDate: '2024-10-24 10:04:04',
updateDate: '2024-10-24 10:04:04', updateDate: '2024-10-24 10:04:04',
holder: 'admin',
type: 'theme',
themeId: '1-1',
}, },
{ {
delFlag: '0', modelName: '一级主体域2',
flag: '1', EngName: 'themeTwo',
businessId: 103, describe: '知识库模型3,数据很多',
modelName: '知识库模型3', workArea: '默认工作组',
EngName:'modelThree', createDate: '2024-10-24 10:04:04',
describe:'知识库模型3,数据很多', updateDate: '2024-10-24 10:04:04',
workArea:'默认工作组',
parentId: 100,
'code:': '002',
ancestors: '0,100',
orderNum: 1,
// "children" : [ ],
selectType: null,
holder: 'admin', holder: 'admin',
type: 'theme',
themeId: '1-2',
},
{
modelName: '一级主体域3',
EngName: 'themeThree',
describe: '知识库模型3,数据很多',
workArea: '默认工作组',
createDate: '2024-10-24 10:04:04', createDate: '2024-10-24 10:04:04',
updateDate: '2024-10-24 10:04:04', updateDate: '2024-10-24 10:04:04',
holder: 'admin',
type: 'theme',
themeId: '1-3',
}, },
]; ];
......
<template>
<BasicModal
width="40%"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, unref } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { renameFormSchema } from './model.data';
import { useMessage } from '@/hooks/web/useMessage';
const emit = defineEmits(['success', 'register']);
const isUpdate = ref(true);
const isMove = ref(false);
const rowId = ref('');
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 12, md: 24 },
schemas: renameFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
isMove.value = !!data?.isMove;
if (unref(isUpdate)) {
// 获取行数据的id
rowId.value = data.record.businessId;
// 塞值
setFieldsValue({
...data.record,
});
}
});
const getTitle = '重命名';
/**确定按钮*/
async function handleSubmit() {
await validate();
closeModal();
}
</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