上传修改
This commit is contained in:
parent
a8ddcf4b86
commit
003356da15
|
@ -6,7 +6,7 @@
|
|||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
|
||||
"build:prod": "vue-cli-service build",
|
||||
"build:prod": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
|
||||
"build:stage": "vue-cli-service build --mode staging",
|
||||
"preview": "node build/index.js --preview",
|
||||
"lint": "eslint --ext .js,.vue src"
|
||||
|
|
|
@ -213,7 +213,7 @@ export default {
|
|||
// 获取光标所在位置
|
||||
let length = quill.getSelection().index;
|
||||
// 插入图片 res.url为服务器返回的图片地址
|
||||
quill.insertEmbed(length, "image", res.fileName);
|
||||
quill.insertEmbed(length, "image", res.url);
|
||||
// 调整光标到最后
|
||||
quill.setSelection(length + 1);
|
||||
} else {
|
||||
|
|
|
@ -76,7 +76,7 @@ export default {
|
|||
dialogImageUrl: "",
|
||||
dialogVisible: false,
|
||||
hideUpload: false,
|
||||
baseUrl: process.env.VUE_APP_BASE_API,
|
||||
baseUrl: '',//process.env.VUE_APP_BASE_API,
|
||||
uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
|
||||
headers: {
|
||||
Authorization: "Bearer " + getToken(),
|
||||
|
@ -87,12 +87,15 @@ export default {
|
|||
watch: {
|
||||
value: {
|
||||
handler(val) {
|
||||
console.log(val)
|
||||
if (val) {
|
||||
// 首先将值转为数组
|
||||
const list = Array.isArray(val) ? val : this.value.split(',');
|
||||
// 然后将数组转为对象数组
|
||||
this.fileList = list.map(item => {
|
||||
console.log(item)
|
||||
if (typeof item === "string") {
|
||||
|
||||
if (item.indexOf(this.baseUrl) === -1) {
|
||||
item = { name: this.baseUrl + item, url: this.baseUrl + item };
|
||||
} else {
|
||||
|
@ -155,7 +158,7 @@ export default {
|
|||
// 上传成功回调
|
||||
handleUploadSuccess(res, file) {
|
||||
if (res.code === 200) {
|
||||
this.uploadList.push({ name: res.fileName, url: res.fileName });
|
||||
this.uploadList.push({ name: res.fileName, url: res.url });
|
||||
this.uploadedSuccessfully();
|
||||
} else {
|
||||
this.number--;
|
||||
|
|
|
@ -87,6 +87,15 @@
|
|||
:label="item.tagName" :value="item.tagId"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="发布时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="form.createTime"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="datetime"
|
||||
placeholder="选择日期时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
|
|
|
@ -367,6 +367,9 @@ export default {
|
|||
getMaterial(materialId).then(response => {
|
||||
this.form = response.data;
|
||||
this.form.groupId = Number( this.form.groupId)
|
||||
if(this.form.savePath.indexOf('http')==0){
|
||||
// this.form.savePath =
|
||||
}
|
||||
this.open = true;
|
||||
this.title = "修改素材管理";
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue