|
@@ -10,34 +10,36 @@
|
|
|
@blur='getList(true)'
|
|
|
clearable
|
|
|
prefix-icon='el-icon-search'
|
|
|
- v-model='keyword'
|
|
|
+ v-model='keywords'
|
|
|
style='width:220px;margin-left:12px'
|
|
|
></el-input>
|
|
|
</div>
|
|
|
<el-table :data='tableData' style='width: 100%' :border='true'>
|
|
|
<el-table-column type='index' label='序号' width='60' :index='indexMethod'></el-table-column>
|
|
|
- <el-table-column prop='lb' label='楼层' width='100' show-overflow-tooltip resizable>
|
|
|
+ <el-table-column prop='lb' label='楼层' width='110' show-overflow-tooltip resizable>
|
|
|
<template slot-scope='{row}'>{{row.floor || '--'}}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop='lb' label='文件目录' width='300' show-overflow-tooltip resizable>
|
|
|
- <template slot-scope='{row}'>{{row.fileDir || '--'}}</template>
|
|
|
+ <el-table-column prop='lb' label='文件目录' width='400' show-overflow-tooltip resizable>
|
|
|
+ <template slot-scope='{row}'>{{row.fullPath || '--'}}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop='sl' label='文件名' show-overflow-tooltip resizable>
|
|
|
- <template slot-scope='{row}'>{{row.fileName || '--'}}</template>
|
|
|
+ <el-table-column prop='sl' label='文件名' width='250' show-overflow-tooltip resizable>
|
|
|
+ <template slot-scope='{row}'>{{row.pathName || '--'}}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop='assetnum' label='文件类型' width='100' show-overflow-tooltip resizable>
|
|
|
<template slot-scope='{row}'>{{row.fileType || '--'}}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop='assetnum' label='上传文件名'>
|
|
|
- <template slot-scope='{row}'>{{row.uploadFileName || '--'}}</template>
|
|
|
+ <template slot-scope='{row}'>{{row.fileName || '--'}}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label='操作' width='170'>
|
|
|
<template slot-scope='{row}'>
|
|
|
- <el-button type='text' size='mini' @click='handlePreview(row)'>
|
|
|
+ <!-- 无fileId,设置禁用 -->
|
|
|
+ <el-button type='text' size='mini' :disabled='!Boolean(row.fileId)' @click='handlePreview(row.fileId)'>
|
|
|
<!-- <i class='el-icon-download'></i> -->
|
|
|
预览
|
|
|
</el-button>
|
|
|
- <el-button type='text' size='mini' @click='handleDown(row)'>
|
|
|
+ <!-- 无fileUrl,设置禁用 -->
|
|
|
+ <el-button type='text' size='mini' :disabled='!Boolean(row.fileUrl)' @click='handleDown(row.fileUrl)'>
|
|
|
<!-- <i class='el-icon-download'></i> -->
|
|
|
下载{{row.fileSize? `(${row.fileSize})` :''}}
|
|
|
</el-button>
|
|
@@ -59,7 +61,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { queryEquipmentList } from '@/api/equipmentList.js'
|
|
|
+import { queryPicList } from '@/api/equipmentList.js'
|
|
|
import { mapGetters } from 'vuex'
|
|
|
import { random } from 'lodash'
|
|
|
export default {
|
|
@@ -70,15 +72,31 @@ export default {
|
|
|
total: 0,
|
|
|
page: 1,
|
|
|
size: 11,
|
|
|
- keyword: '',
|
|
|
+ keywords: '',
|
|
|
floor: 'all',
|
|
|
fileType: '',
|
|
|
files: [],
|
|
|
}
|
|
|
},
|
|
|
- props: ['major'],
|
|
|
+ props: ['smsxt'],
|
|
|
computed: {
|
|
|
- ...mapGetters(['floorSelect']),
|
|
|
+ // floorSelect2 id: e.gname, name: e.code,使用的gname
|
|
|
+ ...mapGetters(['plazaId', 'floorSelect2']),
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ // 楼层筛选下拉菜单
|
|
|
+ this.floorData = [{ id: 'all', name: '全部' }, ...this.floorSelect2]
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ // 根据分辨率更改size值
|
|
|
+ this.handleResize()
|
|
|
+ // 查询列表
|
|
|
+ this.getList()
|
|
|
+ // 监听resize事件
|
|
|
+ window.addEventListener('resize', this.handleResize)
|
|
|
+ this.$once('hook:beforeDestroy', () => {
|
|
|
+ window.removeEventListener('resize', this.handleResize)
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
//序号的方法
|
|
@@ -97,73 +115,53 @@ export default {
|
|
|
* @param { Boolean } initPage 是否重置页码, true是 false 否
|
|
|
* 更改楼层,搜索文件名时,重置页码
|
|
|
*/
|
|
|
- getList(initPage) {
|
|
|
+ async getList(initPage) {
|
|
|
// 重置页码
|
|
|
if (initPage) {
|
|
|
this.total = 0
|
|
|
this.page = 1
|
|
|
}
|
|
|
- let postParams = {}
|
|
|
- const { page, size, keyword, floor } = this
|
|
|
- let data = {
|
|
|
+ const { plazaId, page, size, keywords, floor } = this
|
|
|
+ // 专业,按照配置文件中的对应关系进行转换
|
|
|
+ const Spes = __systemConf.conf.smsxt_szhyj[this.smsxt]
|
|
|
+ let getParams = {
|
|
|
page,
|
|
|
size,
|
|
|
+ ProjectId: '(YSY)CZWDGC', // plazaId,
|
|
|
+ Spes,
|
|
|
}
|
|
|
- console.log(data)
|
|
|
- // 楼层不为全部时,上送楼层字段
|
|
|
- if (floor !== 'all') {
|
|
|
- postParams.floor = floor
|
|
|
+ // 楼层为全部时,上送完整楼层列表字段
|
|
|
+ if (floor === 'all') {
|
|
|
+ let floorArr = [],
|
|
|
+ floorStr = ''
|
|
|
+ this.floorSelect2.map((item) => floorArr.push(item.id))
|
|
|
+ floorStr = floorArr.join(',')
|
|
|
+ getParams.Floors = floorStr
|
|
|
+ } else {
|
|
|
+ getParams.Floors = floor
|
|
|
}
|
|
|
// 搜索文件名/上传文件名
|
|
|
- if (keyword) {
|
|
|
- data.keyword = `${keyword}:fileName,uploadFileName;`
|
|
|
+ if (keywords) {
|
|
|
+ getParams.keywords = keywords
|
|
|
}
|
|
|
- /**
|
|
|
- * 模拟数据
|
|
|
- */
|
|
|
- let mockData = [
|
|
|
- {
|
|
|
- floor: 'F1',
|
|
|
- fileDir: '03-MEP机电/02-EL电气',
|
|
|
- fileId: '123',
|
|
|
- fileName: 'F01层结构',
|
|
|
- fileType: 'pdf',
|
|
|
- fileSize: '99.2M',
|
|
|
- uploadFileName: '万达广场 地库电梯井施工图.dwg',
|
|
|
- fireUrl: 'xxxxx',
|
|
|
- },
|
|
|
- {
|
|
|
- floor: 'B2',
|
|
|
- fileDir: 'dist/test2',
|
|
|
- fileId: '123',
|
|
|
- fileName: '文件2',
|
|
|
- fileType: 'cad',
|
|
|
- fileSize: '1.3M',
|
|
|
- uploadFileName: '上传文件2',
|
|
|
- fireUrl: 'xxxxx',
|
|
|
- },
|
|
|
- ]
|
|
|
- initPage && (this.total = random(15, 90))
|
|
|
- let max = this.size - 2
|
|
|
- if (this.page === Math.ceil(this.total / this.size)) {
|
|
|
- max = (this.total % this.size) - 2
|
|
|
- }
|
|
|
- for (let index = 0; index < max; index++) {
|
|
|
- mockData.push({})
|
|
|
- }
|
|
|
- this.tableData = mockData
|
|
|
+ let res = await queryPicList({ getParams })
|
|
|
+ console.log('===========')
|
|
|
+ console.log(res)
|
|
|
+ console.log('===========')
|
|
|
+ this.tableData = res?.data || []
|
|
|
+ this.total = res?.count || 0
|
|
|
},
|
|
|
/**
|
|
|
* 预览
|
|
|
*/
|
|
|
- handlePreview(row) {
|
|
|
- window.open('http://szhyj.wanda.cn/dwg/index.html?fileId=123456')
|
|
|
+ handlePreview(fileId) {
|
|
|
+ window.open(`http://szhyj.wanda.cn/dwg/index.html?fileId=${fileId}`)
|
|
|
},
|
|
|
/**
|
|
|
* 下载
|
|
|
*/
|
|
|
- handleDown(row) {
|
|
|
- window.open('http://mapapp.wanda.cn/editor/fmap/1000772_54/1000772_54.fmap')
|
|
|
+ handleDown(fileUrl) {
|
|
|
+ window.open(fileUrl)
|
|
|
},
|
|
|
/**
|
|
|
* 页面窗口变化,更新 size值
|
|
@@ -180,21 +178,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
- created() {
|
|
|
- // 楼层筛选下拉菜单
|
|
|
- this.floorData = [{ id: 'all', name: '全部' }, ...this.floorSelect]
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- // 根据分辨率更改size值
|
|
|
- this.handleResize()
|
|
|
- // 查询列表
|
|
|
- this.getList()
|
|
|
- // 监听resize事件
|
|
|
- window.addEventListener('resize', this.handleResize)
|
|
|
- this.$once('hook:beforeDestroy', () => {
|
|
|
- window.removeEventListener('resize', this.handleResize)
|
|
|
- })
|
|
|
- },
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|