Jelajahi Sumber

代码上传

zhangqiOMG 2 tahun lalu
induk
melakukan
f50d958ac4

+ 0 - 0
src/HManagement/accountManage/modules/account_detail copy.vue → src/HManagement/accountManage/bak/account_detail copy.vue


+ 8 - 8
src/HManagement/accountManage/index copy.vue → src/HManagement/accountManage/bak/index copy.vue

@@ -24,15 +24,15 @@
 </template>
 
 <script>
-import list from './modules/list.vue'
-import add from './modules/add.vue'
-import accountDel from './modules/account_delete.vue'
-import accountEdit from './modules/edit.vue'
-import accountUse from './modules/useAccdount.vue'
-import accountUnuse from './modules/unuseAccount.vue'
+import list from './list.vue'
+import add from '../add.vue'
+import accountDel from '../account_delete.vue'
+import accountEdit from '../edit.vue'
+import accountUse from '../useAccdount.vue'
+import accountUnuse from '../unuseAccount.vue'
 
-import role from './modules/set_account_role.vue'
-import accountDetail from './modules/account_detail.vue'
+import role from '../set_account_role.vue'
+import accountDetail from '../account_detail.vue'
 
 export default {
   components:{

+ 0 - 0
src/HManagement/accountManage/modules/list.vue → src/HManagement/accountManage/bak/list.vue


+ 18 - 9
src/HManagement/accountManage/index.vue

@@ -8,7 +8,7 @@
       }"
       tableName="accountTable" 
       idName="userid" 
-      :apiId="{query:20221031141102,del:20221031141102}"
+      :apiId="{query:20221031141102,del:20221031141202}"
       :options="options"
       :detailPath="{
         path:'/account_details'
@@ -30,14 +30,23 @@
         </el-select>
       </div>
       <template v-slot:tbList="scope">
-        <div>
-          {{scope.data.column.data[[scope.data.column.columnname]]}}
-        </div>
-      </template>
-      <template v-slot:tbOpreation="scope">
-        <!-- <account-edit v-if="tool.checkAuth($route.name,'update')" :data="scope.data.data" @onSuccess="onSuccess" :type="'text'"></account-edit> -->
-        <account-use v-if="tool.checkAuth($route.name,'use') && scope.data.data.status === 'INACTIVE'" :data="scope.data.data" @onSuccess="onSuccess" :type="'text'"></account-use>
-        <account-unuse v-if="tool.checkAuth($route.name,'use') && scope.data.data.status === 'ACTIVE'" :data="scope.data.data" @onSuccess="onSuccess" :type="'text'"></account-unuse>
+        <p v-if="scope.data.column.columnname === 'status'">
+          <span
+            :style="
+              scope.data.column.data.status === 'ACTIVE'
+                ? 'color:#52C41A'
+                : 'color:#FF3B30'
+            "
+            >{{
+              scope.data.column.data.status === "ACTIVE"
+                ? "启用"
+                : scope.data.column.data.status === "INACTIVE"
+                ? "停用"
+                : "其他"
+            }}</span
+          >
+        </p>
+        <p v-else> {{scope.data.column.data[[scope.data.column.columnname]]}}</p>
       </template>
     </basicLayout>
   </div>

+ 69 - 39
src/HManagement/accountManage/modules/account_detail.vue

@@ -1,40 +1,67 @@
 <template>
   <div>
     <basicDetails
-        ref="details"
-        :titleText="`${mainData.accountno}-${mainData.name}`"
-        :oldFormPath="{edit:'HManagement/accountManage/modules'}"
-        :editData="mainData"
-        :mainAreaData="mainAreaData"
-        turnPageId="20221031141102"
-        idname="userid"
-        ownertable="sys_users"
-        tags=""
-        :tabs="['员工信息','角色信息']"
-        @pageChange="pageChange"
-        @onEditSuccess="queryMainData($route.query.id)">
-      <div slot="tags">
-      </div>
+      ref="details"
+      :titleText="`${mainData.accountno}-${mainData.name}`"
+      :oldFormPath="{edit:'HManagement/accountManage/modules'}"
+      :editData="mainData"
+      :mainAreaData="mainAreaData"
+      turnPageId="20221031141102"
+      idname="userid"
+      ownertable="sys_users"
+      tags=""
+      :tabs="['员工信息','角色信息']"
+      @pageChange="pageChange"
+      @onEditSuccess="queryMainData($route.query.id)">
       <div slot="customOperation" >
+        <useTemp v-if="tool.checkAuth($route.name,'use')" :data="mainData" @onSuccess="queryMainData"></useTemp>
+        <unuseTemp v-if="tool.checkAuth($route.name,'use')" :data="mainData" @onSuccess="queryMainData"></unuseTemp>
       </div>
-      <div slot="slot0" >
+      <div class="container normal-panel" slot="slot0" >
+        <el-descriptions :column="6">
+          <el-descriptions-item label-class-name="my-label" content-class-name="my-content" label="编号">{{mainData.hrmsg.hrcode?mainData.hrmsg.hrcode:'--'}}</el-descriptions-item>
+          <el-descriptions-item label-class-name="my-label" content-class-name="my-content" label="身份证号">{{mainData.hrmsg.idcard?mainData.hrmsg.idcard:'--'}}</el-descriptions-item>
+          <el-descriptions-item label-class-name="my-label" content-class-name="my-content" label="部门">{{mainData.hrmsg.depname?mainData.hrmsg.depname:'--'}}</el-descriptions-item>
+          <el-descriptions-item label-class-name="my-label" content-class-name="my-content" label="是否部门负责人">{{mainData.hrmsg.isleader === 1?'是':'否'}}</el-descriptions-item>
+          <el-descriptions-item label-class-name="my-label" content-class-name="my-content" label="职位">{{mainData.hrmsg.position?mainData.hrmsg.position:'--'}}</el-descriptions-item>
+          <el-descriptions-item label-class-name="my-label" content-class-name="my-content" label="办公电话">{{mainData.hrmsg.officetelephone?mainData.hrmsg.officetelephone:'--'}}</el-descriptions-item>
+          <el-descriptions-item label-class-name="my-label" content-class-name="my-content" label="姓名">{{mainData.hrmsg.name?mainData.hrmsg.name:'--'}}</el-descriptions-item>
+          <el-descriptions-item label-class-name="my-label" content-class-name="my-content" label="电话">{{mainData.hrmsg.phonenumber?mainData.hrmsg.phonenumber:'--'}}</el-descriptions-item>
+          <el-descriptions-item label-class-name="my-label" content-class-name="my-content" label="性别">{{mainData.hrmsg.sex?mainData.hrmsg.sex:'--'}}</el-descriptions-item>
+          <el-descriptions-item label-class-name="my-label" content-class-name="my-content" label="电子邮箱">{{mainData.hrmsg.email?mainData.hrmsg.email:'--'}}</el-descriptions-item>
+        </el-descriptions>
       </div>
-      <div slot="slot1" >
+      <div class="container normal-panel" slot="slot1" >
+        <tableLayout :layout="table_roleinfo" :data="roleData" :opwidth="200" :custom="false">
+          <template v-slot:opreation="scope">
+            <el-button type="text" size="small" @click="$router.push({path:'/roleDetail',query:{id:scope.data.roleid}})">详 情</el-button>
+          </template>
+        </tableLayout>
       </div>
     </basicDetails>
   </div>
 </template>
 
 <script>
+import unuseTemp from './unuseAccount.vue'
+import useTemp from './useAccdount.vue'
 export default {
   name: "detail",
   data() {
     return {
       mainData:{},
-      mainAreaData:{}
+      mainAreaData:{},
+      table_userinfo:[],
+      table_hrinfo:[],
+      table_roleinfo:[],
+      list:[],
+      hrmsg:[],
+      roleData:[]
     }
   },
   components:{
+    unuseTemp,
+    useTemp
   },
   methods:{
     async queryMainData(id) {
@@ -46,6 +73,22 @@ export default {
         }
       })
       this.mainData = res.data
+      let arr = [{
+        accountno:res.data.accountno,
+        phonenumber:res.data.phonenumber,
+        usertypename:res.data.usertypename,
+        status:res.data.status
+      }]
+      this.list = arr
+      // 插入人员数据
+      if (typeof(res.data.hrmsg) === 'object'){
+        res.data.hrmsg.systemname = res.data.name
+        let hrmsg = [res.data.hrmsg]
+        this.hrmsg = hrmsg
+      }
+      // 插入角色数据
+      this.roleData = res.data.userrole
+      this.changeDataStructure()
     },
     changeDataStructure() {
       this.mainAreaData = [
@@ -55,39 +98,20 @@ export default {
         },
         {
           label:'状态',
-          value:this.minaInfo.status === 'ACTIVE'?'启用':this.minaInfo.status === 'INACTIVE'?'停用':'其他'
+          value:this.mainData.status === 'ACTIVE'?'启用':this.mainData.status === 'INACTIVE'?'停用':'其他'
         },
         {
           label:'联系方式',
           value:this.mainData.phonenumber
-        },
-        {
-          label:'上级企业',
-          value:this.mainData.superiorenterprisename
-        },
-        {
-          label:'成交状态',
-          value:this.mainData.tradingstatus
-        },
-        {
-          label:'负责人',
-          value:this.mainData.leader[0]?this.mainData.leader[0].name:""
-        },
-        {
-          label:'最近跟近时间',
-          value:''
-        },
-        {
-          label:'所属公海',
-          value:this.mainData.poolname
         }
       ]
+      console.log(this.mainAreaData)
     },
     // 监听切换数据,上一页,下一页
     pageChange (id,rowindex,tabIndex) {
       this.flag = false
       tabIndex = this.$route.query.tabIndex
-      this.$router.replace({path:'/customerDetail',query:{id:id,rowindex:rowindex,tabIndex:tabIndex}})
+      this.$router.replace({path:'/account_details',query:{id:id,rowindex:rowindex,tabIndex:tabIndex}})
       this.queryMainData(id)
     },
     onSuccess(){
@@ -100,6 +124,12 @@ export default {
     this.queryMainData(this.$route.query.id)
   },
   created() {
+    // 获取用户信息表结构
+    this.table_userinfo = this.tool.tabelCol(this.$route.name).detailUserinfo.tablecols
+    // 获取人员表结构
+    this.table_hrinfo = this.tool.tabelCol(this.$route.name).detailHrInfo.tablecols
+    // 获取角色表结构
+    this.table_roleinfo = this.tool.tabelCol(this.$route.name).detailRoleInfo.tablecols
   }
 }
 </script>

+ 4 - 4
src/HManagement/accountManage/modules/add.vue

@@ -8,8 +8,8 @@
       direction="rtl"
       append-to-body
       @close="onClose">
-      <div class="container">
-        <el-row :gutter="50">
+      <div class="drawer__panel">
+        <el-row>
           <el-form :model="form" :rules="rules" ref="form"  size="mini" label-position="left">
             <el-col :span="24">
               <el-form-item label="手机号码" label-width="100px" prop="phonenumber">
@@ -37,9 +37,9 @@
           </el-form>
         </el-row>
       </div>
-      <div class="dialog-footer">
+      <div class="fixed__btn__panel">
         <el-button size="small" @click="drawer = false" class="normal-btn-width">取 消</el-button>
-        <el-button size="small" type="warning" @click="onSubmit" class="normal-btn-width btn-warning">确 定</el-button>
+        <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
       </div>
     </el-drawer>
   </div>

+ 8 - 8
src/HManagement/accountManage/modules/edit.vue

@@ -1,15 +1,15 @@
 <template>
-  <div class="inline-16">
-    <el-button size="small" type="text" @click="onShow">编 辑</el-button>
+  <div>
+    <el-button size="mini" type="default" :disabled="data.status === 'ACTIVE'" @click="onShow">编 辑</el-button>
     <el-drawer
       title="编辑用户"
       :visible.sync="drawer"
-      width="864px"
+      size="664px"
       direction="rtl"
       append-to-body>
-      <div>
-        <el-row :gutter="50">
-          <el-form :model="form" :rules="rules" ref="form"  size="mini" label-position="left">
+      <div class="drawer__panel">
+        <el-row :gutter="20">
+          <el-form :model="form" :rules="rules" ref="form"  size="small" label-position="left">
             <el-col :span="12">
               <el-form-item label="账号" label-width="100px">
                 <el-input v-model="form.accountno" readonly autocomplete="off" placeholder="输入账号"></el-input>
@@ -46,9 +46,9 @@
           </el-form>
         </el-row>
       </div>
-      <div class="dialog-footer">
+      <div class="fixed__btn__panel">
         <el-button size="small" @click="drawer = false" class="normal-btn-width">取 消</el-button>
-        <el-button size="small" type="warning" @click="onSubmit" class="normal-btn-width btn-warning">确 定</el-button>
+        <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
       </div>
     </el-drawer>
   </div>

+ 2 - 2
src/HManagement/accountManage/modules/unuseAccount.vue

@@ -1,9 +1,9 @@
 <template>
-  <div class="inline-16">
+  <div v-if="data.status === 'ACTIVE'">
     <el-popconfirm
       title="确定停用当前选中账号吗?"
       @confirm="stop()">
-      <el-button slot="reference" size="small" type="text">停 用</el-button>
+      <el-button slot="reference" size="mini" type="default">停 用</el-button>
     </el-popconfirm>
   </div>
 </template>

+ 2 - 2
src/HManagement/accountManage/modules/useAccdount.vue

@@ -1,9 +1,9 @@
 <template>
-  <div class="inline-16">
+  <div  v-if="data.status === 'INACTIVE'">
     <el-popconfirm
       title="确定启用当前选中账号吗?"
       @confirm="start()">
-      <el-button slot="reference" type="text" size="small">启 用</el-button>
+      <el-button slot="reference" type="default" size="mini">启 用</el-button>
     </el-popconfirm>
   </div>
 </template>

+ 42 - 0
src/HManagement/roleManage/bak/index copy.vue

@@ -0,0 +1,42 @@
+<template>
+  <div>
+    <add class="container normal-panel" style="margin-bottom:16px"></add>
+    <div class="container normal-panel">
+      <list ref="list">
+        <template v-slot:detail="scope">
+          <div class="inline-16">
+            <el-button type="text" size="small" @click="$router.push({path:'/roleDetail',query:{id:scope.data.roleid}})">详 情</el-button>
+          </div>
+        </template>
+        <template v-slot:edit="scope">
+          <el-button v-if="tool.checkAuth($route.name,'update')" type="text" size="small" @click="$router.push({path:'/roleEdit',query:{id:scope.data.roleid}})">编 辑</el-button>
+        </template>   
+      </list>
+    </div>
+  </div>
+</template>
+
+<script>
+import list from '../modules/list.vue'
+import add from '../modules/add.vue'
+
+export default {
+  components:{
+    list,
+    add
+  },
+  data () {
+    return {
+      row:{}
+    }
+  },
+  methods:{
+    
+  },
+  mounted () {
+  }
+}
+
+</script>
+<style>
+</style>

+ 139 - 0
src/HManagement/roleManage/bak/role_details copy.vue

@@ -0,0 +1,139 @@
+<template>
+  <div>
+    <div class="container normal-panel mb-16">
+      <el-button v-if="tool.checkAuth($route.name,'update')" size="small" icon="el-icon-edit" @click="$router.replace({path:'/roleEdit',query:{id:roleid}})">编 辑</el-button>
+      <onDel v-if="tool.checkAuth($route.name,'delete')" :data="{roleid:roleid}"></onDel>
+    </div>
+    <div class="container normal-panel mb-16">
+      <p class="normal-title mb-16">角色信息</p>
+      <el-row>
+        <el-form :inline="true" :model="form" ref="form" size="small" label-position="left" class="demo-form-inline">
+          <el-col :span="8">
+            <el-form-item label="角色名称:">
+              <p>{{form.rolename}}</p>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="角色描述:">
+              <p>{{form.remarks}}</p>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="角色类型:">
+              <p>{{form.usertypename}}</p>
+            </el-form-item>
+          </el-col>
+        </el-form>
+      </el-row>
+    </div>
+    <div class="container normal-panel mb-16">
+      <p class="normal-title mb-16">角色授权</p>
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <tableLayout :layout="tablecols" :data="roleMainInfo.apps" height="500px" :custom="false" @rowClick="appoptionselect">
+          </tableLayout>
+        </el-col>
+        <el-col :span="11">
+          <el-row :gutter="40">
+            <el-col :span="12">
+              <p class="title">功能</p>
+              <div class="flex-align-center flex-between option-item" v-for="item in appoptions" :key="item.index">
+                <p>{{item.optionname}}</p>
+              </div>
+            </el-col>
+            <el-col :span="12">
+              <p class="title">隐藏字段</p>
+              <div class="flex-align-center flex-between option-item" v-for="item in hiddenfields" :key="item.index">
+                <p>{{item.fieldname}}</p>
+              </div>
+            </el-col>
+          </el-row>
+        </el-col>
+      </el-row>
+    </div>
+  </div>
+</template>
+
+<script>
+import onDel from '../modules/delete_role.vue'
+export default {
+  components:{
+    onDel
+  },
+  data () {
+    return{
+      form:{
+        "roleid":0,
+        "rolename":"",
+        "remarks":""
+      },
+      roleMainInfo:{},
+      tablecols:[],
+      appoptions:[],
+      hiddenfields:[],
+      roleid:0,
+      active_systemappid:''
+    }
+  },
+  created() {
+  },
+  methods:{
+    async roleMain () {
+      const res = await this.$api.requested({
+        "classname": "webmanage.role.role",
+        "method": "query_roleMain",
+        "content": {
+            "roleid":this.roleid
+        }
+      })
+      this.form = {
+        "roleid":res.data.roleid,
+        "rolename":res.data.rolename,
+        "remarks":res.data.remarks,
+        "usertype":res.data.usertype,
+        "usertypename":res.data.usertypename
+      }
+      this.roleMainInfo = res.data
+      
+      //显示默认授权信息,一般默认信息为第一条数据
+      this.appoptionselect(res.data.apps[0])
+    },
+    async appoptionselect (row) {
+      this.active_systemappid = row.systemappid
+      this.appoptions = row.options
+      this.hiddenfields = row.hiddenfields
+    },
+  },
+  mounted () {
+    // 获取应用表结构
+    this.tablecols = this.tool.tabelCol(this.$route.name).detailsAppsTable.tablecols
+
+    this.roleid = this.$route.query.id
+    this.roleid !== '0'?this.roleMain():''
+  }
+}
+
+</script>
+<style>
+</style>
+<style scoped>
+.mb-16{
+  margin-bottom:16px
+}
+.title{
+  height: 20px;
+  line-height: 20px;
+  font-size: 14px;
+  text-indent: 7px;
+  font-weight: bold;
+  color: #333333;
+  margin-bottom: 20px;
+  border-left: .3rem solid #3874F6;
+}
+.option-item{
+  color:#333333;
+  font-size: 14px;
+  border-bottom:1px solid #f1f2f3;
+  line-height: 35px;
+}
+</style>

+ 63 - 22
src/HManagement/roleManage/index.vue

@@ -1,39 +1,80 @@
+
 <template>
   <div>
-    <add class="container normal-panel" style="margin-bottom:16px"></add>
-    <div class="container normal-panel">
-      <list ref="list">
-        <template v-slot:detail="scope">
-          <div class="inline-16">
-            <el-button type="text" size="small" @click="$router.push({path:'/roleDetail',query:{id:scope.data.roleid}})">详 情</el-button>
-          </div>
-        </template>
-        <template v-slot:edit="scope">
-          <el-button v-if="tool.checkAuth($route.name,'update')" type="text" size="small" @click="$router.push({path:'/roleEdit',query:{id:scope.data.roleid}})">编 辑</el-button>
-        </template>   
-      </list>
-    </div>
+    <basicLayout 
+      ref="basicLayout" 
+      :oldFormPath="{
+        add:'HManagement/roleManage/modules'
+      }"
+      tableName="roleTable" 
+      idName="roleid" 
+      :apiId="{query:20221101131902,del:20221101132002}"
+      :options="options"
+      :detailPath="{
+        path:'/roleDetail'
+      }">
+      <div slot="custom">
+        <el-select
+          class="inline-16"
+          size="small"
+          v-model="type"
+          placeholder="请选择"
+          @change="handleSelectChange"
+          clearable
+        >
+          <el-option
+            v-for="item in select"
+            :label="item.remarks"
+            :value="item.value"
+            :key="item.index"
+          ></el-option>
+        </el-select>
+      </div>
+      <template v-slot:tbList="scope">
+        <p> {{scope.data.column.data[[scope.data.column.columnname]]}}</p>
+      </template>
+    </basicLayout>
   </div>
 </template>
 
 <script>
