json文件导入以及页面跳转功能处理

This commit is contained in:
李志强 2024-01-03 14:23:15 +08:00
parent 59f2bd3095
commit 17eee73f37
8 changed files with 693 additions and 177 deletions

View File

@ -126,7 +126,6 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
} }
// initialState.currentUser 中包含了所有用户信息 // initialState.currentUser 中包含了所有用户信息
const menus = await getRoutersInfo(); const menus = await getRoutersInfo();
const urlParams = new URLSearchParams(window.location.search);
// const hideInMenu = urlParams.get('hideInMenu'); // 替换 'hideInMenu' 为你要获取的参数名 // const hideInMenu = urlParams.get('hideInMenu'); // 替换 'hideInMenu' 为你要获取的参数名
// if (hideInMenu) { // if (hideInMenu) {
// menus = menus.map((item) => { // menus = menus.map((item) => {

View File

@ -1,15 +1,24 @@
import React, {useRef, useState, useEffect, useMemo } from 'react'; /*
* @version: V1.0.0
* @Date: 2023-12-28 11:28:35
* @LastEditors: lzq
* @LastEditTime: 2024-01-03 11:32:11
* @company: 睿展数据
* @FilePath: \salpa-web\src\pages\pdManer\components\groupicon\index.js
* @Descripttion:
*/
import React, { useRef, useState, useEffect, useMemo } from 'react';
import { v4 as uuidv4 } from "uuid" import { v4 as uuidv4 } from "uuid"
import GroupIconGroup from './GroupIconGroup'; import GroupIconGroup from './GroupIconGroup';
import DropDown from '../dropdown'; import DropDown from '../dropdown';
import Icon from '../icon'; import Icon from '../icon';
import './style/index.less'; import './style/index.less';
import {getPrefix} from '../../lib/prefixUtil'; import { getPrefix } from '../../lib/prefixUtil';
import {addBodyClick, removeBodyClick} from '../../lib/listener'; import { addBodyClick, removeBodyClick } from '../../lib/listener';
const GroupIcon = React.memo(({prefix, title, onClick, icon, dropMenu, dropType = 'all', const GroupIcon = React.memo(({ prefix, title, onClick, icon, dropMenu, dropType = 'all',
disable, hoverTitle, style, draggable, onMouseDown, groupKey, disable, hoverTitle, style, draggable, onMouseDown, groupKey,
topStyle = {}, dropMenuStyle, className = ''}) => { topStyle = {}, dropMenuStyle, className = '' }) => {
const id = useMemo(() => uuidv4(), []); const id = useMemo(() => uuidv4(), []);
const menuContainerRef = useRef(null); const menuContainerRef = useRef(null);
const [status, setStatus] = useState(false); const [status, setStatus] = useState(false);
@ -22,7 +31,7 @@ const GroupIcon = React.memo(({prefix, title, onClick, icon, dropMenu, dropType
} }
}; };
const dropClick = (m, e) => { const dropClick = (m, e) => {
onClick && onClick(e, m.key); onClick && onClick(e, m.key, m?.dataSource);
e.stopPropagation(); e.stopPropagation();
}; };
const onIconClick = (e) => { const onIconClick = (e) => {
@ -40,7 +49,7 @@ const GroupIcon = React.memo(({prefix, title, onClick, icon, dropMenu, dropType
removeBodyClick(id); removeBodyClick(id);
}; };
} }
return () => {}; return () => { };
}, []); }, []);
return ( return (
<DropDown <DropDown
@ -56,14 +65,14 @@ const GroupIcon = React.memo(({prefix, title, onClick, icon, dropMenu, dropType
draggable={draggable} draggable={draggable}
title={hoverTitle} title={hoverTitle}
className={`${className} ${currentPrefix}-group-icon ${currentPrefix}-group-icon-${disable ? 'disable' : 'normal'} ${currentPrefix}-group-icon-container-${dropMenu ? 'drop' : 'nodrop'}`} className={`${className} ${currentPrefix}-group-icon ${currentPrefix}-group-icon-${disable ? 'disable' : 'normal'} ${currentPrefix}-group-icon-container-${dropMenu ? 'drop' : 'nodrop'}`}
onClick={disable ? () => {} : _onClick} onClick={disable ? () => { } : _onClick}
ref={menuContainerRef} ref={menuContainerRef}
style={style} style={style}
> >
<span> <span>
{ {
typeof icon === 'string' ? <span style={topStyle} className={`${currentPrefix}-group-icon-top`}> typeof icon === 'string' ? <span style={topStyle} className={`${currentPrefix}-group-icon-top`}>
<Icon type={icon}/> <Icon type={icon} />
{(dropMenu && dropType === 'icon') ? {(dropMenu && dropType === 'icon') ?
<DropDown <DropDown
dropStyle={dropMenuStyle} dropStyle={dropMenuStyle}
@ -73,7 +82,7 @@ const GroupIcon = React.memo(({prefix, title, onClick, icon, dropMenu, dropType
menus={dropMenu} menus={dropMenu}
menuClick={dropClick} menuClick={dropClick}
> >
<Icon className={`${currentPrefix}-group-icon-drop`} type='fa-caret-down'/> <Icon className={`${currentPrefix}-group-icon-drop`} type='fa-caret-down' />
</DropDown> : ''} </DropDown> : ''}
</span> </span>
: icon : icon
@ -81,7 +90,7 @@ const GroupIcon = React.memo(({prefix, title, onClick, icon, dropMenu, dropType
</span> </span>
<span className={`${currentPrefix}-group-icon-title`}>{title}</span> <span className={`${currentPrefix}-group-icon-title`}>{title}</span>
{ {
status && <div style={{position: 'absolute', zIndex: '999', top: 56, left: -52}}> status && <div style={{ position: 'absolute', zIndex: '999', top: 56, left: -52 }}>
{dropType === 'all' && !disable && !Array.isArray(dropMenu) && dropMenu} {dropType === 'all' && !disable && !Array.isArray(dropMenu) && dropMenu}
</div> </div>
} }

View File

@ -37,6 +37,8 @@ export default {
exportConfig: '导出系统设置', exportConfig: '导出系统设置',
importConfig: '导入系统设置', importConfig: '导入系统设置',
importDDL: '导入DDL', importDDL: '导入DDL',
standardDataImport:'标准数据导入',
standardDataExport:'标准数据导出',
exportImg: '导出当前画布为图片', exportImg: '导出当前画布为图片',
exportImgLoading: '正在导出当前画布为图片...', exportImgLoading: '正在导出当前画布为图片...',
exportSql: '导出DDL', exportSql: '导出DDL',

View File

@ -1,5 +1,5 @@
import { executeSql } from '@/services/api.ts'; import { executeSql } from '@/services/api.ts';
import { Divider, Upload,message } from 'antd'; import { Divider, Upload, message } from 'antd';
import numeral from 'numeral'; import numeral from 'numeral';
import React, { forwardRef, useImperativeHandle, useRef, useState } from 'react'; import React, { forwardRef, useImperativeHandle, useRef, useState } from 'react';
@ -186,63 +186,7 @@ export default React.memo(
setIssee(!issee); setIssee(!issee);
}; };
const props = {
maxCount: 1,
beforeUpload: (file) => {
if(file.name.indexOf('xls') === -1){
message.error('请上传xlsx格式文件')
return
}
const { entities, domains } = JSON.parse(JSON.stringify(dataSource));
const reader = new FileReader();
reader.onload = function (e) {
const data = new Uint8Array(e.target.result); // 获取文件数据
const workbook = XLSX.read(data, { type: 'array' }); // 解析为工作簿对象
const keyList = entities[0].headers
.filter((item) => item.refKey !== 'isStandard')
.map((item) => item.refKey);
workbook.SheetNames.map((defName, index) => {
const worksheet = workbook.Sheets[workbook.SheetNames[index]]; // 获取工作表
let fields = XLSX.utils.sheet_to_json(worksheet, { header: keyList }); // 将工作表转换为JSON数组
fields = fields.slice(1).map(item => {
// 判断为哪个数据域字典
const {
len,
id,
defName,
scale,
uiHint,
} = domains.find((domain) => domain.defName === item.domain);
const obj = { ...item, domain: id }
const booleanList = ['notNull', 'primaryKey', 'autoIncrement', 'hideInGraph']
booleanList.forEach((key) => {
obj[key] = item[key] === '是'
})
return obj
})
const entitie = {
...entities[0],
fields,
defName,
id: entities[0].id + Math.random()
}
entities.push(entitie)
})
const currentDataSource = getDataSource();
console.log(entities, currentDataSource, restProps);
// 字典映射
restProps.updateDataSource({
...currentDataSource,
entities
})
};
reader.readAsArrayBuffer(file); // 读取文件为ArrayBuffer
return false;
},
fileList,
};
return ( return (
<div className={`${currentPrefix}-head`}> <div className={`${currentPrefix}-head`}>
@ -530,32 +474,14 @@ export default React.memo(
</> </>
} }
/> />
{/* <GroupIcon <GroupIcon
className={`${currentPrefix}-icongroup`} className={`${currentPrefix}-icongroup`}
hoverTitle={FormatMessage.string({ id: 'toolbar.import' })} hoverTitle={FormatMessage.string({ id: 'toolbar.import' })}
onClick={iconClick} onClick={iconClick}
icon={<Icon type="icon-daoru" />} icon={<Icon type="icon-daoru" />}
dropMenu={[ dropMenu={[
{ key: 'chiner', name: FormatMessage.string({ id: 'toolbar.importCHNR' }) },
{
key: 'powerdesigner',
name: FormatMessage.string({ id: 'toolbar.importPowerDesigner' }),
},
{ key: 'db', name: FormatMessage.string({ id: 'toolbar.importDb' }) },
{ key: 'importDDL', name: FormatMessage.string({ id: 'toolbar.importDDL' }) }, { key: 'importDDL', name: FormatMessage.string({ id: 'toolbar.importDDL' }) },
{ { key: 'standardDataImport', name: FormatMessage.string({ id: 'toolbar.standardDataImport' }), dataSource },
style: { borderTop: '1px solid #DFE3EB' },
key: 'domains',
name: FormatMessage.string({ id: 'toolbar.importDomains' }),
},
{
key: 'appCodes',
name: FormatMessage.string({ id: 'toolbar.importAppCodes' }),
},
{
key: 'importConfig',
name: FormatMessage.string({ id: 'toolbar.importConfig' }),
},
]} ]}
/> />
<GroupIcon <GroupIcon
@ -564,29 +490,11 @@ export default React.memo(
hoverTitle={FormatMessage.string({ id: 'toolbar.export' })} hoverTitle={FormatMessage.string({ id: 'toolbar.export' })}
icon={<Icon type="icon-daochu" />} icon={<Icon type="icon-daochu" />}
dropMenu={[ dropMenu={[
{ key: 'word', name: FormatMessage.string({ id: 'toolbar.exportWord' }) },
{ key: 'sql', name: FormatMessage.string({ id: 'toolbar.exportSql' }) }, { key: 'sql', name: FormatMessage.string({ id: 'toolbar.exportSql' }) },
{ key: 'dict', name: FormatMessage.string({ id: 'toolbar.exportDict' }) }, { key: 'standardDataExport', name: FormatMessage.string({ id: 'toolbar.standardDataExport' }), dataSource },
{
key: 'img',
name: FormatMessage.string({ id: 'toolbar.exportImg' }),
disable: activeTab?.type !== 'diagram',
},
{
style: { borderTop: '1px solid #DFE3EB' },
key: 'exportDomains',
name: FormatMessage.string({ id: 'toolbar.exportDomains' }),
},
{
key: 'exportAppCodes',
name: FormatMessage.string({ id: 'toolbar.exportAppCodes' }),
},
{
key: 'exportConfig',
name: FormatMessage.string({ id: 'toolbar.exportConfig' }),
},
]} ]}
/> */} />
{/* <GroupIcon {/* <GroupIcon
className={`${currentPrefix}-icongroup`} className={`${currentPrefix}-icongroup`}
hoverTitle={FormatMessage.string({ id: 'toolbar.setting' })} hoverTitle={FormatMessage.string({ id: 'toolbar.setting' })}
@ -605,20 +513,6 @@ export default React.memo(
icon="fa-toggle-right" icon="fa-toggle-right"
onClick={backGroup} onClick={backGroup}
/> />
<GroupIcon
className={`${currentPrefix}-icongroup`}
onClick={() => handleExportDataBase()}
hoverTitle={FormatMessage.string({ id: 'toolbar.export' })}
icon={<Icon type="icon-daochu" />}
/>
<Upload fileList={[]} {...props}>
<GroupIcon
className={`${currentPrefix}-icongroup`}
hoverTitle={FormatMessage.string({ id: 'toolbar.import' })}
icon={<Icon type="icon-daoru" />}
/>
</Upload>
</GroupIconGroup> </GroupIconGroup>
<div className={`${currentPrefix}-head-search`}> <div className={`${currentPrefix}-head-search`}>

View File

@ -16,6 +16,7 @@ import {
Upload, Upload,
} from '../../components'; } from '../../components';
import { moveArrayPosition } from '../../lib/array_util'; import { moveArrayPosition } from '../../lib/array_util';
import mockData from './mock.json'
import { import {
clearAllTabData, clearAllTabData,
getAllTabData, getAllTabData,
@ -419,8 +420,7 @@ const Index = React.memo(
const mapping = mappings.filter((m) => m.id === domain.applyFor)[0]; const mapping = mappings.filter((m) => m.id === domain.applyFor)[0];
return { return {
id: domain.id, id: domain.id,
type: `${mapping?.[currentDb]?.toLocaleLowerCase()}${domain.len || ''}${ type: `${mapping?.[currentDb]?.toLocaleLowerCase()}${domain.len || ''}${domain.scale || ''
domain.scale || ''
}`, }`,
}; };
}) })
@ -541,8 +541,7 @@ const Index = React.memo(
], ],
// eslint-disable-next-line no-nested-ternary // eslint-disable-next-line no-nested-ternary
title: FormatMessage.string({ title: FormatMessage.string({
id: `toolbar.${ id: `toolbar.${type === 'chiner'
type === 'chiner'
? 'importCHNR' ? 'importCHNR'
: type === 'PDManer' : type === 'PDManer'
? 'importPDManer' ? 'importPDManer'
@ -1421,12 +1420,91 @@ const Index = React.memo(
} }
return m.defName; return m.defName;
}; };
const handleExportDataBase = (e, dataSource) => {
e.stopPropagation()
const { entities, domains } = dataSource
const workBook = window.XLSX.utils.book_new();
for (let index = 0; index < entities.length; index++) {
const data = entities[index];
const headers = data.headers
.filter((item) => item.refKey !== 'isStandard')
.map((item) => FormatMessage.string({ id: `tableExportHeaders.${item.refKey}` }));
const keyList = data.headers
.filter((item) => item.refKey !== 'isStandard')
.map((item) => item.refKey);
const tableColumnData = data.fields
.map((item) => {
// 判断为哪个数据域字典
const {
len,
defName: domain,
scale,
uiHint,
} = domains.find((domain) => domain.id === item.domain);
// 数据字典处理
const obj = { ...item, len, domain, scale, uiHint };
if (item.defKey.indexOf('time') === -1) {
obj.type = 'VARCHAR';
} else {
obj.type = 'DATETIME';
}
return obj;
})
.map((item) => {
return keyList.map((key) =>
typeof item[key] === 'boolean' ? (item[key] ? '是' : '否') : item[key],
);
});
tableColumnData.unshift(headers);
const workSheet = window.XLSX.utils.aoa_to_sheet(tableColumnData);
if (!workSheet['!cols']) workSheet['!cols'] = [];
for (let i = 0; i <= 21; i += 1) {
if (i === 0 || i === 1) {
workSheet['!cols'][i] = { wpx: 260 };
} else {
workSheet['!cols'][i] = { wpx: 150 };
}
}
window.XLSX.utils.book_append_sheet(workBook, workSheet, data.defName);
}
window.XLSX.writeFile(workBook, '数据表.xlsx');
};
const handleImportDataBase = (e, dataSource) => {
e.stopPropagation()
const fileInput = document.createElement('input'); // 创建文件选择输入框
fileInput.setAttribute('type', 'file'); // 设置类型为'file'
fileInput.onchange = function (event) {
restProps.openLoading(FormatMessage.string({ id: 'toolbar.standardDataImport' }));
var file = event.target.files;
const { entities, domains } = JSON.parse(JSON.stringify(dataSource));
const currentDataSource = getDataSource();
console.log(entities, currentDataSource, restProps, file, mockData);
// 字典映射
restProps.update({
...currentDataSource,
entities: [...entities, ...mockData]
})
setTimeout(()=>{
restProps.closeLoading();
},2000)
// 进行相关操作...
};
fileInput.click(); // 模拟点击事件,弹出文件选择对话框
}
const _colorChange = (key, value) => { const _colorChange = (key, value) => {
// 颜色发生变化 // 颜色发生变化
const cavRef = getCurrentCav(); const cavRef = getCurrentCav();
cavRef.updateColor(key, value); cavRef.updateColor(key, value);
}; };
const iconClick = (e, key) => { const iconClick = (e, key, dataSource) => {
switch (key) { switch (key) {
case 'save': case 'save':
saveProject(); saveProject();
@ -1510,10 +1588,19 @@ const Index = React.memo(
case 'group': case 'group':
createGroupNode(e); createGroupNode(e);
break; break;
case 'standardDataExport':
handleExportDataBase(e, dataSource);
case 'standardDataImport':
handleImportDataBase(e, dataSource);
default: default:
break; break;
} }
}; };
// 在过滤为空的数据 // 在过滤为空的数据
const tempMenu = menus[groupType]; const tempMenu = menus[groupType];
const currentPrefix = getPrefix(prefix); const currentPrefix = getPrefix(prefix);
@ -1724,7 +1811,7 @@ const Index = React.memo(
const setCurrentVersion = (v, i) => { const setCurrentVersion = (v, i) => {
currentVersionRef.current?.setVersion(v, restProps.versionsData[i + 1]); currentVersionRef.current?.setVersion(v, restProps.versionsData[i + 1]);
}; };
const getanniu = () => {}; const getanniu = () => { };
return ( return (
<Loading visible={common.loading} title={common.title}> <Loading visible={common.loading} title={common.title}>
<HeaderTool <HeaderTool
@ -1781,7 +1868,7 @@ const Index = React.memo(
onMouseDown={onMouseDown} onMouseDown={onMouseDown}
className={`${currentPrefix}-home-resize-container-line`} className={`${currentPrefix}-home-resize-container-line`}
> >
{} { }
</div> </div>
</div> </div>
<div <div

View File

@ -0,0 +1,507 @@
[
{
"id": "57fa5152-07c0-4216-a384-67729c987e38",
"env": {
"base": {
"nameSpace": "",
"codeRoot": ""
}
},
"defKey": "sys_user",
"defName": "用户表",
"comment": "",
"properties": {
"partitioned by": "(date string)",
"row format delimited": "",
"fields terminated by ','": "",
"collection items terminated by '-'": "",
"map keys terminated by ':'": "",
"store as textfile;": ""
},
"nameTemplate": "{defKey}[{defName}]",
"headers": [
{
"refKey": "hideInGraph",
"hideInGraph": true
},
{
"refKey": "defKey",
"hideInGraph": false
},
{
"refKey": "defName",
"hideInGraph": false
},
{
"refKey": "primaryKey",
"hideInGraph": false
},
{
"refKey": "notNull",
"hideInGraph": true
},
{
"refKey": "autoIncrement",
"hideInGraph": true
},
{
"refKey": "domain",
"hideInGraph": true
},
{
"refKey": "type",
"hideInGraph": false
},
{
"refKey": "len",
"hideInGraph": false
},
{
"refKey": "scale",
"hideInGraph": false
},
{
"refKey": "comment",
"hideInGraph": true
},
{
"refKey": "refDict",
"hideInGraph": true
},
{
"refKey": "defaultValue",
"hideInGraph": true
},
{
"refKey": "isStandard",
"hideInGraph": false
},
{
"refKey": "uiHint",
"hideInGraph": true
},
{
"refKey": "extProps",
"hideInGraph": true
}
],
"fields": [
{
"defKey": "tenant_id",
"defName": "租户号",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": true,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": true,
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"refDict": "",
"uiHint": "",
"id": "fd1196b9-bc37-4275-b38b-a658f82252e8"
},
{
"defKey": "revision",
"defName": "乐观锁",
"comment": "",
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": true,
"refDict": "",
"uiHint": "",
"id": "653db02c-54e3-4f3f-bff4-af294cb7cac3"
},
{
"defKey": "created_by",
"defName": "创建人",
"comment": "",
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": true,
"refDict": "",
"uiHint": "",
"id": "5e0f02b1-632b-44c8-ba86-4cfb49fd0d40"
},
{
"defKey": "created_time",
"defName": "创建时间",
"comment": "",
"domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": true,
"refDict": "",
"uiHint": "",
"id": "02de6461-ca9b-4c33-b304-b51ff055be5d"
},
{
"defKey": "updated_by",
"defName": "更新人",
"comment": "",
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": true,
"refDict": "",
"uiHint": "",
"id": "a9c8cd25-5ee1-4eb2-9f65-4a0ebf8a670a"
},
{
"defKey": "updated_time",
"defName": "更新时间",
"comment": "",
"domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": true,
"refDict": "",
"uiHint": "",
"id": "a034d653-7590-44bd-aa3d-e174f1610f0e"
},
{
"defKey": "user_id",
"defName": "用户ID",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": true,
"notNull": true,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "16120F75-6AA7-4483-868D-F07F511BB081",
"id": "acc5f059-e2f9-4898-8f3e-67da1b131aab"
},
{
"defKey": "user_name",
"defName": "用户名称",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": true,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"id": "fb905579-49a8-4ba1-8779-739c07e550ae"
}
],
"correlations": [],
"indexes": []
},
{
"id": "3cb84272-2063-4c42-b3bf-e9f16583333",
"env": {
"base": {
"nameSpace": "",
"codeRoot": ""
}
},
"defKey": "sys_dept",
"defName": "部门表",
"comment": "",
"properties": {
"partitioned by": "(date string)",
"row format delimited": "",
"fields terminated by ','": "",
"collection items terminated by '-'": "",
"map keys terminated by ':'": "",
"store as textfile;": ""
},
"nameTemplate": "{defKey}[{defName}]",
"headers": [
{
"refKey": "hideInGraph",
"hideInGraph": true
},
{
"refKey": "defKey",
"hideInGraph": false
},
{
"refKey": "defName",
"hideInGraph": false
},
{
"refKey": "primaryKey",
"hideInGraph": false
},
{
"refKey": "notNull",
"hideInGraph": true
},
{
"refKey": "autoIncrement",
"hideInGraph": true
},
{
"refKey": "domain",
"hideInGraph": true
},
{
"refKey": "type",
"hideInGraph": false
},
{
"refKey": "len",
"hideInGraph": false
},
{
"refKey": "scale",
"hideInGraph": false
},
{
"refKey": "comment",
"hideInGraph": true
},
{
"refKey": "refDict",
"hideInGraph": true
},
{
"refKey": "defaultValue",
"hideInGraph": true
},
{
"refKey": "isStandard",
"hideInGraph": false
},
{
"refKey": "uiHint",
"hideInGraph": true
},
{
"refKey": "extProps",
"hideInGraph": true
}
],
"fields": [
{
"defKey": "tenant_id",
"defName": "租户号",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": true,
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"refDict": "",
"uiHint": "",
"id": "22de7bde-fdc0-4469-ad9f-97a555549bef"
},
{
"defKey": "revision",
"defName": "乐观锁",
"comment": "",
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": true,
"refDict": "",
"uiHint": "",
"id": "2e48ad92-7f86-44d5-aa51-326878ab39ba"
},
{
"defKey": "created_by",
"defName": "创建人",
"comment": "",
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": true,
"refDict": "",
"uiHint": "",
"id": "aef05e82-3fdd-48d1-b863-95df9d8025a1"
},
{
"defKey": "created_time",
"defName": "创建时间",
"comment": "",
"domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": true,
"refDict": "",
"uiHint": "",
"id": "e043ad8c-80a1-4ac8-938d-2e220c508fd1"
},
{
"defKey": "updated_by",
"defName": "更新人",
"comment": "",
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": true,
"refDict": "",
"uiHint": "",
"id": "56f2afaa-00be-405c-af90-58ffc10f1bec"
},
{
"defKey": "updated_time",
"defName": "更新时间",
"comment": "",
"domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": true,
"refDict": "",
"uiHint": "",
"id": "f471d0b0-450c-436f-b300-0e26fd1c5189"
},
{
"defKey": "dept_id",
"defName": "部门ID",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": true,
"notNull": true,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "16120F75-6AA7-4483-868D-F07F511BB081",
"id": "0cdd83a0-fa06-4139-9547-0fb8165fde0b"
},
{
"defKey": "pid",
"defName": "上级部门",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"id": "8fb08930-0abf-4410-aa35-a9891c6a81a7"
},
{
"defKey": "sub_count",
"defName": "子部门数目",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
"id": "6b784bad-1a7f-4989-a9db-a9225e6e947b"
},
{
"defKey": "name",
"defName": "名称",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": true,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"id": "210abffa-a4f8-4ce9-8459-29c4948fb2b1"
},
{
"defKey": "dept_sort",
"defName": "排序",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": true,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
"id": "90ed2b15-35d7-4fc5-82cd-aa7e257cf917"
}
],
"correlations": [],
"indexes": []
}
]

View File

@ -51,7 +51,20 @@ export default ({ openTemplate }) => {
const [eidtLoading, setEidtLoading] = useState(false) const [eidtLoading, setEidtLoading] = useState(false)
const [searchLoading, setSearchLoading] = useState(false) const [searchLoading, setSearchLoading] = useState(false)
React.useEffect(() => { React.useEffect(() => {
const params = new URLSearchParams(window.location.search);
const projectId = params.get('projectId');
if (projectId) {
setSpinCard(true)
getModelId(projectId).then((res) => {
if (res.code == 200) {
setSpinCard(false)
const manerDataKey = JSON.parse(res.data.jsonFile)
openTemplate(manerDataKey, res.data.projectName)
}
})
} else {
goin(current, pagesize) goin(current, pagesize)
}
user() user()
}, []) }, [])
// 用户列表 // 用户列表
@ -259,7 +272,7 @@ export default ({ openTemplate }) => {
okText: '确定', okText: '确定',
okType: 'danger', okType: 'danger',
cancelText: '取消', cancelText: '取消',
async onOk () { async onOk() {
await deleteProject(projectId) await deleteProject(projectId)
setTimeout(() => { setTimeout(() => {
message.success('删除成功') message.success('删除成功')
@ -286,6 +299,7 @@ export default ({ openTemplate }) => {
<Form.Item> <Form.Item>
<Button <Button
block block
type='primary'
className="ProCard" className="ProCard"
style={{ width: '200px' }} style={{ width: '200px' }}
onClick={createshowModal} onClick={createshowModal}
@ -338,7 +352,7 @@ export default ({ openTemplate }) => {
}} }}
/> />
</div> </div>
<div style={{ marginTop: '12px',color: "#9093a5" }}>{item.projectDescription}</div> <div style={{ marginTop: '12px', color: "#9093a5" }}>{item.projectDescription}</div>
<DeleteOutlined <DeleteOutlined
title="删除" title="删除"
className="iconstyle" className="iconstyle"

View File

@ -31,3 +31,7 @@
display: flex; display: flex;
justify-content: end; justify-content: end;
} }
.primary-button{
color: @primary-color;
}