|
|
@@ -6,29 +6,36 @@
|
|
|
>
|
|
|
<el-form v-loading="isLoading" :model="form" label-width="100px" label-position="top">
|
|
|
<el-row :gutter="24">
|
|
|
- <el-col :span="16">
|
|
|
- <el-form-item label="点位分布">
|
|
|
- <select-base-info-data v-model="form.placeBaseInfoId" :multiple="false" :data-type="form.placeBaseInfoId"/>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-form-item label="点位分布">
|
|
|
+ <select-base-info-data v-model="form.placeBaseInfoId" :multiple="false"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item label="备注说明">
|
|
|
+ <el-input v-model="form.brief"/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="图片">
|
|
|
+ <el-upload
|
|
|
+ :file-list="fileList"
|
|
|
+ action="#"
|
|
|
+ list-type="picture-card"
|
|
|
+ name="fileData"
|
|
|
+ :http-request="uploaderHandle"
|
|
|
+ :on-success="uploadSuccess"
|
|
|
+ :on-remove="handleRemove"
|
|
|
+ :auto-upload="true"
|
|
|
+ >
|
|
|
+ <i slot="default" class="el-icon-plus"/>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <tencent-map id="amapcontainer" :position="[lat,lng]" @click="mapClick"/>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-form-item label="说明">
|
|
|
- <el-input v-model="form.brief"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="图片">
|
|
|
- <el-upload
|
|
|
- :file-list="fileList"
|
|
|
- action="#"
|
|
|
- list-type="picture-card"
|
|
|
- name="fileData"
|
|
|
- :http-request="uploaderHandle"
|
|
|
- :on-success="uploadSuccess"
|
|
|
- :on-remove="handleRemove"
|
|
|
- :auto-upload="true"
|
|
|
- >
|
|
|
- <i slot="default" class="el-icon-plus"/>
|
|
|
- </el-upload>
|
|
|
- </el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="visible = false">取 消</el-button>
|
|
|
@@ -41,17 +48,19 @@
|
|
|
|
|
|
import { uploaderHandle } from '@/api/upload'
|
|
|
import SelectBaseInfoData from '@/components/SelectBaseInfoData'
|
|
|
-import { save, updateById } from '@/api/place/passenger_equipment'
|
|
|
+import { save, updateById } from '@/api/equipment/equipment_passenger'
|
|
|
+import TencentMap from '@/components/TencentMap'
|
|
|
|
|
|
export default {
|
|
|
- components: { SelectBaseInfoData },
|
|
|
+ components: { SelectBaseInfoData, TencentMap },
|
|
|
data() {
|
|
|
return {
|
|
|
visible: false,
|
|
|
isLoading: false,
|
|
|
- listAllAuthorities: [],
|
|
|
form: {},
|
|
|
- fileList: []
|
|
|
+ fileList: [],
|
|
|
+ lng: null,
|
|
|
+ lat: null
|
|
|
}
|
|
|
},
|
|
|
computed: {},
|
|
|
@@ -66,18 +75,27 @@ export default {
|
|
|
file.url = res.url
|
|
|
this.fileList = fileList
|
|
|
},
|
|
|
+ mapClick(e) {
|
|
|
+ this.lng = e.latLng.lng
|
|
|
+ this.lat = e.latLng.lat
|
|
|
+ },
|
|
|
open(data) {
|
|
|
this.visible = true
|
|
|
this.isLoading = false
|
|
|
- this.fileList = []
|
|
|
this.form = {}
|
|
|
+ this.fileList = []
|
|
|
+ this.lng = null
|
|
|
+ this.lat = null
|
|
|
+
|
|
|
if (data && data.id) {
|
|
|
if (data.litpics) {
|
|
|
data.litpics.forEach(o => {
|
|
|
this.fileList.push({ url: o })
|
|
|
})
|
|
|
}
|
|
|
- this.form = Object.assign({}, data, { dataType: data.dataType.name })
|
|
|
+ this.lng = data.lng
|
|
|
+ this.lat = data.lat
|
|
|
+ this.form = Object.assign({}, data)
|
|
|
}
|
|
|
},
|
|
|
handleSubmit() {
|
|
|
@@ -86,7 +104,7 @@ export default {
|
|
|
litpics.push(o.url)
|
|
|
})
|
|
|
this.isLoading = true
|
|
|
- const param = { ...this.form, litpics }
|
|
|
+ const param = { ...this.form, lng: this.lng, lat: this.lat, litpics }
|
|
|
if (this.form.id) {
|
|
|
updateById(this.form.id, param).then(() => {
|
|
|
this.visible = false
|