From a2299a6d4a6f99e9c11132138f5d3e9ec68f03ea Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期五, 06 六月 2025 19:19:34 +0800 Subject: [PATCH] 开发更新 --- admin/src/views/Inspection/components/OperaYwPatrolPointWindow.vue | 102 +++++++++++++++++++++++++++++++++------------------ 1 files changed, 66 insertions(+), 36 deletions(-) diff --git a/admin/src/views/Inspection/components/OperaYwPatrolPointWindow.vue b/admin/src/views/Inspection/components/OperaYwPatrolPointWindow.vue index 00acdd2..2f22cd9 100644 --- a/admin/src/views/Inspection/components/OperaYwPatrolPointWindow.vue +++ b/admin/src/views/Inspection/components/OperaYwPatrolPointWindow.vue @@ -1,8 +1,8 @@ <template> <GlobalWindow :title="title" :visible.sync="visible" width="620px" :confirm-working="isWorking" @confirm="confirm"> <el-form :model="form" ref="form" :rules="rules"> - <el-form-item label="宸℃鐐圭紪鐮�" prop="code"> - <el-input v-model="form.code" placeholder="璇疯緭鍏ュ悕绉�" v-trim /> + <el-form-item label="宸℃鐐圭紪鐮�" required > + <el-input v-model="form.code" disabled readonly placeholder="绯荤粺鑷姩鐢熸垚" v-trim /> </el-form-item> <el-form-item label="宸℃鐐瑰悕绉�" prop="name"> <el-input v-model="form.name" placeholder="璇疯緭鍏ュ贰妫�鐐瑰悕绉�" v-trim /> @@ -21,16 +21,16 @@ }"></el-cascader> </el-form-item> <el-form-item label="缁忕含搴�"> - <el-input v-model="form.lnglat" disabled v-trim /> + <el-input v-model="form.lnglat" placeholder="绀轰緥锛�117.297461,31.849234" v-trim /> </el-form-item> - <el-form-item> + <!-- <el-form-item> <mapDrag class="mapbox" @center="getCenter" /> - </el-form-item> + </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 }" + <UploadAvatarImage :file="{ 'imgurlfull': form.fileFullUrl, 'imgurl': form.fileUrl }" :uploadData="{ folder: 'ywPatrol/' }" @uploadSuccess="uploadAvatarSuccess" @uploadEnd="isUploading = false" @uploadBegin="isUploading = true" /> </el-form-item> @@ -45,6 +45,7 @@ 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, @@ -66,7 +67,6 @@ // 楠岃瘉瑙勫垯 rules: { name: [{ required: true, message: '璇疯緭鍏�' }], - code: [{ required: true, message: '璇疯緭鍏�' }], }, isUploading: false, } @@ -81,50 +81,80 @@ 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 } - // this.$set(this.form, 'areaId', res.areaId) - // console.log('res', res) - // console.log('res', this.form) - this.initData(res.areaId) + 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(areaId) { - fetchList({ - model: { type: 4 }, + initData() { + getDeiceList({ + model: {}, capacity: 1000, page: 1, }).then(res => { - this.cateList = res.records || [] - console.log('this.form.areaId', this.form) - - 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]) - console.log('areaIds', this.form) - - } - }) - } - }) - } + this.deviceList = res.records }) }, getCenter(data) { // console.log(data) // this.$set(this.form, 'postion', data.address) - if(data.lng){ + if (data.lng) { this.$set(this.form, 'lnglat', data.lng + ',' + data.lat) - }else{ + } else { this.$set(this.form, 'lnglat', '') } this.$set(this.form, 'longitude', data.lng) @@ -138,8 +168,8 @@ } }, 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) }, } } @@ -151,4 +181,4 @@ margin-bottom: 20px; float: left; } -</style> \ No newline at end of file +</style> -- Gitblit v1.9.3