修正ts类型
This commit is contained in:
@@ -66,7 +66,7 @@
|
||||
<el-table-column label="设备编码" width="250" align="center" prop="deviceCode" />
|
||||
<el-table-column label="设备状态" width="100" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<div class="readRecord" v-if="scope.row.status">
|
||||
<div class="readRecord" v-if="scope.row.status !== null">
|
||||
<DictTag :options="com_waterdevice_on_status" :value="scope.row.status"></DictTag>
|
||||
</div>
|
||||
<span v-else>---</span>
|
||||
@@ -121,32 +121,31 @@
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<el-table-column min-width="120" label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-row>
|
||||
<el-col :span="24" class="flex flex-items-center actions">
|
||||
<el-button link type="primary" @click="handleRecode(scope.row)" v-hasPermi="['equipment:view:electricitydevice']">充值记录</el-button>
|
||||
<el-button link type="primary" @click="handleQrCode(scope.row)" v-hasPermi="['equipment:addqrcode:electricitydevice']"
|
||||
>生成条码</el-button
|
||||
>
|
||||
<el-button link type="primary" @click="handleOpenDialog('usedWater', scope.row)" v-hasPermi="['equipment:useWater:electricitydevice']"
|
||||
>用水量</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="handleOpenDialog('Upload', scope.row)"
|
||||
v-hasPermi="['equipment:updatehardware:electricitydevice']"
|
||||
>更新固件</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="handleOpenDialog('UpdateHouse', scope.row)"
|
||||
v-hasPermi="['equipment:edithouse:electricitydevice']"
|
||||
>绑定房屋</el-button
|
||||
>
|
||||
<!-- <el-dropdown style="vertical-align: text-top">
|
||||
<div class="actions">
|
||||
<el-button link type="primary" @click="handleRecode(scope.row)" v-hasPermi="['equipment:view:electricitydevice']">充值记录</el-button>
|
||||
<el-button link type="primary" @click="handleQrCode(scope.row)" v-hasPermi="['equipment:addqrcode:electricitydevice']"
|
||||
>生成条码</el-button
|
||||
>
|
||||
<el-button link type="primary" @click="handleOpenDialog('usedWater', scope.row)" v-hasPermi="['equipment:useWater:electricitydevice']"
|
||||
>用电量</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="handleOpenDialog('Upload', scope.row)"
|
||||
v-hasPermi="['equipment:updatehardware:electricitydevice']"
|
||||
>更新固件</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="handleOpenDialog('UpdateHouse', scope.row)"
|
||||
v-hasPermi="['equipment:edithouse:electricitydevice']"
|
||||
>绑定房屋</el-button
|
||||
>
|
||||
<!-- <el-dropdown style="vertical-align: text-top">
|
||||
<el-button link type="primary">
|
||||
<div>
|
||||
更多<el-icon><arrow-down /></el-icon>
|
||||
@@ -166,8 +165,7 @@
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -180,19 +178,21 @@
|
||||
<el-form-item label="设备编号" prop="deviceCode"> {{ UsedWaterform.deviceCode }} </el-form-item>
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker
|
||||
format="YYYY-MM-DD HH:MM:ss"
|
||||
value-format="YYYY-MM-DD HH:MM:ss"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
v-model="UsedWaterform.startTime"
|
||||
type="datetime"
|
||||
@update:model-value="handleStarTime"
|
||||
placeholder="开始时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-date-picker
|
||||
format="YYYY-MM-DD HH:MM:ss"
|
||||
value-format="YYYY-MM-DD HH:MM:ss"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
v-model="UsedWaterform.endTime"
|
||||
type="datetime"
|
||||
@update:model-value="handleEndTime"
|
||||
placeholder="结束时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -326,6 +326,26 @@ const rules = {
|
||||
startTime: [{ required: true, message: '请选择开始时间', trigger: 'blur' }],
|
||||
endTime: [{ required: true, message: '请选择结束时间', trigger: 'blur' }]
|
||||
};
|
||||
function handleStarTime(val: string) {
|
||||
if (!val) return;
|
||||
const current = new Date(val).getTime();
|
||||
if (UsedWaterform.value.endTime && UsedWaterform.value.startTime) {
|
||||
if (current > new Date(UsedWaterform.value.endTime).getTime()) {
|
||||
UsedWaterform.value.endTime = '';
|
||||
ElMessage.warning('开始时间不能大于结束时间');
|
||||
}
|
||||
}
|
||||
}
|
||||
function handleEndTime(val: string) {
|
||||
if (!val) return;
|
||||
const current = new Date(val).getTime();
|
||||
if (UsedWaterform.value.startTime && UsedWaterform.value.endTime) {
|
||||
if (current < new Date(UsedWaterform.value.startTime).getTime()) {
|
||||
UsedWaterform.value.startTime = '';
|
||||
ElMessage.warning('结束时间不能小于开始时间');
|
||||
}
|
||||
}
|
||||
}
|
||||
// ! =======================================================================================
|
||||
|
||||
// ? 上传固件 ==============================================================================================
|
||||
@@ -464,7 +484,7 @@ function getTree() {
|
||||
}
|
||||
|
||||
/** 电表 启停*/
|
||||
// TODO 修改水电表 启停
|
||||
// TODO 修改电表 启停
|
||||
const handleChangeWater = (val: string, row: ElectricityDeviceVO) => {};
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
@@ -579,9 +599,18 @@ const download = (url: string) => {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.actions {
|
||||
:deep(.el-button + .el-button) {
|
||||
margin-left: 0;
|
||||
}
|
||||
:deep(.el-button > span) {
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
@media (max-width: 1500px) {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
:deep(.waterDevice_online) {
|
||||
color: #3dd4a7;
|
||||
|
||||
Reference in New Issue
Block a user