|
@@ -2,8 +2,16 @@
|
|
|
<div class="siteManage-main watchDog">
|
|
|
<!-- 筛选start -->
|
|
|
<div class="filter-container mb-20">
|
|
|
- <span class="">【{{ labelCom }}】站点的所有监控设备 <a href="./static/伍继监控设备导入模板.xlsx" download class="downloadMb" >模板下载</a></span>
|
|
|
-
|
|
|
+ <span class="">
|
|
|
+ 【{{ labelCom }}】站点的所有监控设备
|
|
|
+ <a
|
|
|
+ href="./static/伍继监控设备导入模板.xlsx"
|
|
|
+ download
|
|
|
+ class="downloadMb"
|
|
|
+ >
|
|
|
+ 模板下载
|
|
|
+ </a>
|
|
|
+ </span>
|
|
|
|
|
|
<!-- <el-button icon="el-icon-plus" type="success" @click="addItem()">新增</el-button > -->
|
|
|
|
|
@@ -13,6 +21,7 @@
|
|
|
:action="fileUrl + '/deviceAttribute/deviceAttributeImport'"
|
|
|
:on-progress="handleProgress"
|
|
|
:on-success="handleUpAvatar"
|
|
|
+ :on-error="handleError"
|
|
|
multiple
|
|
|
:limit="1"
|
|
|
:headers="{
|
|
@@ -306,8 +315,15 @@ export default defineComponent({
|
|
|
})
|
|
|
deviceNewsList()
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ const handleError = (res) => {
|
|
|
+ let myError = res.toString() //转字符串
|
|
|
+ myError = myError.replace('Error: ', '') //去掉前面的
|
|
|
+ myError = JSON.parse(myError) //转对象
|
|
|
+ ElMessage.error({
|
|
|
+ message: myError.msg,
|
|
|
+ type: 'error',
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
function goVariableList() {
|
|
|
emit('func')
|
|
@@ -345,7 +361,7 @@ export default defineComponent({
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- //监听变化
|
|
|
+ //监听变化
|
|
|
watch(
|
|
|
() => props.siteId,
|
|
|
(newVal) => {
|
|
@@ -366,7 +382,7 @@ export default defineComponent({
|
|
|
}
|
|
|
)
|
|
|
|
|
|
- onMounted(() => {
|
|
|
+ onMounted(() => {
|
|
|
// console.log('props.siteId')
|
|
|
// console.log(props.siteId)
|
|
|
})
|
|
@@ -398,7 +414,7 @@ export default defineComponent({
|
|
|
closeDialog,
|
|
|
handleDelete,
|
|
|
cancelEvent,
|
|
|
-
|
|
|
+
|
|
|
handleSizeChange,
|
|
|
handleCurrentChange,
|
|
|
|
|
@@ -409,6 +425,7 @@ export default defineComponent({
|
|
|
accessToken,
|
|
|
handleProgress,
|
|
|
handleUpAvatar,
|
|
|
+ handleError,
|
|
|
|
|
|
labelCom,
|
|
|
}
|