Commit a934ce74 authored by wangjiankun's avatar wangjiankun

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

fix:
parent 5ceb86ef
<template>
<div id="app">
<transition name="page">
<router-view />
<keep-alive>
<router-view />
</keep-alive>
</transition>
</div>
</template>
......
......@@ -16,7 +16,7 @@
<el-col :span="20">
<el-row v-for="(item3,index3) in item2.children" :key="index3"
: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}}
</el-row>
</el-col>
......@@ -27,25 +27,29 @@
</el-row>
</div>
<div class="table_body" v-if="tableData instanceof Array" :style="{ width: bodyWidth + '%'}">
<div class="productionName" v-if="tableData.length > 0">
<el-col :span="24 / tableData.length" v-for="(item,index) in tableData" :key="index" style="min-width: 200px">
<el-row :class="{'dataCell':true, 'prodName': index < 2}">{{item.productionName}}</el-row>
<el-col class="productionDetail" :span="24 / item.productionProperties.length" 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'}">
<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'">
<img v-for="(src,srcIndex) in item2.imgList"
:key="srcIndex"
:src="getImageUrl(src.fileUrl)"
alt="失效链接"
:style="{ 'cursor': 'pointer', height: src.fileOrder === 0 ? '80px' : '0'}">
</viewer>
<div v-else-if="value === 'boolean' && item2[key] === 1" class="circle block"></div>
<div v-else-if="value === 'boolean' && item2[key] === 0" class="circle hollow"></div>
<div v-else-if="value === 'boolean' && !item2[key]" >--</div>
</el-row>
</el-col>
</el-col>
<div class="productionName" v-if="tableData.length > 0" style="display: flex;flex-direction: row;width: 100%">
<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">
<div style="width: auto">
<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'}">
<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'">
<img v-for="(src,srcIndex) in item2.imgList"
:key="srcIndex"
:src="getImageUrl(src.fileUrl)"
alt="失效链接"
:style="{ 'cursor': 'pointer', height: src.fileOrder === 0 ? '80px' : '0'}">
</viewer>
<div v-else-if="value === 'boolean' && item2[key] === 1" class="circle block"></div>
<div v-else-if="value === 'boolean' && item2[key] === 0" class="circle hollow"></div>
<div v-else-if="value === 'boolean' && !item2[key]" >--</div>
</el-row>
</div>
</div>
</div>
</div>
</div>
<div v-else style="height: 100%;display: flex;align-items: center;">
<div style="width: 100%;text-align: center;margin: auto">
......@@ -54,15 +58,12 @@
</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-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>
<viewer :images="[]" v-else-if="value === 'img'">
<img :src="getImageUrl(tableData[key])" alt="" height="80" style="cursor:pointer;">
</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] === 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>
</el-row>
</el-col>
......@@ -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 () {
return {
dataMap :{
'unitArea': 'string',
'projectName': 'string',
'fileUrl': 'img',
'bayNumber': 'string',
'roomNumber': 'string',
......@@ -162,6 +176,7 @@
display flex
flex-direction row
.table_header {
border-right 2px solid #ffffff
min-width 420px
.rowStyle{
width 100%
......@@ -195,7 +210,6 @@
line-height 32px
border-bottom 2px solid #ffffff
border-left 2px solid #ffffff
border-right 1px solid #ffffff
}
.el-col-4 {
height 100%
......@@ -228,7 +242,6 @@
position relative
}
.prodName {
border-right 2px solid #ffffff
}
.prodName:nth-child(3) {
border-right none
......@@ -239,7 +252,6 @@
}
.productionDetail{
.el-row {
border-right 2px solid #ffffff
}
.el-row:last-child {
border-bottom none
......
......@@ -9,7 +9,7 @@ import { getToken } from '@assets/js/auth'
// 创建axios实例
const xhr = axios.create({
baseURL: process.env.VUE_APP_API, // api 的 base_url
timeout: 30000, // 请求超时时间
timeout: 0, // 请求超时时间
withCredentials: true,
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
transformRequest: [(data) => {
......
......@@ -27,10 +27,11 @@ const user = {
if(authorities) {
authorities = authorities.split(",")
state.authorities = authorities
} else {
state.authorities = []
}
}
},
actions: {
// 登录
Login({ commit }, userInfo) {
......@@ -41,6 +42,8 @@ const user = {
setToken(data.Authentication)
commit('SET_TOKEN', data.Authentication)
commit('SET_AUTH', data.authorities)
sessionStorage.setItem('auth', data.authorities.split(','))
sessionStorage.setItem('userName', username)
resolve()
}).catch(error => {
reject(error)
......@@ -86,6 +89,8 @@ const user = {
return new Promise(resolve => {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
sessionStorage.removeItem('auth')
sessionStorage.removeItem('userName')
removeToken()
resolve()
})
......
......@@ -381,6 +381,7 @@
if(res.data.productQueryMap[item]) {
res.data.productQueryMap[item].forEach(propertySinle => {
const singleData = {}
singleData.projectName = propertySinle.projectName
singleData.unitArea = propertySinle.bnsProduct.unitArea
singleData.bayNumber = propertySinle.bnsProduct.bayNumber
singleData.roomNumber = propertySinle.bnsProduct.roomNumber
......@@ -420,6 +421,13 @@
})
}
this.productionProjectData = resultArray
const booleanMap = {
0: '否',
1: '是',
'': '--',
undefined: '--',
null: '--'
}
let dealArr = JSON.parse(JSON.stringify(resultArray)).map((item => {
if(item.productionProperties && item.productionProperties.length > 0) {
item.productionProperties.map(item2 => {
......@@ -428,7 +436,7 @@
item2[key] = item2[key] ? item2[key] : '--'
}
else if(tableDataType[key] === 'boolean') {
item2[key] = item2[key] ? (item2[key] == 1 ? '是' : '否') : '--'
item2[key] = booleanMap[item2[key]]
} else if(tableDataType[key] === 'img') {
item2[key] = item2[key] ? item2[key] : null
}
......@@ -437,6 +445,7 @@
return item
}
}))
console.log(dealArr)
this.unitDetailJsonExport = JSON.stringify(dealArr)
})
exportExcelJson(temp).then(res => {
......
export default [
{ trName: '产品组' },
{ trName: '楼盘名称' },
{ trName: '户型面积' },
{ trName: '户型图', cellHeight: 85 },
{
......
......@@ -123,7 +123,7 @@
{{item.title + item.defaultSetting}}
</div>
<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] || '--'}}
</div>
</el-col>
......
......@@ -11,6 +11,7 @@
</div>
<div class="bannerOptions">
<el-button type="danger"
v-if="haveAuth"
:title="propertyData.fileList.length === 0 ? '未查询到技术资料' : ''"
:disabled="propertyData.fileList.length === 0" @click="downloadDataFlag = true" >下载技术资料</el-button>
<el-radio-group v-model="bannerType" @change="scorllTop">
......@@ -665,6 +666,7 @@
})
}
})
console.log(singleData, 'adadadada')
propertyProjectInfoArr.push(singleData)
})
this.propertyData.propertyBanner.hxBanner = propertyProjectInfoArr
......@@ -838,12 +840,24 @@
}
},
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 () {
return columData
},
multiHeader () {
const table = JSON.parse(JSON.stringify(tableHeader))
table.splice(0,1)
table.splice(0,2)
table.splice(1,1)
return table
}
......@@ -855,6 +869,7 @@
this.queryPropertyProductionAnalysis()
},
mounted(){
console.log(this.$store, 'asdasdasdasd')
let scorll = document.getElementById('htmlMain')
if(scorll) {
const header = document.getElementById('propertyDetailHeader')
......
......@@ -13,7 +13,8 @@ export const propertyMapFunction = {
suit3: '三件套',
suit4: '四件套',
other: '其他',
null: ''
null: '',
undefined: ''
}
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