|
@@ -12,12 +12,6 @@
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="经度" prop="longitude" :rules="[{required: true, message: '请输入经度'}]">
|
|
|
|
- <el-input type="text" v-model="projectForm.longitude" placeholder="请输入经度"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="纬度" prop="latitude" :rules="[{required: true, message: '请输入纬度'}]">
|
|
|
|
- <el-input type="text" v-model="projectForm.latitude" placeholder="请输入纬度"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
<el-form-item label="项目区域" prop="address" :rules="[{required: true, message: '请选择项目区域'}]">
|
|
<el-form-item label="项目区域" prop="address" :rules="[{required: true, message: '请选择项目区域'}]">
|
|
<city v-model="projectForm.address"></city>
|
|
<city v-model="projectForm.address"></city>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -29,6 +23,10 @@
|
|
<el-input type="textarea" v-model="projectForm.comment" placeholder="请输入项目描述" resize="none">
|
|
<el-input type="textarea" v-model="projectForm.comment" placeholder="请输入项目描述" resize="none">
|
|
</el-input>
|
|
</el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="地图位置" class="hui-textarea">
|
|
|
|
+ <select-location ref="map" v-if="showMap" type="insert" :coordinates="projectForm.coordinates">
|
|
|
|
+ </select-location>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item label="项目配图" class="hui-textarea">
|
|
<el-form-item label="项目配图" class="hui-textarea">
|
|
<upload ref="upload" :list="responsibility" type="insert"></upload>
|
|
<upload ref="upload" :list="responsibility" type="insert"></upload>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -55,6 +53,7 @@
|
|
import upload from '@/components/common/upload'
|
|
import upload from '@/components/common/upload'
|
|
import city from '@/components/common/city'
|
|
import city from '@/components/common/city'
|
|
import tag from '@/components/common/tag'
|
|
import tag from '@/components/common/tag'
|
|
|
|
+ import selectLocation from '@/components/work/common/selectLocation'
|
|
export default {
|
|
export default {
|
|
props: ['isUpdate', 'detailId'],
|
|
props: ['isUpdate', 'detailId'],
|
|
data() {
|
|
data() {
|
|
@@ -68,11 +67,11 @@
|
|
picture: '',
|
|
picture: '',
|
|
tagIds: '',
|
|
tagIds: '',
|
|
type: 1,
|
|
type: 1,
|
|
- longitude: '',
|
|
|
|
- latitude: ''
|
|
|
|
|
|
+ coordinates: ''
|
|
},
|
|
},
|
|
specific: '',
|
|
specific: '',
|
|
- responsibility: []
|
|
|
|
|
|
+ responsibility: [],
|
|
|
|
+ showMap: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -81,9 +80,7 @@
|
|
getProjectDetailById(this.detailId).then(res => {
|
|
getProjectDetailById(this.detailId).then(res => {
|
|
if (res.state) {
|
|
if (res.state) {
|
|
this.projectForm = res.data;
|
|
this.projectForm = res.data;
|
|
- let address = res.data.coordinates.split(',');
|
|
|
|
- this.projectForm.longitude = address[0];
|
|
|
|
- this.projectForm.latitude = address[1];
|
|
|
|
|
|
+ this.showMap = true;
|
|
this.projectForm.address = JSON.parse(this.projectForm.address);
|
|
this.projectForm.address = JSON.parse(this.projectForm.address);
|
|
if (this.projectForm.picture) this.responsibility = JSON.parse(this.projectForm.picture);
|
|
if (this.projectForm.picture) this.responsibility = JSON.parse(this.projectForm.picture);
|
|
if (this.projectForm.data) {
|
|
if (this.projectForm.data) {
|
|
@@ -92,6 +89,8 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ } else {
|
|
|
|
+ this.showMap = true;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -105,7 +104,7 @@
|
|
postData['picture'] = JSON.stringify(this.$refs.upload.fileList);
|
|
postData['picture'] = JSON.stringify(this.$refs.upload.fileList);
|
|
postData['address'] = JSON.stringify(this.projectForm.address);
|
|
postData['address'] = JSON.stringify(this.projectForm.address);
|
|
postData['tagIds'] = this.$refs.tag.tagIds();
|
|
postData['tagIds'] = this.$refs.tag.tagIds();
|
|
- postData['coordinates'] = postData.longitude + ',' + postData.latitude;
|
|
|
|
|
|
+ postData['coordinates'] = this.$refs.map.address;
|
|
if (this.isUpdate) {
|
|
if (this.isUpdate) {
|
|
updateProject(postData).then(this.successFunc);
|
|
updateProject(postData).then(this.successFunc);
|
|
} else {
|
|
} else {
|
|
@@ -126,7 +125,8 @@
|
|
components: {
|
|
components: {
|
|
city,
|
|
city,
|
|
upload,
|
|
upload,
|
|
- tag
|
|
|
|
|
|
+ tag,
|
|
|
|
+ selectLocation
|
|
},
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|