소스 검색

Merge branch 'dev' of http://10.87.10.227:4000/jzyd_yyds/soc_web into dev

luojun 2 년 전
부모
커밋
0744ef87e3

+ 1 - 1
.env.development

@@ -13,7 +13,7 @@ ENV = 'development'
 VUE_APP_BASE_API = 'http://10.87.10.47:8080'
 #高雄
 #VUE_APP_BASE_API = 'http://10.87.11.94:8080'
-VUE_APP_BASE_API = 'http://localhost:8080'
+#VUE_APP_BASE_API = 'http://localhost:8080'
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true
 

+ 6 - 0
src/api/system/role.js

@@ -128,5 +128,11 @@ export function findAllRole(query) {
     method: 'get',
     params:query
   })
+
 }
 
+export function findRoleByType(type) {    
+  return request({
+    url: '/system/role/getRoleByType/'+ type,
+    method: 'get',
+  })}

+ 5 - 0
src/assets/styles/element-ui.scss

@@ -93,3 +93,8 @@
   height: calc(100vh - 185px);
   overflow: auto;
 }
+
+.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{
+  background-color:#008CD6 !important;
+  color:#fff;
+}

+ 156 - 152
src/components/orgTreeSelect/index.vue

@@ -1,95 +1,110 @@
 <template>
-    <!--  弹出框  -->
-    <el-popover
-      placement="bottom-start"
-      :disabled="disabled"
-      v-model="visible">
-      <!--  选中的值  -->
-      <div  slot="reference" class="tags-box">
-        <i v-if="sNodeList.length > 0 && !disabled" class="el-icon-circle-close close-icon" @click="clear"></i>
-        <el-tag type="success" v-for="v in sNodeList" :key="v.id">{{v.name}}</el-tag>
-      </div>
+  <!--  弹出框  -->
+  <el-popover placement="bottom-start" :disabled="disabled" v-model="visible">
+    <!--  选中的值  -->
+    <div slot="reference" class="tags-box">
+      <i
+        v-if="sNodeList.length > 0 && !disabled"
+        class="el-icon-circle-close close-icon"
+        @click="clear"
+      ></i>
+      <el-tag type="success" v-for="v in sNodeList" :key="v.id">{{
+        v.name
+      }}</el-tag>
+    </div>
 
-      <!--  文本框    -->
-      <el-input style="width: 100%;margin-bottom: 20px;" v-model="queryForm.value" placeholder="请输入过滤值" clearable></el-input>
-      <!--  下拉框   -->
-      <el-row :gutter="20" type="flex" align="middle">
-        <el-col :span="14" :xs="24">
-          <el-select  v-model="queryForm.type" placeholder="请选择过滤机构类型" clearable>
-            <el-option
-              v-for="dict in dict.type.sys_org_type"
-              :key="dict.value"
-              :label="dict.label"
-              :value="`${dict.value}`"
-            ></el-option>
-          </el-select>
-        </el-col>
-        <el-col :span="10" :xs="24" >
-          <el-checkbox v-model="checked">按过滤机构类型勾选</el-checkbox>
-        </el-col>
-      </el-row>
-      <!--  机构树   -->
-      <div class="tree-box">
-        <el-tree
-          ref="tree"
-          :data='orgTree'
-          :props="props"
-          node-key="id"
-          show-checkbox
-          check-strictly
-          :expand-on-click-node="false"
-          :default-checked-keys="nodes"
-          @node-click="handleNodeClick"
-          @check="onCheck"
-          :filter-node-method="filterNode">
-        </el-tree>
-      </div>
+    <!--  文本框    -->
+    <el-input
+      style="width: 100%; margin-bottom: 20px"
+      v-model="queryForm.value"
+      @input="serchTreeHandler"
+      placeholder="请输入过滤值"
+      clearable
+    ></el-input>
+    <!--  下拉框   -->
+    <el-row :gutter="20" type="flex" align="middle">
+      <el-col :span="14" :xs="24">
+        <el-select
+          v-model="queryForm.type"
+          placeholder="请选择过滤机构类型"
+          clearable
+          @change="serchTreeHandler"
+        >
+          <el-option
+            v-for="dict in dict.type.sys_org_type"
+            :key="dict.value"
+            :label="dict.label"
+            :value="`${dict.value}`"
+          ></el-option>
+        </el-select>
+      </el-col>
+      <el-col :span="10" :xs="24">
+        <el-checkbox v-model="checked">按过滤机构类型勾选</el-checkbox>
+      </el-col>
+    </el-row>
+    <!--  机构树   -->
+    <div class="tree-box">
+      <el-tree
+        ref="tree"
+        :data="orgTree"
+        :props="defaultProps"
+        node-key="id"
+        show-checkbox
+        check-strictly
+        :expand-on-click-node="false"
+        :default-checked-keys="nodes"
+        @node-click="handleNodeClick"
+        @check="onCheck"
+        :filter-node-method="filterNode"
+      >
+      </el-tree>
+    </div>
   </el-popover>
 </template>
 
 <script>
