Browse Source

权限控制

dev-烟台0301
dai 3 years ago
parent
commit
385cf3cc73
  1. 51
      src/views/modules/base/resi.vue

51
src/views/modules/base/resi.vue

@ -53,16 +53,22 @@
</el-card>
<el-card class="resi-card-table">
<div class="resi-row-btn">
<el-button size="small" class="diy-button--add" @click="handleAdd"
<el-button
v-if="btnAuths.ic_resi_add"
size="small"
class="diy-button--add"
@click="handleAdd"
>新增</el-button
>
<el-button
v-if="ic_resi_import"
class="diy-button--export"
size="small"
@click="handleExportModule('room')"
>下载模板</el-button
>
<el-upload
v-if="ic_resi_import"
:headers="$getElUploadHeaders()"
ref="upload"
class="upload-demo"
@ -89,17 +95,25 @@
class="diy-button--reset"
:loading="exportBtn"
@click="handleExport">{{exportBtnTitle}}</el-button> -->
<el-button class="diy-button--reset" size="small" @click="diyExport"
<el-button
v-if="btnAuths.ic_resi_export"
class="diy-button--reset"
size="small"
@click="diyExport"
>导出</el-button
>
<el-button class="diy-button--add" size="small" @click="deleteBatch"
<el-button
v-if="btnAuths.ic_resi_batch_del"
class="diy-button--add"
size="small"
@click="deleteBatch"
>批量删除</el-button
>
<!-- <el-button type="primary" size="small">下载人口模板</el-button> -->
<el-button
size="small"
v-if="displayedBaobiaoBtn"
v-if="btnAuths.ic_resi_smart_import && displayedBaobiaoBtn"
class="diy-button--add"
@click="reportForm"
>智能填报</el-button
@ -144,7 +158,7 @@
<!-- :width="item.itemType === 'radio' ? computedWidth(item.label) : 180" -->
<template slot-scope="scope">
<a
v-if="item.columnName == 'NAME'"
v-if="item.columnName == 'NAME' && btnAuths.ic_resi_view"
class="name-a"
@click="handleLook(scope.row)"
>
@ -164,6 +178,7 @@
size="small"
class="div-table-button--detail">变动</el-button> -->
<el-button
v-if="btnAuths.ic_resi_change_rec"
@click="handleChangeRecord(scope.row)"
type="text"
size="small"
@ -172,6 +187,7 @@
>
<template v-if="filterEdit(scope.row.ORG_ID)">
<el-button
v-if="btnAuths.ic_resi_update"
@click="handleEdit(scope.row)"
type="text"
size="small"
@ -179,6 +195,7 @@
>修改</el-button
>
<el-popconfirm
v-if="btnAuths.ic_resi_del"
title="删除之后无法回复,确认删除?"
@onConfirm="handleDel(scope.row)"
>
@ -384,6 +401,7 @@
</el-dialog>
<people-more
v-if="showedPeopleMoreInfo && lookInfo.userId"
:view_real_data="btnAuths.view_real_data"
:userId="lookInfo.userId"
:gridName="lookInfo.gridName"
@close="handleCancleLook"
@ -476,6 +494,7 @@ export default {
btnAuths: {
ic_resi_add: false, //
ic_resi_import: false, //
ic_resi_export: false, //
ic_resi_batch_del: false, //
ic_resi_smart_import: false, //
@ -488,17 +507,6 @@ export default {
};
},
props: {},
//
beforeRouteEnter(to, from, next) {
next((that) => {
if (Array.isArray(to.meta.btns)) {
to.meta.btns.forEach((item) => {
that.btnAuths[item.permissions] = true;
});
}
console.log("^^^^^^^^^^^^^^^^^^btns", that.btnAuths);
});
},
async activated() {
console.log("this.$route.query---", this.$route.query);
if (this.$route.query && this.$route.query.columnName) {
@ -519,6 +527,8 @@ export default {
},
},
async created() {
this.updateBtnAuths();
if (this.$route.query) {
let query = this.$route.query;
this.defaultCategotyKey = query.columnName;
@ -553,6 +563,15 @@ export default {
});
},
methods: {
//
updateBtnAuths() {
let rot = this.router.currentRoute;
if (Array.isArray(rot.meta.btns)) {
rot.meta.btns.forEach((item) => {
this.btnAuths[item.permissions] = true;
});
}
},
reportForm() {
this.$refs.baobiao.init({
elseParams: {

Loading…
Cancel
Save