Browse Source

添加支付密码

master
song 3 years ago
parent
commit
e8c6ed1e0a
  1. 46
      src/components/News/addOrEdit.vue
  2. 4
      src/config.js
  3. 8
      vue.config.js

46
src/components/News/addOrEdit.vue

@ -27,12 +27,17 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="附件:" prop="jumpUrl"> <el-form-item label="附件:" prop="jumpUrl">
<el-input v-model="formLabelAlign.jumpUrl" placeholder="附件" /> <!-- <el-input v-model="formLabelAlign.jumpUrl" placeholder="附件" /> -->
<el-upload <el-upload
class="upload-demo mt-4" class="upload-demo"
:action="`${BASE_API}/file/upload`" :action="`${BASE_API}/file/uploadMultiple`"
name="files"
:on-success="handleJumpUrlSuccess" :on-success="handleJumpUrlSuccess"
:show-file-list="false" :on-remove="handleRemove"
:before-remove="beforeRemove"
:show-file-list="true"
:file-list="fileList"
multiple
> >
<el-button size="small" type="primary" class="mr-4">点击上传</el-button> <el-button size="small" type="primary" class="mr-4">点击上传</el-button>
</el-upload> </el-upload>
@ -135,14 +140,14 @@ import { Loading } from 'element-ui';
author: '', author: '',
editor: '', editor: '',
showType: 0, showType: 0,
jumpUrl: '',
titleUrl: '', titleUrl: '',
submitStatus: 1, submitStatus: 1,
source: '', source: '',
publishTime: '', publishTime: '',
content: '', content: '',
showPage: ['02','0203'], showPage: ['02','0203'],
relationContentIds: [] relationContentIds: [],
files: []
}, },
fileList: [], fileList: [],
code: '', code: '',
@ -220,11 +225,29 @@ import { Loading } from 'element-ui';
// //
handleJumpUrlSuccess(res) { handleJumpUrlSuccess(res) {
if (res.data && res.data.path) { if (res.data && res.data.length) {
this.formLabelAlign.jumpUrl = res.data.path; 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) { handleChange(value) {
this.formLabelAlign.showPage = value this.formLabelAlign.showPage = value
@ -324,6 +347,13 @@ import { Loading } from 'element-ui';
this.showLoading = false; this.showLoading = false;
if(res.code === 200){ if(res.code === 200){
this.formLabelAlign.content = res.data.content 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{ }else{
Alert.fail(res.msg || '详情获取失败'); Alert.fail(res.msg || '详情获取失败');
} }

4
src/config.js

@ -4,8 +4,8 @@ export const DEVICE_TYPE_BIG = "quxia-vm"
export const client_id = 'test' export const client_id = 'test'
export const client_secret = "test" export const client_secret = "test"
// export const BASE_API = "https://rapapi.renqilai.com/app/mock/39"; // 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 = "http://10.119.190.12:8000/v1.0";
// export const BASE_API = "https://test.tall.wiki/datang/v1.0"; export const BASE_API = "https://test.tall.wiki/datang/v1.0";
export const pageSize = 20 export const pageSize = 20
export const SHELF_MAX_ROW=7 export const SHELF_MAX_ROW=7

8
vue.config.js

@ -1,11 +1,11 @@
// vue.config.js // vue.config.js
var path = require("path"); var path = require("path");
const BASE_API = "http://10.119.190.12:8000/v1.0" // const BASE_API = "http://10.119.190.12:8000/v1.0"
const proxyUrl = '/v1.0' // const proxyUrl = '/v1.0'
// const BASE_API = "https://test.tall.wiki/datang/v1.0" const BASE_API = "https://test.tall.wiki/datang/v1.0"
// const proxyUrl = '/datang/v1.0' const proxyUrl = '/datang/v1.0'
const port = 8080 const port = 8080

Loading…
Cancel
Save