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

Merge remote-tracking branch 'origin/master'

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