From 697f7fff292a02e435086999787853e4dd873d39 Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Fri, 28 Jun 2024 17:37:30 +0800 Subject: [PATCH] 1 --- package.json | 1 + src/main.js | 2 +- src/views/assets/component/addLand.vue | 26 +++-- src/views/assets/files.vue | 40 ++++++-- src/views/component/detail.vue | 127 +++++++++++++++---------- 5 files changed, 128 insertions(+), 68 deletions(-) diff --git a/package.json b/package.json index a7c0476..cf2c808 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "eslint-plugin-vue": "6.2.2", "html-webpack-plugin": "3.2.0", "mockjs": "1.0.1-beta3", + "patch-package": "^8.0.0", "runjs": "4.3.2", "sass": "1.26.8", "sass-loader": "8.0.2", diff --git a/src/main.js b/src/main.js index 87464d7..668d6e8 100644 --- a/src/main.js +++ b/src/main.js @@ -98,7 +98,7 @@ AMap.initAMapApiLoader({ // 高德的key key: '795a757114c371f42cee1f8efa527684', // 插件集合 (插件按需引入) - plugin: ['AMap.Autocomplete','AMap.Geocoder','AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', + plugin: ['AMap.AutoComplete','AMap.Geocoder','AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor', 'AMap.DistrictSearch','AMap.CircleMarker','AMap.Polyline','AMap.MarkerClusterer' // 'AMap.Object3DLayer', 'AMap.Object3D' ] diff --git a/src/views/assets/component/addLand.vue b/src/views/assets/component/addLand.vue index bff5b6d..57a9708 100644 --- a/src/views/assets/component/addLand.vue +++ b/src/views/assets/component/addLand.vue @@ -44,7 +44,8 @@ export default { type: "selection", reserveSelection: true, fixed: "left", - width: 56 + width: 50, + selectable: (row) => (!row.land_id || row.land_id === this.id), }, { label: "名称", @@ -93,7 +94,12 @@ export default { }, on: { ["loaded"]: (_) => { - this.setCurrentRow(); + //this.setCurrentRow(); + this.$refs["houseTable"].getListData()?.forEach(row => { + if (row.land_id && row.land_id === this.id) { + this.$refs["houseTable"].toggleRowSelection(row, true); + } + }) }, ["select"]: (selection, row) => { if (row.land_id && row.land_id !== this.id) { @@ -327,16 +333,18 @@ export default { delete copyForm[info._relations?.link_with_name]; } }); - if (this.pickHouseRow && typeof this.pickHouseRow === "object") { + if (this.$refs["houseTable"].getSelection() && this.$refs["houseTable"]?.getSelection()?.length > 0) { promiseAll.push( - save( - Object.assign(this.pickHouseRow, { - table_name: "houses", - land_id: this.id, - }) - ) + ...this.$refs["houseTable"].getSelection().map(i => save(Object.assign(i, { table_name: 'houses',land_id: this.id }))) ); } + this.originalForm.id_houses_land_id_relation.forEach(item => { + if (this.$refs["houseTable"].getSelection().findIndex(selected => selected.id === item.id) === -1) { + promiseAll.push( + save(Object.assign(item, { table_name: 'houses',land_id: "" })) + ); + } + }) promiseAll.push( save(Object.assign(copyForm, { table_name: this.tableName })) ); diff --git a/src/views/assets/files.vue b/src/views/assets/files.vue index 49eeb80..3f381ab 100644 --- a/src/views/assets/files.vue +++ b/src/views/assets/files.vue @@ -244,16 +244,15 @@ export default { }, submit() { - save({ + Promise.all(this.fileList.map(item => save({ table_name: 'asset_file_files', - file_id: this.fileList[0]?.response?.id, + file_id: item?.response?.id, [/\/land/g.test(this.$route.path) ? 'land_id' : 'house_id']: this.id, - name: this.fileList[0]?.response?.name, - original_name: this.fileList[0]?.response?.original_name, - //TODO: 待修改 - url: this.fileList[0]?.response?.url.replace(/:\/\/:\/\//g, '://'), - ...this.form - }).then(res => { + name: item?.response?.name, + original_name: item?.response?.original_name, + url: item?.response?.url, + ...this.form + }))).then(res => { this.$message({ type: 'success', message: '附件上传成功' @@ -262,6 +261,24 @@ export default { this.isShowModal = false this.init() }) + // save({ + // table_name: 'asset_file_files', + // file_id: this.fileList[0]?.response?.id, + // [/\/land/g.test(this.$route.path) ? 'land_id' : 'house_id']: this.id, + // name: this.fileList[0]?.response?.name, + // original_name: this.fileList[0]?.response?.original_name, + // //TODO: 待修改 + // url: this.fileList[0]?.response?.url.replace(/:\/\/:\/\//g, '://'), + // ...this.form + // }).then(res => { + // this.$message({ + // type: 'success', + // message: '附件上传成功' + // }) + // this.getDetail() + // this.isShowModal = false + // this.init() + // }) }, openDownload (row) { @@ -303,6 +320,13 @@ export default { this.type = '' this.fileList = [] } + }, + isShowModal (val) { + if (val) { + + } else { + this.fileList = []; + } } } } diff --git a/src/views/component/detail.vue b/src/views/component/detail.vue index 1c4e87f..e941771 100644 --- a/src/views/component/detail.vue +++ b/src/views/component/detail.vue @@ -59,49 +59,61 @@ }}{{ units.get(item.field) }} -
- {{ detail.hasOwnProperty('id_houses_land_id_relation') ? (detail.id_houses_land_id_relation ? detail.id_houses_land_id_relation.name : '') : (detail.land_id_lands_id_relation ? detail.land_id_lands_id_relation.name : '') }} - 查看 -
+ + + + + +
- -
- 资产证件图片 -
- -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
历史沿革 @@ -165,7 +177,8 @@
- 资产地图 +

资产地图

+
-
- -
- 安全检查 -
-
+ + + + + + +
@@ -249,10 +263,10 @@ detail.id_assets_atlas_files_land_id_relation.length > 0) " /> - + - + @@ -304,7 +318,7 @@
    -
  • +
  • {{index+1}}.{{ item.original_name }} @@ -513,10 +527,18 @@ export default { }, init() { + //创建卫星图层 + const satellite = new AMap.TileLayer.Satellite(); + const roadNet = new AMap.TileLayer.RoadNet(); this.map = new AMap.Map("detail-map", { center: this.center, mapStyle: "amap://styles/bfb1bb3feb0db7082367abca96b8d214", // 设置地图的显示样式 zoom: 60, + layers: [satellite, roadNet] + }); + this.map.plugin(["AMap.ToolBar"],() => { + //加载工具条 + this.map.addControl(new AMap.ToolBar()); }); this.map.remove(this.marker); @@ -543,6 +565,7 @@ export default { this.marker = marker; this.map.add(this.marker); this.map.setFitView(this.marker); + this.map.setZoom(15); } }, @@ -735,6 +758,10 @@ export default { }, computed: { + filesFilter () { + return this.myFiles.filter((i) => (new RegExp(`${this.searchKeyword}.`).test(i.original_name))); + }, + picList() { if (/\/house/g.test(this.$route.path)) { return ( @@ -802,7 +829,7 @@ export default { this.getFields().then(res => { this.getHistories() this.getKeeps() - this.getInspections() + // this.getInspections() }) }, };