Pārlūkot izejas kodu

fix-车联网优化修改

LAPTOP-U5GOA5HA\zz 1 gadu atpakaļ
vecāks
revīzija
512bef2498

+ 16 - 0
src/api/iot.js

@@ -85,4 +85,20 @@ export function getOverSpeedStatistics(params) {
     method: 'get',
     params
   })
+}
+// 车辆轨迹记录(日期)
+export function getCalendar(params) {
+  return request({
+    url: '/car/calendar',
+    method: 'get',
+    params
+  })
+}
+// 车辆轨迹记录日历详情(日期)
+export function getCalendarDetail(params) {
+  return request({
+    url: '/car/calendar/detail',
+    method: 'get',
+    params
+  })
 }

+ 2 - 0
src/bus.js

@@ -0,0 +1,2 @@
+import Vue from 'vue'
+export default new Vue()  //将这个BUS挂载到Vue.prototype身上,此后所有组件都可以通过this直接访问到这个BUS

+ 19 - 8
src/main.js

@@ -12,8 +12,8 @@ import { VueAxios } from './utils/request'
 import ProLayout, { PageHeaderWrapper } from '@/components/ProLayout'
 import FooterToolBar from '@/components/FooterToolbar'
 import FileUpload from '@/components/FileUpload'
-import ElementUI from 'element-ui';
-import 'element-ui/lib/theme-chalk/index.css';
+import ElementUI from 'element-ui'
+import 'element-ui/lib/theme-chalk/index.css'
 import themePluginConfig from '../config/themePluginConfig'
 import { TableSetting } from '@/components'
 // 字典数据组件
@@ -27,11 +27,22 @@ import './permission' // permission control
 import './utils/filter' // global filter
 import './global.less' // global style
 import { getDicts } from '@/api/system/dict/data'
-import dataV from '@jiaminghi/data-view';
+import dataV from '@jiaminghi/data-view'
 import { getConfigKey } from '@/api/system/config'
-import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree, tableSorter } from '@/utils/ruoyi'
+import {
+  parseTime,
+  resetForm,
+  addDateRange,
+  selectDictLabel,
+  selectDictLabels,
+  handleTree,
+  tableSorter,
+} from '@/utils/ruoyi'
 import { download } from '@/utils/request'
-
+// 引入BUS
+import BUS from './bus.js'
+// 将BUS挂载到Vue的prototype原型身上
+Vue.prototype.BUS = BUS
 // 全局方法挂载
 Vue.prototype.getDicts = getDicts
 Vue.prototype.getConfigKey = getConfigKey
@@ -47,7 +58,7 @@ Vue.config.productionTip = false
 
 // mount axios to `Vue.$http` and `this.$http`
 Vue.use(VueAxios)
-Vue.use(ElementUI);
+Vue.use(ElementUI)
 // use pro-layout components
 Vue.component('pro-layout', ProLayout)
 Vue.component('page-container', PageHeaderWrapper)
@@ -59,7 +70,7 @@ Vue.component('dict-tag', DictTag)
 
 Vue.use(permission)
 Vue.use(style)
-Vue.use(dataV);
+Vue.use(dataV)
 DictData.install()
 window.umi_plugin_ant_themeVar = themePluginConfig.theme
 new Vue({
@@ -68,5 +79,5 @@ new Vue({
   i18n,
   // init localstorage, vuex
   created: bootstrap,
-  render: h => h(App)
+  render: (h) => h(App),
 }).$mount('#app')

+ 18 - 3
src/views/cardIot/components/CarPathHistory.vue

@@ -380,7 +380,7 @@ export default {
         strokeOpacity: 0.3, //线透明度
         strokeWeight: 6, //线宽
       })
-      map.setZoom(18)
+      map.setZoom(16)
       map.setCenter(this.carMarker.getPosition(), true)
       this.basicInfo = new AMap.InfoWindow({
         isCustom: true, // 使用自定义窗体
@@ -465,6 +465,18 @@ export default {
       })
     },
   },
+  created() {
+    //  $on 接收comment兄弟组件传的参数
+    this.BUS.$on("changeEmTime", value => {
+      this.selectDateTimeForm.startTime=value.startTime
+      this.selectDateTimeForm.endTime=value.endTime
+      this.handleCarPathHistory(this.selectDateTimeForm.startTime, this.selectDateTimeForm.endTime).then(() => {
+          })
+          this.showCarPathHistory=true
+      // this.visibleModal = true
+      // this.commentItem = value; //value就是comment组件传过来的commentItem
+    });
+  },
 }
 </script>
 
