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)
......
...@@ -59,7 +59,13 @@ ...@@ -59,7 +59,13 @@
</el-radio-group> </el-radio-group>
</div> </div>
<div style="width: 100%;text-align: right"> <div style="width: 100%;text-align: right">
<el-button type="primary" size="small" :loading="exportLoading" :disabled="exportLoading" @click="exportPlateAnalysis">导出数据</el-button> <el-button
:title="!haveAuth('dataAnalysisExport') ? '无权限' : ''"
type="primary"
size="small"
:loading="exportLoading"
:disabled="!haveAuth('dataAnalysisExport')"
@click="exportPlateAnalysis">导出数据</el-button>
</div> </div>
</div> </div>
<el-card :body-style="{padding: '0'}"> <el-card :body-style="{padding: '0'}">
...@@ -183,11 +189,11 @@ ...@@ -183,11 +189,11 @@
import {downloadFile} from "../../assets/js/public"; import {downloadFile} from "../../assets/js/public";
export default { export default {
name: "ProductAnalysis", name: "ProductAnalysis",
components:{ components: {
unitCard, unitCard,
multiHeaderTable multiHeaderTable
}, },
data () { data() {
return { return {
pieData: { pieData: {
columns: ['productionPie', 'supplication'], columns: ['productionPie', 'supplication'],
...@@ -206,8 +212,7 @@ ...@@ -206,8 +212,7 @@
}, },
histogramData: { histogramData: {
columns: [], columns: [],
rows: [ rows: []
]
}, },
map: { map: {
'nxmkAvg': '南向面宽', 'nxmkAvg': '南向面宽',
...@@ -216,8 +221,8 @@ ...@@ -216,8 +221,8 @@
'kwmkAvg': '客卧面宽' 'kwmkAvg': '客卧面宽'
}, // 房屋数据 map匹配 }, // 房屋数据 map匹配
histogramTableData: [], histogramTableData: [],
chartSettings : { chartSettings: {
axisSite: { right: ['下单率'] }, axisSite: {right: ['下单率']},
yAxisType: ['normal'] yAxisType: ['normal']
}, },
extend: { extend: {
...@@ -229,8 +234,10 @@ ...@@ -229,8 +234,10 @@
show: true, show: true,
fontSize: 11, fontSize: 11,
position: "top", position: "top",
formatter:function(params){ //标签内容 formatter: function (params) { //标签内容
if(params.data == 0) { return '' } if (params.data == 0) {
return ''
}
return params.data.toFixed(1) return params.data.toFixed(1)
} }
} }
...@@ -250,7 +257,7 @@ ...@@ -250,7 +257,7 @@
colorsArr: colors, // 图表颜色风格 colorsArr: colors, // 图表颜色风格
headerTable: tableHeader, // 多级表头-表头数据 headerTable: tableHeader, // 多级表头-表头数据
plateMap: { plateMap: {
// 格式为 regionId: plateData 即区域Id所对应的下属板块数据 // 格式为 regionId: plateData 即区域Id所对应的下属板块数据
}, },
exportLoading: false, // 导出lodaing exportLoading: false, // 导出lodaing
exportExcelSave: null, // 保存的excel表格数据 exportExcelSave: null, // 保存的excel表格数据
...@@ -258,14 +265,10 @@ ...@@ -258,14 +265,10 @@
// 储存分页数据 // 储存分页数据
pageList: [], pageList: [],
// 产品1: { page1: array[6] } // 产品1: { page1: array[6] }
pageListMap: { pageListMap: {},
},
// 多级表头数据 // 多级表头数据
productionProjectData: [], productionProjectData: [],
supplyRateMap: { supplyRateMap: {}, // 供应套数占比map
}, // 供应套数占比map
unitDetailJsonExport: '' // 户型详细信息导出json处理后保存 unitDetailJsonExport: '' // 户型详细信息导出json处理后保存
} }
}, },
...@@ -276,15 +279,15 @@ ...@@ -276,15 +279,15 @@
this.pageList[index].page = currentPage this.pageList[index].page = currentPage
}, },
// 导出板块产品分析-图表数据 // 导出板块产品分析-图表数据
exportPlateAnalysis () { exportPlateAnalysis() {
if(this.exportExcelSave) { if (this.exportExcelSave) {
this.exportLoading = true this.exportLoading = true
exportAsExcel({ exportAsExcel({
title: this.exportExcelSave.title, title: this.exportExcelSave.title,
dataJsonTwo: JSON.stringify(this.exportExcelSave.detilProductJsonDtoList), dataJsonTwo: JSON.stringify(this.exportExcelSave.detilProductJsonDtoList),
dataJson: this.unitDetailJsonExport dataJson: this.unitDetailJsonExport
}).then(res => { }).then(res => {
if(res) { if (res) {
const title = this.exportExcelSave.title.replace(/;/g, '-') const title = this.exportExcelSave.title.replace(/;/g, '-')
downloadFile(res, title, 'application/vnd.ms-excel;charset=utf-8').then(() => { downloadFile(res, title, 'application/vnd.ms-excel;charset=utf-8').then(() => {
this.$message({ this.$message({
...@@ -306,9 +309,9 @@ ...@@ -306,9 +309,9 @@
} }
}, },
// 区域变化后 根据区域map匹配对应的下属板块 // 区域变化后 根据区域map匹配对应的下属板块
changePlateForRegion (region) { changePlateForRegion(region) {
this.plateVal = '' this.plateVal = ''
if(this.plateMap[region] && this.plateMap[region].length > 0) { if (this.plateMap[region] && this.plateMap[region].length > 0) {
this.plateOptions = this.plateMap[region] this.plateOptions = this.plateMap[region]
} else { } else {
this.plateOptions = [] this.plateOptions = []
...@@ -335,13 +338,15 @@ ...@@ -335,13 +338,15 @@
plateAnalysis(temp).then((res) => { plateAnalysis(temp).then((res) => {
let supplyResult = 0 let supplyResult = 0
try { try {
res.data.pieDetilProductDtoList.forEach(item => { supplyResult += item.supplication }) res.data.pieDetilProductDtoList.forEach(item => {
supplyResult += item.supplication
})
} catch (e) { } catch (e) {
supplyResult = 0 supplyResult = 0
} }
try { try {
res.data.pieDetilProductDtoList.forEach((item) => { res.data.pieDetilProductDtoList.forEach((item) => {
if(supplyResult === 0 && item.supplication === 0) { if (supplyResult === 0 && item.supplication === 0) {
this.supplyRateMap[item.productionPie] = 0 + '%' this.supplyRateMap[item.productionPie] = 0 + '%'
} else { } else {
this.supplyRateMap[item.productionPie] = Number((item.supplication / supplyResult) * 100).toFixed(2) + '%' this.supplyRateMap[item.productionPie] = Number((item.supplication / supplyResult) * 100).toFixed(2) + '%'
...@@ -355,17 +360,17 @@ ...@@ -355,17 +360,17 @@
// 处理 面宽数据 格式: { roomInfo: '南向面宽', '产品1': num, '产品2': num2 } // 处理 面宽数据 格式: { roomInfo: '南向面宽', '产品1': num, '产品2': num2 }
let histomData = [] let histomData = []
let colum = ['roomInfo'] let colum = ['roomInfo']
if(res.data.barDetilDtoList && res.data.barDetilDtoList.length > 0) { if (res.data.barDetilDtoList && res.data.barDetilDtoList.length > 0) {
Object.keys(this.map).forEach(key => { Object.keys(this.map).forEach(key => {
// 单条数据预备对象 // 单条数据预备对象
let singleData = {} let singleData = {}
// 面宽信息 // 面宽信息
res.data.barDetilDtoList.forEach(item => { res.data.barDetilDtoList.forEach(item => {
// 将产品名称加入到 // 将产品名称加入到
if(colum.length - 1 !== res.data.barDetilDtoList.length) { if (colum.length - 1 !== res.data.barDetilDtoList.length) {
colum.push(item.production) colum.push(item.production)
} }
if(!singleData.roomInfo) { if (!singleData.roomInfo) {
singleData.roomInfo = this.map[key] singleData.roomInfo = this.map[key]
} }
singleData[item.production] = item[key] singleData[item.production] = item[key]
...@@ -377,13 +382,13 @@ ...@@ -377,13 +382,13 @@
this.histogramData.rows = histomData this.histogramData.rows = histomData
// 处理多级表头数据 // 处理多级表头数据
let resultArray = [] let resultArray = []
if(res.data.productQueryMap) { if (res.data.productQueryMap) {
Object.keys(res.data.productQueryMap).forEach(item => { Object.keys(res.data.productQueryMap).forEach(item => {
let singleProduct = { let singleProduct = {
productionName: item, productionName: item,
productionProperties: [] productionProperties: []
} }
if(res.data.productQueryMap[item]) { if (res.data.productQueryMap[item]) {
res.data.productQueryMap[item].forEach(propertySinle => { res.data.productQueryMap[item].forEach(propertySinle => {
const singleData = {} const singleData = {}
singleData.projectName = propertySinle.projectName singleData.projectName = propertySinle.projectName
...@@ -397,9 +402,13 @@ ...@@ -397,9 +402,13 @@
singleData.masterRoomWidth = propertySinle.bnsProduct.masterRoomWidth singleData.masterRoomWidth = propertySinle.bnsProduct.masterRoomWidth
singleData.guestRoomWidth = propertySinle.bnsProduct.guestRoomWidth singleData.guestRoomWidth = propertySinle.bnsProduct.guestRoomWidth
try { try {
singleData.fileUrl = propertySinle.productImgList.find(item => { return item.fileOrder === 0 }).fileUrl singleData.fileUrl = propertySinle.productImgList.find(item => {
return item.fileOrder === 0
}).fileUrl
// singleData.fileUrl = '/2020-07-29/project/33d5876350b04258b7c560a413689a47.jpg' // singleData.fileUrl = '/2020-07-29/project/33d5876350b04258b7c560a413689a47.jpg'
singleData.imgUrl = process.env.VUE_APP_OSS_SRC + propertySinle.productImgList.find(item => { return item.fileOrder === 0 }).fileUrl singleData.imgUrl = process.env.VUE_APP_OSS_SRC + propertySinle.productImgList.find(item => {
return item.fileOrder === 0
}).fileUrl
// singleData.imgUrl = process.env.VUE_APP_OSS_SRC + '/2020-07-29/project/33d5876350b04258b7c560a413689a47.jpg' // singleData.imgUrl = process.env.VUE_APP_OSS_SRC + '/2020-07-29/project/33d5876350b04258b7c560a413689a47.jpg'
} catch (e) { } catch (e) {
singleData.fileUrl = '' singleData.fileUrl = ''
...@@ -407,9 +416,9 @@ ...@@ -407,9 +416,9 @@
} }
singleData.imgList = propertySinle.productImgList || [] singleData.imgList = propertySinle.productImgList || []
propertySinle.familyFunc.forEach(item => { propertySinle.familyFunc.forEach(item => {
if(item.list) { if (item.list) {
item.list.forEach(item2 => { item.list.forEach(item2 => {
if(item2.checkboxGroup && item2.checkboxGroup.length > 0) { if (item2.checkboxGroup && item2.checkboxGroup.length > 0) {
const value = item2.checkboxGroup[0] const value = item2.checkboxGroup[0]
singleData[item.parentName + '-' + item2.functionName] = propertyMapFunction[value] singleData[item.parentName + '-' + item2.functionName] = propertyMapFunction[value]
} else { } else {
...@@ -434,18 +443,17 @@ ...@@ -434,18 +443,17 @@
null: '--' null: '--'
} }
let dealArr = JSON.parse(JSON.stringify(resultArray)).map((item => { let dealArr = JSON.parse(JSON.stringify(resultArray)).map((item => {
if(item.productionProperties && item.productionProperties.length > 0) { if (item.productionProperties && item.productionProperties.length > 0) {
item.productionProperties.map(item2 => { item.productionProperties.map(item2 => {
Object.keys(tableDataType).forEach(key => { Object.keys(tableDataType).forEach(key => {
if(tableDataType[key] === 'string') { if (tableDataType[key] === 'string') {
item2[key] = item2[key] ? item2[key] : '--' item2[key] = item2[key] ? item2[key] : '--'
} } else if (tableDataType[key] === 'boolean') {
else if(tableDataType[key] === 'boolean') {
item2[key] = booleanMap[item2[key]] item2[key] = booleanMap[item2[key]]
} else if(tableDataType[key] === 'img') { } else if (tableDataType[key] === 'img') {
item2[key] = item2[key] ? item2[key] : null item2[key] = item2[key] ? item2[key] : null
} }
}) })
}) })
return item return item
} }
...@@ -472,9 +480,9 @@ ...@@ -472,9 +480,9 @@
} catch (e) { } catch (e) {
plateAnalysisQuery = undefined plateAnalysisQuery = undefined
} }
if(plateAnalysisQuery && plateAnalysisQuery.adminRegion && plateAnalysisQuery.regionId) { if (plateAnalysisQuery && plateAnalysisQuery.adminRegion && plateAnalysisQuery.regionId) {
res.data.forEach(item => { res.data.forEach(item => {
if(!this.plateMap[item.adminRegionId]) { if (!this.plateMap[item.adminRegionId]) {
this.plateMap[item.adminRegionId] = item.resultRegionDTOS this.plateMap[item.adminRegionId] = item.resultRegionDTOS
} }
if (item.adminRegionId === plateAnalysisQuery.adminRegion) { if (item.adminRegionId === plateAnalysisQuery.adminRegion) {
...@@ -483,14 +491,14 @@ ...@@ -483,14 +491,14 @@
}) })
this.regionVal = plateAnalysisQuery.adminRegion ? plateAnalysisQuery.adminRegion : '' this.regionVal = plateAnalysisQuery.adminRegion ? plateAnalysisQuery.adminRegion : ''
this.plateVal = plateAnalysisQuery.regionId ? plateAnalysisQuery.regionId : '' this.plateVal = plateAnalysisQuery.regionId ? plateAnalysisQuery.regionId : ''
this.timeVal = plateAnalysisQuery.year ? plateAnalysisQuery.year: new Date().getFullYear() this.timeVal = plateAnalysisQuery.year ? plateAnalysisQuery.year : new Date().getFullYear()
this.areaInterval = plateAnalysisQuery.areaVal ? plateAnalysisQuery.areaVal : '0-70' this.areaInterval = plateAnalysisQuery.areaVal ? plateAnalysisQuery.areaVal : '0-70'
} else { } else {
res.data.forEach(item => { res.data.forEach(item => {
if(!this.plateMap[item.adminRegionId]) { if (!this.plateMap[item.adminRegionId]) {
this.plateMap[item.adminRegionId] = item.resultRegionDTOS this.plateMap[item.adminRegionId] = item.resultRegionDTOS
} }
if(item.resultRegionDTOS && item.resultRegionDTOS.length > 0 && !this.regionVal && !this.plateVal) { if (item.resultRegionDTOS && item.resultRegionDTOS.length > 0 && !this.regionVal && !this.plateVal) {
this.plateOptions = item.resultRegionDTOS this.plateOptions = item.resultRegionDTOS
this.regionVal = item.adminRegionId this.regionVal = item.adminRegionId
this.plateVal = item.resultRegionDTOS[0].regionId this.plateVal = item.resultRegionDTOS[0].regionId
...@@ -507,19 +515,19 @@ ...@@ -507,19 +515,19 @@
// } // }
}) })
} }
if(callback) { if (callback) {
callback() callback()
} }
}) })
}, },
// 获取产品类型下拉框数据 并赋保存的搜索值或者第一个值 // 获取产品类型下拉框数据 并赋保存的搜索值或者第一个值
getProductType (callback) { getProductType(callback) {
queryProductionType('product_Type').then(res => { queryProductionType('product_Type').then(res => {
this.houseTypeOptions = res.data this.houseTypeOptions = res.data
const plateAnalysisQuery = sessionStorage.getItem('plateAnalysisQuery') const plateAnalysisQuery = sessionStorage.getItem('plateAnalysisQuery')
if(plateAnalysisQuery) { if (plateAnalysisQuery) {
const product_type = JSON.parse(plateAnalysisQuery).productType const product_type = JSON.parse(plateAnalysisQuery).productType
if(product_type) { if (product_type) {
this.houseTypeVal = product_type this.houseTypeVal = product_type
} else { } else {
this.houseTypeVal = res.data[0] ? res.data[0].businessId : '' this.houseTypeVal = res.data[0] ? res.data[0].businessId : ''
...@@ -529,21 +537,21 @@ ...@@ -529,21 +537,21 @@
this.houseTypeVal = res.data[0] ? res.data[0].businessId : '' this.houseTypeVal = res.data[0] ? res.data[0].businessId : ''
// this.houseTypeVal = res.data.find(item => { return item.name === '洋房' }).businessId // this.houseTypeVal = res.data.find(item => { return item.name === '洋房' }).businessId
} }
if(callback) { if (callback) {
callback() callback()
} }
}) })
}, },
// 获取户型信息----产品户型图与图片 // 获取户型信息----产品户型图与图片
getPlateProductionIng () { getPlateProductionIng() {
let temp = { let temp = {
adminRegion: this.regionVal, adminRegion: this.regionVal,
regionId: this.plateVal, regionId: this.plateVal,
year: this.timeVal, year: this.timeVal,
productType: this.houseTypeVal, productType: this.houseTypeVal,
unitArea: { unitArea: {
areaMin: this.areaInterval.split('-')[0], areaMin: this.areaInterval.split('-')[0],
areaMax: this.areaInterval.split('-')[1] areaMax: this.areaInterval.split('-')[1]
} }
} }
// 处理后的格式 // 处理后的格式
...@@ -563,19 +571,21 @@ ...@@ -563,19 +571,21 @@
plateAnalysisHouseImg(temp).then(res => { plateAnalysisHouseImg(temp).then(res => {
let productionList = [] let productionList = []
let pageList = [] let pageList = []
if(res.data && res.data.length > 0) { if (res.data && res.data.length > 0) {
res.data.forEach(item => { res.data.forEach(item => {
let single = {} let single = {}
single.productGroupName = item.productGroupName single.productGroupName = item.productGroupName
let children = [] let children = []
if(item.productQueryDtoList) { if (item.productQueryDtoList) {
item.productQueryDtoList.forEach((item2) => { item.productQueryDtoList.forEach((item2) => {
let unit = {} let unit = {}
unit.unitHouse = (item2.bnsProduct.roomNumber || 0) + '-' + (item2.bnsProduct.hallNumber || 0) + '-' + (item2.bnsProduct.toiletNumber || 0) unit.unitHouse = (item2.bnsProduct.roomNumber || 0) + '-' + (item2.bnsProduct.hallNumber || 0) + '-' + (item2.bnsProduct.toiletNumber || 0)
unit.unitName = item2.projectName unit.unitName = item2.projectName
unit.unitArea = item2.bnsProduct.unitArea unit.unitArea = item2.bnsProduct.unitArea
try { try {
unit.imgUrl = item2.productImgList.find(item => { return item.fileOrder === 0 }).fileUrl unit.imgUrl = item2.productImgList.find(item => {
return item.fileOrder === 0
}).fileUrl
} catch (e) { } catch (e) {
unit.imgUrl = '' unit.imgUrl = ''
} }
...@@ -586,8 +596,8 @@ ...@@ -586,8 +596,8 @@
} }
productionList.push(single) productionList.push(single)
pageList.push({ pageList.push({
page: 1, page: 1,
total: item.productQueryDtoList.length total: item.productQueryDtoList.length
}) })
}) })
} }
...@@ -603,44 +613,70 @@ ...@@ -603,44 +613,70 @@
// 注意截取数组不要用splice 要用slice // 注意截取数组不要用splice 要用slice
const productionListCopy = JSON.parse(JSON.stringify(productionList)) const productionListCopy = JSON.parse(JSON.stringify(productionList))
productionListCopy.forEach(item => { productionListCopy.forEach(item => {
if(!this.pageListMap[item.productGroupName]) { if (!this.pageListMap[item.productGroupName]) {
this.pageListMap[item.productGroupName] = {} this.pageListMap[item.productGroupName] = {}
} }
item.children.forEach((item2, index2) => { item.children.forEach((item2, index2) => {
if(index2 % 6 === 0) { if (index2 % 6 === 0) {
this.pageListMap[item.productGroupName][index2/ 6 + 1] = item.children.slice(index2,index2 + 6) this.pageListMap[item.productGroupName][index2 / 6 + 1] = item.children.slice(index2, index2 + 6)
} }
}) })
}) })
console.log(this.pageListMap, 'ssssssssssssssssssssssssss') console.log(this.pageListMap, 'ssssssssssssssssssssssssss')
}) })
} }
}, },
created() { computed: {
window.eventBus.$on('searchParamChange', (searchResult) => { haveAuth() {
this.$router.push({ return (accessName) => {
path: '/regionalPlate', const auth = sessionStorage.getItem('access')
query: searchResult if (auth === 'master') {
return true
}
if (!auth) {
return false
} else {
return auth.split(',').includes(accessName)
}
}
},
created() {
window.eventBus.$on('searchParamChange', (searchResult) => {
this.$router.push({
path: '/regionalPlate',
query: searchResult
})
}) })
}) },
}, beforeMount() {
beforeMount() { for (let i = new Date().getFullYear(); i >= 1980; i--) {
for(let i = new Date().getFullYear(); i>= 1980; i--) { this.timeOptions.push({
this.timeOptions.push({ value: i,
value: i, label: i + '年'
label: i + '年' })
}
this.getRegionAndPlate(() => {
this.getProductType(() => {
this.getPlateAnalysisData()
this.getPlateProductionIng()
})
}) })
} },
this.getRegionAndPlate(() => { mounted() {
this.getProductType(() => { window.addEventListener('beforeunload', () => {
this.getPlateAnalysisData() if (this.regionVal && this.plateVal) {
this.getPlateProductionIng() sessionStorage.setItem('plateAnalysisQuery', JSON.stringify({
adminRegion: this.regionVal,
regionId: this.plateVal,
year: this.timeVal,
productType: this.houseTypeVal,
areaVal: this.areaInterval
}))
}
}) })
}) },
}, beforeDestroy() {
mounted() { if (this.regionVal && this.plateVal) {
window.addEventListener('beforeunload', () => {
if(this.regionVal && this.plateVal) {
sessionStorage.setItem('plateAnalysisQuery', JSON.stringify({ sessionStorage.setItem('plateAnalysisQuery', JSON.stringify({
adminRegion: this.regionVal, adminRegion: this.regionVal,
regionId: this.plateVal, regionId: this.plateVal,
...@@ -649,17 +685,6 @@ ...@@ -649,17 +685,6 @@
areaVal: this.areaInterval areaVal: this.areaInterval
})) }))
} }
})
},
beforeDestroy() {
if(this.regionVal && this.plateVal) {
sessionStorage.setItem('plateAnalysisQuery', JSON.stringify({
adminRegion: this.regionVal,
regionId: this.plateVal,
year: this.timeVal,
productType: this.houseTypeVal,
areaVal: this.areaInterval
}))
} }
} }
} }
......
...@@ -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