|
@@ -47,7 +47,7 @@
|
|
|
</el-popover>
|
|
</el-popover>
|
|
|
<el-button type="primary" icon="el-icon-view" @click="lookFile">查看文件信息</el-button>
|
|
<el-button type="primary" icon="el-icon-view" @click="lookFile">查看文件信息</el-button>
|
|
|
<el-button type="primary" icon="el-icon-s-fold" @click="hideLeft">左侧内容</el-button>
|
|
<el-button type="primary" icon="el-icon-s-fold" @click="hideLeft">左侧内容</el-button>
|
|
|
- <el-button type="primary" icon="el-icon-download" @click="updateFile">下载文件</el-button>
|
|
|
|
|
|
|
+ <el-button v-if="deleteShow" type="primary" icon="el-icon-download" @click="updateFile">下载文件</el-button>
|
|
|
<el-button type="danger" icon="el-icon-close" @click="closeDialog">关闭</el-button>
|
|
<el-button type="danger" icon="el-icon-close" @click="closeDialog">关闭</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
@@ -254,6 +254,7 @@ export default {
|
|
|
document.addEventListener('visibilitychange', this.handlePageChange)
|
|
document.addEventListener('visibilitychange', this.handlePageChange)
|
|
|
this.checkDialogBody()
|
|
this.checkDialogBody()
|
|
|
// task-3972 删除权限仅开放给超级用户和文件管理员
|
|
// task-3972 删除权限仅开放给超级用户和文件管理员
|
|
|
|
|
+ // task-4059 下载、删除权限均只对超级用户和文件管理员开放
|
|
|
const roleList = ['wjgly']
|
|
const roleList = ['wjgly']
|
|
|
const isPower = this.role.some(item => roleList.includes(item.alias))
|
|
const isPower = this.role.some(item => roleList.includes(item.alias))
|
|
|
this.deleteShow = this.isSuper || isPower
|
|
this.deleteShow = this.isSuper || isPower
|
|
@@ -403,49 +404,28 @@ export default {
|
|
|
},
|
|
},
|
|
|
deleteFile () {
|
|
deleteFile () {
|
|
|
this.deleteVisible = false
|
|
this.deleteVisible = false
|
|
|
- // const roleKey = ['xtgljs', 'syszr', 'wjgly', 'wjglzzc']
|
|
|
|
|
- const roleKey = ['xtgljs']
|
|
|
|
|
- const curRole = this.role.map(i => i.alias)
|
|
|
|
|
- const isPower = curRole.some(item => roleKey.includes(item))
|
|
|
|
|
- if (this.isSuper || isPower) {
|
|
|
|
|
- const deleteParams = {
|
|
|
|
|
- tableName: 't_wjxxb',
|
|
|
|
|
- paramWhere: { id_: this.leftData[0].zId }
|
|
|
|
|
- }
|
|
|
|
|
- curdPost('delete', deleteParams).then(() => {
|
|
|
|
|
- this.$message({
|
|
|
|
|
- message: '删除成功!',
|
|
|
|
|
- type: 'warning'
|
|
|
|
|
- })
|
|
|
|
|
- this.dialogVisible = false
|
|
|
|
|
- })
|
|
|
|
|
- return
|
|
|
|
|
|
|
+ const deleteParams = {
|
|
|
|
|
+ tableName: 't_wjxxb',
|
|
|
|
|
+ paramWhere: { id_: this.leftData[0].zId }
|
|
|
}
|
|
}
|
|
|
- this.$message({
|
|
|
|
|
- message: '您还没有权限,请联系管理员',
|
|
|
|
|
- type: 'warning'
|
|
|
|
|
|
|
+ curdPost('delete', deleteParams).then(() => {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: '删除成功!',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ })
|
|
|
|
|
+ this.dialogVisible = false
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
// closeDialog1 (val) {
|
|
// closeDialog1 (val) {
|
|
|
// this.innerVisible = val
|
|
// this.innerVisible = val
|
|
|
// },
|
|
// },
|
|
|
updateFile () {
|
|
updateFile () {
|
|
|
- const roleKey = ['xtgljs', 'wjglzzc', 'wjgly']
|
|
|
|
|
- const curRole = this.role.map(i => i.alias)
|
|
|
|
|
- const isPower = curRole.some(i => roleKey.includes(i))
|
|
|
|
|
- if (this.isSuper || isPower) {
|
|
|
|
|
- const a = document.createElement('a')
|
|
|
|
|
- a.href = this.optionFile.url
|
|
|
|
|
- a.download = this.optionFile.data.fileName
|
|
|
|
|
- document.body.appendChild(a)
|
|
|
|
|
- a.click()
|
|
|
|
|
- a.remove()
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- this.$message({
|
|
|
|
|
- message: '您还没有权限,请联系管理员',
|
|
|
|
|
- type: 'warning'
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ const a = document.createElement('a')
|
|
|
|
|
+ a.href = this.optionFile.url
|
|
|
|
|
+ a.download = this.optionFile.data.fileName
|
|
|
|
|
+ document.body.appendChild(a)
|
|
|
|
|
+ a.click()
|
|
|
|
|
+ a.remove()
|
|
|
},
|
|
},
|
|
|
fileShow (val) {
|
|
fileShow (val) {
|
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|