上传修改

This commit is contained in:
lee 2024-07-04 10:29:30 +08:00
parent a8ddcf4b86
commit 003356da15
5 changed files with 19 additions and 4 deletions

View File

@ -6,7 +6,7 @@
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"dev": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve", "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", "build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview", "preview": "node build/index.js --preview",
"lint": "eslint --ext .js,.vue src" "lint": "eslint --ext .js,.vue src"

View File

@ -213,7 +213,7 @@ export default {
// //
let length = quill.getSelection().index; let length = quill.getSelection().index;
// res.url // res.url
quill.insertEmbed(length, "image", res.fileName); quill.insertEmbed(length, "image", res.url);
// //
quill.setSelection(length + 1); quill.setSelection(length + 1);
} else { } else {

View File

@ -76,7 +76,7 @@ export default {
dialogImageUrl: "", dialogImageUrl: "",
dialogVisible: false, dialogVisible: false,
hideUpload: 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", // uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", //
headers: { headers: {
Authorization: "Bearer " + getToken(), Authorization: "Bearer " + getToken(),
@ -87,12 +87,15 @@ export default {
watch: { watch: {
value: { value: {
handler(val) { handler(val) {
console.log(val)
if (val) { if (val) {
// //
const list = Array.isArray(val) ? val : this.value.split(','); const list = Array.isArray(val) ? val : this.value.split(',');
// //
this.fileList = list.map(item => { this.fileList = list.map(item => {
console.log(item)
if (typeof item === "string") { if (typeof item === "string") {
if (item.indexOf(this.baseUrl) === -1) { if (item.indexOf(this.baseUrl) === -1) {
item = { name: this.baseUrl + item, url: this.baseUrl + item }; item = { name: this.baseUrl + item, url: this.baseUrl + item };
} else { } else {
@ -155,7 +158,7 @@ export default {
// //
handleUploadSuccess(res, file) { handleUploadSuccess(res, file) {
if (res.code === 200) { if (res.code === 200) {
this.uploadList.push({ name: res.fileName, url: res.fileName }); this.uploadList.push({ name: res.fileName, url: res.url });
this.uploadedSuccessfully(); this.uploadedSuccessfully();
} else { } else {
this.number--; this.number--;

View File

@ -87,6 +87,15 @@
:label="item.tagName" :value="item.tagId"></el-option> :label="item.tagName" :value="item.tagId"></el-option>
</el-select> </el-select>
</el-form-item> </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> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>

View File

@ -367,6 +367,9 @@ export default {
getMaterial(materialId).then(response => { getMaterial(materialId).then(response => {
this.form = response.data; this.form = response.data;
this.form.groupId = Number( this.form.groupId) this.form.groupId = Number( this.form.groupId)
if(this.form.savePath.indexOf('http')==0){
// this.form.savePath =
}
this.open = true; this.open = true;
this.title = "修改素材管理"; this.title = "修改素材管理";
}); });