上饶市警务平台后台管理前端
shuishen
2024-05-13 6b54b2f1e1b43458370181b8451bd2c81c5ad6e1
经纬度保存字段更换
2 files modified
188 ■■■■ changed files
src/views/three/resPic/resPic.vue 90 ●●●● patch | view | raw | blame | history
src/views/three/riskHidDangPic/riskHidDangPic.vue 98 ●●●● patch | view | raw | blame | history
src/views/three/resPic/resPic.vue
@@ -42,9 +42,9 @@
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,
@@ -53,7 +53,7 @@
        securityManage,
        securityManageCar
    },
    data() {
    data () {
        return {
            securityId: "",
            carBox: false,
@@ -326,7 +326,7 @@
    },
    computed: {
        ...mapGetters(["userInfo", "permission"]),
        permissionList() {
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.security_add, false),
                viewBtn: this.vaildData(this.permission.security_view, true),
@@ -334,7 +334,7 @@
                editBtn: this.vaildData(this.permission.security_edit, false)
            }
        },
        ids() {
        ids () {
            let ids = []
            this.selectionList.forEach(ele => {
                ids.push(ele.id)
@@ -342,7 +342,7 @@
            return ids.join(",")
        }
    },
    created() {
    created () {
        const tokenLength = window.location.href.indexOf('=')
        if (tokenLength > 0) {
            //取“=”之后的token
@@ -351,21 +351,21 @@
    },
    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)
@@ -376,7 +376,7 @@
                this.$store.commit('CLEAR_LOCK')
            })
        },
        rowSave(row, done, loading) {
        rowSave (row, done, loading) {
            add(row).then(() => {
                this.onLoad(this.page)
                this.$message({
@@ -389,7 +389,7 @@
                window.console.log(error)
            })
        },
        rowUpdate(row, index, done, loading) {
        rowUpdate (row, index, done, loading) {
            update(row).then(() => {
                this.onLoad(this.page)
                this.$message({
@@ -402,7 +402,7 @@
                console.log(error)
            })
        },
        rowDel(row) {
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
@@ -419,7 +419,7 @@
                    })
                })
        },
        handleDelete() {
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
@@ -441,47 +441,47 @@
                    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") {
@@ -497,33 +497,33 @@
            })
        },
        //活动人员区域点击按钮事件
        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('该点没有位置信息,请重新选点!', '提示', {
src/views/three/riskHidDangPic/riskHidDangPic.vue
@@ -40,16 +40,16 @@
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,
@@ -140,7 +140,7 @@
                        search: true,
                        searchSpan: 5,
                        searchLabelWidth: 100,
                        width:150,
                        width: 150,
                        // type: "select",
                        // dicUrl: "/api/blade-system/dict-biz/dictionary?code=securityType",
                        // props: {
@@ -231,8 +231,8 @@
                    {
                        label: "存在隐患",
                        prop: "hiddenDangerDesc",
                        span:24,
                        type:"textarea",
                        span: 24,
                        type: "textarea",
                        rules: [{
                            required: true,
                            message: "请输入存在隐患",
@@ -244,7 +244,7 @@
                        prop: "createTime",
                        addDisplay: false,
                        editDisplay: false,
                        width:150,
                        width: 150,
                        rules: [{
                            required: true,
                            message: "请输入创建时间",
@@ -270,7 +270,7 @@
    },
    computed: {
        ...mapGetters(["userInfo", "permission"]),
        permissionList() {
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.security_add, false),
                viewBtn: this.vaildData(this.permission.security_view, true),
@@ -278,7 +278,7 @@
                editBtn: this.vaildData(this.permission.security_edit, false)
            }
        },
        ids() {
        ids () {
            let ids = []
            this.selectionList.forEach(ele => {
                ids.push(ele.id)
@@ -286,7 +286,7 @@
            return ids.join(",")
        }
    },
    created() {
    created () {
        const tokenLength = window.location.href.indexOf('=')
        if (tokenLength > 0) {
            //取“=”之后的token
@@ -295,21 +295,21 @@
    },
    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)
@@ -320,7 +320,7 @@
                this.$store.commit('CLEAR_LOCK')
            })
        },
        rowSave(row, done, loading) {
        rowSave (row, done, loading) {
            add(row).then(() => {
                this.onLoad(this.page)
                this.$message({
@@ -333,7 +333,7 @@
                window.console.log(error)
            })
        },
        rowUpdate(row, index, done, loading) {
        rowUpdate (row, index, done, loading) {
            update(row).then(() => {
                this.onLoad(this.page)
                this.$message({
@@ -346,7 +346,7 @@
                console.log(error)
            })
        },
        rowDel(row) {
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
@@ -363,7 +363,7 @@
                    })
                })
        },
        handleDelete() {
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
@@ -385,47 +385,47 @@
                    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") {
@@ -441,33 +441,33 @@
            })
        },
        //活动人员区域点击按钮事件
        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('该点没有位置信息,请重新选点!', '提示', {