zhouwx
2025-05-19 457f9c817adef8b003ee6379f493798bae5cbb69
修改
已修改7个文件
144 ■■■■ 文件已修改
config/env.development.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/util/validate.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/components/msgEditMod.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/dataStatistic.vue 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/massSend.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/notice.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/env.development.js
@@ -1,5 +1,5 @@
module.exports = {
    NODE_ENV: "development",
    baseUrl: 'http://192.168.2.11:8087',
    baseUrl: 'http://192.168.2.58:8087',
    // baseUrl: 'http://sms.sinanoaq.cn/api',
};
};
src/router/index.js
@@ -8,7 +8,7 @@
  {
    path: '/',
    name: 'login',
    component: () => import('@/views/Login'),
    component: () => import('@/views/Login.vue'),
    meta: { title: '登录' },
  },
    {
src/util/validate.js
@@ -370,3 +370,8 @@
    // true:车牌号正确
    else return true;
}
export function verifySimpleContent(val) {
    var regex = /^[^\u3010-\u3011]*$/;  // 正则表达式,\d 匹配数字,{11} 表示匹配11次
    return regex.test(val);
}
src/views/Admin/components/msgEditMod.vue
@@ -190,7 +190,7 @@
        <h2>短信预览</h2>
        <div class="mobile">
          <div class="mesg">
            <P>【防灾减灾工作提示】{{form.content}}</P>
            <P>【新疆自然灾害预警中心】{{form.content}}</P>
          </div>
        </div>
      </div>
src/views/Admin/dataStatistic.vue
@@ -3,8 +3,8 @@
    <div id="charts" style="width: 100%;height: 400px"></div>
    <a-row type="flex" justify="space-between" style="margin-bottom: 20px">
      <a-col :span="20">
        <a-row type="flex" :gutter="18">
          <a-col :span="8">
        <a-row type="flex" :gutter="24">
          <a-col :span="6">
            <a-range-picker
                v-model="timeRange"
                format="YYYY-MM-DD"
@@ -13,6 +13,14 @@
                @ok="timeOk"
                style="width: 100%"
            />
          </a-col>
          <a-col :span="6">
            <a-select v-model="search.disasterType"  style="width: 100%" placeholder="选择灾种类别"  allow-clear>
              <a-select-option v-for="item in typeList" :value="item.value" :key="item.value">{{item.name}}</a-select-option>
            </a-select>
          </a-col>
          <a-col :span="6">
            <a-cascader :options="areaData" v-model="areaVal" placeholder="选择地理位置" expandTrigger="hover" :fieldNames="fieldNames" changeOnSelect @change="onChange1" style="width: 100%"/>
          </a-col>
          <a-col :span="6">
            <a-button type="primary" @click="searchData">查询</a-button>
@@ -25,7 +33,7 @@
    <!-- 表格实体部分-->
    <div class="table-cont">
      <a-button type="primary" v-if="backButton" @click="backData" :loading="backLoading" style="margin-bottom: 20px">返回上级</a-button>
      <a-table :columns="columns" :data-source="data" bordered :pagination="false" :rowKey="record=>record.name">
      <a-table  :columns="columns" :loading="loading" :data-source="data" bordered :pagination="false" :rowKey="record=>record.name">
        <template #index="text,record,index">
          {{ index + 1 }}
        </template>
