| | |
| | | import MapBox from "@/components/map/mapBox" |
| | | import SearchMap from "@/components/map/searchMap" |
| | | import DcMap from "@/components/map/dcMap" |
| | | import { exportBlob } from "@/api/common"; |
| | | import { getToken } from "@/util/auth"; |
| | | import { downloadXls } from "@/util/util"; |
| | | import { exportBlob } from "@/api/common" |
| | | import { getToken } from "@/util/auth" |
| | | import { downloadXls } from "@/util/util" |
| | | export default { |
| | | components: { |
| | | DcMap, |
| | |
| | | securityManage, |
| | | securityManageCar |
| | | }, |
| | | data() { |
| | | data () { |
| | | return { |
| | | securityId: "", |
| | | carBox: false, |
| | |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList() { |
| | | permissionList () { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.security_add, false), |
| | | viewBtn: this.vaildData(this.permission.security_view, true), |
| | |
| | | editBtn: this.vaildData(this.permission.security_edit, false) |
| | | } |
| | | }, |
| | | ids() { |
| | | ids () { |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id) |
| | |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | created() { |
| | | created () { |
| | | const tokenLength = window.location.href.indexOf('=') |
| | | if (tokenLength > 0) { |
| | | //取“=”之后的token |
| | |
| | | }, |
| | | methods: { |
| | | //下面为导入操作 |
| | | handleImport() { |
| | | this.excelBox = true; |
| | | handleImport () { |
| | | this.excelBox = true |
| | | }, |
| | | uploadAfter(res, done, loading, column) { |
| | | window.console.log(column); |
| | | this.excelBox = false; |
| | | this.refreshChange(); |
| | | done(); |
| | | uploadAfter (res, done, loading, column) { |
| | | window.console.log(column) |
| | | this.excelBox = false |
| | | this.refreshChange() |
| | | done() |
| | | }, |
| | | handleTemplate() { |
| | | handleTemplate () { |
| | | exportBlob(`/api/blade-resPicDetail/resPicDetail/export-template?${this.website.tokenHeader}=${getToken()}`).then(res => { |
| | | downloadXls(res.data, "可用资源图明细数据模板.xlsx"); |
| | | downloadXls(res.data, "可用资源图明细数据模板.xlsx") |
| | | }) |
| | | }, |
| | | getUserInfo() { |
| | | getUserInfo () { |
| | | getUserInfos().then(res => { |
| | | const data = res.data |
| | | this.$store.commit('SET_TOKEN', data.access_token) |
| | |
| | | this.$store.commit('CLEAR_LOCK') |
| | | }) |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | rowSave (row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | |
| | | window.console.log(error) |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | rowUpdate (row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | rowDel (row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | handleDelete () { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | beforeOpen (done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | var data = res.data.data |
| | | this.form = data |
| | | this.form['datetimerange'] = [data.startTime, data.endTime] |
| | | this.form['longitude'] = data.position.split(" ")[0] |
| | | this.form['latitude'] = data.position.split(" ")[1] |
| | | this.point = "POINT(" + this.form.longitude + " " + this.form.latitude + ")" |
| | | this.form['lng'] = data.position.split(" ")[0] |
| | | this.form['lat'] = data.position.split(" ")[1] |
| | | this.point = "POINT(" + this.form.lng + " " + this.form.lat + ")" |
| | | this.$refs.dcMap.showPolygon(this.form.activityArea) |
| | | }) |
| | | } |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | searchReset () { |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | searchChange (params, done) { |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | selectionChange (list) { |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | selectionClear () { |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | currentChange (currentPage) { |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | sizeChange (pageSize) { |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | refreshChange () { |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | onLoad (page, params = {}) { |
| | | this.loading = true |
| | | |
| | | if (this.userInfo.role_name != "admin" && this.userInfo.role_name != "administrator") { |
| | |
| | | }) |
| | | }, |
| | | //活动人员区域点击按钮事件 |
| | | handlePersonList(row) { |
| | | handlePersonList (row) { |
| | | this.personBox = true |
| | | this.securityId = row.id |
| | | }, |
| | | //活动车辆区域点击按钮事件 |
| | | handleCarList(row) { |
| | | handleCarList (row) { |
| | | this.carBox = true |
| | | this.securityId = row.id |
| | | }, |
| | | //地图传回的polygon坐标 |
| | | toData(data) { |
| | | toData (data) { |
| | | console.log('data', data) |
| | | this.form.activityArea = data |
| | | }, |
| | | getLonLat(data) { |
| | | this.chosePoint.longitude = data[0] |
| | | this.chosePoint.latitude = data[1] |
| | | getLonLat (data) { |
| | | this.chosePoint.lng = data[0] |
| | | this.chosePoint.lat = data[1] |
| | | }, |
| | | getAddress(data) { |
| | | getAddress (data) { |
| | | this.chosePoint.address = data |
| | | }, |
| | | confirmLonLat() { |
| | | if (this.chosePoint.longitude) { |
| | | this.form.longitude = this.chosePoint.longitude |
| | | this.form.latitude = this.chosePoint.latitude |
| | | confirmLonLat () { |
| | | if (this.chosePoint.lng) { |
| | | this.form.lng = this.chosePoint.lng |
| | | this.form.lat = this.chosePoint.lat |
| | | this.form.place = this.chosePoint.address |
| | | this.point = "POINT(" + this.form.longitude + " " + this.form.latitude + ")" |
| | | this.point = "POINT(" + this.form.lng + " " + this.form.lat + ")" |
| | | this.placeBox = false |
| | | } else { |
| | | this.$alert('该点没有位置信息,请重新选点!', '提示', { |
| | |
| | | import MapBox from "@/components/map/mapBox" |
| | | import SearchMap from "@/components/map/searchMap" |
| | | import DcMap from "@/components/map/dcMap" |
| | | import { exportBlob } from "@/api/common"; |
| | | import { getToken } from "@/util/auth"; |
| | | import { downloadXls } from "@/util/util"; |
| | | import { exportBlob } from "@/api/common" |
| | | import { getToken } from "@/util/auth" |
| | | import { downloadXls } from "@/util/util" |
| | | export default { |
| | | components: { |
| | | DcMap, |
| | | SearchMap, |
| | | MapBox, |
| | | }, |
| | | data() { |
| | | data () { |
| | | return { |
| | | securityId: "", |
| | | carBox: false, |
| | |
| | | search: true, |
| | | searchSpan: 5, |
| | | searchLabelWidth: 100, |
| | | width:150, |
| | | width: 150, |
| | | // type: "select", |
| | | // dicUrl: "/api/blade-system/dict-biz/dictionary?code=securityType", |
| | | // props: { |
| | |
| | | { |
| | | label: "存在隐患", |
| | | prop: "hiddenDangerDesc", |
| | | span:24, |
| | | type:"textarea", |
| | | span: 24, |
| | | type: "textarea", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入存在隐患", |
| | |
| | | prop: "createTime", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | width:150, |
| | | width: 150, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入创建时间", |
| | |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList() { |
| | | permissionList () { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.security_add, false), |
| | | viewBtn: this.vaildData(this.permission.security_view, true), |
| | |
| | | editBtn: this.vaildData(this.permission.security_edit, false) |
| | | } |
| | | }, |
| | | ids() { |
| | | ids () { |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id) |
| | |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | created() { |
| | | created () { |
| | | const tokenLength = window.location.href.indexOf('=') |
| | | if (tokenLength > 0) { |
| | | //取“=”之后的token |
| | |
| | | }, |
| | | methods: { |
| | | //下面为导入操作 |
| | | handleImport() { |
| | | this.excelBox = true; |
| | | handleImport () { |
| | | this.excelBox = true |
| | | }, |
| | | uploadAfter(res, done, loading, column) { |
| | | window.console.log(column); |
| | | this.excelBox = false; |
| | | this.refreshChange(); |
| | | done(); |
| | | uploadAfter (res, done, loading, column) { |
| | | window.console.log(column) |
| | | this.excelBox = false |
| | | this.refreshChange() |
| | | done() |
| | | }, |
| | | handleTemplate() { |
| | | handleTemplate () { |
| | | exportBlob(`/api/blade-riskHidDangPicDetail/riskHidDangPicDetail/export-template?${this.website.tokenHeader}=${getToken()}`).then(res => { |
| | | downloadXls(res.data, "风险隐患图明细数据模板.xlsx"); |
| | | downloadXls(res.data, "风险隐患图明细数据模板.xlsx") |
| | | }) |
| | | }, |
| | | getUserInfo() { |
| | | getUserInfo () { |
| | | getUserInfos().then(res => { |
| | | const data = res.data |
| | | this.$store.commit('SET_TOKEN', data.access_token) |
| | |
| | | this.$store.commit('CLEAR_LOCK') |
| | | }) |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | rowSave (row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | |
| | | window.console.log(error) |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | rowUpdate (row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | rowDel (row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | handleDelete () { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | beforeOpen (done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | var data = res.data.data |
| | | this.form = data |
| | | this.form['datetimerange'] = [data.startTime, data.endTime] |
| | | this.form['longitude'] = data.position.split(" ")[0] |
| | | this.form['latitude'] = data.position.split(" ")[1] |
| | | this.point = "POINT(" + this.form.longitude + " " + this.form.latitude + ")" |
| | | this.form['lng'] = data.position.split(" ")[0] |
| | | this.form['lat'] = data.position.split(" ")[1] |
| | | this.point = "POINT(" + this.form.lng + " " + this.form.lat + ")" |
| | | this.$refs.dcMap.showPolygon(this.form.activityArea) |
| | | }) |
| | | } |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | searchReset () { |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | searchChange (params, done) { |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | selectionChange (list) { |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | selectionClear () { |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | currentChange (currentPage) { |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | sizeChange (pageSize) { |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | refreshChange () { |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | onLoad (page, params = {}) { |
| | | this.loading = true |
| | | |
| | | if (this.userInfo.role_name != "admin" && this.userInfo.role_name != "administrator") { |
| | |
| | | }) |
| | | }, |
| | | //活动人员区域点击按钮事件 |
| | | handlePersonList(row) { |
| | | handlePersonList (row) { |
| | | this.personBox = true |
| | | this.securityId = row.id |
| | | }, |
| | | //活动车辆区域点击按钮事件 |
| | | handleCarList(row) { |
| | | handleCarList (row) { |
| | | this.carBox = true |
| | | this.securityId = row.id |
| | | }, |
| | | //地图传回的polygon坐标 |
| | | toData(data) { |
| | | toData (data) { |
| | | console.log('data', data) |
| | | this.form.activityArea = data |
| | | }, |
| | | getLonLat(data) { |
| | | this.chosePoint.longitude = data[0] |
| | | this.chosePoint.latitude = data[1] |
| | | getLonLat (data) { |
| | | this.chosePoint.lng = data[0] |
| | | this.chosePoint.lat = data[1] |
| | | }, |
| | | getAddress(data) { |
| | | getAddress (data) { |
| | | this.chosePoint.address = data |
| | | }, |
| | | confirmLonLat() { |
| | | if (this.chosePoint.longitude) { |
| | | this.form.longitude = this.chosePoint.longitude |
| | | this.form.latitude = this.chosePoint.latitude |
| | | confirmLonLat () { |
| | | if (this.chosePoint.lng) { |
| | | this.form.lng = this.chosePoint.lng |
| | | this.form.lat = this.chosePoint.lat |
| | | this.form.place = this.chosePoint.address |
| | | this.point = "POINT(" + this.form.longitude + " " + this.form.latitude + ")" |
| | | this.point = "POINT(" + this.form.lng + " " + this.form.lat + ")" |
| | | this.placeBox = false |
| | | } else { |
| | | this.$alert('该点没有位置信息,请重新选点!', '提示', { |