-import {deptTreeSelect} from "@/api/system/public";
+import { deptTreeSelect } from "@/api/system/public";
 
 export default {
-  dicts:['sys_org_type'],
+  dicts: ["sys_org_type"],
   props: {
     defaultNode: {
       type: Array,
-      required: false
+      required: false,
     },
-    disabled:{
+    disabled: {
       type: Boolean,
-      default:false,
-      required: false
-    }
+      default: false,
+      required: false,
+    },
   },
-  data (){
+  data() {
     return {
       //清除图标
-      showClearable:false,
+      showClearable: false,
       //弹窗显示
-      visible:false,
+      visible: false,
       //结构树
-      orgTree:null,
+      orgTree: null,
       //自定义字段
-      props: {
-        label: 'name',
+      defaultProps: {
+        label: "name",
       },
       //过滤条件
-      queryForm:{
-        value:null,
-        type:null,
+      queryForm: {
+        value: null,
+        type: null,
       },
       //受否全选
-      checked:false,
+      checked: false,
       //默认展示的node
       //defaultNode:[],
       //已选中的node
-      sNodeList:[],
-      nodes:[],
-    }
+      sNodeList: [],
+      nodes: [],
+    };
   },
-  mounted(){
+  mounted() {
     this.getDeptTree();
   },
   watch: {
@@ -102,129 +117,118 @@ export default {
         });
       },
     },
-    queryForm:{
-      deep:true,
-      handler(n,o) {
-        this.$refs.tree.filter(n);
-      },
-    },
+    // queryForm: {
+    //   deep: true,
+    //   handler(n, o) {
+       
+    //     if(!n.value&&!n.type){
+    //       this.$refs.tree.filter({});
+    //     }else{
+
+    //       this.$refs.tree.filter(n);
+    //     }
+    //   },
+    // },
   },
   // computed: {
   //   defaultNode:
   //   //pv: sync("value"),
   // },
-  model:{
-    prop: 'defaultNode',
-    event: 'change'
+  model: {
+    prop: "defaultNode",
+    event: "change",
   },
-  methods:{
-    clear(){
+  methods: {
+    clear() {
       this.sNodeList = [];
       this.$refs.tree.setCheckedKeys([]);
       this.$refs.tree.setCurrentKey(null);
       this.$emit("selectNode", JSON.stringify(this.sNodeList));
     },
+    //筛选条件变化
+    serchTreeHandler(){
+      this.$refs.tree.filter(this.queryForm)
+    },
     /** 查询机构树 */
     getDeptTree() {
-      deptTreeSelect().then(response => {
+      deptTreeSelect().then((response) => {
         this.orgTree = response.data;
       });
     },
     filterNode(value,data,node){
+      
       if (this.queryForm.value && this.queryForm.type) {
-        return data.name.indexOf(this.queryForm.value) >= 0 && data.type == this.queryForm.type;
+        return data.name.indexOf(this.queryForm.value) !== -1 && data.type == this.queryForm.type;
       }
       if (this.queryForm.value) {
-        return data.name.indexOf(this.queryForm.value) >= 0;
+        return data.name.indexOf(this.queryForm.value) !== -1;
       }
       if (this.queryForm.type) {
         return data.type == this.queryForm.type;
       }
       return true
     },
-    handleNodeClick(){
-
-    },
+    
+    handleNodeClick() {},
     onCheck(data, checked, tree) {
-        if (this.queryForm.type && this.checked) {
-          let subOrgIds = [];
-          let currentCheckedIndex = checked.checkedKeys.findIndex(
-            (x) => {
-              x == data.id
-            }
-          );
-          checked.checkedKeys.splice(currentCheckedIndex, 1);
-          let checkValue = currentCheckedIndex > -1;
-          this.getSubOrgIdsByOrgType(data, this.queryForm.type, subOrgIds);
-          console.log(subOrgIds,checkValue,'subOrgIds')
-          if (!checkValue) {
-            subOrgIds.forEach((x) => checked.checkedKeys.push(x.id));
-          } else {
-            subOrgIds.forEach((x) => {
-              let index = checked.checkedKeys.findIndex((y) => x.id == y);
-              if (index > -1) {
-                checked.checkedKeys.splice(index, 1);
-              }
-            });
-          }
-          console.log(checked,'checked')
-          this.$refs.tree.setCheckedKeys(checked.checkedKeys);
-      }
+      
       this.sNodeList = this.$refs.tree.getCheckedNodes();
       this.$emit("selectNode", JSON.stringify(this.sNodeList));
     },
     getSubOrgIdsByOrgType(topOrg, orgType, orgIdList) {
-        if (!topOrg) return;
-        if (topOrg.type == orgType) {orgIdList.push(topOrg)};
-        if (topOrg.children && topOrg.children.length > 0) {
-          topOrg.children.forEach((item) => {
-            this.getSubOrgIdsByOrgType(item, orgType, orgIdList);
-          });
-        }
+      if (!topOrg) return;
+      if (topOrg.type == orgType) {
+        orgIdList.push(topOrg);
+      }
+      if (topOrg.children && topOrg.children.length > 0) {
+        topOrg.children.forEach((item) => {
+          this.getSubOrgIdsByOrgType(item, orgType, orgIdList);
+        });
+      }
     },
-  }
-}
+  },
+};
 </script>
 
 <style scoped lang="scss">
-  .tags-box{
-    background-color: #fff;
-    border-radius: 4px;
-    border: 1px solid #DCDFE6;
-    color: #606266;
-    outline: 0;
-    padding: 0 15px 0 5px;
-    width: 100%;
-    min-height: 40px;
-    max-height: 40px;
-    position: relative;
-    overflow: hidden;
-    display: inline-block;
-    text-overflow: ellipsis;
-    white-space: nowrap;
-    cursor: pointer;
-    >span{
-      margin: 5px 10px;
-    }
-    &:hover{
-      .close-icon{
-        display: block;
-        color: #666;
-      }
-    }
-    .close-icon{
-      position: absolute;
-      top:30%;
-      right: 5px;
-      display: none;
-      cursor: pointer;
+.tags-box {
+  background-color: #fff;
+  border-radius: 4px;
+  border: 1px solid #dcdfe6;
+  color: #606266;
+  outline: 0;
+  padding: 0 15px 0 5px;
+  width: 100%;
+  min-height: 40px;
+  max-height: 40px;
+  position: relative;
+  overflow: hidden;
+  display: inline-block;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  cursor: pointer;
+  > span {
+    margin: 5px 10px;
+  }
+  &:hover {
+    .close-icon {
+      display: block;
+      color: #666;
     }
   }
-  .tree-box{
-    margin-top: 20px;
-    max-height: 300px;
-    overflow: auto;
-    border-radius: 4px;
-    border: 1px solid #DCDFE6;
+  .close-icon {
+    position: absolute;
+    top: 30%;
+    right: 5px;
+    display: none;
+    cursor: pointer;
   }
+}
+.tree-box {
+  margin-top: 20px;
+  max-height: 300px;
+  overflow: auto;
+  border-radius: 4px;
+  border: 1px solid #dcdfe6;
+}
 </style>

+ 1 - 0
src/mixins/tableList.js

@@ -10,6 +10,7 @@ export default {
       // 遮罩层
       loading: false,
       queryParams:{},
+      dateRange:[],
     }
   },
   methods:{

+ 19 - 12
src/views/core/accessPlan/index.vue

@@ -111,7 +111,7 @@
         </el-form-item>
 
         <el-form-item label="调阅机构类型" prop="orgType">
-          <el-select style="width: 100%;" v-model="form.orgType" placeholder="请选择">
+          <el-select style="width: 100%;" v-model="form.orgType" placeholder="请选择" @change="changeSelect">
             <el-option v-for="dict in dict.type.sys_org_type" :key="dict.value" :label="dict.label"
               :value="`${dict.value}`"></el-option>
           </el-select>
@@ -123,14 +123,14 @@
           </el-select>
         </el-form-item>
 
-      
-            <el-form-item label="计划状态" prop="planStatus">
-              <el-radio-group v-model="form.planStatus">
-                <el-radio v-for="dict in dict.type.plan_status" :key="dict.value" :label="dict.value">{{ dict.label
-                }}</el-radio>
-              </el-radio-group>
-            </el-form-item>
-         
+
+        <el-form-item label="计划状态" prop="planStatus">
+          <el-radio-group v-model="form.planStatus">
+            <el-radio v-for="dict in dict.type.plan_status" :key="dict.value" :label="dict.value">{{ dict.label
+            }}</el-radio>
+          </el-radio-group>
+        </el-form-item>
+
 
 
         <el-form-item style="width: 100%;" v-if="form.planCycle == 0" label="开始时间" prop="startTime">
@@ -172,7 +172,7 @@
 
 <script>
 import { listPlan, getPlan, delPlan, addPlan, updatePlan, distribute } from "@/api/core/accessPlan";
-import { listRole } from "@/api/system/role";
+import { listRole, findRoleByType } from "@/api/system/role";
 import tableList from "@/mixins/tableList";
 import orgTree from "@/components/orgTree";
 import { deptTreeSelect } from "@/api/system/public";
@@ -180,8 +180,8 @@ import KFileUpload from "@/components/K-FileUpload/index.vue";
 
 export default {
   name: "Plan",
-  dicts: ['sys_org_type', 'sys_access_cycle', 'sys_normal_disable','plan_status'],
-  components:{
+  dicts: ['sys_org_type', 'sys_access_cycle', 'sys_normal_disable', 'plan_status'],
+  components: {
     orgTree
   },
   data() {
@@ -295,6 +295,13 @@ export default {
       this.queryParams.orgId = data.id;
       this.handleQuery();
     },
+
+    changeSelect(val) {
+  
+      findRoleByType(val).then(response => {
+        this.roleList = response;
+      })
+    },
     /** 查询机构树数据 */
     getDeptTree() {
       deptTreeSelect().then(response => {

+ 7 - 1
src/views/system/menu/index.vue

@@ -102,11 +102,17 @@
           />
         </template>
       </el-table-column>
-      <el-table-column prop="icon" label="图标" align="center" width="100">
+      <el-table-column prop="icon" v-if="activeName==1" label="图标" align="center" width="100">
         <template slot-scope="scope">
           <svg-icon :icon-class="scope.row.icon" />
         </template>
       </el-table-column>
+      <el-table-column prop="icon" v-if="activeName==0" label="图标" align="center" width="100">
+        <template slot-scope="scope">
+          <img :src="scope.row.icon" alt="">
+         
+        </template>
+      </el-table-column>
       <el-table-column
         prop="orderNum"
         label="排序"

+ 16 - 6
src/views/system/workTimeSet/workTime.vue

@@ -25,6 +25,7 @@
             :filter-node-method="filterNode"
             ref="tree"
             node-key="id"
+            highlight-current
             :default-expanded-keys="defaultKeys"
             :default-checked-keys="defaultKeys"
             @node-click="handleNodeClick"
@@ -153,7 +154,11 @@ import DialogAdd from './dialog.add'
 import { deptTreeSelect } from "@/api/system/public";
 import { tableList } from "./api";
 import {formatTime} from "@/utils/ruoyi";
-
+//初始化查询日期
+let timea = new Date();
+timea.setHours(0, 0, 0, 0);
+let timeb = new Date(timea.getTime() - 3600 * 1000 * 24 * 30);
+timeb.setHours(0, 0, 0, 0);
 export default {
   /**  得先引入字典才能使用 */
   dicts: ['sys_business_type'],
@@ -161,11 +166,6 @@ export default {
   mixins:[tableListMixins],
   components: {DialogEdit,DialogAdd},
   data() {
-    //初始化查询日期
-    let timea = new Date();
-    timea.setHours(0, 0, 0, 0);
-    let timeb = new Date(timea.getTime() - 3600 * 1000 * 24 * 30);
-    timeb.setHours(0, 0, 0, 0);
     return {
       //选中的行
       selectRow:null,
@@ -250,6 +250,7 @@ export default {
         this.deptOptions = response.data;
         this.defaultKeys.push(response.data[0].id);
         this.queryParams.orgId = response.data[0].id;
+        this.$refs.tree.setCurrentKey(response.data[0].id);
         this.handleQuery();
       });
     },
@@ -283,6 +284,15 @@ export default {
         ...this.queryParams
       }, `user_${new Date().getTime()}.xlsx`)
     },
+    /* 重置搜索 */
+    resetForm(name){
+      this.queryParams = {
+        orgId: null,
+        isEnable:'1',
+        range: [formatTime(timeb), formatTime(timea)],
+      }
+    },
   }
 };
+
 </script>

+ 10 - 4
src/views/system/workTimeSet/workTimeWeek.vue

@@ -25,6 +25,7 @@
             :filter-node-method="filterNode"
             ref="tree"
             node-key="id"
+            highlight-current
             :default-expanded-keys="defaultKeys"
             :default-checked-keys="defaultKeys"
             @node-click="handleNodeClick"
@@ -38,7 +39,7 @@
         <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
           <el-form-item label="生效日期">
             <el-date-picker
-              v-model="queryParams.params"
+              v-model="dateRange"
               style="width: 240px"
               value-format="yyyy-MM-dd hh:mm:ss"
               type="daterange"
@@ -113,7 +114,6 @@ import DialogTemplate from './dialog.template'
 /** 引入节点树接口*/
 import { deptTreeSelect} from "@/api/system/public";
 import {weekTableList} from './api'
-
 export default {
   /**  得先引入字典才能使用 */
   dicts: ['sys_business_type'],
@@ -145,7 +145,6 @@ export default {
         checkSub: false,
         orgId: null,
         isEnable:false,
-        params: null,
       },
       // 列信息
       columns: [
@@ -204,7 +203,7 @@ export default {
         ...this.queryParams,
         ...this.pages
       }
-      weekTableList(this.addDateRange(data, this.queryParams.params)).then(response => {
+      weekTableList(this.addDateRange(data, this.dateRange)).then(response => {
           this.tableList = response.data.records;
           this.pages.total = response.data.total;
           this.loading = false;
@@ -244,6 +243,13 @@ export default {
         ...this.queryParams
       }, `user_${new Date().getTime()}.xlsx`)
     },
+    /* 重置搜索 */
+    resetForm(name){
+      this.queryParams = {
+          orgId: null,
+          isEnable:false,
+      }
+    },
   }
 };
 </script>