|
|
|
@ -69,7 +69,7 @@ |
|
|
|
|
:limit="1" |
|
|
|
|
accept=".xlsx, .xls" |
|
|
|
|
:headers="data.upload.headers" |
|
|
|
|
:action="data.upload.url + '?updateSupport=' + data.upload.updateSupport" |
|
|
|
|
:action="data.upload.url" |
|
|
|
|
:disabled="data.upload.isUploading" |
|
|
|
|
:on-progress="handleFileUploadProgress" |
|
|
|
|
:on-success="handleFileSuccess" |
|
|
|
@ -91,7 +91,7 @@ |
|
|
|
|
<template #footer> |
|
|
|
|
<div class="dialog-footer"> |
|
|
|
|
<el-button type="primary" @click="submitFileForm">确 定</el-button> |
|
|
|
|
<el-button @click="data.upload.open = false">取 消</el-button> |
|
|
|
|
<el-button @click="cancel2">取 消</el-button> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-dialog> |
|
|
|
@ -200,7 +200,7 @@ |
|
|
|
|
<script setup name="Index"> |
|
|
|
|
import {ElMessage,ElMessageBox} from 'element-plus' |
|
|
|
|
import {Delete} from '@element-plus/icons-vue' |
|
|
|
|
import {ref,reactive,watch,onMounted} from "vue"; |
|
|
|
|
import {ref,reactive,watch,onMounted,} from "vue"; |
|
|
|
|
import {getXl, getSbTab, postNew1, getSb, postXg1, postDel1, getYh, getMx,} from '../../../api/emonitor/api' |
|
|
|
|
import {getToken} from "@/utils/auth"; |
|
|
|
|
onMounted(()=>{ |
|
|
|
@ -246,6 +246,7 @@ onMounted(()=>{ |
|
|
|
|
}) |
|
|
|
|
/** 筛选处理 */ |
|
|
|
|
const data = reactive({ |
|
|
|
|
|
|
|
|
|
form:{}, |
|
|
|
|
upload:{ |
|
|
|
|
// 是否显示弹出层(用户导入) |
|
|
|
@ -259,7 +260,7 @@ const data = reactive({ |
|
|
|
|
// 设置上传的请求头部 |
|
|
|
|
headers: { Authorization: "Bearer " + getToken() }, |
|
|
|
|
// 上传的地址 |
|
|
|
|
url: import.meta.env.VITE_APP_BASE_API + "/system/user/importData" |
|
|
|
|
url: import.meta.env.VITE_APP_BASE_API + "/system/device/index/daoruDevData" |
|
|
|
|
}, |
|
|
|
|
MxList:[], |
|
|
|
|
sblb:[], |
|
|
|
@ -377,15 +378,15 @@ const handleCurrentChange = (val) => { |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance(); |
|
|
|
|
function handleImport() { |
|
|
|
|
data.upload.title = "设备导入"; |
|
|
|
|
data.upload.open = true; |
|
|
|
|
}; |
|
|
|
|
/** 下载模板操作 */ |
|
|
|
|
function importTemplate() { |
|
|
|
|
proxy.download("system/user/importTemplate", { |
|
|
|
|
}, `user_template_${new Date().getTime()}.xlsx`); |
|
|
|
|
proxy.download("system/device/index/downloadDevTemplate",{ |
|
|
|
|
}, `device_template_${new Date().getTime()}.xlsx`); |
|
|
|
|
}; |
|
|
|
|
/**文件上传中处理 */ |
|
|
|
|
const handleFileUploadProgress = (event, file, fileList) => { |
|
|
|
@ -397,7 +398,26 @@ const handleFileSuccess = (response, file, fileList) => { |
|
|
|
|
data.upload.isUploading = false; |
|
|
|
|
proxy.$refs["uploadRef"].handleRemove(file); |
|
|
|
|
proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true }); |
|
|
|
|
getList(); |
|
|
|
|
getSbTab({ |
|
|
|
|
"deviceId":0, |
|
|
|
|
|
|
|
|
|
"deviceModel":data.sceneCode, |
|
|
|
|
|
|
|
|
|
"pageNum": currentPage.value, |
|
|
|
|
|
|
|
|
|
"pageSize": pageSize.value |
|
|
|
|
}).then((res)=>{ |
|
|
|
|
console.log(res) |
|
|
|
|
data.timingList=res.rows |
|
|
|
|
data.total=res.total |
|
|
|
|
for(let i in res.rows){ |
|
|
|
|
if(res.rows[i].isControl==2){ |
|
|
|
|
res.rows[i].isControl='可控' |
|
|
|
|
}else if(res.rows[i].isControl==1){ |
|
|
|
|
res.rows[i].isControl='不可控' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}; |
|
|
|
|
/** 提交上传文件 */ |
|
|
|
|
function submitFileForm() { |
|
|
|
@ -420,8 +440,8 @@ function reset() { |
|
|
|
|
proxy.resetForm("userRef"); |
|
|
|
|
}; |
|
|
|
|
/** 取消按钮 */ |
|
|
|
|
function cancel() { |
|
|
|
|
open.value = false; |
|
|
|
|
function cancel2() { |
|
|
|
|
data.upload.open = false; |
|
|
|
|
reset(); |
|
|
|
|
}; |
|
|
|
|
/** 新增策略处理 */ |
|
|
|
|