|
|
|
@ -27,6 +27,15 @@ |
|
|
|
|
v-hasPermi="['system:user:import']" |
|
|
|
|
>导入</el-button> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="1.5"> |
|
|
|
|
<el-button |
|
|
|
|
type="warning" |
|
|
|
|
plain |
|
|
|
|
icon="Download" |
|
|
|
|
@click="handleExport" |
|
|
|
|
v-hasPermi="['system:user:export']" |
|
|
|
|
>导出</el-button> |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
<div class="dev_control_table"> |
|
|
|
|
<el-table :data="data.timingList" height="500px"> |
|
|
|
@ -41,8 +50,24 @@ |
|
|
|
|
<el-table-column label="温度" align="center" prop="temp"/> |
|
|
|
|
<el-table-column label="进水温度" align="center" prop="tempIn"/> |
|
|
|
|
<el-table-column label="出水温度" align="center" prop="tempOut"/> |
|
|
|
|
<el-table-column label="操作" align="center" prop="handle" width="200"> |
|
|
|
|
<template v-slot="scope"> |
|
|
|
|
<el-table-column label="操作" align="center" prop="handle" width="380"> |
|
|
|
|
<template v-slot="scope" style="display: flex"> |
|
|
|
|
<el-upload |
|
|
|
|
class="upload-demo" |
|
|
|
|
:action="data.url" |
|
|
|
|
:headers="data.headers" |
|
|
|
|
:on-preview="handlePreview1" |
|
|
|
|
:on-remove="handleRemove1" |
|
|
|
|
:before-remove="beforeRemove1" |
|
|
|
|
:data="data.getId" |
|
|
|
|
:on-success="success" |
|
|
|
|
multiple |
|
|
|
|
:limit="3" |
|
|
|
|
:on-exceed="handleExceed1" |
|
|
|
|
:file-list="data.fileList1"> |
|
|
|
|
<el-button size="small" type="info" @click="getId(scope.row.deviceId)">点击上传图片</el-button> |
|
|
|
|
<!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>--> |
|
|
|
|
</el-upload> |
|
|
|
|
<el-button type="primary" size="small" icon="Edit" v-hasPermi="['system:cl:edit']" @click="handleXg(scope.row)">修改</el-button> |
|
|
|
|
<el-button type="danger" size="small" :icon="Delete" @click="handleDel(scope.row.deviceId)">删除</el-button> |
|
|
|
|
</template> |
|
|
|
@ -62,7 +87,7 @@ |
|
|
|
|
</div> |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
//导入 |
|
|
|
|
|
|
|
|
|
<el-dialog :title="data.upload.title" v-model="data.upload.open" width="400px" append-to-body> |
|
|
|
|
<el-upload |
|
|
|
|
ref="uploadRef" |
|
|
|
@ -244,9 +269,16 @@ onMounted(()=>{ |
|
|
|
|
// console.log(res) |
|
|
|
|
// }) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
/** 筛选处理 */ |
|
|
|
|
const data = reactive({ |
|
|
|
|
|
|
|
|
|
url:import.meta.env.VITE_APP_BASE_API + "/system/device/index/daoruDevTuPian", |
|
|
|
|
headers: { Authorization: "Bearer " + getToken() }, |
|
|
|
|
getId:{ |
|
|
|
|
deviceId:1 |
|
|
|
|
}, |
|
|
|
|
fileList1:[], |
|
|
|
|
form:{}, |
|
|
|
|
upload:{ |
|
|
|
|
// 是否显示弹出层(用户导入) |
|
|
|
@ -267,9 +299,33 @@ const data = reactive({ |
|
|
|
|
total:'', |
|
|
|
|
timingList:[], |
|
|
|
|
queryParams: '', |
|
|
|
|
queryParams1: { |
|
|
|
|
"deviceId": 0, |
|
|
|
|
"deviceModel": "温度传感器" |
|
|
|
|
}, |
|
|
|
|
sceneCode:'', |
|
|
|
|
dateRange:[], |
|
|
|
|
}); |
|
|
|
|
const { queryParams1, form, rules } = toRefs(data); |
|
|
|
|
function success(response){ |
|
|
|
|
proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "上传结果", { dangerouslyUseHTMLString: true }); |
|
|
|
|
} |
|
|
|
|
function getId(Id){ |
|
|
|
|
console.log(Id) |
|
|
|
|
data.getId.deviceId=Id |
|
|
|
|
} |
|
|
|
|
function handleRemove1(file, fileList) { |
|
|
|
|
console.log(file, fileList); |
|
|
|
|
} |
|
|
|
|
function handlePreview1(file) { |
|
|
|
|
console.log(file); |
|
|
|
|
} |
|
|
|
|
function handleExceed1(files, fileList) { |
|
|
|
|
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`); |
|
|
|
|
} |
|
|
|
|
function beforeRemove1(file, fileList) { |
|
|
|
|
return this.$confirm(`确定移除 ${ file.name }?`); |
|
|
|
|
} |
|
|
|
|
//改变 |
|
|
|
|
function changeSl(){ |
|
|
|
|
console.log(data.sceneCode) |
|
|
|
@ -444,6 +500,16 @@ function cancel2() { |
|
|
|
|
data.upload.open = false; |
|
|
|
|
reset(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
|
|
function handleExport() { |
|
|
|
|
proxy.download("system/device/index/daochuDevs", { |
|
|
|
|
...JSON.stringify({ |
|
|
|
|
"deviceId": 0, |
|
|
|
|
"deviceModel": "温度传感器" |
|
|
|
|
}), |
|
|
|
|
},`device_${new Date().getTime()}.xlsx`); |
|
|
|
|
}; |
|
|
|
|
/** 新增策略处理 */ |
|
|
|
|
const open = ref(false); |
|
|
|
|
const title = ref(); |
|
|
|
@ -631,4 +697,10 @@ const { queryParams } = toRefs(data); |
|
|
|
|
::v-deep .el-form-item__content{ |
|
|
|
|
//display: flex; |
|
|
|
|
} |
|
|
|
|
.upload-demo{ |
|
|
|
|
width: 10px; |
|
|
|
|
height: 0px; |
|
|
|
|
align-items: center; |
|
|
|
|
position: center; |
|
|
|
|
} |
|
|
|
|
</style> |