Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
csbr-daop
/
fe-data-trusted-space
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
9d37357a
authored
2025-06-18 17:35:33 +0800
by
fanguang
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'develop-fan' into develop
2 parents
470f418f
c8c31d56
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2442 additions
and
202 deletions
.env.development
src/api/modules/dataMetaService.ts
src/views/data_meta/components/dictFileds.vue
src/views/data_meta/standard-codetable.vue
src/views/data_meta/standard-codetable_old.vue
.env.development
View file @
9d37357
...
...
@@ -5,6 +5,7 @@ VITE_APP_TITLE = 数据资产管理系统
# VITE_API_BASEURL = https://swzl-test.csbr.cn/api
# VITE_API_BASEURL = http://localhost:9000
VITE_API_BASEURL = http://192.168.6.20:28052/
# VITE_API_BASEURL = http://192.168.6.20:8052/
VITE_IDASS_BASEURL = https://idaas-test.csbr.cn/login
...
...
@@ -81,6 +82,9 @@ VITE_APP_ATTACHMENT_TEMPLATE = ms-daop-personel-service
#人员服务
VITE_APP_PERSONAL_URL = 'ms-daop-personel-service'
#元数据标准
VITE_APP_STANDARD_URL = 'ms-daop-meta-standard-service'
#流通平台地址
VITE_APP_CIRCULATION = http://192.168.6.20:18052/
# 测试环境访问地址
...
...
src/api/modules/dataMetaService.ts
View file @
9d37357
...
...
@@ -249,3 +249,61 @@ export const delMetaDataSource = (databaseGuid) => request({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_PLAN_BASEURL
}
/meta-collect-task/del-by-database-guid?databaseGuid=
${
databaseGuid
}
`
,
method
:
'delete'
,
})
/** 元数据-标准代码分页查询 */
export
const
getStandardCodeList
=
(
params
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_STANDARD_URL
}
/standard-code/page-list`
,
method
:
'post'
,
data
:
params
})
/** 元数据-标准代码新增 */
export
const
saveStandardCode
=
(
params
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_STANDARD_URL
}
/standard-code/save`
,
method
:
'post'
,
data
:
params
})
/** 元数据-标准代码修改 */
export
const
updateStandardCode
=
(
params
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_STANDARD_URL
}
/standard-code/update`
,
method
:
'put'
,
data
:
params
})
/** 元数据-标准代码详情 */
export
const
getStandardCodeDetail
=
(
guid
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_STANDARD_URL
}
/standard-code/detail?guid=
${
guid
}
`
,
method
:
'get'
,
})
/** 元数据-标准代码删除 */
export
const
deleteStandardCode
=
(
params
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_STANDARD_URL
}
/standard-code/delete`
,
method
:
'delete'
,
data
:
params
})
/** 元数据-查询标准列表 */
export
const
getStandardCodeStandard
=
(
standardTypeCode
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_STANDARD_URL
}
/standard-code/get-standard?standardTypeCode=
${
standardTypeCode
}
`
,
method
:
'get'
})
/** 元数据-查询代码列表 */
export
const
getStandardCodeDataList
=
(
params
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_STANDARD_URL
}
/standard-code/data/get-data`
,
method
:
'post'
,
data
:
params
})
/** 元数据-查询代码字段数据 */
export
const
getStandardCodeFields
=
(
standardGuid
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_STANDARD_URL
}
/standard-code/get-field?standardGuid=
${
standardGuid
}
`
,
method
:
'get'
})
/** 元数据-保存标准代码数据 */
export
const
saveStandardCodeFieldsData
=
(
params
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_STANDARD_URL
}
/standard-code/data/save-data`
,
method
:
'post'
,
data
:
params
})
/** 元数据-删除标准代码数据 */
export
const
deleteStandardCodeFieldsData
=
(
params
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_STANDARD_URL
}
/standard-code/data/remove-data`
,
method
:
'post'
,
data
:
params
})
\ No newline at end of file
...
...
src/views/data_meta/components/dictFileds.vue
0 → 100644
View file @
9d37357
<route
lang=
"yaml"
>
name: dictFileds
</route>
<
script
lang=
"ts"
setup
name=
"dictFileds"
>
import
{
ref
}
from
'vue'
import
router
from
'@/router'
import
{
ElMessage
,
ElMessageBox
}
from
"element-plus"
;
import
Table
from
'@/components/Table/index.vue'
// import Dialog from '@/components/Dialog/index.vue'
import
useCatchStore
from
"@/store/modules/catch"
;
import
{
chunk
}
from
'@/utils/common'
import
{
getStandardCodeDataList
,
getStandardCodeFields
,
saveStandardCodeFieldsData
,
deleteStandardCodeFieldsData
}
from
'@/api/modules/dataMetaService'
import
{
saveDictionaryData
,
getDictionaryFileds
,
deleteDictionaryData
,
checkDictionaryData
,
showDictionary
,
getDictionaryRuleData
}
from
'@/api/modules/dataInventory'
;
const
emits
=
defineEmits
([
"exportData"
])
const
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
cacheStore
=
useCatchStore
()
const
standardGuid
=
ref
(
""
)
const
tableSearchInput
=
ref
(
''
)
const
tableFields
:
any
=
ref
([])
const
orginData
:
any
=
ref
([])
const
currTableData
:
any
=
ref
<
Object
>
({});
const
selectRowData
=
ref
([])
const
page
=
ref
({
limit
:
50
,
curr
:
1
,
// sizes: [
// { label: "100", value: 100 },
// { label: "200", value: 200 },
// { label: "300", value: 300 },
// { label: "400", value: 400 },
// { label: "500", value: 500 },
// ],
});
const
tableChunkData
:
any
=
ref
([])
const
tableData
:
any
=
ref
([])
const
tableInfo
:
any
=
ref
({
id
:
'data-fileds-table'
,
multiple
:
true
,
fields
:
[],
data
:
[],
page
:
{
type
:
"count"
,
rows
:
0
,
...
page
.
value
,
},
// showPage: false,
actionInfo
:
{
label
:
"操作"
,
type
:
"btn"
,
width
:
92
,
btns
:
(
scope
)
=>
{
return
[
{
label
:
"编辑"
,
value
:
"edit"
,
visible
:
scope
.
row
[
'STATE'
]
!==
'Running'
},
{
label
:
"删除"
,
value
:
"remove"
,
visible
:
scope
.
row
[
'STATE'
]
!==
'Running'
},
// { label: "保存", value: "save", visible: scope.row['STATE'] === 'Running' },
{
label
:
"取消"
,
value
:
"cancel"
,
visible
:
scope
.
row
[
'STATE'
]
===
'Running'
},
]
},
},
editInfo
:
{},
loading
:
false
})
const
uploadFiles
=
ref
([])
const
uploadInfo
=
ref
({
type
:
'upload'
,
title
:
''
,
col
:
''
,
uploadInfo
:
{
id
:
'upload-file-form'
,
type
:
'panel'
,
action
:
''
,
auto
:
false
,
cover
:
true
,
fileList
:
[],
accept
:
'.xlsx, .xls'
,
triggerBtn
:
{
label
:
'导入'
,
value
:
'import_file'
,
icon
:
'Upload'
,
},
tips
:
'当前支持xls、xlsx文件,默认使用第一个sheet'
},
})
const
dialogInfo
=
ref
({
visible
:
false
,
size
:
640
,
direction
:
"column"
,
header
:
{
title
:
"新建"
,
},
type
:
''
,
contents
:
[
uploadInfo
.
value
],
footer
:
{
visible
:
true
,
btns
:
[
{
type
:
"default"
,
label
:
"取消"
,
value
:
"cancel"
},
{
type
:
"primary"
,
label
:
"开始导入"
,
value
:
"submit"
},
],
},
})
const
getFirstPageData
=
()
=>
{
toSearch
({})
}
const
toSearch
=
(
val
:
any
,
clear
:
boolean
=
false
)
=>
{
let
params
=
{
pageIndex
:
1
,
pageSize
:
-
1
,
standardGuid
:
standardGuid
.
value
}
getTableData
(
params
);
};
const
getTableData
=
(
params
)
=>
{
tableInfo
.
value
.
loading
=
true
Promise
.
all
([
getStandardCodeFields
(
standardGuid
.
value
),
getStandardCodeDataList
(
params
)]).
then
((
resList
:
any
)
=>
{
console
.
log
(
resList
)
let
schemaDataVOS
=
resList
[
0
].
data
||
[]
let
jsonArray
=
resList
[
1
].
data
.
records
||
[]
setUploadDataInfo
({
schemaDataVOS
,
jsonArray
},
true
)
}).
finally
(()
=>
tableInfo
.
value
.
loading
=
false
)
};
const
tableSelectionChange
=
(
val
,
tId
)
=>
{
selectRowData
.
value
=
val
;
};
const
tablePageChange
=
(
info
)
=>
{
page
.
value
.
curr
=
Number
(
info
.
curr
);
if
(
page
.
value
.
limit
!=
Number
(
info
.
limit
))
{
page
.
value
.
limit
=
Number
(
info
.
limit
);
chunkData
()
}
else
{
tableData
.
value
=
tableChunkData
.
value
[
page
.
value
.
curr
-
1
]
tableInfo
.
value
.
data
=
tableData
.
value
tableInfo
.
value
.
page
.
limit
=
page
.
value
.
limit
tableInfo
.
value
.
page
.
curr
=
page
.
value
.
curr
}
};
const
toolBtnClick
=
(
btn
)
=>
{
console
.
log
(
'btnType'
,
btn
)
const
type
=
btn
.
value
if
(
type
==
'export'
)
{
exportData
()
}
else
if
(
type
==
'import'
)
{
const
info
=
{
type
:
'dictionary'
,
standardGuid
:
standardGuid
.
value
}
cacheStore
.
setCatch
(
'uploadSetting'
,
info
)
nextTick
(()
=>
{
router
.
push
({
path
:
'/data-inventory/data-dictionary/import-file'
,
});
})
}
else
if
(
type
==
'submit'
)
{
saveData
()
}
else
if
(
type
==
'add_row'
)
{
const
params
=
{
guid
:
standardGuid
.
value
}
getDictionaryRuleData
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
const
data
=
res
.
data
??
{}
let
rowInfo
:
any
=
{}
tableFields
.
value
.
map
(
item
=>
{
rowInfo
[
item
.
field
]
=
data
[
item
.
field
]
??
''
})
rowInfo
.
guid
=
undefined
;
rowInfo
.
STATE
=
'Running'
rowInfo
.
STATUS
=
'edit'
rowInfo
.
ROWID
=
`upload_
${
tableData
.
value
.
length
}
`
tableData
.
value
.
unshift
(
rowInfo
)
orginData
.
value
.
unshift
(
rowInfo
)
tableInfo
.
value
.
page
.
rows
=
tableData
.
value
.
length
// orginData.value.unshift(rowInfo)
// page.value.curr = 1
// chunkData()
}
else
{
ElMessage
({
type
:
'error'
,
message
:
res
.
msg
})
}
})
}
}
const
tableBtnClick
=
(
scope
,
btn
)
=>
{
const
type
=
btn
.
value
;
let
row
=
scope
.
row
;
currTableData
.
value
=
row
;
if
(
type
==
"edit"
)
{
row
.
STATE
=
'Running'
row
.
STATUS
=
'edit'
tableData
.
value
[
scope
.
$index
]
=
row
}
else
if
(
type
==
'save'
)
{
saveData
(
scope
)
}
else
if
(
type
==
'cancel'
)
{
if
(
row
.
guid
!=
undefined
)
{
// row = orginData.value[(page.value.curr - 1) * page.value.limit + scope.$index]
row
=
JSON
.
parse
(
JSON
.
stringify
(
orginData
.
value
[
scope
.
$index
]))
row
.
STATE
=
''
row
.
STATUS
=
''
tableData
.
value
[
scope
.
$index
]
=
row
}
else
{
tableData
.
value
.
splice
(
scope
.
$index
,
1
)
orginData
.
value
.
splice
(
scope
.
$index
,
1
)
// orginData.value.splice((page.value.curr - 1) * page.value.limit + scope.$index, 1)
// if (scope.$index == 0) {
// page.value.curr = (page.value.curr - 1 > 1) ? page.value.curr - 1 : 1
// }
// chunkData()
}
tableInfo
.
value
.
page
.
rows
=
tableData
.
value
.
length
}
else
if
(
type
==
'remove'
)
{
open
(
"是否确定删除所选数据?"
,
"warning"
);
}
};
const
onUpload
=
(
file
,
fileList
)
=>
{
uploadFiles
.
value
=
fileList
}
const
uploadBtnClick
=
(
btn
)
=>
{
exportData
(
'model'
)
}
const
exportData
=
(
type
:
any
=
null
)
=>
{
emits
(
'exportData'
,
type
)
}
const
importData
=
(
file
:
any
=
null
)
=>
{
let
params
=
new
FormData
()
if
(
file
)
{
params
.
append
(
"file"
,
file
.
raw
);
}
else
{
if
(
uploadFiles
.
value
.
length
)
{
uploadFiles
.
value
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
params
.
append
(
"file"
,
item
.
raw
);
});
}
}
params
.
append
(
"standardGuid"
,
standardGuid
.
value
);
showDictionary
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
dialogInfo
.
value
.
visible
=
false
let
data
=
res
.
data
??
[]
// data.map((item: any, i) => {
// item.index = tableData.value.length + i
// })
const
tData
=
{
jsonArray
:
data
}
setUploadDataInfo
(
tData
)
// saveData(null, tData)
}
else
{
ElMessage
({
type
:
"error"
,
message
:
res
.
msg
,
});
// dialogInfo.value.footer.btns.map((item: any) => delete item.disabled)
}
}).
catch
(()
=>
{
// dialogInfo.value.footer.btns.map((item: any) => delete item.disabled)
});
}
const
checkSave
=
()
=>
{
const
toSaveData
=
tableData
.
value
.
filter
(
item
=>
item
.
STATE
===
'Running'
)
return
toSaveData
.
length
==
0
?
true
:
false
}
const
checkParamsData
=
(
scope
:
any
=
null
)
=>
{
let
addJsonArray
:
any
=
[],
upJsonArray
:
any
=
[],
jsonArray
:
any
=
[],
pass
=
true
let
passArr
=
scope
?
[
scope
.
row
]
:
tableData
.
value
passArr
.
map
((
item
,
index
)
=>
{
const
obj
=
JSON
.
parse
(
JSON
.
stringify
(
item
))
delete
obj
.
STATUS
delete
obj
.
NOTES
delete
obj
.
STATE
delete
obj
.
ROWID
// if (item.STATE === 'Running') {
for
(
var
i
in
obj
)
{
if
(
obj
[
i
]
==
''
)
{
pass
=
false
}
}
// }
if
(
obj
.
guid
!==
undefined
)
{
upJsonArray
.
push
(
obj
)
}
else
{
addJsonArray
.
push
(
obj
)
}
if
(
scope
)
{
// obj.index = scope.$index
jsonArray
.
push
(
obj
)
}
else
{
// obj.index = index
jsonArray
.
push
(
obj
)
}
})
return
{
pass
,
addJsonArray
,
upJsonArray
,
jsonArray
}
}
const
loading
=
ref
(
false
)
const
saveData
=
async
(
scope
:
any
=
null
,
checkParamData
:
any
=
null
)
=>
{
let
passInfo
:
any
=
{}
if
(
checkParamData
)
{
passInfo
=
checkParamData
}
else
{
passInfo
=
await
checkParamsData
(
scope
)
if
(
!
passInfo
.
pass
)
{
ElMessage
({
type
:
'error'
,
message
:
'请填写所有数据项'
})
return
}
}
let
params
=
passInfo
.
jsonArray
.
map
(
item
=>
{
let
standardCodeValue
=
{}
tableFields
.
value
.
forEach
(
fieldObj
=>
{
standardCodeValue
[
fieldObj
.
field
]
=
item
[
fieldObj
.
field
]
})
let
obj
=
{
standardGuid
:
standardGuid
.
value
,
standardCodeValue
,
guid
:
item
.
guid
||
null
,
standardCodeId
:
item
.
standardCodeId
||
null
,
parentId
:
item
.
parentId
||
null
}
return
obj
})
loading
.
value
=
true
saveStandardCodeFieldsData
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
getFirstPageData
();
ElMessage
({
type
:
'success'
,
message
:
'保存成功'
})
}
else
{
ElMessage
({
type
:
'error'
,
message
:
res
.
msg
,
})
}
}).
finally
(()
=>
loading
.
value
=
false
)
}
const
addColumn
=
(
info
:
any
=
null
)
=>
{
const
fields
=
tableFields
.
value
const
existIndex
=
fields
.
findIndex
(
item
=>
item
.
field
==
'NOTES'
)
if
(
info
)
{
if
(
existIndex
==
-
1
)
{
fields
.
push
({
label
:
'备注'
,
field
:
'NOTES'
,
width
:
200
})
}
for
(
var
d
in
info
)
{
tableData
.
value
[
d
].
NOTES
=
info
[
d
].
join
(
','
)
}
}
else
{
if
(
existIndex
>
-
1
)
{
fields
.
splice
(
existIndex
,
1
)
}
}
}
// 生成表头
const
setUploadDataFields
=
(
data
)
=>
{
let
fields
:
any
=
[],
editInfo
:
any
=
{}
data
.
map
(
item
=>
{
let
fieldItem
:
any
=
{
label
:
item
.
fieldName
,
field
:
item
.
fieldName
,
width
:
140
}
fieldItem
.
type
=
'edit'
fieldItem
.
columClass
=
'edit-colum'
editInfo
[
item
.
fieldName
]
=
{
label
:
''
,
type
:
'input'
,
placeholder
:
''
,
maxlength
:
50
,
field
:
item
.
fieldName
,
default
:
''
,
disabled
:
item
.
codeRuleGuid
?
true
:
false
,
clearable
:
true
,
}
fields
.
push
(
fieldItem
)
})
tableFields
.
value
=
fields
tableInfo
.
value
.
fields
=
tableFields
.
value
tableInfo
.
value
.
editInfo
=
editInfo
}
// 生成表数据
const
setUploadDataInfo
=
async
(
info
,
setField
=
false
)
=>
{
if
(
setField
)
{
const
fields
=
info
.
schemaDataVOS
??
[]
await
setUploadDataFields
(
fields
)
}
let
data
=
info
.
jsonArray
??
[]
// 设置表数据
// data.map((item, i) => {
// item.ROWID = `upload_${tableData.value.length + i}`
// })
data
.
forEach
(
item
=>
{
Object
.
keys
(
item
.
standardCodeValue
).
forEach
(
key
=>
{
item
[
key
]
=
item
.
standardCodeValue
[
key
]
})
})
if
(
setField
)
{
tableData
.
value
=
data
}
else
{
tableData
.
value
=
[...
tableData
.
value
,
...
data
]
}
orginData
.
value
=
JSON
.
parse
(
JSON
.
stringify
(
tableData
.
value
))
tableInfo
.
value
.
data
=
tableData
.
value
tableInfo
.
value
.
page
.
rows
=
tableData
.
value
.
length
// if (setField) {
// orginData.value = data
// } else {
// orginData.value = [...orginData.value, ...data]
// }
// chunkData()
}
const
chunkData
=
()
=>
{
const
data
=
orginData
.
value
tableChunkData
.
value
=
chunk
(
data
,
page
.
value
.
limit
)
tableData
.
value
=
tableChunkData
.
value
[
page
.
value
.
curr
-
1
]
tableInfo
.
value
.
data
=
tableData
.
value
tableInfo
.
value
.
page
.
limit
=
page
.
value
.
limit
tableInfo
.
value
.
page
.
curr
=
page
.
value
.
curr
tableInfo
.
value
.
page
.
rows
=
orginData
.
value
.
length
}
const
batching
=
(
type
)
=>
{
if
(
type
==
'delete'
)
{
if
(
selectRowData
.
value
.
length
==
0
)
{
ElMessage
({
type
:
'error'
,
message
:
'请选择需要删除的数据'
,
})
return
}
open
(
"是否确定删除所选数据?"
,
"warning"
,
true
);
}
};
const
open
=
(
msg
,
type
,
isBatch
=
false
)
=>
{
ElMessageBox
.
confirm
(
msg
,
"提示"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
type
,
}).
then
(()
=>
{
let
guids
:
any
=
[]
if
(
isBatch
)
{
const
list
=
selectRowData
.
value
.
filter
((
item
:
any
)
=>
item
.
guid
!==
undefined
)
if
(
list
.
length
)
{
guids
=
list
.
map
((
l
:
any
)
=>
l
.
guid
)
}
const
newRows
=
selectRowData
.
value
.
filter
((
item
:
any
)
=>
item
.
guid
==
undefined
)
newRows
.
map
((
n
:
any
,
r
)
=>
{
const
existIndex
=
tableData
.
value
.
findIndex
(
t
=>
t
.
ROWID
==
n
.
ROWID
)
if
(
existIndex
>
-
1
)
{
tableData
.
value
.
splice
(
existIndex
,
1
)
orginData
.
value
.
splice
(
existIndex
,
1
)
}
// const existIndex = orginData.value.findIndex(t => t.id == n.id)
// existIndex > -1 && orginData.value.splice(existIndex, 1)
// if (r == newRows.length - 1) {
// page.value.curr = 1
// chunkData()
// }
})
tableInfo
.
value
.
page
.
rows
=
tableData
.
value
.
length
}
else
{
guids
=
[
currTableData
.
value
.
guid
]
}
if
(
guids
.
length
)
{
const
params
=
{
guid
:
standardGuid
.
value
,
delGuids
:
guids
}
// console.log(params)
// return
deleteStandardCodeFieldsData
(
guids
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
getFirstPageData
();
ElMessage
({
type
:
"success"
,
message
:
"删除成功"
,
});
}
else
{
ElMessage
({
type
:
"error"
,
message
:
res
.
msg
,
});
}
});
}
});
};
const
dialogBtnClick
=
(
btn
,
info
)
=>
{
if
(
btn
.
value
==
'submit'
)
{
// dialogInfo.value.footer.btns.map((item: any) => item.disabled = true)
importData
()
}
else
if
(
btn
.
value
==
'cancel'
)
{
// dialogInfo.value.footer.btns.map((item: any) => delete item.disabled)
nextTick
(()
=>
{
dialogInfo
.
value
.
visible
=
false
;
})
}
};
defineExpose
({
standardGuid
,
getFirstPageData
,
checkSave
});
</
script
>
<
template
>
<div
class=
"container_wrap full flex"
>
<div
class=
"main_wrap"
>
<div
class=
"table_tool_wrap"
>
<div
class=
"tools_btns"
>
<el-button
type=
"primary"
@
click=
"toolBtnClick(
{ value: 'add_row' })" v-preReClick :disabled="loading">新增行
</el-button>
<el-button
type=
"primary"
plain
@
click=
"toolBtnClick(
{ value: 'submit' })" v-preReClick :disabled="loading">保存数据
</el-button>
<el-button
@
click=
"batching('delete')"
v-preReClick
:disabled=
"loading"
>
批量删除
</el-button>
<el-button
@
click=
"toolBtnClick(
{ value: 'import' })" v-preReClick :disabled="loading">导入数据
</el-button>
<el-button
@
click=
"toolBtnClick(
{ value: 'export' })" v-preReClick :disabled="loading">导出数据
</el-button>
</div>
<!--
<el-input
class=
"table_search_input"
v-model
.
trim=
"tableSearchInput"
placeholder=
"输入名称搜索"
:suffix-icon=
"Search"
clearable
@
change=
"val => toSearch(
{})" /> -->
</div>
<div
class=
"table_panel_wrap full"
>
<Table
:tableInfo=
"tableInfo"
@
tableBtnClick=
"tableBtnClick"
@
tableSelectionChange=
"tableSelectionChange"
@
tablePageChange=
"tablePageChange"
/>
</div>
</div>
<!--
<Dialog
:dialogInfo=
"dialogInfo"
@
btnClick=
"dialogBtnClick"
@
onUpload=
"onUpload"
@
uploadBtnClick=
"uploadBtnClick"
/>
-->
</div>
</
template
>
<
style
lang=
"scss"
scoped
>
.container_wrap
{
width
:
calc
(
100%
-
200px
);
.main_wrap
{
width
:
100%
;
.table_panel_wrap
{
height
:
calc
(
100%
-
44px
);
}
}
}
</
style
>
src/views/data_meta/standard-codetable.vue
View file @
9d37357
<route
lang=
"yaml"
>
name: metadataStandardCodetable
</route>
<
script
lang=
"ts"
setup
name=
"metadataStandardCodetable"
>
import
{
ref
}
from
'vue'
;
import
{
ElMessage
}
from
"element-plus"
;
import
Tree
from
'@/components/Tree/index.vue'
;
import
TableTools
from
'@/components/Tools/table_tools.vue'
;
name: dictionary
</route>
<
script
lang=
"ts"
setup
name=
"dictionary"
>
import
{
ref
}
from
'vue'
import
{
ElMessage
,
ElMessageBox
}
from
"element-plus"
;
import
{
Search
}
from
'@element-plus/icons-vue'
import
{
useRouter
,
useRoute
}
from
"vue-router"
;
import
{
TableColumnWidth
}
from
'@/utils/enum'
;
import
{
commonPageConfig
}
from
'@/components/PageNav/index'
;
import
Tree
from
'@/components/Tree/index.vue'
import
Table
from
'@/components/Table/index.vue'
import
Drawer
from
'@/components/Drawer/index.vue'
import
DictFileds
from
'./components/dictFileds.vue'
import
useCatchStore
from
"@/store/modules/catch"
;
import
{
download
}
from
'@/utils/common'
import
{
getParamsList
}
from
'@/api/modules/dataAsset'
import
{
getStandardCodeList
,
saveStandardCode
,
updateStandardCode
,
getStandardCodeDetail
,
deleteStandardCode
,
getStandardCodeStandard
}
from
'@/api/modules/dataMetaService'
import
{
addDictionary
,
deleteDictionary
,
getDictionary
,
updateDictionary
,
getDictionaryTree
,
getDictionaryDetail
,
exportDictionary
,
showDictionary
,
getDataBaseList
,
getCoderuleList
,
saveDictionaryData
,
getDictionaryFileds
,
updateDictionaryState
,
getDictionaryRuleData
,
exportDictionaryFileds
,
checkDeleteDictionary
,
checkDeleteDictionaryScheme
,
checkDictionaryData
,
getNewDataTypeList
}
from
'@/api/modules/dataInventory'
;
const
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
router
=
useRouter
();
const
treeInfo
:
any
=
ref
({
const
cacheStore
=
useCatchStore
()
// 禁用字段
const
forbidFields
=
[
'guid'
,
'sharding_flag'
,
'create_user_id'
,
'create_user_name'
,
'update_user_id'
,
'update_user_name'
,
'create_time'
,
'update_time'
,
'is_deleted'
]
const
showFiledsPage
=
ref
(
false
)
const
dictFiledsRef
=
ref
()
const
dataTypeList
=
ref
([])
const
dataBaseList
=
ref
([])
const
codeRuleList
=
ref
([])
const
dictTreeRef
=
ref
()
const
dictType
=
ref
(
-
1
)
const
dictGuid
=
ref
(
''
)
const
expandedKey
:
any
=
ref
([])
const
currentNodeKey
=
ref
(
''
)
const
showLoading
=
ref
(
true
)
const
treeData
=
ref
([])
const
treeInfo
=
ref
({
id
:
"data-pickup-tree"
,
filter
:
true
,
queryValue
:
""
,
queryPlaceholder
:
"请输入关键字搜索"
,
props
:
{
label
:
"name"
,
value
:
"guid"
,
label
:
"label"
,
value
:
"value"
,
isLeaf
:
"isLeaf"
,
},
nodeKey
:
'guid'
,
expandedKey
:
[]
,
currentNodeKey
:
''
,
expandOnNodeClick
:
false
,
lazy
:
true
,
nodeKey
:
'value'
,
expandedKey
:
[
'01'
]
,
currentNodeKey
:
'01'
,
data
:
[],
loading
:
false
expandOnNodeClick
:
false
,
loading
:
false
,
currentObj
:
{}
});
function
nodeClick
(
data
)
{
}
const
standardOptions
=
ref
([])
const
publishingUnitCodeOptions
=
ref
([])
/** 分页及搜索传参信息配置。 */
const
tableSearchInput
=
ref
(
''
)
function
getFirstPageData
()
{
page
.
value
.
curr
=
1
toSearch
({})
}
function
toSearch
(
val
:
any
,
clear
:
boolean
=
false
)
{
let
params
:
any
=
Object
.
keys
(
val
).
length
?
{
...
val
}
:
{}
params
.
pageIndex
=
page
.
value
.
curr
;
params
.
pageSize
=
page
.
value
.
limit
;
params
.
name
=
tableSearchInput
.
value
getTableData
(
params
);
}
const
currTableData
:
any
=
ref
<
Object
>
({});
const
page
=
ref
({
...
commonPageConfig
,
collectTaskName
:
''
,
dataSourceGuid
:
''
,
taskState
:
null
limit
:
50
,
curr
:
1
,
sizes
:
[
{
label
:
"10"
,
value
:
10
},
{
label
:
"50"
,
value
:
50
},
{
label
:
"100"
,
value
:
100
},
{
label
:
"150"
,
value
:
150
},
{
label
:
"200"
,
value
:
200
},
],
});
const
tableInfo
=
ref
({
const
selectRowData
=
ref
([])
const
tableInfo
:
any
=
ref
({
id
:
'data-source-table'
,
multiple
:
true
,
fixedSelection
:
true
,
fields
:
[
{
label
:
'序号'
,
type
:
'index'
,
width
:
TableColumnWidth
.
INDEX
,
align
:
'center'
},
{
label
:
'代码名称'
,
field
:
'1'
,
width
:
140
},
{
label
:
'标准号'
,
field
:
'2'
,
width
:
140
},
{
label
:
'标准名称'
,
field
:
'3'
,
width
:
140
},
{
label
:
'启用状态'
,
field
:
'4'
,
width
:
140
},
{
label
:
'创建时间'
,
field
:
'5'
,
width
:
140
}
{
label
:
"序号"
,
type
:
"index"
,
width
:
56
,
align
:
"center"
},
{
label
:
'代码名称'
,
field
:
'codeName'
,
width
:
140
},
{
label
:
'标准号'
,
field
:
'standard'
,
width
:
140
},
{
label
:
'标准名称'
,
field
:
'standardName'
,
width
:
140
},
// { label: '启用状态', field: 'bizState', type: 'switch', activeText: '启用', inactiveText: '停用', activeValue: 1, inactiveValue: 0, switchWidth: 56, width: 100, align: 'center' },
{
label
:
'启用状态'
,
field
:
'bizState'
,
type
:
'tag'
,
width
:
100
,
align
:
'center'
},
{
label
:
'创建时间'
,
field
:
'createTime'
,
width
:
140
}
],
data
:
[],
page
:
{
type
:
'normal'
,
type
:
"normal"
,
rows
:
0
,
...
page
.
value
...
page
.
value
,
},
actionInfo
:
{
label
:
'操作'
,
type
:
'btn'
,
width
:
160
,
btns
:
scope
=>
{
let
row
=
scope
.
row
return
[
{
label
:
'编辑'
,
value
:
'edit'
},
{
label
:
'删除'
,
value
:
'delete'
},
]
}
label
:
"操作"
,
type
:
"btn"
,
width
:
92
,
//不要刚好90.缩小浏览器会因为小数点的差距而换行,
fixed
:
'right'
,
btns
:
[
{
label
:
"编辑"
,
value
:
"edit"
},
{
label
:
"删除"
,
value
:
"delete"
},
],
},
loading
:
false
})
function
tableBtnClick
(
scope
,
btn
)
{
}
function
tablePageChange
(
info
)
{
page
.
value
.
curr
=
Number
(
info
.
curr
);
page
.
value
.
limit
=
Number
(
info
.
limit
);
// getTableData();
}
function
getTableData
(
params
)
{
}
function
handleCreate
()
{
drawerInfo
.
value
.
visible
=
true
;
drawerInfo
.
value
.
type
=
'add'
;
drawerInfo
.
value
.
header
.
title
=
'新增标准代码'
;
drawerInfo
.
value
.
footer
.
visible
=
true
;
}
// drawer form
const
formRef
=
ref
()
const
formItems
:
any
=
ref
([
const
dictionaryType
=
ref
(
1
)
const
orginOptions
=
[
{
label
:
'code'
,
value
:
'code'
},
{
label
:
'name'
,
value
:
'name'
},
]
const
orginItems
=
[
{
label
:
'标准类型'
,
type
:
'select'
,
placeholder
:
'请选择'
,
field
:
'1'
,
default
:
'1'
,
field
:
'standardTypeCode'
,
default
:
''
,
options
:
standardOptions
,
clearable
:
true
,
required
:
true
}
,
{
label
:
'字典英文名'
,
type
:
'input'
,
maxlength
:
20
,
placeholder
:
'请输入'
,
field
:
'enName'
,
clearable
:
true
,
required
:
true
,
disabled
:
false
},
{
label
:
'排序'
,
type
:
'input'
,
placeholder
:
'请输入'
,
field
:
'orderNum'
,
maxlength
:
6
,
clearable
:
true
,
required
:
true
,
visible
:
true
,
},
{
label
:
'字典类型'
,
type
:
'radio-panel'
,
placeholder
:
''
,
field
:
'dictionaryType'
,
default
:
1
,
options
:
[
{
label
:
'列表结构'
,
value
:
1
},
{
label
:
'层级结构'
,
value
:
2
}
],
children
:
[
{
label
:
'编码字段'
,
type
:
'select'
,
placeholder
:
'请输入'
,
field
:
'codeColumn'
,
default
:
''
,
options
:
[],
clearable
:
true
,
required
:
true
},
{
label
:
'编码名称'
,
type
:
'select'
,
placeholder
:
'请输入'
,
field
:
'codeName'
,
default
:
''
,
options
:
[],
clearable
:
true
,
required
:
true
},
{
label
:
'顶级节点值'
,
type
:
'input'
,
placeholder
:
'请输入'
,
field
:
'topNodeValue'
,
clearable
:
true
,
required
:
true
,
visible
:
false
},
{
label
:
'路径'
,
type
:
'input'
,
placeholder
:
'请输入'
,
field
:
'path'
,
clearable
:
true
,
required
:
true
,
block
:
true
,
visible
:
false
}
],
clearable
:
true
,
required
:
false
,
block
:
true
,
visible
:
true
,
},
]
const
formItems
:
any
=
ref
([
{
label
:
'标准类型'
,
type
:
'select'
,
placeholder
:
'请选择'
,
field
:
'standardTypeCode'
,
default
:
''
,
options
:
standardOptions
,
clearable
:
true
,
required
:
true
},
{
label
:
'代码名称'
,
type
:
'input'
,
placeholder
:
'请输入'
,
field
:
'2
'
,
field
:
'codeName
'
,
default
:
''
,
maxlength
:
5
0
,
maxlength
:
2
0
,
clearable
:
true
,
required
:
true
},
...
...
@@ -129,7 +248,7 @@ const formItems: any = ref([
label
:
'标准号'
,
type
:
'input'
,
placeholder
:
'请输入'
,
field
:
'3
'
,
field
:
'standard
'
,
default
:
''
,
maxlength
:
50
,
clearable
:
true
,
...
...
@@ -139,19 +258,19 @@ const formItems: any = ref([
label
:
'标准名称'
,
type
:
'input'
,
placeholder
:
'请输入'
,
field
:
'4
'
,
field
:
'standardName
'
,
default
:
''
,
maxlength
:
5
0
,
maxlength
:
2
0
,
clearable
:
true
,
required
:
true
},
{
label
:
'发布单位'
,
type
:
'inpu
t'
,
placeholder
:
'请输入
'
,
field
:
'5
'
,
type
:
'selec
t'
,
placeholder
:
'请选择
'
,
field
:
'publishingUnitCode
'
,
default
:
''
,
maxlength
:
50
,
options
:
publishingUnitCodeOptions
,
clearable
:
true
,
required
:
true
},
...
...
@@ -159,25 +278,30 @@ const formItems: any = ref([
label
:
'排序'
,
type
:
'inputNumber'
,
placeholder
:
'请输入'
,
field
:
'6
'
,
field
:
'orderNum
'
,
default
:
''
,
maxlength
:
50
,
maxlength
:
2
,
clearable
:
true
,
required
:
true
},
{
label
:
'启用状态'
,
type
:
'switch'
,
field
:
'status'
,
default
:
false
field
:
'bizState'
,
default
:
'Y'
,
activeValue
:
'Y'
,
inactiveValue
:
'N'
},
{
label
:
'代码类型'
,
type
:
'select
'
,
type
:
'radio-panel
'
,
placeholder
:
'请选择'
,
field
:
'7
'
,
field
:
'typeCode
'
,
default
:
'1'
,
options
:
[],
options
:
[
{
label
:
'列表结构'
,
value
:
'1'
},
{
label
:
'层级结构'
,
value
:
'2'
}
],
clearable
:
true
,
required
:
true
},
...
...
@@ -185,19 +309,26 @@ const formItems: any = ref([
label
:
'编码字段'
,
type
:
'select'
,
placeholder
:
'请选择'
,
field
:
'8'
,
default
:
'1'
,
options
:
[],
field
:
'codeFields'
,
default
:
[],
options
:
[
{
label
:
'code'
,
value
:
'code'
},
{
label
:
'name'
,
value
:
'name'
}
],
clearable
:
true
,
required
:
true
required
:
true
,
multiple
:
true
},
{
label
:
'编码名称'
,
type
:
'select'
,
placeholder
:
'请选择'
,
field
:
'9'
,
default
:
'1'
,
options
:
[],
field
:
'codeFieldName'
,
default
:
''
,
options
:
[
{
label
:
'code'
,
value
:
'code'
},
{
label
:
'name'
,
value
:
'name'
}
],
clearable
:
true
,
required
:
true
},
...
...
@@ -205,15 +336,22 @@ const formItems: any = ref([
label
:
'层级结构'
,
type
:
'input'
,
placeholder
:
'请输入'
,
field
:
'10'
,
default
:
'1'
,
options
:
[],
field
:
'hierarchy'
,
default
:
''
,
clearable
:
true
,
required
:
true
visible
:
true
}
])
const
formRules
=
ref
({
const
formRules
:
any
=
ref
({
standardTypeCode
:
{
required
:
true
,
message
:
'请选择标准类型'
},
codeName
:
{
required
:
true
,
message
:
'请输入代码名称'
},
standard
:
{
required
:
true
,
message
:
'请输入标准号'
},
standardName
:
{
required
:
true
,
message
:
'请输入标准名称'
},
publishingUnitCode
:
{
required
:
true
,
message
:
'请选择发布单位'
},
orderNum
:
{
required
:
true
,
message
:
'请输入排序'
},
typeCode
:
{
required
:
true
,
message
:
'请选择代码类型'
},
codeFields
:
{
required
:
true
,
message
:
'请选择编码字段'
},
codeFieldName
:
{
required
:
true
,
message
:
'请选择编码名称'
}
})
const
formInfo
=
ref
({
type
:
'form'
,
...
...
@@ -222,8 +360,53 @@ const formInfo = ref({
formInfo
:
{
id
:
'add-dict-form'
,
col
:
'col2'
,
readonly
:
false
,
items
:
formItems
.
value
,
formRules
:
formRules
.
value
rules
:
formRules
.
value
}
})
const
orginData
=
[
{
ROWID
:
'field_0'
,
fieldName
:
'code'
,
description
:
'编码字段'
,
fieldType
:
'varchar'
,
fieldLength
:
'10'
,
fieldPrecision
:
''
,
// orderNum: '1',
codeRuleGuid
:
''
,
STATUS
:
'edit'
,
STATE
:
'Running'
},
{
ROWID
:
'field_1'
,
fieldName
:
'name'
,
description
:
'编码名称'
,
fieldType
:
'varchar'
,
fieldLength
:
'20'
,
fieldPrecision
:
''
,
// orderNum: '2',
codeRuleGuid
:
''
,
STATUS
:
'edit'
,
STATE
:
'Running'
}
]
const
orginFields
=
[
{
label
:
"序号"
,
type
:
"index"
,
width
:
56
,
align
:
"center"
},
{
label
:
"字段名称"
,
field
:
"fieldName"
,
width
:
140
}
]
const
formTableData
:
any
=
ref
([])
const
formTableSelectRowData
:
any
=
ref
([])
const
editTableInfo
=
ref
({
fieldName
:
{
label
:
'字段名称'
,
type
:
'input'
,
maxlength
:
50
,
placeholder
:
''
,
field
:
'fieldName'
,
default
:
''
,
clearable
:
true
,
required
:
true
,
}
})
const
formTable
=
ref
({
...
...
@@ -238,10 +421,7 @@ const formTable = ref({
multiple
:
true
,
minHeight
:
'unset'
,
maxHeight
:
'100%'
,
fields
:
[
{
label
:
'序号'
,
type
:
'index'
,
width
:
56
,
align
:
'center'
},
{
label
:
'字段名称'
,
field
:
'name'
,
width
:
140
,
type
:
'edit'
,
customClass
:
'edit-colum'
}
],
fields
:
[],
data
:
[],
showPage
:
false
,
actionInfo
:
{
...
...
@@ -250,154 +430,1112 @@ const formTable = ref({
type
:
"btn"
,
width
:
60
,
fixed
:
'right'
,
btns
:
[{
label
:
"删除"
,
value
:
"remove"
}]
btns
:
[
{
label
:
"删除"
,
value
:
"remove"
},
]
},
editInfo
:
{},
readonly
:
false
,
col
:
'auto-height'
,
style
:
{
height
:
'calc(100% - 40px)'
},
style
:
{
height
:
'calc(100% - 40px)'
},
loading
:
false
},
tableTool
:
{
col
:
'float-right'
,
visible
:
true
,
btns
:
[
{
label
:
"新增行"
,
value
:
"add-row"
,
type
:
'primary'
,
plain
:
true
},
{
label
:
"新增行"
,
value
:
"add-row"
,
type
:
'primary'
},
{
label
:
"批量删除"
,
value
:
"remove_batch"
},
]
},
})
// 新增drawer
const
drawerInfo
=
ref
({
const
fieldSheetInfo
:
any
=
ref
({})
const
uploadTableData
:
any
=
ref
([])
const
uploadSelectRowData
:
any
=
ref
([])
const
uploadTableFields
:
any
=
ref
([])
const
uploadTableInfo
=
ref
({
id
:
"role-authority-table"
,
multiple
:
true
,
// minHeight: 'unset',
// maxHeight: '100%',
fields
:
[],
data
:
[],
showPage
:
false
,
actionInfo
:
{
label
:
"操作"
,
type
:
"btn"
,
width
:
60
,
btns
:
[
{
label
:
"删除"
,
value
:
"remove"
},
],
},
editInfo
:
{},
readonly
:
false
,
loading
:
false
})
const
uploadFiles
:
any
=
ref
([])
const
uploadInfo
=
ref
({
type
:
'upload'
,
title
:
'添加表数据'
,
col
:
'row-reverse'
,
uploadInfo
:
{
id
:
'upload-file-form'
,
action
:
''
,
auto
:
false
,
fileList
:
[],
accept
:
'.xlsx, .xls'
,
cover
:
true
,
triggerBtn
:
{
label
:
'导入文件'
,
value
:
'import_file'
,
icon
:
'Upload'
,
plain
:
true
,
},
toolBar
:
[
{
label
:
'下载模板'
,
value
:
'export_model'
,
plain
:
true
,
icon
:
'Download'
},
]
// showList: false,
},
tableInfo
:
{},
tools
:
{
col
:
'right'
,
visible
:
true
,
btns
:
[
{
label
:
'树形显示'
,
value
:
'show_tree'
,
type
:
'primary'
,
plain
:
true
,
visible
:
false
},
{
label
:
'新增行'
,
value
:
'add_row'
,
type
:
'primary'
,
plain
:
true
},
{
label
:
'批量删除'
,
value
:
'remove_batch'
,
plain
:
true
},
]
}
})
const
fieldTableInfo
=
ref
({
type
:
'field-table'
,
title
:
'表数据'
,
tableInfo
:
{
id
:
'dict-field-table'
,
minHeight
:
'unset'
,
maxHeight
:
'100%'
,
fields
:
[],
data
:
[],
loading
:
false
,
showPage
:
false
,
actionInfo
:
{
show
:
false
},
col
:
'auto-height'
}
})
const
contents
=
ref
({
add
:
[
formInfo
.
value
,
formTable
.
value
,
],
upload
:
[
formInfo
.
value
,
uploadInfo
.
value
,
],
sheet
:
[
formInfo
.
value
,
formTable
.
value
,
],
field
:
[
formInfo
.
value
,
fieldTableInfo
.
value
,
]
})
const
drawerRef
=
ref
()
const
drawerInfo
:
any
=
ref
({
visible
:
false
,
direction
:
'rtl'
,
size
:
550
,
direction
:
"rtl"
,
modalClass
:
""
,
modalClose
:
false
,
modal
:
true
,
size
:
700
,
header
:
{
title
:
'新增标准代码'
,
title
:
"新增"
,
},
type
:
''
,
container
:
{
contents
:
[
formInfo
.
value
,
formTable
.
value
],
contents
:
[
],
},
footer
:
{
visible
:
true
,
btns
:
[
{
type
:
'default'
,
label
:
'取消'
,
value
:
'cancel'
},
{
type
:
'primary'
,
label
:
'保存'
,
value
:
'save
'
},
{
type
:
'primary'
,
label
:
'保存并添加数据'
,
value
:
'saveAndAdd'
,
visible
:
true
}
{
type
:
'primary'
,
label
:
'保存'
,
value
:
'submit
'
},
{
type
:
'primary'
,
label
:
'保存并添加数据'
,
value
:
'saveAndAdd'
,
visible
:
true
},
]
}
},
})
async
function
drawerBtnClick
(
btn
,
info
)
{
const
setFormItems
=
(
row
:
any
=
null
)
=>
{
formItems
.
value
=
JSON
.
parse
(
JSON
.
stringify
(
orginItems
))
formItems
.
value
.
map
(
item
=>
{
if
(
item
.
field
==
'databaseNameZh'
)
{
item
.
options
=
dataBaseList
.
value
item
.
default
=
row
?
row
[
item
.
field
]
:
''
}
else
if
(
item
.
field
==
'dictionaryType'
)
{
item
.
default
=
dictionaryType
.
value
// item.disabled = drawerInfo.value.type == 'add' ? false : true
item
.
disabled
=
true
item
.
children
.
map
(
child
=>
{
child
.
options
=
orginOptions
if
(
child
.
field
==
'codeColumn'
)
{
child
.
default
=
row
?
row
[
child
.
field
]
:
'code'
}
else
if
(
child
.
field
==
'codeName'
)
{
child
.
default
=
row
?
row
[
child
.
field
]
:
'name'
}
else
{
child
.
default
=
row
?
row
[
child
.
field
]
:
''
}
child
.
disabled
=
drawerInfo
.
value
.
type
==
'detail'
?
true
:
false
child
.
clearable
=
drawerInfo
.
value
.
type
==
'detail'
?
false
:
true
})
}
else
if
(
item
.
field
==
'enName'
)
{
item
.
default
=
row
?
row
[
item
.
field
]
:
''
item
.
disabled
=
drawerInfo
.
value
.
type
==
'add'
?
false
:
true
item
.
clearable
=
drawerInfo
.
value
.
type
==
'add'
?
true
:
false
}
else
{
item
.
default
=
row
?
row
[
item
.
field
]
:
''
item
.
disabled
=
drawerInfo
.
value
.
type
==
'detail'
?
true
:
false
item
.
clearable
=
drawerInfo
.
value
.
type
==
'detail'
?
false
:
true
}
})
formInfo
.
value
.
formInfo
.
readonly
=
drawerInfo
.
value
.
type
==
'detail'
formInfo
.
value
.
formInfo
.
items
=
formItems
.
value
// for(var e in editTableInfo.value){
// const editItem = editTableInfo.value[e]
// if(editItem.field != 'description' && editItem.field != 'codeRuleGuid'){
// editItem.disabled = drawerInfo.value.type != 'add'
// }
// }
}
</
script
>
<
template
>
<div
class=
"container_wrap full flex"
>
<div
class=
"aside_wrap"
>
<div
class=
"aside_title"
>
标准代码列表
</div>
<Tree
:treeInfo=
"treeInfo"
@
nodeClick=
"nodeClick"
/>
</div>
<div
class=
"main_wrap"
>
<div
class=
"table_tool_wrap"
>
<div
class=
"tools_btns"
>
<el-button
type=
"primary"
@
click=
"handleCreate"
>
新建
</el-button>
<el-button>
批量删除
</el-button>
<el-button>
批量导入
</el-button>
</div>
<el-input
class=
"table_search_input"
v-model
.
trim=
"tableSearchInput"
placeholder=
"代码名称搜索"
:suffix-icon=
"Search"
clearable
@
change=
"val => getFirstPageData()"
/>
</div>
<div
class=
"table_panel_wrap"
>
<Table
:tableInfo=
"tableInfo"
@
tableBtnClick=
"tableBtnClick"
@
tablePageChange=
"tablePageChange"
/>
</div>
</div>
<Drawer
:drawerInfo=
"drawerInfo"
@
drawerBtnClick=
"drawerBtnClick"
ref=
"drawerRef"
>
<!--
<Form
ref=
"formRef"
:itemList=
"formItems"
formId=
"basic-info-form"
:rules=
"formRules"
/>
-->
</Drawer>
</div>
</
template
>
// 获取数据类型列表
const
getDataType
=
()
=>
{
let
params
=
{
dictType
:
"字段类型"
}
getNewDataTypeList
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
const
data
=
res
.
data
editTableInfo
.
value
[
'fieldType'
].
options
=
data
}
else
{
ElMessage
({
type
:
'error'
,
message
:
res
.
msg
,
})
}
})
}
<
style
scoped
lang=
"scss"
>
.container_wrap
{
// 获取数据库列表
const
getDataBase
=
()
=>
{
const
params
=
{
pageIndex
:
1
,
connectStatus
:
'1'
}
getDataBaseList
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
const
data
=
res
.
data
??
[]
data
.
map
(
item
=>
{
item
.
label
=
item
.
databaseNameZh
item
.
value
=
item
.
guid
})
dataBaseList
.
value
=
data
}
else
{
ElMessage
({
type
:
'error'
,
message
:
res
.
msg
,
})
}
})
}
.aside_wrap
{
width
:
200px
;
// 获取编码规则列表
const
getCodeRuleData
=
()
=>
{
let
params
=
{}
getCoderuleList
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
const
data
=
res
.
data
data
?.
map
(
item
=>
{
item
.
label
=
item
.
ruleName
item
.
value
=
item
.
guid
})
codeRuleList
.
value
=
data
editTableInfo
.
value
[
'codeRuleGuid'
].
options
=
data
}
else
{
ElMessage
({
type
:
'error'
,
message
:
res
.
msg
,
})
}
})
}
.main_wrap
{
padding
:
10px
20px
;
const
treePromise
=
ref
();
const
getTreeData
=
(
needClick
=
false
,
currData
=
{})
=>
{
getParamsList
({
dictType
:
'标准类型'
}).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
proxy
.
$passCode
)
{
const
data
=
res
.
data
||
[]
data
.
forEach
(
item
=>
{
item
.
treeLevel
=
1
})
treeInfo
.
value
.
data
=
data
standardOptions
.
value
=
data
// 默认展开第一个
if
(
data
.
length
===
0
)
return
let
params
=
{
pageIndex
:
1
,
pageSize
:
50
,
standardTypeCode
:
data
[
0
].
value
,
// codeName: '标准类型'
}
getStandardCodeList
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
proxy
.
$passCode
)
{
let
data
=
res
.
data
tableInfo
.
value
.
data
=
data
.
records
tableInfo
.
value
.
page
.
limit
=
data
.
pageSize
tableInfo
.
value
.
page
.
curr
=
data
.
pageIndex
tableInfo
.
value
.
page
.
rows
=
data
.
totalRows
}
})
}
})
}
:deep(.el-tabs)
{
height
:
100%
;
const
getFirstPageData
=
()
=>
{
page
.
value
.
curr
=
1
;
toSearch
({})
}
.el-tabs__header
{
margin-bottom
:
0
;
const
toSearch
=
(
val
:
any
,
clear
:
boolean
=
false
)
=>
{
let
params
:
any
=
Object
.
keys
(
val
).
length
?
{
...
val
}
:
{}
let
{
currentNodeKey
,
currentObj
}
=
treeInfo
.
value
console
.
log
(
'currentObj'
,
currentObj
)
params
.
pageIndex
=
page
.
value
.
curr
;
params
.
pageSize
=
page
.
value
.
limit
;
params
.
codeName
=
tableSearchInput
.
value
if
(
currentObj
.
treeLevel
===
1
)
{
params
.
standardTypeCode
=
currentNodeKey
}
else
if
(
currentObj
.
treeLevel
===
2
)
{
params
.
standardTypeCode
=
currentObj
.
standardTypeCode
params
.
standardName
=
currentObj
.
value
}
getTableData
(
params
);
};
.el-tabs__item
{
height
:
32px
;
padding
:
0px
;
width
:
144px
;
const
getTableData
=
(
params
)
=>
{
tableInfo
.
value
.
loading
=
true
getStandardCodeList
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
proxy
.
$passCode
)
{
let
data
=
res
.
data
let
list
=
res
.
data
.
records
||
[]
list
=
list
.
map
(
item
=>
{
item
.
label
=
item
.
codeName
item
.
value
=
item
.
guid
return
item
})
tableInfo
.
value
.
data
=
list
tableInfo
.
value
.
page
.
limit
=
data
.
pageSize
tableInfo
.
value
.
page
.
curr
=
data
.
pageIndex
tableInfo
.
value
.
page
.
rows
=
data
.
totalRows
}
tableInfo
.
value
.
loading
=
false
}).
catch
(
xhr
=>
{
tableInfo
.
value
.
loading
=
false
})
};
&:last-child
{
width
:
130px
;
const
tableSelectionChange
=
(
val
,
tId
)
=>
{
if
(
drawerInfo
.
value
.
visible
)
{
if
(
formItems
.
value
.
length
==
2
)
{
uploadSelectRowData
.
value
=
val
}
else
{
formTableSelectRowData
.
value
=
val
}
}
else
{
selectRowData
.
value
=
val
.
map
((
item
)
=>
item
.
guid
);
}
};
.el-tabs__content
{
height
:
calc
(
100%
-
32px
);
const
tablePageChange
=
(
info
)
=>
{
page
.
value
.
curr
=
Number
(
info
.
curr
);
page
.
value
.
limit
=
Number
(
info
.
limit
);
toSearch
({});
};
const
tableInputChange
=
(
val
,
scope
)
=>
{
if
(
forbidFields
.
indexOf
(
val
)
>
-
1
)
{
ElMessage
({
type
:
"error"
,
message
:
'该名称已存在,请填写其他名称'
,
});
return
}
setCodeOptions
()
}
.el-tab-pane
{
padding
:
0px
16px
;
height
:
100%
;
const
setCodeOptions
=
()
=>
{
let
opts
:
any
=
[]
formTableData
.
value
.
map
(
item
=>
{
if
(
item
.
fieldName
)
{
const
row
=
JSON
.
parse
(
JSON
.
stringify
(
item
))
row
.
label
=
item
.
fieldName
row
.
value
=
item
.
fieldName
opts
.
push
(
row
)
}
})
formItems
.
value
.
at
(
-
1
).
children
.
map
(
child
=>
{
if
(
child
.
type
==
'select'
)
{
child
.
options
=
opts
}
})
}
const
toolBtnClick
=
(
btn
,
data
)
=>
{
const
type
=
btn
.
value
if
(
data
)
{
if
(
type
.
indexOf
(
'add'
)
>
-
1
)
{
if
(
formItems
.
value
.
length
==
2
)
{
const
params
=
{
guid
:
fieldSheetInfo
.
value
.
guid
}
uploadTableInfo
.
value
.
loading
=
true
getDictionaryRuleData
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
const
data
=
res
.
data
??
{}
let
rowInfo
:
any
=
{}
uploadTableFields
.
value
.
map
(
item
=>
{
rowInfo
[
item
.
field
]
=
data
[
item
.
field
]
??
''
})
rowInfo
.
STATUS
=
'edit'
rowInfo
.
STATE
=
'Running'
rowInfo
.
ROWID
=
`upload_
${
uploadTableData
.
value
.
length
}
`
uploadTableData
.
value
.
push
(
rowInfo
)
uploadTableInfo
.
value
.
data
=
uploadTableData
.
value
scrollTable
(
rowInfo
)
}
else
{
ElMessage
({
type
:
'error'
,
message
:
res
.
msg
})
}
uploadTableInfo
.
value
.
loading
=
false
}).
catch
(()
=>
{
uploadTableInfo
.
value
.
loading
=
false
})
}
else
{
const
rowInfo
=
{
ROWID
:
`formData_
${
formTableData
.
value
.
length
}
`
,
fieldName
:
''
,
description
:
''
,
fieldType
:
''
,
fieldLength
:
''
,
fieldPrecision
:
''
,
orderNum
:
''
,
codeRuleGuid
:
''
,
STATUS
:
'edit'
,
STATE
:
'Running'
}
let
list
:
any
=
formTableData
.
value
list
.
push
(
rowInfo
)
formTable
.
value
.
tableInfo
.
data
=
list
scrollTable
(
rowInfo
)
}
}
else
if
(
type
.
indexOf
(
'remove'
)
>
-
1
)
{
if
(
formItems
.
value
.
length
==
2
)
{
if
(
uploadSelectRowData
.
value
.
length
==
0
)
{
ElMessage
({
type
:
"error"
,
message
:
'请选择需要删除的数据'
,
});
return
}
uploadSelectRowData
.
value
.
map
(
item
=>
{
const
existIndex
=
uploadTableData
.
value
.
findIndex
(
s
=>
s
.
ROWID
==
item
.
ROWID
)
existIndex
>
-
1
&&
uploadTableData
.
value
.
splice
(
existIndex
,
1
)
})
}
else
{
if
(
formTableSelectRowData
.
value
.
length
==
0
)
{
ElMessage
({
type
:
"error"
,
message
:
'请选择需要删除的数据'
,
});
return
}
const
removeRows
=
()
=>
{
formTableSelectRowData
.
value
.
map
(
item
=>
{
const
existIndex
=
formTableData
.
value
.
findIndex
(
s
=>
s
.
ROWID
==
item
.
ROWID
)
existIndex
>
-
1
&&
formTableData
.
value
.
splice
(
existIndex
,
1
)
})
}
if
(
drawerInfo
.
value
.
type
==
'edit'
)
{
const
editRows
=
formTableSelectRowData
.
value
.
filter
(
item
=>
item
.
guid
!==
undefined
)
if
(
editRows
.
length
)
{
formTable
.
value
.
tableInfo
.
loading
=
true
checkDelete
().
then
((
res
:
any
)
=>
{
if
(
res
)
{
ElMessageBox
.
confirm
(
"数据字典有数据, 确定是否继续删除?"
,
"提示"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
'warning'
,
}).
then
(()
=>
{
removeRows
()
})
}
else
{
removeRows
()
}
formTable
.
value
.
tableInfo
.
loading
=
false
}).
catch
(
xhr
=>
{
ElMessage
({
type
:
'error'
,
message
:
xhr
})
formTable
.
value
.
tableInfo
.
loading
=
false
})
}
else
{
removeRows
()
}
}
else
{
removeRows
()
}
}
}
}
else
{
if
(
type
==
'export_model'
)
{
exportData
(
'model'
)
}
else
if
(
type
==
'import_file'
)
{
importData
()
}
}
}
const
tableSwitchBeforeChange
=
(
scope
,
field
,
callback
)
=>
{
const
msg
=
'确定修改状态?'
ElMessageBox
.
confirm
(
msg
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
}
).
then
(()
=>
{
const
state
=
scope
.
row
[
field
]
==
1
?
0
:
1
const
result
=
tableSwitchChange
(
state
,
scope
,
field
)
callback
(
result
)
}).
catch
(()
=>
{
callback
(
false
)
})
}
const
tableSwitchChange
=
(
val
,
scope
,
field
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
params
=
{
guid
:
scope
.
row
.
guid
,
dictionaryState
:
val
}
updateDictionaryState
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
&&
res
.
data
)
{
getFirstPageData
()
ElMessage
({
type
:
"success"
,
message
:
'状态修改成功'
,
});
resolve
(
true
)
}
else
{
ElMessage
({
type
:
"error"
,
message
:
res
.
msg
,
});
reject
(
false
)
}
}).
catch
(()
=>
{
reject
(
false
)
})
})
}
const
tableBtnClick
=
(
scope
,
btn
)
=>
{
const
type
=
btn
.
value
;
const
row
=
scope
.
row
;
if
(
type
==
"edit"
||
type
==
'detail'
)
{
fieldTableInfo
.
value
.
tableInfo
.
fields
=
[]
fieldTableInfo
.
value
.
tableInfo
.
data
=
[]
drawerInfo
.
value
.
header
.
title
=
type
==
'edit'
?
"编辑标准代码"
:
"数据字典详情"
;
drawerInfo
.
value
.
modalClass
=
type
==
'edit'
?
''
:
'wrap_width_auto'
drawerInfo
.
value
.
type
=
type
drawerInfo
.
value
.
visible
=
true
;
drawerInfo
.
value
.
loading
=
true
;
formTable
.
value
.
tableInfo
.
loading
=
true
getStandardCodeDetail
(
row
.
guid
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
&&
res
.
data
)
{
let
data
=
res
.
data
currTableData
.
value
=
data
;
setDetailInfo
()
}
else
{
ElMessage
({
type
:
"error"
,
message
:
res
.
msg
,
});
}
formTable
.
value
.
tableInfo
.
loading
=
false
drawerInfo
.
value
.
loading
=
false
;
}).
catch
(()
=>
{
formTable
.
value
.
tableInfo
.
loading
=
false
drawerInfo
.
value
.
loading
=
false
;
})
}
else
if
(
type
==
"delete"
)
{
currTableData
.
value
=
row
;
tableInfo
.
value
.
loading
=
true
open
(
"此操作将永久删除, 是否继续?"
,
"warning"
);
tableInfo
.
value
.
loading
=
false
}
};
const
checkDelete
=
(
isBatch
:
any
=
false
)
=>
{
if
(
drawerInfo
.
value
.
visible
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
params
:
any
=
{
guid
:
currTableData
.
value
.
guid
}
checkDeleteDictionaryScheme
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
const
data
=
res
.
data
resolve
(
data
)
}
else
{
reject
(
res
.
msg
)
}
}).
catch
((
xhr
:
any
)
=>
{
reject
(
xhr
.
msg
)
})
})
}
else
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
guids
=
[
currTableData
.
value
.
guid
]
if
(
isBatch
)
{
guids
=
selectRowData
.
value
}
checkDeleteDictionary
(
guids
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
const
data
=
res
.
data
??
{}
if
(
data
.
used
)
{
resolve
({
used
:
true
,
data
:
data
.
used
})
}
else
{
resolve
({
used
:
false
,
data
:
data
.
unuse
})
}
}
else
{
reject
(
res
.
msg
)
}
}).
catch
((
xhr
:
any
)
=>
{
reject
(
xhr
.
msg
)
})
})
}
}
.tree_panel
{
height
:
calc
(
100%
-
36px
);
padding-top
:
0
;
const
open
=
(
msg
,
type
,
isBatch
=
false
)
=>
{
ElMessageBox
.
confirm
(
msg
,
"提示"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
type
,
}).
then
(()
=>
{
let
guids
=
[
currTableData
.
value
.
guid
]
if
(
isBatch
)
{
guids
=
selectRowData
.
value
}
tableInfo
.
value
.
loading
=
true
deleteStandardCode
(
guids
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
getFirstPageData
()
ElMessage
({
type
:
"success"
,
message
:
"删除成功"
,
});
}
else
{
ElMessage
({
type
:
"error"
,
message
:
res
.
msg
,
});
}
tableInfo
.
value
.
loading
=
false
}).
catch
(()
=>
{
tableInfo
.
value
.
loading
=
false
});
});
};
:deep(.el-tree)
{
margin
:
0
;
overflow
:
hidden
auto
;
const
onUpload
=
(
file
,
fileList
)
=>
{
uploadFiles
.
value
=
fileList
}
const
uploadFile
=
(
file
)
=>
{
importData
(
file
)
}
const
exportData
=
(
type
:
any
=
null
)
=>
{
if
(
type
==
'model'
)
{
let
params
=
{
guid
:
dictGuid
.
value
}
if
(
drawerInfo
.
value
.
type
==
'add'
)
{
params
.
guid
=
fieldSheetInfo
.
value
.
guid
}
exportDictionary
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
&&
!
res
.
msg
)
{
download
(
res
,
'数据字典模板.xlsx'
,
'excel'
)
}
else
{
res
?.
msg
&&
ElMessage
.
error
(
res
?.
msg
);
}
});
}
else
{
let
params
=
{
guid
:
dictGuid
.
value
}
exportDictionaryFileds
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
&&
!
res
.
msg
)
{
download
(
res
,
'字典数据.xlsx'
,
'excel'
);
}
else
{
res
?.
msg
&&
ElMessage
.
error
(
res
?.
msg
);
}
});
}
}
const
importData
=
(
file
:
any
=
null
)
=>
{
let
params
=
new
FormData
()
if
(
file
)
{
params
.
append
(
"file"
,
file
.
raw
);
}
else
{
if
(
uploadFiles
.
value
.
length
)
{
uploadFiles
.
value
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
params
.
append
(
"file"
,
item
.
raw
);
});
}
}
params
.
append
(
"dictionaryGuid"
,
fieldSheetInfo
.
value
.
guid
);
showDictionary
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
let
data
=
res
.
data
??
[]
setUploadDataInfo
(
data
)
}
else
{
ElMessage
({
type
:
"error"
,
message
:
res
.
msg
,
});
}
})
}
// 生成表头
const
setUploadDataFields
=
(
data
)
=>
{
let
fields
:
any
=
[],
editInfo
:
any
=
{}
data
.
map
(
item
=>
{
let
fieldItem
:
any
=
{
label
:
item
.
description
,
field
:
item
.
fieldName
,
width
:
140
}
if
(
drawerInfo
.
value
.
type
!=
'detail'
)
{
fieldItem
.
type
=
'edit'
fieldItem
.
columClass
=
'edit-colum'
editInfo
[
item
.
fieldName
]
=
{
label
:
''
,
type
:
'input'
,
placeholder
:
''
,
field
:
item
.
fieldName
,
default
:
''
,
disabled
:
item
.
codeRuleGuid
?
true
:
false
,
clearable
:
true
,
}
}
fields
.
push
(
fieldItem
)
})
uploadTableFields
.
value
=
fields
if
(
drawerInfo
.
value
.
type
==
'detail'
)
{
fieldTableInfo
.
value
.
tableInfo
.
fields
=
uploadTableFields
.
value
}
else
{
uploadTableInfo
.
value
.
fields
=
uploadTableFields
.
value
uploadTableInfo
.
value
.
editInfo
=
editInfo
}
}
// 生成表数据
const
setUploadDataInfo
=
async
(
info
)
=>
{
let
data
=
info
if
(
drawerInfo
.
value
.
type
==
'detail'
)
{
data
=
info
.
jsonArray
??
[]
const
fields
=
info
.
schemaDataVOS
??
[]
setUploadDataFields
(
fields
)
}
if
(
drawerInfo
.
value
.
type
==
'detail'
)
{
fieldTableInfo
.
value
.
tableInfo
.
data
=
data
drawerInfo
.
value
.
container
.
contents
=
contents
.
value
[
'field'
]
}
else
{
// 设置表数据
data
.
map
((
item
,
i
)
=>
{
item
.
STATUS
=
'edit'
item
.
STATE
=
'Running'
item
.
ROWID
=
`upload_
${
i
}
`
})
uploadTableData
.
value
=
data
uploadTableInfo
.
value
.
data
=
uploadTableData
.
value
}
}
const
loadDrawer
=
async
()
=>
{
drawerInfo
.
value
.
visible
=
true
;
drawerInfo
.
value
.
type
=
'add'
;
drawerInfo
.
value
.
header
.
title
=
'新增标准代码'
;
drawerInfo
.
value
.
footer
.
visible
=
true
;
// drawerInfo.value.header.title = '新增数据字典'
// drawerInfo.value.type = 'add'
// drawerInfo.value.modalClass = '';
// await setFormItems()
let
fields
=
JSON
.
parse
(
JSON
.
stringify
(
orginFields
))
fields
.
map
((
item
:
any
)
=>
{
if
(
!
item
.
type
||
item
.
type
!=
'index'
)
{
item
.
type
=
'edit'
item
.
columClass
=
'edit-colum'
}
})
formTable
.
value
.
tableInfo
.
fields
=
fields
formInfo
.
value
.
formInfo
.
items
=
formItems
.
value
formTableData
.
value
=
JSON
.
parse
(
JSON
.
stringify
(
orginData
))
formTable
.
value
.
tableInfo
.
data
=
formTableData
.
value
formTable
.
value
.
tableInfo
.
editInfo
=
JSON
.
parse
(
JSON
.
stringify
(
editTableInfo
.
value
))
formTable
.
value
.
tableInfo
.
readonly
=
false
formTable
.
value
.
tableInfo
.
multiple
=
true
formTable
.
value
.
tableInfo
.
actionInfo
.
show
=
true
formTable
.
value
.
tableTool
.
visible
=
true
drawerInfo
.
value
.
container
.
contents
=
contents
.
value
[
'add'
]
drawerInfo
.
value
.
visible
=
true
console
.
log
(
'table'
,
formTable
.
value
)
console
.
log
(
'formInfo'
,
formInfo
)
};
const
batching
=
(
type
)
=>
{
if
(
type
==
'delete'
)
{
if
(
selectRowData
.
value
.
length
==
0
)
{
ElMessage
({
type
:
'error'
,
message
:
'请选择需要删除的数据'
,
})
return
}
tableInfo
.
value
.
loading
=
true
open
(
"此操作将永久删除, 是否继续?"
,
"warning"
,
true
);
tableInfo
.
value
.
loading
=
false
}
};
const
nodeClick
=
(
data
)
=>
{
console
.
log
(
'treeNodeClick'
,
data
)
drawerInfo
.
value
.
visible
=
false
const
changeCont
=
()
=>
{
nextTick
(()
=>
{
treeInfo
.
value
.
currentNodeKey
=
data
.
value
treeInfo
.
value
.
currentObj
=
data
if
(
data
.
isLeaf
)
{
showFiledsPage
.
value
=
true
nextTick
(()
=>
{
dictFiledsRef
.
value
.
standardGuid
=
data
.
value
dictFiledsRef
.
value
.
getFirstPageData
()
})
}
else
{
showFiledsPage
.
value
=
false
getFirstPageData
()
}
})
}
if
(
showFiledsPage
.
value
)
{
const
toChange
=
dictFiledsRef
.
value
.
checkSave
()
if
(
!
toChange
)
{
ElMessageBox
.
confirm
(
'存在未保存的数据,切换后会丢失,是否确定切换'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
}
).
then
(()
=>
{
changeCont
()
}).
catch
(()
=>
{
treeInfo
.
value
.
currentNodeKey
=
dictGuid
.
value
})
}
else
{
changeCont
()
}
}
else
{
changeCont
()
}
}
function
loadTreeNode
(
node
,
resolve
)
{
console
.
log
(
'node'
,
node
)
if
(
node
.
isLeaf
)
{
return
resolve
([]);
}
if
(
node
.
level
===
1
)
{
let
standardTypeCode
=
node
.
data
.
value
getStandardCodeStandard
(
standardTypeCode
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
proxy
.
$passCode
)
{
let
data
=
res
.
data
||
[]
let
uniqList
=
Array
.
from
(
new
Set
(
data
)).
map
(
item
=>
{
return
{
label
:
item
,
value
:
item
,
treeLevel
:
2
,
standardTypeCode
}
})
resolve
(
uniqList
)
}
})
}
if
(
node
.
level
===
2
)
{
let
params
=
{
pageIndex
:
1
,
pageSize
:
-
1
,
standardTypeCode
:
node
.
data
.
standardTypeCode
,
standardName
:
node
.
data
.
value
}
getStandardCodeList
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
proxy
.
$passCode
)
{
const
list
=
res
.
data
.
records
||
[]
list
.
forEach
(
item
=>
{
item
.
isLeaf
=
true
item
.
label
=
item
.
codeName
item
.
value
=
item
.
guid
})
resolve
(
list
)
}
})
}
}
// 设置详情信息
const
setDetailInfo
=
()
=>
{
const
row
=
JSON
.
parse
(
JSON
.
stringify
(
currTableData
.
value
))
formItems
.
value
.
forEach
(
item
=>
{
item
.
default
=
row
[
item
.
field
]
||
''
})
formInfo
.
value
.
formInfo
.
items
=
formItems
.
value
formTableData
.
value
=
row
.
standardCodeFields
.
map
(
item
=>
{
item
.
STATUS
=
'edit'
return
item
})
let
fields
=
JSON
.
parse
(
JSON
.
stringify
(
orginFields
))
fields
.
map
((
item
:
any
)
=>
{
if
(
item
.
type
!=
'index'
)
{
item
.
type
=
'edit'
item
.
columClass
=
'edit-colum'
}
})
formTable
.
value
.
tableInfo
.
fields
=
fields
formTable
.
value
.
tableInfo
.
data
=
formTableData
.
value
formTable
.
value
.
tableInfo
.
editInfo
=
JSON
.
parse
(
JSON
.
stringify
(
editTableInfo
.
value
))
formTable
.
value
.
tableInfo
.
readonly
=
false
formTable
.
value
.
tableInfo
.
multiple
=
true
formTable
.
value
.
tableInfo
.
actionInfo
.
show
=
true
formTable
.
value
.
tableTool
.
visible
=
true
drawerInfo
.
value
.
container
.
contents
=
contents
.
value
[
'add'
]
drawerInfo
.
value
.
visible
=
true
}
const
saveData
=
async
(
params
)
=>
{
// const passInfo = await checkParamsData()
console
.
log
(
'params'
,
params
)
let
request
=
drawerInfo
.
value
.
type
===
'add'
?
saveStandardCode
:
updateStandardCode
request
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
proxy
.
$passCode
)
{
ElMessage
.
success
(
'操作成功'
)
getTreeData
()
drawerInfo
.
value
.
visible
=
false
}
}).
finally
(()
=>
{
drawerInfo
.
value
.
footer
.
btns
.
map
((
item
:
any
)
=>
item
.
disabled
=
true
)
})
}
const
scrollTable
=
(
rowInfo
)
=>
{
nextTick
(()
=>
{
const
drawerBody
=
document
.
getElementsByClassName
(
'el-drawer__body'
)[
0
];
const
tableListRef
=
drawerRef
.
value
.
getDrawerConRef
(
"drawerTableRef"
);
if
(
!
tableListRef
)
return
;
//设置选中表格当前新增行。
tableListRef
.
setCurrentRow
(
rowInfo
);
drawerBody
.
scrollTop
=
drawerBody
.
scrollHeight
;
let
table
=
tableListRef
.
layout
.
table
.
refs
;
// 获取表格滚动元素
let
tableScrollEle
=
table
.
bodyWrapper
.
firstElementChild
.
firstElementChild
;
// 设置表格滚动的位置
tableScrollEle
.
scrollTop
=
tableScrollEle
.
scrollHeight
;
});
};
const
drawerBtnClick
=
(
btn
,
info
)
=>
{
console
.
log
(
'btn'
,
btn
,
info
)
console
.
log
(
'table'
,
formTable
.
value
)
let
params
=
{
standardCodeFields
:
formTable
.
value
.
tableInfo
.
data
.
map
(
item
=>
{
let
obj
=
{
fieldName
:
item
.
fieldName
,
guid
:
item
.
guid
||
null
,
standardGuid
:
item
.
standardGuid
||
null
}
return
obj
}),
...
info
}
if
(
params
.
typeCode
===
'1'
)
{
delete
params
.
hierarchy
}
if
(
drawerInfo
.
value
.
type
===
'edit'
)
{
params
.
guid
=
currTableData
.
value
.
guid
}
if
(
btn
.
value
==
'submit'
||
btn
.
value
==
'saveAndAdd'
)
{
drawerInfo
.
value
.
footer
.
btns
.
map
((
item
:
any
)
=>
item
.
disabled
=
true
)
saveData
(
params
)
}
else
{
drawerInfo
.
value
.
footer
.
btns
.
map
((
item
:
any
)
=>
delete
item
.
disabled
)
nextTick
(()
=>
{
drawerInfo
.
value
.
visible
=
false
})
}
}
const
radioGroupChange
=
async
(
val
,
info
)
=>
{
dictionaryType
.
value
=
Number
(
val
)
await
setFormItems
(
info
)
setGroup
()
}
// 切换结构类型 设置选项显隐
const
setGroup
=
()
=>
{
let
dictionaryOpts
=
formItems
.
value
.
at
(
-
1
).
children
if
(
dictionaryType
.
value
==
1
)
{
dictionaryOpts
[
2
].
visible
=
false
dictionaryOpts
[
3
].
visible
=
false
}
else
if
(
dictionaryType
.
value
==
2
)
{
dictionaryOpts
[
2
].
visible
=
false
dictionaryOpts
[
3
].
block
=
false
dictionaryOpts
[
3
].
visible
=
true
}
else
if
(
dictionaryType
.
value
==
3
)
{
dictionaryOpts
[
2
].
visible
=
true
dictionaryOpts
[
3
].
block
=
true
dictionaryOpts
[
3
].
visible
=
true
}
else
if
(
dictionaryType
.
value
==
4
)
{
dictionaryOpts
[
2
].
visible
=
false
dictionaryOpts
[
3
].
block
=
true
dictionaryOpts
[
3
].
visible
=
true
}
formInfo
.
value
.
formInfo
.
items
=
formItems
.
value
}
.table_tool_wrap
{
display
:
flex
;
flex-direction
:
column
;
onActivated
(()
=>
{
// getCodeRuleData();
// let guid = cacheStore.getCatch('dictionaryGuid');
// if (guid) {
// nextTick(() => {
// if (treePromise.value) {
// treePromise.value.then(() => {
// nodeClick({ guid: guid, dictionaryType: '1', type: 2 });
// cacheStore.setCatch('dictionaryGuid', null);
// });
// } else {
// nodeClick({ guid: guid, type: 1 });
// cacheStore.setCatch('dictionaryGuid', null);
// }
// });
// }
})
.el-input
{
width
:
230px
;
height
:
32px
;
onBeforeMount
(()
=>
{
// getDataType()
getTreeData
()
getParamsList
({
dictType
:
'发布单位'
}).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
proxy
.
$passCode
)
{
const
data
=
res
.
data
||
[]
publishingUnitCodeOptions
.
value
=
data
}
})
})
:deep
(
.el-input
)
{
.el-input__suffix-inner
{
flex-direction
:
row-reverse
;
-webkit-flex-direction
:
row-reverse
;
display
:
flex
;
onMounted
(()
=>
{
let
dom
=
document
.
getElementById
(
'main-app'
);
if
(
dom
)
{
dom
.
addEventListener
(
'click'
,
(
event
:
any
)
=>
{
// 新建时不要处理。
if
(
drawerInfo
.
value
.
header
.
title
==
'数据字典详情'
&&
!
event
.
target
?.
classList
?.
contains
(
'drawer-detail-cell'
))
{
if
(
drawerInfo
.
value
.
visible
)
{
drawerInfo
.
value
.
visible
=
false
;
}
}
});
}
});
</
script
>
<
template
>
<div
class=
"container_wrap full flex"
>
<div
class=
"aside_wrap"
>
<div
class=
"aside_title"
>
数据字典列表
</div>
<Tree
ref=
"dictTreeRef"
:treeInfo=
"treeInfo"
@
nodeClick=
"nodeClick"
@
loadNode=
"loadTreeNode"
/>
</div>
<DictFileds
ref=
"dictFiledsRef"
v-if=
"showFiledsPage"
@
exportData=
"exportData"
/>
<div
class=
"main_wrap"
v-else
>
<div
class=
"table_tool_wrap"
>
<div
class=
"tools_btns"
>
<el-button
type=
"primary"
@
click=
"loadDrawer"
v-preReClick
>
新建
</el-button>
<el-button
@
click=
"batching('delete')"
v-preReClick
>
批量删除
</el-button>
</div>
<el-input
class=
"table_search_input"
v-model
.
trim=
"tableSearchInput"
placeholder=
"请输入代码名称搜索"
:suffix-icon=
"Search"
clearable
@
change=
"val => getFirstPageData()"
/>
</div>
<div
class=
"table_panel_wrap full"
>
<Table
:tableInfo=
"tableInfo"
@
tableBtnClick=
"tableBtnClick"
@
tableSelectionChange=
"tableSelectionChange"
@
tablePageChange=
"tablePageChange"
@
tableSwitchBeforeChange=
"tableSwitchBeforeChange"
/>
</div>
</div>
<Drawer
ref=
"drawerRef"
:drawerInfo=
"drawerInfo"
@
drawerBtnClick=
"drawerBtnClick"
@
radioGroupChange=
"radioGroupChange"
@
drawerTableBtnClick=
"tableBtnClick"
@
drawerTableSelectionChange=
"tableSelectionChange"
@
drawerTableToolBtnClick=
"toolBtnClick"
@
drawerTableInputChange=
"tableInputChange"
@
drawerToolBtnClick=
"toolBtnClick"
@
onUpload=
"onUpload"
@
uploadFile=
"uploadFile"
@
uploadBtnClick=
"toolBtnClick"
/>
</div>
</
template
>
<
style
lang=
"scss"
scoped
>
.container_wrap
{
.aside_wrap
{
width
:
200px
;
}
}
.table_panel_wrap
{
height
:
calc
(
100%
-
44px
);
.tree_panel
{
height
:
100%
;
padding-top
:
0
;
:deep(.el-tree)
{
margin
:
0
;
height
:
calc
(
100%
-
68px
);
overflow
:
hidden
auto
;
}
}
</
style
>
...
...
src/views/data_meta/standard-codetable_old.vue
0 → 100644
View file @
9d37357
<route
lang=
"yaml"
>
name: metadataStandardCodetable
</route>
<
script
lang=
"ts"
setup
name=
"metadataStandardCodetable"
>
import
{
ref
,
reactive
}
from
'vue'
;
import
{
ElMessage
}
from
"element-plus"
;
import
Tree
from
'@/components/Tree/index.vue'
;
import
TableTools
from
'@/components/Tools/table_tools.vue'
;
import
{
Search
}
from
'@element-plus/icons-vue'
import
{
useRouter
,
useRoute
}
from
"vue-router"
;
import
{
TableColumnWidth
}
from
'@/utils/enum'
;
import
{
commonPageConfig
}
from
'@/components/PageNav/index'
;
import
{
getParamsList
}
from
'@/api/modules/dataAsset'
import
{
getStandardCodeList
,
saveStandardCode
,
updateStandardCode
}
from
'@/api/modules/dataMetaService'
const
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
router
=
useRouter
();
const
treeInfo
:
any
=
reactive
({
id
:
"data-pickup-tree"
,
filter
:
true
,
queryValue
:
""
,
queryPlaceholder
:
"请输入关键字搜索"
,
props
:
{
label
:
"label"
,
value
:
"value"
,
},
nodeKey
:
'value'
,
expandedKey
:
[
'01'
],
currentNodeKey
:
'01'
,
expandOnNodeClick
:
false
,
data
:
[],
loading
:
false
});
function
nodeClick
(
data
)
{
}
/** 分页及搜索传参信息配置。 */
const
tableSearchInput
=
ref
(
''
)
function
getFirstPageData
()
{
page
.
value
.
curr
=
1
toSearch
({})
}
function
toSearch
(
val
:
any
,
clear
:
boolean
=
false
)
{
let
params
:
any
=
Object
.
keys
(
val
).
length
?
{
...
val
}
:
{}
params
.
pageIndex
=
page
.
value
.
curr
;
params
.
pageSize
=
page
.
value
.
limit
;
params
.
name
=
tableSearchInput
.
value
getTableData
(
params
);
}
const
page
=
ref
({
...
commonPageConfig
,
collectTaskName
:
''
,
dataSourceGuid
:
''
,
taskState
:
null
});
const
tableInfo
=
ref
({
id
:
'data-source-table'
,
fields
:
[
{
label
:
'序号'
,
type
:
'index'
,
width
:
TableColumnWidth
.
INDEX
,
align
:
'center'
},
{
label
:
'代码名称'
,
field
:
'1'
,
width
:
140
},
{
label
:
'标准号'
,
field
:
'2'
,
width
:
140
},
{
label
:
'标准名称'
,
field
:
'3'
,
width
:
140
},
{
label
:
'启用状态'
,
field
:
'4'
,
width
:
140
},
{
label
:
'创建时间'
,
field
:
'5'
,
width
:
140
}
],
data
:
[],
page
:
{
type
:
'normal'
,
rows
:
0
,
...
page
.
value
},
actionInfo
:
{
label
:
'操作'
,
type
:
'btn'
,
width
:
160
,
btns
:
scope
=>
{
let
row
=
scope
.
row
return
[
{
label
:
'编辑'
,
value
:
'edit'
},
{
label
:
'删除'
,
value
:
'delete'
},
]
}
},
loading
:
false
})
function
tableBtnClick
(
scope
,
btn
)
{
}
function
tablePageChange
(
info
)
{
page
.
value
.
curr
=
Number
(
info
.
curr
);
page
.
value
.
limit
=
Number
(
info
.
limit
);
// getTableData();
}
function
getTableData
(
params
)
{
}
function
handleCreate
()
{
drawerInfo
.
value
.
visible
=
true
;
drawerInfo
.
value
.
type
=
'add'
;
drawerInfo
.
value
.
header
.
title
=
'新增标准代码'
;
drawerInfo
.
value
.
footer
.
visible
=
true
;
}
// drawer form
const
standardOptions
=
ref
([])
const
publishingUnitCodeOptions
=
ref
([])
const
formRef
=
ref
()
const
formItems
:
any
=
ref
([
{
label
:
'标准类型'
,
type
:
'select'
,
placeholder
:
'请选择'
,
field
:
'standardTypeCode'
,
default
:
''
,
options
:
standardOptions
,
clearable
:
true
,
required
:
true
},
{
label
:
'代码名称'
,
type
:
'input'
,
placeholder
:
'请输入'
,
field
:
'codeName'
,
default
:
''
,
maxlength
:
20
,
clearable
:
true
,
required
:
true
},
{
label
:
'标准号'
,
type
:
'input'
,
placeholder
:
'请输入'
,
field
:
'standard'
,
default
:
''
,
maxlength
:
50
,
clearable
:
true
,
required
:
true
},
{
label
:
'标准名称'
,
type
:
'input'
,
placeholder
:
'请输入'
,
field
:
'standardName'
,
default
:
''
,
maxlength
:
20
,
clearable
:
true
,
required
:
true
},
{
label
:
'发布单位'
,
type
:
'select'
,
placeholder
:
'请输入'
,
field
:
'publishingUnitCode'
,
default
:
''
,
options
:
publishingUnitCodeOptions
,
clearable
:
true
,
required
:
true
},
{
label
:
'排序'
,
type
:
'inputNumber'
,
placeholder
:
'请输入'
,
field
:
'orderNum'
,
default
:
''
,
maxlength
:
2
,
clearable
:
true
,
required
:
true
},
{
label
:
'启用状态'
,
type
:
'switch'
,
field
:
'bizState'
,
default
:
false
},
{
label
:
'代码类型'
,
type
:
'select'
,
placeholder
:
'请选择'
,
field
:
'typeCode'
,
default
:
'1'
,
options
:
[
{
label
:
'列表结构'
,
value
:
'1'
},
{
label
:
'层级结构'
,
value
:
'2'
}
],
clearable
:
true
,
required
:
true
},
{
label
:
'编码字段'
,
type
:
'select'
,
placeholder
:
'请选择'
,
field
:
'codeFields'
,
default
:
[],
options
:
[
{
label
:
'code'
,
value
:
'code'
},
{
label
:
'name'
,
value
:
'name'
}
],
clearable
:
true
,
required
:
true
,
multiple
:
true
},
{
label
:
'编码名称'
,
type
:
'select'
,
placeholder
:
'请选择'
,
field
:
'codeFieldName'
,
default
:
''
,
options
:
[
{
label
:
'code'
,
value
:
'code'
},
{
label
:
'name'
,
value
:
'name'
}
],
clearable
:
true
,
required
:
true
},
{
label
:
'层级结构'
,
type
:
'input'
,
placeholder
:
'请输入'
,
field
:
'hierarchy'
,
default
:
''
,
clearable
:
true
,
required
:
true
}
])
const
formRules
=
ref
({
})
const
formInfo
=
ref
({
type
:
'form'
,
title
:
''
,
col
:
'span'
,
formInfo
:
{
id
:
'add-dict-form'
,
col
:
'col2'
,
items
:
formItems
.
value
,
formRules
:
formRules
.
value
}
})
const
formTable
=
reactive
({
type
:
"table"
,
title
:
"定义表结构"
,
col
:
'no-margin'
,
style
:
{
height
:
'calc(100% - 234px)'
},
tableInfo
:
{
id
:
"role-authority-table"
,
multiple
:
true
,
minHeight
:
'unset'
,
maxHeight
:
'100%'
,
fields
:
[
{
label
:
'序号'
,
type
:
'index'
,
width
:
56
,
align
:
'center'
},
{
label
:
'字段名称'
,
field
:
'fieldName'
,
width
:
140
,
type
:
'edit'
,
customClass
:
'edit-colum'
}
],
data
:
[{
fieldName
:
'1'
,
index
:
0
}],
showPage
:
false
,
actionInfo
:
{
show
:
true
,
label
:
"操作"
,
type
:
"btn"
,
width
:
60
,
fixed
:
'right'
,
btns
:
[{
label
:
"删除"
,
value
:
"remove"
}]
},
editInfo
:
{
fieldName
:
{
field
:
'fieldName'
,
label
:
'字段名称'
,
type
:
'input'
,
clearable
:
true
,
maxlength
:
20
}
},
readonly
:
false
,
col
:
'auto-height'
,
style
:
{
height
:
'calc(100% - 40px)'
},
loading
:
false
},
tableTool
:
{
col
:
'float-right'
,
visible
:
true
,
btns
:
[
{
label
:
"新增行"
,
value
:
"tableAdd"
,
type
:
'primary'
},
{
label
:
"批量删除"
,
value
:
"tableDelete"
},
]
},
})
// 新增drawer
const
drawerInfo
=
ref
({
visible
:
false
,
direction
:
'rtl'
,
size
:
550
,
header
:
{
title
:
'新增标准代码'
,
},
type
:
''
,
container
:
{
contents
:
[
formInfo
.
value
,
formTable
],
},
footer
:
{
visible
:
true
,
btns
:
[
{
type
:
'default'
,
label
:
'取消'
,
value
:
'cancel'
},
{
type
:
'primary'
,
label
:
'保存'
,
value
:
'save'
},
{
type
:
'primary'
,
label
:
'保存并添加数据'
,
value
:
'saveAndAdd'
,
visible
:
true
}
]
}
})
async
function
drawerBtnClick
(
btn
,
info
)
{
}
function
drawerTableToolBtnClick
(
btn
,
data
)
{
console
.
log
(
btn
,
data
)
if
(
btn
.
value
===
'tableAdd'
)
{
// 定义表结构新增行
let
rowInfo
=
{
fieldName
:
''
}
formTable
.
tableInfo
.
data
.
push
(
rowInfo
)
}
}
onMounted
(()
=>
{
getParamsList
({
dictType
:
'标准类型'
}).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
proxy
.
$passCode
)
{
const
data
=
res
.
data
||
[]
treeInfo
.
data
=
data
standardOptions
.
value
=
data
// 默认展开第一个
if
(
data
.
length
===
0
)
return
let
params
=
{
pageIndex
:
1
,
pageSize
:
100
,
standardTypeCode
:
data
[
0
].
value
,
codeName
:
'标准类型'
}
getStandardCodeList
(
params
)
}
})
getParamsList
({
dictType
:
'发布单位'
}).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
proxy
.
$passCode
)
{
const
data
=
res
.
data
||
[]
publishingUnitCodeOptions
.
value
=
data
}
})
})
</
script
>
<
template
>
<div
class=
"container_wrap full flex"
>
<div
class=
"aside_wrap"
>
<div
class=
"aside_title"
>
标准代码列表
</div>
<Tree
:treeInfo=
"treeInfo"
@
nodeClick=
"nodeClick"
/>
</div>
<div
class=
"main_wrap"
>
<div
class=
"table_tool_wrap"
>
<div
class=
"tools_btns"
>
<el-button
type=
"primary"
@
click=
"handleCreate"
>
新建
</el-button>
<el-button>
批量删除
</el-button>
<el-button>
批量导入
</el-button>
</div>
<el-input
class=
"table_search_input"
v-model
.
trim=
"tableSearchInput"
placeholder=
"代码名称搜索"
:suffix-icon=
"Search"
clearable
@
change=
"val => getFirstPageData()"
/>
</div>
<div
class=
"table_panel_wrap"
>
<Table
:tableInfo=
"tableInfo"
@
tableBtnClick=
"tableBtnClick"
@
tablePageChange=
"tablePageChange"
/>
</div>
</div>
<Drawer
:drawerInfo=
"drawerInfo"
@
drawerBtnClick=
"drawerBtnClick"
ref=
"drawerRef"
@
drawerTableToolBtnClick=
"drawerTableToolBtnClick"
>
<!--
<Form
ref=
"formRef"
:itemList=
"formItems"
formId=
"basic-info-form"
:rules=
"formRules"
/>
-->
</Drawer>
</div>
</
template
>
<
style
scoped
lang=
"scss"
>
.container_wrap
{
.aside_wrap
{
width
:
200px
;
}
.main_wrap
{
padding
:
10px
20px
;
:deep(.el-tabs)
{
height
:
100%
;
.el-tabs__header
{
margin-bottom
:
0
;
}
.el-tabs__item
{
height
:
32px
;
padding
:
0px
;
width
:
144px
;
&:last-child
{
width
:
130px
;
}
}
.el-tabs__content
{
height
:
calc
(
100%
-
32px
);
}
.el-tab-pane
{
padding
:
0px
16px
;
height
:
100%
;
}
}
}
}
.tree_panel
{
height
:
calc
(
100%
-
36px
);
padding-top
:
0
;
:deep(.el-tree)
{
margin
:
0
;
overflow
:
hidden
auto
;
}
}
.table_tool_wrap
{
display
:
flex
;
flex-direction
:
column
;
.el-input
{
width
:
230px
;
height
:
32px
;
}
:deep
(
.el-input
)
{
.el-input__suffix-inner
{
flex-direction
:
row-reverse
;
-webkit-flex-direction
:
row-reverse
;
display
:
flex
;
}
}
}
.table_panel_wrap
{
height
:
calc
(
100%
-
44px
);
}
</
style
>
\ No newline at end of file
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment