diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 2b26fd7..2287665 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -122,7 +122,6 @@ export function filterDynamicRoutes(routes) { } export const loadView = (view) => { - console.log(view,"=======loadView") if (process.env.NODE_ENV === 'development') { return (resolve) => require([`@/views/${view}`], resolve) } else { diff --git a/src/views/hispotalManage/hospital/index.vue b/src/views/hispotalManage/hospital/index.vue index 81a36e8..c31f147 100644 --- a/src/views/hispotalManage/hospital/index.vue +++ b/src/views/hispotalManage/hospital/index.vue @@ -2,7 +2,7 @@ * @Author: ‘巴博尔’ 2164119982@qq.com * @Date: 2023-09-07 16:09:29 * @LastEditors: ‘巴博尔’ 2164119982@qq.com - * @LastEditTime: 2023-09-20 14:33:53 + * @LastEditTime: 2023-09-25 09:37:51 * @FilePath: \peizhen-vue\src\views\hispotalManage\hospital\index.vue * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE --> @@ -293,11 +293,20 @@ </el-option> </el-select> </el-form-item> + <el-form-item label="地址" prop="mapAddress"> + <div @click="clickOpenCheckAddress"> + <el-input v-model="form.mapAddress" placeholder="请选择地址" readonly="" /> + </div> + </el-form-item> <el-form-item label="经度" prop="lng"> - <el-input v-model="form.lng" placeholder="请输入经度" /> + <div @click="clickOpenCheckAddress"> + <el-input v-model="form.lng" placeholder="请选择经度" readonly="" /> + </div> </el-form-item> <el-form-item label="纬度" prop="lat"> - <el-input v-model="form.lat" placeholder="请输入纬度" /> + <div @click="clickOpenCheckAddress"> + <el-input v-model="form.lat" placeholder="请选择纬度" readonly="" /> + </div> </el-form-item> <el-form-item label="类别" prop="category"> <el-select @@ -341,6 +350,24 @@ <el-button @click="cancel">取 消</el-button> </div> </el-dialog> + <el-dialog + title="选择区域" + :modal-append-to-body="true" + :destroy-on-close="true" + center + :visible.sync="openAddress" + width="60%" + > + <iframe + width="100%" + style="height: 60vh; width: 100%; border: none" + :src="map_src" + ></iframe> + <span slot="footer"> + <el-button @click="openAddress = false">取 消</el-button> + <el-button type="primary" @click="openAddress = false">确 定</el-button> + </span> + </el-dialog> </div> </template> @@ -412,13 +439,58 @@ export default { cityId: [{ required: true, message: "请选择城市", trigger: "change" }], name: [{ required: true, message: "请选择城市", trigger: "blur" }], }, + map_src: "", + openAddress: false, + map_data: { + url: "https://mapapi.qq.com/web/mapComponents/locationPicker/v/index.html?search=1&type=1&key=RQOBZ-K2GCA-I6NKY-CPX4H-WBQAO-4SFSQ&referer=appname", + address: "", + lng: "", + lat: "", + }, }; }, created() { + let that = this; + window.addEventListener( + "message", + function (event) { + // 接收位置信息,用户选择确认位置点后选点组件会触发该事件,回传用户的位置信息 + var loc = event.data; + if (loc && loc.module == "locationPicker") { + //防止其他应用也会向该页面post信息,需判断module是否为'locationPicker' + //{ + // module:'locationPicker', + // latlng: { + // lat: 39.998766, + // lng: 116.273938 + // }, + // poiaddress: "北京市海淀区新建宫门路19号", + // poiname: "颐和园", + // cityname: "北京市" + //} + that.map_data.address = loc.poiaddress; + that.map_data.lat = loc.latlng.lat; + that.map_data.lng = loc.latlng.lng; + console.log(that.map_data, "=======that.map_data"); + that.$set(that.form, "mapAddress", loc.poiaddress); + that.$set(that.form, "lng", loc.latlng.lng); + that.$set(that.form, "lat", loc.latlng.lat); + } + }, + false + ); this.getList(); this.getDeptTree(); }, methods: { + clickOpenCheckAddress(lat, lng) { + let mat_url = this.map_data.url; + if (lat && lng) { + mat_url += "&coord=" + lat + "," + lng; + } + this.map_src = mat_url; + this.openAddress = true; + }, /** 查询部门下拉树结构 */ getDeptTree() { listDepartment().then((response) => { @@ -470,6 +542,7 @@ export default { updateTime: undefined, delFlag: undefined, status: undefined, + mapAddress: undefined, }; this.resetForm("form"); }, diff --git a/vue.config.js b/vue.config.js index 764fc12..79c28c1 100644 --- a/vue.config.js +++ b/vue.config.js @@ -39,7 +39,7 @@ module.exports = { target: `https://peizheng.shanpeikj.com/api`, // target: `http://192.168.0.169:8089`, // target: `http://192.168.0.137:8089`, - // target: `http://192.168.0.170:8089`, + // target: `http://192.168.0.125:8089`, changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: ''