Commit a934ce74 authored by wangjiankun's avatar wangjiankun

feat: 判断是否有下载技术资料权限

fix:
parent 5ceb86ef
<template> <template>
<div id="app"> <div id="app">
<transition name="page"> <transition name="page">
<keep-alive>
<router-view /> <router-view />
</keep-alive>
</transition> </transition>
</div> </div>
</template> </template>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<el-col :span="20"> <el-col :span="20">
<el-row v-for="(item3,index3) in item2.children" :key="index3" <el-row v-for="(item3,index3) in item2.children" :key="index3"
:class="{'table_header__cell': true, :class="{'table_header__cell': true,
'table_header_cell-34': index3 !== item2.children.length - 1}"> 'table_header_cell-34': index3 !== item2.children.length - 1 || item3.trName === '是否设厨房动线'}">
{{item3.trName}} {{item3.trName}}
</el-row> </el-row>
</el-col> </el-col>
...@@ -27,10 +27,12 @@ ...@@ -27,10 +27,12 @@
</el-row> </el-row>
</div> </div>
<div class="table_body" v-if="tableData instanceof Array" :style="{ width: bodyWidth + '%'}"> <div class="table_body" v-if="tableData instanceof Array" :style="{ width: bodyWidth + '%'}">
<div class="productionName" v-if="tableData.length > 0"> <div class="productionName" v-if="tableData.length > 0" style="display: flex;flex-direction: row;width: 100%">
<el-col :span="24 / tableData.length" v-for="(item,index) in tableData" :key="index" style="min-width: 200px"> <div v-for="(item,index) in tableData" :key="index" style="flex:1;min-width: 160px;max-width: 320px;overflow-x: auto;border-right: 2px solid #ffffff">
<el-row :class="{'dataCell':true, 'prodName': index < 2}">{{item.productionName}}</el-row> <div style="width: auto">
<el-col class="productionDetail" :span="24 / item.productionProperties.length" v-for="(item2,index) in item.productionProperties" :key="index"> <el-row :class="{'dataCell':true}">{{item.productionName}}</el-row>
<div style="display: flex;flex-direction: row">
<div class="productionDetail" style="min-width: 160px;width: 100%;border-right: 1px solid #ffffff;" v-for="(item2,index) in item.productionProperties" :key="index">
<el-row v-for="(value, key) in dataMap" :key="key" :class="{ 'dataCell': true, 'imgHeigth': value === 'img'}"> <el-row v-for="(value, key) in dataMap" :key="key" :class="{ 'dataCell': true, 'imgHeigth': value === 'img'}">
<div v-if="value === 'string'">{{item2[key] || '--'}} <span v-if="key === 'area'">m<sup>2</sup></span> </div> <div v-if="value === 'string'">{{item2[key] || '--'}} <span v-if="key === 'area'">m<sup>2</sup></span> </div>
<viewer :images="getImgUrlList(item2.imgList)" v-else-if="value === 'img'"> <viewer :images="getImgUrlList(item2.imgList)" v-else-if="value === 'img'">
...@@ -44,8 +46,10 @@ ...@@ -44,8 +46,10 @@
<div v-else-if="value === 'boolean' && item2[key] === 0" class="circle hollow"></div> <div v-else-if="value === 'boolean' && item2[key] === 0" class="circle hollow"></div>
<div v-else-if="value === 'boolean' && !item2[key]" >--</div> <div v-else-if="value === 'boolean' && !item2[key]" >--</div>
</el-row> </el-row>
</el-col> </div>
</el-col> </div>
</div>
</div>
</div> </div>
<div v-else style="height: 100%;display: flex;align-items: center;"> <div v-else style="height: 100%;display: flex;align-items: center;">
<div style="width: 100%;text-align: center;margin: auto"> <div style="width: 100%;text-align: center;margin: auto">
...@@ -54,15 +58,12 @@ ...@@ -54,15 +58,12 @@
</div> </div>
</div> </div>
</div> </div>
<div class="table_body" v-else :style="{ width: bodyWidth + '%'}"> <div class="table_body tableObject" v-else :style="{ width: bodyWidth + '%'}">
<el-col :span="24" style="min-width: 120px"> <el-col :span="24" style="min-width: 120px">
<el-row v-for="(value, key) in dataMap" v-if="key !== 'fileUrl'" :key="key" :class="{ 'dataCell': true, 'imgHeigth': value === 'img' }"> <el-row v-for="(value, key) in dataMap" v-if="key !== 'fileUrl' && key !== 'projectName'" :key="key" :class="{ 'dataCell': true, 'imgHeigth': value === 'img' }">
<div v-if="value === 'string'">{{tableData[key] || '--'}}</div> <div v-if="value === 'string'">{{tableData[key] || '--'}}</div>
<viewer :images="[]" v-else-if="value === 'img'"> <div v-else-if="value === 'boolean' && tableData[key] === 1" class="circle block"></div>
<img :src="getImageUrl(tableData[key])" alt="" height="80" style="cursor:pointer;"> <div v-else-if="value === 'boolean' && tableData[key] === 0" class="circle hollow"></div>
</viewer>
<div v-else-if="value === 'boolean' && tableData[key] == 1" class="circle block"></div>
<div v-else-if="value === 'boolean' && tableData[key] == 0" class="circle hollow"></div>
<div v-else-if="value === 'boolean' && !tableData[key]" >--</div> <div v-else-if="value === 'boolean' && !tableData[key]" >--</div>
</el-row> </el-row>
</el-col> </el-col>
...@@ -97,10 +98,23 @@ ...@@ -97,10 +98,23 @@
} }
} }
}, },
mounted() {
console.log(this.headerData)
},
watch: {
tableData: {
deep: true,
handler(val) {
console.log(val, '多级表头的值发生改变!')
console.log(val['kitchen-LDK'] == 0)
}
}
},
data () { data () {
return { return {
dataMap :{ dataMap :{
'unitArea': 'string', 'unitArea': 'string',
'projectName': 'string',
'fileUrl': 'img', 'fileUrl': 'img',
'bayNumber': 'string', 'bayNumber': 'string',
'roomNumber': 'string', 'roomNumber': 'string',
...@@ -162,6 +176,7 @@ ...@@ -162,6 +176,7 @@
display flex display flex
flex-direction row flex-direction row
.table_header { .table_header {
border-right 2px solid #ffffff
min-width 420px min-width 420px
.rowStyle{ .rowStyle{
width 100% width 100%
...@@ -195,7 +210,6 @@ ...@@ -195,7 +210,6 @@
line-height 32px line-height 32px
border-bottom 2px solid #ffffff border-bottom 2px solid #ffffff
border-left 2px solid #ffffff border-left 2px solid #ffffff
border-right 1px solid #ffffff
} }
.el-col-4 { .el-col-4 {
height 100% height 100%
...@@ -228,7 +242,6 @@ ...@@ -228,7 +242,6 @@
position relative position relative
} }
.prodName { .prodName {
border-right 2px solid #ffffff
} }
.prodName:nth-child(3) { .prodName:nth-child(3) {
border-right none border-right none
...@@ -239,7 +252,6 @@ ...@@ -239,7 +252,6 @@
} }
.productionDetail{ .productionDetail{
.el-row { .el-row {
border-right 2px solid #ffffff
} }
.el-row:last-child { .el-row:last-child {
border-bottom none border-bottom none
......
...@@ -9,7 +9,7 @@ import { getToken } from '@assets/js/auth' ...@@ -9,7 +9,7 @@ import { getToken } from '@assets/js/auth'
// 创建axios实例 // 创建axios实例
const xhr = axios.create({ const xhr = axios.create({
baseURL: process.env.VUE_APP_API, // api 的 base_url baseURL: process.env.VUE_APP_API, // api 的 base_url
timeout: 30000, // 请求超时时间 timeout: 0, // 请求超时时间
withCredentials: true, withCredentials: true,
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' }, headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
transformRequest: [(data) => { transformRequest: [(data) => {
......
...@@ -27,10 +27,11 @@ const user = { ...@@ -27,10 +27,11 @@ const user = {
if(authorities) { if(authorities) {
authorities = authorities.split(",") authorities = authorities.split(",")
state.authorities = authorities state.authorities = authorities
} else {
state.authorities = []
} }
} }
}, },
actions: { actions: {
// 登录 // 登录
Login({ commit }, userInfo) { Login({ commit }, userInfo) {
...@@ -41,6 +42,8 @@ const user = { ...@@ -41,6 +42,8 @@ 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(','))
sessionStorage.setItem('userName', username)
resolve() resolve()
}).catch(error => { }).catch(error => {
reject(error) reject(error)
...@@ -86,6 +89,8 @@ const user = { ...@@ -86,6 +89,8 @@ const user = {
return new Promise(resolve => { return new Promise(resolve => {
commit('SET_TOKEN', '') commit('SET_TOKEN', '')
commit('SET_ROLES', []) commit('SET_ROLES', [])
sessionStorage.removeItem('auth')
sessionStorage.removeItem('userName')
removeToken() removeToken()
resolve() resolve()
}) })
......
...@@ -381,6 +381,7 @@ ...@@ -381,6 +381,7 @@
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.unitArea = propertySinle.bnsProduct.unitArea singleData.unitArea = propertySinle.bnsProduct.unitArea
singleData.bayNumber = propertySinle.bnsProduct.bayNumber singleData.bayNumber = propertySinle.bnsProduct.bayNumber
singleData.roomNumber = propertySinle.bnsProduct.roomNumber singleData.roomNumber = propertySinle.bnsProduct.roomNumber
...@@ -420,6 +421,13 @@ ...@@ -420,6 +421,13 @@
}) })
} }
this.productionProjectData = resultArray this.productionProjectData = resultArray
const booleanMap = {
0: '否',
1: '是',
'': '--',
undefined: '--',
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 => {
...@@ -428,7 +436,7 @@ ...@@ -428,7 +436,7 @@
item2[key] = item2[key] ? item2[key] : '--' item2[key] = item2[key] ? item2[key] : '--'
} }
else if(tableDataType[key] === 'boolean') { else if(tableDataType[key] === 'boolean') {
item2[key] = item2[key] ? (item2[key] == 1 ? '是' : '否') : '--' 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
} }
...@@ -437,6 +445,7 @@ ...@@ -437,6 +445,7 @@
return item return item
} }
})) }))
console.log(dealArr)
this.unitDetailJsonExport = JSON.stringify(dealArr) this.unitDetailJsonExport = JSON.stringify(dealArr)
}) })
exportExcelJson(temp).then(res => { exportExcelJson(temp).then(res => {
......
export default [ export default [
{ trName: '产品组' }, { trName: '产品组' },
{ trName: '楼盘名称' },
{ trName: '户型面积' }, { trName: '户型面积' },
{ trName: '户型图', cellHeight: 85 }, { trName: '户型图', cellHeight: 85 },
{ {
......
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
{{item.title + item.defaultSetting}} {{item.title + item.defaultSetting}}
</div> </div>
<div class="plateRegionDetailShowContainer" <div class="plateRegionDetailShowContainer"
:style="{ color: item.color || '#000000', fontWeight: item.color ? '600' : 'normal' }"> :style="{ color: item.color || '#000000', fontWeight: item.color ? '600' : 'normal', whiteSpace: 'pre-line' }">
{{ dataType.plateRegion.plateInfo[item.prop] || '--'}} {{ dataType.plateRegion.plateInfo[item.prop] || '--'}}
</div> </div>
</el-col> </el-col>
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
</div> </div>
<div class="bannerOptions"> <div class="bannerOptions">
<el-button type="danger" <el-button type="danger"
v-if="haveAuth"
:title="propertyData.fileList.length === 0 ? '未查询到技术资料' : ''" :title="propertyData.fileList.length === 0 ? '未查询到技术资料' : ''"
:disabled="propertyData.fileList.length === 0" @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">
...@@ -665,6 +666,7 @@ ...@@ -665,6 +666,7 @@
}) })
} }
}) })
console.log(singleData, 'adadadada')
propertyProjectInfoArr.push(singleData) propertyProjectInfoArr.push(singleData)
}) })
this.propertyData.propertyBanner.hxBanner = propertyProjectInfoArr this.propertyData.propertyBanner.hxBanner = propertyProjectInfoArr
...@@ -838,12 +840,24 @@ ...@@ -838,12 +840,24 @@
} }
}, },
computed: { computed: {
haveAuth() {
const userName = sessionStorage.getItem('userName')
if(userName === 'admin') {
return true
}
const auth = sessionStorage.getItem('auth')
if(!auth) {
return false
} else {
return auth.split(',').includes('downloadFile')
}
},
colum () { colum () {
return columData return columData
}, },
multiHeader () { multiHeader () {
const table = JSON.parse(JSON.stringify(tableHeader)) const table = JSON.parse(JSON.stringify(tableHeader))
table.splice(0,1) table.splice(0,2)
table.splice(1,1) table.splice(1,1)
return table return table
} }
...@@ -855,6 +869,7 @@ ...@@ -855,6 +869,7 @@
this.queryPropertyProductionAnalysis() this.queryPropertyProductionAnalysis()
}, },
mounted(){ mounted(){
console.log(this.$store, 'asdasdasdasd')
let scorll = document.getElementById('htmlMain') let scorll = document.getElementById('htmlMain')
if(scorll) { if(scorll) {
const header = document.getElementById('propertyDetailHeader') const header = document.getElementById('propertyDetailHeader')
......
...@@ -13,7 +13,8 @@ export const propertyMapFunction = { ...@@ -13,7 +13,8 @@ export const propertyMapFunction = {
suit3: '三件套', suit3: '三件套',
suit4: '四件套', suit4: '四件套',
other: '其他', other: '其他',
null: '' null: '',
undefined: ''
} }
export const tableDataType = { export const tableDataType = {
......
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