Commit bbaa98d0 authored by liwei's avatar liwei

物理模型页面

parent e6147095
<template>
<PageWrapper
:title="`用户` + userId + `的资料`"
content="这是用户资料详情页面。本页面仅用于演示相同路由在tab中打开多个页面并且显示不同的数据"
contentBackground
@back="goBack"
>
<template #extra>
<a-button type="primary" danger> 禁用账号 </a-button>
<a-button type="primary"> 修改密码 </a-button>
</template>
<template #footer>
<a-tabs default-active-key="detail" v-model:activeKey="currentKey">
<a-tab-pane key="detail" tab="用户资料" />
<a-tab-pane key="logs" tab="操作日志" />
</a-tabs>
</template>
<div class="pt-4 m-4 desc-wrap">
<template v-if="currentKey == 'detail'">
<div v-for="i in 10" :key="i">这是用户{{ userId }}资料Tab</div>
</template>
<template v-if="currentKey == 'logs'">
<div v-for="i in 10" :key="i">这是用户{{ userId }}操作日志Tab</div>
</template>
</div>
</PageWrapper>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { useRoute } from 'vue-router';
import { PageWrapper } from '@/components/Page';
import { useGo } from '@/hooks/web/usePage';
import { useTabs } from '@/hooks/web/useTabs';
import { Tabs } from 'ant-design-vue';
defineOptions({ name: 'AccountDetail' });
const ATabs = Tabs;
const ATabPane = Tabs.TabPane;
const route = useRoute();
const go = useGo();
// 此处可以得到用户ID
const userId = ref(route.params?.id);
const currentKey = ref('detail');
const { setTitle } = useTabs();
// TODO
// 本页代码仅作演示,实际应当通过userId从接口获得用户的相关资料
// 设置Tab的标题(不会影响页面标题)
setTitle('详情:用户' + userId.value);
// 页面左侧点击返回链接时的操作
function goBack() {
// 本例的效果时点击返回始终跳转到账号列表页,实际应用时可返回上一页
go('/system/account');
}
</script>
<style></style>
<template>
<BasicTable @register="registerTable4" class="height">
<template #toolbar>
<a-input style="width: 200px;margin-right: auto" default-value="分区信息" allowClear></a-input>
<a-button type="primary" @click="handleCreateFile">展示</a-button>
<a-button type="primary" @click="addProperty()">添加属性</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
color: 'error',
label: '删除',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record),
},
},
]"
/>
</template>
</template>
</BasicTable>
</template>
<script lang="ts" setup>
import { reactive,unref,onDeactivated,onMounted,ref } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import {getAccountList, deleteUser,exportUserList} from '@/api/system/user/user';
import { PageWrapper } from '@/components/Page';
import ModelTree from './ModelTree.vue';
import { useMessage } from '@/hooks/web/useMessage';
import { useModal } from '@/components/Modal';
import ModelModal from './modelModal.vue';
import { columns,searchFormSchema } from './editModel.data';
import { useGo } from '@/hooks/web/usePage';
import { useRoute,onBeforeRouteLeave } from 'vue-router';
import { useFilterStore } from '@/store/modules/filterData';
import {editTableData,editBucketData,editAreaData,editColumnData} from "@/views/metaModel/physicsModel/modelData";
import {router} from "@/router";
import AddTypeModal from './addTypeModal.vue';
defineOptions({ name: 'AccountManagement' });
const { createMessage } = useMessage();
const filterStore = useFilterStore();
const route = useRoute();
const go = useGo();
const [registerModal, { openModal }] = useModal();
const [registerAddUserModal, { openModal:addUserModal }] = useModal();
const [registerMoveUser, { openModal: openMoveUserModal }] = useModal();
const searchInfo = reactive<Recordable>({});
const areaTableData = ref([])
const [registerTable4, { reload, updateTableDataRecord4, getSearchInfo4,getForm4,getRowSelection4 }] = useTable({
title: '',
api: async (params) => {
console.log('params:',params)
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: areaTableData.value.length,
code:'',
message:'',
data: [],
};
//过滤data中的数据,取出等于params.deptId的数据
var data = []
//按照部门筛选 如果有进行过滤相应部门的 没有就赋值全部
var data = [];
data = areaTableData.value.filter((item) => item.businessId !== 100);
return { ...response, data: data };
},
columns,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter: true,
},
useSearchForm: false,
showTableSetting: false,
showIndexColumn: false,
pagination: false,
bordered: true,
handleSearchInfoFn(info) {
return info;
},
actionColumn: {
width: 150,
title: '操作',
dataIndex: 'action',
},
});
/** 新增元模型*/
function handleCreateModel() {
openModal(true, {
isUpdate: false,
});
}
/** 新增文件夹*/
function handleCreateFile() {
openModal(true, {
isUpdate: false,
});
}
/** 编辑按钮*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
});
}
/** 保存*/
function save() {
createMessage.success('保存成功!')
}
/** 添加类别*/
function handleCreateType() {
openModal(true, {
});
}
/** 取消*/
function cancel() {
go('/metaModel/physicsModel/index');
}
/** 删除按钮*/
function handleDelete(record: Recordable) {
createMessage.success('删除成功!');
}
/** 新增/编辑成功*/
function handleSuccess({ isUpdate, values }) {
}
/**新增属性*/
function addProperty(type) {
const data = {
"businessId" : '',
"name" : "",
"description": '',
"englishName": '',
"isWrite": '0',
"isShow": '0',
"type": '1',
}
areaTableData.value.push(data)
reload()
}
onMounted(() => {
areaTableData.value = editAreaData
});
// 页面左侧点击返回链接时的操作
function goBack() {
// 本例的效果时点击返回始终跳转到账号列表页,实际应用时可返回上一页
go('/metaModel/physicsModel/index');
}
</script>
<template>
<BasicTable @register="registerTable4" class="height">
<template #toolbar>
<a-input style="width: 200px;margin-right: auto" default-value="分桶信息" allowClear></a-input>
<a-button type="primary" @click="handleCreateFile">展示</a-button>
<a-button type="primary" @click="addProperty()">添加属性</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
color: 'error',
label: '删除',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record),
},
},
]"
/>
</template>
</template>
</BasicTable>
</template>
<script lang="ts" setup>
import { reactive,unref,onDeactivated,onMounted,ref } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import {getAccountList, deleteUser,exportUserList} from '@/api/system/user/user';
import { PageWrapper } from '@/components/Page';
import ModelTree from './ModelTree.vue';
import { useMessage } from '@/hooks/web/useMessage';
import { useModal } from '@/components/Modal';
import ModelModal from './modelModal.vue';
import { columns,searchFormSchema } from './editModel.data';
import { useGo } from '@/hooks/web/usePage';
import { useRoute,onBeforeRouteLeave } from 'vue-router';
import { useFilterStore } from '@/store/modules/filterData';
import {editTableData,editBucketData,editAreaData,editColumnData} from "@/views/metaModel/physicsModel/modelData";
import {router} from "@/router";
import AddTypeModal from './addTypeModal.vue';
defineOptions({ name: 'AccountManagement' });
const { createMessage } = useMessage();
const filterStore = useFilterStore();
const route = useRoute();
const go = useGo();
const [registerModal, { openModal }] = useModal();
const [registerAddUserModal, { openModal:addUserModal }] = useModal();
const [registerMoveUser, { openModal: openMoveUserModal }] = useModal();
const searchInfo = reactive<Recordable>({});
const bucketTableData = ref([])
const [registerTable4, { reload, updateTableDataRecord4, getSearchInfo4,getForm4,getRowSelection4 }] = useTable({
title: '',
api: async (params) => {
console.log('params:',params)
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: bucketTableData.value.length,
code:'',
message:'',
data: [],
};
//过滤data中的数据,取出等于params.deptId的数据
var data = []
//按照部门筛选 如果有进行过滤相应部门的 没有就赋值全部
var data = [];
data = bucketTableData.value.filter((item) => item.businessId !== 100);
return { ...response, data: data };
},
columns,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter: true,
},
useSearchForm: false,
showTableSetting: false,
showIndexColumn: false,
pagination: false,
bordered: true,
handleSearchInfoFn(info) {
return info;
},
actionColumn: {
width: 150,
title: '操作',
dataIndex: 'action',
},
});
/** 新增元模型*/
function handleCreateModel() {
openModal(true, {
isUpdate: false,
});
}
/** 新增文件夹*/
function handleCreateFile() {
openModal(true, {
isUpdate: false,
});
}
/** 编辑按钮*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
});
}
/** 保存*/
function save() {
createMessage.success('保存成功!')
}
/** 添加类别*/
function handleCreateType() {
openModal(true, {
});
}
/** 取消*/
function cancel() {
go('/metaModel/physicsModel/index');
}
/** 删除按钮*/
function handleDelete(record: Recordable) {
createMessage.success('删除成功!');
}
/** 新增/编辑成功*/
function handleSuccess({ isUpdate, values }) {
}
/**新增属性*/
function addProperty(type) {
const data = {
"businessId" : '',
"name" : "",
"description": '',
"englishName": '',
"isWrite": '0',
"isShow": '0',
"type": '1',
}
bucketTableData.value.push(data)
reload()
}
onMounted(() => {
bucketTableData.value = editBucketData
});
// 页面左侧点击返回链接时的操作
function goBack() {
// 本例的效果时点击返回始终跳转到账号列表页,实际应用时可返回上一页
go('/metaModel/physicsModel/index');
}
</script>
<template>
<BasicTable @register="registerTable4" class="height">
<template #toolbar>
<a-input style="width: 200px;margin-right: auto" default-value="列信息" allowClear></a-input>
<a-button type="primary" @click="handleCreateFile">展示</a-button>
<a-button type="primary" @click="addProperty()">添加属性</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
color: 'error',
label: '删除',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record),
},
},
]"
/>
</template>
</template>
</BasicTable>
</template>
<script lang="ts" setup>
import { reactive,unref,onDeactivated,onMounted,ref } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import {getAccountList, deleteUser,exportUserList} from '@/api/system/user/user';
import { PageWrapper } from '@/components/Page';
import ModelTree from './ModelTree.vue';
import { useMessage } from '@/hooks/web/useMessage';
import { useModal } from '@/components/Modal';
import ModelModal from './modelModal.vue';
import { columns,searchFormSchema } from './editModel.data';
import { useGo } from '@/hooks/web/usePage';
import { useRoute,onBeforeRouteLeave } from 'vue-router';
import { useFilterStore } from '@/store/modules/filterData';
import {editTableData,editBucketData,editAreaData,editColumnData} from "@/views/metaModel/physicsModel/modelData";
import {router} from "@/router";
import AddTypeModal from './addTypeModal.vue';
defineOptions({ name: 'AccountManagement' });
const { createMessage } = useMessage();
const filterStore = useFilterStore();
const route = useRoute();
const go = useGo();
const [registerModal, { openModal }] = useModal();
const [registerAddUserModal, { openModal:addUserModal }] = useModal();
const [registerMoveUser, { openModal: openMoveUserModal }] = useModal();
const searchInfo = reactive<Recordable>({});
const tableData = ref([])
const bucketTableData = ref([])
const areaTableData = ref([])
const columnTableData = ref([])
const [registerTable4, { reload, updateTableDataRecord4, getSearchInfo4,getForm4,getRowSelection4 }] = useTable({
title: '',
api: async (params) => {
console.log('params:',params)
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: columnTableData.value.length,
code:'',
message:'',
data: [],
};
//过滤data中的数据,取出等于params.deptId的数据
var data = []
//按照部门筛选 如果有进行过滤相应部门的 没有就赋值全部
var data = [];
data = columnTableData.value.filter((item) => item.businessId !== 100);
return { ...response, data: data };
},
columns,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter: true,
},
useSearchForm: false,
showTableSetting: false,
showIndexColumn: false,
pagination: false,
bordered: true,
handleSearchInfoFn(info) {
return info;
},
actionColumn: {
width: 150,
title: '操作',
dataIndex: 'action',
},
});
/** 新增元模型*/
function handleCreateModel() {
openModal(true, {
isUpdate: false,
});
}
/** 新增文件夹*/
function handleCreateFile() {
openModal(true, {
isUpdate: false,
});
}
/** 编辑按钮*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
});
}
/** 保存*/
function save() {
createMessage.success('保存成功!')
}
/** 添加类别*/
function handleCreateType() {
openModal(true, {
});
}
/** 取消*/
function cancel() {
go('/metaModel/physicsModel/index');
}
/** 删除按钮*/
function handleDelete(record: Recordable) {
tableData.value.splice(tableData.value.findIndex(item => item.businessId === record.businessId), 1);
createMessage.success('删除成功!');
}
/** 新增/编辑成功*/
function handleSuccess({ isUpdate, values }) {
}
/**新增属性*/
function addProperty(type) {
const data = {
"businessId" : '',
"name" : "",
"description": '',
"englishName": '',
"isWrite": '0',
"isShow": '0',
"type": '1',
}
columnTableData.value.push(data)
reload()
}
onMounted(() => {
columnTableData.value = editColumnData
});
// 页面左侧点击返回链接时的操作
function goBack() {
// 本例的效果时点击返回始终跳转到账号列表页,实际应用时可返回上一页
go('/metaModel/physicsModel/index');
}
</script>
...@@ -12,63 +12,19 @@ ...@@ -12,63 +12,19 @@
<div style="margin-top: 20px;">数据资产类型:Inceptor表</div> <div style="margin-top: 20px;">数据资产类型:Inceptor表</div>
</div> </div>
<div> <div>
<a-button type="primary" @click="handleCreateFile">添加类别</a-button> <a-button type="primary" @click="handleCreateType">添加类别</a-button>
<a-button type="primary" @click="handleCreateFile" style="margin-left: 5px;">保存</a-button> <a-button type="primary" @click="save" style="margin-left: 5px;">保存</a-button>
<a-button type="primary" @click="handleCreateFile" style="margin-left: 5px;">取消</a-button> <a-button type="primary" @click="cancel" style="margin-left: 5px;">取消</a-button>
</div> </div>
</div> </div>
</template> </template>
<BasicTable @register="registerTable" class="height"> <Table @register="registerTableModal" @success="handleSuccess" />
<template #toolbar> <AreaTable @register="registerAreaTableModal" @success="handleSuccess" />
<a-input style="width: 200px;margin-right: auto" default-value="表信息" allowClear></a-input> <ColumnTable @register="registerColumnTableModal" @success="handleSuccess" />
<a-button type="primary" @click="handleCreateFile">展示</a-button> <BucketTable @register="registerBucketTableModal" @success="handleSuccess" />
<a-button type="primary" @click="handleCreateModel">添加属性</a-button> <AddTypeModal @register="registerModal" @success="handleSuccess" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
color: 'error',
label: '删除',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record),
},
},
]"
/>
</template>
</template>
</BasicTable>
<BasicTable @register="registerTable" class="height">
<template #toolbar>
<a-input style="width: 200px;margin-right: auto" default-value="表信息" allowClear></a-input>
<a-button type="primary" @click="handleCreateFile">展示</a-button>
<a-button type="primary" @click="handleCreateModel">添加属性</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
color: 'error',
label: '删除',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record),
},
},
]"
/>
</template>
</template>
</BasicTable>
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { reactive,unref,onDeactivated,onMounted,ref } from 'vue'; import { reactive,unref,onDeactivated,onMounted,ref } from 'vue';
...@@ -85,6 +41,11 @@ import { useRoute,onBeforeRouteLeave } from 'vue-router'; ...@@ -85,6 +41,11 @@ import { useRoute,onBeforeRouteLeave } from 'vue-router';
import { useFilterStore } from '@/store/modules/filterData'; import { useFilterStore } from '@/store/modules/filterData';
import {editTableData,editBucketData,editAreaData,editColumnData} from "@/views/metaModel/physicsModel/modelData"; import {editTableData,editBucketData,editAreaData,editColumnData} from "@/views/metaModel/physicsModel/modelData";
import {router} from "@/router"; import {router} from "@/router";
import AddTypeModal from './addTypeModal.vue';
import ColumnTable from './ColumnTable.vue';
import AreaTable from './AreaTable.vue';
import Table from './Table.vue';
import BucketTable from './BucketTable.vue';
defineOptions({ name: 'AccountManagement' }); defineOptions({ name: 'AccountManagement' });
const { createMessage } = useMessage(); const { createMessage } = useMessage();
...@@ -92,50 +53,13 @@ const filterStore = useFilterStore(); ...@@ -92,50 +53,13 @@ const filterStore = useFilterStore();
const route = useRoute(); const route = useRoute();
const go = useGo(); const go = useGo();
const [registerModal, { openModal }] = useModal(); const [registerModal, { openModal }] = useModal();
const [registerTableModal, { openModal:openTableModal }] = useModal();
const [registerAreaTableModal, { openModal:openAreaTableModal }] = useModal();
const [registerColumnTableModal, { openModal:openColumnTableModal }] = useModal();
const [registerBucketTableModal, { openModal:openBucketTableModal }] = useModal();
const [registerAddUserModal, { openModal:addUserModal }] = useModal(); const [registerAddUserModal, { openModal:addUserModal }] = useModal();
const [registerMoveUser, { openModal: openMoveUserModal }] = useModal(); const [registerMoveUser, { openModal: openMoveUserModal }] = useModal();
const searchInfo = reactive<Recordable>({}); const searchInfo = reactive<Recordable>({});
const tableData = ref([])
const [registerTable, { reload, updateTableDataRecord, getSearchInfo,getForm,getRowSelection }] = useTable({
title: '',
api: async (params) => {
console.log('params:',params)
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: tableData.value.length,
code:'',
message:'',
data: [],
};
//过滤data中的数据,取出等于params.deptId的数据
var data = []
//按照部门筛选 如果有进行过滤相应部门的 没有就赋值全部
var data = [];
data = tableData.value.filter((item) => item.businessId !== 100);
return { ...response, data: data };
},
columns,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter: true,
},
useSearchForm: false,
showTableSetting: false,
showIndexColumn: false,
pagination: false,
bordered: true,
handleSearchInfoFn(info) {
return info;
},
actionColumn: {
width: 150,
title: '操作',
dataIndex: 'action',
},
});
/** 新增元模型*/ /** 新增元模型*/
function handleCreateModel() { function handleCreateModel() {
...@@ -159,21 +83,36 @@ function handleEdit(record: Recordable) { ...@@ -159,21 +83,36 @@ function handleEdit(record: Recordable) {
}); });
} }
/** 保存*/
function save() {
createMessage.success('保存成功!')
}
/** 添加类别*/
function handleCreateType() {
openModal(true, {
});
}
/** 取消*/
function cancel() {
go('/metaModel/physicsModel/index');
}
/** 删除按钮*/ /** 删除按钮*/
function handleDelete(record: Recordable) { function handleDelete(record: Recordable) {
tableData.value.splice(tableData.value.findIndex(item => item.businessId === record.businessId), 1);
createMessage.success('删除成功!'); createMessage.success('删除成功!');
reload();
} }
/** 新增/编辑成功*/ /** 新增/编辑成功*/
function handleSuccess({ isUpdate, values }) { function handleSuccess({ isUpdate, values }) {
reload();
} }
onMounted(() => { onMounted(() => {
tableData.value = editTableData
}); });
// 页面左侧点击返回链接时的操作 // 页面左侧点击返回链接时的操作
function goBack() { function goBack() {
......
<template>
<BasicTable @register="registerTable4" class="height">
<template #toolbar>
<a-input style="width: 200px;margin-right: auto" default-value="表信息" allowClear></a-input>
<a-button type="primary" @click="handleCreateFile">展示</a-button>
<a-button type="primary" @click="addProperty()">添加属性</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
color: 'error',
label: '删除',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record),
},
},
]"
/>
</template>
</template>
</BasicTable>
</template>
<script lang="ts" setup>
import { reactive,unref,onDeactivated,onMounted,ref } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import {getAccountList, deleteUser,exportUserList} from '@/api/system/user/user';
import { PageWrapper } from '@/components/Page';
import ModelTree from './ModelTree.vue';
import { useMessage } from '@/hooks/web/useMessage';
import { useModal } from '@/components/Modal';
import ModelModal from './modelModal.vue';
import { columns,searchFormSchema } from './editModel.data';
import { useGo } from '@/hooks/web/usePage';
import { useRoute,onBeforeRouteLeave } from 'vue-router';
import { useFilterStore } from '@/store/modules/filterData';
import {editTableData,editBucketData,editAreaData,editColumnData} from "@/views/metaModel/physicsModel/modelData";
import {router} from "@/router";
import AddTypeModal from './addTypeModal.vue';
defineOptions({ name: 'AccountManagement' });
const { createMessage } = useMessage();
const filterStore = useFilterStore();
const route = useRoute();
const go = useGo();
const [registerModal, { openModal }] = useModal();
const [registerAddUserModal, { openModal:addUserModal }] = useModal();
const [registerMoveUser, { openModal: openMoveUserModal }] = useModal();
const searchInfo = reactive<Recordable>({});
const tableData = ref([])
const [registerTable4, { reload, updateTableDataRecord4, getSearchInfo4,getForm4,getRowSelection4 }] = useTable({
title: '',
api: async (params) => {
console.log('params:',params)
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: tableData.value.length,
code:'',
message:'',
data: [],
};
//过滤data中的数据,取出等于params.deptId的数据
var data = []
//按照部门筛选 如果有进行过滤相应部门的 没有就赋值全部
var data = [];
data = tableData.value.filter((item) => item.businessId !== 100);
return { ...response, data: data };
},
columns,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter: true,
},
useSearchForm: false,
showTableSetting: false,
showIndexColumn: false,
pagination: false,
bordered: true,
handleSearchInfoFn(info) {
return info;
},
actionColumn: {
width: 150,
title: '操作',
dataIndex: 'action',
},
});
/** 新增元模型*/
function handleCreateModel() {
openModal(true, {
isUpdate: false,
});
}
/** 新增文件夹*/
function handleCreateFile() {
openModal(true, {
isUpdate: false,
});
}
/** 编辑按钮*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
});
}
/** 保存*/
function save() {
createMessage.success('保存成功!')
}
/** 添加类别*/
function handleCreateType() {
openModal(true, {
});
}
/** 取消*/
function cancel() {
go('/metaModel/physicsModel/index');
}
/** 删除按钮*/
function handleDelete(record: Recordable) {
tableData.value.splice(tableData.value.findIndex(item => item.businessId === record.businessId), 1);
createMessage.success('删除成功!');
}
/** 新增/编辑成功*/
function handleSuccess({ isUpdate, values }) {
}
/**新增属性*/
function addProperty(type) {
const data = {
"businessId" : '',
"name" : "",
"description": '',
"englishName": '',
"isWrite": '0',
"isShow": '0',
"type": '1',
}
tableData.value.push(data)
reload()
}
onMounted(() => {
tableData.value = editTableData
});
// 页面左侧点击返回链接时的操作
function goBack() {
// 本例的效果时点击返回始终跳转到账号列表页,实际应用时可返回上一页
go('/metaModel/physicsModel/index');
}
</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 { modelFormSchema } from './model.data';
import { getDeptList } from '@/api/system/dept/dept';
import {addUserApi,UserDetailApi,UserUpdataApi} from '@/api/system/user/user'
import { encryptTwo } from '../../../../src/utils/jsencrypt.js'
import { useMessage } from '@/hooks/web/useMessage';
import {TreeData} from "@/views/metaModel/physicsModel/modelData";
import {router} from "@/router";
import {addTypeFormSchema} from "@/views/metaModel/physicsModel/editModel.data";
defineOptions({ name: 'ModelModal' });
const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage();
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: addTypeFormSchema,
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 = computed(() => ('新建类别'));
/**确定按钮*/
async function handleSubmit() {
const values = await validate();
closeModal()
}
</script>
...@@ -79,13 +79,21 @@ export const columns: BasicColumn[] = [ ...@@ -79,13 +79,21 @@ export const columns: BasicColumn[] = [
editComponentProps: { editComponentProps: {
options: [ options: [
{ {
label: 'Option1', label: '字符串',
value: '1', value: '1',
}, },
{ {
label: 'Option2', label: '布尔',
value: '2', value: '2',
}, },
{
label: '整型',
value: '3',
},
{
label: '浮点型',
value: '4',
},
], ],
}, },
width: 200, width: 200,
...@@ -180,3 +188,20 @@ export const MoveFormSchema: any[] = [ ...@@ -180,3 +188,20 @@ export const MoveFormSchema: any[] = [
required: true, required: true,
}, },
] ]
export const addTypeFormSchema: any[] = [
{
field: 'name',
label: '类别名称',
component: 'Input',
componentProps: {
placeholder: '请输入类别名称',
},
rules: [
{
required: true,
message: '请输入类别名称',
},
],
colProps: { span: 7 },
},
];
...@@ -171,107 +171,107 @@ export const editTableData: any[] = [ ...@@ -171,107 +171,107 @@ export const editTableData: any[] = [
{ {
"businessId" : 1, "businessId" : 1,
"name" : "数据源", "name" : "数据源",
"description": "", "description": '',
"englishName":"", "englishName": '',
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "库名", "name" : "库名",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "表名", "name" : "表名",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "资产类型", "name" : "资产类型",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "表类型", "name" : "表类型",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, { }, {
"businessId" : 1, "businessId" : 1,
"name" : "表注释", "name" : "表注释",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, { }, {
"businessId" : 1, "businessId" : 1,
"name" : "存储类型", "name" : "存储类型",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
},{ },{
"businessId" : 1, "businessId" : 1,
"name" : "是否为事务表", "name" : "是否为事务表",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "创建时间", "name" : "创建时间",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "创建者", "name" : "创建者",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "发布时间", "name" : "发布时间",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "发布者", "name" : "发布者",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
...@@ -282,63 +282,63 @@ export const editColumnData: any[] = [ ...@@ -282,63 +282,63 @@ export const editColumnData: any[] = [
"name" : "列名", "name" : "列名",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "字段类型", "name" : "字段类型",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "字段类型参数", "name" : "字段类型参数",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "长度", "name" : "长度",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "精度", "name" : "精度",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "是否可为空", "name" : "是否可为空",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "字段注释", "name" : "字段注释",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
} }
]; ];
export const editBucketData: any[] = [ export const editBucketData: any[] = [
...@@ -347,36 +347,36 @@ export const editBucketData: any[] = [ ...@@ -347,36 +347,36 @@ export const editBucketData: any[] = [
"name" : "分桶数", "name" : "分桶数",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "分桶字段", "name" : "分桶字段",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "排序字段", "name" : "排序字段",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "排序方式", "name" : "排序方式",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
]; ];
export const editAreaData: any[] = [ export const editAreaData: any[] = [
...@@ -385,36 +385,36 @@ export const editAreaData: any[] = [ ...@@ -385,36 +385,36 @@ export const editAreaData: any[] = [
"name" : "分区类型", "name" : "分区类型",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "分区字段", "name" : "分区字段",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "分区名", "name" : "分区名",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
{ {
"businessId" : 1, "businessId" : 1,
"name" : "分区值", "name" : "分区值",
"description": "", "description": "",
"englishName":"", "englishName":"",
"isWrite":0, "isWrite": '0',
"isShow":0, "isShow": '0',
"type":"", "type": '1',
}, },
]; ];
......
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