like 6 ماه پیش
والد
کامیت
754400d5f4

+ 1 - 1
snowy-admin-web/.env.development

@@ -1,5 +1,5 @@
 # 接口地址
-VITE_API_BASEURL = http://127.0.0.1:51182
+VITE_API_BASEURL = http://192.168.25.125:58889
 
 # 本地端口
 VITE_PORT = 81

+ 6 - 2
snowy-admin-web/src/api/basicset/setupApi.js

@@ -8,6 +8,12 @@ export default {
 	setupPage(data) {
 		return request('page', data, 'get')
 	},
+
+	// 获取监控对象列表 -仅状态值为正常的数据
+	setupList(data) {
+		return request('list', data, 'get')
+	},
+
 	// 提交表单 edit为true时为编辑,默认为新增
 	submitForm(data, edit = false) {
 		return request(edit ? 'edit' : 'add', data)
@@ -20,6 +26,4 @@ export default {
 	setupDetail(data) {
 		return request('detail', data, 'get')
 	}
-
-	
 }

+ 2 - 2
snowy-admin-web/src/views/basicset/mem/index.vue

@@ -65,7 +65,7 @@
 					<a-button type="link" size="small">记录</a-button>
 				</template>
 			</template>
-			<template #expandedRowRender="{ record }">
+			<!-- <template #expandedRowRender="{ record }">
 				<a-tabs v-model:activeKey="record.activeKey" size="small" type="card">
 					<a-tab-pane key="1" tab="基本信息">
 						<div class="list">
@@ -88,7 +88,7 @@
 						</div>
 					</a-tab-pane>
 				</a-tabs>
-			</template>
+			</template> -->
 		</s-table>
 
 		<Form ref="formRef" @successful="tableRef.refresh(true)" />

+ 0 - 3
snowy-admin-web/src/views/basicset/monitor/setup.vue

@@ -57,7 +57,6 @@
 					<a-popconfirm title="确定要删除吗?" @confirm="deleteData(record)">
 						<a-button type="link" danger size="small">删除</a-button>
 					</a-popconfirm>
-					<a-button type="link" size="small">记录</a-button>
 				</template>
 			</template>
 			<!-- <template #expandedRowRender="{ record }">
@@ -65,7 +64,6 @@
 					<a-tab-pane key="1" tab="基本信息">
 						<div class="list">
 							<a-descriptions bordered size="small">
-								<a-descriptions-item label="所属单位" :span="3">{{ record.ssbm }}</a-descriptions-item>
 								<a-descriptions-item label="对象名称" :span="2">{{ record.name }}</a-descriptions-item>
 								<a-descriptions-item label="对象编号" :span="2">{{ record.dxcode }}</a-descriptions-item>
 								<a-descriptions-item label="品牌">{{ record.pp }}</a-descriptions-item>
@@ -83,7 +81,6 @@
 								<a-descriptions-item label="冷链编号" :span="2">{{ record.llcode }}</a-descriptions-item>
 								<a-descriptions-item label="对应路数" :span="2">{{ record.dyls }}</a-descriptions-item>
 								<a-descriptions-item label="所属中继" :span="2">{{ record.sszj }}</a-descriptions-item>
-
 							</a-descriptions>
 						</div>
 					</a-tab-pane>

+ 33 - 41
snowy-admin-web/src/views/motoring/location/form.vue

@@ -41,12 +41,12 @@
 				</a-col>
 
 				<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
-					<a-form-item label="监控目标对象" name="monitorTargetId">
+					<a-form-item label="监控对象" name="monitorTargetId">
 						<a-select
 							ref="select"
 							v-model:value="formData.monitorTargetId"
 							:options="monitorTargetOptions"
-							placeholder="请选择监控目标对象"
+							placeholder="请选择监控对象"
 						/>
 					</a-form-item>
 				</a-col>
@@ -82,7 +82,13 @@
 
 				<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
 					<a-form-item label="传感器路数" name="sensorRoute">
-						<a-input-number v-model:value="formData.sensorRoute" style="width: 100%" :min="1" :max="sensorRouteMax" />
+						<a-input-number
+							v-model:value="formData.sensorRoute"
+							style="width: 100%"
+							:min="1"
+							:max="sensorRouteMax"
+							placeholder="请输入传感器路数"
+						/>
 					</a-form-item>
 				</a-col>
 
@@ -108,12 +114,6 @@
 						/>
 					</a-form-item>
 				</a-col>
-
-				<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
-					<a-form-item label="排序:" name="sortCode">
-						<a-input-number class="xn-wd" v-model:value="formData.sortCode" :max="100" />
-					</a-form-item>
-				</a-col>
 			</a-row>
 		</a-form>
 
@@ -133,9 +133,9 @@
 	const emit = defineEmits({ successful: null })
 	const visible = ref(false) // 默认是关闭状态
 	const formRef = ref()
-	const formData = ref({ sortCode: 99 }) // 表单数据
+	const formData = ref() // 表单数据
 	const sensorOptions = tool.dictList('SENSORTYPE') // 传感器类型
-	const monitorTargetOptions = ref([]) // 监控目标对象
+	const monitorTargetOptions = ref([]) // 监控对象
 	const memListOptions = ref([]) // 监控设备数据
 
 	const sensorRouteMax = ref(1) //传感器最大值默认1
@@ -144,7 +144,7 @@
 	const formRules = {
 		name: [required('请输入区域名称')],
 		parentId: [required('请选择上级区域')],
-		monitorTargetId: [required('请选择监控目标对象')],
+		monitorTargetId: [required('请选择监控对象')],
 		monitorDeviceId: [required('请选择监控设备')],
 		sensorRoute: [required('请输入传感器路数')],
 		limitUp: [required('请选择报警上限')],
@@ -158,9 +158,7 @@
 	const onOpen = (record, parentId) => {
 		loadData()
 		visible.value = true
-		formData.value = {
-			sortCode: 99
-		}
+		formData.value = {}
 		if (parentId) {
 			formData.value.parentId = parentId
 		}
@@ -180,32 +178,26 @@
 	}
 
 	const loadData = () => {
-		// 获取采集器监控列表
-		memApi.memList().then((res) => {
-			if (res) {
-				memListOptions.value = (res || []).map((item) => {
-					// 状态为正常的数据
-					if (item.status && item.status == 1)
-						return {
-							value: item['id'],
-							label: item['deviceName'],
-							modelName: item['modelName'],
-							deviceCode: item['deviceCode'],
-							sensorCount: item['sensorCount']
-						}
-				})
-			}
+		// 获取监控对象
+		setupApi.setupList({ isAll: false }).then((res) => {
+			monitorTargetOptions.value = (res || []).map((item) => {
+				return {
+					value: item['id'],
+					label: item['name']
+				}
+			})
 		})
-		// 获取监控对象列表
-		setupApi.setupPage({ current: 1, size: 99999 }).then((res) => {
-			if (res.records) {
-				monitorTargetOptions.value = (res.records || []).map((item) => {
-					return {
-						value: item['id'],
-						label: item['name']
-					}
-				})
-			}
+		// 获取监控设备
+		memApi.memList({ isAll: false }).then((res) => {
+			memListOptions.value = (res || []).map((item) => {
+				return {
+					value: item['id'],
+					label: item['deviceName'],
+					modelName: item['modelName'],
+					deviceCode: item['deviceCode'],
+					sensorCount: item['sensorCount']
+				}
+			})
 		})
 	}
 
@@ -215,7 +207,7 @@
 		if (value) {
 			const data = memListOptions.value.find((item) => item.value === value)
 			formData.value.modelName = data.modelName //监控设备型号
-			formData.value.code = data.deviceCode //冷链编号
+			formData.value.deviceCode = data.deviceCode //冷链编号
 			sensorRouteMax.value = data.sensorCount //传感器路数的最大值
 		}
 	}

+ 21 - 44
snowy-admin-web/src/views/motoring/location/index.vue

@@ -1,6 +1,12 @@
 <template>
 	<div class="table_item">
-		<s-table ref="tableRef" :columns="columns" :data="loadData" :row-key="(record) => record.code">
+		<s-table
+			ref="tableRef"
+			:columns="columns"
+			:data="loadData"
+			:row-key="(record) => record.id"
+			:show-pagination="false"
+		>
 			<template #operator>
 				<!-- 搜索区域 -->
 				<div class="table-search">
@@ -47,7 +53,6 @@
 					<a-popconfirm title="确定要删除吗?" @confirm="deleteData(record)">
 						<a-button type="link" danger size="small">删除</a-button>
 					</a-popconfirm>
-					<a-button type="link" size="small">记录</a-button>
 				</template>
 			</template>
 		</s-table>
@@ -63,6 +68,7 @@
 	const searchFormRef = ref()
 	const searchFormState = ref({})
 	const tableRef = ref()
+
 	const columns = [
 		{
 			title: '区域名称',
@@ -70,12 +76,7 @@
 			align: 'center',
 			ellipsis: true
 		},
-		{
-			title: '上级区域',
-			dataIndex: 'parentId',
-			align: 'center',
-			ellipsis: true
-		},
+
 		{
 			title: '监控对象',
 			dataIndex: 'monitorTargetId',
@@ -83,7 +84,7 @@
 			ellipsis: true
 		},
 		{
-			title: '监控设备型号',
+			title: '监控设备',
 			dataIndex: 'modelName',
 			align: 'center',
 			ellipsis: true
@@ -129,43 +130,11 @@
 
 	const loadData = () => {
 		return locationApi.locationTree(Object.assign(searchFormState.value)).then((res) => {
-			console.log(res, 'x')
-
-			if (data) {
-				return data
+			if (res) {
+				return res
 			}
 			return []
 		})
-
-
-
-
-		if (!module.value) {
-			return mobileMenuApi.mobileMenuModuleSelector().then((data) => {
-				moduleList.value = data
-				module.value = data.length > 0 ? data[0].id : ''
-				searchFormState.value.module = module.value
-				return locationApi.locationTree(Object.assign(searchFormState.value)).then((data) => {
-					if (data) {
-						return data
-					}
-					return []
-				})
-			})
-		} else {
-			return locationApi.locationTree(Object.assign(searchFormState.value)).then((data) => {
-				if (data) {
-					return data
-				}
-				return []
-			})
-		}
-
-
-
-
-
-
 	}
 	// 重置
 	const reset = () => {
@@ -174,7 +143,15 @@
 	}
 	// 删除
 	const deleteData = (record) => {
-		console.log(record, '删除')
+		let params = [
+			{
+				id: record.id
+			}
+		]
+		locationApi.locationDelete(params).then(() => {
+			tableRef.value.refresh(true)
+			reset()
+		})
 	}
 </script>