codeMan 2 年 前
コミット
f821409714

+ 118 - 0
src/HManagement/roleManage/modules/auth_list3.vue

@@ -0,0 +1,118 @@
+<template>
+  <div style="display:inline">
+    <el-button type="primary" size="mini" @click="onShow" icon="el-icon-thumb">授 权</el-button>
+    <el-drawer class="auth-container" title="授权报表列表" append-to-body :visible.sync="dialogTableVisible" size="50%">
+      <div class="container">
+          <div class="flex-align-center normal-margin">
+        <p style="width:50px">搜索:&nbsp;</p>
+        <el-input style="width:250px" v-model="value" size="small" @keyup.native.enter="listData(param.content.where.condition = value)" @clear="listData(param.content.where.condition = '')" placeholder="应用名称" clearable></el-input>
+      </div>
+      <el-row>
+        <el-col :span="24">
+          <Table ref="table" :layout="tablecols" :data="list" :custom="false" height="500px">
+          </Table>
+          <div style="margin:20px 0;text-align:right">
+            <el-pagination
+              background
+              small
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="param.content.pageNumber"
+              :page-size="param.content.pageSize"
+              layout="total, prev, pager, next, jumper"
+              :total="total">
+            </el-pagination>
+          </div>
+        </el-col>
+      </el-row>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button size="small" @click="dialogTableVisible = false" class="normal-btn-width">取 消</el-button>
+        <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
+      </div>
+    </el-drawer>
+
+  </div>
+</template>
+
+<script>
+import Table from './table'
+export default {
+  props:['data'],
+  components:{Table},
+  data () {
+    return {
+      dialogTableVisible:false,
+      param:{
+        "id":20221213141501,
+        "content": {
+            "roleid":'',
+            "pageNumber": 1,
+            "pageSize": 10,
+            "where":{
+              "condition":"",
+            
+            }
+        }
+      },
+      list:[],
+      total:0,
+      value:'',
+      tablecols:[]
+    }
+  },
+  created () {
+    this.tablecols = this.tool.tabelCol(this.$route.name).userCenter.tablecols
+
+  },
+  methods:{
+    async listData () {
+      this.param.content.roleid = this.$route.query.id
+      let res = await this.$api.requested(this.param)
+      this.list = res.data
+      this.total = res.total
+      console.log(this.list);
+      
+    },
+    onShow () {
+      this.dialogTableVisible = true
+      this.listData()
+    },
+    async onSubmit () {
+      let result = this.$refs.table.allArr.map(item => item.sys_reportid)
+      let res = await this.$api.requested({
+        "id":20221213141801,
+        "content": {
+          roleid:this.$route.query.id,
+          sys_reportids: result
+        }
+      })
+      console.log(res);
+      this.tool.showMessage(res,() => {
+        this.$emit('onSuccess')
+        this.dialogTableVisible = false
+      })
+      
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.query_all_auth()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.query_all_auth()
+    },
+  }
+}
+
+</script>
+<style>
+.auth-container .el-tabs--border-card{
+  box-shadow: none !important;
+}
+.auth-container .el-tabs--border-card>.el-tabs__content{
+  padding: 0;
+}
+</style>

+ 8 - 1
src/HManagement/roleManage/modules/role_details.vue

@@ -11,7 +11,7 @@
         idname="roleid"
         ownertable="sys_role"
         tags=""
-        :tabs="['角色授权','报表授权','数据过滤']"
+        :tabs="['角色授权','报表授权','用户授权','数据过滤']"
         @pageChange="pageChange"
         @onEditSuccess="queryMainData($route.query.id)">
       <div slot="tags">
@@ -32,6 +32,11 @@
         </reportCenter>
       </div>
       <div class="container normal-panel" slot="slot2" >
+        <userCenter :data="{roleid:$route.query.id}" @onSuccess="onSuccess">
+          <el-button slot="cancel" size="small" @click="drawer = false" class="normal-btn-width">取 消</el-button>
+        </userCenter>
+      </div>
+      <div class="container normal-panel" slot="slot3" >
        <dataFiltering :data="{roleid:$route.query.id}">
 
        </dataFiltering>
@@ -43,6 +48,7 @@
 <script>
 import roleContentTemp from './roleContent'
 import reportCenter from './reportCenter'
