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
40b02c12
authored
2025-06-24 10:26:22 +0800
by
lxs
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
数据定价更新
1 parent
4d0521fe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
173 additions
and
19 deletions
src/api/modules/queryService.ts
src/components/Table/index.vue
src/components/Upload/index.vue
src/views/importFile.vue
src/api/modules/queryService.ts
View file @
40b02c1
...
...
@@ -303,3 +303,10 @@ export const getCurrentUserInfo = (params) => {
params
});
};
/** 下载文件模板 */
export
const
exportTemplate
=
(
params
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_ADD_FILE
}
/import-config/export-template?bizGuid=
${
params
.
bizGuid
}
&importType=
${
params
.
importType
}
`
,
method
:
'post'
,
responseType
:
'blob'
});
...
...
src/components/Table/index.vue
View file @
40b02c1
...
...
@@ -248,6 +248,7 @@ onMounted(() => {
:show-header="props.tableInfo.showHeader ?? true" stripe :border="props.tableInfo.border
?? true" :height="props.tableInfo.height === null ? null : (props.tableInfo.height ?? '100%')"
:max-height="maxHeight" :row-key="rowKey" :current-row-key="currentRowKey" :row-class-name="rowClassName"
:tree-props="props.tableInfo.treeProps" :default-expand-all="props.tableInfo.expandAll ?? false"
:expand-row-keys="props.tableInfo.expandedKey" v-loading="tableDataLoading" @row-click="rowClick"
@row-dblclick="rowDblClick" @selection-change="selectionChange" @select="tableCheckboxSelectChange"
@select-all="tableCheckboxAllSelectChange" style="width: 100%; display: inline-block"
...
...
@@ -375,7 +376,7 @@ onMounted(() => {
<
template
#
default=
"scope"
v-else-if=
"item.type == 'approveTag'"
>
<el-tag
v-if=
"scope.row[item.field]"
:type=
"tagType(scope.row.approveVO, 'approveState')"
>
{{
tagMethod
(
scope
.
row
.
approveVO
,
'approveState'
)
}}
</el-tag>
}}
</el-tag>
<span
v-else
>
{{
'--'
}}
</span>
</
template
>
<
template
#
default=
"scope"
v-else-if=
"item.type == 'tooltip'"
>
...
...
@@ -480,7 +481,7 @@ onMounted(() => {
</template>
<
template
#
default=
"scope"
v-else-if=
"item.type == 'stepsBar'"
>
<div
:class=
"item.className"
v-if=
"item.stepsInfo(scope)"
>
<StepBar
:steps-info=
"item.stepsInfo(scope)"
/>
<StepBar
:steps-info=
"item.stepsInfo(scope)"
/>
</div>
<span
v-else
>
--
</span>
</
template
>
...
...
src/components/Upload/index.vue
View file @
40b02c1
...
...
@@ -111,13 +111,16 @@ defineExpose({
<p
class=
"item_title"
>
{{
item
.
title
}}
</p>
<div
class=
"form_item"
v-if=
"item.type == 'select'"
>
<span
class=
"item_label"
:class=
"
{ required_mark: item.selectInfo.required }">
{{
item
.
selectInfo
.
label
}}
:
</span>
}}
:
</span>
<el-select
v-model=
"extraParams[item.selectInfo.field]"
:placeholder=
"item.selectInfo.placeholder"
:disabled=
"item.selectInfo.disabled"
@
change=
"selectChange"
>
<el-option
v-for=
"opts in item.selectInfo.options"
:label=
"opts.label"
:value=
"opts.value"
/>
:disabled=
"item.selectInfo.disabled"
@
change=
"selectChange"
:filterable=
"item.selectInfo.filterable"
:style=
"item.selectInfo.style"
>
<el-option
v-for=
"opts in item.selectInfo.options"
:label=
"item.selectInfo.props?.label ? opts[item.selectInfo.props.label] : opts.label"
:value=
"item.selectInfo.props?.value ? opts[item.selectInfo.props.value] : opts.value"
:disabled=
"opts.disabled"
/>
</el-select>
</div>
<div
class=
"form_item"
v-if=
"item.type == 'tree-select'"
>
<div
class=
"form_item"
v-
else-
if=
"item.type == 'tree-select'"
>
<span
class=
"item_label"
:class=
"
{ required_mark: item.selectInfo.required }">
{{
item
.
selectInfo
.
label
}}
:
</span>
<el-tree-select
...
...
@@ -176,7 +179,7 @@ defineExpose({
</el-button>
</div>
<el-upload
v-else
ref=
"fileUploadRef"
class=
"upload_panel"
:class=
"[props.uploadInfo.col]"
v-model:file-list=
"fileList"
:action=
"item.uploadInfo.action"
:auto-upload=
"item.uploadInfo.auto ?? ''"
v-model:file-list=
"fileList"
:action=
"item.uploadInfo.action
?? ''
"
:auto-upload=
"item.uploadInfo.auto ?? ''"
:drag=
"item.uploadInfo.drag ?? false"
:accept=
"item.uploadInfo.accept"
:limit=
"item.uploadInfo.limit ?? 1"
:on-change=
"onUpload"
:on-exceed=
"val => exceedFile(val, item.uploadInfo.cover ?? false)"
:on-error=
"handleError"
:on-success=
"handleSuccess"
:before-upload=
"beforeUPload"
...
...
src/views/importFile.vue
View file @
40b02c1
...
...
@@ -18,7 +18,7 @@ import {
getImportData
,
exportDictionary
,
exportCollectTask
,
// getImageContent
exportTemplate
}
from
'@/api/modules/queryService'
;
import
{
parseAndDecodeUrl
,
...
...
@@ -29,6 +29,7 @@ import {
getDictionaryTree
}
from
'@/api/modules/dataInventory'
;
import
{
commonPageConfig
}
from
'@/utils/enum'
;
import
{
getDemandTreeList
,
getDiseaseAll
}
from
'@/api/modules/dataPricing'
;
const
{
proxy
}
=
getCurrentInstance
()
as
any
;
...
...
@@ -156,6 +157,29 @@ const getDictList = () => {
})
}
// 获取需求表树形数据
const
getTreeData
=
()
=>
{
if
(
isfileImport
==
'7'
)
{
getDemandTreeList
({
pageIndex
:
1
,
pageSize
:
100000
,
isCatalog
:
'N'
}).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
const
data
=
res
.
data
?.
records
||
[];
dictionaryList
.
value
=
data
;
}
else
{
proxy
.
$ElMessage
.
error
(
res
.
msg
);
}
})
}
else
{
getDiseaseAll
().
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
const
data
=
res
.
data
||
[];
dictionaryList
.
value
=
data
;
}
else
{
proxy
.
$ElMessage
.
error
(
res
.
msg
);
}
})
}
}
const
tabsChange
=
(
name
)
=>
{
tabsActiveName
.
value
=
name
let
info
:
any
=
{
...
...
@@ -283,11 +307,16 @@ const batching = (type) => {
}
open
(
"此操作将永久删除, 是否继续?"
,
"warning"
,
true
);
}
else
if
(
type
===
'importFile'
)
{
if
(
isfileImport
==
'2'
||
isfileImport
==
'4'
)
{
if
(
isfileImport
==
'2'
||
isfileImport
==
'4'
||
isfileImport
==
'7'
||
isfileImport
==
'8'
)
{
dialogInfo
.
value
.
header
.
title
=
'导入数据'
dialogInfo
.
value
.
type
=
'upload'
dialogInfo
.
value
.
size
=
isfileImport
==
'4'
?
600
:
500
;
uploadFiles
.
value
=
[]
if
(
isfileImport
==
'7'
)
{
uploadSteps
.
value
[
0
].
selectInfo
.
options
=
dictionaryList
.
value
;
}
else
if
(
isfileImport
==
'8'
)
{
uploadSteps
.
value
[
0
].
cascaderInfo
.
options
=
dictionaryList
.
value
;
}
uploadInfo
.
value
.
uploadInfo
.
steps
=
uploadSteps
.
value
const
content
:
any
=
[
uploadInfo
.
value
]
dialogInfo
.
value
.
contents
=
content
...
...
@@ -377,6 +406,20 @@ const exportData = (ids: any = null) => {
res
?.
msg
&&
ElMessage
.
error
(
res
?.
msg
);
}
});
}
else
if
(
tabsActiveName
.
value
==
'importFile'
&&
isfileImport
==
'7'
)
{
exportTemplate
({
bizGuid
:
''
,
importType
:
"0046"
}).
then
((
res
:
any
)
=>
{
download
(
res
,
'需求表管理导入模板.xlsx'
,
'excel'
)
});
}
else
if
(
tabsActiveName
.
value
==
'importFile'
&&
isfileImport
==
'8'
)
{
exportTemplate
({
bizGuid
:
''
,
importType
:
"0047"
}).
then
((
res
:
any
)
=>
{
download
(
res
,
'疾病管理导入模板.xlsx'
,
'excel'
)
});
}
}
...
...
@@ -390,11 +433,11 @@ const importData = (info) => {
// dialogInfo.value.footer.btns.map((item: any) => delete item.disabled)
return
}
uploadFiles
.
value
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
params
.
append
(
"file"
,
item
.
raw
);
});
let
paramUrl
=
''
;
if
(
isfileImport
==
'2'
)
{
uploadFiles
.
value
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
params
.
append
(
"file"
,
item
.
raw
);
});
paramUrl
=
`ms-daop-zcgl-asset-dam-service/dam-catalog-table/excel-by-subject-guid?staffGuid=
${
userData
.
staffGuid
}
&subjectGuid=
${
route
.
query
.
bizGuid
}
`
}
else
if
(
isfileImport
==
'4'
)
{
if
(
!
info
.
databaseNameZh
)
{
...
...
@@ -411,14 +454,17 @@ const importData = (info) => {
})
return
;
}
uploadFiles
.
value
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
params
.
append
(
"uploadFile"
,
item
.
raw
);
});
paramUrl
=
`
${
import
.
meta
.
env
.
VITE_APP_PLAN_BASEURL
}
/meta-collect-task/meta-collect-import?staffGuid=
${
userData
.
staffGuid
}
&databaseNameZh=
${
info
.
databaseNameZh
}
&databaseNameEn=
${
info
.
databaseNameEn
}
&isCover=
${
info
.
isCover
}
`
}
else
if
(
isfileImport
==
'7'
)
{
info
.
bizGuid
=
'0046'
;
paramUrl
=
`
${
import
.
meta
.
env
.
VITE_APP_ADD_FILE
}
/import-data/import-common?importType=
${
importType
.
value
}
&staffGuid=
${
userData
.
staffGuid
}
&tenantGuid=
${
userData
.
tenantGuid
}
`
paramUrl
+=
`&extendFields=
${
encodeURIComponent
(
JSON
.
stringify
(
info
))}
`
}
else
if
(
isfileImport
==
'8'
)
{
info
.
bizGuid
=
'0047'
;
paramUrl
=
`
${
import
.
meta
.
env
.
VITE_APP_ADD_FILE
}
/import-data/import-common?importType=
${
importType
.
value
}
&staffGuid=
${
userData
.
staffGuid
}
&tenantGuid=
${
userData
.
tenantGuid
}
`
paramUrl
+=
`&extendFields=
${
encodeURIComponent
(
JSON
.
stringify
(
info
))}
`
}
else
{
uploadFiles
.
value
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
params
.
append
(
"file"
,
item
.
raw
);
});
paramUrl
=
`
${
import
.
meta
.
env
.
VITE_APP_ADD_FILE
}
/import-data/import-common?importType=
${
importType
.
value
}
&staffGuid=
${
userData
.
staffGuid
}
&tenantGuid=
${
userData
.
tenantGuid
}
&dataType=2`
if
(
info
&&
Object
.
keys
(
info
).
length
)
{
paramUrl
+=
`&extendFields=
${
encodeURIComponent
(
JSON
.
stringify
(
info
))}
`
...
...
@@ -452,6 +498,10 @@ const dialogBtnClick = (btn, info) => {
if
(
dialogInfo
.
value
.
type
==
'upload'
)
{
if
(
tabsActiveName
.
value
==
'dictionary'
)
{
importData
({
bizGuid
:
dictionaryGuid
.
value
})
}
else
if
(
tabsActiveName
.
value
==
'importFile'
&&
isfileImport
==
'7'
)
{
importData
(
info
)
}
else
if
(
tabsActiveName
.
value
==
'importFile'
&&
isfileImport
==
'8'
)
{
importData
(
info
)
}
else
{
importData
(
info
)
}
...
...
@@ -478,6 +528,10 @@ const setUploadInfo = () => {
importType
.
value
=
'0034'
;
}
else
if
(
isfileImport
==
'4'
)
{
importType
.
value
=
'0042'
;
}
else
if
(
isfileImport
==
'7'
)
{
importType
.
value
=
'0046'
;
}
else
if
(
isfileImport
==
'8'
)
{
importType
.
value
=
'0047'
;
}
else
{
importType
.
value
=
'0033'
;
}
...
...
@@ -641,6 +695,94 @@ const setUploadInfo = () => {
}
]
uploadInfo
.
value
.
uploadInfo
.
extraParams
=
{
isCover
:
'Y'
}
}
else
if
(
tabsActiveName
.
value
==
'importFile'
&&
isfileImport
==
'7'
)
{
uploadSteps
.
value
=
[
{
title
:
'1、导入前请先录入以下内容'
,
type
:
'select'
,
selectInfo
:
{
label
:
'需求表名称'
,
placeholder
:
'请选择'
,
field
:
'menuGuid'
,
default
:
''
,
options
:
[],
props
:
{
label
:
"menuName"
,
value
:
"guid"
,
},
filterable
:
true
,
clearable
:
true
,
required
:
true
,
style
:
{
width
:
'191px'
,
}
}
},
{
title
:
'2、请下载最新的模板,并按照模板格式准备需要导入的数据'
,
type
:
'btn_down'
},
{
title
:
'3、选择准备好的文件导入'
,
type
:
'btn_upload'
,
uploadInfo
:
{
action
:
''
,
auto
:
false
,
cover
:
true
,
fileList
:
[],
accept
:
'.xlsx, .xls'
,
tips
:
'当前支持xls、xlsx文件,默认使用第一个sheet'
}
}
]
dictionaryGuid
.
value
=
uploadSetting
.
value
?.
dictionaryGuid
||
''
uploadInfo
.
value
.
uploadInfo
.
extraParams
=
{
menuGuid
:
dictionaryGuid
.
value
}
}
else
if
(
tabsActiveName
.
value
==
'importFile'
&&
isfileImport
==
'8'
)
{
uploadSteps
.
value
=
[
{
title
:
'1、导入前请先录入以下内容'
,
type
:
'cascader'
,
cascaderInfo
:
{
label
:
'疾病名称'
,
placeholder
:
''
,
field
:
'parentGuid'
,
options
:
[],
default
:
''
,
showAllLevels
:
false
,
props
:
{
checkStrictly
:
true
,
label
:
"diseaseName"
,
value
:
"guid"
,
children
:
'childList'
,
emitPath
:
false
},
filterable
:
true
,
clearable
:
true
,
}
},
{
title
:
'2、请下载最新的模板,并按照模板格式准备需要导入的数据'
,
type
:
'btn_down'
},
{
title
:
'3、选择准备好的文件导入'
,
type
:
'btn_upload'
,
uploadInfo
:
{
action
:
''
,
auto
:
false
,
cover
:
true
,
fileList
:
[],
accept
:
'.xlsx, .xls'
,
tips
:
'当前支持xls、xlsx文件,默认使用第一个sheet'
}
}
]
dictionaryGuid
.
value
=
uploadSetting
.
value
?.
dictionaryGuid
||
''
uploadInfo
.
value
.
uploadInfo
.
extraParams
=
{
parentGuid
:
dictionaryGuid
.
value
}
}
else
{
uploadSteps
.
value
=
[
{
...
...
@@ -674,7 +816,8 @@ onActivated(() => {
if
(
tabsActiveName
.
value
==
'dictionary'
)
{
getDictList
();
}
setUploadInfo
()
setUploadInfo
();
(
isfileImport
==
'7'
||
isfileImport
==
'8'
)
&&
getTreeData
();
})
</
script
>
...
...
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