首页预览

dev_2022-04-07
yujialong 3 years ago
parent 57535214c7
commit 6065ddfb59
  1. 2
      src/pages/data/list/index.vue
  2. 52
      src/pages/index/list/index.vue
  3. 1
      src/pages/role/list/index.vue

@ -240,6 +240,7 @@ export default {
this.$post(`${this.api.getIdQueryTable}?categoryId=${this.defaultType}&showName=${this.keyword}&pageNum=${this.page}&pageSize=${this.pageSize}&updateTime=`).then(res => {
const list = res.pageList.records
list.map(e => {
//
const startTime = e.startTime ? e.startTime.slice(0, 10) : ''
const endTime = e.endTime ? e.endTime.slice(0, 10) : ''
if (startTime && endTime) {
@ -252,6 +253,7 @@ export default {
})
this.listData = list
this.total = res.pageList.total
//
if (this.$route.query.preview) {
this.preview({
id: this.$route.query.id,

@ -256,31 +256,39 @@ export default {
this.getData()
},
preview(row) {
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => {
// +1
this.$post(this.api.saveRecord, {
tableId: row.id,
type: 2,
}).then(res => { }).catch(res => { })
//
if(this.token){
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => {
// +1
this.$post(this.api.saveRecord, {
tableId: row.id,
type: 2,
}).then(res => { }).catch(res => { })
let comment = res.comment
let previewHead = []
comment.map(n => {
// id
n.field != 'id' && n.field != 'operation_time' && previewHead.push(n)
})
this.previewHead = previewHead
let comment = res.comment
let previewHead = []
comment.map(n => {
// id
n.field != 'id' && n.field != 'operation_time' && previewHead.push(n)
})
this.previewHead = previewHead
let data = res.data
data.map(n => {
for (let i in n) {
// +0000,,
if (typeof n[i] == 'string' && n[i].endsWith('+0000')) n[i] = util.formatDate('yyyy-MM-dd hh:mm:ss', new Date(n[i]))
}
let data = res.data
data.map(n => {
for (let i in n) {
// +0000,,
if (typeof n[i] == 'string' && n[i].endsWith('+0000')) n[i] = util.formatDate('yyyy-MM-dd hh:mm:ss', new Date(n[i]))
}
})
this.previewData = data
this.previewVisible = true
}).catch(res => { })
}else{
let route = this.$router.resolve({
path: '/login'
})
this.previewData = data
this.previewVisible = true
}).catch(res => { })
window.open(route.href)
}
},
download(row){
// ,

@ -178,6 +178,7 @@ export default {
setTimeout(() => {
this.$get(`${this.api.getRole}?id=${row.id}`).then(res => {
this.form = res.role
//
this.checkedIds = this.handleRolePer(res.permissionList,this.permissions)
this.$refs.per.setCheckedNodes(this.checkedIds)
}).catch(res => {})

Loading…
Cancel
Save