首页预览

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 => { 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 const list = res.pageList.records
list.map(e => { list.map(e => {
//
const startTime = e.startTime ? e.startTime.slice(0, 10) : '' const startTime = e.startTime ? e.startTime.slice(0, 10) : ''
const endTime = e.endTime ? e.endTime.slice(0, 10) : '' const endTime = e.endTime ? e.endTime.slice(0, 10) : ''
if (startTime && endTime) { if (startTime && endTime) {
@ -252,6 +253,7 @@ export default {
}) })
this.listData = list this.listData = list
this.total = res.pageList.total this.total = res.pageList.total
//
if (this.$route.query.preview) { if (this.$route.query.preview) {
this.preview({ this.preview({
id: this.$route.query.id, id: this.$route.query.id,

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

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

Loading…
Cancel
Save