+import userCenter from './userCenter'
 import dataFiltering from './dataFiltering'
 export default {
   name: "detail",
@@ -71,6 +77,7 @@ export default {
   components:{
     roleContentTemp,
     reportCenter,
+    userCenter,
     dataFiltering
   },
   methods:{

+ 117 - 0
src/HManagement/roleManage/modules/userCenter.vue

@@ -0,0 +1,117 @@
+<template>
+  <div>
+    <div style="display:flex;align-items:center">
+<!--      <el-input
+          placeholder="请输入搜索内容"
+          suffix-icon="el-icon-search"
+          v-model="params.content.where.condition"
+          style="width:200px"
+          size="small"
+          class="input-with-select inline-16"
+          @keyup.native.enter="listData()"
+          @clear="listData()"
+          clearable>
+      </el-input>-->
+      <!-- <auth v-if="tool.checkAuth($route.name,'reportCenterAuth')" class="inline-16" @onSuccess="listData()"></auth> -->
+    </div>
+    <div style="margin-top: 15px">
+      <tableLayout :layout="tablecols" :data="list" :opwidth="200" :custom="true"  :height="tableHieght" >
+        <template v-slot:customcol="scope">
+          <div v-if="scope.column.columnname === 'province'">
+            <p>{{ scope.column.data.province + '-' + scope.column.data.city + '-' + scope.column.data.county}}</p>
+          </div>
+          <div v-else-if="!scope.column.data[scope.column.columnname] && scope.column.columnname != 'operation'">--</div>
+          <div v-else>{{scope.column.data[scope.column.columnname]}}</div>
+        </template>
+        <template v-slot:opreation="scope">
+          <el-popconfirm v-if="tool.checkAuth($route.name,'reportCenterAuthDelete')" title="确定删除当前权限吗?" @confirm="deleteRow(scope.data.sys_reportid)">
+            <el-button slot="reference" size="mini" type="text">删 除</el-button>
+          </el-popconfirm>
+        </template>
+      </tableLayout>
+    </div>
+    <div style="margin-top:16px;text-align:right">
+      <el-pagination
+          background
+          small
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="params.content.pageNumber"
+          :page-size="params.content.pageSize"
+          layout="total, prev, pager, next, jumper"
+          :total="total">
+      </el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+import auth from './auth_list3'
+export default {
+  name: '',
+  components:{auth},
+  data() {
+    return {
+      tablecols:[],
+      list:[],
+      params: {
+          "id": "20230302135404",
+          "content": {
+              "roleid":276,
+              "pageNumber":1,
+              "pageSize":20
+          }
+      },
+      total:0
+    };
+  },
+  computed:{
+  },
+  watch:{
+  },
+  created () {
+    this.listData()
+    this.tablecols = this.tool.tabelCol(this.$route.name).userCenter.tablecols
+    console.log(this.tablecols);
+    
+  },
+  methods: {
+    async listData () {
+      this.params.content.roleid = this.$route.query.id
+      let res = await this.$api.requested(this.params)
+      this.list = res.data
+      this.total = res.total
+      console.log(this.list);
+    },
+    async deleteRow (id) {
+      let res = await this.$api.requested({
+        "id":20221213141701,
+        "content": {
+          roleid:this.$route.query.id,
+          sys_reportids:[id]
+        }
+      })
+      this.tool.showMessage(res,() => {
+        this.listData()
+      })
+    },
+    onSuccess () {
+
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.params.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.params.content.pageNumber = val
+      this.listData()
+    },
+  },
+};
+</script>
+
+<style scoped>
+
+</style>

+ 2 - 2
vue.config.js

@@ -14,8 +14,8 @@ module.exports = {
       port: 8000,
       proxy: {
         '/apis': {
-          // target: 'http://61.164.207.46:8000',  // target host*/
-          target: 'https://oms.idcgroup.com.cn:8079/',  // target host
+          target: 'http://61.164.207.46:8000',  // target host*/
+          // target: 'https://oms.idcgroup.com.cn:8079/',  // target host
           // target: 'localhost:8080',  // target host
           ws: true,  // proxy websockets 
           changeOrigin: true,  // needed for virtual hosted sites