Browse Source

Merge remote-tracking branch 'origin/master'

黄渊昊 6 months ago
parent
commit
08bf01b9af

+ 2 - 16
snowy-admin-web/src/views/motoring/location/form.vue

@@ -159,25 +159,11 @@
 	const onOpen = (record, parentId) => {
 		loadData()
 		visible.value = true
-		formData.value = {
-			parentId: 0
-		}
-		if (parentId) {
-			formData.value.parentId = parentId
-		}
 		if (record) {
 			formData.value = Object.assign({}, record)
+		} else {
+			formData.value = {}
 		}
-		locationApi.locationTree().then((res) => {
-			treeData.value = [
-				{
-					id: 0,
-					parentId: '-1',
-					name: '顶级',
-					children: res
-				}
-			]
-		})
 	}
 
 	const loadData = () => {

+ 3 - 9
snowy-admin-web/src/views/motoring/location/index.vue

@@ -1,12 +1,6 @@
 <template>
 	<div class="table_item">
-		<s-table
-			ref="tableRef"
-			:columns="columns"
-			:data="loadData"
-			:row-key="(record) => record.id"
-			:show-pagination="false"
-		>
+		<s-table ref="tableRef" :columns="columns" :data="loadData" :row-key="(record) => record.id">
 			<template #operator>
 				<!-- 搜索区域 -->
 				<div class="table-search">
@@ -82,7 +76,7 @@
 
 		{
 			title: '监控对象',
-			dataIndex: 'monitorTargetId',
+			dataIndex: 'targetName',
 			align: 'center',
 			ellipsis: true
 		},
@@ -132,7 +126,7 @@
 	]
 
 	const loadData = () => {
-		return locationApi.locationTree(Object.assign(searchFormState.value)).then((res) => {
+		return locationApi.locationPage(Object.assign(searchFormState.value)).then((res) => {
 			if (res) {
 				return res
 			}