| @ -0,0 +1,13 @@ | |||
| <template> | |||
| $END$ | |||
| </template> | |||
| <script> | |||
| export default { | |||
| name: "TencentMapPicker" | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| </style> | |||
| @ -0,0 +1,235 @@ | |||
| <template> | |||
| <div> | |||
| <div class="map-box"> | |||
| <div class="map" ref="map" style="height: 400px" ></div> | |||
| <div class="map-search"> | |||
| <div> | |||
| <a-input-search id="place" v-model="searchValue" placeholder="请输入详细地址" enter-button @search="searchAddress(searchValue)" /> | |||
| </div> | |||
| <div> | |||
| <ul v-if="kwData.length"> | |||
| <li v-for="(item, index) in kwData" :key="index" @click="selectKeyword(item)">{{ item.address }}</li> | |||
| </ul> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </template> | |||
| <script> | |||
| export default { | |||
| name: 'TencentMapPicker', | |||
| props: { | |||
| latitude: { | |||
| type: Number|String, | |||
| default: 0 | |||
| }, | |||
| longitude: { | |||
| type: Number|String, | |||
| default: 0 | |||
| } | |||
| }, | |||
| watch: { | |||
| latitude(newVal, oldVal) { | |||
| console.info(`newVal`,newVal,`oldVal`,oldVal) | |||
| if (newVal) { | |||
| this.form.latitude = newVal | |||
| // this.$nextTick(()=>{ | |||
| // this.map.setCenter(new window.TMap.LatLng(this.form.latitude, this.form.longitude)); | |||
| // }) | |||
| } | |||
| }, | |||
| longitude(newVal, oldVal) { | |||
| console.info(`newVal`,newVal,`oldVal`,oldVal) | |||
| if (newVal) { | |||
| this.form.longitude = newVal | |||
| // this.$nextTick(()=>{ | |||
| // this.map.setCenter(new window.TMap.LatLng(this.form.latitude, this.form.longitude)); | |||
| // }) | |||
| } | |||
| } | |||
| }, | |||
| data() { | |||
| return { | |||
| searchValue: '', //地图搜索 | |||
| form: { | |||
| longitude: 116.397128, | |||
| latitude: 39.916527 | |||
| }, | |||
| kwData:[] | |||
| } | |||
| }, | |||
| mounted() { | |||
| let that = this | |||
| if (that.script) return; | |||
| that.script = document.createElement('script'); | |||
| that.script.type = 'text/javascript'; | |||
| that.script.src = `//map.qq.com/api/gljs?v=1.exp&libraries=service&key=DGFBZ-JU76M-34A63-6BU47-2FLJH-XLBCN`; | |||
| document.head.appendChild(that.script); | |||
| that.script.onload = () => { | |||
| window.initMap = that.initMap; | |||
| that.$nextTick(() => { | |||
| that.initMap(); | |||
| }); | |||
| }; | |||
| }, | |||
| methods: { | |||
| // 地图 | |||
| initMap() { | |||
| // 搜索类 | |||
| this.searchEr = new window.TMap.service.Search({ pageSize: 15 }); | |||
| // 地图主类 | |||
| this.map = new window.TMap.Map(this.$refs.map, { | |||
| backgroundColor: '#f7f7f7', | |||
| mapStyleId: 'style1', | |||
| zoom: 14, | |||
| mapTypeControlOptions: { | |||
| mapTypeIds: [], | |||
| }, | |||
| draggableCursor: 'crosshair', | |||
| center: new window.TMap.LatLng(this.form.latitude, this.form.longitude), | |||
| }); | |||
| // 图层类 | |||
| this.markerLayer = new window.TMap.MultiMarker({ | |||
| map: this.map, | |||
| geometries: [], | |||
| }); | |||
| // 地址逆解析 | |||
| this.geocoder = new window.TMap.service.Geocoder(); | |||
| const setMarker = () => { | |||
| const latlng = new window.TMap.LatLng(this.form.latitude, this.form.longitude); | |||
| this.markerLayer.setGeometries([]); | |||
| let geometries = this.markerLayer.getGeometries(); | |||
| geometries.push({ | |||
| id: '-1', | |||
| position: latlng, | |||
| }); | |||
| this.markerLayer.updateGeometries(geometries); | |||
| }; | |||
| this.map.on('click', (e) => { | |||
| this.form.longitude = e.latLng.getLng(); // 经度 | |||
| this.form.latitude = e.latLng.getLat(); // 纬度 | |||
| setMarker(); | |||
| this.getAddressFormat(); | |||
| }); | |||
| if (this.form.longitude) { | |||
| this.map.setCenter(new window.TMap.LatLng(this.form.latitude, this.form.longitude)); | |||
| setMarker(); | |||
| } | |||
| }, | |||
| selectKeyword(event){ | |||
| this.map.setCenter(new window.TMap.LatLng(event.location.lat, event.location.lng)); | |||
| this.kwData = [] | |||
| }, | |||
| // 地图搜索 | |||
| searchAddress(keyword = '') { | |||
| console.log(keyword+"=====") | |||
| if (!keyword) return; | |||
| this.$jsonp('https://apis.map.qq.com/ws/place/v1/suggestion', { | |||
| key: 'DGFBZ-JU76M-34A63-6BU47-2FLJH-XLBCN', | |||
| output: 'jsonp', | |||
| keyword: keyword, | |||
| }).then((res) => { | |||
| console.log(`res`,res) | |||
| if (res.status === 0) { | |||
| this.kwData = res.data | |||
| } else { | |||
| this.kwData = [] | |||
| } | |||
| }).catch((e) => { | |||
| console.log(e) | |||
| }) | |||
| this.markerLayer.setGeometries([]); | |||
| this.searchEr.searchRectangle({ | |||
| keyword, | |||
| bounds: this.map.getBounds(), | |||
| }) | |||
| .then((result) => { | |||
| console.info(`result`,result) | |||
| const { location = {} } = result.data[0] || {}; | |||
| const { lat = 39.916527, lng = 116.397128 } = location; | |||
| this.map.setCenter(new window.TMap.LatLng(lat, lng)); | |||
| result.data.forEach((item, index) => { | |||
| let geometries = this.markerLayer.getGeometries(); | |||
| // 点标注数据数组 | |||
| geometries.push({ | |||
| id: String(index), | |||
| position: item.location, | |||
| }); | |||
| // 绘制地点标注 | |||
| this.markerLayer.updateGeometries(geometries); | |||
| }); | |||
| }); | |||
| }, | |||
| getAddressFormat() { | |||
| const { longitude, latitude } = this.form; | |||
| this.geocoder | |||
| .getAddress({ | |||
| location: new window.TMap.LatLng(latitude, longitude), | |||
| }) | |||
| .then((res) => { | |||
| const { | |||
| formatted_addresses: { recommend = '' }, | |||
| } = res.result || {}; | |||
| this.searchValue = recommend | |||
| this.form.hotelDetailAddress = recommend; | |||
| this.$emit('onLocationSelected', this.form); | |||
| console.log(this.form); | |||
| }); | |||
| }, | |||
| } | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| .map-box { | |||
| position: relative; | |||
| } | |||
| .map-search { | |||
| z-index: 1000; | |||
| display: flex; | |||
| flex-direction: column; | |||
| position: absolute; | |||
| top: 20px; | |||
| left: 20px; | |||
| width: 300px; | |||
| } | |||
| button { | |||
| border-radius: 0; | |||
| } | |||
| .icons { | |||
| display: flex; | |||
| align-items: center; | |||
| justify-content: space-between; | |||
| } | |||
| .time { | |||
| margin-top: 15px; | |||
| width: 100%; | |||
| font-size: 12px; | |||
| flex-wrap: wrap; | |||
| height: 70%; | |||
| } | |||
| ul{ | |||
| background: white; | |||
| list-style-type: none; | |||
| padding-left: 0px; | |||
| height: 280px; | |||
| overflow: scroll; | |||
| } | |||
| li{ | |||
| padding-left: 6px; | |||
| font-size: 10px; | |||
| text-align: left; | |||
| height: 40px; | |||
| line-height: 15px; | |||
| display: flex; | |||
| align-items: center; | |||
| } | |||
| li:hover{ | |||
| cursor: pointer; | |||
| background: #f5f5f5; | |||
| } | |||
| </style> | |||
| @ -0,0 +1,235 @@ | |||
| <template> | |||
| <div> | |||
| <div class="map-box"> | |||
| <div class="map" ref="map" style="height: 400px" ></div> | |||
| <div class="map-search"> | |||
| <div> | |||
| <a-input-search id="place" v-model="searchValue" placeholder="请输入详细地址" enter-button @search="searchAddress(searchValue)" /> | |||
| </div> | |||
| <div> | |||
| <ul v-if="kwData.length"> | |||
| <li v-for="(item, index) in kwData" :key="index" @click="selectKeyword(item)">{{ item.address }}</li> | |||
| </ul> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </template> | |||
| <script> | |||
| export default { | |||
| name: 'TencentMapPicker', | |||
| props: { | |||
| latitude: { | |||
| type: Number|String, | |||
| default: 0 | |||
| }, | |||
| longitude: { | |||
| type: Number|String, | |||
| default: 0 | |||
| } | |||
| }, | |||
| watch: { | |||
| latitude(newVal, oldVal) { | |||
| console.info(`newVal`,newVal,`oldVal`,oldVal) | |||
| if (newVal) { | |||
| this.form.latitude = newVal | |||
| // this.$nextTick(()=>{ | |||
| // this.map.setCenter(new window.TMap.LatLng(this.form.latitude, this.form.longitude)); | |||
| // }) | |||
| } | |||
| }, | |||
| longitude(newVal, oldVal) { | |||
| console.info(`newVal`,newVal,`oldVal`,oldVal) | |||
| if (newVal) { | |||
| this.form.longitude = newVal | |||
| // this.$nextTick(()=>{ | |||
| // this.map.setCenter(new window.TMap.LatLng(this.form.latitude, this.form.longitude)); | |||
| // }) | |||
| } | |||
| } | |||
| }, | |||
| data() { | |||
| return { | |||
| searchValue: '', //地图搜索 | |||
| form: { | |||
| longitude: 116.397128, | |||
| latitude: 39.916527 | |||
| }, | |||
| kwData:[] | |||
| } | |||
| }, | |||
| mounted() { | |||
| let that = this | |||
| if (that.script) return; | |||
| that.script = document.createElement('script'); | |||
| that.script.type = 'text/javascript'; | |||
| that.script.src = `//map.qq.com/api/gljs?v=1.exp&libraries=service&key=DGFBZ-JU76M-34A63-6BU47-2FLJH-XLBCN`; | |||
| document.head.appendChild(that.script); | |||
| that.script.onload = () => { | |||
| window.initMap = that.initMap; | |||
| that.$nextTick(() => { | |||
| that.initMap(); | |||
| }); | |||
| }; | |||
| }, | |||
| methods: { | |||
| // 地图 | |||
| initMap() { | |||
| // 搜索类 | |||
| this.searchEr = new window.TMap.service.Search({ pageSize: 15 }); | |||
| // 地图主类 | |||
| this.map = new window.TMap.Map(this.$refs.map, { | |||
| backgroundColor: '#f7f7f7', | |||
| mapStyleId: 'style1', | |||
| zoom: 14, | |||
| mapTypeControlOptions: { | |||
| mapTypeIds: [], | |||
| }, | |||
| draggableCursor: 'crosshair', | |||
| center: new window.TMap.LatLng(this.form.latitude, this.form.longitude), | |||
| }); | |||
| // 图层类 | |||
| this.markerLayer = new window.TMap.MultiMarker({ | |||
| map: this.map, | |||
| geometries: [], | |||
| }); | |||
| // 地址逆解析 | |||
| this.geocoder = new window.TMap.service.Geocoder(); | |||
| const setMarker = () => { | |||
| const latlng = new window.TMap.LatLng(this.form.latitude, this.form.longitude); | |||
| this.markerLayer.setGeometries([]); | |||
| let geometries = this.markerLayer.getGeometries(); | |||
| geometries.push({ | |||
| id: '-1', | |||
| position: latlng, | |||
| }); | |||
| this.markerLayer.updateGeometries(geometries); | |||
| }; | |||
| this.map.on('click', (e) => { | |||
| this.form.longitude = e.latLng.getLng(); // 经度 | |||
| this.form.latitude = e.latLng.getLat(); // 纬度 | |||
| setMarker(); | |||
| this.getAddressFormat(); | |||
| }); | |||
| if (this.form.longitude) { | |||
| this.map.setCenter(new window.TMap.LatLng(this.form.latitude, this.form.longitude)); | |||
| setMarker(); | |||
| } | |||
| }, | |||
| selectKeyword(event){ | |||
| this.map.setCenter(new window.TMap.LatLng(event.location.lat, event.location.lng)); | |||
| this.kwData = [] | |||
| }, | |||
| // 地图搜索 | |||
| searchAddress(keyword = '') { | |||
| console.log(keyword+"=====") | |||
| if (!keyword) return; | |||
| this.$jsonp('https://apis.map.qq.com/ws/place/v1/suggestion', { | |||
| key: 'DGFBZ-JU76M-34A63-6BU47-2FLJH-XLBCN', | |||
| output: 'jsonp', | |||
| keyword: keyword, | |||
| }).then((res) => { | |||
| console.log(`res`,res) | |||
| if (res.status === 0) { | |||
| this.kwData = res.data | |||
| } else { | |||
| this.kwData = [] | |||
| } | |||
| }).catch((e) => { | |||
| console.log(e) | |||
| }) | |||
| this.markerLayer.setGeometries([]); | |||
| this.searchEr.searchRectangle({ | |||
| keyword, | |||
| bounds: this.map.getBounds(), | |||
| }) | |||
| .then((result) => { | |||
| console.info(`result`,result) | |||
| const { location = {} } = result.data[0] || {}; | |||
| const { lat = 39.916527, lng = 116.397128 } = location; | |||
| this.map.setCenter(new window.TMap.LatLng(lat, lng)); | |||
| result.data.forEach((item, index) => { | |||
| let geometries = this.markerLayer.getGeometries(); | |||
| // 点标注数据数组 | |||
| geometries.push({ | |||
| id: String(index), | |||
| position: item.location, | |||
| }); | |||
| // 绘制地点标注 | |||
| this.markerLayer.updateGeometries(geometries); | |||
| }); | |||
| }); | |||
| }, | |||
| getAddressFormat() { | |||
| const { longitude, latitude } = this.form; | |||
| this.geocoder | |||
| .getAddress({ | |||
| location: new window.TMap.LatLng(latitude, longitude), | |||
| }) | |||
| .then((res) => { | |||
| const { | |||
| formatted_addresses: { recommend = '' }, | |||
| } = res.result || {}; | |||
| this.searchValue = recommend | |||
| this.form.hotelDetailAddress = recommend; | |||
| this.$emit('onLocationSelected', this.form); | |||
| console.log(this.form); | |||
| }); | |||
| }, | |||
| } | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| .map-box { | |||
| position: relative; | |||
| } | |||
| .map-search { | |||
| z-index: 1000; | |||
| display: flex; | |||
| flex-direction: column; | |||
| position: absolute; | |||
| top: 20px; | |||
| left: 20px; | |||
| width: 300px; | |||
| } | |||
| button { | |||
| border-radius: 0; | |||
| } | |||
| .icons { | |||
| display: flex; | |||
| align-items: center; | |||
| justify-content: space-between; | |||
| } | |||
| .time { | |||
| margin-top: 15px; | |||
| width: 100%; | |||
| font-size: 12px; | |||
| flex-wrap: wrap; | |||
| height: 70%; | |||
| } | |||
| ul{ | |||
| background: white; | |||
| list-style-type: none; | |||
| padding-left: 0px; | |||
| height: 280px; | |||
| overflow: scroll; | |||
| } | |||
| li{ | |||
| padding-left: 6px; | |||
| font-size: 10px; | |||
| text-align: left; | |||
| height: 40px; | |||
| line-height: 15px; | |||
| display: flex; | |||
| align-items: center; | |||
| } | |||
| li:hover{ | |||
| cursor: pointer; | |||
| background: #f5f5f5; | |||
| } | |||
| </style> | |||
| @ -0,0 +1,235 @@ | |||
| <template> | |||
| <div> | |||
| <div class="map-box"> | |||
| <div class="map" ref="map" style="height: 400px" ></div> | |||
| <div class="map-search"> | |||
| <div> | |||
| <a-input-search id="place" v-model="searchValue" placeholder="请输入详细地址" enter-button @search="searchAddress(searchValue)" /> | |||
| </div> | |||
| <div> | |||
| <ul v-if="kwData.length"> | |||
| <li v-for="(item, index) in kwData" :key="index" @click="selectKeyword(item)">{{ item.address }}</li> | |||
| </ul> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </template> | |||
| <script> | |||
| export default { | |||
| name: 'TencentMapPicker', | |||
| props: { | |||
| latitude: { | |||
| type: Number|String, | |||
| default: 0 | |||
| }, | |||
| longitude: { | |||
| type: Number|String, | |||
| default: 0 | |||
| } | |||
| }, | |||
| watch: { | |||
| latitude(newVal, oldVal) { | |||
| console.info(`newVal`,newVal,`oldVal`,oldVal) | |||
| if (newVal) { | |||
| this.form.latitude = newVal | |||
| // this.$nextTick(()=>{ | |||
| // this.map.setCenter(new window.TMap.LatLng(this.form.latitude, this.form.longitude)); | |||
| // }) | |||
| } | |||
| }, | |||
| longitude(newVal, oldVal) { | |||
| console.info(`newVal`,newVal,`oldVal`,oldVal) | |||
| if (newVal) { | |||
| this.form.longitude = newVal | |||
| // this.$nextTick(()=>{ | |||
| // this.map.setCenter(new window.TMap.LatLng(this.form.latitude, this.form.longitude)); | |||
| // }) | |||
| } | |||
| } | |||
| }, | |||
| data() { | |||
| return { | |||
| searchValue: '', //地图搜索 | |||
| form: { | |||
| longitude: 116.397128, | |||
| latitude: 39.916527 | |||
| }, | |||
| kwData:[] | |||
| } | |||
| }, | |||
| mounted() { | |||
| let that = this | |||
| if (that.script) return; | |||
| that.script = document.createElement('script'); | |||
| that.script.type = 'text/javascript'; | |||
| that.script.src = `//map.qq.com/api/gljs?v=1.exp&libraries=service&key=DGFBZ-JU76M-34A63-6BU47-2FLJH-XLBCN`; | |||
| document.head.appendChild(that.script); | |||
| that.script.onload = () => { | |||
| window.initMap = that.initMap; | |||
| that.$nextTick(() => { | |||
| that.initMap(); | |||
| }); | |||
| }; | |||
| }, | |||
| methods: { | |||
| // 地图 | |||
| initMap() { | |||
| // 搜索类 | |||
| this.searchEr = new window.TMap.service.Search({ pageSize: 15 }); | |||
| // 地图主类 | |||
| this.map = new window.TMap.Map(this.$refs.map, { | |||
| backgroundColor: '#f7f7f7', | |||
| mapStyleId: 'style1', | |||
| zoom: 14, | |||
| mapTypeControlOptions: { | |||
| mapTypeIds: [], | |||
| }, | |||
| draggableCursor: 'crosshair', | |||
| center: new window.TMap.LatLng(this.form.latitude, this.form.longitude), | |||
| }); | |||
| // 图层类 | |||
| this.markerLayer = new window.TMap.MultiMarker({ | |||
| map: this.map, | |||
| geometries: [], | |||
| }); | |||
| // 地址逆解析 | |||
| this.geocoder = new window.TMap.service.Geocoder(); | |||
| const setMarker = () => { | |||
| const latlng = new window.TMap.LatLng(this.form.latitude, this.form.longitude); | |||
| this.markerLayer.setGeometries([]); | |||
| let geometries = this.markerLayer.getGeometries(); | |||
| geometries.push({ | |||
| id: '-1', | |||
| position: latlng, | |||
| }); | |||
| this.markerLayer.updateGeometries(geometries); | |||
| }; | |||
| this.map.on('click', (e) => { | |||
| this.form.longitude = e.latLng.getLng(); // 经度 | |||
| this.form.latitude = e.latLng.getLat(); // 纬度 | |||
| setMarker(); | |||
| this.getAddressFormat(); | |||
| }); | |||
| if (this.form.longitude) { | |||
| this.map.setCenter(new window.TMap.LatLng(this.form.latitude, this.form.longitude)); | |||
| setMarker(); | |||
| } | |||
| }, | |||
| selectKeyword(event){ | |||
| this.map.setCenter(new window.TMap.LatLng(event.location.lat, event.location.lng)); | |||
| this.kwData = [] | |||
| }, | |||
| // 地图搜索 | |||
| searchAddress(keyword = '') { | |||
| console.log(keyword+"=====") | |||
| if (!keyword) return; | |||
| this.$jsonp('https://apis.map.qq.com/ws/place/v1/suggestion', { | |||
| key: 'DGFBZ-JU76M-34A63-6BU47-2FLJH-XLBCN', | |||
| output: 'jsonp', | |||
| keyword: keyword, | |||
| }).then((res) => { | |||
| console.log(`res`,res) | |||
| if (res.status === 0) { | |||
| this.kwData = res.data | |||
| } else { | |||
| this.kwData = [] | |||
| } | |||
| }).catch((e) => { | |||
| console.log(e) | |||
| }) | |||
| this.markerLayer.setGeometries([]); | |||
| this.searchEr.searchRectangle({ | |||
| keyword, | |||
| bounds: this.map.getBounds(), | |||
| }) | |||
| .then((result) => { | |||
| console.info(`result`,result) | |||
| const { location = {} } = result.data[0] || {}; | |||
| const { lat = 39.916527, lng = 116.397128 } = location; | |||
| this.map.setCenter(new window.TMap.LatLng(lat, lng)); | |||
| result.data.forEach((item, index) => { | |||
| let geometries = this.markerLayer.getGeometries(); | |||
| // 点标注数据数组 | |||
| geometries.push({ | |||
| id: String(index), | |||
| position: item.location, | |||
| }); | |||
| // 绘制地点标注 | |||
| this.markerLayer.updateGeometries(geometries); | |||
| }); | |||
| }); | |||
| }, | |||
| getAddressFormat() { | |||
| const { longitude, latitude } = this.form; | |||
| this.geocoder | |||
| .getAddress({ | |||
| location: new window.TMap.LatLng(latitude, longitude), | |||
| }) | |||
| .then((res) => { | |||
| const { | |||
| formatted_addresses: { recommend = '' }, | |||
| } = res.result || {}; | |||
| this.searchValue = recommend | |||
| this.form.hotelDetailAddress = recommend; | |||
| this.$emit('onLocationSelected', this.form); | |||
| console.log(this.form); | |||
| }); | |||
| }, | |||
| } | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| .map-box { | |||
| position: relative; | |||
| } | |||
| .map-search { | |||
| z-index: 1000; | |||
| display: flex; | |||
| flex-direction: column; | |||
| position: absolute; | |||
| top: 20px; | |||
| left: 20px; | |||
| width: 300px; | |||
| } | |||
| button { | |||
| border-radius: 0; | |||
| } | |||
| .icons { | |||
| display: flex; | |||
| align-items: center; | |||
| justify-content: space-between; | |||
| } | |||
| .time { | |||
| margin-top: 15px; | |||
| width: 100%; | |||
| font-size: 12px; | |||
| flex-wrap: wrap; | |||
| height: 70%; | |||
| } | |||
| ul{ | |||
| background: white; | |||
| list-style-type: none; | |||
| padding-left: 0px; | |||
| height: 280px; | |||
| overflow: scroll; | |||
| } | |||
| li{ | |||
| padding-left: 6px; | |||
| font-size: 10px; | |||
| text-align: left; | |||
| height: 40px; | |||
| line-height: 15px; | |||
| display: flex; | |||
| align-items: center; | |||
| } | |||
| li:hover{ | |||
| cursor: pointer; | |||
| background: #f5f5f5; | |||
| } | |||
| </style> | |||
| @ -0,0 +1,333 @@ | |||
| <template> | |||
| <a-card :bordered="false"> | |||
| <!-- 查询区域 --> | |||
| <div class="table-page-search-wrapper"> | |||
| <a-form layout="inline" @keyup.enter.native="searchQuery"> | |||
| <a-row :gutter="24"> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <a-form-item label="发布用户"> | |||
| <j-search-select-tag placeholder="请选择发布用户" v-model="queryParam.userId" dict="han_hai_member,nick_name,id"/> | |||
| </a-form-item> | |||
| </a-col> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <a-form-item label="所属区域"> | |||
| <j-search-select-tag placeholder="请选择所属区域" v-model="queryParam.addId" dict="city_addr,name,id"/> | |||
| </a-form-item> | |||
| </a-col> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> | |||
| <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> | |||
| <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> | |||
| <a @click="handleToggleSearch" style="margin-left: 8px"> | |||
| {{ toggleSearchStatus ? '收起' : '展开' }} | |||
| <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> | |||
| </a> | |||
| </span> | |||
| </a-col> | |||
| </a-row> | |||
| </a-form> | |||
| </div> | |||
| <!-- 查询区域-END --> | |||
| <!-- 操作按钮区域 --> | |||
| <div class="table-operator"> | |||
| <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> | |||
| <a-button type="primary" icon="download" @click="handleExportXls('租房信息表')">导出</a-button> | |||
| <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | |||
| <a-button type="primary" icon="import">导入</a-button> | |||
| </a-upload> | |||
| <!-- 高级查询区域 --> | |||
| <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> | |||
| <a-dropdown v-if="selectedRowKeys.length > 0"> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> | |||
| </a-menu> | |||
| <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> | |||
| </a-dropdown> | |||
| </div> | |||
| <!-- table区域-begin --> | |||
| <div> | |||
| <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |||
| <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | |||
| <a style="margin-left: 24px" @click="onClearSelected">清空</a> | |||
| </div> | |||
| <a-table | |||
| ref="table" | |||
| size="middle" | |||
| :scroll="{x:true}" | |||
| bordered | |||
| rowKey="id" | |||
| :columns="columns" | |||
| :dataSource="dataSource" | |||
| :pagination="ipagination" | |||
| :loading="loading" | |||
| :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | |||
| class="j-table-force-nowrap" | |||
| @change="handleTableChange"> | |||
| <template slot="htmlSlot" slot-scope="text"> | |||
| <div v-html="text"></div> | |||
| </template> | |||
| <template slot="imgSlot" slot-scope="text,record"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |||
| <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | |||
| </template> | |||
| <template slot="fileSlot" slot-scope="text"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||
| <a-button | |||
| v-else | |||
| :ghost="true" | |||
| type="primary" | |||
| icon="download" | |||
| size="small" | |||
| @click="downloadFile(text)"> | |||
| 下载 | |||
| </a-button> | |||
| </template> | |||
| <span slot="action" slot-scope="text, record"> | |||
| <a @click="handleEdit(record)">编辑</a> | |||
| <a-divider type="vertical" /> | |||
| <a-dropdown> | |||
| <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item> | |||
| <a @click="handleDetail(record)">详情</a> | |||
| </a-menu-item> | |||
| <a-menu-item> | |||
| <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |||
| <a>删除</a> | |||
| </a-popconfirm> | |||
| </a-menu-item> | |||
| </a-menu> | |||
| </a-dropdown> | |||
| </span> | |||
| </a-table> | |||
| </div> | |||
| <city-home-modal ref="modalForm" @ok="modalFormOk"></city-home-modal> | |||
| </a-card> | |||
| </template> | |||
| <script> | |||
| import '@/assets/less/TableExpand.less' | |||
| import { mixinDevice } from '@/utils/mixin' | |||
| import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |||
| import CityHomeModal from './modules/CityHomeModal' | |||
| import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' | |||
| export default { | |||
| name: 'CityHomeList', | |||
| mixins:[JeecgListMixin, mixinDevice], | |||
| components: { | |||
| CityHomeModal | |||
| }, | |||
| data () { | |||
| return { | |||
| description: '租房信息表管理页面', | |||
| // 表头 | |||
| columns: [ | |||
| { | |||
| title: '#', | |||
| dataIndex: '', | |||
| key:'rowIndex', | |||
| width:60, | |||
| align:"center", | |||
| customRender:function (t,r,index) { | |||
| return parseInt(index)+1; | |||
| } | |||
| }, | |||
| { | |||
| title:'创建日期', | |||
| align:"center", | |||
| sorter: true, | |||
| dataIndex: 'createTime' | |||
| }, | |||
| { | |||
| title:'发布用户', | |||
| align:"center", | |||
| dataIndex: 'userId_dictText' | |||
| }, | |||
| { | |||
| title:'所属区域', | |||
| align:"center", | |||
| dataIndex: 'addId_dictText' | |||
| }, | |||
| { | |||
| title:'标题', | |||
| align:"center", | |||
| dataIndex: 'title' | |||
| }, | |||
| { | |||
| title:'备注', | |||
| align:"center", | |||
| dataIndex: 'titleSub' | |||
| }, | |||
| { | |||
| title:'图片', | |||
| align:"center", | |||
| dataIndex: 'image', | |||
| scopedSlots: {customRender: 'imgSlot'} | |||
| }, | |||
| { | |||
| title:'租金', | |||
| align:"center", | |||
| dataIndex: 'money' | |||
| }, | |||
| { | |||
| title:'面积', | |||
| align:"center", | |||
| dataIndex: 'crm' | |||
| }, | |||
| { | |||
| title:'楼层', | |||
| align:"center", | |||
| dataIndex: 'floor' | |||
| }, | |||
| { | |||
| title:'朝向', | |||
| align:"center", | |||
| dataIndex: 'face' | |||
| }, | |||
| { | |||
| title:'装修', | |||
| align:"center", | |||
| dataIndex: 'decoration' | |||
| }, | |||
| { | |||
| title:'付款', | |||
| align:"center", | |||
| dataIndex: 'payment' | |||
| }, | |||
| { | |||
| title:'电梯', | |||
| align:"center", | |||
| dataIndex: 'lift' | |||
| }, | |||
| { | |||
| title:'交付', | |||
| align:"center", | |||
| dataIndex: 'deliver' | |||
| }, | |||
| { | |||
| title:'看房', | |||
| align:"center", | |||
| dataIndex: 'showings' | |||
| }, | |||
| { | |||
| title:'电话', | |||
| align:"center", | |||
| dataIndex: 'phone' | |||
| }, | |||
| { | |||
| title:'地址', | |||
| align:"center", | |||
| dataIndex: 'address' | |||
| }, | |||
| { | |||
| title:'浏览量', | |||
| align:"center", | |||
| dataIndex: 'num' | |||
| }, | |||
| { | |||
| title:'经度', | |||
| align:"center", | |||
| dataIndex: 'longitude' | |||
| }, | |||
| { | |||
| title:'纬度', | |||
| align:"center", | |||
| dataIndex: 'latitude' | |||
| }, | |||
| { | |||
| title:'一室一卫', | |||
| align:"center", | |||
| dataIndex: 'home' | |||
| }, | |||
| { | |||
| title:'优选', | |||
| align:"center", | |||
| dataIndex: 'isGood' | |||
| }, | |||
| { | |||
| title:'低价', | |||
| align:"center", | |||
| dataIndex: 'isMinPrice' | |||
| }, | |||
| { | |||
| title:'发布人头像', | |||
| align:"center", | |||
| dataIndex: 'headImage', | |||
| scopedSlots: {customRender: 'fileSlot'} | |||
| }, | |||
| { | |||
| title: '操作', | |||
| dataIndex: 'action', | |||
| align:"center", | |||
| fixed:"right", | |||
| width:147, | |||
| scopedSlots: { customRender: 'action' } | |||
| } | |||
| ], | |||
| url: { | |||
| list: "/cityHome/cityHome/list", | |||
| delete: "/cityHome/cityHome/delete", | |||
| deleteBatch: "/cityHome/cityHome/deleteBatch", | |||
| exportXlsUrl: "/cityHome/cityHome/exportXls", | |||
| importExcelUrl: "cityHome/cityHome/importExcel", | |||
| }, | |||
| dictOptions:{}, | |||
| superFieldList:[], | |||
| } | |||
| }, | |||
| created() { | |||
| this.getSuperFieldList(); | |||
| }, | |||
| computed: { | |||
| importExcelUrl: function(){ | |||
| return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |||
| }, | |||
| }, | |||
| methods: { | |||
| initDictConfig(){ | |||
| }, | |||
| getSuperFieldList(){ | |||
| let fieldList=[]; | |||
| fieldList.push({type:'datetime',value:'createTime',text:'创建日期'}) | |||
| fieldList.push({type:'sel_search',value:'userId',text:'发布用户',dictTable:"han_hai_member", dictText:'nick_name', dictCode:'id'}) | |||
| fieldList.push({type:'sel_search',value:'addId',text:'所属区域',dictTable:"city_addr", dictText:'name', dictCode:'id'}) | |||
| fieldList.push({type:'string',value:'title',text:'标题',dictCode:''}) | |||
| fieldList.push({type:'string',value:'titleSub',text:'备注',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'image',text:'图片',dictCode:''}) | |||
| fieldList.push({type:'string',value:'money',text:'租金',dictCode:''}) | |||
| fieldList.push({type:'string',value:'crm',text:'面积',dictCode:''}) | |||
| fieldList.push({type:'string',value:'floor',text:'楼层',dictCode:''}) | |||
| fieldList.push({type:'string',value:'face',text:'朝向',dictCode:''}) | |||
| fieldList.push({type:'string',value:'decoration',text:'装修',dictCode:''}) | |||
| fieldList.push({type:'string',value:'payment',text:'付款',dictCode:''}) | |||
| fieldList.push({type:'string',value:'lift',text:'电梯',dictCode:''}) | |||
| fieldList.push({type:'string',value:'deliver',text:'交付',dictCode:''}) | |||
| fieldList.push({type:'string',value:'showings',text:'看房',dictCode:''}) | |||
| fieldList.push({type:'string',value:'phone',text:'电话',dictCode:''}) | |||
| fieldList.push({type:'string',value:'address',text:'地址',dictCode:''}) | |||
| fieldList.push({type:'string',value:'num',text:'浏览量',dictCode:''}) | |||
| fieldList.push({type:'string',value:'longitude',text:'经度',dictCode:''}) | |||
| fieldList.push({type:'string',value:'latitude',text:'纬度',dictCode:''}) | |||
| fieldList.push({type:'string',value:'home',text:'一室一卫',dictCode:''}) | |||
| fieldList.push({type:'string',value:'isGood',text:'优选',dictCode:''}) | |||
| fieldList.push({type:'string',value:'isMinPrice',text:'低价',dictCode:''}) | |||
| fieldList.push({type:'string',value:'headImage',text:'发布人头像',dictCode:''}) | |||
| this.superFieldList = fieldList | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| @import '~@assets/less/common.less'; | |||
| </style> | |||
| @ -0,0 +1,214 @@ | |||
| <template> | |||
| <a-spin :spinning="confirmLoading"> | |||
| <j-form-container :disabled="formDisabled"> | |||
| <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> | |||
| <a-row> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="发布用户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId"> | |||
| <j-search-select-tag v-model="model.userId" dict="han_hai_member,nick_name,id" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="所属区域" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="addId"> | |||
| <j-search-select-tag v-model="model.addId" dict="city_addr,name,id" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="title"> | |||
| <a-input v-model="model.title" placeholder="请输入标题" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="titleSub"> | |||
| <a-textarea v-model="model.titleSub" rows="4" placeholder="请输入备注" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="image"> | |||
| <j-image-upload isMultiple v-model="model.image" ></j-image-upload> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="租金" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="money"> | |||
| <a-input v-model="model.money" placeholder="请输入租金" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="面积" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="crm"> | |||
| <a-input v-model="model.crm" placeholder="请输入面积" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="楼层" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="floor"> | |||
| <a-input v-model="model.floor" placeholder="请输入楼层" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="朝向" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="face"> | |||
| <a-input v-model="model.face" placeholder="请输入朝向" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="装修" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="decoration"> | |||
| <a-input v-model="model.decoration" placeholder="请输入装修" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="付款" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="payment"> | |||
| <a-input v-model="model.payment" placeholder="请输入付款" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="电梯" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lift"> | |||
| <a-input v-model="model.lift" placeholder="请输入电梯" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="交付" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliver"> | |||
| <a-input v-model="model.deliver" placeholder="请输入交付" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="看房" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="showings"> | |||
| <a-input v-model="model.showings" placeholder="请输入看房" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="phone"> | |||
| <a-input v-model="model.phone" placeholder="请输入电话" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address"> | |||
| <a-textarea v-model="model.address" rows="4" placeholder="请输入地址" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="浏览量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num"> | |||
| <a-input v-model="model.num" placeholder="请输入浏览量" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="经度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="longitude"> | |||
| <a-input v-model="model.longitude" placeholder="请输入经度" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="纬度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="latitude"> | |||
| <a-input v-model="model.latitude" placeholder="请输入纬度" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="一室一卫" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="home"> | |||
| <a-input v-model="model.home" placeholder="请输入一室一卫" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="优选" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isGood"> | |||
| <a-input v-model="model.isGood" placeholder="请输入优选" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="低价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isMinPrice"> | |||
| <a-input v-model="model.isMinPrice" placeholder="请输入低价" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="发布人头像" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="headImage"> | |||
| <j-upload v-model="model.headImage" ></j-upload> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| </a-row> | |||
| </a-form-model> | |||
| </j-form-container> | |||
| </a-spin> | |||
| </template> | |||
| <script> | |||
| import { httpAction, getAction } from '@/api/manage' | |||
| import { validateDuplicateValue } from '@/utils/util' | |||
| export default { | |||
| name: 'CityHomeForm', | |||
| components: { | |||
| }, | |||
| props: { | |||
| //表单禁用 | |||
| disabled: { | |||
| type: Boolean, | |||
| default: false, | |||
| required: false | |||
| } | |||
| }, | |||
| data () { | |||
| return { | |||
| model:{ | |||
| }, | |||
| labelCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 5 }, | |||
| }, | |||
| wrapperCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 16 }, | |||
| }, | |||
| confirmLoading: false, | |||
| validatorRules: { | |||
| }, | |||
| url: { | |||
| add: "/cityHome/cityHome/add", | |||
| edit: "/cityHome/cityHome/edit", | |||
| queryById: "/cityHome/cityHome/queryById" | |||
| } | |||
| } | |||
| }, | |||
| computed: { | |||
| formDisabled(){ | |||
| return this.disabled | |||
| }, | |||
| }, | |||
| created () { | |||
| //备份model原始值 | |||
| this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.edit(this.modelDefault); | |||
| }, | |||
| edit (record) { | |||
| this.model = Object.assign({}, record); | |||
| this.visible = true; | |||
| }, | |||
| submitForm () { | |||
| const that = this; | |||
| // 触发表单验证 | |||
| this.$refs.form.validate(valid => { | |||
| if (valid) { | |||
| that.confirmLoading = true; | |||
| let httpurl = ''; | |||
| let method = ''; | |||
| if(!this.model.id){ | |||
| httpurl+=this.url.add; | |||
| method = 'post'; | |||
| }else{ | |||
| httpurl+=this.url.edit; | |||
| method = 'put'; | |||
| } | |||
| httpAction(httpurl,this.model,method).then((res)=>{ | |||
| if(res.success){ | |||
| that.$message.success(res.message); | |||
| that.$emit('ok'); | |||
| }else{ | |||
| that.$message.warning(res.message); | |||
| } | |||
| }).finally(() => { | |||
| that.confirmLoading = false; | |||
| }) | |||
| } | |||
| }) | |||
| }, | |||
| } | |||
| } | |||
| </script> | |||
| @ -0,0 +1,84 @@ | |||
| <template> | |||
| <a-drawer | |||
| :title="title" | |||
| :width="width" | |||
| placement="right" | |||
| :closable="false" | |||
| @close="close" | |||
| destroyOnClose | |||
| :visible="visible"> | |||
| <city-home-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></city-home-form> | |||
| <div class="drawer-footer"> | |||
| <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> | |||
| <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> | |||
| </div> | |||
| </a-drawer> | |||
| </template> | |||
| <script> | |||
| import CityHomeForm from './CityHomeForm' | |||
| export default { | |||
| name: 'CityHomeModal', | |||
| components: { | |||
| CityHomeForm | |||
| }, | |||
| data () { | |||
| return { | |||
| title:"操作", | |||
| width:800, | |||
| visible: false, | |||
| disableSubmit: false | |||
| } | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.add(); | |||
| }) | |||
| }, | |||
| edit (record) { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.edit(record); | |||
| }); | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| }, | |||
| submitCallback(){ | |||
| this.$emit('ok'); | |||
| this.visible = false; | |||
| }, | |||
| handleOk () { | |||
| this.$refs.realForm.submitForm(); | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style lang="less" scoped> | |||
| /** Button按钮间距 */ | |||
| .ant-btn { | |||
| margin-left: 30px; | |||
| margin-bottom: 30px; | |||
| float: right; | |||
| } | |||
| .drawer-footer{ | |||
| position: absolute; | |||
| bottom: -8px; | |||
| width: 100%; | |||
| border-top: 1px solid #e8e8e8; | |||
| padding: 10px 16px; | |||
| text-align: right; | |||
| left: 0; | |||
| background: #fff; | |||
| border-radius: 0 0 2px 2px; | |||
| } | |||
| </style> | |||
| @ -0,0 +1,60 @@ | |||
| <template> | |||
| <j-modal | |||
| :title="title" | |||
| :width="width" | |||
| :visible="visible" | |||
| switchFullscreen | |||
| @ok="handleOk" | |||
| :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" | |||
| @cancel="handleCancel" | |||
| cancelText="关闭"> | |||
| <city-home-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></city-home-form> | |||
| </j-modal> | |||
| </template> | |||
| <script> | |||
| import CityHomeForm from './CityHomeForm' | |||
| export default { | |||
| name: 'CityHomeModal', | |||
| components: { | |||
| CityHomeForm | |||
| }, | |||
| data () { | |||
| return { | |||
| title:'', | |||
| width:800, | |||
| visible: false, | |||
| disableSubmit: false | |||
| } | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.add(); | |||
| }) | |||
| }, | |||
| edit (record) { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.edit(record); | |||
| }) | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| }, | |||
| handleOk () { | |||
| this.$refs.realForm.submitForm(); | |||
| }, | |||
| submitCallback(){ | |||
| this.$emit('ok'); | |||
| this.visible = false; | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| @ -0,0 +1,254 @@ | |||
| <template> | |||
| <a-card :bordered="false"> | |||
| <!-- 查询区域 --> | |||
| <div class="table-page-search-wrapper"> | |||
| <a-form layout="inline" @keyup.enter.native="searchQuery"> | |||
| <a-row :gutter="24"> | |||
| </a-row> | |||
| </a-form> | |||
| </div> | |||
| <!-- 查询区域-END --> | |||
| <!-- 操作按钮区域 --> | |||
| <div class="table-operator"> | |||
| <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> | |||
| <a-button type="primary" icon="download" @click="handleExportXls('工作信息表')">导出</a-button> | |||
| <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | |||
| <a-button type="primary" icon="import">导入</a-button> | |||
| </a-upload> | |||
| <!-- 高级查询区域 --> | |||
| <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> | |||
| <a-dropdown v-if="selectedRowKeys.length > 0"> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> | |||
| </a-menu> | |||
| <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> | |||
| </a-dropdown> | |||
| </div> | |||
| <!-- table区域-begin --> | |||
| <div> | |||
| <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |||
| <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | |||
| <a style="margin-left: 24px" @click="onClearSelected">清空</a> | |||
| </div> | |||
| <a-table | |||
| ref="table" | |||
| size="middle" | |||
| :scroll="{x:true}" | |||
| bordered | |||
| rowKey="id" | |||
| :columns="columns" | |||
| :dataSource="dataSource" | |||
| :pagination="ipagination" | |||
| :loading="loading" | |||
| :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | |||
| class="j-table-force-nowrap" | |||
| @change="handleTableChange"> | |||
| <template slot="htmlSlot" slot-scope="text"> | |||
| <div v-html="text"></div> | |||
| </template> | |||
| <template slot="imgSlot" slot-scope="text,record"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |||
| <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | |||
| </template> | |||
| <template slot="fileSlot" slot-scope="text"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||
| <a-button | |||
| v-else | |||
| :ghost="true" | |||
| type="primary" | |||
| icon="download" | |||
| size="small" | |||
| @click="downloadFile(text)"> | |||
| 下载 | |||
| </a-button> | |||
| </template> | |||
| <span slot="action" slot-scope="text, record"> | |||
| <a @click="handleEdit(record)">编辑</a> | |||
| <a-divider type="vertical" /> | |||
| <a-dropdown> | |||
| <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item> | |||
| <a @click="handleDetail(record)">详情</a> | |||
| </a-menu-item> | |||
| <a-menu-item> | |||
| <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |||
| <a>删除</a> | |||
| </a-popconfirm> | |||
| </a-menu-item> | |||
| </a-menu> | |||
| </a-dropdown> | |||
| </span> | |||
| </a-table> | |||
| </div> | |||
| <city-job-modal ref="modalForm" @ok="modalFormOk"></city-job-modal> | |||
| </a-card> | |||
| </template> | |||
| <script> | |||
| import '@/assets/less/TableExpand.less' | |||
| import { mixinDevice } from '@/utils/mixin' | |||
| import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |||
| import CityJobModal from './modules/CityJobModal' | |||
| import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' | |||
| export default { | |||
| name: 'CityJobList', | |||
| mixins:[JeecgListMixin, mixinDevice], | |||
| components: { | |||
| CityJobModal | |||
| }, | |||
| data () { | |||
| return { | |||
| description: '工作信息表管理页面', | |||
| // 表头 | |||
| columns: [ | |||
| { | |||
| title: '#', | |||
| dataIndex: '', | |||
| key:'rowIndex', | |||
| width:60, | |||
| align:"center", | |||
| customRender:function (t,r,index) { | |||
| return parseInt(index)+1; | |||
| } | |||
| }, | |||
| { | |||
| title:'标题', | |||
| align:"center", | |||
| dataIndex: 'title' | |||
| }, | |||
| { | |||
| title:'发布人', | |||
| align:"center", | |||
| dataIndex: 'userId_dictText' | |||
| }, | |||
| { | |||
| title:'工资', | |||
| align:"center", | |||
| dataIndex: 'minPrice' | |||
| }, | |||
| { | |||
| title:'地址', | |||
| align:"center", | |||
| dataIndex: 'address' | |||
| }, | |||
| { | |||
| title:'经度', | |||
| align:"center", | |||
| dataIndex: 'latitude' | |||
| }, | |||
| { | |||
| title:'纬度', | |||
| align:"center", | |||
| dataIndex: 'longitude' | |||
| }, | |||
| { | |||
| title:'工作年限', | |||
| align:"center", | |||
| dataIndex: 'workYear' | |||
| }, | |||
| { | |||
| title:'标签列表', | |||
| align:"center", | |||
| dataIndex: 'iconText' | |||
| }, | |||
| { | |||
| title:'联系人', | |||
| align:"center", | |||
| dataIndex: 'userName' | |||
| }, | |||
| { | |||
| title:'联系电话', | |||
| align:"center", | |||
| dataIndex: 'userPhone' | |||
| }, | |||
| { | |||
| title:'职位描述', | |||
| align:"center", | |||
| dataIndex: 'jobContext' | |||
| }, | |||
| { | |||
| title:'招聘公司', | |||
| align:"center", | |||
| dataIndex: 'company' | |||
| }, | |||
| { | |||
| title:'认证情况', | |||
| align:"center", | |||
| dataIndex: 'isCardOpen' | |||
| }, | |||
| { | |||
| title:'所属乡镇', | |||
| align:"center", | |||
| dataIndex: 'city_dictText' | |||
| }, | |||
| { | |||
| title: '操作', | |||
| dataIndex: 'action', | |||
| align:"center", | |||
| fixed:"right", | |||
| width:147, | |||
| scopedSlots: { customRender: 'action' } | |||
| } | |||
| ], | |||
| url: { | |||
| list: "/cityJob/cityJob/list", | |||
| delete: "/cityJob/cityJob/delete", | |||
| deleteBatch: "/cityJob/cityJob/deleteBatch", | |||
| exportXlsUrl: "/cityJob/cityJob/exportXls", | |||
| importExcelUrl: "cityJob/cityJob/importExcel", | |||
| }, | |||
| dictOptions:{}, | |||
| superFieldList:[], | |||
| } | |||
| }, | |||
| created() { | |||
| this.getSuperFieldList(); | |||
| }, | |||
| computed: { | |||
| importExcelUrl: function(){ | |||
| return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |||
| }, | |||
| }, | |||
| methods: { | |||
| initDictConfig(){ | |||
| }, | |||
| getSuperFieldList(){ | |||
| let fieldList=[]; | |||
| fieldList.push({type:'string',value:'title',text:'标题',dictCode:''}) | |||
| fieldList.push({type:'sel_search',value:'userId',text:'发布人',dictTable:"han_hai_member", dictText:'nick_name', dictCode:'id'}) | |||
| fieldList.push({type:'Text',value:'minPrice',text:'工资',dictCode:''}) | |||
| fieldList.push({type:'string',value:'address',text:'地址',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'school',text:'招聘要求',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'jobDetails',text:'岗位详情',dictCode:''}) | |||
| fieldList.push({type:'string',value:'latitude',text:'经度',dictCode:''}) | |||
| fieldList.push({type:'string',value:'longitude',text:'纬度',dictCode:''}) | |||
| fieldList.push({type:'string',value:'workYear',text:'工作年限',dictCode:''}) | |||
| fieldList.push({type:'string',value:'iconText',text:'标签列表',dictCode:''}) | |||
| fieldList.push({type:'string',value:'userName',text:'联系人',dictCode:''}) | |||
| fieldList.push({type:'string',value:'userPhone',text:'联系电话',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'jobContext',text:'职位描述',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'gsContext',text:'公司介绍',dictCode:''}) | |||
| fieldList.push({type:'string',value:'company',text:'招聘公司',dictCode:''}) | |||
| fieldList.push({type:'string',value:'isCardOpen',text:'认证情况',dictCode:''}) | |||
| fieldList.push({type:'string',value:'iconTitle',text:'假日福利',dictCode:''}) | |||
| fieldList.push({type:'sel_search',value:'city',text:'所属乡镇',dictTable:"city_addr", dictText:'name', dictCode:'id'}) | |||
| this.superFieldList = fieldList | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| @import '~@assets/less/common.less'; | |||
| </style> | |||
| @ -0,0 +1,189 @@ | |||
| <template> | |||
| <a-spin :spinning="confirmLoading"> | |||
| <j-form-container :disabled="formDisabled"> | |||
| <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> | |||
| <a-row> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="title"> | |||
| <a-input v-model="model.title" placeholder="请输入标题" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="发布人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId"> | |||
| <j-search-select-tag v-model="model.userId" dict="han_hai_member,nick_name,id" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="工资" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="minPrice"> | |||
| <a-input v-model="model.minPrice" placeholder="请输入工资" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address"> | |||
| <a-input v-model="model.address" placeholder="请输入地址" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="招聘要求" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="school"> | |||
| <a-textarea v-model="model.school" rows="4" placeholder="请输入招聘要求" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="岗位详情" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jobDetails"> | |||
| <a-textarea v-model="model.jobDetails" rows="4" placeholder="请输入岗位详情" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="经度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="latitude"> | |||
| <a-input v-model="model.latitude" placeholder="请输入经度" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="纬度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="longitude"> | |||
| <a-input v-model="model.longitude" placeholder="请输入纬度" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="工作年限" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workYear"> | |||
| <a-input v-model="model.workYear" placeholder="请输入工作年限" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="标签列表" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="iconText"> | |||
| <a-input v-model="model.iconText" placeholder="请输入标签列表" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="联系人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userName"> | |||
| <a-input v-model="model.userName" placeholder="请输入联系人" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userPhone"> | |||
| <a-input v-model="model.userPhone" placeholder="请输入联系电话" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="职位描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jobContext"> | |||
| <a-textarea v-model="model.jobContext" rows="4" placeholder="请输入职位描述" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="公司介绍" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="gsContext"> | |||
| <a-textarea v-model="model.gsContext" rows="4" placeholder="请输入公司介绍" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="招聘公司" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="company"> | |||
| <a-input v-model="model.company" placeholder="请输入招聘公司" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="认证情况" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isCardOpen"> | |||
| <a-input v-model="model.isCardOpen" placeholder="请输入认证情况" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="假日福利" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="iconTitle"> | |||
| <a-input v-model="model.iconTitle" placeholder="请输入假日福利" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="所属乡镇" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="city"> | |||
| <j-search-select-tag v-model="model.city" dict="city_addr,name,id" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| </a-row> | |||
| </a-form-model> | |||
| </j-form-container> | |||
| </a-spin> | |||
| </template> | |||
| <script> | |||
| import { httpAction, getAction } from '@/api/manage' | |||
| import { validateDuplicateValue } from '@/utils/util' | |||
| export default { | |||
| name: 'CityJobForm', | |||
| components: { | |||
| }, | |||
| props: { | |||
| //表单禁用 | |||
| disabled: { | |||
| type: Boolean, | |||
| default: false, | |||
| required: false | |||
| } | |||
| }, | |||
| data () { | |||
| return { | |||
| model:{ | |||
| }, | |||
| labelCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 5 }, | |||
| }, | |||
| wrapperCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 16 }, | |||
| }, | |||
| confirmLoading: false, | |||
| validatorRules: { | |||
| }, | |||
| url: { | |||
| add: "/cityJob/cityJob/add", | |||
| edit: "/cityJob/cityJob/edit", | |||
| queryById: "/cityJob/cityJob/queryById" | |||
| } | |||
| } | |||
| }, | |||
| computed: { | |||
| formDisabled(){ | |||
| return this.disabled | |||
| }, | |||
| }, | |||
| created () { | |||
| //备份model原始值 | |||
| this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.edit(this.modelDefault); | |||
| }, | |||
| edit (record) { | |||
| this.model = Object.assign({}, record); | |||
| this.visible = true; | |||
| }, | |||
| submitForm () { | |||
| const that = this; | |||
| // 触发表单验证 | |||
| this.$refs.form.validate(valid => { | |||
| if (valid) { | |||
| that.confirmLoading = true; | |||
| let httpurl = ''; | |||
| let method = ''; | |||
| if(!this.model.id){ | |||
| httpurl+=this.url.add; | |||
| method = 'post'; | |||
| }else{ | |||
| httpurl+=this.url.edit; | |||
| method = 'put'; | |||
| } | |||
| httpAction(httpurl,this.model,method).then((res)=>{ | |||
| if(res.success){ | |||
| that.$message.success(res.message); | |||
| that.$emit('ok'); | |||
| }else{ | |||
| that.$message.warning(res.message); | |||
| } | |||
| }).finally(() => { | |||
| that.confirmLoading = false; | |||
| }) | |||
| } | |||
| }) | |||
| }, | |||
| } | |||
| } | |||
| </script> | |||
| @ -0,0 +1,84 @@ | |||
| <template> | |||
| <a-drawer | |||
| :title="title" | |||
| :width="width" | |||
| placement="right" | |||
| :closable="false" | |||
| @close="close" | |||
| destroyOnClose | |||
| :visible="visible"> | |||
| <city-job-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></city-job-form> | |||
| <div class="drawer-footer"> | |||
| <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> | |||
| <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> | |||
| </div> | |||
| </a-drawer> | |||
| </template> | |||
| <script> | |||
| import CityJobForm from './CityJobForm' | |||
| export default { | |||
| name: 'CityJobModal', | |||
| components: { | |||
| CityJobForm | |||
| }, | |||
| data () { | |||
| return { | |||
| title:"操作", | |||
| width:800, | |||
| visible: false, | |||
| disableSubmit: false | |||
| } | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.add(); | |||
| }) | |||
| }, | |||
| edit (record) { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.edit(record); | |||
| }); | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| }, | |||
| submitCallback(){ | |||
| this.$emit('ok'); | |||
| this.visible = false; | |||
| }, | |||
| handleOk () { | |||
| this.$refs.realForm.submitForm(); | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style lang="less" scoped> | |||
| /** Button按钮间距 */ | |||
| .ant-btn { | |||
| margin-left: 30px; | |||
| margin-bottom: 30px; | |||
| float: right; | |||
| } | |||
| .drawer-footer{ | |||
| position: absolute; | |||
| bottom: -8px; | |||
| width: 100%; | |||
| border-top: 1px solid #e8e8e8; | |||
| padding: 10px 16px; | |||
| text-align: right; | |||
| left: 0; | |||
| background: #fff; | |||
| border-radius: 0 0 2px 2px; | |||
| } | |||
| </style> | |||
| @ -0,0 +1,60 @@ | |||
| <template> | |||
| <j-modal | |||
| :title="title" | |||
| :width="width" | |||
| :visible="visible" | |||
| switchFullscreen | |||
| @ok="handleOk" | |||
| :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" | |||
| @cancel="handleCancel" | |||
| cancelText="关闭"> | |||
| <city-job-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></city-job-form> | |||
| </j-modal> | |||
| </template> | |||
| <script> | |||
| import CityJobForm from './CityJobForm' | |||
| export default { | |||
| name: 'CityJobModal', | |||
| components: { | |||
| CityJobForm | |||
| }, | |||
| data () { | |||
| return { | |||
| title:'', | |||
| width:800, | |||
| visible: false, | |||
| disableSubmit: false | |||
| } | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.add(); | |||
| }) | |||
| }, | |||
| edit (record) { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.edit(record); | |||
| }) | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| }, | |||
| handleOk () { | |||
| this.$refs.realForm.submitForm(); | |||
| }, | |||
| submitCallback(){ | |||
| this.$emit('ok'); | |||
| this.visible = false; | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| @ -0,0 +1,340 @@ | |||
| <template> | |||
| <a-card :bordered="false"> | |||
| <!-- 查询区域 --> | |||
| <div class="table-page-search-wrapper"> | |||
| <a-form layout="inline" @keyup.enter.native="searchQuery"> | |||
| <a-row :gutter="24"> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <a-form-item label="商户名称"> | |||
| <a-input placeholder="请输入商户名称" v-model="queryParam.title"></a-input> | |||
| </a-form-item> | |||
| </a-col> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <a-form-item label="商户地址"> | |||
| <a-input placeholder="请输入商户地址" v-model="queryParam.address"></a-input> | |||
| </a-form-item> | |||
| </a-col> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> | |||
| <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> | |||
| <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> | |||
| <a @click="handleToggleSearch" style="margin-left: 8px"> | |||
| {{ toggleSearchStatus ? '收起' : '展开' }} | |||
| <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> | |||
| </a> | |||
| </span> | |||
| </a-col> | |||
| </a-row> | |||
| </a-form> | |||
| </div> | |||
| <!-- 查询区域-END --> | |||
| <!-- 操作按钮区域 --> | |||
| <div class="table-operator"> | |||
| <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> | |||
| <a-button type="primary" icon="download" @click="handleExportXls('商铺信息表')">导出</a-button> | |||
| <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | |||
| <a-button type="primary" icon="import">导入</a-button> | |||
| </a-upload> | |||
| <!-- 高级查询区域 --> | |||
| <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> | |||
| <a-dropdown v-if="selectedRowKeys.length > 0"> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> | |||
| </a-menu> | |||
| <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> | |||
| </a-dropdown> | |||
| </div> | |||
| <!-- table区域-begin --> | |||
| <div> | |||
| <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |||
| <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | |||
| <a style="margin-left: 24px" @click="onClearSelected">清空</a> | |||
| </div> | |||
| <a-table | |||
| ref="table" | |||
| size="middle" | |||
| :scroll="{x:true}" | |||
| bordered | |||
| rowKey="id" | |||
| :columns="columns" | |||
| :dataSource="dataSource" | |||
| :pagination="ipagination" | |||
| :loading="loading" | |||
| :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | |||
| class="j-table-force-nowrap" | |||
| @change="handleTableChange"> | |||
| <template slot="htmlSlot" slot-scope="text"> | |||
| <div v-html="text"></div> | |||
| </template> | |||
| <template slot="imgSlot" slot-scope="text,record"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |||
| <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | |||
| </template> | |||
| <template slot="fileSlot" slot-scope="text"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||
| <a-button | |||
| v-else | |||
| :ghost="true" | |||
| type="primary" | |||
| icon="download" | |||
| size="small" | |||
| @click="downloadFile(text)"> | |||
| 下载 | |||
| </a-button> | |||
| </template> | |||
| <span slot="action" slot-scope="text, record"> | |||
| <a @click="handleEdit(record)">编辑</a> | |||
| <a-divider type="vertical" /> | |||
| <a-dropdown> | |||
| <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item> | |||
| <a @click="handleDetail(record)">详情</a> | |||
| </a-menu-item> | |||
| <a-menu-item> | |||
| <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |||
| <a>删除</a> | |||
| </a-popconfirm> | |||
| </a-menu-item> | |||
| </a-menu> | |||
| </a-dropdown> | |||
| </span> | |||
| </a-table> | |||
| </div> | |||
| <city-shop-modal ref="modalForm" @ok="modalFormOk"></city-shop-modal> | |||
| </a-card> | |||
| </template> | |||
| <script> | |||
| import '@/assets/less/TableExpand.less' | |||
| import { mixinDevice } from '@/utils/mixin' | |||
| import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |||
| import CityShopModal from './modules/CityShopModal' | |||
| import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' | |||
| export default { | |||
| name: 'CityShopList', | |||
| mixins:[JeecgListMixin, mixinDevice], | |||
| components: { | |||
| CityShopModal | |||
| }, | |||
| data () { | |||
| return { | |||
| description: '商铺信息表管理页面', | |||
| // 表头 | |||
| columns: [ | |||
| { | |||
| title: '#', | |||
| dataIndex: '', | |||
| key:'rowIndex', | |||
| width:60, | |||
| align:"center", | |||
| customRender:function (t,r,index) { | |||
| return parseInt(index)+1; | |||
| } | |||
| }, | |||
| { | |||
| title:'创建日期', | |||
| align:"center", | |||
| sorter: true, | |||
| dataIndex: 'createTime' | |||
| }, | |||
| { | |||
| title:'商户名称', | |||
| align:"center", | |||
| dataIndex: 'title' | |||
| }, | |||
| { | |||
| title:'商户门头', | |||
| align:"center", | |||
| dataIndex: 'image', | |||
| scopedSlots: {customRender: 'imgSlot'} | |||
| }, | |||
| { | |||
| title:'商户LOGO', | |||
| align:"center", | |||
| dataIndex: 'logoImage', | |||
| scopedSlots: {customRender: 'imgSlot'} | |||
| }, | |||
| { | |||
| title:'商户简介', | |||
| align:"center", | |||
| dataIndex: 'titleSub' | |||
| }, | |||
| { | |||
| title:'商户标签', | |||
| align:"center", | |||
| dataIndex: 'iconSub' | |||
| }, | |||
| { | |||
| title:'营业时间', | |||
| align:"center", | |||
| dataIndex: 'workTime' | |||
| }, | |||
| { | |||
| title:'商户地址', | |||
| align:"center", | |||
| dataIndex: 'address' | |||
| }, | |||
| { | |||
| title:'商户介绍', | |||
| align:"center", | |||
| dataIndex: 'details' | |||
| }, | |||
| { | |||
| title:'商户图片', | |||
| align:"center", | |||
| dataIndex: 'detailsImage', | |||
| scopedSlots: {customRender: 'imgSlot'} | |||
| }, | |||
| { | |||
| title:'排序', | |||
| align:"center", | |||
| dataIndex: 'sort' | |||
| }, | |||
| { | |||
| title:'浏览量', | |||
| align:"center", | |||
| dataIndex: 'isBrowse' | |||
| }, | |||
| { | |||
| title:'评论量', | |||
| align:"center", | |||
| dataIndex: 'isComment' | |||
| }, | |||
| { | |||
| title:'经度', | |||
| align:"center", | |||
| dataIndex: 'longitude' | |||
| }, | |||
| { | |||
| title:'纬度', | |||
| align:"center", | |||
| dataIndex: 'latitude' | |||
| }, | |||
| { | |||
| title:'是否营业', | |||
| align:"center", | |||
| dataIndex: 'isOpen', | |||
| customRender: (text) => (text ? filterMultiDictText(this.dictOptions['isOpen'], text) : ''), | |||
| }, | |||
| { | |||
| title:'关联店主', | |||
| align:"center", | |||
| dataIndex: 'shopUser_dictText' | |||
| }, | |||
| { | |||
| title:'店主姓名', | |||
| align:"center", | |||
| dataIndex: 'shopName' | |||
| }, | |||
| { | |||
| title:'店主电话', | |||
| align:"center", | |||
| dataIndex: 'shopPhone' | |||
| }, | |||
| { | |||
| title:'店主图片', | |||
| align:"center", | |||
| dataIndex: 'shopImage', | |||
| scopedSlots: {customRender: 'imgSlot'} | |||
| }, | |||
| { | |||
| title:'是否配送', | |||
| align:"center", | |||
| dataIndex: 'pay', | |||
| customRender: (text) => (text ? filterMultiDictText(this.dictOptions['pay'], text) : ''), | |||
| }, | |||
| { | |||
| title:'二维码背景图片', | |||
| align:"center", | |||
| dataIndex: 'qrCodeBg', | |||
| scopedSlots: {customRender: 'imgSlot'} | |||
| }, | |||
| { | |||
| title:'二维码位置x', | |||
| align:"center", | |||
| dataIndex: 'qrCodeX' | |||
| }, | |||
| { | |||
| title:'二维码位置y', | |||
| align:"center", | |||
| dataIndex: 'qrCodeY' | |||
| }, | |||
| { | |||
| title: '操作', | |||
| dataIndex: 'action', | |||
| align:"center", | |||
| fixed:"right", | |||
| width:147, | |||
| scopedSlots: { customRender: 'action' } | |||
| } | |||
| ], | |||
| url: { | |||
| list: "/cityShop/cityShop/list", | |||
| delete: "/cityShop/cityShop/delete", | |||
| deleteBatch: "/cityShop/cityShop/deleteBatch", | |||
| exportXlsUrl: "/cityShop/cityShop/exportXls", | |||
| importExcelUrl: "cityShop/cityShop/importExcel", | |||
| }, | |||
| dictOptions:{}, | |||
| superFieldList:[], | |||
| } | |||
| }, | |||
| created() { | |||
| this.$set(this.dictOptions, 'isOpen', [{text:'是',value:'Y'},{text:'否',value:'N'}]) | |||
| this.$set(this.dictOptions, 'pay', [{text:'是',value:'Y'},{text:'否',value:'N'}]) | |||
| this.getSuperFieldList(); | |||
| }, | |||
| computed: { | |||
| importExcelUrl: function(){ | |||
| return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |||
| }, | |||
| }, | |||
| methods: { | |||
| initDictConfig(){ | |||
| }, | |||
| getSuperFieldList(){ | |||
| let fieldList=[]; | |||
| fieldList.push({type:'datetime',value:'createTime',text:'创建日期'}) | |||
| fieldList.push({type:'string',value:'title',text:'商户名称',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'image',text:'商户门头',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'logoImage',text:'商户LOGO',dictCode:''}) | |||
| fieldList.push({type:'string',value:'titleSub',text:'商户简介',dictCode:''}) | |||
| fieldList.push({type:'string',value:'iconSub',text:'商户标签',dictCode:''}) | |||
| fieldList.push({type:'string',value:'workTime',text:'营业时间',dictCode:''}) | |||
| fieldList.push({type:'string',value:'address',text:'商户地址',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'details',text:'商户介绍',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'detailsImage',text:'商户图片',dictCode:''}) | |||
| fieldList.push({type:'int',value:'sort',text:'排序',dictCode:''}) | |||
| fieldList.push({type:'int',value:'isBrowse',text:'浏览量',dictCode:''}) | |||
| fieldList.push({type:'int',value:'isComment',text:'评论量',dictCode:''}) | |||
| fieldList.push({type:'string',value:'longitude',text:'经度',dictCode:''}) | |||
| fieldList.push({type:'string',value:'latitude',text:'纬度',dictCode:''}) | |||
| fieldList.push({type:'switch',value:'isOpen',text:'是否营业'}) | |||
| fieldList.push({type:'sel_search',value:'shopUser',text:'关联店主',dictTable:"han_hai_member", dictText:'nick_name', dictCode:'id'}) | |||
| fieldList.push({type:'string',value:'shopName',text:'店主姓名',dictCode:''}) | |||
| fieldList.push({type:'string',value:'shopPhone',text:'店主电话',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'shopImage',text:'店主图片',dictCode:''}) | |||
| fieldList.push({type:'switch',value:'pay',text:'是否配送'}) | |||
| fieldList.push({type:'string',value:'qrCodeBg',text:'二维码背景图片',dictCode:''}) | |||
| fieldList.push({type:'int',value:'qrCodeX',text:'二维码位置x',dictCode:''}) | |||
| fieldList.push({type:'int',value:'qrCodeY',text:'二维码位置y',dictCode:''}) | |||
| this.superFieldList = fieldList | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| @import '~@assets/less/common.less'; | |||
| </style> | |||
| @ -0,0 +1,214 @@ | |||
| <template> | |||
| <a-spin :spinning="confirmLoading"> | |||
| <j-form-container :disabled="formDisabled"> | |||
| <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> | |||
| <a-row> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="商户名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="title"> | |||
| <a-input v-model="model.title" placeholder="请输入商户名称" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="商户门头" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="image"> | |||
| <j-image-upload isMultiple v-model="model.image" ></j-image-upload> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="商户LOGO" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logoImage"> | |||
| <j-image-upload isMultiple v-model="model.logoImage" ></j-image-upload> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="商户简介" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="titleSub"> | |||
| <a-textarea v-model="model.titleSub" rows="4" placeholder="请输入商户简介" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="商户标签" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="iconSub"> | |||
| <a-input v-model="model.iconSub" placeholder="请输入商户标签" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="营业时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workTime"> | |||
| <a-input v-model="model.workTime" placeholder="请输入营业时间" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="商户地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address"> | |||
| <a-textarea v-model="model.address" rows="4" placeholder="请输入商户地址" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="商户介绍" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="details"> | |||
| <a-textarea v-model="model.details" rows="4" placeholder="请输入商户介绍" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="商户图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="detailsImage"> | |||
| <j-image-upload isMultiple v-model="model.detailsImage" ></j-image-upload> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sort"> | |||
| <a-input-number v-model="model.sort" placeholder="请输入排序" style="width: 100%" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="浏览量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isBrowse"> | |||
| <a-input-number v-model="model.isBrowse" placeholder="请输入浏览量" style="width: 100%" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="评论量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isComment"> | |||
| <a-input-number v-model="model.isComment" placeholder="请输入评论量" style="width: 100%" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="经度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="longitude"> | |||
| <a-input v-model="model.longitude" placeholder="请输入经度" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="纬度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="latitude"> | |||
| <a-input v-model="model.latitude" placeholder="请输入纬度" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="是否营业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isOpen"> | |||
| <j-switch v-model="model.isOpen" ></j-switch> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="关联店主" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shopUser"> | |||
| <j-search-select-tag v-model="model.shopUser" dict="han_hai_member,nick_name,id" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="店主姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shopName"> | |||
| <a-input v-model="model.shopName" placeholder="请输入店主姓名" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="店主电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shopPhone"> | |||
| <a-input v-model="model.shopPhone" placeholder="请输入店主电话" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="店主图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shopImage"> | |||
| <j-image-upload isMultiple v-model="model.shopImage" ></j-image-upload> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="是否配送" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pay"> | |||
| <j-switch v-model="model.pay" ></j-switch> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="二维码背景图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qrCodeBg"> | |||
| <j-image-upload isMultiple v-model="model.qrCodeBg" ></j-image-upload> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="二维码位置x" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qrCodeX"> | |||
| <a-input-number v-model="model.qrCodeX" placeholder="请输入二维码位置x" style="width: 100%" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="二维码位置y" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qrCodeY"> | |||
| <a-input-number v-model="model.qrCodeY" placeholder="请输入二维码位置y" style="width: 100%" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| </a-row> | |||
| </a-form-model> | |||
| </j-form-container> | |||
| </a-spin> | |||
| </template> | |||
| <script> | |||
| import { httpAction, getAction } from '@/api/manage' | |||
| import { validateDuplicateValue } from '@/utils/util' | |||
| export default { | |||
| name: 'CityShopForm', | |||
| components: { | |||
| }, | |||
| props: { | |||
| //表单禁用 | |||
| disabled: { | |||
| type: Boolean, | |||
| default: false, | |||
| required: false | |||
| } | |||
| }, | |||
| data () { | |||
| return { | |||
| model:{ | |||
| }, | |||
| labelCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 5 }, | |||
| }, | |||
| wrapperCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 16 }, | |||
| }, | |||
| confirmLoading: false, | |||
| validatorRules: { | |||
| }, | |||
| url: { | |||
| add: "/cityShop/cityShop/add", | |||
| edit: "/cityShop/cityShop/edit", | |||
| queryById: "/cityShop/cityShop/queryById" | |||
| } | |||
| } | |||
| }, | |||
| computed: { | |||
| formDisabled(){ | |||
| return this.disabled | |||
| }, | |||
| }, | |||
| created () { | |||
| //备份model原始值 | |||
| this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.edit(this.modelDefault); | |||
| }, | |||
| edit (record) { | |||
| this.model = Object.assign({}, record); | |||
| this.visible = true; | |||
| }, | |||
| submitForm () { | |||
| const that = this; | |||
| // 触发表单验证 | |||
| this.$refs.form.validate(valid => { | |||
| if (valid) { | |||
| that.confirmLoading = true; | |||
| let httpurl = ''; | |||
| let method = ''; | |||
| if(!this.model.id){ | |||
| httpurl+=this.url.add; | |||
| method = 'post'; | |||
| }else{ | |||
| httpurl+=this.url.edit; | |||
| method = 'put'; | |||
| } | |||
| httpAction(httpurl,this.model,method).then((res)=>{ | |||
| if(res.success){ | |||
| that.$message.success(res.message); | |||
| that.$emit('ok'); | |||
| }else{ | |||
| that.$message.warning(res.message); | |||
| } | |||
| }).finally(() => { | |||
| that.confirmLoading = false; | |||
| }) | |||
| } | |||
| }) | |||
| }, | |||
| } | |||
| } | |||
| </script> | |||
| @ -0,0 +1,84 @@ | |||
| <template> | |||
| <a-drawer | |||
| :title="title" | |||
| :width="width" | |||
| placement="right" | |||
| :closable="false" | |||
| @close="close" | |||
| destroyOnClose | |||
| :visible="visible"> | |||
| <city-shop-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></city-shop-form> | |||
| <div class="drawer-footer"> | |||
| <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> | |||
| <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> | |||
| </div> | |||
| </a-drawer> | |||
| </template> | |||
| <script> | |||
| import CityShopForm from './CityShopForm' | |||
| export default { | |||
| name: 'CityShopModal', | |||
| components: { | |||
| CityShopForm | |||
| }, | |||
| data () { | |||
| return { | |||
| title:"操作", | |||
| width:800, | |||
| visible: false, | |||
| disableSubmit: false | |||
| } | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.add(); | |||
| }) | |||
| }, | |||
| edit (record) { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.edit(record); | |||
| }); | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| }, | |||
| submitCallback(){ | |||
| this.$emit('ok'); | |||
| this.visible = false; | |||
| }, | |||
| handleOk () { | |||
| this.$refs.realForm.submitForm(); | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style lang="less" scoped> | |||
| /** Button按钮间距 */ | |||
| .ant-btn { | |||
| margin-left: 30px; | |||
| margin-bottom: 30px; | |||
| float: right; | |||
| } | |||
| .drawer-footer{ | |||
| position: absolute; | |||
| bottom: -8px; | |||
| width: 100%; | |||
| border-top: 1px solid #e8e8e8; | |||
| padding: 10px 16px; | |||
| text-align: right; | |||
| left: 0; | |||
| background: #fff; | |||
| border-radius: 0 0 2px 2px; | |||
| } | |||
| </style> | |||
| @ -0,0 +1,60 @@ | |||
| <template> | |||
| <j-modal | |||
| :title="title" | |||
| :width="width" | |||
| :visible="visible" | |||
| switchFullscreen | |||
| @ok="handleOk" | |||
| :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" | |||
| @cancel="handleCancel" | |||
| cancelText="关闭"> | |||
| <city-shop-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></city-shop-form> | |||
| </j-modal> | |||
| </template> | |||
| <script> | |||
| import CityShopForm from './CityShopForm' | |||
| export default { | |||
| name: 'CityShopModal', | |||
| components: { | |||
| CityShopForm | |||
| }, | |||
| data () { | |||
| return { | |||
| title:'', | |||
| width:800, | |||
| visible: false, | |||
| disableSubmit: false | |||
| } | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.add(); | |||
| }) | |||
| }, | |||
| edit (record) { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.edit(record); | |||
| }) | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| }, | |||
| handleOk () { | |||
| this.$refs.realForm.submitForm(); | |||
| }, | |||
| submitCallback(){ | |||
| this.$emit('ok'); | |||
| this.visible = false; | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| } | |||
| } | |||
| } | |||
| </script> | |||