Browse Source

样式调整

wt 3 years ago
parent
commit
5510e410de

+ 1 - 1
public/static/config.js

@@ -2,7 +2,7 @@
  * @Author: wt 1241351815@qq.com
  * @Date: 2022-04-25 10:21:18
  * @LastEditors: wt 1241351815@qq.com
- * @LastEditTime: 2022-05-11 15:40:00
+ * @LastEditTime: 2022-05-13 15:02:51
  * @FilePath: \securityHtml\public\static\config.js
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */

+ 1 - 1
src/App.vue

@@ -2,7 +2,7 @@
  * @Author: wt 1241351815@qq.com
  * @Date: 2022-04-25 10:21:18
  * @LastEditors: wt 1241351815@qq.com
- * @LastEditTime: 2022-05-11 09:14:38
+ * @LastEditTime: 2022-05-12 18:36:47
  * @FilePath: \securityHtml\src\App.vue
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 -->

+ 4 - 4
src/store/index.js

@@ -117,7 +117,7 @@ const actions = {
                         path: (data[i].path).slice(1, 8),
                         component: Layout,
                         redirect: (data[i].path).slice(1, 8),
-                        name: data[i].name,
+                        name: "",
                         meta: {
                             title: data[i].meta.title,
                             icon: data[i].meta.icon
@@ -126,11 +126,10 @@ const actions = {
                     })
                     for (let j = 0; j < data[i].children.length; j++) {
                         var new_response = data[i].children[j].meta
-                        //var url = (data[i].children[j].path).slice(8, -2)
                         var url = data[i].children[j].path
                         arrayList[i].children.push({
                             path: url,
-                            name: new_response.title,
+                            name: '',
                             component: (resolve) => require([`@/views${data[i].children[j].path}`], resolve),
                             meta: {
                                 title: new_response.title,
@@ -153,7 +152,7 @@ const actions = {
                             redirect: '/index',
                             children: [{
                                 path: 'index',
-                                name: 'index',
+                                name: '',
                                 component: () =>
                                     import ('@/views/index/index'),
                                 meta: { title: '首页', icon: 'home' }
@@ -174,6 +173,7 @@ const actions = {
                 arrayList.push(footer)
                 router.options.routes = arrayList
                 state.app.routes = router.options.routes
+               
                 router.addRoutes(arrayList)
 
             }).catch(error => {

+ 1 - 1
src/styles/index.scss

@@ -317,7 +317,7 @@ div:focus {
 }
 
 .el-dialog__body {
-    height: 600px!important;
+    max-height: 600px!important;
     overflow: auto;
 }
 

+ 1 - 1
src/utils/request.js

@@ -2,7 +2,7 @@
  * @Author: wt 1241351815@qq.com
  * @Date: 2022-04-25 10:21:19
  * @LastEditors: wt 1241351815@qq.com
- * @LastEditTime: 2022-05-09 13:23:41
+ * @LastEditTime: 2022-05-12 18:19:11
  * @FilePath: \securityHtml\src\utils\request.js
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */

+ 1 - 1
src/views/MochaITOM/crew/index.vue

@@ -7,7 +7,7 @@
           placeholder="请输入班组名称"
           clearable
           size="small"
-          style="width: 140px"
+          style="width: 160px"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>

+ 8 - 7
src/views/MochaITOM/plan/index.vue

@@ -7,7 +7,7 @@
           placeholder="请输入计划名称"
           clearable
           size="small"
-          style="width: 140px"
+          style="width: 160px"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
@@ -34,7 +34,7 @@
     <el-table v-loading="loading" :data="adminList" :max-height="tableHeight">
       <el-table-column label="计划名称" align="center" prop="name"  show-overflow-tooltip />
       <el-table-column label="周期" align="center" prop="cycle"  show-overflow-tooltip >
-       <template slot-scope="scope">
+        <template slot-scope="scope">
           <span>{{scope.row.cycle == 1 ? "日" : scope.row.cycle == 2 ? "周" : "月"}}</span>
         </template>
       </el-table-column>
@@ -75,7 +75,6 @@
               <el-select
                 v-model="form.teamId"
                 placeholder="请选择执行班组"
-                clearable
                 size="small"
                 style="width: 160px"
               >
@@ -114,7 +113,6 @@
               <el-select
                 v-model="form.startInspectTime"
                 placeholder="请选择开始时间"
-                clearable
                 size="small"
                 style="width: 160px"
               >
@@ -131,8 +129,7 @@
             <el-form-item label="执行结束时间" prop="endInspectTime">
               <el-select
                 v-model="form.endInspectTime"
-                placeholder="请选择执行结束时间"
-                clearable
+                placeholder="请选择结束时间"
                 size="small"
                 style="width: 160px"
               >
@@ -150,7 +147,6 @@
               <el-select
                 v-model="form.cycle"
                 placeholder="请选择周期"
-                clearable
                 size="small"
                 style="width: 160px;"
                 
@@ -521,3 +517,8 @@ export default {
   }
 };
 </script>
+<style lang="scss" scoped>
+.el-input__prefix{
+  top:0px !important
+}
+</style>

+ 3 - 6
src/views/MochaITOM/point/index.vue

@@ -7,7 +7,7 @@
           placeholder="请输入点位名称"
           clearable
           size="small"
-          style="width: 140px"
+          style="width: 160px"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
@@ -17,7 +17,7 @@
           placeholder="请输入点位地址"
           clearable
           size="small"
-          style="width: 140px"
+          style="width: 160px"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
@@ -98,7 +98,6 @@
               <el-select
                 v-model="form.vidCode"
                 placeholder="请选择摄像头名称"
-                clearable
                 size="small"
                 style="width: 160px"
               >
@@ -170,10 +169,8 @@
 <script>
 import QRCode from 'qrcodejs2'
 import { fileUpload } from "@/api/uploadfile.js";
-// import { getPlanPath } from "@/api/MochaITOM/route";
 import { addInspectionPoint, delInspectionPoint, updateInspectionPoint, getInspectionPoint, exportInspectionPoint } from "@/api/MochaITOM/point";
-import { getLocalDeviceList, getLocalUnitNodes,  getLocalChannel, getDhDeviceListNew } from "@/api/device/camera";
-import { YearMonthDateSFN } from "@/assets/js/dataFormate.js";
+import { getLocalChannel, } from "@/api/device/camera";
 export default {
   name: "Floor",
   data() {

+ 1 - 1
src/views/MochaITOM/route/index.vue

@@ -7,7 +7,7 @@
           placeholder="请输入路线名称"
           clearable
           size="small"
-          style="width: 140px"
+          style="width: 160px"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>

+ 4 - 2
src/views/alarm/alarm-log/index.vue

@@ -8,16 +8,18 @@
             v-model="query.guardCode"
             placeholder="请输入防区名"
             style="width: 150px"
+            clearable
           ></el-input>
         </div>
         <div class="filter-item">
           处理状态:
-          <el-select v-model="status_value" placeholder="请选择处理状态" style="width: 150px" @change="select_status">
+          <el-select v-model="status_value" placeholder="请选择处理状态" style="width: 160px" @change="select_status" clearable>
             <el-option
               v-for="item in status"
               :key="item.value"
               :label="item.label"
               :value="item.value"
+              
             >
             </el-option>
           </el-select>
@@ -173,7 +175,7 @@ export default {
         },
       ],
       //存储处理状态值
-      status_value: "",
+      status_value: undefined,
       //存储防区名
       guardCode_value: "",
       query:{

+ 4 - 1
src/views/alarm/alarm-task/index.vue

@@ -8,6 +8,7 @@
             v-model="query.UserName"
             placeholder="请输入实际班组"
             style="width: 150px"
+            clearable
           ></el-input>
         </div>
         <div class="filter-item">
@@ -15,7 +16,8 @@
           <el-input
             v-model="query.eTeamName"
             placeholder="请输入实际巡更人"
-            style="width: 150px"
+            style="width: 160px"
+            clearable
           ></el-input>
         </div>
         <div class="filter-item">
@@ -24,6 +26,7 @@
             v-model="query.eLName"
             placeholder="请输入线路名称"
             style="width: 150px"
+            clearable
           ></el-input>
         </div>
         <el-button

+ 4 - 1
src/views/device/camera/index.vue

@@ -8,6 +8,7 @@
             v-model="query.deviceId"
             placeholder="请输入设备id"
             style="width: 150px"
+            clearable
           ></el-input>
         </div>
         <div class="filter-item">
@@ -16,6 +17,7 @@
             v-model="query.id"
             placeholder="请输入通道id"
             style="width: 150px"
+            clearable
           ></el-input>
         </div>
         <div class="filter-item">
@@ -24,6 +26,7 @@
             v-model="query.name"
             placeholder="请输入通道名称"
             style="width: 150px"
+            clearable
           ></el-input>
         </div>
         <div class="filter-item">
@@ -33,7 +36,7 @@
               placeholder="请选择通道状态"
               clearable
               size="small"
-               style="width: 150px"
+              style="width: 150px"
             >
               <el-option
                 v-for="dict in statusOptions"

+ 3 - 0
src/views/device/camera2/index.vue

@@ -9,6 +9,7 @@
             v-model="query.code"
             placeholder="请输入设备id"
             style="width: 150px"
+            clearable
           ></el-input>
         </div>
         <div class="filter-item">
@@ -17,6 +18,7 @@
             v-model="query.name"
             placeholder="请输入设备名称"
             style="width: 150px"
+            clearable
           ></el-input>
         </div>
         <div class="filter-item">
@@ -25,6 +27,7 @@
             v-model="query.unit"
             placeholder="请输入单位名称"
             style="width: 150px"
+            clearable
           ></el-input>
         </div>
         <el-button

+ 3 - 0
src/views/device/guard/index.vue

@@ -8,6 +8,7 @@
             v-model="query.deviceNum"
             placeholder="请输入设备编号"
             style="width: 150px"
+            clearable
           ></el-input>
         </div>
         <div class="filter-item">
@@ -16,6 +17,7 @@
             v-model="query.deviceName"
             placeholder="请输入设备名称"
             style="width: 150px"
+            clearable
           ></el-input>
         </div>
         <div class="filter-item">
@@ -24,6 +26,7 @@
             v-model="query.addr"
             placeholder="请输入设备地址"
             style="width: 150px"
+            clearable
           ></el-input>
         </div>
         <div class="filter-item">

+ 0 - 1
src/views/index/components/monitor.vue

@@ -141,7 +141,6 @@
       :src="iframe_Url"
       :style="'width:' + width + ';'"
     ></iframe>
-
   </div>
 </template>
 <script>

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

@@ -8,7 +8,6 @@
         </transition>
         <monitor :width="width"  v-if="monitorStatus" @monitorChange="monitorChange"></monitor>
       </div>
-
       <transition name="fade1">
         <div class="column2" v-if="show">
           <alarm-static></alarm-static>

+ 3 - 0
src/views/patrol/elect-partol/index.vue

@@ -8,6 +8,7 @@
             v-model="query.eTeamName"
             placeholder="请输入实际班组"
             style="width: 150px"
+            clearable
           ></el-input>
         </div>
         <div class="filter-item">
@@ -16,6 +17,7 @@
             v-model="query.UserName"
             placeholder="请输入实际巡更人"
             style="width: 150px"
+            clearable
           ></el-input>
         </div>
         <div class="filter-item">
@@ -24,6 +26,7 @@
             v-model="query.eLName"
             placeholder="请输入线路名称"
             style="width: 150px"
+            clearable
           ></el-input>
         </div>
 

+ 1 - 0
src/views/patrol/partol-plan/index.vue

@@ -9,6 +9,7 @@
             placeholder="请选择计划模式"
             @change="select"
             style="width: 150px"
+            clearable
           >
             <el-option
               v-for="(item, index) in pMode_list"

+ 2 - 1
src/views/patrol/patrol-point/index.vue

@@ -7,7 +7,8 @@
           <el-input
             v-model="query.ptName"
             placeholder="请输入点位名称"
-            style="width: 140px"
+            style="width: 160px"
+            clearable
           ></el-input>
         </div>
         <el-button

+ 2 - 1
src/views/patrol/patrol-route/index.vue

@@ -7,7 +7,8 @@
           <el-input
             v-model="query.lName"
             placeholder="请输入路线名称"
-            style="width: 140px"
+            style="width: 160px"
+            clearable
           ></el-input>
         </div>
         <el-button

+ 24 - 14
src/views/system/auth-manage/index.vue

@@ -11,8 +11,9 @@
                   菜单名称:
                   <el-input
                     v-model="menuQuery.menuName"
-                    style="width: 140px"
+                    style="width: 160px"
                     placeholder="请输入菜单名称"
+                    clearable
                   ></el-input>
                 </div>
                 <el-button
@@ -41,6 +42,7 @@
               row-key="menuId"
               :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
               style="margin-top: 10px"
+              :max-height="tableHeight"
             >
               <el-table-column
                 prop="menuName"
@@ -278,7 +280,8 @@
                   <el-input
                     v-model="roleListQuery.roleName"
                     placeholder="请输入角色名称"
-                    style="width: 140px"
+                    style="width: 160px"
+                    clearable
                   ></el-input>
                 </div>
                 <el-button
@@ -309,6 +312,7 @@
               v-loading="loading"
               :data="roleListAdmin"
               style="margin-top: 10px"
+              :max-height="tableHeight"
             >
               <el-table-column label="角色编号" prop="roleId" />
               <el-table-column
@@ -427,6 +431,7 @@
                         v-model="roleForm.roleSort"
                         controls-position="right"
                         :min="0"
+                        style="width:170px"
                       />
                     </el-form-item>
                   </el-col>
@@ -706,6 +711,7 @@ export default {
       },
       menuFormHC: {},
       roleTitle: undefined,
+      tableHeight:undefined,
     };
   },
   watch: {
@@ -721,6 +727,19 @@ export default {
     }
     this.tabChange();
   },
+  mounted() {
+    // table高度
+    if(window.innerWidth <1920){
+      this.tableHeight = window.innerHeight - 300
+    }else{
+      this.tableHeight = window.innerHeight - 295
+    }
+    // 监听窗口大小变化
+    let self = this;
+    window.onresize = function() {
+      self.tableHeight = window.innerHeight - 300
+    }
+  },
   methods: {
     /**
      * 菜单切换
@@ -804,12 +823,11 @@ export default {
               }
             }
           }
-          console.log(arr)
           this.menuOptions = arr;
         }
+        this.dialogFormVisible2 = true;
       });
     },
-
     // 所有菜单节点数据
     getMenuAllCheckedKeys() {
       // 目前被选中的菜单节点
@@ -819,7 +837,6 @@ export default {
       checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
       return checkedKeys;
     },
-
     /** 根据角色ID查询菜单树结构 */
     getRoleMenuTreeselect(roleId) {
       return roleMenuTree(roleId).then((response) => {
@@ -847,12 +864,11 @@ export default {
             }
           }
           this.menuOptions = arr;
+          this.dialogFormVisible2 = true;
         }
         return response;
       });
     },
-
-    
     handleCheckedTreeExpand(value, type) {
       if (type == "menu") {
         let treeList = this.menuOptions;
@@ -906,7 +922,6 @@ export default {
           });
         });
     },
-
     batchDelete() {
       let multData = this.multipleSelection;
       let tableData = this.tableData;
@@ -986,7 +1001,6 @@ export default {
         this.roleTitle = "新增角色";
         this.roleForm.menuCheckStrictly = true;
         this.getMenuTreeselect();
-        this.dialogFormVisible2 = true;
       } else {
         const roleId = row.roleId || this.ids;
         const roleName = row.roleName;
@@ -994,7 +1008,6 @@ export default {
         roleList({ roleName: roleName }).then((response) => {
           this.roleForm = response.data.pageList[0];
           this.roleForm.menuCheckStrictly = true;
-          this.dialogFormVisible2 = true;
           this.$nextTick(() => {
             roleMenu.then((res) => {
               let checkedKeys = res.data.checkedKeys;
@@ -1095,7 +1108,6 @@ export default {
         }
       });
     },
-
     menuSubmit() {
       //菜单提交
       if (this.dialogFormVisible1 == true) {
@@ -1172,7 +1184,6 @@ export default {
         // this.menuForm.parentId = 0
         // this.menuForm.menuType = "M"
       }
-      this.dialogFormVisible1 = true;
       this.menutitle = "添加菜单";
     },
     /** 删除按钮操作 */
@@ -1230,6 +1241,7 @@ export default {
           const menu = { menuId: 0, menuName: "主类目", children: [] };
           menu.children = this.handleTree(Response.data, "menuId");
           this.menuOptions.push(menu);
+          this.dialogFormVisible1 = true;
         }
       });
     },
@@ -1289,8 +1301,6 @@ export default {
       this.menuFormReset()
 
     },
-
-
     /** 重置按钮操作 */
     resetQuery() {
       this.roleListQuery = {

+ 2 - 1
src/views/system/organization/index.vue

@@ -7,7 +7,8 @@
           <el-input
             v-model="queryForm.deptName"
             placeholder="请输入部门名称"
-            style="width: 140px"
+            style="width: 160px"
+            clearable
           ></el-input>
         </div>
 

+ 65 - 26
src/views/system/security/index.vue

@@ -21,6 +21,13 @@
       </template>
       </el-table-column>
       <el-table-column label="账号锁定次数" prop="lockNumber" />
+      <el-table-column label="锁定时间" prop="loseDate" >
+        <template slot-scope="scope">
+          <span>{{scope.row.loseDate == 1 ? "1分钟" : scope.row.loseDate == 5 ? "5分钟" 
+            : scope.row.loseDate == 15 ? "15分钟" : scope.row.loseDate == 30 ? "30分钟" : scope.row.loseDate == 120 ? "2小时" 
+            : scope.row.loseDate == 1440 ? "1天" : ""}}</span>
+        </template>
+      </el-table-column>
       <el-table-column label="默认账户" align="center" >
         <template slot-scope="scope">
           <el-switch
@@ -53,41 +60,58 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['system:role:edit']"
           >修改</el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['system:role:remove']"
           >删除</el-button>
         </template>
       </el-table-column>
     </el-table>
-
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <el-pagination
+      background
+      @current-change="handleCurrentChange"
+      :page-sizes="[5, 10, 15, 20]"
+      @size-change="handleSizeChange"
+      :current-page="pageNo"
+      :page-size="pageSize"
+      layout="sizes,prev, pager, next"
+      :total="totalCount"
+    >
+    </el-pagination>
 
     <!-- 添加或修改角色配置对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :before-close="cancel" :close-on-click-modal="false">
+    <el-dialog :title="title" :visible.sync="open" width="680px" append-to-body :before-close="cancel" :close-on-click-modal="false">
       <el-form ref="form" :model="form" :rules="rules" label-width="140px">
         <el-row>
-          <el-col :span="18">
+          <el-col :span="12">
             <el-form-item label="密码长度不少于" prop="pwdLength">
               <el-input-number v-model="form.pwdLength" controls-position="right" :min="0" :max="30" placeholder="请输入密码长度" />
             </el-form-item>
           </el-col>
-          <el-col :span="18">
+          <el-col :span="12">
             <el-form-item label="账号锁定次数" prop="lockNumber" >
               <el-input-number v-model="form.lockNumber" controls-position="right" :min="0" :max="10" placeholder="请输入账号锁定次数" />
             </el-form-item>
           </el-col>
+          <el-col :span="12">
+            <el-form-item label="锁定时间" prop="loseDate" >
+              <el-select
+                v-model="form.loseDate"
+                placeholder="请选择锁定时间"
+                size="small"
+              >
+                <el-option
+                  v-for="item in loseDateList"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
           <el-col :span="12">
             <el-form-item label="默认账户" prop="isEnable">
               <el-switch
@@ -127,8 +151,11 @@ export default {
       multiple: true,
       // 显示搜索条件
       showSearch: true,
-      // 总条数
-      total: 0,
+      //存储开始页
+      pageNo: 1,
+      //存储每页几条
+      pageSize:10,
+      totalCount:undefined,
       // 表格数据
       adminList: [],
       // 弹出层标题
@@ -160,8 +187,18 @@ export default {
         lockNumber: [
           { required: true, message: "锁定次数不能为空", trigger: ["blur",'change']}
         ],
-
-      }
+        loseDate:[
+          { required: true, message: "锁定时间不能为空", trigger: ["blur",'change']}
+        ]
+      },
+      loseDateList:[//锁定时间
+        {value:1,label:"1分钟"},
+        {value:5,label:"5分钟"},
+        {value:15,label:"15分钟"},
+        {value:30,label:"30分钟"},
+        {value:120,label:"2小时"},
+        {value:1440,label:"1天"},
+      ],
     };
   },
   created() {
@@ -174,9 +211,8 @@ export default {
       listAccountLock(this.queryParams).then(
         response => {
           this.adminList = response.data.pageList;
-          this.total = response.data.total;
+          this.totalCount = response.data.totalCount
           this.loading = false;
-          
         }
       );
     },
@@ -197,13 +233,6 @@ export default {
       this.queryParams.pageNum = 1;
       this.getList();
     },
-    /** 重置按钮操作 */
-    // resetQuery() {
-    //   this.dateRange = [];
-    //   this.resetForm("queryForm");
-    //   this.handleQuery();
-    // },
-
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
@@ -282,6 +311,16 @@ export default {
           this.msgSuccess("删除成功");
         }).catch(() => {});
     },
+    //分页查询
+    handleCurrentChange(val) {
+      this.pageNo = val;
+      this.getList()
+    },
+    //改变每条数
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.getList()
+    },
   }
 };
 </script>

+ 75 - 177
src/views/system/unit-info/index.vue

@@ -4,7 +4,7 @@
       <div class="filter-left">
         <div class="filter-item">
           单位名称:
-          <el-input v-model="name"  placeholder="请输入单位名称" style="width: 140px"></el-input>
+          <el-input v-model="name"  placeholder="请输入单位名称" style="width: 160px" clearable></el-input>
         </div>
         <el-button type="primary" icon="el-icon-search" size="mini"  @click="getList()">搜索</el-button>
         <el-button type="primary" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -30,13 +30,12 @@
       <el-table-column prop="name" label="单位名称" show-overflow-tooltip></el-table-column>
       <el-table-column prop="introduce" label="单位介绍" show-overflow-tooltip> </el-table-column>
       <el-table-column prop="logo" label="公司logo">
-        <!-- <p>{{scope.row.logo}}</p> -->
-        <template slot-scope="scope" >
-          <el-image
-          v-if="scope.row.logo"
-            width="100"
-            :src="scope.row.logo"
-            :preview-src-list="[scope.row.logo]">
+        <template width="90" slot-scope="scope" >
+           <el-image
+            v-if="scope.row.logo"
+            style="width: 80px"
+            :preview-src-list="[scope.row.logo]"
+            :src="scope.row.logo">
           </el-image>
         </template>
       </el-table-column>
@@ -63,42 +62,35 @@
 
     <!-- 添加或修改参数配置对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="680px" append-to-body :before-close="cancel" :close-on-click-modal="false" class="roleform roleDialog">
-      <el-form ref="form2" :model="form2" :rules="rules" label-width="100px">
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
         <el-row>
           <el-col :span="12">
             <el-form-item label="单位名称" prop="name" >
-              <el-input v-model="form2.name" placeholder="请输单位名称" maxlength="30" width="30%" />
+              <el-input v-model="form.name" placeholder="请输单位名称" maxlength="30" width="30%" />
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="单位介绍" prop="deptId">
-              <el-input v-model="form2.introduce" placeholder="请输单位介绍" maxlength="30" width="30%" />
+            <el-form-item label="单位介绍" prop="introduce">
+              <el-input v-model="form.introduce" placeholder="请输单位介绍" maxlength="30" width="30%" />
             </el-form-item>
           </el-col>
-        </el-row>
-        <el-row>
-           <el-col :span="12">
-            <el-form-item label="公司LOGO" prop="logo" ref="logo2">
-              <el-image v-if="logoStatus"
-                style="width: auto;font-size:10px"
-                :src="form2.logo"
-                :preview-src-list="[form2.logo]">
-              </el-image>
-              <!-- :on-change="getImageFile" -->
-                <!-- :on-preview="handlePicPreview" -->
-                <!-- action="http://172.16.120.104:8082/file/upload" -->
+          <!-- <el-col :span="12">
+            <el-form-item label="备注" prop="remark">
+              <el-input v-model="form.remark" placeholder="请输入备注" maxlength="30" width="30%" />
+            </el-form-item>
+          </el-col> -->
+          <el-col :span="12">
+            <el-form-item label="单位LOGO" prop="logo" ref="img">
               <el-upload
-                ref='upload'
+                class="upload-demo"
                 action="#"
-                accept="image/png,image/jpg,image/jpeg"
-                :class="uploadDisabled"
-                :on-change="uploadFileLogo"
-                :on-remove="handlePicRemove"
-                :limit="limitCount"
-                list-type="picture-card"
+                :limit = 1
+                :on-change="handleChange"
+                :file-list="fileList"
                 :auto-upload="false"
-              >
-                <i class="el-icon-plus"></i>
+                accept=".jpg,.jpeg,.JPG,.JPEG,.PNG,.png,.GIF,.gif"   
+                >
+                <el-button size="small" type="primary">点击上传</el-button>
               </el-upload>
             </el-form-item>
           </el-col>
@@ -125,13 +117,12 @@
 </template>
 <script>
 
-import { companyList, companyAdd, companyUpdata, companyDel, imgAdd, imgDel } from "@/api/unit-info/unit-info";
+import { companyList, companyAdd, companyUpdata, companyDel, imgDel } from "@/api/unit-info/unit-info";
+import { fileUpload } from "@/api/uploadfile.js";
 export default {
   data() {
     return {
       uploadDisabled:false,
-      limitCount:1,
-      logoStatus:false,
       open:false,
       title:undefined,
       loading:true,
@@ -148,35 +139,17 @@ export default {
         name: [
           { required: true, message: "公司名称不能为空", trigger: "blur" },
         ],
-        // logo: [
-        //   { required: true, message: "logo不能为空", trigger: "change" },
-        // ],
-
+        logo: [
+          { required: true, message: "公司logo不能为空", trigger: "change" }
+        ],
       },
-      form2:{},
-
       imageUrl: "",
-      fileList: [],
+      fileList:[],
       dialogImageUrl: "",
       dialogVisible: false,
       hideUploadEdit: false, // 是否隐藏上传按钮
       tableData: [],
       multipleSelection: [],
-
-      // options: [
-      //   {
-      //     value: "1",
-      //     label: "单位名称1",
-      //   },
-      //   {
-      //     value: "2",
-      //     label: "单位名称2",
-      //   },
-      //   {
-      //     value: "3",
-      //     label: "单位名称3",
-      //   },
-      // ],
       value: "",
 
       input: "",
@@ -187,11 +160,13 @@ export default {
         name: "",
         introduce: "",
         remark: "",
+        logo:undefined
       },
       formData:undefined, //上传图片
       logoUrl:undefined,//图片地址
       //表格自适应高度
       tableHeight:undefined,
+      num:0,
     };
   },
   created(){
@@ -211,6 +186,22 @@ export default {
     }
   },
   methods: {
+    //文件上传
+    handleChange(param){
+      this.num++
+      if(this.num>1){
+        this.num = 0
+        return false
+      }else{
+        const formData = new FormData();
+        formData.append('file', param.raw)
+        formData.append('multipart', param.raw)
+        fileUpload(formData).then(response => {
+          this.$message.success("上传成功");
+          this.form.logo = response.data
+        });
+      }
+    },
     /** 重置按钮操作 */
     resetQuery() {
       this.name = undefined
@@ -227,13 +218,12 @@ export default {
     },
     //修改数据
     companyUpdata(){
-      companyUpdata(this.form2).then(Response =>{
+      companyUpdata(this.form).then(Response =>{
         if(Response.status == "SUCCESS"){
           this.$message.success("修改成功")
           this.open = false
           this.getList()
         }
-
       }).catch(()=>{
         this.imgDel()
       })
@@ -256,7 +246,7 @@ export default {
     },
     //新增数据
     companyAddData(){
-      companyAdd(this.form2).then(Response =>{
+      companyAdd(this.form).then(Response =>{
         if(Response.status == "SUCCESS"){
           this.open = false
           this.$message.success("添加成功")
@@ -266,14 +256,25 @@ export default {
         this.imgDel()
       })
     },
+    //删除图片
+    imgDel(){
+      if(this.delImg){
+        imgDel({"fileName":this.delImg.split("archive/")[1]}).then(Response=>{
+          if(Response.status == "SUCCESS"){
+            this.form.logo = undefined
+            this.delImg = undefined
+          }
+        })
+      }
+    },
     //删除数据
     companyDelData(row){
       companyDel(row.id).then(Response =>{
         if(Response.status == "SUCCESS"){
           this.open = false
           this.$message.success("删除成功")
-          if(this.form2.logo){
-            this.delImg = this.form2.logo
+          if(this.form.logo){
+            this.delImg = this.form.logo
             this.imgDel()
           }
           this.getList()
@@ -290,107 +291,21 @@ export default {
       this.pageSize = val;
       this.getList()
     },
-    // 获取图片信息
-    getImageFile(file, fileList) {
-      //console.log("fileList", fileList);
-      //选择图片后做图片格式限制(手动上传图片时,before-upload钩子无效,使用此方法替代)
-      const isImage = fileList[0].raw.type == 'image/png' || file.raw.type == 'image/jpg' ||  file.raw.type == 'image/jpeg';
-      const isLt60KB = fileList[0].size <  1024 * 60;
-      //console.log(fileList[0].size)
-      if (!isImage) {
-        this.$message.error('上传只能是png,jpg,jpeg格式!');
-      }
-      // if (!isLt60KB) {
-      //   this.$message.error('上传图片大小不能超过 60KB!');
-      // }
-
-      if(isImage){
-        this.uploadFile =  file.raw || null;
-      }else{
-        fileList.splice(-1,1);
-      }
-      this.getImageBase64(file.raw).then((res) => {
-        // this.uploadDisabled='disabled'
-        this.logoStatus = false
-        this.imageUrl = res;
-        this.form.logo = res
-        this.form2.logo = res
-      });
-      // 大于1张隐藏
-      this.hideUploadEdit = fileList.length >= 0;
-
-
-    },
-    uploadFileLogo(param){//上传图片
-        this.delImg = this.form2.logo
-        this.formData = new FormData()// FormData 对象
-        this.formData.append('file', param.raw)// 文件对象
-        imgAdd(this.formData).then(Response=>{
-          if(Response.status == "SUCCESS"){
-            var arr = document.getElementsByClassName('el-upload-list')[0]
-            arr.classList.remove("yc")
-            this.logoStatus = false
-            this.form2.logo = Response.data
-          }
-        })
-    },
-    //转换成base64方法
-    getImageBase64(file) {
-      return new Promise(function (resolve, reject) {
-        let newImagereader = new FileReader();
-        let imgInfo = "";
-        newImagereader.readAsDataURL(file);
-        newImagereader.onload = function () {
-          imgInfo = newImagereader.result;
-        };
-        newImagereader.onerror = function (error) {
-          reject(error);
-        };
-        newImagereader.onloadend = function () {
-          resolve(imgInfo);
-        };
-      });
-    },
-    //删除
-    handlePicRemove(file, fileList) {
-      this.imageUrl = "";
-      this.imgDel()
-    },
-    //删除图片
-    imgDel(){
-      if(this.delImg){
-        imgDel({"fileName":this.delImg.split("archive/")[1]}).then(Response=>{
-          if(Response.status == "SUCCESS"){
-            this.form2.logo = undefined
-            this.delImg = undefined
-          }
-        })
-      }
-    },
-    //预览
-    handlePicPreview(file) {
-      this.dialogImageUrl = file.url;
-      this.dialogVisible = true;
-    },
-    queryGroupTree(){
-      api.queryGroupTree().then((request) => {
-        this.tableData = request.data
-      });
-    },
     //新增按钮
     add(){
-      this.title = "新增"
-      this.open = true
-      this.form = {}
-      this.form2 = {}
-      this.imageUrl = undefined
-      this.logoStatus = false
-      var arr = document.getElementsByClassName('el-upload-list')[0]
-      arr.classList.add("yc")
-      this.$refs.upload.clearFiles();
+      this.form.id =undefined
+      this.form.name =undefined
+      this.form.introduce =undefined
+      this.form.logo =undefined
+      this.open = true;
+      this.title = "新增";
     },
     submitForm(){
-      this.$refs["form2"].validate(valid => {
+      if(this.form.logo){
+      }else{
+        this.$refs.img.clearValidate();
+      }
+      this.$refs["form"].validate(valid => {
         if (valid) {
           if(this.form.id){
             this.companyUpdata()
@@ -421,7 +336,6 @@ export default {
       setTimeout(()=>{
         this.title = "修改"
         this.form = JSON.parse(JSON.stringify(row))
-        this.form2 = JSON.parse(JSON.stringify(row))
         this.open = true
         setTimeout(()=>{
           var arr = document.getElementsByClassName('el-upload-list')[0]
@@ -447,22 +361,6 @@ export default {
           this.$message.info("已取消删除")
         });
     },
-
-    batchDelete() {
-      let multData = this.multipleSelection;
-      let tableData = this.tableData;
-      let multDataLen = multData.length;
-      let tableDataLen = tableData.length;
-      for (let i = 0; i < multDataLen; i++) {
-        for (let y = 0; y < tableDataLen; y++) {
-          if (JSON.stringify(tableData[y]) == JSON.stringify(multData[i])) {
-            //判断是否相等,相等就删除
-            this.tableData.splice(y, 1);
-
-          }
-        }
-      }
-    },
     handleSelectionChange(val) {
       this.multipleSelection = val;
     },

+ 26 - 34
src/views/user/account-manage/index.vue

@@ -50,7 +50,6 @@
             <el-select
               v-model="queryParams.status"
               placeholder="用户状态"
-              clearable
               size="small"
               style="width: 150px"
             >
@@ -157,7 +156,7 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="归属部门" prop="deptId">
-              <treeselect v-model="form.deptId" :options="deptOptions"  placeholder="请选择归属部门"  />
+              <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
             </el-form-item>
           </el-col>
         </el-row>
@@ -509,7 +508,6 @@ export default {
     // });
   },
   methods: {
-    
     /** 查询用户列表 */
     getList() {
       this.loading = true;
@@ -532,17 +530,27 @@ export default {
       treeselect().then(response => {
         this.deptOptions = []
         if(response.data){
-          for(let a = 0; a<response.data.length; a++){
-            this.deptOptions[a] ={}
+          for(let a = 0; a<Object.keys(response.data).length; a++){
+            this.deptOptions[a] = []
             this.deptOptions[a].label = response.data[a].deptName
             this.deptOptions[a].id = response.data[a].deptId
-            if(response.data[a].children.length>0){
-              this.deptOptions[a].children = []
-              for(let b = 0; b<response.data[a].children.length; b++){
-                this.deptOptions[a].children[b] = {}
-                if(response.data[a].children.length>0){
+            if(response.data[a].children){
+              if(Object.keys(response.data[a].children).length>0){
+                this.deptOptions[a].children = []
+                for(let b = 0; b<Object.keys(response.data[a].children).length; b++){
+                  this.deptOptions[a].children[b] = {}
                   this.deptOptions[a].children[b].label = response.data[a].children[b].deptName
                   this.deptOptions[a].children[b].id = response.data[a].children[b].deptId
+                  if(response.data[a].children[b].children){
+                    if(Object.keys(response.data[a].children[b].children).length>0){
+                      this.deptOptions[a].children[b].children = []
+                      for(let c = 0; c<Object.keys(response.data[a].children[b].children).length; c++){
+                        this.deptOptions[a].children[b].children[c] = {}
+                        this.deptOptions[a].children[b].children[c].label = response.data[a].children[b].children[c].deptName
+                        this.deptOptions[a].children[b].children[c].id = response.data[a].children[b].children[c].deptId
+                      }
+                    }
+                  }
                 }
               }
             }
@@ -608,7 +616,9 @@ export default {
     // 取消按钮
     cancel() {
       this.open = false;
-      this.reset();
+      setTimeout(()=>{
+        this.reset();
+      },500)
     },
     // 表单重置
     reset() {
@@ -743,11 +753,12 @@ export default {
       userList({loginName:loginName}).then(response => {
         if(response.status == "SUCCESS"){
           if(response.data.pageList){
-            this.form = response.data.pageList[0];
+            let data = response.data.pageList[0]
+            this.form = data;
             this.sex(this.form.sex)
             //角色赋值
-            if(response.data.pageList[0].roles){
-              this.form.roleIds = response.data.pageList[0].roles[0].roleId
+            if(data.roles){
+              this.form.roleIds = data.roles[0].roleId
               if(this.form.roleIds){
                 if(this.roleOptions){
                   for(let i = 0;i<this.roleOptions.length;i++){
@@ -759,26 +770,7 @@ export default {
               }
             }
             //部门赋值
-            if(response.data.pageList[0].deptName){
-              this.form.deptName = response.data.pageList[0].deptName
-              if(this.form.deptName){
-                if(this.deptOptions){
-                  for(let i = 0;i<this.deptOptions.length;i++){
-                    if(this.form.deptName = this.deptOptions[i].label){
-                      this.form.deptId = this.deptOptions[i].label
-                    }
-                    if(this.deptOptions[i].children){
-                      for(let a = 0;a<this.deptOptions[i].children.length;a++){
-                        if(this.form.deptName = this.deptOptions[i].children[a].label){
-                          this.form.deptId = this.deptOptions[i].children[a].label
-                        }
-                      }
-                    }
-                  }
-                }
-              }
-            }
-            this.open = true;
+            this.open = true
             this.title = "修改用户";
             this.form.password = "";
           }

+ 1 - 1
src/views/user/log-manage/index.vue

@@ -3,7 +3,7 @@
     <div class="filter-container">
       <div class="filter-left">
         <div class="filter-item">操作内容:
-          <el-input v-model="operation" placeholder="请输入操作内容" style="width: 140px"></el-input>
+          <el-input v-model="operation" placeholder="请输入操作内容" clearable style="width: 160px"></el-input>
         </div>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="getList()">搜索</el-button>
         <el-button type="primary" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>

+ 0 - 1
vue.config.js

@@ -38,7 +38,6 @@ module.exports = {
             warnings: false,
             errors: true
         },
-
         //解决跨越问题
         proxy: {
             [process.env.VUE_APP_BASE_API]: {