From beb5d0bb567d7ca675bf4ff7064d2762554f0249 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期五, 10 一月 2025 09:18:28 +0800
Subject: [PATCH] ll
---
admin/src/views/Inspection/components/OperaYwPatrolPointWindow.vue | 122 +++++++++++++++++++++++++++++++++-------
1 files changed, 101 insertions(+), 21 deletions(-)
diff --git a/admin/src/views/Inspection/components/OperaYwPatrolPointWindow.vue b/admin/src/views/Inspection/components/OperaYwPatrolPointWindow.vue
index 8674bad..d17b360 100644
--- a/admin/src/views/Inspection/components/OperaYwPatrolPointWindow.vue
+++ b/admin/src/views/Inspection/components/OperaYwPatrolPointWindow.vue
@@ -18,18 +18,20 @@
label: 'name',
value: 'id',
children: 'childCategoryList',
- checkStrictly: true
}"></el-cascader>
</el-form-item>
<el-form-item label="缁忕含搴�">
-
+ <el-input v-model="form.lnglat" placeholder="绀轰緥锛�117.297461,31.849234" v-trim />
</el-form-item>
+ <!-- <el-form-item>
+ <mapDrag class="mapbox" @center="getCenter" />
+ </el-form-item> -->
<el-form-item label="宸℃鍐呭" prop="content">
<el-input type="textarea" :rows="4" v-model="form.content" placeholder="璇疯緭鍏�" />
</el-form-item>
<el-form-item label="涓婁紶鍥剧墖" prop="imgurl">
- <UploadAvatarImage :file="{ 'imgurlfull': form.imgurlfull, 'imgurl': form.imgurl }"
- :uploadData="{ folder: 'projects' }" @uploadSuccess="uploadAvatarSuccess" @uploadEnd="isUploading = false"
+ <UploadAvatarImage :file="{ 'imgurlfull': form.fileFullUrl, 'imgurl': form.fileUrl }"
+ :uploadData="{ folder: 'ywPatrol/' }" @uploadSuccess="uploadAvatarSuccess" @uploadEnd="isUploading = false"
@uploadBegin="isUploading = true" />
</el-form-item>
</el-form>
@@ -40,11 +42,14 @@
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import UploadAvatarImage from '@/components/common/UploadAvatarImage'
+import mapDrag from '@/components/common/map/mapDrag.vue'
import { fetchList } from '@/api/business/category'
+import { detail } from '@/api/Inspection/ywPatrolPoint'
+import { fetchList as getDeiceList } from '@/api/Inspection/device'
export default {
name: 'OperaYwPatrolPointWindow',
extends: BaseOpera,
- components: { GlobalWindow, UploadAvatarImage },
+ components: { GlobalWindow, UploadAvatarImage, mapDrag },
data() {
return {
// 琛ㄥ崟鏁版嵁
@@ -53,7 +58,8 @@
code: '',
content: '',
imgurl: '',
- areaId: '',
+ areaId: 0,
+ areaIds: [],
addr: ''
},
deviceList: [],
@@ -73,33 +79,107 @@
})
},
methods: {
+ open(title, row) {
+ this.title = title
+ this.visible = true
+ this.initData()
+ if (row == null) {
+ this.$nextTick(() => {
+ this.form = {
+ name: '',
+ code: '',
+ content: '',
+ imgurl: '',
+ areaId: 0,
+ areaIds: [],
+ addr: ''
+ }
+ this.$refs.form.resetFields()
+
+ this.form[this.configData['field.id']] = null
+ })
+ fetchList({
+ model: { type: 4 },
+ capacity: 1000,
+ page: 1,
+ }).then(res => {
+ this.cateList = res.records || []
+ })
+ return
+ }
+ if (row && row.id) {
+ this.getDetail(row)
+ }
+ },
+ getDetail(row) {
+ detail(row.id).then(res => {
+ this.form = { ...res }
+ if (res.longitude && res.latitude) {
+ this.$set(this.form, 'lnglat', res.longitude + ',' + res.latitude)
+ }
+ fetchList({
+ model: { type: 4 },
+ capacity: 1000,
+ page: 1,
+ }).then(ress => {
+ this.cateList = ress.records || []
+ const areaId = res.areaId
+ if (areaId) {
+ this.cateList.forEach(item => {
+ if (item.childCategoryList) {
+ item.childCategoryList.forEach(item2 => {
+ if (item2.id == areaId) {
+ this.$set(this.form, 'areaIds', [item.id, item2.id])
+
+ }
+ })
+ }
+ })
+ }
+ })
+
+ })
+ },
initData() {
- fetchList({
- model: { type: 4 },
+ getDeiceList({
+ model: {},
capacity: 1000,
page: 1,
}).then(res => {
- this.cateList = res.records || []
+ this.deviceList = res.records
})
},
- changeSel(e) {
- if (e && e.length == 1) {
- this.$set(this.form, 'catePId', e[0])
- this.$set(this.form, 'cateId', '')
- } else if (e && e.length == 2) {
- this.$set(this.form, 'catePId', e[0])
- this.$set(this.form, 'cateId', e[1])
+ getCenter(data) {
+ // console.log(data)
+ // this.$set(this.form, 'postion', data.address)
+ if (data.lng) {
+ this.$set(this.form, 'lnglat', data.lng + ',' + data.lat)
} else {
- this.$set(this.form, 'catePId', '')
- this.$set(this.form, 'cateId', '')
+ this.$set(this.form, 'lnglat', '')
}
- this.search()
+ this.$set(this.form, 'longitude', data.lng)
+ this.$set(this.form, 'latitude', data.lat)
+ },
+ changeSel(e) {
+ if (e && e.length == 2) {
+ this.$set(this.form, 'areaId', e[1])
+ } else {
+ this.$set(this.form, 'areaId', '')
+ }
},
uploadAvatarSuccess(file) {
- this.form.imgurl = file.imgurl
- this.form.imgurlfull = file.imgurlfull
+ this.$set(this.form, 'fileUrl', file.imgurl)
+ this.$set(this.form, 'fileFullUrl', file.imgurlfull)
},
}
}
</script>
+<style lang="scss" scoped>
+.mapbox {
+ width: 100%;
+ height: 400px;
+ margin-bottom: 20px;
+ float: left;
+}
+</style>
\ No newline at end of file
--
Gitblit v1.9.3