Explorar o código

供热区联调

picasso %!s(int64=3) %!d(string=hai) anos
pai
achega
64330dc7b0

+ 1 - 1
.env.development

@@ -8,5 +8,5 @@ VITE_ASSESS_URL = 'http://zhgy.sagoo.cn/base-api/assess/v1'
 VITE_SCREEN_URL = 'http://home.yanglizhi.cn:10003'
 VITE_TOPO_URL = 'http://home.yanglizhi.cn:10001'
 VITE_WS_URL = 'ws://zhgy.sagoo.cn:8899/api/v1/websocket'
-#VITE_API_URL = 'http://sgadserver.wdeveloperw.xyz/api/v1'
+VITE_API_URL = 'http://sgadserver.wdeveloperw.xyz/api/v1'
 # VITE_IMG_URL = 'http://sgadserver.wdeveloperw.xyz/'

+ 2 - 4
src/views/heatingDistrict/heatingDistrictManage/children/floor/component/edit.vue

@@ -44,8 +44,7 @@ export default defineComponent({
 				id: 0,
 				name: '',
         number: '',
-				plotId: '',
-				organizationId: '',
+				nodeId: '',
 				status: 1
 			},
 			rules: {
@@ -73,8 +72,7 @@ export default defineComponent({
 				id: 0,
 				name: '',
         number: '',
-				plotId: '',
-				organizationId: '',
+				nodeId: '',
 				status: 1
 			}
 		}

+ 14 - 12
src/views/heatingDistrict/heatingDistrictManage/children/floor/index.vue

@@ -51,7 +51,7 @@
       </el-table>
       <pagination v-show="tableData.total>0" :total="tableData.total" v-model:page="tableData.param.pageNum" v-model:limit="tableData.param.pageSize" @pagination="queryList" />
     </div>
-    <EditDic ref="editDicRef" @queryList="queryList" />
+    <EditDic ref="editDicRef" @queryList="handleFinish()" />
     <Detail ref="detailRef"  />
   </div>
 </template>
@@ -62,19 +62,17 @@ import { ElMessageBox, ElMessage, FormInstance } from 'element-plus';
 import EditDic from './component/edit.vue';
 import Detail from './component/detail.vue';
 import api from '/@/api/heatingDistrict';
+import { emit } from 'process';
 
 export default defineComponent({
 	name: 'loop',
 	components: { EditDic,Detail },
 	props: {
-		organizationId: {
-			default: ''
-		},
-		plotId: {
+		nodeId: {
 			default: ''
 		}
 	},
-	setup(prop) {
+	setup(prop, { emit }) {
 		const editDicRef = ref();
 		const detailRef=ref();
 		const queryRef = ref();
@@ -89,8 +87,7 @@ export default defineComponent({
 					pageSize: 10,
 					name: '',
 					number: '',
-					plotId: '',
-					organizationId: '',
+					nodeId: '',
 					status: -1
 				},
 			},
@@ -104,10 +101,14 @@ export default defineComponent({
 				state.tableData.loading = false
 			});
 		};
+
+		const handleFinish = () => {
+			emit('finish')
+			queryList()
+		}
 		
-		watch(() => prop.plotId, () => {
-			state.tableData.param.organizationId = prop.organizationId
-			state.tableData.param.plotId = prop.plotId
+		watch(() => prop.nodeId, () => {
+			state.tableData.param.nodeId = prop.nodeId
 			queryList()
 		}, {
 			deep: true,
@@ -120,7 +121,7 @@ export default defineComponent({
 		}
 		// 打开新增修改弹窗
 		const onOpenDialog = (row: any) => {
-			editDicRef.value.openDialog(row, { organizationId: prop.organizationId, plotId: prop.plotId });
+			editDicRef.value.openDialog(row, { nodeId: prop.nodeId });
 		};
 		
 		// 状态修改
@@ -176,6 +177,7 @@ export default defineComponent({
 			queryList,
 			resetQuery,
 			handleStatusChange,
+			handleFinish,
 			...toRefs(state),
 		};
 	},

+ 8 - 2
src/views/heatingDistrict/heatingDistrictManage/children/regional/index.vue

@@ -76,7 +76,7 @@
       </el-table>
       <pagination v-show="tableData.total>0" :total="tableData.total" v-model:page="tableData.param.pageNum" v-model:limit="tableData.param.pageSize" @pagination="queryList" />
     </div>
-    <EditDic ref="editDicRef" @queryList="queryList" />
+    <EditDic ref="editDicRef" @queryList="handleFinish()" />
     <Detail ref="detailRef"  />
   </div>
 </template>
@@ -98,7 +98,7 @@ export default defineComponent({
 			default: ''
 		}
 	},
-	setup(prop) {
+	setup(prop, { emit }) {
 		const addDicRef = ref();
 		const editDicRef = ref();
 		const detailRef=ref();
@@ -128,6 +128,11 @@ export default defineComponent({
 				state.tableData.loading = false
 			});
 		};
+		
+		const handleFinish = () => {
+			emit('finish')
+			queryList()
+		}
 
 		watch(() => prop.organizationId, () => {
 			state.tableData.param.organizationId = prop.organizationId
@@ -204,6 +209,7 @@ export default defineComponent({
 			queryList,
 			resetQuery,
 			handleStatusChange,
+			handleFinish,
 			...toRefs(state),
 		};
 	},

+ 2 - 10
src/views/heatingDistrict/heatingDistrictManage/children/resident/component/edit.vue

@@ -57,11 +57,7 @@ export default defineComponent({
 			dialogVisible: false,
 			ruleForm: {
 				id: 0,
-				organizationId: '',
-				heatStaId: '',
-				plotId: '',
-				floorId: '',
-				unitId: '',
+				nodeId: '',
 				name: '',
 				floorLevel: '',
 				roomNumber: '',
@@ -98,11 +94,7 @@ export default defineComponent({
 		const resetForm = () => {
 			state.ruleForm = {
 				id: 0,
-				organizationId: '',
-				heatStaId: '',
-				plotId: '',
-				floorId: '',
-				unitId: '',
+				nodeId: '',
 				name: '',
 				floorLevel: '',
 				roomNumber: '',

+ 13 - 20
src/views/heatingDistrict/heatingDistrictManage/children/resident/index.vue

@@ -52,7 +52,7 @@
       </el-table>
       <pagination v-show="tableData.total>0" :total="tableData.total" v-model:page="tableData.param.pageNum" v-model:limit="tableData.param.pageSize" @pagination="queryList" />
     </div>
-    <EditDic ref="editDicRef" @queryList="queryList" />
+    <EditDic ref="editDicRef" @queryList="handleFinish()" />
     <Detail ref="detailRef"  />
   </div>
 </template>
@@ -69,20 +69,11 @@ export default defineComponent({
 	name: 'loop',
 	components: { EditDic,Detail },
 	props: {
-		organizationId: {
-			default: ''
-		},
-		plotId: {
-			default: ''
-		},
-		floorId: {
-			default: ''
-		},
-		unitId: {
+		nodeId: {
 			default: ''
 		}
 	},
-	setup(prop) {
+	setup(prop, { emit }) {
 		const addDicRef = ref();
 		const editDicRef = ref();
 		const detailRef=ref();
@@ -97,10 +88,7 @@ export default defineComponent({
 					pageNum: 1,
 					pageSize: 10,
 					name: '',
-					plotId: '',
-					floorId: '',
-					unitId: '',
-					organizationId: '',
+					nodeId: '',
 					status: -1
 				},
 			},
@@ -115,9 +103,13 @@ export default defineComponent({
 			});
 		};
 		
-		watch(() => prop.unitId, () => {
-			state.tableData.param.organizationId = prop.organizationId
-			state.tableData.param.unitId = prop.unitId
+		const handleFinish = () => {
+			emit('finish')
+			queryList()
+		}
+		
+		watch(() => prop.nodeId, () => {
+			state.tableData.param.nodeId = prop.nodeId
 			queryList()
 		}, {
 			deep: true,
@@ -129,7 +121,7 @@ export default defineComponent({
 		}
 		// 打开新增修改弹窗
 		const onOpenDialog = (row: any) => {
-			editDicRef.value.openDialog(row, { organizationId: prop.organizationId, plotId: prop.plotId, floorId: prop.floorId, unitId: prop.unitId });
+			editDicRef.value.openDialog(row, { nodeId: prop.nodeId });
 		};
 		
 		// 状态修改
@@ -185,6 +177,7 @@ export default defineComponent({
 			queryList,
 			resetQuery,
 			handleStatusChange,
+			handleFinish,
 			...toRefs(state),
 		};
 	},

+ 2 - 8
src/views/heatingDistrict/heatingDistrictManage/children/unit/component/edit.vue

@@ -38,10 +38,7 @@ export default defineComponent({
 			ruleForm: {
 				id: 0,
 				name: '',
-        organizationId: '',
-        plotId: '',
-        floorId: '',
-        heatStaId: '',
+        nodeId: '',
         number: '',
         remark: '',
 				status: 1
@@ -71,10 +68,7 @@ export default defineComponent({
 			state.ruleForm = {
 				id: 0,
 				name: '',
-        organizationId: '',
-        plotId: '',
-        floorId: '',
-        heatStaId: '',
+        nodeId: '',
         number: '',
         remark: '',
 				status: 1

+ 13 - 15
src/views/heatingDistrict/heatingDistrictManage/children/unit/index.vue

@@ -51,7 +51,7 @@
       </el-table>
       <pagination v-show="tableData.total>0" :total="tableData.total" v-model:page="tableData.param.pageNum" v-model:limit="tableData.param.pageSize" @pagination="queryList" />
     </div>
-    <EditDic ref="editDicRef" @queryList="queryList" />
+    <EditDic ref="editDicRef" @queryList="handleFinish()" />
     <Detail ref="detailRef"  />
   </div>
 </template>
@@ -68,17 +68,11 @@ export default defineComponent({
 	name: 'loop',
 	components: { EditDic,Detail },
 	props: {
-		organizationId: {
-			default: ''
-		},
-		plotId: {
-			default: ''
-		},
-		floorId: {
+		nodeId: {
 			default: ''
 		}
 	},
-	setup(prop) {
+	setup(prop, { emit }) {
 		const addDicRef = ref();
 		const editDicRef = ref();
 		const detailRef=ref();
@@ -94,8 +88,7 @@ export default defineComponent({
 					pageSize: 10,
 					name: '',
 					number: '',
-					organizationId: '',
-					floorId: '',
+					nodeId: '',
 					status: -1
 				},
 			},
@@ -110,9 +103,13 @@ export default defineComponent({
 			});
 		};
 		
-		watch(() => prop.floorId, () => {
-			state.tableData.param.organizationId = prop.organizationId
-			state.tableData.param.floorId = prop.floorId
+		const handleFinish = () => {
+			emit('finish')
+			queryList()
+		}
+		
+		watch(() => prop.nodeId, () => {
+			state.tableData.param.nodeId = prop.nodeId
 			queryList()
 		}, {
 			deep: true,
@@ -125,7 +122,7 @@ export default defineComponent({
 		}
 		// 打开新增修改弹窗
 		const onOpenDialog = (row: any) => {
-			editDicRef.value.openDialog(row, { organizationId: prop.organizationId, plotId: prop.plotId, floorId: prop.floorId });
+			editDicRef.value.openDialog(row, { nodeId: prop.nodeId });
 		};
 		
 		// 状态修改
@@ -184,6 +181,7 @@ export default defineComponent({
 			queryList,
 			resetQuery,
 			handleStatusChange,
+			handleFinish,
 			...toRefs(state),
 		};
 	},

+ 8 - 5
src/views/heatingDistrict/heatingDistrictManage/index.vue

@@ -21,13 +21,13 @@
 		</div>
 		<div class="right-panel">
 			<!-- 小区 -->
-			<Regional v-if="curNode.orgType === 'org'" :organizationId="curNode.id"/>
+			<Regional v-if="curNode.orgType === 'org'" :organizationId="curNode.id" @finish="getTreeData()"/>
 			<!-- 楼宇 -->
-			<Floor v-else-if="curNode.orgType === 'plot'" :organizationId="curNode.organizationId" :plotId="curNode.id"/>
+			<Floor v-else-if="curNode.orgType === 'plot'" :nodeId="curNode.id" @finish="getTreeData()"/>
 			<!-- 单元 -->
-			<Unit v-else-if="curNode.orgType === 'floor'" :organizationId="curNode.organizationId" :plotId="curNode.plotId" :floorId="curNode.id"/>
+			<Unit v-else-if="curNode.orgType === 'floor'" :nodeId="curNode.id" @finish="getTreeData()"/>
 			<!-- 住户 -->
-			<Resident v-else-if="curNode.orgType === 'unit'" :organizationId="curNode.organizationId" :plotId="curNode.plotId" :floorId="curNode.floorId" :unitId="curNode.id"/>
+			<Resident v-else-if="curNode.orgType === 'unit'" :nodeId="curNode.id" @finish="getTreeData()"/>
 		</div>
   </div>
 </template>
@@ -59,7 +59,9 @@ export default defineComponent({
 			api.heatingDistrict.getTree({})
 				.then((res: any) => {
 					treeList.value = res || []
-					state.curNode = treeList.value[0]
+					if (!state.curNode.id) {
+						state.curNode = treeList.value[0]
+					}
 				})
 		}
 		const onNodeClick = (data: any, node: any) => {
@@ -83,6 +85,7 @@ export default defineComponent({
 		return {
 			treeList,
 			onNodeClick,
+			getTreeData,
 			...toRefs(state),
 		};
 	},