shuishen
2023-07-11 15b1134a86078cefcab5d3d1c0121370bec0a678
警戒线选择图片
2 files modified
60 ■■■■■ changed files
src/api/icons/index.js 14 ●●●●● patch | view | raw | blame | history
src/components/warningSelect/index.vue 46 ●●●● patch | view | raw | blame | history
src/api/icons/index.js
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-04-10 17:28:21
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-04-10 17:29:29
 * @LastEditTime: 2023-07-10 19:11:32
 * @FilePath: \srs-police-affairs\src\api\icons\index.js
 * @Description: 
 * 
@@ -21,3 +21,15 @@
        method: 'get',
    })
}
/**
 * 获取派出所和责任区数据
 * @param {*} params
 * @returns
 */
export const getWarningsAll = () => {
    return request({
        url: '/api/data/getWarningsPictureUrlDataList',
        method: 'get',
    })
}
src/components/warningSelect/index.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-04-04 16:24:42
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-07-07 15:09:44
 * @LastEditTime: 2023-07-10 19:11:58
 * @FilePath: \srs-police-affairs\src\components\warningSelect\index.vue
 * @Description: 
 * 
@@ -21,7 +21,7 @@
</template>
<script>
import { getIconsAll } from "@/api/icons/index"
import { getWarningsAll } from "@/api/icons/index"
export default {
    name: 'WarningSelect',
@@ -38,39 +38,19 @@
    methods: {
        requireImage () {
            this.imageUrls = [
                {
                    url: '/warnings/防范区1.png',
                    title: '防范区1',
                },
                {
                    url: '/warnings/防范区2.png',
                    title: '防范区2',
                },
                {
                    url: '/warnings/防范区3.png',
                    title: '防范区3',
                },
                {
                    url: '/warnings/核心区1.png',
                    title: '核心区1',
                },
            ]
            getWarningsAll().then(res => {
                res.data.data.forEach(item => {
                    let imgArr = item.split('/')
                    let title = imgArr[imgArr.length - 1].split('.')[0]
            // getIconsAll().then(res => {
            //     res.data.data.forEach(item => {
            //         let imgArr = item.split('/')
            //         let title = imgArr[imgArr.length - 1].split('.')[0]
            //         this.imageUrls.push({
            //             url: item,
            //             title
            //         })
            //     })
            //     this.loading = false
            // })
                    this.imageUrls.push({
                        url: item,
                        title
                    })
                })
                this.loading = false
            })
        },
        curImgClick (item) {