|
@@ -1,16 +1,16 @@
|
|
<template>
|
|
<template>
|
|
- <div class="system-edit-dic-container">
|
|
|
|
- <el-dialog :title="'环路详情'" v-model="dialogVisible" width="950px">
|
|
|
|
- <el-form :model="ruleForm" ref="formRef" size="default" label-width="110px">
|
|
|
|
- <el-form-item label="环路名称" prop="name">
|
|
|
|
- {{ ruleForm.name }}
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="环路编号" prop="code">
|
|
|
|
- {{ ruleForm.code }}
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="所属换热站" prop="stationId">
|
|
|
|
- {{ ruleForm.stationInfo.name }}
|
|
|
|
- <!-- <el-tree-select
|
|
|
|
|
|
+ <div class="system-edit-dic-container">
|
|
|
|
+ <el-dialog :title="'环路详情'" v-model="dialogVisible" width="950px">
|
|
|
|
+ <el-form :model="ruleForm" ref="formRef" size="default" label-width="110px">
|
|
|
|
+ <el-form-item label="环路名称" prop="name">
|
|
|
|
+ {{ ruleForm.name }}
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="环路编号" prop="code">
|
|
|
|
+ {{ ruleForm.code }}
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="所属换热站" prop="stationId">
|
|
|
|
+ {{ ruleForm.stationInfo?.name }}
|
|
|
|
+ <!-- <el-tree-select
|
|
v-model="ruleForm.stationId"
|
|
v-model="ruleForm.stationId"
|
|
:data="treeData"
|
|
:data="treeData"
|
|
:props="{
|
|
:props="{
|
|
@@ -23,7 +23,7 @@
|
|
style="width: 100%;"
|
|
style="width: 100%;"
|
|
:render-after-expand="true"
|
|
:render-after-expand="true"
|
|
/> -->
|
|
/> -->
|
|
- </el-form-item>
|
|
|
|
|
|
+ </el-form-item>
|
|
<el-form-item label="环路类型" prop="loopTypes">
|
|
<el-form-item label="环路类型" prop="loopTypes">
|
|
{{ ruleForm.loopTypes === 1 ? '一网' : '二网' }}
|
|
{{ ruleForm.loopTypes === 1 ? '一网' : '二网' }}
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -57,27 +57,26 @@
|
|
<el-form-item label="环路年代" prop="decade">
|
|
<el-form-item label="环路年代" prop="decade">
|
|
{{ ruleForm.decade }}
|
|
{{ ruleForm.decade }}
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="状态" prop="status">
|
|
|
|
|
|
+ <el-form-item label="状态" prop="status">
|
|
{{ ruleForm.status === 1 ? '启用' : '禁用' }}
|
|
{{ ruleForm.status === 1 ? '启用' : '禁用' }}
|
|
- </el-form-item>
|
|
|
|
|
|
+ </el-form-item>
|
|
<el-form-item label="路线信息" prop="">
|
|
<el-form-item label="路线信息" prop="">
|
|
- <div class="mb10" style="width: 100%">
|
|
|
|
- <div style="display: flex;" class="mb10" v-for="(item, index) in pointList" :key="index">
|
|
|
|
- <el-input v-model="item.position" :disabled="!item.editFalg" @keydown="onLocalChange(item, index)" @change="onLocalChange(item, index)" placeholder="请输入关键字进行搜索" clearable style="flex: 1; margin-right: 10px"></el-input>
|
|
|
|
- <span>排序:</span>
|
|
|
|
- <el-input-number v-model="item.sort" :controls="false" :disabled="!item.editFalg" placeholder="排序" clearable style="width: 100px; margin-right: 10px"></el-input-number>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div class="mb10" style="width: 100%">
|
|
|
|
+ <div style="display: flex;" class="mb10" v-for="(item, index) in pointList" :key="index">
|
|
|
|
+ <el-input v-model="item.position" :disabled="!item.editFalg" @keydown="onLocalChange(item, index)" @change="onLocalChange(item, index)" placeholder="请输入关键字进行搜索" clearable style="flex: 1; margin-right: 10px"></el-input>
|
|
|
|
+ <span>排序:</span>
|
|
|
|
+ <el-input-number v-model="item.sort" :controls="false" :disabled="!item.editFalg" placeholder="排序" clearable style="width: 100px; margin-right: 10px"></el-input-number>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- </el-form>
|
|
|
|
- <template #footer>
|
|
|
|
- <span class="dialog-footer">
|
|
|
|
- <el-button @click="onCancel" size="default">取 消</el-button>
|
|
|
|
- <el-button type="primary" @click="onSubmit" size="default">{{ ruleForm.id !== 0 ? '修 改' : '添 加' }}</el-button>
|
|
|
|
- </span>
|
|
|
|
- </template>
|
|
|
|
- </el-dialog>
|
|
|
|
- </div>
|
|
|
|
|
|
+ </el-form>
|
|
|
|
+ <template #footer>
|
|
|
|
+ <span class="dialog-footer">
|
|
|
|
+ <el-button @click="onCancel" size="default">取 消</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
@@ -85,35 +84,35 @@ import { reactive, toRefs, defineComponent, ref } from 'vue';
|
|
import api from '/@/api/heatStation';
|
|
import api from '/@/api/heatStation';
|
|
import { ElMessage } from 'element-plus';
|
|
import { ElMessage } from 'element-plus';
|
|
interface Point {
|
|
interface Point {
|
|
- sort?: number;
|
|
|
|
- lnt: number;
|
|
|
|
- lat: number
|
|
|
|
|
|
+ sort?: number;
|
|
|
|
+ lnt: number;
|
|
|
|
+ lat: number
|
|
}
|
|
}
|
|
interface RuleFormState {
|
|
interface RuleFormState {
|
|
- id?: number;
|
|
|
|
- name: string;
|
|
|
|
- code: string;
|
|
|
|
- stationId: string;
|
|
|
|
- loopTypes: string;
|
|
|
|
- energyTypes: string;
|
|
|
|
- heatingObject: string;
|
|
|
|
- heatingTypes: string;
|
|
|
|
- heatingArea: string;
|
|
|
|
- forRealArea: string;
|
|
|
|
- viaPoint: Array<Point>;
|
|
|
|
- decade: string;
|
|
|
|
- status: number;
|
|
|
|
|
|
+ id?: number;
|
|
|
|
+ name: string;
|
|
|
|
+ code: string;
|
|
|
|
+ stationId: string;
|
|
|
|
+ loopTypes: string;
|
|
|
|
+ energyTypes: string;
|
|
|
|
+ heatingObject: string;
|
|
|
|
+ heatingTypes: string;
|
|
|
|
+ heatingArea: string;
|
|
|
|
+ forRealArea: string;
|
|
|
|
+ viaPoint: Array<Point>;
|
|
|
|
+ decade: string;
|
|
|
|
+ status: number;
|
|
}
|
|
}
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
- name: 'headStationLoop',
|
|
|
|
- setup(prop, { emit }) {
|
|
|
|
- const formRef = ref<HTMLElement | null>(null);
|
|
|
|
- const state = reactive({
|
|
|
|
- dialogVisible: false,
|
|
|
|
- ruleForm: {
|
|
|
|
- id: 0,
|
|
|
|
- name: '',
|
|
|
|
|
|
+ name: 'headStationLoop',
|
|
|
|
+ setup(prop, { emit }) {
|
|
|
|
+ const formRef = ref<HTMLElement | null>(null);
|
|
|
|
+ const state = reactive({
|
|
|
|
+ dialogVisible: false,
|
|
|
|
+ ruleForm: {
|
|
|
|
+ id: 0,
|
|
|
|
+ name: '',
|
|
code: '',
|
|
code: '',
|
|
stationId: '',
|
|
stationId: '',
|
|
loopTypes: '',
|
|
loopTypes: '',
|
|
@@ -123,26 +122,26 @@ export default defineComponent({
|
|
heatingArea: '',
|
|
heatingArea: '',
|
|
forRealArea: '',
|
|
forRealArea: '',
|
|
decade: '',
|
|
decade: '',
|
|
- viaPoint: [],
|
|
|
|
|
|
+ viaPoint: [],
|
|
status: 1
|
|
status: 1
|
|
- },
|
|
|
|
- treeData: [],
|
|
|
|
|
|
+ },
|
|
|
|
+ treeData: [],
|
|
pointList: [] as any
|
|
pointList: [] as any
|
|
- })
|
|
|
|
- // 打开弹窗
|
|
|
|
- const openDialog = (row: RuleFormState | null) => {
|
|
|
|
- resetForm()
|
|
|
|
- queryTree()
|
|
|
|
- if (row) {
|
|
|
|
- (state.ruleForm as any).id = row.id
|
|
|
|
- getDetail()
|
|
|
|
- }
|
|
|
|
- state.dialogVisible = true
|
|
|
|
- }
|
|
|
|
- const resetForm = () => {
|
|
|
|
- state.ruleForm = {
|
|
|
|
- id: 0,
|
|
|
|
- name: '',
|
|
|
|
|
|
+ })
|
|
|
|
+ // 打开弹窗
|
|
|
|
+ const openDialog = (row: RuleFormState | null) => {
|
|
|
|
+ resetForm()
|
|
|
|
+ queryTree()
|
|
|
|
+ if (row) {
|
|
|
|
+ (state.ruleForm as any).id = row.id
|
|
|
|
+ getDetail()
|
|
|
|
+ }
|
|
|
|
+ state.dialogVisible = true
|
|
|
|
+ }
|
|
|
|
+ const resetForm = () => {
|
|
|
|
+ state.ruleForm = {
|
|
|
|
+ id: 0,
|
|
|
|
+ name: '',
|
|
code: '',
|
|
code: '',
|
|
stationId: '',
|
|
stationId: '',
|
|
loopTypes: '',
|
|
loopTypes: '',
|
|
@@ -151,50 +150,50 @@ export default defineComponent({
|
|
heatingTypes: '',
|
|
heatingTypes: '',
|
|
heatingArea: '',
|
|
heatingArea: '',
|
|
forRealArea: '',
|
|
forRealArea: '',
|
|
- viaPoint: [],
|
|
|
|
|
|
+ viaPoint: [],
|
|
decade: '',
|
|
decade: '',
|
|
status: 1
|
|
status: 1
|
|
- }
|
|
|
|
- }
|
|
|
|
- // 关闭弹窗
|
|
|
|
- const closeDialog = () => {
|
|
|
|
- state.dialogVisible = false
|
|
|
|
- }
|
|
|
|
- // 取消
|
|
|
|
- const onCancel = () => {
|
|
|
|
- closeDialog()
|
|
|
|
- state.pointList = []
|
|
|
|
- }
|
|
|
|
- const queryTree = () => {
|
|
|
|
- api.heatStation.getList({
|
|
|
|
- name: '',
|
|
|
|
- code: '',
|
|
|
|
- status: -1
|
|
|
|
- })
|
|
|
|
- .then((res: any) => {
|
|
|
|
- state.treeData = res || [];
|
|
|
|
- });
|
|
|
|
- };
|
|
|
|
- const getDetail = () => {
|
|
|
|
- api.loop.detail(state.ruleForm.id)
|
|
|
|
- .then((res: any) => {
|
|
|
|
- state.ruleForm = {
|
|
|
|
- ...res
|
|
|
|
- }
|
|
|
|
- state.pointList = state.ruleForm.viaPoint.map((item: any) => ({
|
|
|
|
- ...item,
|
|
|
|
- editFlag: false
|
|
|
|
- }))
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 关闭弹窗
|
|
|
|
+ const closeDialog = () => {
|
|
|
|
+ state.dialogVisible = false
|
|
|
|
+ }
|
|
|
|
+ // 取消
|
|
|
|
+ const onCancel = () => {
|
|
|
|
+ closeDialog()
|
|
|
|
+ state.pointList = []
|
|
|
|
+ }
|
|
|
|
+ const queryTree = () => {
|
|
|
|
+ api.heatStation.getList({
|
|
|
|
+ name: '',
|
|
|
|
+ code: '',
|
|
|
|
+ status: -1
|
|
|
|
+ })
|
|
|
|
+ .then((res: any) => {
|
|
|
|
+ state.treeData = res || [];
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ const getDetail = () => {
|
|
|
|
+ api.loop.detail(state.ruleForm.id)
|
|
|
|
+ .then((res: any) => {
|
|
|
|
+ state.ruleForm = {
|
|
|
|
+ ...res
|
|
|
|
+ }
|
|
|
|
+ state.pointList = state.ruleForm.viaPoint.map((item: any) => ({
|
|
|
|
+ ...item,
|
|
|
|
+ editFlag: false
|
|
|
|
+ }))
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
|
|
- return {
|
|
|
|
- openDialog,
|
|
|
|
- closeDialog,
|
|
|
|
- onCancel,
|
|
|
|
- formRef,
|
|
|
|
- ...toRefs(state)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ return {
|
|
|
|
+ openDialog,
|
|
|
|
+ closeDialog,
|
|
|
|
+ onCancel,
|
|
|
|
+ formRef,
|
|
|
|
+ ...toRefs(state)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
})
|
|
})
|
|
</script>
|
|
</script>
|