diff --git a/src/components/News/addOrEdit.vue b/src/components/News/addOrEdit.vue index dc027fa..cc79a4a 100644 --- a/src/components/News/addOrEdit.vue +++ b/src/components/News/addOrEdit.vue @@ -27,12 +27,17 @@ - + 点击上传 @@ -135,14 +140,14 @@ import { Loading } from 'element-ui'; author: '', editor: '', showType: 0, - jumpUrl: '', titleUrl: '', submitStatus: 1, source: '', publishTime: '', content: '', showPage: ['02','0203'], - relationContentIds: [] + relationContentIds: [], + files: [] }, fileList: [], code: '', @@ -220,11 +225,29 @@ import { Loading } from 'element-ui'; // 上传附件 handleJumpUrlSuccess(res) { - if (res.data && res.data.path) { - this.formLabelAlign.jumpUrl = res.data.path; + if (res.data && res.data.length) { + this.formLabelAlign.files.push(res.data[0]); + } + }, + + handleRemove(file, fileList) { + if(file.status === 'success'){ + this.formLabelAlign.files = [] + if(fileList && fileList.length) { + fileList.forEach(file => { + const item = {} + item.name = file.name + item.path = file.path + this.formLabelAlign.files.push(item) + }) + } } }, + beforeRemove(file) { + return this.$confirm(`确定移除 ${ file.name }?`); + }, + // 位置选择 handleChange(value) { this.formLabelAlign.showPage = value @@ -324,6 +347,13 @@ import { Loading } from 'element-ui'; this.showLoading = false; if(res.code === 200){ this.formLabelAlign.content = res.data.content + this.formLabelAlign.files = res.data.files + if(res.data.files && res.data.files.length){ + res.data.files.forEach(item => { + this.fileList.push(item) + }) + } + }else{ Alert.fail(res.msg || '详情获取失败'); } diff --git a/src/config.js b/src/config.js index ab80f92..690c3da 100644 --- a/src/config.js +++ b/src/config.js @@ -4,8 +4,8 @@ export const DEVICE_TYPE_BIG = "quxia-vm" export const client_id = 'test' export const client_secret = "test" // export const BASE_API = "https://rapapi.renqilai.com/app/mock/39"; -export const BASE_API = "http://10.119.190.12:8000/v1.0"; -// export const BASE_API = "https://test.tall.wiki/datang/v1.0"; +// export const BASE_API = "http://10.119.190.12:8000/v1.0"; +export const BASE_API = "https://test.tall.wiki/datang/v1.0"; export const pageSize = 20 export const SHELF_MAX_ROW=7 diff --git a/vue.config.js b/vue.config.js index 75419d4..28780a2 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,11 +1,11 @@ // vue.config.js var path = require("path"); -const BASE_API = "http://10.119.190.12:8000/v1.0" -const proxyUrl = '/v1.0' +// const BASE_API = "http://10.119.190.12:8000/v1.0" +// const proxyUrl = '/v1.0' -// const BASE_API = "https://test.tall.wiki/datang/v1.0" -// const proxyUrl = '/datang/v1.0' +const BASE_API = "https://test.tall.wiki/datang/v1.0" +const proxyUrl = '/datang/v1.0' const port = 8080