Commit c9091069 authored by wangjiankun's avatar wangjiankun

fix: 导出、下载技术资料添加权限按钮

parent 6fc39822
...@@ -361,3 +361,10 @@ ...@@ -361,3 +361,10 @@
background-color: #3974CA!important; background-color: #3974CA!important;
border-color: #3974CA!important; border-color: #3974CA!important;
} }
.el-button.is-disabled {
color: #C0C4CC!important;
cursor: not-allowed!important;
background-image: none!important;
background-color: #FFF!important;
border-color: #EBEEF5!important;
}
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
<el-container> <el-container>
<el-aside :width="isCollapse ? 'auto' : '200px'"> <el-aside :width="isCollapse ? 'auto' : '200px'">
<div class="logo-title-sign"> <div class="logo-title-sign">
<img src="@assets/img/tenio-logo.png" width="21" height="21"> <!-- <img src="@assets/img/tenio-logo.png" width="21" height="21">-->
<b>户型地图大数据</b> <!-- <b>户型地图大数据</b>-->
<img src="@assets/img/logo.png" alt="">
</div> </div>
<transition name="fade"> <transition name="fade">
<el-menu <el-menu
...@@ -97,7 +98,6 @@ export default { ...@@ -97,7 +98,6 @@ export default {
searchByUserInfo() { searchByUserInfo() {
getUserInfo().then((res) => { getUserInfo().then((res) => {
console.log(res); console.log(res);
if(res.code === '200'){ if(res.code === '200'){
this.avatar = res.data.headImg; this.avatar = res.data.headImg;
this.userName = res.data.realName this.userName = res.data.realName
......
...@@ -42,8 +42,12 @@ const user = { ...@@ -42,8 +42,12 @@ const user = {
setToken(data.Authentication) setToken(data.Authentication)
commit('SET_TOKEN', data.Authentication) commit('SET_TOKEN', data.Authentication)
commit('SET_AUTH', data.authorities) commit('SET_AUTH', data.authorities)
sessionStorage.setItem('auth', data.authorities.split(',')) if(username === 'admin') {
sessionStorage.setItem('userName', username) sessionStorage.setItem('access', 'master')
} else {
sessionStorage.setItem('access', data.authorities)
console.log(sessionStorage.getItem('access'))
}
resolve() resolve()
}).catch(error => { }).catch(error => {
reject(error) reject(error)
......
This diff is collapsed.
...@@ -33,7 +33,13 @@ ...@@ -33,7 +33,13 @@
</el-select> </el-select>
</div> </div>
<div style="width: 100%; text-align: right" > <div style="width: 100%; text-align: right" >
<el-button type="primary" :loading="exportLoading" :disabled="exportLoading" size="small" @click="exportSupplyDataForeExcel">导出数据</el-button> <el-button
:title="!haveAuth('supplyDemandExport') ? '无权限' : ''"
type="primary"
:loading="exportLoading"
:disabled="!haveAuth('supplyDemandExport')"
size="small"
@click="exportSupplyDataForeExcel">导出数据</el-button>
</div> </div>
</div> </div>
<el-card :body-style="{ padding: '0' }"> <el-card :body-style="{ padding: '0' }">
...@@ -279,8 +285,23 @@ ...@@ -279,8 +285,23 @@
} }
} }
}, },
computed: {
haveAuth() {
return (accessName) => {
const auth = sessionStorage.getItem('access')
if (auth === 'master') {
return true
}
if (!auth) {
return false
} else {
return auth.split(',').includes(accessName)
}
}
}
},
mounted() { mounted() {
for(let i = new Date().getFullYear(); i>= 1980; i--) { for(let i = new Date().getFullYear(); i>= 2014; i--) {
this.timeOptions.push({ this.timeOptions.push({
value: i, value: i,
label: i + '年' label: i + '年'
......
...@@ -11,9 +11,8 @@ ...@@ -11,9 +11,8 @@
</div> </div>
<div class="bannerOptions"> <div class="bannerOptions">
<el-button type="danger" <el-button type="danger"
v-if="haveAuth" :title="!haveAuth('downloadFile') ? '无权限' : (propertyData.fileList.length === 0 ? '未查询到技术资料' : '')"
:title="propertyData.fileList.length === 0 ? '未查询到技术资料' : ''" :disabled="propertyData.fileList.length === 0 || !haveAuth('downloadFile')" @click="downloadDataFlag = true" >下载技术资料</el-button>
:disabled="propertyData.fileList.length === 0" @click="downloadDataFlag = true" >下载技术资料</el-button>
<el-radio-group v-model="bannerType" @change="scorllTop"> <el-radio-group v-model="bannerType" @change="scorllTop">
<el-radio-button :label="0">总图</el-radio-button> <el-radio-button :label="0">总图</el-radio-button>
<el-radio-button :label="1">立面</el-radio-button> <el-radio-button :label="1">立面</el-radio-button>
...@@ -123,7 +122,12 @@ ...@@ -123,7 +122,12 @@
<div class="salesInfomation" v-if="bannerType !== 2"> <div class="salesInfomation" v-if="bannerType !== 2">
<div class="title" style="padding-left: 20px">销售信息</div> <div class="title" style="padding-left: 20px">销售信息</div>
<div style="text-align: right;padding-right: 20px"> <div style="text-align: right;padding-right: 20px">
<el-button type="primary" :disabled="propertyExportLoading" :loading="propertyExportLoading" @click="propertySaleInfoExport">导出数据</el-button> <el-button
:title="!haveAuth('propertyDetails') ? '无权限' : ''"
:disabled="!haveAuth('propertyDetails')"
:loading="propertyExportLoading"
type="primary"
@click="propertySaleInfoExport">导出数据</el-button>
</div> </div>
<div ref="imgExport" class="container"> <div ref="imgExport" class="container">
<el-row class="firstRow supplyDataDetail"> <el-row class="firstRow supplyDataDetail">
...@@ -841,15 +845,14 @@ ...@@ -841,15 +845,14 @@
}, },
computed: { computed: {
haveAuth() { haveAuth() {
const userName = sessionStorage.getItem('userName') return (accessName) => {
if(userName === 'admin') { const auth = sessionStorage.getItem('access')
return true if(auth === 'master') { return true }
} if(!auth) {
const auth = sessionStorage.getItem('auth') return false
if(!auth) { } else {
return false return auth.split(',').includes(accessName)
} else { }
return auth.split(',').includes('downloadFile')
} }
}, },
colum () { colum () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment