فهرست منبع

Merge branch 'V0.0.2' of http://10.87.10.227:4000/jzyd_yyds/soc_web into V0.0.2

 Conflicts:
	src/components/orgTree/index.vue
zhulu 2 سال پیش
والد
کامیت
344ead0844

+ 1 - 2
src/assets/styles/element-ui.scss

@@ -95,6 +95,5 @@
 }
 
 .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{
-  background-color:#008CD6 !important;
-  color:#fff;
+  background-color:#d1e0f1  !important;
 }

+ 1 - 2
src/assets/styles/ruoyi.scss

@@ -104,10 +104,9 @@
 /** 表格布局 **/
 .pagination-container {
 	position: relative;
-	height: 25px;
+	height: 30px;
 	margin-bottom: 10px;
 	margin-top: 15px;
-	padding: 10px 20px !important;
 }
 
 /* tree border */

+ 5 - 5
src/components/Pagination/index.vue

@@ -31,7 +31,7 @@ export default {
     },
     limit: {
       type: Number,
-      default: 20
+      default: 10
     },
     pageSizes: {
       type: Array,
@@ -104,10 +104,10 @@ export default {
 </script>
 
 <style scoped>
-.pagination-container {
-  background: #fff;
-  padding: 32px 16px;
-}
+/*.pagination-container {*/
+/*  background: #fff;*/
+/*  padding: 32px 16px;*/
+/*}*/
 .pagination-container.hidden {
   display: none;
 }

+ 82 - 0
src/components/layoutContainer/index.vue

@@ -0,0 +1,82 @@
+<template>
+  <div>
+    <div class="big_box">
+      <div class="leftBar">
+        <slot name="leftBar"></slot>
+      </div>
+      <div class="dragonet" v-move></div>
+      <div class="rightBar">
+        <slot name="rightBar"></slot>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+export default {
+  name: "SocWebIndex",
+
+  data() {
+    return {
+        leftWith:0
+    };
+  },
+  directives: {
+    move(el, bindings, that) {
+       
+      that = that.context;
+    
+
+      el.onmousedown = function (e) {
+        var init = e.clientX;
+
+        var parent = document.querySelector(".leftBar");
+        // var searchInput = document.querySelector(".input-with-select");
+        // var parentelement = document.querySelector("#form");
+        // var formBox = document.querySelector(".formBox");
+        var initWidth = parent.offsetWidth;
+        
+
+        document.onmousemove = function (e) {
+            var end = e.clientX;
+           
+          if (end > that.leftWith) {
+              var newWidth = end - init + initWidth;
+              parent.style.width = newWidth + "px";
+              console.log(parent);
+          
+          } else {
+            end = that.leftWith + "px";
+            parent.style.width = that.leftWith + "px";
+           
+          }
+        };
+        document.onmouseup = function () {
+          document.onmousemove = document.onmouseup = null;
+        };
+      };
+    },
+  },
+  mounted() {},
+
+  methods: {},
+};
+</script>
+<style lang="scss" scoped>
+.big_box {
+  width: 100%;
+  display: flex;
+  .leftBar {
+    min-width: 200px;
+  }
+  .rightBar {
+    width: 85%;
+  }
+  .dragonet {
+    width: 10px;
+    min-width: 10px;
+    cursor: col-resize;
+    background-color: #fff;
+    z-index: 5;
+  }
+}
+</style>

+ 56 - 36
src/components/orgTree/index.vue

@@ -3,15 +3,18 @@
     <div class="head-container">
       <el-input
         v-model="deptName"
-        placeholder="请输入机构名称"
+        :placeholder="searchPlaceHolder"
         clearable
         size="small"
         prefix-icon="el-icon-search"
-        style="margin-bottom: 20px"/>
+        style="margin-bottom: 20px"
+      />
     </div>
     <div class="tree-container">
-      <div style="margin-bottom: 10px;">
-        <el-checkbox v-model="checkSub" @change="changeCheckBox">是否关联下级机构</el-checkbox>
+      <div style="margin-bottom: 10px" v-show="showLowerCheck">
+        <el-checkbox v-model="checkSub" @change="changeCheckBox"
+          >关联下级</el-checkbox
+        >
       </div>
       <el-tree
         :data="treeList"
@@ -24,22 +27,24 @@
         :default-expanded-keys="defaultKeys"
         :default-checked-keys="defaultKeys"
         @node-click="handleNodeClick"
-      />
+        v-bind="$attrs"
+      >    
+    </el-tree>
     </div>
   </div>
 </template>
 
 <script>
 import tableListMixins from "@/mixins/tableList";
-import {deptTreeSelect,handsheDeptTreeSelect} from "@/api/system/public";
+import { deptTreeSelect, handsheDeptTreeSelect } from "@/api/system/public";
 
 export default {
   name: "orgTree",
-  mixins:[tableListMixins],
-  data(){
+  mixins: [tableListMixins],
+  data() {
     return {
       //过滤信息
-      deptName:'',
+      deptName: "",
       //是否关联下级
       checked: false,
       // 机构树列表
@@ -47,26 +52,37 @@ export default {
       //默认选中节点
       defaultKeys:[],
       //自定义取值
-      defaultProps: {
-        children: "children",
-        label: "name"
-      },
       checkSub:true,
       defaultKey:null,
+      defaultProps:{
+        children: "children",
+        label: "shortName",
+      }
     }
   },
-  props:{
-    hangsheTree:{
-      type:Boolean,
-      default:false,
+  props: {
+    hangsheTree: {
+      type: Boolean,
+      default: false,
     },
-    defaultProps:{
-      type:Object,
-      default:{
+    defaultProps: {
+      type: Object,
+      default: {
         children: "children",
-        label: "name"
+        label: "shortName",
       },
-    }
+    },
+    customRequest: {
+      type: Function,
+    },
+    showLowerCheck: {
+      type: Boolean,
+      default: true,
+    },
+    searchPlaceHolder: {
+      type: String,
+      default: "请输入机构名称",
+    },
   },
   watch: {
     // 根据名称筛选机构树
@@ -74,31 +90,34 @@ export default {
       this.$refs.tree.filter(val);
     },
     defaultProps(val) {
-      this.defaultProps={...val};
-    }
+      this.defaultProps = { ...val };
+    },
   },
   created() {
     this.getDeptTree();
   },
-  methods:{
+  methods: {
     /** 下穿状态改变*/
-    changeCheckBox(state){
-      this.$emit('checkChange',state);
+    changeCheckBox(state) {
+      this.$emit("checkChange", state);
     },
     /** 查询机构下拉树结构 */
     getDeptTree() {
-      let method=deptTreeSelect;
-      if(this.hangsheTree){
-        method=handsheDeptTreeSelect
+      let method = deptTreeSelect;
+      if (this.hangsheTree) {
+        method = handsheDeptTreeSelect;
+      }
+      if (this.customRequest) {
+        method = this.customRequest;
       }
-      method().then(response => {
+      method().then((response) => {
         this.treeList = response.data;
         this.defaultKeys.push(response.data[0].id);
-        this.$emit('defaultKey',response.data[0].id);
+        this.$emit("defaultKey", response.data[0].id);
         this.$emit('defaultOrg',response.data[0]);
         this.defaultKey = response.data[0].id;
         setTimeout(() => {
-          this.$refs.tree.setCurrentKey(response.data[0].id)
+          this.$refs.tree.setCurrentKey(response.data[0].id);
         }, 100);
       });
     },
@@ -108,11 +127,11 @@ export default {
       return data.name.indexOf(value) !== -1;
     },
     // 节点单击事件
-    handleNodeClick(data) {
-      this.$emit('click',data);
+    handleNodeClick(data, node) {
+      this.$emit("click", data, node);
     },
   },
-}
+};
 </script>
 
 <style lang='scss' scoped>
@@ -122,4 +141,5 @@ export default {
       background-color: #d1e0f1 !important;
     }
   }
+
 </style>

+ 3 - 3
src/components/orgTreeSelect/index.vue

@@ -191,14 +191,14 @@ export default {
         this.recursionTreeHandler(this.queryForm.type, [data]);
       }
       // debugger;
-      // this.sNodeList = this.$refs.tree.getCheckedNodes();
-      // this.$emit("selectNode", JSON.stringify(this.sNodeList));
+      this.sNodeList = this.$refs.tree.getCheckedNodes();
+      this.$emit("selectNode", JSON.stringify(this.sNodeList));
     },
     recursionTreeHandler(type, tree) {
       tree.forEach((item) => {
         if (type == item.type) {
           this.$refs.tree.setCheckedKeys([item.id])
-       
+
         }
       });
       if (tree.children && tree.children.length > 0) {

+ 3 - 3
src/layout/components/TagsView/ScrollPane.vue

@@ -10,7 +10,7 @@ const tagAndTagSpacing = 4 // tagAndTagSpacing
 
 export default {
   name: 'ScrollPane',
-  
+
   data() {
     return {
       left: 0
@@ -20,7 +20,7 @@ export default {
     scrollWrapper() {
       return this.$refs.scrollContainer.$refs.wrap
     },
-    
+
   },
   mounted() {
     this.scrollWrapper.addEventListener('scroll', this.emitScroll, true)
@@ -94,7 +94,7 @@ export default {
       bottom: 0px;
     }
     .el-scrollbar__wrap {
-      height: 39px;
+      height: 45px;
     }
   }
 }

+ 3 - 0
src/main.js

@@ -49,6 +49,8 @@ import DictData from '@/components/DictData'
 import TreeSelect from "@riophae/vue-treeselect";
 // elementui Dialog组件
 import DialogCom from '@/components/elDialog/dialog.vue'
+//布局容器
+import layoutCom from '@/components/layoutContainer/index.vue'
 // 全局方法挂载
 Vue.prototype.getDicts = getDicts
 //根据参数键名查询参数值
@@ -79,6 +81,7 @@ Vue.component('ImagePreview', ImagePreview)
 Vue.component('ImageListPreview', ImageListPreview)
 Vue.component('TreeSelect', TreeSelect)
 Vue.component('DialogCom', DialogCom)
+Vue.component('layoutCom', layoutCom)
 
 Vue.use(directive)
 Vue.use(plugins)

+ 2 - 2
src/mixins/tableList.js

@@ -3,8 +3,8 @@ export default {
     return {
       //分页参数,最终合并提交
       pages:{
-        page: 1,
-        size: 10,
+        pageNum: 1,
+        pageSize: 10,
         total: 0,
       },
       // 遮罩层

+ 81 - 31
src/views/resumption/ruleManager/index.vue

@@ -3,18 +3,31 @@
   <div class="app-container">
     <el-row :gutter="20">
       <el-col :span="4" :xs="24">
-        <el-input placeholder="输入关键字进行过滤" v-model="filterText">
+        <org-tree
+          v-model="queryParams.orgId"
+          @click="clicktreenode"
+          :customRequest="treeData"
+          searchPlaceHolder="输入关键字进行过滤"
+          :expand-on-click-node="true"
+          node-key="id"
+          :default-expanded-keys="topItemKeys"
+          accordion
+          :defaultProps="defaultProps"
+          :showLowerCheck="false"
+          :renderContent="renderContent"
+        >
+          
+        </org-tree>
+
+        <!-- <el-input placeholder="输入关键字进行过滤" v-model="filterText">
         </el-input>
         <el-tree
           class="filter-tree"
           :data="treedata"
-          node-key="id"
+          
           highlight-current
-          :expand-on-click-node="true"
-          :default-expanded-keys="topItemKeys"
-          :filter-node-method="filterNode"
-          accordion
-          @node-click="clicktreenode"
+          
+         
           ref="tree"
         >
           <span class="custom-tree-node" slot-scope="{ node, data }">
@@ -28,7 +41,7 @@
             }}</span>
             </span>
           </span>
-        </el-tree>
+        </el-tree> -->
       </el-col>
       <el-col :span="20" :xs="24">
         <el-form
@@ -129,6 +142,7 @@
           :default-expand-all="expandAll"
           v-if="fresh"
           style="width: 100%"
+          v-loading="loading"
         >
           <el-table-column type="expand">
             <template slot-scope="props">
@@ -173,7 +187,11 @@
             v-if="columns[2].visible"
           >
           </el-table-column>
-          <el-table-column label="操作" width="140">
+          <el-table-column
+            label="操作"
+            width="140"
+            v-if="rule && rule.orgId == orgId"
+          >
             <template slot-scope="scope">
               <el-button
                 type="text"
@@ -182,13 +200,20 @@
                 @click="onEditItem(scope.row.id)"
                 v-hasPermi="['resumption:ruleManager:edit']"
                 >编辑</el-button
-              > 
-                    
+              >
+
               <el-popconfirm
                 title="将删除履职项及其下所有履职内容,确定删除?"
                 @confirm="deldata(scope.row.id)"
               >
-                <el-button type="text" size="small" slot="reference" icon="el-icon-delete" v-hasPermi="['resumption:ruleManager:remove']">删除</el-button>
+                <el-button
+                  type="text"
+                  size="small"
+                  slot="reference"
+                  icon="el-icon-delete"
+                  v-hasPermi="['resumption:ruleManager:remove']"
+                  >删除</el-button
+                >
               </el-popconfirm>
             </template>
           </el-table-column>
@@ -212,6 +237,7 @@
 </template>
 
 <script>
+import OrgTree from "@/components/orgTree";
 import { mapGetters, mapMutations } from "vuex";
 import { page, treeData, del } from "@/api/resumption/ruleManager.js";
 import DialogEdit from "./dialog.editItem.vue";
@@ -242,13 +268,13 @@ export default {
       // },
       treedata: [],
       tableData: [],
-
+      loading: false,
       total: 0,
       topItemKeys: [],
-      // defaultProps: {
-      //   children: "children",
-      //   label: "label",
-      // },
+      defaultProps: {
+        children: "children",
+        label: "label",
+      },
       columns: [
         { key: 0, label: `序号`, visible: true },
         { key: 1, label: `履职项`, visible: true },
@@ -256,14 +282,14 @@ export default {
         { key: 3, label: `履职内容`, visible: true },
         { key: 4, label: `履职区域`, visible: true },
       ],
-      currentOrgId:null,
+      currentOrgId: null,
     };
   },
 
-  components: { DialogEdit },
+  components: { DialogEdit, OrgTree },
 
   computed: {
-    ...mapGetters(["orgId"])
+    ...mapGetters(["orgId"]),
     // ...mapState(["org", "loginUser"]),
   },
 
@@ -271,7 +297,6 @@ export default {
     filterText(val) {
       this.$refs.tree.filter(val);
     },
-    
   },
 
   async created() {
@@ -281,12 +306,11 @@ export default {
     // await this.getassetlist();
   },
 
-  mounted() {
-
-  },
+  mounted() {},
 
   methods: {
     ...mapMutations([]),
+    treeData,
     dakai() {
       this.expandAll = !this.expandAll;
       this.fresh = false;
@@ -308,10 +332,12 @@ export default {
         this.$message.warning("请先选择一个履职内容库定义");
         return;
       }
+      this.loading = true;
       const data = await page(this.queryParams);
       this.tableData = data.rows;
-      this.total =Number.parseInt(data.total);
+      this.total = Number.parseInt(data.total);
       this.expandAll = false;
+      this.loading = false;
     },
     async gettreelist() {
       await treeData().then((v) => {
@@ -327,7 +353,7 @@ export default {
       this.currentPage = val;
       this.getList();
     },
-    clicktreenode(data,node) {
+    clicktreenode(data, node) {
       if (!data.isRule) {
         return;
       }
@@ -337,12 +363,36 @@ export default {
       this.$nextTick(() => {
         this.fresh = true;
       });
-
+      this.tableData = [];
       this.queryParams.ruleId = data.id;
       this.rule = data;
-      this.rule.orgId=node.parent.data.id
+      this.rule.orgId = node.parent.data.id;
       this.refresh();
     },
+
+    renderContent(h, { node, data, store }) {
+      if (data.isRule == 0) {
+        return (
+          <span class="custom-tree-node">
+            <span class="show-ellipsis">
+              {data.label}
+            </span>
+          </span>
+        );
+      } else {
+        return (
+          <span class="custom-tree-node">
+            <span style="display: flex">
+              <i
+                class="el-icon-s-management"
+                style="color: #008cd6; padding-top: 3px"
+              ></i>
+              <span class="show-ellipsis">{data.label}</span>
+            </span>
+          </span>
+        );
+      }
+    },
     async deldata(val) {
       await del(val);
       this.$message.info("删除成功");
@@ -365,12 +415,12 @@ export default {
     onEditItem(itemId) {
       this.$refs.dialogEdit.show(itemId);
     },
-    onSelect(){
+    onSelect() {
       this.$refs.DialogSelect.show();
     },
-    onSuccess(){
+    onSuccess() {
       this.refresh();
-    }
+    },
   },
 };
 </script>

+ 3 - 3
src/views/safetycheck/ruleManager/index.vue

@@ -173,14 +173,14 @@
             v-if="columns[2].visible"
           >
           </el-table-column>
-          <el-table-column label="操作" width="140">
+          <el-table-column label="操作" width="140" v-if="rule && rule.orgId == orgId">
             <template slot-scope="scope">
               <el-button
                 type="text"
                 size="small"
                 icon="el-icon-edit"
                 @click="onEditItem(scope.row.id)"
-                v-hasPermi="['resumption:ruleManager:edit']"
+                v-hasPermi="['resumption:ruleManager:edit']"                
                 >编辑</el-button
               > 
                     
@@ -341,7 +341,7 @@ export default {
       this.$nextTick(() => {
         this.fresh = true;
       });
-
+      this.tableData=[]
       this.queryParams.ruleId = data.id;
       this.rule = data;
       this.rule.orgId=node.parent.data.id

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

@@ -390,6 +390,7 @@ export default {
         name: undefined,
         status: undefined,
         parentId: undefined,
+        checkSub:true,
       },
       // 表单参数
       form: {},

+ 462 - 209
src/views/system/user/index.vue

@@ -1,47 +1,90 @@
 <template>
   <div class="app-container">
-    <el-row :gutter="20">
-      <!--机构数据-->
-      <el-col :span="4" :xs="24">
-        <org-tree v-model="queryParams.orgId" @defaultKey="getDefaultKey" @checkChange="checkChange"
-          @click="clickTreeNode" :defaultProps="defaultProps"></org-tree>
-      </el-col>
-      <!--用户数据-->
-      <el-col :span="20" :xs="24">
-
-        <!--    搜索条件    -->
-        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-          <el-form-item label="用户名称" prop="username">
-            <el-input v-model="queryParams.username" placeholder="请输入用户名称" clearable style="width: 240px"
-              @keyup.enter.native="handleQuery" />
-          </el-form-item>
-          <el-form-item label="手机号码" prop="phone">
-            <el-input v-model="queryParams.phone" placeholder="请输入手机号码" clearable style="width: 240px"
-              @keyup.enter.native="handleQuery" />
-          </el-form-item>
-          <el-form-item label="状态" prop="isLock">
-            <el-select v-model="queryParams.isLock" placeholder="用户状态" clearable style="width: 240px">
-              <el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label"
-                :value="dict.value" />
-            </el-select>
-          </el-form-item>
-          <!-- <el-form-item label="创建时间">
+    <layoutCom>
+      <org-tree
+        slot="leftBar"
+        v-model="queryParams.orgId"
+        @defaultKey="getDefaultKey"
+        @checkChange="checkChange"
+        @click="clickTreeNode"
+      ></org-tree>
+      <el-row slot="rightBar">
+        <!--用户数据-->
+        <el-col>
+          <!--    搜索条件    -->
+          <el-form
+            :model="queryParams"
+            ref="queryForm"
+            size="small"
+            :inline="true"
+            v-show="showSearch"
+            label-width="68px"
+          >
+            <el-form-item label="用户名称" prop="username">
+              <el-input
+                v-model="queryParams.username"
+                placeholder="请输入用户名称"
+                clearable
+                style="width: 240px"
+                @keyup.enter.native="handleQuery"
+              />
+            </el-form-item>
+            <el-form-item label="手机号码" prop="phone">
+              <el-input
+                v-model="queryParams.phone"
+                placeholder="请输入手机号码"
+                clearable
+                style="width: 240px"
+                @keyup.enter.native="handleQuery"
+              />
+            </el-form-item>
+            <el-form-item label="状态" prop="isLock">
+              <el-select
+                v-model="queryParams.isLock"
+                placeholder="用户状态"
+                clearable
+                style="width: 240px"
+              >
+                <el-option
+                  v-for="dict in dict.type.sys_normal_disable"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                />
+              </el-select>
+            </el-form-item>
+            <!-- <el-form-item label="创建时间">
             <el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
               range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
           </el-form-item> -->
-          <el-form-item>
-            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-          </el-form-item>
-        </el-form>
+            <el-form-item>
+              <el-button
+                type="primary"
+                icon="el-icon-search"
+                size="mini"
+                @click="handleQuery"
+                >搜索</el-button
+              >
+              <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+                >重置</el-button
+              >
+            </el-form-item>
+          </el-form>
 
-        <!--    按纽    -->
-        <el-row :gutter="10" class="mb8">
-          <el-col :span="1.5">
-            <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
-              v-hasPermi="['system:user:add']">新增</el-button>
-          </el-col>
-          <!-- <el-col :span="1.5">
+          <!--    按纽    -->
+          <el-row :gutter="10" class="mb8">
+            <el-col :span="1.5">
+              <el-button
+                type="primary"
+                plain
+                icon="el-icon-plus"
+                size="mini"
+                @click="handleAdd"
+                v-hasPermi="['system:user:add']"
+                >新增</el-button
+              >
+            </el-col>
+            <!-- <el-col :span="1.5">
             <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
               v-hasPermi="['system:user:edit']">修改</el-button>
           </el-col>
@@ -49,92 +92,204 @@
             <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
               v-hasPermi="['system:user:remove']">删除</el-button>
           </el-col> -->
-          <!--          <el-col :span="1.5">-->
-          <!--            <el-button-->
-          <!--              type="info"-->
-          <!--              plain-->
-          <!--              icon="el-icon-upload2"-->
-          <!--              size="mini"-->
-          <!--              @click="handleImport"-->
-          <!--              v-hasPermi="['system:user:import']"-->
-          <!--            >导入</el-button>-->
-          <!--          </el-col>-->
-          <!--          <el-col :span="1.5">-->
-          <!--            <el-button-->
-          <!--              type="warning"-->
-          <!--              plain-->
-          <!--              icon="el-icon-download"-->
-          <!--              size="mini"-->
-          <!--              @click="handleExport"-->
-          <!--              v-hasPermi="['system:user:export']"-->
-          <!--            >导出</el-button>-->
-          <!--          </el-col>-->
-          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
-        </el-row>
-        <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
-          <el-table-column v-if="false" type="selection" width="50" align="center" />
-          <el-table-column label="用户名称" align="center" key="username" prop="username" v-if="columns[0].visible" />
-          <el-table-column label="用户昵称" align="center" key="name" prop="name" v-if="columns[1].visible"
-            :show-overflow-tooltip="true" />
+            <!--          <el-col :span="1.5">-->
+            <!--            <el-button-->
+            <!--              type="info"-->
+            <!--              plain-->
+            <!--              icon="el-icon-upload2"-->
+            <!--              size="mini"-->
+            <!--              @click="handleImport"-->
+            <!--              v-hasPermi="['system:user:import']"-->
+            <!--            >导入</el-button>-->
+            <!--          </el-col>-->
+            <!--          <el-col :span="1.5">-->
+            <!--            <el-button-->
+            <!--              type="warning"-->
+            <!--              plain-->
+            <!--              icon="el-icon-download"-->
+            <!--              size="mini"-->
+            <!--              @click="handleExport"-->
+            <!--              v-hasPermi="['system:user:export']"-->
+            <!--            >导出</el-button>-->
+            <!--          </el-col>-->
+            <right-toolbar
+              :showSearch.sync="showSearch"
+              @queryTable="getList"
+              :columns="columns"
+            ></right-toolbar>
+          </el-row>
+          <el-table
+            v-loading="loading"
+            :data="userList"
+            @selection-change="handleSelectionChange"
+          >
+            <el-table-column
+              v-if="false"
+              type="selection"
+              width="50"
+              align="center"
+            />
+            <el-table-column
+              label="用户名称"
+              align="center"
+              key="username"
+              prop="username"
+              v-if="columns[0].visible"
+            />
+            <el-table-column
+              label="用户昵称"
+              align="center"
+              key="name"
+              prop="name"
+              v-if="columns[1].visible"
+              :show-overflow-tooltip="true"
+            />
 
-          <el-table-column label="所属机构" align="center" key="orgName" prop="orgName" v-if="columns[3].visible"
-            :show-overflow-tooltip="true" />
-          <el-table-column label="用户角色" align="center" prop="roles" v-if="columns[2].visible"
-            :show-overflow-tooltip="true">
-            <template slot-scope="scope">
-              <template v-for="item in scope.row.roles">
-                {{ item.roleName }}
-                <br />
+            <el-table-column
+              label="所属机构"
+              align="center"
+              key="orgName"
+              prop="orgName"
+              v-if="columns[3].visible"
+              :show-overflow-tooltip="true"
+            />
+            <el-table-column
+              label="用户角色"
+              align="center"
+              prop="roles"
+              v-if="columns[2].visible"
+              :show-overflow-tooltip="true"
+            >
+              <template slot-scope="scope">
+                <template v-for="item in scope.row.roles">
+                  {{ item.roleName }}
+                  <br />
+                </template>
               </template>
-            </template>
-          </el-table-column>
-          <el-table-column label="状态" align="center" key="isLock" prop="isLock" v-if="columns[4].visible" width="80">
-            <template slot-scope="scope">
-              <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.isLock" />
-            </template>
-          </el-table-column>
-          <el-table-column label="是否管理人员" align="center" key="isManager" prop="isManager" v-if="columns[5].visible"
-            width="120">
-            <template slot-scope="scope">
-              {{ scope.row.isManager > 0 ? "是" : "否" }}
-            </template>
-          </el-table-column>
-          <el-table-column label="登录IP" align="center" key="lastIp" prop="lastIp" v-if="columns[6].visible" width="120" />
-          <el-table-column label="登录时间" align="center" key="lastTime" prop="lastTime" v-if="columns[7].visible"
-            width="120" />
-          <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
-            <template slot-scope="scope" v-if="scope.row.userId !== 1">
-              <el-button size="mini" type="text" icon="el-icon-plus" @click="handleExtend(scope.row)"
-                v-hasPermi="['system:user:extend']">补充信息</el-button>
-              <!-- <el-button
+            </el-table-column>
+            <el-table-column
+              label="状态"
+              align="center"
+              key="isLock"
+              prop="isLock"
+              v-if="columns[4].visible"
+              width="80"
+            >
+              <template slot-scope="scope">
+                <dict-tag
+                  :options="dict.type.sys_normal_disable"
+                  :value="scope.row.isLock"
+                />
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="是否管理人员"
+              align="center"
+              key="isManager"
+              prop="isManager"
+              v-if="columns[5].visible"
+              width="120"
+            >
+              <template slot-scope="scope">
+                {{ scope.row.isManager > 0 ? "是" : "否" }}
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="登录IP"
+              align="center"
+              key="lastIp"
+              prop="lastIp"
+              v-if="columns[6].visible"
+              width="120"
+            />
+            <el-table-column
+              label="登录时间"
+              align="center"
+              key="lastTime"
+              prop="lastTime"
+              v-if="columns[7].visible"
+              width="120"
+            />
+            <el-table-column
+              label="操作"
+              align="center"
+              width="160"
+              class-name="small-padding fixed-width"
+            >
+              <template slot-scope="scope" v-if="scope.row.userId !== 1">
+                <el-button
+                  size="mini"
+                  type="text"
+                  icon="el-icon-plus"
+                  @click="handleExtend(scope.row)"
+                  v-hasPermi="['system:user:extend']"
+                  >补充信息</el-button
+                >
+                <!-- <el-button
                   size="mini"
                   type="text"
                   icon="el-icon-plus"
                   v-hasPermi="['system:user:extend']"
                   >补充信息</el-button
                 > -->
-              <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
-                v-hasPermi="['system:user:edit']">编辑</el-button>
-              <el-button v-if="!scope.row.source" size="mini" type="text" icon="el-icon-delete"
-                @click="handleDelete(scope.row)" v-hasPermi="['system:user:remove']">删除</el-button>
-              <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)"
-                v-hasPermi="['system:user:resetPwd', 'system:user:edit']">
-                <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
-                <el-dropdown-menu slot="dropdown">
-                  <el-dropdown-item command="handleResetPwd" icon="el-icon-key"
-                    v-hasPermi="['system:user:resetPwd']">重置密码</el-dropdown-item>
-                  <el-dropdown-item command="handleAuthRole" v-if="false" icon="el-icon-circle-check"
-                    v-hasPermi="['system:user:edit']">分配角色</el-dropdown-item>
-                </el-dropdown-menu>
-              </el-dropdown>
-            </template>
-          </el-table-column>
-        </el-table>
+                <el-button
+                  size="mini"
+                  type="text"
+                  icon="el-icon-edit"
+                  @click="handleUpdate(scope.row)"
+                  v-hasPermi="['system:user:edit']"
+                  >编辑</el-button
+                >
+                <el-button
+                  v-if="!scope.row.source"
+                  size="mini"
+                  type="text"
+                  icon="el-icon-delete"
+                  @click="handleDelete(scope.row)"
+                  v-hasPermi="['system:user:remove']"
+                  >删除</el-button
+                >
+                <el-dropdown
+                  size="mini"
+                  @command="(command) => handleCommand(command, scope.row)"
+                  v-hasPermi="['system:user:resetPwd', 'system:user:edit']"
+                >
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-d-arrow-right"
+                    >更多</el-button
+                  >
+                  <el-dropdown-menu slot="dropdown">
+                    <el-dropdown-item
+                      command="handleResetPwd"
+                      icon="el-icon-key"
+                      v-hasPermi="['system:user:resetPwd']"
+                      >重置密码</el-dropdown-item
+                    >
+                    <el-dropdown-item
+                      command="handleAuthRole"
+                      v-if="false"
+                      icon="el-icon-circle-check"
+                      v-hasPermi="['system:user:edit']"
+                      >分配角色</el-dropdown-item
+                    >
+                  </el-dropdown-menu>
+                </el-dropdown>
+              </template>
+            </el-table-column>
+          </el-table>
 
-        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
-          @pagination="getList" />
-      </el-col>
-    </el-row>
+          <pagination
+            v-show="total > 0"
+            :total="total"
+            :page.sync="queryParams.pageNum"
+            :limit.sync="queryParams.pageSize"
+            @pagination="getList"
+          />
+        </el-col>
+      </el-row>
+    </layoutCom>
 
     <!-- 添加或修改用户配置对话框 -->
     <DialogCom :title="title" :visible.sync="open" width="800px" append-to-body>
@@ -142,28 +297,51 @@
         <el-row>
           <el-col :span="10">
             <el-form-item label="用户名称" prop="username" v-if="!form.source">
-              <el-input v-model="form.username" placeholder="请输入用户名" maxlength="30" />
+              <el-input
+                v-model="form.username"
+                placeholder="请输入用户名"
+                maxlength="30"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="10">
             <el-form-item label="用户昵称" prop="name" v-if="!form.source">
-              <el-input v-model="form.name" placeholder="请输入用户昵称" maxlength="30" />
+              <el-input
+                v-model="form.name"
+                placeholder="请输入用户昵称"
+                maxlength="30"
+              />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
-
           <el-col :span="10">
             <el-form-item label="所属机构" prop="orgId" v-if="!form.source">
-              <tree-select v-model="form.orgId" :options="deptOptions" :show-count="true" :normalizer="tenantIdnormalizer"
-                :props="{ checkStrictly: true, label: 'name' }" placeholder="请选择归属机构" />
+              <tree-select
+                v-model="form.orgId"
+                :options="deptOptions"
+                :show-count="true"
+                :normalizer="tenantIdnormalizer"
+                :props="{ checkStrictly: true, label: 'name' }"
+                placeholder="请选择归属机构"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="10">
             <el-form-item label="用户角色" prop="roleIds">
-              <el-select style="width: 100%;" v-model="form.roleIds" multiple placeholder="请选择角色">
-                <el-option v-for="item in roleOptions" :key="item.id" :label="item.roleName" :value="item.id"
-                  :disabled="item.status == 1"></el-option>
+              <el-select
+                style="width: 100%"
+                v-model="form.roleIds"
+                multiple
+                placeholder="请选择角色"
+              >
+                <el-option
+                  v-for="item in roleOptions"
+                  :key="item.id"
+                  :label="item.roleName"
+                  :value="item.id"
+                  :disabled="item.status == 1"
+                ></el-option>
               </el-select>
             </el-form-item>
           </el-col>
@@ -171,14 +349,26 @@
         <el-row>
           <el-col :span="10">
             <el-form-item label="手机号码" prop="phone" v-if="!form.source">
-              <el-input v-model="form.phone" placeholder="请输入手机号码" maxlength="11" />
+              <el-input
+                v-model="form.phone"
+                placeholder="请输入手机号码"
+                maxlength="11"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="10">
             <el-form-item label="用户性别" v-if="!form.source">
-              <el-select style="width: 100%;" v-model="form.gender" placeholder="请选择性别">
-                <el-option v-for="dict in dict.type.sys_user_sex" :key="dict.value" :label="dict.label"
-                  :value="`${dict.value}`"></el-option>
+              <el-select
+                style="width: 100%"
+                v-model="form.gender"
+                placeholder="请选择性别"
+              >
+                <el-option
+                  v-for="dict in dict.type.sys_user_sex"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="`${dict.value}`"
+                ></el-option>
               </el-select>
             </el-form-item>
           </el-col>
@@ -196,17 +386,26 @@
           </el-col>   -->
           <el-col :span="14">
             <el-form-item v-if="!form.id" label="用户密码" prop="password">
-              <el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password />
+              <el-input
+                v-model="form.password"
+                placeholder="请输入用户密码"
+                type="password"
+                maxlength="20"
+                show-password
+              />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
-
           <el-col :span="14">
             <el-form-item label="状态" v-if="!form.source">
               <el-radio-group v-model="form.isLock">
-                <el-radio v-for="dict in dict.type.sys_normal_disable" :key="`${dict.value}`" :label="dict.value">{{
-                  dict.label }}</el-radio>
+                <el-radio
+                  v-for="dict in dict.type.sys_normal_disable"
+                  :key="`${dict.value}`"
+                  :label="dict.value"
+                  >{{ dict.label }}</el-radio
+                >
               </el-radio-group>
             </el-form-item>
           </el-col>
@@ -219,19 +418,39 @@
     </DialogCom>
 
     <!-- 用户导入对话框 -->
-    <DialogCom :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
-      <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
-        :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
+    <DialogCom
+      :title="upload.title"
+      :visible.sync="upload.open"
+      width="400px"
+      append-to-body
+    >
+      <el-upload
+        ref="upload"
+        :limit="1"
+        accept=".xlsx, .xls"
+        :headers="upload.headers"
+        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess"
+        :auto-upload="false"
+        drag
+      >
         <i class="el-icon-upload"></i>
         <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
         <div class="el-upload__tip text-center" slot="tip">
           <div class="el-upload__tip" slot="tip">
-            <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
+            <el-checkbox v-model="upload.updateSupport" />
+            是否更新已经存在的用户数据
           </div>
           <span>仅允许导入xls、xlsx格式文件。</span>
-          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
-            @click="importTemplate">下载模板</el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            style="font-size: 12px; vertical-align: baseline"
+            @click="importTemplate"
+            >下载模板</el-link
+          >
         </div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -243,15 +462,23 @@
 </template>
 
 <script>
-import OrgTree from '@/components/orgTree'
-import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus } from "@/api/system/user";
+import OrgTree from "@/components/orgTree";
+import {
+  listUser,
+  getUser,
+  delUser,
+  addUser,
+  updateUser,
+  resetUserPwd,
+  changeUserStatus,
+} from "@/api/system/user";
 import { getToken } from "@/utils/auth";
 import { deptTreeSelect } from "@/api/system/public";
 import tableList from "@/mixins/tableList";
 
 export default {
   name: "User",
-  dicts: ['sys_normal_disable', 'sys_user_sex'],
+  dicts: ["sys_normal_disable", "sys_user_sex"],
   components: { OrgTree },
   mixins: [tableList],
   data() {
@@ -305,7 +532,7 @@ export default {
         // 设置上传的请求头部
         headers: { Authorization: "Bearer " + getToken() },
         // 上传的地址
-        url: process.env.VUE_APP_BASE_API + "/system/user/importData"
+        url: process.env.VUE_APP_BASE_API + "/system/user/importData",
       },
       // 查询参数
       queryParams: {
@@ -315,7 +542,7 @@ export default {
         phone: null,
         status: null,
         orgId: null,
-        checkSub: false
+        checkSub: true,
       },
       // 列信息
       columns: [
@@ -326,19 +553,24 @@ export default {
         { key: 4, label: `状态`, visible: true },
         { key: 5, label: `是否管理人员`, visible: true },
         { key: 6, label: `登录IP`, visible: true },
-        { key: 7, label: `登录时间`, visible: true }
+        { key: 7, label: `登录时间`, visible: true },
       ],
       // 表单校验
       rules: {
         username: [
           { required: true, message: "用户名称不能为空", trigger: "blur" },
-          { min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' }
+          {
+            min: 2,
+            max: 20,
+            message: "用户名称长度必须介于 2 和 20 之间",
+            trigger: "blur",
+          },
         ],
         name: [
-          { required: true, message: "用户昵称不能为空", trigger: "blur" }
+          { required: true, message: "用户昵称不能为空", trigger: "blur" },
         ],
         roleIds: [
-          { required: true, message: "用户角色不能为空", trigger: "blur" }
+          { required: true, message: "用户角色不能为空", trigger: "blur" },
         ],
         password: [
           { required: true, message: '密码不能为空', trigger: 'blur' },
@@ -355,7 +587,7 @@ export default {
           },
         ],
         orgId: [
-          { required: true, message: "所属机构不能为空", trigger: "blur" }
+          { required: true, message: "所属机构不能为空", trigger: "blur" },
         ],
         // email: [
         //   {
@@ -368,9 +600,9 @@ export default {
           {
             pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
             message: "请输入正确的手机号码",
-            trigger: "blur"
-          }
-        ]
+            trigger: "blur",
+          },
+        ],
       },
       //默认选中节点
       defaultKeys: null,
@@ -385,13 +617,11 @@ export default {
     //   this.initPassword = response.msg;
     // });
   },
-  mounted() {
-
-  },
+  mounted() {},
   methods: {
     /** 查询机构树数据 */
     getDeptTree() {
-      deptTreeSelect().then(response => {
+      deptTreeSelect().then((response) => {
         this.deptOptions = response.data;
       });
     },
@@ -408,13 +638,13 @@ export default {
     /** treeSelect组件自定义数据*/
     tenantIdnormalizer(node, instanceId) {
       if (node.children && !node.children.length) {
-        delete node.children
+        delete node.children;
       }
       return {
         id: node.id,
         label: node.name,
-        children: node.children
-      }
+        children: node.children,
+      };
     },
 
     /** 搜索按钮操作 */
@@ -426,23 +656,25 @@ export default {
     resetQuery() {
       this.resetForm("queryForm");
       this.handleQuery();
-
     },
 
     /** 查询列表 */
     getList() {
       this.loading = true;
-      listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
-        //兼容框架userId字段
-        response.data.rows.forEach(v => { v.userId = v.id });
-        this.userList = response.data.rows;
-        this.total = response.data.total;
-        this.check = response.check;
-        this.loading = false;
-      }
-      ).catch(err => {
-        this.loading = false;
-      })
+      listUser(this.addDateRange(this.queryParams, this.dateRange))
+        .then((response) => {
+          //兼容框架userId字段
+          response.data.rows.forEach((v) => {
+            v.userId = v.id;
+          });
+          this.userList = response.data.rows;
+          this.total = response.data.total;
+          this.check = response.check;
+          this.loading = false;
+        })
+        .catch((err) => {
+          this.loading = false;
+        });
     },
 
     getDefaultKey(key) {
@@ -457,17 +689,21 @@ export default {
     // 用户状态修改
     handleStatusChange(row) {
       let text = row.status === "1" ? "启用" : "停用";
-      this.$modal.confirm('确认要' + text + '"' + row.name + '"用户吗?').then(function () {
-        const data = {
-          id: row.id,
-          isLock: row.isLock
-        }
-        return changeUserStatus(data);
-      }).then(() => {
-        this.$modal.msgSuccess(text + "成功");
-      }).catch(function () {
-        row.status = row.status === "0" ? "1" : "0";
-      });
+      this.$modal
+        .confirm("确认要" + text + '"' + row.name + '"用户吗?')
+        .then(function () {
+          const data = {
+            id: row.id,
+            isLock: row.isLock,
+          };
+          return changeUserStatus(data);
+        })
+        .then(() => {
+          this.$modal.msgSuccess(text + "成功");
+        })
+        .catch(function () {
+          row.status = row.status === "0" ? "1" : "0";
+        });
     },
     // 取消按钮
     cancel() {
@@ -489,13 +725,13 @@ export default {
         remark: undefined,
         postIds: [],
         roleIds: [],
-        isLock: "0"
+        isLock: "0",
       };
       this.resetForm("form");
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.userId);
+      this.ids = selection.map((item) => item.userId);
       this.single = selection.length != 1;
       this.multiple = !selection.length;
     },
@@ -515,7 +751,7 @@ export default {
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
-      getUser().then(response => {
+      getUser().then((response) => {
         this.postOptions = response.posts;
         this.roleOptions = response.roles;
         this.open = true;
@@ -528,8 +764,8 @@ export default {
       console.log(row);
       this.reset();
       const userId = row.id || this.ids;
-      getUser(userId).then(response => {
-        console.log(response.data, 'data')
+      getUser(userId).then((response) => {
+        console.log(response.data, "data");
         this.form = response.data;
         this.postOptions = response.posts;
         this.roleOptions = response.roles;
@@ -542,22 +778,24 @@ export default {
     },
     /** 重置密码按钮操作 */
     handleResetPwd(row) {
-      console.log(row, 'row')
+      console.log(row, "row");
       this.$prompt('请输入"' + row.name + '"的新密码', "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         closeOnClickModal: false,
         inputPattern: /^.{5,20}$/,
-        inputErrorMessage: "用户密码长度必须介于 5 和 20 之间"
-      }).then(({ value }) => {
-        let data = {
-          id: row.userId,
-          password: value
-        }
-        resetUserPwd(data).then(response => {
-          this.$modal.msgSuccess("修改成功,新密码是:" + value);
-        });
-      }).catch(() => { });
+        inputErrorMessage: "用户密码长度必须介于 5 和 20 之间",
+      })
+        .then(({ value }) => {
+          let data = {
+            id: row.userId,
+            password: value,
+          };
+          resetUserPwd(data).then((response) => {
+            this.$modal.msgSuccess("修改成功,新密码是:" + value);
+          });
+        })
+        .catch(() => {});
     },
     /** 分配角色操作 */
     handleAuthRole: function (row) {
@@ -566,16 +804,16 @@ export default {
     },
     /** 提交按钮 */
     submitForm: function () {
-      this.$refs["form"].validate(valid => {
+      this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.id != undefined) {
-            updateUser(this.form).then(response => {
+            updateUser(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            addUser(this.form).then(response => {
+            addUser(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -597,9 +835,13 @@ export default {
     },
     /** 导出按钮操作 */
     handleExport() {
-      this.download('system/user/export', {
-        ...this.queryParams
-      }, `user_${new Date().getTime()}.xlsx`)
+      this.download(
+        "system/user/export",
+        {
+          ...this.queryParams,
+        },
+        `user_${new Date().getTime()}.xlsx`
+      );
     },
     /** 导入按钮操作 */
     handleImport() {
@@ -608,8 +850,11 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      this.download('system/user/importTemplate', {
-      }, `user_template_${new Date().getTime()}.xlsx`)
+      this.download(
+        "system/user/importTemplate",
+        {},
+        `user_template_${new Date().getTime()}.xlsx`
+      );
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -620,15 +865,23 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
+      this.$alert(
+        "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
+          response.msg +
+          "</div>",
+        "导入结果",
+        { dangerouslyUseHTMLString: true }
+      );
       this.getList();
     },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
-    }
-  }
+    },
+  },
 };
 </script>
 <style lang="scss"></style>
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+
+</style>

+ 1 - 1
src/views/system/workTimeSet/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="app-container" style="padding-top: 5px;">
+  <div class="app-container" style="padding-top: 0;">
 
     <el-tabs v-model="activeName" @tab-click="handleClick">
       <el-tab-pane label="作息配置" name="作息配置">

+ 30 - 20
src/views/system/workTimeSet/workTime.vue

@@ -1,6 +1,5 @@
 <template>
   <div class="tabs-container">
-
     <el-row :gutter="20">
       <!--机构数据-->
       <el-col :span="4" :xs="24">
@@ -16,7 +15,7 @@
         </div>
         <div class="tree-container">
           <div style="margin-bottom: 10px;">
-            <el-checkbox v-model="queryParams.checkSub" @change="changeCheckBox">是否关联下级机构</el-checkbox>
+            <el-checkbox v-model="queryParams.checkSub" @change="changeCheckBox">关联下级</el-checkbox>
           </div>
           <el-tree
             :data="deptOptions"
@@ -46,6 +45,7 @@
               range-separator="-"
               start-placeholder="开始日期"
               end-placeholder="结束日期"
+              :clearable="false"
             ></el-date-picker>
           </el-form-item>
           <el-form-item label="营业状态" prop="status">
@@ -65,7 +65,7 @@
           </el-form-item>
           <el-form-item>
             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            <el-button icon="el-icon-refresh" size="mini" @click="resetForm">重置</el-button>
           </el-form-item>
         </el-form>
 
@@ -93,12 +93,12 @@
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
         </el-row>
 
-        <el-table v-loading="loading" style="width: auto;" size="nimi" border :data="tableList">
+        <el-table v-loading="loading" style="width: auto;" size="mini" border :data="tableList">
           <el-table-column v-if="columns[0].visible" prop="orgName" label="机构"></el-table-column>
           <el-table-column v-if="columns[1].visible" label="日期" >
             <span slot-scope="scope">{{scope.row.ymdDate}}</span>
           </el-table-column>
-          <el-table-column v-if="columns[2].visible" label="营业状态">
+          <el-table-column v-if="columns[2].visible" label="营业状态" :width="100">
             <template slot-scope="r">{{r.row.isEnable?'营业':'歇业'}}</template>
           </el-table-column>
           <el-table-column v-if="columns[3].visible" label="上下班时间段">
@@ -116,7 +116,7 @@
               <span>{{scope.row.noonbreakStart}}-{{scope.row.noonbreakEnd}}</span>
             </template>
           </el-table-column>
-          <el-table-column v-if="columns[6].visible" prop="modifiedName" label="更新人"></el-table-column>
+          <el-table-column v-if="columns[6].visible" prop="modifiedName" label="更新人" width="100"></el-table-column>
           <el-table-column v-if="columns[7].visible" label="更新时间" >
             <span slot-scope="scope">{{scope.row.updateTime}}</span>
           </el-table-column>
@@ -128,10 +128,11 @@
         </el-table>
 
         <pagination
-          v-show="pages.total>0"
-          :total="pages.total"
-          :page.sync="pages.pageNum"
-          :limit.sync="pages.pageSize"
+          class="pages-box"
+          v-show="total>0"
+          :total="total"
+          :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize"
           @pagination="getList"
         />
       </el-col>
@@ -146,7 +147,6 @@
 </template>
 
 <script>
-import tableListMixins  from '@/mixins/tableList'
 import DialogEdit from './dialog.edit'
 import DialogAdd from './dialog.add'
 
@@ -163,10 +163,11 @@ export default {
   /**  得先引入字典才能使用 */
   dicts: ['sys_business_type'],
   /** 引入基础minxins*/
-  mixins:[tableListMixins],
   components: {DialogEdit,DialogAdd},
   data() {
     return {
+      // 遮罩层
+      loading: false,
       //选中的行
       selectRow:null,
       // 显示搜索条件
@@ -187,12 +188,15 @@ export default {
         label: "name"
       },
       // 查询参数
-      queryParams: {
+     queryParams: {
         checkSub: false,
         orgId: null,
         isEnable:'1',
+        pageNum:1,
+        pageSize:10,
         range: [formatTime(timeb), formatTime(timea)],
       },
+      total:0,
       // 列信息
       columns: [
         { key: 0, label: `机构`, visible: true },
@@ -231,13 +235,10 @@ export default {
     /** 查询列表 */
     getList() {
       this.loading = true;
-      let data = {
-        ...this.queryParams,
-        ...this.pages
-      }
-      tableList(data).then(response => {
+      console.log(this.queryParams,'pages')
+      tableList(this.queryParams,).then(response => {
           this.tableList = response.rows;
-          this.pages.total = response.total;
+          this.total = response.total;
           this.loading = false;
         }
       ).catch(err=>{
@@ -290,9 +291,18 @@ export default {
         orgId: null,
         isEnable:'1',
         range: [formatTime(timeb), formatTime(timea)],
-      }
+      };
+      this.getList();
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
     },
   }
 };
 
 </script>
+<style lang="scss">
+
+</style>

+ 23 - 16
src/views/system/workTimeSet/workTimeWeek.vue

@@ -1,6 +1,5 @@
 <template>
   <div class="tabs-container">
-
     <el-row :gutter="20">
       <!--机构数据-->
       <el-col :span="4" :xs="24">
@@ -56,7 +55,7 @@
           </el-form-item>
           <el-form-item>
             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            <el-button icon="el-icon-refresh" size="mini" @click="resetForm">重置</el-button>
           </el-form-item>
         </el-form>
 
@@ -75,7 +74,7 @@
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
         </el-row>
 
-        <el-table v-loading="loading" style="width: auto;" size="nimi" border :data="tableList">
+        <el-table v-loading="loading" style="width: auto;" size="mini" border :data="tableList">
           <el-table-column v-if="columns[0].visible" prop="orgName" label="机构"></el-table-column>
           <el-table-column v-if="columns[1].visible" prop="effectiveDate" label="生效日期" ></el-table-column>
           <el-table-column v-if="columns[2].visible" prop="workDay" label="工作日"></el-table-column>
@@ -93,10 +92,10 @@
         </el-table>
 
         <pagination
-          v-show="pages.total >0"
-          :total="pages.total"
-          :page.sync="pages.pageNum"
-          :limit.sync="pages.pageSize"
+          v-show="total >0"
+          :total="total"
+          :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize"
           @pagination="getList"
         />
       </el-col>
@@ -109,18 +108,18 @@
 </template>
 
 <script>
-import tableListMixins  from '@/mixins/tableList'
 import DialogTemplate from './dialog.template'
 /** 引入节点树接口*/
 import { deptTreeSelect} from "@/api/system/public";
 import {weekTableList} from './api'
+import {formatTime} from "@/utils/ruoyi";
 export default {
   /**  得先引入字典才能使用 */
   dicts: ['sys_business_type'],
-  mixins:[tableListMixins],
   components: {DialogTemplate},
   data() {
     return {
+      loading:false,
       //选中的行
       selectRow:null,
       // 显示搜索条件
@@ -142,10 +141,14 @@ export default {
       },
       // 查询参数
       queryParams: {
+        pageNum: 1,
+        pageSize: 10,
         checkSub: false,
         orgId: null,
         isEnable:false,
       },
+      dateRange:[],
+      total:0,
       // 列信息
       columns: [
         { key: 0, label: `机构`, visible: true },
@@ -184,6 +187,11 @@ export default {
     });
   },
   methods: {
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
     /** 查看 */
     lookItem(row) {
       this.selectRow = row;
@@ -199,13 +207,9 @@ export default {
     },
     /** 查询列表 */
     getList() {
-      let data = {
-        ...this.queryParams,
-        ...this.pages
-      }
-      weekTableList(this.addDateRange(data, this.dateRange)).then(response => {
+      weekTableList(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
           this.tableList = response.data.records;
-          this.pages.total = response.data.total;
+          this.total = response.data.total;
           this.loading = false;
         }
       ).catch(err=>{
@@ -216,7 +220,6 @@ export default {
     getDeptTree() {
       deptTreeSelect().then(response => {
         this.orgTree = response.data;
-        console.log( this.deptOptions,' this.deptOptions')
         this.defaultKeys.push(response.data[0].id);
         this.queryParams.orgId = response.data[0].id;
         this.handleQuery();
@@ -246,9 +249,13 @@ export default {
     /* 重置搜索 */
     resetForm(name){
       this.queryParams = {
+          pageNum: 1,
+          pageSize: 10,
           orgId: null,
           isEnable:false,
       }
+      this.dateRange = [];
+      this.getList();
     },
   }
 };