diff --git a/public/index.html b/public/index.html index 0cae8d5..eaf8ccf 100644 --- a/public/index.html +++ b/public/index.html @@ -12,8 +12,8 @@ - - + + diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index fc9af3d..a5168d4 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -105,36 +105,6 @@ - - - - - - 搜索 - -
-
-
- @@ -222,23 +192,8 @@ - - 选择位置 - - - - - - - - - + @@ -289,9 +244,6 @@ export default { components: { Treeselect }, data() { return { - innerVisible: false, - map: null, - searchAddress: '', // 遮罩层 loading: true, // 显示搜索条件 @@ -318,11 +270,7 @@ export default { isDepartmentList:[{id:'0',name:'否'},{id:'1',name:'是'}], provinceList:["北京","上海","天津","重庆","河北","山西","内蒙古","辽宁","吉林","黑龙江","江苏","浙江","安徽","福建","江西","山东","河南","湖北","湖南","广东","广西","海南","四川","贵州","云南","西藏","陕西","甘肃","宁夏","青海","新疆","香港","澳门","台湾"], // 表单参数 - form: { - lon: '', - lat: '', - address: '', - }, + form: {}, // 表单校验 rules: { parentId: [ @@ -452,12 +400,12 @@ export default { this.reset(); getDept(row.id).then(response => { this.form = response.data; - if(!this.form.parentId){ - this.form.parentId=0 + if (!this.form.parentId) { + this.form.parentId = 0 } - if(this.form.orgHeadUserId!=null){ + if (this.form.orgHeadUserId != null) { let arr = this.form.orgHeadUserId.split(',') - this.$set(this.form,"orgHeadUserIdList",arr) + this.$set(this.form, "orgHeadUserIdList", arr) } this.open = true; this.title = "修改部门"; @@ -467,10 +415,10 @@ export default { }); }, /** 提交按钮 */ - submitForm: function() { + submitForm: function () { this.$refs["form"].validate(valid => { if (valid) { - this.form.orgHeadUserId=this.form.orgHeadUserIdList.join(',') + this.form.orgHeadUserId = this.form.orgHeadUserIdList.join(',') if (this.form.id != undefined) { updateDept(this.form).then(response => { this.$modal.msgSuccess("修改成功"); @@ -489,17 +437,22 @@ export default { }, /** 删除按钮操作 */ handleDelete(row) { - this.$modal.confirm('是否确认删除名称为"' + row.orgName + '"的数据项?').then(function() { + this.$modal.confirm('是否确认删除名称为"' + row.orgName + '"的数据项?').then(function () { return delDept(row.id); }).then(() => { this.getList(); this.$modal.msgSuccess("删除成功"); - }).catch(() => {}); + }).catch(() => { + }); }, /** 导出按钮操作 */ handleExport() { exportOrg(this.queryParams).then(res => { - downloadFile({ fileName: `组织架构_${new Date().getTime()}.xlsx`, fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' }) + downloadFile({ + fileName: `组织架构_${new Date().getTime()}.xlsx`, + fileData: res, + fileType: 'application/vnd.ms-excel;charset=utf-8' + }) }) }, /** 导入按钮操作 */ @@ -528,93 +481,7 @@ export default { // 提交上传文件 submitFileForm() { this.$refs.upload.submit(); - }, - /** 选择工程地址 */ - handleProjectAddress() { - const this_ = this; - this.searchAddress = ''; - this.innerVisible = true; - - this.$nextTick(() => { - //在线地图 new BMapGL - //离线地图 new window.BMap - this_.map = new BMapGL.Map('map-container'); // 创建地图实例 - let point; - if (this_.form.lon != null && this_.form.lon !== '' && this_.form.lat != null && this_.form.lat !== '') { - console.log(this_.form.lat, this_.form.lon); - point = new BMapGL.Point(this_.form.lon, this_.form.lat); - let marker = new BMapGL.Marker(point); // 创建标点 - this_.map.addOverlay(marker); - } else { - point = new BMapGL.Point(117.13805, 31.8734); // 创建点坐标 - } - - this_.map.centerAndZoom(point, 14); // 初始化地图,设置中心点坐标和地图级别 - this_.map.enableScrollWheelZoom(true); // 启用滚轮放大缩小 - this_.map.setMinZoom(14) // 启用滚轮放大缩小 - this_.map.setMaxZoom(14) // 启用滚轮放大缩小 - - // 禁用不必要的功能 - // this_.map.disableDragging(); // 禁用拖拽 - this_.map.disableDoubleClickZoom(); // 禁用双击缩放 - this_.map.disablePinchToZoom(); // 禁用多点触控缩放 - this_.map.disableKeyboard(); // 禁用键盘操作 - - var geoc = new BMapGL.Geocoder(); - - this_.map.addEventListener('click', function (e) { - var pt = e.latlng; - geoc.getLocation(pt, function (res) { - var addComp = res.addressComponents; - this_.form.address = `${addComp.province}${addComp.city}${addComp.district}${addComp.street}${addComp.streetNumber}`; - this_.form.lon = e.latlng.lng; - this_.form.lat = e.latlng.lat; - }); - this_.map.clearOverlays(); - point = new BMapGL.Point(e.latlng.lng, e.latlng.lat); - let marker = new BMapGL.Marker(point); // 创建标点 - this_.map.addOverlay(marker); - }); - }); - }, - /* 搜索 */ - onSearchAddress() { - - // 创建地址 - const myGeo = new BMapGL.Geocoder() - const _this = this - myGeo.getPoint( - this.searchAddress, - function (point) { - if (point) { - _this.map.clearOverlays() - const {lng, lat} = point - - _this.map.centerAndZoom(point, 16) - _this.map.addOverlay( - new BMapGL.Marker(point, { - title: _this.searchAddress, - }), - ) - // 根据坐标得到地址描述 - myGeo.getLocation( - new BMapGL.Point(lng, lat), - function (result) { - if (result) { - let addComp = result.addressComponents - _this.form.address = `${addComp.province}${addComp.city}${addComp.district}${addComp.street}${addComp.streetNumber}` - _this.form.lon = lng - _this.form.lat = lat - } - }, - ) - } else { - this.$message.error('您输入的地址有误,请重新输入') - } - }, - '中国', - ) - }, + } } };