-import list from './modules/list.vue'
-import add from './modules/add_role.vue'
-
 export default {
-  components:{
-    list,
-    add
-  },
   data () {
     return {
-      row:{}
+      options:[],
+      select:[],
+      type:''
     }
   },
+  components:{
+  },
   methods:{
-    
+    onSuccess () {
+      this.$refs.basicLayout.listData()
+    },
+    async usertype() {
+      let param = {
+        "classname": "sysmanage.develop.optiontype.optiontype",
+        "method": "optiontypeselect",
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 20,
+          "typename": "usertype",
+          "parameter": {
+          }
+        }
+      };
+      const res = await this.$api.requested(param);
+      this.select = res.data;
+    },
+    handleSelectChange() {
+      this.$refs['basicLayout'].param.content.where.usertype = this.type
+       this.$refs['basicLayout'].param.content.pageNumber = 1
+      this.$refs['basicLayout'].listData()
+    },
   },
   mounted () {
+    this.usertype()
   }
 }
 

+ 45 - 0
src/HManagement/roleManage/modules/add.vue

@@ -0,0 +1,45 @@
+<template>
+  <div>
+    <el-button size="small" type="primary" icon="el-icon-plus" @click="drawer = true">新 建</el-button>
+    <el-drawer
+      title="创建角色"
+      :visible.sync="drawer"
+      append-to-body
+      size="80%"
+      direction="rtl">
+      <div class="drawer__panel">
+        <roleContentTemp :data="{roleid:'0'}" @onSuccess="onSuccess">
+          <el-button slot="cancel" size="small" @click="drawer = false" class="normal-btn-width">取 消</el-button>
+        </roleContentTemp>
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import roleContentTemp from './roleContent.vue'
+export default {
+  data () {
+    return{
+      dialogFormVisible:false,
+      drawer:false,
+      form:{
+        "roleid":0,
+        "rolename":"",
+        "remarks":""
+      }
+    }
+  },
+  components:{
+    roleContentTemp
+  },
+  methods:{
+    onSuccess () {
+      this.$emit('onSuccess')
+    }
+  }
+}
+
+</script>
+<style>
+</style>

