马宇豪
2023-12-21 45fbd9d1e4f63c6e43512d9d532d491367cc55ee
修复弹窗bug
已修改20个文件
已添加3个文件
110 ■■■■ 文件已修改
config/env.development.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Home/Dynamic.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/directive/index.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/directive/preventReclick.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/util/debounce.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/util/request.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/util/validate.js 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/Report.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/components/addressUserMod.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/components/msgEditMod.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/components/pwdMod.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/components/userMod.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/list.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/massSend.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/msgReview.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/notice.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/reactionManage.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/release.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/sameLevel.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/userManage.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Home.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Login.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/env.development.js
@@ -1,5 +1,5 @@
module.exports = {
    NODE_ENV: "development",
    baseUrl: 'http://192.168.0.41:8086',
    baseUrl: 'http://192.168.0.47:8086',
    // baseUrl: 'http://121.239.169.30:13001',
}
};
src/components/Home/Dynamic.vue
@@ -48,8 +48,12 @@
      const t = this
      const res = await getResponseRecord(this.search)
      if(res.data.code == 100){
        if(res.data.data && res.data.data.length>0){
        t.lists = res.data.data
      }else{
          t.lists = []
        }
      }else{
        this.$message.error(res.data.msg)
      }
    },
src/directive/index.js
对比新文件
@@ -0,0 +1,12 @@
import preventReClick from './preventReclick'
const install = function(Vue) {
    Vue.directive('preventReClick', preventReClick)
}
if (window.Vue) {
    window['preventReClick'] = preventReClick
    Vue.use(install); // eslint-disable-line
}
export default install
src/directive/preventReclick.js
对比新文件
@@ -0,0 +1,17 @@
// 自定义指令防止按钮重复点击 v-preventReClick
export default {
    inserted(el, binding, vnode) {
        el.addEventListener('click', () => {
            // 是否可见
            if (!el.disabled) {
                el.disabled = true
                el.style.display = 'none'
                setTimeout(() => {
                    el.disabled = false
                    el.style.display = ''
                }, binding.value || 1500)
                // 不设置默认则为1500
            }
        })
    },
}
src/main.js
@@ -5,13 +5,13 @@
import './util/AntDesign'
import 'ant-design-vue/dist/antd.css'
import moment from 'moment'
//设置组件默认中文
import 'moment/locale/zh-cn';
import '@/util/permission'
import {message,Modal} from "ant-design-vue";
moment.locale('zh-cn');
import prevent from './directive/index'//你的文件路径
Vue.use(prevent)
Vue.config.productionTip = false
Vue.filter('filterTime', (value) => {
src/util/debounce.js
对比新文件
@@ -0,0 +1,14 @@
export function debounce(func, delay) {
  let timeoutId;
  return function() {
    const context = this;
    const args = arguments;
    clearTimeout(timeoutId);
    timeoutId = setTimeout(function() {
      func.apply(context, args);
    }, delay);
  };
}
src/util/request.js
@@ -61,7 +61,7 @@
        if (error.message.indexOf('timeout') != -1) {
            message.error('网络超时');
            setTimeout(() => {
                Session.clear();
                Session.clear()
                window.location.href = '/';
            }, 1000);
        } else if (error.message == 'Network Error') {
src/util/validate.js
src/views/Admin/Report.vue
@@ -30,7 +30,7 @@
            />
          </a-col>
          <a-col :span="6">
            <a-button type="primary" @click="searchData()">查询</a-button>
            <a-button type="primary" @click="searchData()" v-preventReClick="1500">查询</a-button>
            <a-button style="margin-left: 12px" @click="resetSearch">重置</a-button>
          </a-col>
        </a-row>
@@ -59,7 +59,7 @@
          </a-tag>
        </template>
        <template #operation="text, record, index">
          <a-button type="primary" v-if="record.reviewStatus == 2" @click="confirmPost(record.id)">确认发布</a-button>
          <a-button type="primary" v-if="record.reviewStatus == 2" @click="confirmPost(record.id)" v-preventReClick="1500">确认发布</a-button>
          <a-button type="link" @click="openMod('view',record)">查看信息详情</a-button>
          <a-button class="del" type="link" @click="delData(record.id)">删除</a-button>
          <a-button v-if="record.reviewStatus == 1 || record.reviewStatus == 3" @click="openMod('edit',record)">修改</a-button>
@@ -180,6 +180,7 @@
  },
  methods:{
    async getData(){
      console.log(111)
      const t = this
      const res = await getReviewRecord(this.search)
      if(res.data.code == 100){
src/views/Admin/components/addressUserMod.vue
@@ -13,7 +13,7 @@
  >
    <a-form-model ref="ruleForm" :rules="rules" :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" :colon="false">
      <a-form-model-item label="姓名" prop="name">
        <a-input v-model="form.name"/>
        <a-input v-model.trim="form.name"/>
      </a-form-model-item>
      <a-form-model-item label="手机号码" prop="phone">
        <a-input v-model="form.phone"/>
src/views/Admin/components/msgEditMod.vue
@@ -169,7 +169,7 @@
            </a-button>
          </a-col>
          <a-col :span="12" style="text-align: right" v-if="title=='信息修改'">
            <a-button type="primary" style="min-width: 140px;margin-right: 12px" @click="confirmSend(4)" :disabled="userInfo.role.id==1?true:false">
            <a-button type="primary" style="min-width: 140px;margin-right: 12px" @click="confirmSend(4)" :disabled="userInfo.role.id==1?true:false" v-preventReClick="1500">
              确认并提交审核
            </a-button>
          </a-col>
src/views/Admin/components/pwdMod.vue
@@ -12,7 +12,7 @@
      :afterClose="clearMod"
  >
    <a-form-model ref="ruleForm" :rules="rules" :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" :colon="false">
      <a-form-model-item label="原密码" prop="oldPwd">
      <a-form-model-item label="原密码" prop="oldPwd" v-if="form.uid == id">
<!--        <a-input v-model="form.oldPwd"/>-->
        <a-input-password v-model="form.oldPwd" placeholder="请输入原密码" />
      </a-form-model-item>
@@ -31,7 +31,7 @@
import {verifyPasswordPowerful, verifyPhone, verifyTelPhone} from "@/util/validate";
import { updatePwd } from '@/api/user'
import {loginOut} from "@/api/login";
import {Session} from "@/util/storage";
import {getUserInfo, Session} from "@/util/storage";
export default {
  name: 'pwdMod',
  data () {
@@ -67,6 +67,7 @@
        newPwd: '',
        reNewPwd: ''
      },
      id: getUserInfo().uid,
      rules: {
        // oldPwd: [{ required: true, validator: validatePwd, trigger: 'blur'}],
        // newPwd: [{ required: true, validator: validatePwd, trigger: 'blur'}],
@@ -79,6 +80,7 @@
  },
  created() {
    const t = this
    console.log(t.id,t.form.uid,'id')
  },
  methods:{
    clearMod(){
src/views/Admin/components/userMod.vue
@@ -13,13 +13,13 @@
  >
    <a-form-model ref="ruleForm" :rules="rules" :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" :colon="false">
      <a-form-model-item label="姓名" prop="realName">
        <a-input v-model="form.realName"/>
        <a-input v-model.trim="form.realName"/>
      </a-form-model-item>
      <a-form-model-item label="手机号码" prop="phone">
        <a-input v-model="form.phone"/>
        <a-input v-model.trim="form.phone"/>
      </a-form-model-item>
      <a-form-model-item label="用户名" prop="name">
        <a-input v-model="form.name"/>
        <a-input v-model.trim="form.name"/>
      </a-form-model-item>
      <a-form-model-item label="密码" v-if="title== '新增用户'" prop="pwd">
        <a-input v-model="form.pwd"/>
@@ -276,6 +276,8 @@
            this.$message.error('单位层级和所属地区不匹配,请重新选择')
            return
          }
          // this.form.realName = this.form.realName.trim()
          // this.form.name = this.form.name.trim()
          if(this.title == '新增用户'){
            const { id,...data } = this.form
            addUser(data).then((res)=>{
src/views/Admin/list.vue
@@ -30,7 +30,7 @@
            />
          </a-col>
          <a-col :span="6">
            <a-button type="primary" @click="searchData">查询</a-button>
            <a-button type="primary" @click="searchData" v-preventReClick="1000">查询</a-button>
            <a-button style="margin-left: 12px" @click="resetSearch">重置</a-button>
          </a-col>
        </a-row>
@@ -104,6 +104,7 @@
import axios from "axios";
import Cookies from "js-cookie";
import {getUserInfo} from "@/util/storage";
import {debounce} from "@/util/debounce";
  export default {
    name: 'list',
@@ -226,7 +227,7 @@
      t.getData()
    },
    methods: {
      async getData(){
      getData: debounce(async function(){
        const t = this
        const res = await getMsgRecord(this.search)
        if(res.data.code == 100){
@@ -235,7 +236,7 @@
        }else{
          this.$message.error(res.data.msg)
        }
      },
      },1000),
      onPageChange(page, pageSize) {
        const t= this
src/views/Admin/massSend.vue
@@ -163,7 +163,7 @@
<!--                </a-select>-->
<!--      </div>-->
      <div style="display: flex;justify-content: right">
        <a-button type="primary" style="width: 250px;" @click="confirmSend()" :disabled="userInfo.role.id==1?true:false">
        <a-button type="primary" style="width: 250px;" @click="confirmSend()" :disabled="userInfo.role.id==1?true:false" v-preventReClick="1500">
          确认发送
        </a-button>
      </div>
src/views/Admin/msgReview.vue
@@ -30,7 +30,7 @@
            />
          </a-col>
          <a-col :span="4">
            <a-button type="primary" @click="getData">查询</a-button>
            <a-button type="primary" @click="getData" v-preventReClick="1500">查询</a-button>
            <a-button style="margin-left: 12px" @click="resetSearch">重置</a-button>
          </a-col>
        </a-row>
src/views/Admin/notice.vue
@@ -130,7 +130,7 @@
                        </a-form-model-item>
                    </a-col>
                    <a-col :span="12" style="text-align: right">
                        <a-button type="primary" style="width: 250px;" @click="confirmSend()"
                        <a-button type="primary" style="width: 250px;" @click="confirmSend()" v-preventReClick="1500"
                            :disabled="userInfo.role.id==1?true:false">
                            确认并提交审核
                        </a-button>
src/views/Admin/reactionManage.vue
@@ -22,7 +22,7 @@
            {{ getRiskName(type) }}
        </template>
        <template #action="action,row">
          <a-button type="link" @click="editData('edit',row)">编辑</a-button>
          <a-button type="link" @click="editData('edit',row)" v-preventReClick="1500">编辑</a-button>
          <a-button type="link" class="delBtn" @click="delData(row)">删除</a-button>
        </template>
      </a-table>
src/views/Admin/release.vue
@@ -83,6 +83,7 @@
import axios from "axios";
import Cookies from "js-cookie";
import {getUserInfo} from "@/util/storage";
import {debounce} from "@/util/debounce";
  const columns = [{
            title: '序号',
            dataIndex: 'index',
@@ -200,7 +201,7 @@
      t.getData()
    },
        methods: {
      async getData(){
      getData: debounce(async function(){
        const t = this
        const res = await getPublishRecord(this.search)
        if(res.data.code == 100){
@@ -209,7 +210,7 @@
        }else{
          this.$message.error(res.data.msg)
        }
      },
      },1000),
      openList(id){
        const t = this
src/views/Admin/sameLevel.vue
@@ -13,7 +13,7 @@
            <a-cascader :options="areaData" v-model="areaVal" placeholder="所属区域" expandTrigger="hover" :fieldNames="fieldNames" changeOnSelect @change="onChange" style="width: 100%"/>
          </a-col>
          <a-col :span="6">
            <a-button type="primary" @click="getUserList">查询</a-button>
            <a-button type="primary" @click="getUserList" v-preventReClick="1500">查询</a-button>
            <a-button style="margin-left: 12px" @click="resetSearch">重置</a-button>
          </a-col>
        </a-row>
src/views/Admin/userManage.vue
@@ -10,7 +10,7 @@
            <a-cascader :options="areaData" v-model="areaVal" placeholder="行政规划" expandTrigger="hover" :fieldNames="fieldNames" changeOnSelect @change="onChange" style="width: 100%"/>
          </a-col>
          <a-col :span="4">
            <a-select v-model="search.searchParams.unittype" placeholder="监管层级" style="width: 100%">
            <a-select v-model="search.searchParams.unittype" placeholder="监管层级" style="width: 100%" clearable>
              <a-select-option :value="1">
                省级
              </a-select-option>
@@ -172,7 +172,6 @@
  created() {
    const t = this
    t.unittype = getUserInfo().unittype
    console.log(t.unittype,'unit')
    t.getUserList()
    t.getDistrictInfo()
  },
src/views/Home.vue
@@ -36,7 +36,7 @@
                      <router-view ref="tabContent"></router-view>
          </keep-alive>
                    <div style="height: 30px;text-align: center;line-height: 30px">
            技术支持:中国科学院
            技术支持:技术保障部
          </div>
                </a-layout-content>
            </a-layout>
src/views/Login.vue
@@ -91,11 +91,12 @@
          size="large"
          @click="handleSubmit"
          :loading="isLoading"
          v-preventReClick="1500"
        >
          登录
        </a-button>
      </a-form-item>
      <center><p>技术支持:中国科学院</p></center>
      <center><p>技术支持:技术保障部</p></center>
    </a-form-model>
  </div>
  </div>