@@ -44,6 +52,7 @@
import Cookies from "js-cookie";
import {getUserInfo} from "@/util/storage";
import * as echarts from 'echarts';
import {getDistrictInfo} from "@/api/login";
const columns = [{
  title: '序号',
  dataIndex: 'index',
@@ -84,9 +93,28 @@
  components: {},
  data() {
    return {
      loading: false,
      search:{
        startTime: '',
        endTime: ''
        endTime: '',
        disasterType: undefined ,
        province: '',
        city: ''
      },
      typeList: [
        {name: '地震',value: 1},
        {name: '气象',value: 3},
        {name: '地质灾害',value: 4},
        {name: '水旱',value: 5},
        {name: '森林草原火灾',value: 6}
      ],
      areaData: [],
      areaVal: [],
      fieldNames:{
        label: 'name',
        value: 'id',
        children: 'children'
      },
      timeRange: [],
      category: 'default',
@@ -110,11 +138,13 @@
      t.$router.push(t.$route.path)
    }
    t.getData()
    t.getDistrictInfo()
  },
  methods: {
    async getData(){
      const t = this
      t.backLoading = true
      t.loading = true
      const res = await getTotalStatisticsByArea(t.search)
      if(res.data.code == 100){
        if(t.areaName && t.areaName !== '新疆维吾尔自治区'){
@@ -126,11 +156,57 @@
          t.backButton = false
        }
        t.backLoading = false
        t.loading = false
      }else{
        this.$message.error(res.data.msg)
      }
    },
    async getDistrictInfo(){
      let res = await getDistrictInfo()
      if(res.data.code == 100){
        this.areaData = res.data.data.map(item => ({
          ...item,
          children: item.children?.map(child => ({...child,children:undefined }))
        }))
      } else {
        this.$message.warning(res.data.msg);
      }
    },
    // 根据id查对象
    findCodeById(data,value) {
      for (const node of data) {
        if (node.id === value) {
          return node;
        }
        if (node.children) {
          const foundNode = this.findCodeById(node.children, value);
          if (foundNode) {
            return foundNode;
          }
        }
      }
      return null;
    },
    onChange1(value) {
      const t = this
      t.search.province = ''
      t.search.city = ''
      if(value[0]){
        t.search.province = t.findCodeById(t.areaData,value[0]).name
      }
      if(value[1]){
        t.search.city = t.findCodeById(t.areaData,value[1]).name
      }
      // if(value[2]){
      //   t.search.searchParams.area = t.findCodeById(t.areaData,value[2]).name
      // }
      // if(value[3]){
      //   t.search.searchParams.town = t.findCodeById(t.areaData,value[3]).name
      // }
      console.log('111',t.search.searchParams)
    },
    async getChartsData(){
      const t = this
      const res = await getTotalStatistics()
@@ -212,7 +288,10 @@
      const t = this
      t.search = {
        startTime: '',
        endTime: ''
        endTime: '',
        disasterType: undefined ,
        province: '',
        city: ''
      }
      t.timeRange = []
      t.getData()
@@ -220,4 +299,4 @@
  }
}
</script>
</script>
src/views/Admin/massSend.vue
@@ -233,7 +233,7 @@
            <h2>短信预览</h2>
            <div class="mobile">
                <div class="mesg">
                    <P>【防灾减灾工作提示】{{form.content}}</P>
                    <P>【新疆自然灾害预警中心】{{form.content}}</P>
                </div>
            </div>
@@ -249,9 +249,21 @@
import {getUserInfo} from "@/util/storage";
import {getNewAddressBook, getNewAddressBookArea, getNewAddressBookUser} from "@/api/contactBook";
import {debounce} from "@/util/debounce";
import {verifySimpleContent} from "@/util/validate";
    export default {
        name: "massSend",
        data() {
      let validateContent = (rule, value, callback)=>{
        if(value === ''){
          callback(new Error('请输入信息内容'))
        }else{
          if(!verifySimpleContent(value)){
            callback(new Error('内容不可包含中文中括号【】'))
          }else{
            callback()
          }
        }
      }
            return {
        newBookUsers: [],
        currentLoadedKeys: [],
@@ -312,7 +324,11 @@
          emergType: [{ required: true, message: '请选择紧急类型', trigger: 'change'}],
          disasterType: [{ required: true, message: '请选择灾种', trigger: 'change'}],
          warningLevel: [{ required: true, message: '请选择预警级别', trigger: 'change'}],
          content: [{ required: true, message: '请输入信息内容', trigger: 'blur'}],
          content: [{
            required: true,
            validator: validateContent,
            trigger: 'blur'
          }],
          txlUsers: [{ required: true, message: '请选择通讯录接收人', trigger: 'blur'}],
          // receiver: [{ required: true, message: '请选择接收单位', trigger: 'change'}],
          // recipient: [{ required: true, message: '请选择平级接收人', trigger: 'change'}]
src/views/Admin/notice.vue
@@ -153,7 +153,7 @@
                <h2>短信预览</h2>
                <div class="mobile">
                    <div class="mesg">
                        <P>【防灾减灾工作提示】{{form.content}}</P>
                        <P>【新疆自然灾害预警中心】{{form.content}}</P>
                    </div>
                </div>
            </div>
@@ -179,11 +179,23 @@
        deleteFile
    } from "@/api/list";
  import { TreeSelect } from 'ant-design-vue';
  import {verifySimpleContent} from "@/util/validate";
  const SHOW_PARENT = TreeSelect.SHOW_PARENT;
  const treeData = [];
    export default {
        name: "notice",
        data() {
      let validateContent = (rule, value, callback)=>{
        if(value === ''){
          callback(new Error('请输入信息内容'))
        }else{
          if(!verifySimpleContent(value)){
            callback(new Error('内容不可包含中文中括号【】'))
          }else{
            callback()
          }
        }
      }
            return {
        value: [],
        SHOW_PARENT,
@@ -284,9 +296,9 @@
                        trigger: 'blur'
                    }],
                    content: [{
                        required: true,
                        message: '请输入信息内容',
                        trigger: 'blur'
            required: true,
            validator: validateContent,
            trigger: 'blur'
                    }],
                    timeout: [{
                        required: true,