Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zrch-risk-39
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
zrch-risk-39
Commits
0ee8d549
提交
0ee8d549
authored
1月 22, 2026
作者:
kxjia
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
http://47.97.51.208/root/zrch-risk-39
上级
f1134147
7e65dfdb
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
158 行增加
和
163 行删除
+158
-163
MetricMonitorCombinedSetList.vue
...ient-39/src/views/metric/MetricMonitorCombinedSetList.vue
+70
-66
MetricMonitorSetList.vue
...-risk-client-39/src/views/metric/MetricMonitorSetList.vue
+88
-97
没有找到文件。
zrch-risk-client-39/src/views/metric/MetricMonitorCombinedSetList.vue
浏览文件 @
0ee8d549
<
template
>
<div>
<!--引用表格-->
<BasicTable
@
register=
"registerTable"
@
edit-end=
"handleEditEnd"
@
edit-cancel=
"handleEditCancel"
:beforeEditSubmit=
"beforeEditSubmit"
>
<BasicTable
@
register=
"registerTable"
@
edit-end=
"handleEditEnd"
@
edit-cancel=
"handleEditCancel"
:beforeEditSubmit=
"beforeEditSubmit"
:rowSelection=
"rowSelection"
>
<!--插槽:table标题-->
<template
#
tableTitle
>
<a-button
type=
"primary"
@
click=
"handleAdd"
preIcon=
"ant-design:plus-outlined"
>
新增
</a-button>
<a-button
type=
"primary"
@
click=
"handleCaluculatAllMetric"
preIcon=
"ant-design:plus-outlined"
>
计算所有指标值
</a-button>
<a-button
type=
"primary"
@
click=
"handleCustomImport"
preIcon=
"ant-design:plus-outlined"
>
从EXCEL导入
</a-button>
<a-dropdown
v-if=
"selectedRowKeys.length > 0"
>
<template
#
overlay
>
<a-menu>
<a-menu-item
key=
"1"
@
click=
"batchHandleDelete"
>
<Icon
icon=
"ant-design:delete-outlined"
></Icon>
删除
</a-menu-item>
</a-menu>
</
template
>
<a-button
>
批量操作
<Icon
icon=
"mdi:chevron-down"
></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<
template
#
action=
"{ record }"
>
<TableAction
:actions=
"getTableAction(record)"
:dropDownActions=
"getDropDownAction(record)"
/>
<TableAction
:actions=
"getTableAction(record)"
:dropDownActions=
"getDropDownAction(record)"
/>
</
template
>
<!--字段回显插槽-->
<
template
#
htmlSlot=
"{
text
}"
>
<
template
#
htmlSlot=
"{
text
}"
>
<div
v-html=
"text"
></div>
</
template
>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.key === 'tolVal'"
>
【
{{
record
.
stTolVal
}}
~
{{
record
.
tolVal
}}
】
</
template
>
<
template
v-if=
"column.key === 'warnVal'"
>
(
{{
record
.
tolVal
}}
~
{{
record
.
warnVal
}}
)
</
template
>
<
template
v-if=
"column.key === 'intvVal'"
>
【
{{
record
.
warnVal
}}
~
{{
record
.
intvVal
}}
】
</
template
>
<template
v-if=
"column.key === 'tolVal'"
>
【
{{
record
.
stTolVal
}}
~
{{
record
.
tolVal
}}
】
</
template
>
<
template
v-if=
"column.key === 'warnVal'"
>
(
{{
record
.
tolVal
}}
~
{{
record
.
warnVal
}}
)
</
template
>
<
template
v-if=
"column.key === 'intvVal'"
>
【
{{
record
.
warnVal
}}
~
{{
record
.
intvVal
}}
】
</
template
>
</template>
</BasicTable>
<!-- 表单区域 -->
...
...
@@ -37,58 +51,54 @@
</template>
<
script
lang=
"ts"
name=
"metric-metricMonitorSet"
setup
>
import
{
ref
,
computed
,
unref
}
from
'vue'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'/@/components/Table'
;
import
{
useModal
}
from
'/@/components/Modal'
;
import
{
useListPage
}
from
'/@/hooks/system/useListPage'
import
MetricMonitorSetFomulaModal
from
'./components/MetricMonitorSetFomulaModal.vue'
import
{
columns
,
searchFormSchema
,
formSchema
}
from
'./MetricMonitorSet.data'
;
import
{
listCombined
,
deleteOne
,
batchDelete
,
caluculatAllMetric
,
saveOrUpdate
,
batchImmportCalculate
}
from
'./MetricMonitorSet.api'
;
import
Import
from
'/@/views/audit/common/components/import.vue'
import
{
ref
,
computed
,
unref
}
from
'vue'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'/@/components/Table'
;
import
{
useModal
}
from
'/@/components/Modal'
;
import
{
useListPage
}
from
'/@/hooks/system/useListPage'
;
import
MetricMonitorSetFomulaModal
from
'./components/MetricMonitorSetFomulaModal.vue'
;
import
{
columns
,
searchFormSchema
,
formSchema
}
from
'./MetricMonitorSet.data'
;
import
{
listCombined
,
deleteOne
,
batchDelete
,
caluculatAllMetric
,
saveOrUpdate
,
batchImmportCalculate
}
from
'./MetricMonitorSet.api'
;
import
Import
from
'/@/views/audit/common/components/import.vue'
;
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerFomulasModal
,
{
openModal
:
openFomulasModal
}]
=
useModal
();
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerFomulasModal
,
{
openModal
:
openFomulasModal
}]
=
useModal
();
const
refImport
=
ref
()
const
refImport
=
ref
()
;
//注册table数据
const
{
tableContext
}
=
useListPage
({
tableProps
:
{
const
{
tableContext
}
=
useListPage
({
tableProps
:
{
title
:
'监测方案'
,
api
:
listCombined
,
columns
,
canResize
:
true
,
canResize
:
true
,
formConfig
:
{
schemas
:
searchFormSchema
,
autoSubmitOnEnter
:
true
,
showAdvancedButton
:
true
,
fieldMapToNumber
:
[
],
fieldMapToTime
:
[
],
autoSubmitOnEnter
:
true
,
showAdvancedButton
:
true
,
fieldMapToNumber
:
[],
fieldMapToTime
:
[],
},
actionColumn
:
{
width
:
150
,
fixed
:
'right'
fixed
:
'right'
,
},
}
})
const
[
registerTable
,
{
reload
},{
rowSelection
,
selectedRowKeys
}]
=
tableContext
},
});
const
[
registerTable
,
{
reload
},
{
rowSelection
,
selectedRowKeys
}]
=
tableContext
;
/**
* 新增事件
*/
function
handleAdd
()
{
openModal
(
true
,
{
mtrcCtp
:
2
,
mtrcCtp
:
2
,
isUpdate
:
false
,
showFooter
:
true
,
});
}
/**
* 编辑事件
*/
...
...
@@ -122,13 +132,13 @@
* 删除事件
*/
async
function
handleDelete
(
record
)
{
await
deleteOne
({
id
:
record
.
id
},
handleSuccess
);
await
deleteOne
({
id
:
record
.
id
},
handleSuccess
);
}
/**
* 批量删除事件
*/
async
function
batchHandleDelete
()
{
await
batchDelete
({
ids
:
selectedRowKeys
.
value
},
handleSuccess
);
await
batchDelete
({
ids
:
selectedRowKeys
.
value
},
handleSuccess
);
}
/**
* 成功回调
...
...
@@ -139,7 +149,7 @@
/**
* 操作栏
*/
function
getTableAction
(
record
){
function
getTableAction
(
record
)
{
return
[
{
label
:
'编辑'
,
...
...
@@ -149,37 +159,38 @@
// label: '编辑公式',
// onClick: handleFormulas.bind(null, record),
// }
]
];
}
/**
* 下拉操作栏
*/
function
getDropDownAction
(
record
){
function
getDropDownAction
(
record
)
{
return
[
{
label
:
'详情'
,
onClick
:
handleDetail
.
bind
(
null
,
record
),
},
{
},
{
label
:
'删除'
,
popConfirm
:
{
title
:
'是否确认删除'
,
confirm
:
handleDelete
.
bind
(
null
,
record
),
}
}
]
},
},
];
}
function
handleEditEnd
({
record
,
index
,
key
,
value
}:
Recordable
)
{
handleSuccess
()
handleSuccess
();
return
false
;
}
async
function
beforeEditSubmit
({
record
,
index
,
key
,
value
})
{
let
tmpPbj
=
{
id
:
record
.
id
,
mtrcNo
:
record
.
mtrcNo
,
}
tmpPbj
[
key
]
=
value
id
:
record
.
id
,
mtrcNo
:
record
.
mtrcNo
,
};
tmpPbj
[
key
]
=
value
;
await
saveOrUpdate
(
tmpPbj
);
}
...
...
@@ -187,20 +198,19 @@
console
.
log
(
'cancel'
);
}
function
handleCaluculatAllMetric
()
{
caluculatAllMetric
()
function
handleCaluculatAllMetric
()
{
caluculatAllMetric
();
}
const
importCallback
=
async
(
datas
)
=>
{
//const transformedData = transformData(datas,pid);
await
batchImmportCalculate
(
datas
);
await
reload
();
}
};
const
handleCustomImport
=
()
=>
{
refImport
.
value
.
iniData
(
formSchema
)
}
refImport
.
value
.
iniData
(
formSchema
);
};
// function transformData(originalArray) {
// return originalArray.map(item => ({
...
...
@@ -214,11 +224,6 @@
// }]
// }));
// }
</
script
>
<
style
scoped
>
</
style
>
\ No newline at end of file
<
style
scoped
></
style
>
zrch-risk-client-39/src/views/metric/MetricMonitorSetList.vue
浏览文件 @
0ee8d549
<
template
>
<div>
<!--引用表格-->
<BasicTable
@
register=
"registerTable"
@
edit-end=
"handleEditEnd"
@
edit-cancel=
"handleEditCancel"
:beforeEditSubmit=
"beforeEditSubmit"
:loading=
"isLoading"
>
<BasicTable
@
register=
"registerTable"
@
edit-end=
"handleEditEnd"
@
edit-cancel=
"handleEditCancel"
:beforeEditSubmit=
"beforeEditSubmit"
:loading=
"isLoading"
:rowSelection=
"rowSelection"
>
<!--插槽:table标题-->
<template
#
tableTitle
>
<a-button
type=
"primary"
@
click=
"handleAdd"
preIcon=
"ant-design:plus-outlined"
>
新增
</a-button>
...
...
@@ -17,31 +24,25 @@
</a-menu-item>
</a-menu>
</
template
>
<a-button>
批量操作
<a-button
>
批量操作
<Icon
icon=
"mdi:chevron-down"
></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<
template
#
action=
"{ record }"
>
<TableAction
:actions=
"getTableAction(record)"
:dropDownActions=
"getDropDownAction(record)"
/>
<TableAction
:actions=
"getTableAction(record)"
:dropDownActions=
"getDropDownAction(record)"
/>
</
template
>
<!--字段回显插槽-->
<
template
#
htmlSlot=
"{
text
}"
>
<
template
#
htmlSlot=
"{
text
}"
>
<div
v-html=
"text"
></div>
</
template
>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.key === 'tolVal'"
>
【
{{
record
.
stTolVal
}}
~
{{
record
.
tolVal
}}
】
</
template
>
<
template
v-if=
"column.key === 'warnVal'"
>
(
{{
record
.
tolVal
}}
~
{{
record
.
warnVal
}}
)
</
template
>
<
template
v-if=
"column.key === 'intvVal'"
>
【
{{
record
.
warnVal
}}
~
{{
record
.
intvVal
}}
】
</
template
>
<template
v-if=
"column.key === 'tolVal'"
>
【
{{
record
.
stTolVal
}}
~
{{
record
.
tolVal
}}
】
</
template
>
<
template
v-if=
"column.key === 'warnVal'"
>
(
{{
record
.
tolVal
}}
~
{{
record
.
warnVal
}}
)
</
template
>
<
template
v-if=
"column.key === 'intvVal'"
>
【
{{
record
.
warnVal
}}
~
{{
record
.
intvVal
}}
】
</
template
>
</template>
</BasicTable>
<!-- 表单区域 -->
...
...
@@ -50,84 +51,82 @@
<MetricFomulasModal
@
register=
"registerFomulasModal"
@
success=
"handleSuccess"
></MetricFomulasModal>
<MetricApiCfgModal
@
register=
"registerAPICofngModal"
@
success=
"handleSuccess"
></MetricApiCfgModal>
<MetricMonitorSetHistory
@
register=
"registerMetricSetHistory"
@
success=
"handleSuccess"
></MetricMonitorSetHistory>
</div>
<Import
ref=
"refImport"
@
callback=
"importCallback"
></Import>
</template>
<
script
lang=
"ts"
name=
"metric-metricMonitorSet"
setup
>
import
{
ref
,
computed
,
unref
}
from
'vue'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'/@/components/Table'
;
import
{
useModal
}
from
'/@/components/Modal'
;
import
{
useListPage
}
from
'/@/hooks/system/useListPage'
import
MetricMonitorSetModal
from
'./components/MetricMonitorSetModal.vue'
import
MetricFomulasModal
from
'./components/MetricFomulasModal.vue'
import
Import
from
'/@/views/audit/common/components/import.vue'
import
MetricMonitorSetHistory
from
'./components/MetricMonitorSetHistory.vue'
import
{
columns
,
searchFormSchema
,
formSchema
}
from
'./MetricMonitorSet.data'
;
import
{
list
,
deleteOne
,
batchDelete
,
getImportUrl
,
getExportUrl
,
saveOrUpdate
,
batchImmportBase
}
from
'./MetricMonitorSet.api'
;
import
MetricApiCfgModal
from
'./components/MetricApiCfgModal.vue'
import
{
queryAll
}
from
'./MetricApiCfg.api'
;
import
{
ref
,
computed
,
unref
}
from
'vue'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'/@/components/Table'
;
import
{
useModal
}
from
'/@/components/Modal'
;
import
{
useListPage
}
from
'/@/hooks/system/useListPage'
;
import
MetricMonitorSetModal
from
'./components/MetricMonitorSetModal.vue'
;
import
MetricFomulasModal
from
'./components/MetricFomulasModal.vue'
;
import
Import
from
'/@/views/audit/common/components/import.vue'
;
import
MetricMonitorSetHistory
from
'./components/MetricMonitorSetHistory.vue'
;
import
{
columns
,
searchFormSchema
,
formSchema
}
from
'./MetricMonitorSet.data'
;
import
{
list
,
deleteOne
,
batchDelete
,
getImportUrl
,
getExportUrl
,
saveOrUpdate
,
batchImmportBase
}
from
'./MetricMonitorSet.api'
;
import
MetricApiCfgModal
from
'./components/MetricApiCfgModal.vue'
;
import
{
queryAll
}
from
'./MetricApiCfg.api'
;
import
{
usePermission
}
from
'/@/hooks/web/usePermission'
;
const
{
hasPermission
}
=
usePermission
();
const
refImport
=
ref
();
const
isLoading
=
ref
(
false
)
const
isLoading
=
ref
(
false
)
;
//注册model
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerBatchModal
,
{
openModal
:
openBatchModal
}]
=
useModal
();
const
[
registerFomulasModal
,
{
openModal
:
openFomulasModal
}]
=
useModal
();
const
[
registerAPICofngModal
,
{
openModal
:
openAPIConfigModal
}]
=
useModal
();
const
[
registerMetricSetHistory
,
{
openModal
:
openHistory
}]
=
useModal
();
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerBatchModal
,
{
openModal
:
openBatchModal
}]
=
useModal
();
const
[
registerFomulasModal
,
{
openModal
:
openFomulasModal
}]
=
useModal
();
const
[
registerAPICofngModal
,
{
openModal
:
openAPIConfigModal
}]
=
useModal
();
const
[
registerMetricSetHistory
,
{
openModal
:
openHistory
}]
=
useModal
();
//注册table数据
const
{
tableContext
,
onExportXls
,
onImportXls
}
=
useListPage
({
tableProps
:
{
const
{
tableContext
,
onExportXls
,
onImportXls
}
=
useListPage
({
tableProps
:
{
title
:
'监测方案'
,
api
:
list
,
columns
,
canResize
:
true
,
defSort
:
{
canResize
:
true
,
defSort
:
{
column
:
'id'
,
order
:
'asc'
,
},
rowSelection
:
{
type
:
'checkbox'
,
},
formConfig
:
{
schemas
:
searchFormSchema
,
autoSubmitOnEnter
:
true
,
showAdvancedButton
:
true
,
fieldMapToNumber
:
[
],
fieldMapToTime
:
[
],
autoSubmitOnEnter
:
true
,
showAdvancedButton
:
true
,
fieldMapToNumber
:
[],
fieldMapToTime
:
[],
},
actionColumn
:
{
width
:
150
,
fixed
:
'right'
fixed
:
'right'
,
},
},
exportConfig
:
{
name
:
"指标导出"
,
name
:
'指标导出'
,
url
:
getExportUrl
,
},
importConfig
:
{
url
:
getImportUrl
,
success
:
handleSuccess
success
:
handleSuccess
,
},
})
const
[
registerTable
,
{
reload
},{
rowSelection
,
selectedRowKeys
}]
=
tableContext
});
const
[
registerTable
,
{
reload
},
{
rowSelection
,
selectedRowKeys
}]
=
tableContext
;
/**
* 新增事件
*/
function
handleAdd
()
{
openModal
(
true
,
{
mtrcCtp
:
1
,
mtrcCtp
:
1
,
isUpdate
:
false
,
showFooter
:
true
,
});
...
...
@@ -154,7 +153,6 @@
});
}
function
handleHistory
(
record
:
Recordable
)
{
openHistory
(
true
,
{
record
,
...
...
@@ -163,7 +161,6 @@
});
}
function
handleFormulas
(
record
:
Recordable
)
{
openFomulasModal
(
true
,
{
record
,
...
...
@@ -173,12 +170,12 @@
}
async
function
handleAPIConfig
(
record
:
Recordable
)
{
let
dataList
=
await
queryAll
({
mtrcNo
:
record
.
mtrcNo
})
let
data
=
{}
if
(
dataList
&&
dataList
.
length
>
0
)
{
data
=
dataList
[
0
]
let
dataList
=
await
queryAll
({
mtrcNo
:
record
.
mtrcNo
});
let
data
=
{}
;
if
(
dataList
&&
dataList
.
length
>
0
)
{
data
=
dataList
[
0
]
;
openAPIConfigModal
(
true
,
{
record
:
data
,
record
:
data
,
isUpdate
:
true
,
showFooter
:
true
,
});
...
...
@@ -189,21 +186,20 @@
showFooter
:
true
,
});
}
return
false
return
false
;
}
/**
* 删除事件
*/
async
function
handleDelete
(
record
)
{
await
deleteOne
({
id
:
record
.
id
},
handleSuccess
);
await
deleteOne
({
id
:
record
.
id
},
handleSuccess
);
}
/**
* 批量删除事件
*/
async
function
batchHandleDelete
()
{
await
batchDelete
({
ids
:
selectedRowKeys
.
value
},
handleSuccess
);
await
batchDelete
({
ids
:
selectedRowKeys
.
value
},
handleSuccess
);
}
/**
* 成功回调
...
...
@@ -214,48 +210,50 @@
/**
* 操作栏
*/
function
getTableAction
(
record
){
let
obj
=
[{
function
getTableAction
(
record
)
{
let
obj
=
[
{
label
:
'编辑'
,
disabled
:
false
,
disabled
:
false
,
onClick
:
handleEdit
.
bind
(
null
,
record
),
}]
},
];
obj
.
push
({
label
:
'接口配置'
,
disabled
:
record
.
collMethod
==
1
?
true
:
false
,
disabled
:
record
.
collMethod
==
1
?
true
:
false
,
onClick
:
handleAPIConfig
.
bind
(
null
,
record
),
})
return
obj
})
;
return
obj
;
}
/**
* 下拉操作栏
*/
function
getDropDownAction
(
record
){
function
getDropDownAction
(
record
)
{
return
[
{
label
:
'详情'
,
onClick
:
handleDetail
.
bind
(
null
,
record
),
},
{
},
{
label
:
'修改历史'
,
onClick
:
handleHistory
.
bind
(
null
,
record
),
},
{
},
{
label
:
'删除'
,
popConfirm
:
{
title
:
'是否确认删除'
,
confirm
:
handleDelete
.
bind
(
null
,
record
),
},
},
];
}
}
]
}
async
function
beforeEditSubmit
({
record
,
index
,
key
,
value
})
{
let
tmpPbj
=
{
id
:
record
.
id
,
mtrcNo
:
record
.
mtrcNo
,
}
tmpPbj
[
key
]
=
value
id
:
record
.
id
,
mtrcNo
:
record
.
mtrcNo
,
};
tmpPbj
[
key
]
=
value
;
await
saveOrUpdate
(
tmpPbj
);
}
...
...
@@ -264,41 +262,35 @@
}
function
handleEditEnd
({
record
,
index
,
key
,
value
}:
Recordable
)
{
handleSuccess
()
handleSuccess
();
return
false
;
}
const
importCallback
=
async
(
datas
)
=>
{
isLoading
.
value
=
true
const
result
=
await
datas
.
map
(
item
=>
({
isLoading
.
value
=
true
;
const
result
=
await
datas
.
map
((
item
)
=>
({
...
item
,
stTolVal
:
extractFirstNumber
(
item
.
stTolVal
),
tolVal
:
extractFirstNumber
(
item
.
tolVal
),
warnVal
:
extractFirstNumber
(
item
.
warnVal
),
intvVal
:
extractFirstNumber
(
item
.
intvVal
)
intvVal
:
extractFirstNumber
(
item
.
intvVal
),
}));
await
batchImmportBase
(
result
);
await
reload
();
isLoading
.
value
=
false
}
isLoading
.
value
=
false
;
};
const
handleCustomImport
=
()
=>
{
refImport
.
value
.
iniData
(
formSchema
)
}
refImport
.
value
.
iniData
(
formSchema
);
};
function
extractFirstNumber
(
value
)
{
if
(
!
value
||
typeof
value
!==
'string'
)
return
null
;
const
match
=
value
.
match
(
/^
(\d
+
)
/
);
return
match
?
parseInt
(
match
[
1
])
:
null
;
}
</
script
>
<
style
scoped
>
</
style
>
\ No newline at end of file
<
style
scoped
></
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论