@@ -479,7 +491,8 @@ export default {
 
   .car-path-history-content {
     background-color: #fff;
-    padding: 5px 10px;
+    padding: 5px 20px;
+    margin-right: 20px;
     .car-path-time {
       display: flex;
       justify-content: center;
@@ -545,7 +558,9 @@ export default {
       background-size: 100% 100%;
       cursor: pointer;
       pointer-events: all;
-      margin-left: 20px;
+      // margin-left: 20px;
+      margin-right: 540px;
+      z-index: 990;
     }
   }
 }

+ 9 - 4
src/views/cardIot/components/FireStationDetails.vue

@@ -24,10 +24,14 @@
         联系人电话:
         {{ carinfo.phone ? carinfo.phone : '暂无' }}
       </div>
-      <div>拨打电话</div>
+      <!-- <div>拨打电话</div> -->
+      <div>
+        <span>纬度:{{ carinfo.lat }}</span>
+        <div>经度:{{ carinfo.lng }}</div>
+      </div>
       <div style="display: flex; justify-content: space-between">
         <div style="display: flex; flex-direction: column; width: 120px; text-align: center">
-          <span style="color: rgb(35, 130, 213); font-size: 20px">5871天</span>
+          <span style="color: rgb(35, 130, 213); font-size: 20px">28天</span>
           <span>安全运行天数</span>
         </div>
         <div style="display: flex; flex-direction: column; width: 120px; text-align: center">
@@ -73,6 +77,7 @@ export default {
   methods: {
     FunInfo() {
       getCarInfo(this.id || this.carIds).then((res) => {
+        console.log('-------yunx', res.data);
         this.carinfo = res.data
       })
     },
@@ -91,9 +96,9 @@ export default {
 <style lang="less" scoped>
 .fire {
   width: 350px;
-  height: 223px;
+  height: 253px;
   background: #fff;
-  margin-top: 10px;
+  margin-top: 5px;
   padding: 8px 10px;
   font-size: 14px;
   font-family: 'Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif';

+ 227 - 0
src/views/cardIot/components/Trajectory.vue

@@ -0,0 +1,227 @@
+<template>
+  <div>
+    <div class="main-tra">
+      <el-calendar style="height: 380px" v-model="nowdate">
+        <template slot="dateCell" slot-scope="{ date, data }">
+          <div style="width: 100%; height: 230px" @click="allcalendar(data)">
+            <div v-for="item in activeday" style="width: 0; height: 0px">
+              <!-- <el-badge v-if=" item.hasOverSpeed==true" ></el-badge> -->
+              <!-- <span>{{  item.hasOverSpeed}}</span> -->
+              <span class="line" v-if="data.day == item.datetime && item.hasOverSpeed == true"></span>
+              <span class="ls" v-if="data.day == item.datetime && item.traceable == true"></span>
+            </div>
+            <div class="spandate">{{ data.day.split('-').slice(2).join('-') }}</div>
+          </div>
+        </template>
+      </el-calendar>
+      <div style="height: 374px; padding: 0 10px">
+        <div>
+          <span style="margin-left: 10px; font-size: 16px; font-weight: bold">历史轨迹</span>
+          <div>
+            <el-table :data="tableData" style="width: 100%">
+              <el-table-column prop="startTime" label="开始日期" show-overflow-tooltip width="130"> </el-table-column>
+              <el-table-column prop="endTime" label="结束日期" show-overflow-tooltip width="130"> </el-table-column>      
+              <el-table-column label="操作" width="100">
+                <template slot-scope="scope">
+                  <el-button size="mini" @click="handleEdit( scope.row)">行驶轨迹</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </div>
+        <div style="margin-top: 10px;">
+          <span style="margin-left: 10px; font-size: 16px; font-weight: bold;">车辆报警</span>
+          <div>
+            <el-table :data="tableData1" style="width: 100%">
+              <el-table-column type="index" width="50" label="序号"> </el-table-column>
+              <el-table-column prop="desc" label="报警类型" width="130"> </el-table-column>
+              <el-table-column prop="datetime" label="时间" width="180"> </el-table-column>
+            </el-table>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import moment from 'moment'
+import { getCalendar,getCalendarDetail } from '@/api/iot'
+export default {
+  props: { values: String },
+  data() {
+    return {
+      activeday: [],
+      nowdate: new Date(),
+      carPlnum: '',
+      nowTime: moment(new Date()).format('YYYY-MM-DD'),
+      tableData: [],
+      tableData1: [],
+      emTime:{}
+    }
+  },
+  watch: {
+    values: {
+      handler(val) {
+        this.carPlnum = val
+      },
+      immediate: true,
+      deep: true,
+    },
+  },
+  computed: {
+    customPickerOptions() {
+      let that = this
+      return {
+        cellClassName(Date) {
+          if (that.customDateArr.includes(moment(Date).format('YYYY-MM-DD'))) {
+            // 自定义的类名, 自行确保这个类型的唯一性,以免覆盖样式
+            return 'custom_date_class'
+          }
+        },
+      }
+    },
+  },
+  methods: {
+    initCustomDate(Date) {
+      setTimeout(() => {
+        this.customDateArr = ['2023-10-24', '2023-09-27', '2023-10-10', '2023-10-15']
+      }, 100)
+    },
+    allcalendar(val) {
+        console.log('------点击',val);
+      this.nowTime = val.day
+      this.funCalendarDetail()
+    },
+    getActivityCalendar() {
+      const params = {
+        year: moment(this.nowdate).format('YYYY-MM-DD').substring(0, 4),
+        month: moment(this.nowdate).format('YYYY-MM-DD').substring(5, 7),
+        plateNumber: this.carPlnum,
+      }
+      getCalendar(params).then((response) => {
+        this.activeday = response.data
+        console.log(this.activeday)
+        //返回数据为日期以及该日期对应的事件个数,用标记显示
+      })
+    },
+    //轨迹
+    handleEdit(row) {
+    //   this.$emit('changeEmTime',row)
+    this.BUS.$emit('changeEmTime', row)
+    },
+    funCalendarDetail(){
+        const params = {
+        datetime:this.nowTime,
+        plateNumber: this.carPlnum,
+      }
+        getCalendarDetail(params).then(res=>{
+            let list=res.data.historicalTracks      
+            this.tableData=list
+            this.tableData1=res.data.vehicleAlarms
+        })
+    }
+  },
+  mounted() {
+    const prevBtn = document.querySelector('.el-calendar__button-group .el-button-group>button:nth-child(1)')
+    prevBtn.addEventListener('click', () => {
+      // 请求数据
+      if (this.carPlnum) {
+        this.getActivityCalendar()
+      }
+    })
+    // 修改今日为当月
+    var spanDoc = document.querySelector('.el-calendar__button-group .el-button-group>button:nth-child(2) span')
+    spanDoc.innerText = '当月'
+    spanDoc.addEventListener('click', () => {
+      this.nowdate = moment(new Date()).format('YYYY-MM-DD')
+      // 请求数据
+      if (this.carPlnum) {
+        this.getActivityCalendar()
+      }
+    })
+    // 点击下一个月
+    const nextBtn = document.querySelector('.el-calendar__button-group .el-button-group>button:nth-child(3)')
+    nextBtn.addEventListener('click', () => {
+      // 请求数据
+      if (this.carPlnum) {
+        this.getActivityCalendar()
+      }
+    })
+  },
+  created() {
+    if (this.carPlnum) {
+      this.getActivityCalendar()
+      this.funCalendarDetail()
+    }
+  },
+}
+</script>
+
+<style lang="less">
+.main-tra {
+  display: flex;
+  flex-direction: column;
+  background: #fff;
+  pointer-events: all;
+}
+.custom_date_class {
+  span {
+    background: #ea6151;
+    color: red;
+    border-radius: 50%;
+    color: #fff !important;
+    &:hover {
+      background-color: #409eff;
+    }
+  }
+  &::after {
+    content: '已标记';
+    display: inline-block;
+    position: absolute;
+    width: 100%;
+    font-size: 12px;
+    color: red;
+    bottom: -15px;
+    left: 0;
+    text-align: center;
+    white-space: nowrap;
+  }
+}
+.el-calendar-table .el-calendar-day {
+  height: 43px;
+  position: relative;
+  line-height: 30px;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+}
+.line {
+  width: 5px;
+  height: 5px;
+  border-radius: 100% !important;
+  background-color: #ea6151;
+  position: absolute;
+  top: 34px;
+  left: 29px;
+}
+.ls {
+  width: 5px;
+  height: 5px;
+  border-radius: 100% !important;
+  background-color: #1be736;
+  position: absolute;
+  top: 34px;
+  left: 20px;
+}
+.el-calendar-table thead th {
+  text-align: center;
+}
+.el-calendar-table {
+  text-align: center;
+}
+.el-table th.el-table__cell.is-leaf {
+    text-align: center;
+}
+</style>

+ 29 - 10
src/views/cardIot/components/TreeCar.vue

@@ -117,14 +117,19 @@
       <div>videoid---------{{ videoid }}</div>
       <div>carIds---------{{ carIds }}</div>
     v-if="videoid || showFlag != false&&carIds" -->
-      <div v-if="treeShow && treeShow == 1">
-        <div v-if="showFlag == true || (carIds && !showBtn)">
-          <Video :carInfo="carInfo" :videoid="videoid" />
-          <!-- 机构详情 -->
-          <FireStationDetails :deptIds="deptIds" />
-          <!-- 油箱 -->
-          <!-- <QuantityOil /> -->
-          <QuantityOil />
+      <div v-if="treeShow && treeShow == 1" style="display: flex">
+        <div>
+          <div v-if="showFlag == true || (carIds && !showBtn)">
+            <Video :carInfo="carInfo" :videoid="videoid" />
+            <!-- 机构详情 -->
+            <FireStationDetails :deptIds="deptIds" />
+            <!-- 油箱 -->
+            <!-- <QuantityOil /> -->
+            <QuantityOil />
+          </div>
+        </div>
+        <div v-if="showFlag == true || (carIds && !showBtn)" class="tra-info">
+          <Trajectory :values="values"  />
         </div>
       </div>
     </div>
@@ -140,6 +145,7 @@ import QuantityOil from './QuantityOil.vue'
 import FireStationDetails from './FireStationDetails.vue'
 import LunarOverspeed from './LunarOverspeed.vue'
 import OfCarUseNum from './OfCarUseNum.vue'
+import Trajectory from './Trajectory.vue'
 const getParentKey = (key, tree) => {
   let parentKey
   for (let i = 0; i < tree.length; i++) {
@@ -155,7 +161,7 @@ const getParentKey = (key, tree) => {
   return parentKey
 }
 export default {
-  components: { Statistics, Video, FireStationDetails, QuantityOil, LunarOverspeed, OfCarUseNum },
+  components: { Statistics, Video, FireStationDetails, QuantityOil, LunarOverspeed, OfCarUseNum, Trajectory },
   props: {
     carId: String,
     showVideos: Boolean,
@@ -231,6 +237,7 @@ export default {
       showFlag: null,
       treeShow: null,
       carIds: '',
+      emTime:{},
       OfDeptId: 'dept#100', //用车次数-超速
     }
   },
@@ -294,7 +301,6 @@ export default {
       this.deptIds = carID
       this.$emit('changeCar', carID)
       this.OfDeptId = node[0]
-      console.log(this.OfDeptId);
       if (this.deptIds.key.indexOf('dept') < 0) {
         this.showBtn = false
       } else if (this.deptIds.key.indexOf('dept') >= 0) {
@@ -321,6 +327,10 @@ export default {
       this.carInfo = val
       this.videoid = val.cqVehicleId
     },
+    //轨迹时间
+    // changeEmTime(node){
+    //   this.emTime=node
+    // }
     // FunCarLocitin() {
     //   getCarLocation().then((res) => {})
     // },
@@ -391,4 +401,13 @@ export default {
 ::-webkit-scrollbar {
   width: 4px;
 }
+.tra-info {
+  position: fixed;
+  right: 2.2%;
+  top: 20%;
+  width: 390px;
+  height: 600px;
+  background: #fff;
+  z-index: 999999999;
+}
 </style>

+ 1 - 0
src/views/cardIot/index.vue

@@ -102,6 +102,7 @@ export default {
       this.carTreeShow=2
     }
   },
+
 }
 </script>
 

+ 0 - 1
src/views/clw/KeyCase/modules/OpenCabinet.vue

@@ -162,7 +162,6 @@ export default {
     /** 提交按钮 */
     handleEdit() {
       if (this.formType == 1 && this.values == 2) {
-        console.log('-------', this.value)
         this.paramsInfo = {
           boxId: this.flag.id,
           status: null,

+ 1 - 1
src/views/clw/applyCarLog/index.vue

@@ -79,7 +79,7 @@
           <dict-tag :options="dict.type['apply_status']" :value="record.applyStatus" />
         </span>
         <span slot="remark" slot-scope="text, record">
-         <span>{{ record.remark?record.remark:'' }}</span>
+         <span>{{ record.remark&&record.remark!=='null'?record.remark:'' }}</span>
         </span>
         <span slot="isNonfixedPoint" slot-scope="text, record">
           <dict-tag :options="dict.type['cmmon_yes_no']" :value="record.isNonfixedPoint" />

+ 98 - 89
src/views/system/role/authUser.vue

@@ -7,12 +7,12 @@
           <a-row :gutter="48">
             <a-col :md="8" :sm="24">
               <a-form-item label="用户名称">
-                <a-input v-model="queryParam.userName" placeholder="请输入" allow-clear/>
+                <a-input v-model="queryParam.userName" placeholder="请输入" allow-clear />
               </a-form-item>
             </a-col>
             <a-col :md="8" :sm="24">
               <a-form-item label="手机号码">
-                <a-input v-model="queryParam.phonenumber" placeholder="请输入" allow-clear/>
+                <a-input v-model="queryParam.phonenumber" placeholder="请输入" allow-clear />
               </a-form-item>
             </a-col>
             <a-col :md="8" :sm="24">
@@ -30,7 +30,13 @@
           <a-icon type="plus" />
           添加用户
         </a-button>
-        <a-button type="danger" :loading="authing" :disabled="multiple" @click="cancelAuthUserAll" v-hasPermi="['system:role:remove']">
+        <a-button
+          type="danger"
+          :loading="authing"
+          :disabled="multiple"
+          @click="cancelAuthUserAll"
+          v-hasPermi="['system:role:remove']"
+        >
           <a-icon type="delete" />
           取消批量授权
         </a-button>
@@ -39,11 +45,12 @@
           返回
         </a-button>
         <table-setting
-          :style="{float: 'right'}"
+          :style="{ float: 'right' }"
           :table-size.sync="tableSize"
           v-model="columns"
           :refresh-loading="loading"
-          @refresh="getList" />
+          @refresh="getList"
+        />
       </div>
       <select-user
         ref="selectUser"
@@ -60,9 +67,10 @@
         :data-source="list"
         :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
         :pagination="false"
-        :bordered="tableBordered">
+        :bordered="tableBordered"
+      >
         <span slot="status" slot-scope="text, record">
-          <dict-tag :options="dict.type['sys_normal_disable']" :value="record.status"/>
+          <dict-tag :options="dict.type['sys_normal_disable']" :value="record.status" />
         </span>
         <span slot="createTime" slot-scope="text, record">
           {{ parseTime(record.createTime) }}
@@ -82,16 +90,22 @@
         :current="queryParam.pageNum"
         :total="total"
         :page-size="queryParam.pageSize"
-        :showTotal="total => `共 ${total} 条`"
+        :showTotal="(total) => `共 ${total} 条`"
         @showSizeChange="onShowSizeChange"
         @change="changeSize"
       />
     </a-card>
+    <a-modal width="30%" :label-col="4" :wrapper-col="8" :visible="visible" @cancel="onClose">
+      <span>是否确认取消授权</span>
+      <div slot="footer">
+        <a-button type="primary" @click="handleEdit">确定</a-button>
+        <a-button @click="onClose">取消</a-button>
+      </div>
+    </a-modal>
   </page-header-wrapper>
 </template>
 
 <script>
-
 import { allocatedUserList, authUserCancel, authUserCancelAll } from '@/api/system/role'
 import CreateForm from './modules/CreateForm'
 import CreateDataScopeForm from './modules/CreateDataScopeForm'
@@ -103,11 +117,11 @@ export default {
   components: {
     CreateForm,
     CreateDataScopeForm,
-    SelectUser
+    SelectUser,
   },
   mixins: [tableMixin],
   dicts: ['sys_normal_disable'],
-  data () {
+  data() {
     return {
       list: [],
       selectedRowKeys: [],
@@ -120,6 +134,8 @@ export default {
       loading: false,
       authing: false,
       total: 0,
+      visible: false,
+      flag: '',
       // 日期范围
       dateRange: [],
       queryParam: {
@@ -127,165 +143,158 @@ export default {
         pageSize: 10,
         roleId: '',
         userName: undefined,
-        phonenumber: undefined
+        phonenumber: undefined,
       },
       columns: [
         {
           title: '用户名称',
           dataIndex: 'userName',
-          align: 'center'
+          align: 'center',
         },
         {
           title: '用户昵称',
           dataIndex: 'nickName',
           ellipsis: true,
-          align: 'center'
+          align: 'center',
         },
         {
           title: '邮箱',
           dataIndex: 'email',
           ellipsis: true,
-          align: 'center'
+          align: 'center',
         },
         {
           title: '手机',
           dataIndex: 'phonenumber',
-          align: 'center'
+          align: 'center',
         },
         {
           title: '状态',
           dataIndex: 'status',
           scopedSlots: { customRender: 'status' },
-          align: 'center'
+          align: 'center',
         },
         {
           title: '创建时间',
           dataIndex: 'createTime',
           scopedSlots: { customRender: 'createTime' },
-          align: 'center'
+          align: 'center',
         },
         {
           title: '操作',
           dataIndex: 'operation',
           width: '20%',
           scopedSlots: { customRender: 'operation' },
-          align: 'center'
-        }
-      ]
+          align: 'center',
+        },
+      ],
+      infoRmeove: {},
     }
   },
-  filters: {
-  },
-  created () {
-  },
-  mounted () {
+  filters: {},
+  created() {},
+  mounted() {
     const roleId = this.$route.query && this.$route.query.roleId
     if (roleId) {
       this.queryParam.roleId = roleId
       this.getList()
     }
   },
-  computed: {
-  },
-  watch: {
-  },
+  computed: {},
+  watch: {},
   methods: {
     /** 查询授权用户列表 */
-    getList () {
+    getList() {
       this.loading = true
-      allocatedUserList(this.queryParam).then(response => {
+      allocatedUserList(this.queryParam).then((response) => {
         this.list = response.rows
         this.total = response.total
         this.loading = false
       })
     },
     /** 搜索按钮操作 */
-    handleQuery () {
+    handleQuery() {
       this.queryParam.pageNum = 1
       this.getList()
     },
+    //取消
+    onClose() {
+      this.visible = false
+    },
     /** 重置按钮操作 */
-    resetQuery () {
+    resetQuery() {
       this.dateRange = []
       this.queryParam = {
         pageNum: 1,
         pageSize: 10,
         roleId: this.queryParam.roleId,
         userName: undefined,
-        phonenumber: undefined
+        phonenumber: undefined,
       }
       this.handleQuery()
     },
-    onShowSizeChange (current, pageSize) {
+    onShowSizeChange(current, pageSize) {
       this.queryParam.pageSize = pageSize
       this.getList()
     },
-    changeSize (current, pageSize) {
+    changeSize(current, pageSize) {
       this.queryParam.pageNum = current
       this.queryParam.pageSize = pageSize
       this.getList()
     },
-    onSelectChange (selectedRowKeys, selectedRows) {
+    onSelectChange(selectedRowKeys, selectedRows) {
       this.selectedRowKeys = selectedRowKeys
       this.selectedRows = selectedRows
-      this.ids = this.selectedRows.map(item => item.userId)
+      this.ids = this.selectedRows.map((item) => item.userId)
       this.single = selectedRowKeys.length !== 1
       this.multiple = !selectedRowKeys.length
     },
     /** 取消授权按钮操作 */
-    cancelAuthUser (row) {
-      var that = this
-      const userName = row.userName
-      const roleId = this.queryParam.roleId
-      this.$confirm({
-        title: '确认要取消该用户的角色吗?',
-        content: '当前选中用户' + userName,
-        onOk () {
-          const param = {
-            userId: row.userId,
-            roleId: roleId
-          }
-          return authUserCancel(param).then(() => {
-            that.onSelectChange([], [])
-            that.getList()
-            that.$message.success(
-              '取消授权成功',
-              3
-            )
-          })
-        },
-        onCancel () {}
-      })
+    cancelAuthUser(row) {
+      this.visible = true
+      this.infoRmeove = row
+      this.flag = 1
+    },
+    handleEdit() {
+      console.log(this.infoRmeove)
+      if (this.flag == 1) {
+        const userName = this.infoRmeove.userName
+        const roleId = this.queryParam.roleId
+        const param = {
+          userId: this.infoRmeove.userId,
+          roleId: roleId,
+        }
+        authUserCancel(param).then(() => {
+          this.onSelectChange([], [])
+          this.getList()
+          this.$message.success('取消授权成功', 3)
+        })
+      } else if (this.flag == 2) {
+        const roleId = this.queryParam.roleId
+            const param = {
+              roleId: roleId,
+              userIds: this.ids,
+            }
+            return authUserCancelAll(param)
+              .then(() => {
+                this.onSelectChange([], [])
+                this.getList()
+                this.$message.success('取消授权成功', 3)
+              })
+              .finally(() => {
+                this.visible = false
+              })
+      }
+      this.visible = false
     },
     /** 批量取消授权按钮操作 */
-    cancelAuthUserAll () {
-      var that = this
-      const roleId = this.queryParam.roleId
-      this.$confirm({
-        title: '是否取消选中用户授权数据项?',
-        onOk () {
-          const param = {
-            roleId: roleId,
-            userIds: that.ids
-          }
-          that.authing = true
-          return authUserCancelAll(param).then(() => {
-            that.onSelectChange([], [])
-            that.getList()
-            that.$message.success(
-              '取消授权成功',
-              3
-            )
-          }).finally(() => {
-            this.authing = false
-          })
-        },
-        onCancel () {}
-      })
+    cancelAuthUserAll() {
+      this.flag = 2
+      this.visible = true
     },
-    back () {
+    back() {
       this.$router.push({ path: '/system/role' })
-    }
-  }
+    },
+  },
 }
 </script>

+ 33 - 40
src/views/system/role/index.vue

@@ -5,7 +5,7 @@
       <div class="table-page-search-wrapper">
         <a-form layout="inline">
           <a-row :gutter="48">
-            <a-col :md="8" :sm="24">
+            <a-col :span="6">
               <a-form-item label="角色名称">
                 <a-input v-model="queryParam.roleName" placeholder="请输入" allow-clear />
               </a-form-item>
@@ -15,8 +15,8 @@
                 <a-input v-model="queryParam.roleKey" placeholder="请输入" allow-clear />
               </a-form-item>
             </a-col>
-            <template v-if="advanced">
-              <a-col :md="8" :sm="24">
+            <template >
+              <a-col :span="6">
                 <a-form-item label="状态">
                   <a-select placeholder="请选择" v-model="queryParam.status" style="width: 100%" allow-clear>
                     <a-select-option
@@ -28,7 +28,7 @@
                   </a-select>
                 </a-form-item>
               </a-col>
-              <a-col :md="8" :sm="24">
+              <a-col :span="6">
                 <a-form-item label="创建时间">
                   <a-range-picker
                     style="width: 100%"
@@ -40,33 +40,17 @@
                 </a-form-item>
               </a-col>
             </template>
-            <a-col :md="(!advanced && 8) || 24" :sm="24">
-              <span
-                class="table-page-search-submitButtons"
-                :style="(advanced && { float: 'right', overflow: 'hidden' }) || {}"
-              >
+            <a-col :span="8"> 
                 <a-button type="primary" @click="handleQuery"><a-icon type="search" />查询</a-button>
                 <a-button style="margin-left: 8px" @click="resetQuery"><a-icon type="redo" />重置</a-button>
-                <a @click="toggleAdvanced" style="margin-left: 8px">
-                  {{ advanced ? '收起' : '展开' }}
-                  <a-icon :type="advanced ? 'up' : 'down'" />
-                </a>
-              </span>
+                <a-button style="margin:0 8px;" type="primary" @click="handleAdd"> <a-icon type="plus" />新增 </a-button>
+                <a-button  type="danger" @click="handleDelete"> <a-icon type="delete" />删除 </a-button>
             </a-col>
           </a-row>
         </a-form>
       </div>
       <!-- 操作 -->
       <div class="table-operations">
-        <!-- <a-button type="primary" @click="$refs.createForm.handleAdd()" v-hasPermi="['system:role:add']">
-          <a-icon type="plus" />新增
-        </a-button>
-        <a-button type="primary" :disabled="single" @click="$refs.createForm.handleUpdate(undefined,ids)" v-hasPermi="['system:role:edit']">
-          <a-icon type="edit" />修改
-        </a-button>
-        <a-button type="danger" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:role:remove']">
-          <a-icon type="delete" />删除
-        </a-button> -->
         <a-button type="primary" @click="handleExport" v-hasPermi="['system:role:export']">
           <a-icon type="download" />导出
         </a-button>
@@ -146,6 +130,7 @@
         @change="changeSize"
       />
     </a-card>
+   
   </page-header-wrapper>
 </template>
 
@@ -160,6 +145,7 @@ export default {
   components: {
     CreateForm,
     CreateDataScopeForm,
+    
   },
   mixins: [tableMixin],
   dicts: ['sys_normal_disable'],
@@ -264,6 +250,13 @@ export default {
       }
       this.handleQuery()
     },
+    //新增
+    handleAdd(){
+      this.$message.error('暂无权限')
+    },
+    handleDelete(){
+      return this.$message.error('暂无权限')
+    },
     onShowSizeChange(current, pageSize) {
       this.queryParam.pageSize = pageSize
       this.getList()
@@ -296,23 +289,23 @@ export default {
         })
     },
     cancelHandleStatus(row) {},
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      var that = this
-      const roleIds = row.roleId || this.ids
-      this.$confirm({
-        title: '确认删除所选中数据?',
-        content: '当前选中编号为' + roleIds + '的数据',
-        onOk() {
-          return delRole(roleIds).then(() => {
-            that.onSelectChange([], [])
-            that.getList()
-            that.$message.success('删除成功', 3)
-          })
-        },
-        onCancel() {},
-      })
-    },
+    // /** 删除按钮操作 */
+    // handleDelete(row) {
+    //   var that = this
+    //   const roleIds = row.roleId || this.ids
+    //   this.$confirm({
+    //     title: '确认删除所选中数据?',
+    //     content: '当前选中编号为' + roleIds + '的数据',
+    //     onOk() {
+    //       return delRole(roleIds).then(() => {
+    //         that.onSelectChange([], [])
+    //         that.getList()
+    //         that.$message.success('删除成功', 3)
+    //       })
+    //     },
+    //     onCancel() {},
+    //   })
+    // },
     /** 导出按钮操作 */
     handleExport() {
       this.$message.success('请稍等,正在导出')

+ 43 - 37
src/views/system/user/index.vue

@@ -2,7 +2,7 @@
   <page-header-wrapper>
     <a-card :bordered="false">
       <a-row :gutter="24">
-        <a-col :span="6" style="overflow-y: scroll; height: 700px;">
+        <a-col :span="6" style="overflow-y: scroll; height: 700px">
           <!-- 部门树 -->
           <dept-tree ref="deptTree" :deptOptions="deptOptions" @select1="clickDeptNode" />
         </a-col>
@@ -26,12 +26,9 @@
                     <a-form-item label="状态" prop="status">
                       <a-select placeholder="请选择状态" style="width: 100%" allow-clear @change="handleChange">
                         <!-- dict.type['sys_normal_disable']"  -->
-                        <a-select-option
-                          v-for="(d, index) in statusList"
-                          :key="index"
-                          :value="d.val" 
-                          >{{ d.lable }}</a-select-option
-                        >
+                        <a-select-option v-for="(d, index) in statusList" :key="index" :value="d.val">{{
+                          d.lable
+                        }}</a-select-option>
                       </a-select>
                     </a-form-item>
                   </a-col>
@@ -64,6 +61,8 @@
             <a-button type="primary" @click="handleExport" v-hasPermi="['system:user:export']">
               <a-icon type="download" />导出
             </a-button>
+            <a-button type="primary" @click="handleAdd"> <a-icon type="plus" />新增 </a-button>
+            <a-button type="danger" @click="handleDelete"> <a-icon type="delete" />删除 </a-button>
             <table-setting
               :style="{ float: 'right' }"
               :table-size.sync="tableSize"
@@ -111,7 +110,7 @@
                 详情
               </a>
               <a-divider type="vertical" v-hasPermi="['system:user:remove']" />
-              <a @click="$refs.createForm.handleEdit(record,2)" v-hasPermi="['system:user:remove']">
+              <a @click="$refs.createForm.handleEdit(record, 2)" v-hasPermi="['system:user:remove']">
                 <a-icon type="edit" />
                 编辑
               </a>
@@ -251,16 +250,16 @@ export default {
           align: 'center',
         },
       ],
-      statusList:[
-       {
-        val:'0',
-        lable:'正常'
-       },
-       {
-        val:'1',
-        lable:'停用'
-       }
-      ]
+      statusList: [
+        {
+          val: '0',
+          lable: '正常',
+        },
+        {
+          val: '1',
+          lable: '停用',
+        },
+      ],
     }
   },
   filters: {},
@@ -286,8 +285,8 @@ export default {
         this.deptOptions = response.data
       })
     },
-    handleChange(val){
-      this.queryParam.status=val
+    handleChange(val) {
+      this.queryParam.status = val
     },
     getTreeselect() {},
     /** 搜索按钮操作 */
@@ -331,6 +330,13 @@ export default {
       this.queryParam.deptId = deptId
       this.handleQuery()
     },
+    //新增
+    handleAdd() {
+      return this.$message.error('暂无权限')
+    },
+    handleDelete(){
+      return this.$message.error('暂无权限')
+    },
     /* 用户状态修改 */
     confirmHandleStatus(row) {
       const text = row.status === '1' ? '启用' : '关闭'
@@ -344,23 +350,23 @@ export default {
         })
     },
     cancelHandleStatus(row) {},
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      var that = this
-      const userIds = row.userId || this.ids
-      this.$confirm({
-        title: '确认删除所选中数据?',
-        content: '当前选中编号为' + userIds + '的数据',
-        onOk() {
-          return delUser(userIds).then(() => {
-            that.onSelectChange([], [])
-            that.getList()
-            that.$message.success('删除成功', 3)
-          })
-        },
-        onCancel() {},
-      })
-    },
+    // /** 删除按钮操作 */
+    // handleDelete(row) {
+    //   var that = this
+    //   const userIds = row.userId || this.ids
+    //   this.$confirm({
+    //     title: '确认删除所选中数据?',
+    //     content: '当前选中编号为' + userIds + '的数据',
+    //     onOk() {
+    //       return delUser(userIds).then(() => {
+    //         that.onSelectChange([], [])
+    //         that.getList()
+    //         that.$message.success('删除成功', 3)
+    //       })
+    //     },
+    //     onCancel() {},
+    //   })
+    // },
     /** 导出按钮操作 */
     handleExport() {
       this.$message.success('请稍后,正在导出')

+ 1 - 1
vue.config.js

@@ -111,7 +111,7 @@ const vueConfig = {
       [process.env.VUE_APP_BASE_API]: {
         // target: `https://ruoyi.setworld.net`,
         // target: `http://113.249.153.164:7618/api`,
-        target:`http://172.20.16.92:8081/`,
+        target:`http://172.20.16.92:8080/`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''