|
@@ -1,141 +1,133 @@
|
|
|
/** * 组件名称:角色授权情况 * @author:laiyh * @Date:2020-07-28 */
|
|
|
|
|
|
<template>
|
|
|
- <dg-row>
|
|
|
- <el-form ref="form" :model="form" inline label-suffix=":" id="my-form">
|
|
|
- <dg-row>
|
|
|
- <dg-col :span="24">
|
|
|
- <el-form-item prop="appId.value" label="应用系统名称">
|
|
|
- <dg-select
|
|
|
- v-model="form.appId.value"
|
|
|
- clearable
|
|
|
- filterable
|
|
|
- :data="appNames"
|
|
|
- valueName="code"
|
|
|
- labelName="value"
|
|
|
- placeholder="请选择应用系统名称"
|
|
|
- @change="handleChangeSysName"
|
|
|
- ></dg-select>
|
|
|
- </el-form-item>
|
|
|
- </dg-col>
|
|
|
- </dg-row>
|
|
|
- </el-form>
|
|
|
- <p class="table-text__detail" v-show="isShowNums">
|
|
|
- 当前应用拥有角色【<span class="text-detail__number">{{ roleNums }}</span
|
|
|
- >】个,应用分配总名额 【<span class="text-detail__number">{{ initNums }}</span
|
|
|
- >】名
|
|
|
- </p>
|
|
|
- <Table ref="myTable" :url="tableUrl" :headerData="headerData" :condition="form" :lazyLoad="true">
|
|
|
- <dg-table-column label="机构名称" prop="name" align="center" fixed="left">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <a href="javascript:;" @click="handleDetail(row)">{{ row.name }}</a>
|
|
|
- </template>
|
|
|
- </dg-table-column>
|
|
|
- </Table>
|
|
|
- </dg-row>
|
|
|
+ <dg-row>
|
|
|
+ <el-form ref="form" :model="form" inline label-suffix=":">
|
|
|
+ <el-form-item prop="appId.value" label="应用系统名称">
|
|
|
+ <dg-select
|
|
|
+ v-model="form.appId.value"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ :data="appNames"
|
|
|
+ valueName="code"
|
|
|
+ labelName="value"
|
|
|
+ placeholder="请选择应用系统名称"
|
|
|
+ style="width: 280px"
|
|
|
+ @change="handleChangeSysName"
|
|
|
+ ></dg-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <p class="table-text__detail" v-show="isShowNums">
|
|
|
+ 当前应用拥有角色【<span class="text-detail__number">{{ roleNums }}</span
|
|
|
+ >】个,应用分配总名额 【<span class="text-detail__number">{{ initNums }}</span
|
|
|
+ >】名
|
|
|
+ </p>
|
|
|
+ <Table ref="myTable" :url="tableUrl" :headerData="headerData" :condition="form" :lazyLoad="true">
|
|
|
+ <dg-table-column label="机构名称" prop="name" align="center" fixed="left">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <a href="javascript:;" @click="handleDetail(row)">{{ row.name }}</a>
|
|
|
+ </template>
|
|
|
+ </dg-table-column>
|
|
|
+ </Table>
|
|
|
+ </dg-row>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import Table from "@/pages/common/table";
|
|
|
-import Editor from "./editor";
|
|
|
-import * as statisticsApi from "@/api/statistics-manage";
|
|
|
-const areaEditor = ["910px", "560px"];
|
|
|
+import Table from '@/pages/common/table';
|
|
|
+import Editor from './editor';
|
|
|
+import * as statisticsApi from '@/api/statistics-manage';
|
|
|
+const areaEditor = ['910px', '560px'];
|
|
|
|
|
|
export default {
|
|
|
- name: "",
|
|
|
- components: { Table },
|
|
|
- // 接收父节点的参数
|
|
|
- props: {},
|
|
|
- data() {
|
|
|
- return {
|
|
|
- tableUrl: statisticsApi.tableUrl,
|
|
|
- form: {
|
|
|
- appId: { value: "", op: "=" }
|
|
|
- },
|
|
|
- headerData: [
|
|
|
- { label: "机构代码", prop: "code", fixed: "left" },
|
|
|
- { label: "应分配名额", prop: "mustQuotas" },
|
|
|
- { label: "实际分配名额", prop: "quotaed" },
|
|
|
- { label: "待分配名额", prop: "kfpme" },
|
|
|
- { label: "完成情况", prop: "overRate" }
|
|
|
- ],
|
|
|
- // appNames
|
|
|
- appNames: [],
|
|
|
- roleNums: "",
|
|
|
- initNums: "",
|
|
|
- isShowNums: false
|
|
|
- };
|
|
|
+ name: '',
|
|
|
+ components: { Table },
|
|
|
+ // 接收父节点的参数
|
|
|
+ props: {},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tableUrl: statisticsApi.tableUrl,
|
|
|
+ form: {
|
|
|
+ appId: { value: '', op: '=' }
|
|
|
+ },
|
|
|
+ headerData: [
|
|
|
+ { label: '机构代码', prop: 'code', fixed: 'left' },
|
|
|
+ { label: '应分配名额', prop: 'mustQuotas' },
|
|
|
+ { label: '实际分配名额', prop: 'quotaed' },
|
|
|
+ { label: '待分配名额', prop: 'kfpme' },
|
|
|
+ { label: '完成情况', prop: 'overRate' }
|
|
|
+ ],
|
|
|
+ // appNames
|
|
|
+ appNames: [],
|
|
|
+ roleNums: '',
|
|
|
+ initNums: '',
|
|
|
+ isShowNums: false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ // 方法
|
|
|
+ methods: {
|
|
|
+ handleSearch() {
|
|
|
+ this.$refs.myTable.handleSearchClick();
|
|
|
},
|
|
|
- // 方法
|
|
|
- methods: {
|
|
|
- handleSearch() {
|
|
|
- this.$refs.myTable.handleSearchClick();
|
|
|
- },
|
|
|
- // 应用系统下拉
|
|
|
- getAppName() {
|
|
|
- const that = this;
|
|
|
- statisticsApi
|
|
|
- .getAppName()
|
|
|
- .then(res => {
|
|
|
- that.appNames = res;
|
|
|
- })
|
|
|
- .catch(error => {
|
|
|
- that.$error("获取应用系统失败!");
|
|
|
- });
|
|
|
- },
|
|
|
- // 应用拥有的角色、配额
|
|
|
- getRoleQuotasInfo(appId) {
|
|
|
- const that = this;
|
|
|
- statisticsApi.getRoleQuotasInfo(appId).then(res => {
|
|
|
- that.roleNums = res.roleNums;
|
|
|
- that.initNums = res.initNums;
|
|
|
- });
|
|
|
- },
|
|
|
- // 应用系统名称改变
|
|
|
- handleChangeSysName(appId) {
|
|
|
- if (appId) {
|
|
|
- this.handleSearch();
|
|
|
- this.getRoleQuotasInfo(appId);
|
|
|
- this.isShowNums = true;
|
|
|
- }
|
|
|
- },
|
|
|
- handleDetail({ id }) {
|
|
|
- const that = this;
|
|
|
- const layer = that.$dgLayer({
|
|
|
- title: "分局应用授权情况",
|
|
|
- shadow: [0.4, "#fff"],
|
|
|
- area: areaEditor,
|
|
|
- props: {
|
|
|
- orgId: id,
|
|
|
- appId: that.form.appId.value,
|
|
|
- isInit: true
|
|
|
- },
|
|
|
- content: Editor
|
|
|
- });
|
|
|
- }
|
|
|
+ // 应用系统下拉
|
|
|
+ getAppName() {
|
|
|
+ const that = this;
|
|
|
+ statisticsApi
|
|
|
+ .getAppName()
|
|
|
+ .then((res) => {
|
|
|
+ that.appNames = res;
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ that.$error('获取应用系统失败!');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 应用拥有的角色、配额
|
|
|
+ getRoleQuotasInfo(appId) {
|
|
|
+ const that = this;
|
|
|
+ statisticsApi.getRoleQuotasInfo(appId).then((res) => {
|
|
|
+ that.roleNums = res.roleNums;
|
|
|
+ that.initNums = res.initNums;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 应用系统名称改变
|
|
|
+ handleChangeSysName(appId) {
|
|
|
+ if (appId) {
|
|
|
+ this.handleSearch();
|
|
|
+ this.getRoleQuotasInfo(appId);
|
|
|
+ this.isShowNums = true;
|
|
|
+ }
|
|
|
},
|
|
|
- // 页面创建完成$data可访问 $el不可以访问
|
|
|
- created() {
|
|
|
- this.getAppName();
|
|
|
+ handleDetail({ id }) {
|
|
|
+ const that = this;
|
|
|
+ const layer = that.$dgLayer({
|
|
|
+ title: '分局应用授权情况',
|
|
|
+ shadow: [0.4, '#fff'],
|
|
|
+ area: areaEditor,
|
|
|
+ props: {
|
|
|
+ orgId: id,
|
|
|
+ appId: that.form.appId.value,
|
|
|
+ isInit: true
|
|
|
+ },
|
|
|
+ content: Editor
|
|
|
+ });
|
|
|
}
|
|
|
+ },
|
|
|
+ // 页面创建完成$data可访问 $el不可以访问
|
|
|
+ created() {
|
|
|
+ this.getAppName();
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scope>
|
|
|
-#my-form {
|
|
|
- .el-select {
|
|
|
- width: 800px;
|
|
|
- }
|
|
|
-}
|
|
|
.table-text__detail {
|
|
|
- .text-detail__number {
|
|
|
- color: blue;
|
|
|
- font-size: 20px;
|
|
|
- font-weight: bold;
|
|
|
- }
|
|
|
+ .text-detail__number {
|
|
|
+ color: blue;
|
|
|
+ font-size: 20px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
}
|
|
|
.orgName__aLink {
|
|
|
- color: blue;
|
|
|
- cursor: pointer;
|
|
|
+ color: blue;
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
|
</style>
|