Commit 9da5f4cf by zhaochengxiang

批量编辑

parent 29cfb982
import React from 'react' import React from 'react'
import { Tooltip, Typography, Input, Space, Button, Form } from 'antd' import { Tooltip, Typography, Input, Space, Button, Form } from 'antd'
import { SettingOutlined } from '@ant-design/icons'; import { SettingOutlined } from '@ant-design/icons'
import { useClickAway } from 'ahooks'
import { defaultPage, usePage } from '../../../util/hooks/page' import { usePage } from '../../../util/hooks/page'
import Table from '../../../util/Component/Table' import Table from '../../../util/Component/Table'
import { isSzseEnv } from '../../../util' import { getQueryParam, isSzseEnv } from '../../../util'
import { EditableCell } from '../Model/Component/ImportActionTable'
import '../Model/Component/EditModel.less' import '../Model/Component/EditModel.less'
import { async } from 'q';
const mockData = [ const mockData = [
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"", "",
"", "",
...@@ -37,6 +45,13 @@ const mockData = [ ...@@ -37,6 +45,13 @@ const mockData = [
] ]
}, },
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"", "",
"", "",
...@@ -63,6 +78,13 @@ const mockData = [ ...@@ -63,6 +78,13 @@ const mockData = [
] ]
}, },
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"SZ001", "SZ001",
"证券数据资料汇总", "证券数据资料汇总",
...@@ -89,6 +111,13 @@ const mockData = [ ...@@ -89,6 +111,13 @@ const mockData = [
] ]
}, },
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"AK45555", "AK45555",
"AK45555", "AK45555",
...@@ -115,6 +144,13 @@ const mockData = [ ...@@ -115,6 +144,13 @@ const mockData = [
] ]
}, },
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"zc001", "zc001",
"", "",
...@@ -141,6 +177,13 @@ const mockData = [ ...@@ -141,6 +177,13 @@ const mockData = [
] ]
}, },
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"zc00000019", "zc00000019",
"", "",
...@@ -167,6 +210,13 @@ const mockData = [ ...@@ -167,6 +210,13 @@ const mockData = [
] ]
}, },
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"", "",
"问题反馈", "问题反馈",
...@@ -193,6 +243,13 @@ const mockData = [ ...@@ -193,6 +243,13 @@ const mockData = [
] ]
}, },
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"cwb00002", "cwb00002",
"超链接配置表", "超链接配置表",
...@@ -219,6 +276,13 @@ const mockData = [ ...@@ -219,6 +276,13 @@ const mockData = [
] ]
}, },
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"", "",
"货币参数表", "货币参数表",
...@@ -245,6 +309,13 @@ const mockData = [ ...@@ -245,6 +309,13 @@ const mockData = [
] ]
}, },
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"", "",
"", "",
...@@ -271,6 +342,13 @@ const mockData = [ ...@@ -271,6 +342,13 @@ const mockData = [
] ]
}, },
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"sf123", "sf123",
"", "",
...@@ -297,6 +375,13 @@ const mockData = [ ...@@ -297,6 +375,13 @@ const mockData = [
] ]
}, },
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"123", "123",
"", "",
...@@ -323,6 +408,13 @@ const mockData = [ ...@@ -323,6 +408,13 @@ const mockData = [
] ]
}, },
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"", "",
"", "",
...@@ -349,6 +441,13 @@ const mockData = [ ...@@ -349,6 +441,13 @@ const mockData = [
] ]
}, },
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"", "",
"", "",
...@@ -375,6 +474,13 @@ const mockData = [ ...@@ -375,6 +474,13 @@ const mockData = [
] ]
}, },
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"", "",
"", "",
...@@ -401,6 +507,13 @@ const mockData = [ ...@@ -401,6 +507,13 @@ const mockData = [
] ]
}, },
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"", "",
"", "",
...@@ -427,6 +540,13 @@ const mockData = [ ...@@ -427,6 +540,13 @@ const mockData = [
] ]
}, },
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"", "",
"", "",
...@@ -453,6 +573,13 @@ const mockData = [ ...@@ -453,6 +573,13 @@ const mockData = [
] ]
}, },
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"", "",
"", "",
...@@ -479,6 +606,13 @@ const mockData = [ ...@@ -479,6 +606,13 @@ const mockData = [
] ]
}, },
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"INJC001001002001001007478", "INJC001001002001001007478",
"监察数据测试2", "监察数据测试2",
...@@ -505,6 +639,13 @@ const mockData = [ ...@@ -505,6 +639,13 @@ const mockData = [
] ]
}, },
{ {
"resourceExtraAttribute": {
"sortingStatus": null,
"currentProcessor": null,
"taskNO": null,
"resourceStatus": null,
"transferDataAsset": null
},
"elementValues": [ "elementValues": [
"INJC00100100200100100309999", "INJC00100100200100100309999",
"eeee", "eeee",
...@@ -534,7 +675,7 @@ const mockData = [ ...@@ -534,7 +675,7 @@ const mockData = [
const mockElements = [ const mockElements = [
{ {
"id": "617397119e14e673b41d26ac", "id": "6524f17e28089e421c4c38fc",
"type": "基本属性", "type": "基本属性",
"name": "编号", "name": "编号",
"interpretation": "资产统一编号(编号规则待定)", "interpretation": "资产统一编号(编号规则待定)",
...@@ -549,828 +690,80 @@ const mockElements = [ ...@@ -549,828 +690,80 @@ const mockElements = [
"grantAble": null, "grantAble": null,
"globalParam": null, "globalParam": null,
"defaultSelected": null, "defaultSelected": null,
"dataAssetType": "dataAsset", "dataAssetType": "resource",
"value": null, "value": null,
"index": 1, "index": 1,
"rowNum": 0, "rowNum": 0,
"errorMsg": null "errorMsg": null
}, },
{ {
"id": "624e43859e14e62a1ae2e921", "id": "6524f17e28089e421c4c38fe",
"type": "管理属性", "type": "基本属性",
"name": "状态", "name": "中文名称",
"interpretation": "生效、失效", "interpretation": null,
"sample": "使用",
"fillingWay": "手工维护",
"manualMaintain": "是",
"attributeGetway": "默认生效",
"custom": "是",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": "是",
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 2,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26ad",
"type": "基本属性",
"name": "中文名称",
"interpretation": null,
"sample": null,
"fillingWay": "文件导入或者手工输入",
"manualMaintain": "是",
"attributeGetway": "文件导入",
"custom": "否",
"metadataItem": null,
"selectAble": "否",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": "是",
"dataAssetType": "dataAsset",
"value": null,
"index": 3,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26ae",
"type": "基本属性",
"name": "英文名称",
"interpretation": null,
"sample": null,
"fillingWay": "文件导入或者手工输入",
"manualMaintain": "是",
"attributeGetway": "文件导入",
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": "是",
"dataAssetType": "dataAsset",
"value": null,
"index": 4,
"rowNum": 0,
"errorMsg": null
},
{
"id": "62e0dbc79e14e60760053125",
"type": "基本属性",
"name": "描述",
"interpretation": null,
"sample": null,
"fillingWay": "文件导入或者手工输入",
"manualMaintain": "是",
"attributeGetway": "文件导入",
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 5,
"rowNum": 0,
"errorMsg": null
},
{
"id": "6251201b9e14e66ebbcfae96",
"type": "内容属性",
"name": "资产路径",
"interpretation": null,
"sample": null,
"fillingWay": null,
"manualMaintain": "是",
"attributeGetway": null,
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 6,
"rowNum": 0,
"errorMsg": null
},
{
"id": "6251201b9e14e66ebbcfae97",
"type": "技术属性",
"name": "资源状态",
"interpretation": null,
"sample": null,
"fillingWay": null,
"manualMaintain": "是",
"attributeGetway": null,
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 7,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26af",
"type": "基本属性",
"name": "表现形式",
"interpretation": "数据表、接口、服务、文件、逻辑资产",
"sample": "数据表(提供链接)",
"fillingWay": "系统生成",
"manualMaintain": "否",
"attributeGetway": "系统根据关联的元数据类型自动填入",
"custom": "是",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 8,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26b0",
"type": "基本属性",
"name": "访问路径",
"interpretation": "protocal/IP:port/path",
"sample": "ftp://10.1.1.1/abc",
"fillingWay": "手工维护",
"manualMaintain": "是",
"attributeGetway": "文件导入",
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "是",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 9,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26b1",
"type": "基本属性",
"name": "存储位置",
"interpretation": "资产的存储路径",
"sample": "/home/file",
"fillingWay": "系统生成",
"manualMaintain": "否",
"attributeGetway": "元数据信息中提取",
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 10,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26b2",
"type": "基本属性",
"name": "来源系统",
"interpretation": "数据的来源系统,比如结算系统,交易系统,BPM",
"sample": "BPM",
"fillingWay": "系统生成",
"manualMaintain": "是",
"attributeGetway": "血缘分析中上游表的所属系统",
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 11,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26b3",
"type": "技术属性",
"name": "加载形式",
"interpretation": "工具导入、脚本",
"sample": "脚本",
"fillingWay": "系统生成",
"manualMaintain": "否",
"attributeGetway": "ETL解析涉及的为脚本加载,其余的默认工具导入?",
"custom": "是",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 12,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26b4",
"type": "技术属性",
"name": "数据规模",
"interpretation": "记录条数",
"sample": "10000",
"fillingWay": "系统生成",
"manualMaintain": "否",
"attributeGetway": "元数据采集",
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 13,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26b5",
"type": "技术属性",
"name": "数据大小",
"interpretation": "容量:GB\\MB等",
"sample": "10GB",
"fillingWay": "系统生成",
"manualMaintain": "否",
"attributeGetway": "元数据采集",
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 14,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26b6",
"type": "技术属性",
"name": "数据时间",
"interpretation": "内容的时间段",
"sample": "2020/1~2020/12",
"fillingWay": "手工维护",
"manualMaintain": "是",
"attributeGetway": "能否提供准则来处理?",
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "是",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 15,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26b7",
"type": "技术属性",
"name": "所属系统",
"interpretation": "资产所在系统名称",
"sample": null,
"fillingWay": "系统生成",
"manualMaintain": "否",
"attributeGetway": "元数据所属的系统",
"custom": "是",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 16,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26b8",
"type": "技术属性",
"name": "遵从标准",
"interpretation": "JR/T 0177.1-2020",
"sample": "提供具体的标准链接",
"fillingWay": "提供列表选择",
"manualMaintain": "是",
"attributeGetway": "文件导入",
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "是",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 17,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26b9",
"type": "技术属性",
"name": "所属层次",
"interpretation": "ETL中的模型分层",
"sample": "ods、dwd、dws、ads",
"fillingWay": "提供列表选择",
"manualMaintain": "是",
"attributeGetway": "文件导入",
"custom": "是",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 18,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26ba",
"type": "技术属性",
"name": "更新频度",
"interpretation": "小时、天、月",
"sample": "天",
"fillingWay": "系统生成",
"manualMaintain": "否",
"attributeGetway": "ETL作业调度分析",
"custom": "是",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 19,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26bb",
"type": "技术属性",
"name": "更新方式",
"interpretation": "全量、增量",
"sample": "增量",
"fillingWay": "提供列表选择",
"manualMaintain": "是",
"attributeGetway": "文件导入",
"custom": "是",
"metadataItem": null,
"selectAble": "是",
"foldAble": "是",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 20,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26bc",
"type": "技术属性",
"name": "更新时点",
"interpretation": "资产更新时间",
"sample": "每天 21:00",
"fillingWay": "系统生成",
"manualMaintain": "否",
"attributeGetway": "ETL作业调度分析",
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 21,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26bd",
"type": "业务属性",
"name": "使用方",
"interpretation": "资产使用业务方",
"sample": "风控、监察",
"fillingWay": "手工维护",
"manualMaintain": "是",
"attributeGetway": "文件导入",
"custom": "否",
"metadataItem": null,
"selectAble": "否",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 22,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26be",
"type": "质量属性",
"name": "质量情况",
"interpretation": "高、中、低",
"sample": "高",
"fillingWay": "系统生成",
"manualMaintain": "是",
"attributeGetway": "从质量管理模块中的质量评估中获取",
"custom": "是",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": "是",
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 23,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26bf",
"type": "使用属性",
"name": "标签",
"interpretation": "资产所带的标签",
"sample": "高管、董事",
"fillingWay": "系统生成",
"manualMaintain": "否",
"attributeGetway": "根据实际打标签情况而定",
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 24,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26c0",
"type": "使用属性",
"name": "使用频率",
"interpretation": "资产使用的频率",
"sample": "3000/天",
"fillingWay": "系统生成",
"manualMaintain": "否",
"attributeGetway": "日志分析",
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 25,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26c1",
"type": "使用属性",
"name": "使用次数",
"interpretation": "资产累计使用次数",
"sample": "65000",
"fillingWay": "系统生成",
"manualMaintain": "否",
"attributeGetway": "日志分析",
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 26,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26c2",
"type": "安全属性",
"name": "共享级别",
"interpretation": "公开、授权访问",
"sample": "公开",
"fillingWay": "手工维护",
"manualMaintain": "是",
"attributeGetway": "默认公开",
"custom": "是",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 27,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26c3",
"type": "安全属性",
"name": "信息安全等级",
"interpretation": "按所内等级定义",
"sample": "一级",
"fillingWay": "手工维护",
"manualMaintain": "是",
"attributeGetway": "默认一级",
"custom": "是",
"metadataItem": null,
"selectAble": "否",
"foldAble": "否",
"grantAble": "是",
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 28,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26c4",
"type": "管理属性",
"name": "所属部门",
"interpretation": "资产管理的所属部门",
"sample": "市场监察部",
"fillingWay": "系统生成",
"manualMaintain": "否",
"attributeGetway": "取自所属系统中‘使用部门’",
"custom": "是",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 29,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26c5",
"type": "管理属性",
"name": "维护方",
"interpretation": "资产管理负责人",
"sample": "张大彪",
"fillingWay": "手工维护",
"manualMaintain": "是",
"attributeGetway": "系统信息中运维信息的运维负责人/手工维护",
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "是",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 30,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26c6",
"type": "管理属性",
"name": "创建时间",
"interpretation": "资产创建时间",
"sample": null,
"fillingWay": "系统生成",
"manualMaintain": "否",
"attributeGetway": "系统生成时间",
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 31,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26c7",
"type": "管理属性",
"name": "创建人",
"interpretation": "资产创建人",
"sample": "赵五",
"fillingWay": "系统生成",
"manualMaintain": "否",
"attributeGetway": "导入或者资产创建的用户",
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 32,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26c8",
"type": "管理属性",
"name": "最近更新时间",
"interpretation": "资产最近更新时间",
"sample": null, "sample": null,
"fillingWay": "系统生成", "fillingWay": "文件导入或者手工输入",
"manualMaintain": "否",
"attributeGetway": "系统更新时间",
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 33,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26c9",
"type": "管理属性",
"name": "更新人",
"interpretation": "资产更新人",
"sample": "李四",
"fillingWay": "系统生成",
"manualMaintain": "否",
"attributeGetway": "导入或者修改更新的系统时间",
"custom": "否",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 34,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26ca",
"type": "管理属性",
"name": "最新状态",
"interpretation": "生效、失效",
"sample": "使用",
"fillingWay": "手工维护",
"manualMaintain": "是",
"attributeGetway": "默认生效",
"custom": "是",
"metadataItem": null,
"selectAble": "是",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 35,
"rowNum": 0,
"errorMsg": null
},
{
"id": "617397119e14e673b41d26cb",
"type": "管理属性",
"name": "来源单位",
"interpretation": "中国结算、上交所等外部单位",
"sample": "上交所",
"fillingWay": "手工维护",
"manualMaintain": "是", "manualMaintain": "是",
"attributeGetway": "文件导入", "attributeGetway": "文件导入",
"custom": "", "custom": "",
"metadataItem": null, "metadataItem": null,
"selectAble": "", "selectAble": "",
"foldAble": "否", "foldAble": "否",
"grantAble": null, "grantAble": null,
"globalParam": null, "globalParam": null,
"defaultSelected": null, "defaultSelected": "是",
"dataAssetType": "dataAsset", "dataAssetType": "resource",
"value": null, "value": null,
"index": 36, "index": 3,
"rowNum": 0, "rowNum": 0,
"errorMsg": null "errorMsg": null
}, },
{ {
"id": "617397119e14e673b41d26cc", "id": "6524f17e28089e421c4c38ff",
"type": "管理属性", "type": "基本属性",
"name": "发起人", "name": "英文名称",
"interpretation": "申请资产发布的发起人", "interpretation": null,
"sample": "张三", "sample": null,
"fillingWay": "手工维护", "fillingWay": "文件导入或者手工输入",
"manualMaintain": "是", "manualMaintain": "是",
"attributeGetway": "文件导入", "attributeGetway": "文件导入",
"custom": "否", "custom": "否",
"metadataItem": null, "metadataItem": null,
"selectAble": "是", "selectAble": "是",
"foldAble": "", "foldAble": "",
"grantAble": null, "grantAble": null,
"globalParam": null, "globalParam": null,
"defaultSelected": null, "defaultSelected": "是",
"dataAssetType": "dataAsset", "dataAssetType": "resource",
"value": null, "value": null,
"index": 37, "index": 4,
"rowNum": 0, "rowNum": 0,
"errorMsg": null "errorMsg": null
}, },
{ {
"id": "617397119e14e673b41d26cd", "id": "6524f17e28089e421c4c3900",
"type": "管理属性", "type": "基本属性",
"name": "发起理由", "name": "描述",
"interpretation": "发起理由", "interpretation": null,
"sample": null, "sample": null,
"fillingWay": "手工维护", "fillingWay": "文件导入或者手工输入",
"manualMaintain": "是", "manualMaintain": "是",
"attributeGetway": "文件导入", "attributeGetway": "文件导入",
"custom": "否", "custom": "否",
"metadataItem": null, "metadataItem": null,
"selectAble": "是", "selectAble": "是",
"foldAble": "", "foldAble": "",
"grantAble": null, "grantAble": null,
"globalParam": null, "globalParam": null,
"defaultSelected": null, "defaultSelected": null,
"dataAssetType": "dataAsset", "dataAssetType": "resource",
"value": null, "value": null,
"index": 38, "index": 5,
"rowNum": 0, "rowNum": 0,
"errorMsg": null "errorMsg": null
}, },
{ {
"id": "617397129e14e673b41d26ce", "id": "6526351b88cbea456cf309a1",
"type": "内容属性", "type": "内容属性",
"name": "资产项", "name": "资产项",
"interpretation": "由来自不同资产实体(表、标准、接口等等)的属性构成,包含一个或多个", "interpretation": "由来自不同资产实体(表、标准、接口等等)的属性构成,包含一个或多个",
...@@ -1385,93 +778,72 @@ const mockElements = [ ...@@ -1385,93 +778,72 @@ const mockElements = [
"grantAble": null, "grantAble": null,
"globalParam": null, "globalParam": null,
"defaultSelected": "是", "defaultSelected": "是",
"dataAssetType": "dataAsset", "dataAssetType": "resource",
"value": null, "value": null,
"index": 39, "index": 39,
"rowNum": 0, "rowNum": 0,
"errorMsg": null "errorMsg": null
},
{
"id": "621de196bf54a3da3862de10",
"type": "内容属性",
"name": "数据类型",
"interpretation": "数据类型",
"sample": null,
"fillingWay": null,
"manualMaintain": "是",
"attributeGetway": "系统根据资产项情况自动生成",
"custom": "否",
"metadataItem": null,
"selectAble": "否",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 40,
"rowNum": 0,
"errorMsg": null
},
{
"id": "620c6a8550f1554a28d80563",
"type": "内容属性",
"name": "特殊要素(改动)",
"interpretation": "由来自不同资产实体(表、标准、接口等等)的属性构成,包含一个或多个",
"sample": "表A1的字段B3,表A2的字段B2",
"fillingWay": "系统生成",
"manualMaintain": "是",
"attributeGetway": "系统根据资产项情况自动生成",
"custom": "否",
"metadataItem": null,
"selectAble": "否",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 41,
"rowNum": 0,
"errorMsg": null
},
{
"id": "6219ee9c9e14e61bf9de2c0c",
"type": "内容属性",
"name": "流程进度",
"interpretation": "流程进度",
"sample": null,
"fillingWay": null,
"manualMaintain": "是",
"attributeGetway": "系统根据资产项情况自动生成",
"custom": "否",
"metadataItem": null,
"selectAble": "否",
"foldAble": "否",
"grantAble": null,
"globalParam": null,
"defaultSelected": null,
"dataAssetType": "dataAsset",
"value": null,
"index": 42,
"rowNum": 0,
"errorMsg": null
} }
] ]
const FC = (props) => { const FC = (props) => {
const ids = getQueryParam('ids', props.location?.search)
const elementIds = getQueryParam('elementIds', props.location?.search)
const [action, setAction] = React.useState('edit')
const editAssetsRef = React.useRef()
const cancel = (e) => {
e.stopPropagation()
setAction('detail')
}
const edit = (e) => {
e.stopPropagation()
setAction('edit')
}
const save = async (e) => {
e.stopPropagation()
try {
const modifyData = await editAssetsRef.current?.getModifyData()
setAction('detail')
} catch(e) {
}
}
return ( return (
<div className='edit-model position-relative'> <div className='edit-model position-relative'>
<div className='edit-header'> <div className='edit-header'>
<span style={{ fontSize: 16, fontWeight: 'bold', color: '#fff' }}>资产批量编辑</span> <span style={{ fontSize: 16, fontWeight: 'bold', color: '#fff' }}>资产批量编辑</span>
</div> </div>
<div className='edit-container'> <div className='edit-container'>
<div className='edit-container-card'> <div className='edit-container-card' style={{ padding: '20px 20px 0' }}>
<EditAssets /> <EditAssets ref={editAssetsRef} action={action} ids={ids} elementIds={elementIds} />
</div> </div>
</div> </div>
<div className='edit-footer'> <div className='edit-footer'>
{
action === 'edit' ? <Space>
<Button onClick={cancel}>取消</Button>
<Button
type='primary'
onClick={save}
danger
>
保存
</Button>
</Space> : <Space>
<Button
type='primary'
onClick={edit}
danger
>
编辑
</Button>
</Space>
}
</div> </div>
</div> </div>
) )
...@@ -1479,14 +851,27 @@ const FC = (props) => { ...@@ -1479,14 +851,27 @@ const FC = (props) => {
export default FC export default FC
const EditAssets = (props) => { export const EditAssets = React.forwardRef(function ({ action, ids, elementIds }, ref) {
const [elements, setElements] = React.useState(mockElements) const [elements, setElements] = React.useState()
const [data, setData] = React.useState(mockData) const [data, setData] = React.useState()
const [modifyData, setModifyData] = React.useState(mockData) const [modifyData, setModifyData] = React.useState()
const [loading, setLoading] = React.useState(false) const [loading, setLoading] = React.useState(false)
const [loadingElements, setLoadingElements] = React.useState(false)
const [editingKey, setEditingKey] = React.useState('')
const [page, setPage] = usePage() const [page, setPage] = usePage()
const [form] = Form.useForm() const [form] = Form.useForm()
const [colBatchEditForm] = Form.useForm()
const tableRef = React.useRef()
const isEditing = (record) => record.id === editingKey
React.useImperativeHandle(ref, () => ({
getModifyData: async () => {
await save()
return modifyData
},
}), [form, editingKey, modifyData])
const getColumnBatchEditProps = (title, dataIndex) => ({ const getColumnBatchEditProps = (title, dataIndex) => ({
filterDropdown: ({ confirm }) => ( filterDropdown: ({ confirm }) => (
...@@ -1499,7 +884,7 @@ const EditAssets = (props) => { ...@@ -1499,7 +884,7 @@ const EditAssets = (props) => {
> >
<h4 className='mb-3'>批量编辑</h4> <h4 className='mb-3'>批量编辑</h4>
<Form <Form
form={form} form={colBatchEditForm}
labelCol={{ span: 6 }} labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }} wrapperCol={{ span: 18 }}
autoComplete="off" autoComplete="off"
...@@ -1530,7 +915,8 @@ const EditAssets = (props) => { ...@@ -1530,7 +915,8 @@ const EditAssets = (props) => {
type="primary" type="primary"
onClick={ async () => { onClick={ async () => {
try { try {
const rows = await form.validateFields() await save()
const rows = await colBatchEditForm.validateFields()
const newModifyData = [...modifyData] const newModifyData = [...modifyData]
const index = parseInt(dataIndex.slice('element'.length)) const index = parseInt(dataIndex.slice('element'.length))
for (const item of newModifyData) { for (const item of newModifyData) {
...@@ -1559,12 +945,11 @@ const EditAssets = (props) => { ...@@ -1559,12 +945,11 @@ const EditAssets = (props) => {
const newColumns = [] const newColumns = []
let index = 0 let index = 0
for (const element of elements??[]) { for (const element of elements??[]) {
const col = { let col = {
title: element.name, title: element.name,
dataIndex: `element${index}`, dataIndex: `element${index}`,
ellipsis: true, ellipsis: true,
width: 120, width: 120,
...getColumnBatchEditProps(element.name, `element${index}`),
render: (text, record) => { render: (text, record) => {
return ( return (
<Tooltip title={text}> <Tooltip title={text}>
...@@ -1575,26 +960,36 @@ const EditAssets = (props) => { ...@@ -1575,26 +960,36 @@ const EditAssets = (props) => {
); );
} }
} }
++index if (element.name === '中文名称') {
if (element.name === '编号') {
col.width = 60
} else if (element.name === '中文名称') {
col.width = isSzseEnv ? 230 : 160 col.width = isSzseEnv ? 230 : 160
} else if (element.name === '英文名称') { } else if (element.name === '英文名称') {
col.width = isSzseEnv ? 224 : 160 col.width = isSzseEnv ? 224 : 160
} else if (element.name === '资源项') {
col.width = isSzseEnv ? 250 : 120
} }
col.onCell = (record) => ({
record,
inputType: 'text',
dataIndex: col.dataIndex,
colTitle: col.title,
editing: isEditing(record),
})
if (action === 'edit') {
col = {
...col,
...getColumnBatchEditProps(element.name, `element${index}`)
}
}
index++
newColumns.push(col) newColumns.push(col)
} }
return newColumns return newColumns
}, [elements, getColumnBatchEditProps]) }, [elements, getColumnBatchEditProps, isEditing, action])
const tableData = React.useMemo(() => { const tableData = React.useMemo(() => {
const newTableData = [] const newTableData = []
for (const item of (data??[])) { for (const item of (modifyData??[])) {
const newAsset = {...item} const newAsset = {...item}
let index = 0 let index = 0
for (const elementValue of (item.elementValues??[])) { for (const elementValue of (item.elementValues??[])) {
...@@ -1607,19 +1002,99 @@ const EditAssets = (props) => { ...@@ -1607,19 +1002,99 @@ const EditAssets = (props) => {
return newTableData return newTableData
}, [modifyData]) }, [modifyData])
useClickAway(() => {
save()
}, tableRef)
React.useEffect(() => {
getElements()
}, [elementIds])
React.useEffect(() => {
getAssets()
}, [ids, action])
React.useEffect(() => {
setEditingKey('')
}, [action])
const getElements = () => {
setLoadingElements(true)
setTimeout(() => {
setLoadingElements(false)
setElements(mockElements)
})
}
const getAssets = () => {
setLoading(true)
setTimeout(() => {
setLoading(false)
setData(mockData)
setModifyData(mockData)
})
}
const save = async () => {
if (!editingKey) {
return true
}
try {
const row = await form.validateFields()
setEditingKey(prevEditingKey => {
const newModifyData = [...modifyData]
const index = newModifyData.findIndex(item => item.id === prevEditingKey)
if (index > -1) {
const item = newModifyData[index]
for (const dataIndex in row) {
const elementIndex = parseInt(dataIndex.slice('element'.length))
item.elementValues[elementIndex] = row[`${dataIndex}`]
}
setModifyData(newModifyData)
return ''
}
return prevEditingKey
})
} catch (e) {
throw new Error()
}
}
return ( return (
<Table <div ref={tableRef}>
maxHeight='calc(100vh - 265px)' <Form form={form} component={false}>
loading={loading} <Table
columns={columns} ref={tableRef}
dataSource={tableData} maxHeight='calc(100vh - 245px)'
pageSize={page.pageSize} pageNum={page.pageNum} total={(data??[]).length} loading={loading||loadingElements}
onRowClick={(event, value) => { columns={columns}
dataSource={tableData}
}} components={{
onPaginate={(page, pageSize) => { body: {
setPage({ pageNum: page, pageSize }) cell: EditableCell,
}} },
/> }}
pageSize={page.pageSize} pageNum={page.pageNum} total={(data??[]).length}
onRowClick={async (event, value) => {
if (action==='edit' && value?.id !== editingKey) {
try {
await save()
form?.setFieldsValue(value)
setEditingKey(value?.id)
} catch(e) {
}
}
}}
onPaginate={(page, pageSize) => {
setPage({ pageNum: page, pageSize })
}}
/>
</Form>
</div>
) )
} })
\ No newline at end of file \ No newline at end of file
...@@ -165,7 +165,6 @@ export const EditableCell = ({ ...@@ -165,7 +165,6 @@ export const EditableCell = ({
children, children,
...restProps ...restProps
}) => { }) => {
let editingComponent = null; let editingComponent = null;
if (editing) { if (editing) {
let inputNode = <InputDebounce />; let inputNode = <InputDebounce />;
......
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