+ 0 - 25
src/HManagement/roleManage/modules/add_role.vue

@@ -1,25 +0,0 @@
-<template>
-  <div>
-    <el-button size="small" type="primary" icon="el-icon-plus" @click="$router.push({path:'/roleEdit',query:{id:0}})">新 建</el-button>
-  </div>
-</template>
-
-<script>
-export default {
-  data () {
-    return{
-      dialogFormVisible:false,
-      form:{
-        "roleid":0,
-        "rolename":"",
-        "remarks":""
-      }
-    }
-  },
-  methods:{
-  }
-}
-
-</script>
-<style>
-</style>

+ 1 - 1
src/HManagement/roleManage/modules/auth_list.vue

@@ -148,7 +148,7 @@ export default {
   },
   methods:{
     onShow () {
-      if (this.$route.query.id === '0') return this.$message({
+      if (this.$route.query) return this.$message({
         message:'请先保存角色信息',
         type:'error'
       })

+ 46 - 0
src/HManagement/roleManage/modules/edit.vue

@@ -0,0 +1,46 @@
+<template>
+  <div>
+    <el-button size="mini" type="default" @click="drawer = true">编 辑</el-button>
+    <el-drawer
+      title="创建角色"
+      :visible.sync="drawer"
+      append-to-body
+      size="80%"
+      direction="rtl">
+      <div class="drawer__panel">
+        <roleContentTemp :data="{roleid:$route.query.id}" @onSuccess="onSuccess">
+          <el-button slot="cancel" size="small" @click="drawer = false" class="normal-btn-width">取 消</el-button>
+        </roleContentTemp>
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import roleContentTemp from './roleContent.vue'
+export default {
+  data () {
+    return{
+      dialogFormVisible:false,
+      drawer:false,
+      form:{
+        "roleid":0,
+        "rolename":"",
+        "remarks":""
+      }
+    }
+  },
+  components:{
+    roleContentTemp
+  },
+  methods:{
+    onSuccess () {
+      this.drawer = false
+      this.$emit('onSuccess')
+    }
+  }
+}
+
+</script>
+<style>
+</style>

+ 14 - 14
src/HManagement/roleManage/modules/edit_role.vue → src/HManagement/roleManage/modules/roleContent.vue

@@ -1,9 +1,6 @@
 <template>
-  <div style="width:100%;overflow-x:hidden">
-    <div class="container normal-panel mb-16">
-      <el-button type="warning" size="small" icon="el-icon-s-claim" @click="onSubmit">保 存</el-button>
-    </div>
-    <div class="container normal-panel mb-16">
+  <div class="normal-panel drewer__panel">
+    <div>
       <p class="normal-title mb-16">角色信息</p>
       <el-form :inline="true" :model="form" :rules="rules" ref="form" size="small" label-width="100px" label-position="left" class="demo-form-inline">
         <el-form-item label="角色名称" prop="rolename">
@@ -19,7 +16,7 @@
         </el-form-item>
       </el-form>
     </div>
-    <div class="container normal-panel">
+    <div>
       <p class="normal-title mb-16">角色授权</p>
       <el-row :gutter="20">
         <el-col :span="12">
@@ -55,20 +52,24 @@
               </el-row>
               <div class="flex-align-center flex-between option-item">
                 <el-checkbox :indeterminate="isIndeterminate2" v-model="checkAll2" @change="handleCheckAllChange2">全选</el-checkbox>
-                <cancelAuth v-if="checkedApps.length > 0" :data="{roleid:roleid,systemappid:active_systemappid,optionid:checkedApps}" @onSuccess="roleMain"></cancelAuth>
+                <cancelAuth v-if="checkedApps.length > 0" :data="{roleid:data.roleid,systemappid:active_systemappid,optionid:checkedApps}" @onSuccess="(roleMain(),$emit('onSuccess'))"></cancelAuth>
               </div>
             </el-col>
             <el-col :span="12">
               <p class="title">隐藏字段</p>
               <div class="flex-align-center flex-between option-item" v-for="item in hiddenfields" :key="item.index">
                 <p>{{item.fieldname}}</p>
-                <cancelFields :data="{roleid:roleid,systemappid:active_systemappid,hiddenfieldid:item.hiddenfieldid}" @onSuccess="roleMain"></cancelFields>
+                <cancelFields :data="{roleid:roleid,systemappid:active_systemappid,hiddenfieldid:item.hiddenfieldid}" @onSuccess="(roleMain(),$emit('onSuccess'))"></cancelFields>
               </div>
             </el-col>
           </el-row>
         </el-col>
       </el-row>
     </div>
+    <div class="fixed__btn__panel">
+      <slot name="cancel"></slot>
+      <el-button type="primary" size="small" class="normal-btn-width" @click="onSubmit">保 存</el-button>
+    </div>
   </div>
 </template>
 
@@ -125,7 +126,7 @@ export default {
         "classname": "webmanage.role.role",
         "method": "query_roleMain",
         "content": {
-            "roleid":this.$route.query.id
+          "roleid":this.data.roleid
         }
       })
       this.form = {
@@ -137,7 +138,7 @@ export default {
       this.roleMainInfo = res.data
 
       //显示默认授权信息,一般默认信息为第一条数据
-      this.appoptionselect(res.data.apps[0])
+      res.data.apps[0]?this.appoptionselect(res.data.apps[0]):''
       this.filterModules()
     },
     async usertype () {
@@ -169,7 +170,7 @@ export default {
           "content": this.form
         }).then(res=>{
           this.tool.showMessage(res,()=>{
-            this.$router.replace({path:'/roleEdit',query:{id:res.data.roleid}})
+            this.$emit('onSuccess')
           })
         })
       })
@@ -214,13 +215,12 @@ export default {
   mounted () {
     // 获取应用表结构
     this.tablecols = this.tool.tabelCol(this.$route.name).detailsAppsTable.tablecols
-    this.roleid = this.$route.query.id
-    this.roleid !== '0'?this.roleMain():''
+    this.data.roleid !== '0'?this.roleMain():''
     this.usertype()
   },
   created () {
     // 验证是否有编辑权限,若无权限则弹出
-    this.tool.checkAuth(this.$route.name,'update')?'':this.$router.go(-1)
+    // this.tool.checkAuth(this.$route.name,'update')?'':this.$router.go(-1)
   }
 }
 

+ 84 - 64
src/HManagement/roleManage/modules/role_details.vue

@@ -1,67 +1,57 @@
 <template>
   <div>
-    <div class="container normal-panel mb-16">
-      <el-button v-if="tool.checkAuth($route.name,'update')" size="small" icon="el-icon-edit" @click="$router.replace({path:'/roleEdit',query:{id:roleid}})">编 辑</el-button>
-      <onDel v-if="tool.checkAuth($route.name,'delete')" :data="{roleid:roleid}"></onDel>
-    </div>
-    <div class="container normal-panel mb-16">
-      <p class="normal-title mb-16">角色信息</p>
-      <el-row>
-        <el-form :inline="true" :model="form" ref="form" size="small" label-position="left" class="demo-form-inline">
-          <el-col :span="8">
-            <el-form-item label="角色名称:">
-              <p>{{form.rolename}}</p>
-            </el-form-item>
+    <basicDetails
+        ref="details"
+        :titleText="mainData.rolename"
+        :oldFormPath="{edit:'HManagement/roleManage/modules'}"
+        :editData="mainData"
+        :mainAreaData="mainAreaData"
+        turnPageId="20221101131902"
+        idname="roleid"
+        ownertable="sys_role"
+        tags=""
+        :tabs="['授权信息']"
+        @pageChange="pageChange"
+        @onEditSuccess="queryMainData($route.query.id)">
+      <div slot="tags">
+      </div>
+      <div slot="customOperation" >
+      </div>
+      <div class="container normal-panel" slot="slot0" >
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <tableLayout :layout="tablecols" :data="roleMainInfo.apps" height="500px" :custom="false" @rowClick="appoptionselect">
+            </tableLayout>
           </el-col>
-          <el-col :span="8">
-            <el-form-item label="角色描述:">
-              <p>{{form.remarks}}</p>
-            </el-form-item>
+          <el-col :span="11">
+            <el-row :gutter="40">
+              <el-col :span="12">
+                <p class="title">功能</p>
+                <div class="flex-align-center flex-between option-item" v-for="item in appoptions" :key="item.index">
+                  <p>{{item.optionname}}</p>
+                </div>
+              </el-col>
+              <el-col :span="12">
+                <p class="title">隐藏字段</p>
+                <div class="flex-align-center flex-between option-item" v-for="item in hiddenfields" :key="item.index">
+                  <p>{{item.fieldname}}</p>
+                </div>
+              </el-col>
+            </el-row>
           </el-col>
-          <el-col :span="8">
-            <el-form-item label="角色类型:">
-              <p>{{form.usertypename}}</p>
-            </el-form-item>
-          </el-col>
-        </el-form>
-      </el-row>
-    </div>
-    <div class="container normal-panel mb-16">
-      <p class="normal-title mb-16">角色授权</p>
-      <el-row :gutter="20">
-        <el-col :span="12">
-          <tableLayout :layout="tablecols" :data="roleMainInfo.apps" height="500px" :custom="false" @rowClick="appoptionselect">
-          </tableLayout>
-        </el-col>
-        <el-col :span="11">
-          <el-row :gutter="40">
-            <el-col :span="12">
-              <p class="title">功能</p>
-              <div class="flex-align-center flex-between option-item" v-for="item in appoptions" :key="item.index">
-                <p>{{item.optionname}}</p>
-              </div>
-            </el-col>
-            <el-col :span="12">
-              <p class="title">隐藏字段</p>
-              <div class="flex-align-center flex-between option-item" v-for="item in hiddenfields" :key="item.index">
-                <p>{{item.fieldname}}</p>
-              </div>
-            </el-col>
-          </el-row>
-        </el-col>
-      </el-row>
-    </div>
+        </el-row>
+      </div>
+    </basicDetails>
   </div>
 </template>
 
 <script>
-import onDel from './delete_role.vue'
 export default {
-  components:{
-    onDel
-  },
-  data () {
-    return{
+  name: "detail",
+  data() {
+    return {
+      mainData:{},
+      mainAreaData:{},
       form:{
         "roleid":0,
         "rolename":"",
@@ -75,17 +65,18 @@ export default {
       active_systemappid:''
     }
   },
-  created() {
+  components:{
   },
   methods:{
-    async roleMain () {
+    async queryMainData(id) {
       const res = await this.$api.requested({
         "classname": "webmanage.role.role",
         "method": "query_roleMain",
         "content": {
-            "roleid":this.roleid
+          "roleid":this.$route.query.id
         }
       })
+      this.mainData = res.data
       this.form = {
         "roleid":res.data.roleid,
         "rolename":res.data.rolename,
@@ -96,7 +87,36 @@ export default {
       this.roleMainInfo = res.data
       
       //显示默认授权信息,一般默认信息为第一条数据
-      this.appoptionselect(res.data.apps[0])
+      res.data.apps[0]?this.appoptionselect(res.data.apps[0]):''
+      this.changeDataStructure()
+    },
+    changeDataStructure() {
+      this.mainAreaData = [
+        {
+          label:'角色名称',
+          value:this.mainData.rolename
+        },
+        {
+          label:'角色描述',
+          value:this.mainData.remarks
+        },
+        {
+          label:'角色类型',
+          value:this.mainData.usertypename
+        }
+      ]
+    },
+    // 监听切换数据,上一页,下一页
+    pageChange (id,rowindex,tabIndex) {
+      this.flag = false
+      tabIndex = this.$route.query.tabIndex
+      this.$router.replace({path:'/roleDetail',query:{id:id,rowindex:rowindex,tabIndex:tabIndex}})
+      this.queryMainData(id)
+    },
+    onSuccess(){
+      this.visible = false
+      this.queryMainData(this.$route.query.id)
+      this.$emit('onSuccess')
     },
     async appoptionselect (row) {
       this.active_systemappid = row.systemappid
@@ -105,17 +125,17 @@ export default {
     },
   },
   mounted () {
-    // 获取应用表结构
+   // 获取应用表结构
     this.tablecols = this.tool.tabelCol(this.$route.name).detailsAppsTable.tablecols
 
     this.roleid = this.$route.query.id
-    this.roleid !== '0'?this.roleMain():''
+    this.roleid !== '0'?this.queryMainData():''
+  },
+  created() {
   }
 }
-
 </script>
-<style>
-</style>
+
 <style scoped>
 .mb-16{
   margin-bottom:16px

+ 3 - 3
src/components/normal-basic-layout/details/index.vue

@@ -8,7 +8,7 @@
         </div>
         <div class="flex-align-center">
           <cpEdit v-if="tool.checkAuth($route.name,'update')" :formPath="formPath" :oldFormPath="oldFormPath" :data="editData" btnType="default" @onAddSuccess="onSuccess"></cpEdit>
-          <div class="inline-16">
+          <div>
             <slot name="customOperation"></slot>
           </div>
           <div>
@@ -18,7 +18,7 @@
         </div>
       </div>
       <div>
-        <el-descriptions :column="4" size="mini">
+        <el-descriptions :column="6" size="mini">
           <el-descriptions-item label-class-name="my-label" content-class-name="my-content" v-for="item in mainAreaData" :key="item.index" :label="item.label">{{item.value?item.value:'--'}}</el-descriptions-item>
         </el-descriptions>
       </div>
@@ -26,7 +26,7 @@
     <div style="box-sizing: border-box;padding:20px">
       <el-row :gutter="20">
         <el-col :span="19">
-          <tabTemp :tabs="tabs" :editData="editData" :idname="idname">
+          <tabTemp :tabs="tabs" :editData="editData" :idname="idname" :ownertable="ownertable?ownertable:idname.slice(0, this.idname.length - 2)">
             <div :slot="'slot' + index" v-for="(tab,index) in tabs" :key="tab.index">
               <slot :name="'slot' + index"></slot>
             </div>

+ 8 - 5
src/components/normal-basic-layout/details/modules/tabs/tab.vue

@@ -15,7 +15,7 @@
     <div class="container normal-panel" v-show="activeName === 'file'">
       <attachmentList :attinfos="attinfo_attachment" @onSuccess="queryAttments">
         <upload slot="upload" :folderid="folderid"
-          :bindData="{ ownertable: idname.slice(0, idname.length - 2), ownerid: editData[idname], usetype: 'default' }"
+          :bindData="{ ownertable: ownertable, ownerid: editData[idname], usetype: 'default' }"
           @onSuccess="queryAttments"></upload>
       </attachmentList>
     </div>
@@ -27,7 +27,7 @@ import attachmentList from '@/components/attachment_list/index.vue'
 import upload from '@/components/upload/hw_obs_upload.vue'
 
 export default {
-  props:['tabs','editData','idname'],
+  props:['tabs','editData','ownertable','idname'],
   components:{
     attachmentList,
     upload
@@ -45,7 +45,7 @@ export default {
         "classname": "system.attachment.Attachment",
         "method": "queryFileLink",
         "content": {
-          "ownertable": this.idname.slice(0, this.idname.length - 2),
+          "ownertable": this.ownertable,
           "ownerid": this.editData[this.idname],
           "usetype":""
         }
@@ -53,9 +53,12 @@ export default {
       this.attinfo_attachment = res.data
     }
   },
+  mounted () {
+    // this.queryAttments()
+  },
   watch: {
-    editData () {
-      this.queryAttments()
+    activeName (val) {
+      val === 'file'?this.queryAttments():''
     }
   },
 }

+ 7 - 2
src/components/normal-basic-layout/drawerDetail/index.vue

@@ -7,7 +7,8 @@
       :with-header="false"
       direction="rtl"
       size="90%"
-      append-to-body>
+      append-to-body
+      @close="closeDrawer">
       <div class="detail__panel">
         <router-view v-if = "drawer"/>
       </div>
@@ -30,7 +31,11 @@ export default {
   methods:{
     onShow () {
       let query = {id:this.data[this.idName],rowindex:this.data.rowindex}
-      this.$router.push({path:this.detailPath.path,query:Object.assign({},query,this.detailPath.param)})
+      this.$router.replace({path:this.detailPath.path,query:Object.assign({},query,this.detailPath.param)})
+    },
+    closeDrawer () {
+      this.$router.replace({path:this.detailPath.path})
+      this.$emit('onSuccess')
     }
   }
 }

+ 1 - 1
src/components/normal-basic-layout/index.vue

@@ -40,7 +40,7 @@
               <slot :data="scope" name="tbList"></slot>
             </template>
             <template v-slot:opreation="scope">
-              <drawerTemp class="inline-16" v-if="detailPath" :data="scope.data" :detailPath="detailPath" :idName="idName"></drawerTemp>
+              <drawerTemp class="inline-16" v-if="detailPath" :data="scope.data" :detailPath="detailPath" :idName="idName" @onSuccess="listData"></drawerTemp>
               <slot :data="scope" name="tbOpreation"></slot>
             </template>
           </tableTemp>

+ 0 - 31
src/components/normal-basic-layout/modules/oldEdit.vue

@@ -1,31 +0,0 @@
-<template>
-  <div class="inline-16">
-    <component :is="formComponent" :data="data" :btnType="btnType" @onSuccess="onSuccess"></component>
-  </div>
-</template>
-
-<script>
-export default {
-  props:['formPath','data','btnType'],
-  data () {
-    return {
-    }
-  },
-  computed:{
-		formComponent(){
-      return ()=>import(`@/Form/${this.formPath}/edit.vue`)
-		}
-	},
-  methods:{
-    onSuccess () {
-      this.$emit('onAddSuccess')
-    }
-  },
-  mounted () {
-    
-  }
-}
-
-</script>
-<style>
-</style>

+ 14 - 11
src/router/HManagement.js

@@ -31,16 +31,19 @@ const HManagement = [
       title: '角色管理',
       ast_nav: true
     },
-    component: () => import(/* webpackChunkName: "about" */ '@/HManagement/roleManage/index.vue')
-  }, {
-    path: '/roleDetail',
-    name: 'roles',
-    meta: {
-      title: '角色详情',
-      ast_nav: true,
-      keeproute: true
-    },
-    component: () => import(/* webpackChunkName: "about" */ '@/HManagement/roleManage/modules/role_details.vue')
+    component: () => import(/* webpackChunkName: "about" */ '@/HManagement/roleManage/index.vue'),
+    children:[
+      {
+        path: '/roleDetail',
+        name: 'roles',
+        meta: {
+          title: '角色详情',
+          ast_nav: true,
+          keeproute: true
+        },
+        component: () => import(/* webpackChunkName: "about" */ '@/HManagement/roleManage/modules/role_details.vue')
+      },
+    ]
   },
   {
     path: '/roleEdit',
@@ -50,7 +53,7 @@ const HManagement = [
       ast_nav: true,
       keeproute: true
     },
-    component: () => import(/* webpackChunkName: "about" */ '@/HManagement/roleManage/modules/edit_role.vue')
+    component: () => import(/* webpackChunkName: "about" */ '@/HManagement/roleManage/modules/roleContentTemp.vue')
   }, {
     path: '/account_manage',
     name: 'users',

+ 21 - 1
src/style/style.css

@@ -38,6 +38,7 @@ ul{
   color: rgb(184, 179, 179);
 }
 .container{
+  position: relative;
   padding: 16px;
 }
 .flex-align-center{
@@ -157,7 +158,7 @@ ul{
 }
 
 .my-label{
-  width: 100px;
+  width: 70px;
   font-size: 14px;
   color:rgb(163, 163, 163) !important;
 }
@@ -167,4 +168,23 @@ ul{
 }
 .el-drawer__wrapper{
   right:60px !important;
+}
+.fixed__btn__panel{
+  position: absolute;
+  display: flex;
+  justify-content: center;
+  width: 100%;
+  bottom: 0;
+  left:0;
+  padding:16px 10px;
+  text-align: center;
+  border-top:1px solid #f1f2f3;
+  background-color: #fff;
+}
+.drawer__panel{
+  padding:0 16px;
+  margin-bottom:72px
+}
+.el-notification.right{
+  right:70px !important;
 }