9/20
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
<div class="title">
|
||||
<div>基本信息</div>
|
||||
</div>
|
||||
<div class="bodybox">
|
||||
<el-form label-width="100px" label-position="right">
|
||||
<div class="bodyBox">
|
||||
<el-form label-position="right" label-width="100px">
|
||||
<el-form-item label="设备编码" prop="deviceCode">
|
||||
<el-input v-model="form.deviceCode" placeholder="请输入"></el-input>
|
||||
</el-form-item>
|
||||
@@ -15,12 +15,12 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="分合状态">
|
||||
<el-radio-group v-model="form.electricityRecord.status">
|
||||
<el-radio v-for="(item, index) in com_electricity_readrecord_status" :key="index" :value="item.value" :label="item.label"></el-radio>
|
||||
<el-radio v-for="(item, index) in com_electricity_readrecord_status" :key="index" :label="item.label" :value="item.value"></el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary">提交</el-button>
|
||||
<el-button @click="routeback">返回</el-button>
|
||||
<el-button @click="routeBack">返回</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -28,7 +28,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script lang="ts" setup>
|
||||
import { getElectricityDevice } from '@/api/system/SdbElectricityDevice';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { ref } from 'vue';
|
||||
@@ -49,11 +49,11 @@ const form = ref({
|
||||
}
|
||||
});
|
||||
|
||||
const editid = ref(null);
|
||||
const editId = ref(null);
|
||||
function init() {
|
||||
if (route.query.id) {
|
||||
editid.value = route.query.id;
|
||||
getElectricityDevice(editid.value).then((res) => {
|
||||
editId.value = route.query.id;
|
||||
getElectricityDevice(editId.value).then((res) => {
|
||||
form.value = {
|
||||
...form.value,
|
||||
...res.data
|
||||
@@ -64,17 +64,17 @@ function init() {
|
||||
|
||||
init();
|
||||
|
||||
function routeback() {
|
||||
function routeBack() {
|
||||
router.back();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
.EditBody {
|
||||
margin-top: 20px;
|
||||
padding: 30px;
|
||||
background-color: white;
|
||||
.bodybox {
|
||||
.bodyBox {
|
||||
width: 600px;
|
||||
margin: 20px auto 0;
|
||||
}
|
||||
@@ -89,7 +89,7 @@ function routeback() {
|
||||
color: #000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.iconbox {
|
||||
.iconBox {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin-left: 5px;
|
||||
|
||||
@@ -79,8 +79,9 @@
|
||||
:preview-src-list="[scope.row.url]"
|
||||
:src="scope.row.url"
|
||||
fit="cover"
|
||||
lazy
|
||||
preview-teleported
|
||||
style="width: 90%; height: 100%"
|
||||
style="width: 90%; height: 100%; max-width: 150px"
|
||||
>
|
||||
<template #toolbar>
|
||||
<el-icon @click="download(scope.row.url)"><Download /></el-icon>
|
||||
@@ -98,15 +99,17 @@
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-if="scope.row.electricityRecord"
|
||||
v-model="scope.row.electricityRecord.status"
|
||||
:active-value="0"
|
||||
:active-value="true"
|
||||
:before-change="
|
||||
() => {
|
||||
const status = scope.row.status === 1 ? 0 : 1;
|
||||
// 0 合闸 1 2 拉闸
|
||||
// 0 合闸 传入 1 拉闸 传入 0
|
||||
const status = scope.row.electricityRecord.status === 0 ? 1 : 0;
|
||||
return handleChangeWater(status, scope.row);
|
||||
}
|
||||
"
|
||||
:inactive-value="1"
|
||||
:inactive-value="false"
|
||||
:model-value="scope.row.electricityRecord.status === 0"
|
||||
active-text="合闸"
|
||||
inactive-text="拉闸"
|
||||
></el-switch>
|
||||
|
||||
Reference in New Issue
Block a user