upload上传回调

This commit is contained in:
xierz 2020-11-24 11:59:15 +08:00
parent 3eb03d1cfd
commit ee12b84b2d
3 changed files with 36 additions and 13 deletions

View File

@ -569,12 +569,20 @@
}, },
//categoryImg文件上传完成回调 //categoryImg文件上传完成回调
categoryImgSuccess: function (response, file, fileList) { categoryImgSuccess: function (response, file, fileList) {
this.form.categoryImg.push({ if(response.result){
url: file.url, this.form.categoryImg.push({
name: file.name, url: file.url,
path: response, name: file.name,
uid: file.uid path: response.data,
}); uid: file.uid
});
}else {
this.$notify({
title: response.msg,
type: 'warning'
});
}
}, },
//上传超过限制 //上传超过限制
categoryImghandleExceed: function (files, fileList) { categoryImghandleExceed: function (files, fileList) {

View File

@ -42,7 +42,8 @@
<template slot='label'>所属栏目 <template slot='label'>所属栏目
<el-popover placement="top-start" title="提示" trigger="hover"> <el-popover placement="top-start" title="提示" trigger="hover">
<a href="http://doc.mingsoft.net/plugs-cms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" <a href="http://doc.mingsoft.net/plugs-cms/biao-qian/wen-zhang-lie-biao-ms-arclist.html"
target="_blank">${'$'}{field.typetitle}</a> target="_blank">${'$'}{field.typetitle}</a><br/>
不能为链接和封面类型新建文章
<i class="el-icon-question" slot="reference"></i> <i class="el-icon-question" slot="reference"></i>
</el-popover> </el-popover>
</template> </template>
@ -530,6 +531,11 @@
pageSize: 9999 pageSize: 9999
}).then(function (res) { }).then(function (res) {
if (res.result) { if (res.result) {
res.data.rows.forEach(function (item) {
if (item.categoryType == '2' || item.categoryType == '3') {
item.isDisabled = true;
}
});
that.contentCategoryIdOptions = ms.util.treeData(res.data.rows, 'id', 'categoryId', 'children'); that.contentCategoryIdOptions = ms.util.treeData(res.data.rows, 'id', 'categoryId', 'children');
that.categoryIdOptions = res.data.rows; that.categoryIdOptions = res.data.rows;
that.changeModel(); that.changeModel();
@ -555,12 +561,20 @@
}, },
//contentImg文件上传完成回调 //contentImg文件上传完成回调
contentImgSuccess: function (response, file, fileList) { contentImgSuccess: function (response, file, fileList) {
this.form.contentImg.push({ if(response.result){
url: file.url, this.form.contentImg.push({
name: file.name, url: file.url,
path: response, name: file.name,
uid: file.uid path: response.data,
}); uid: file.uid
});
}else {
this.$notify({
title: response.msg,
type: 'warning'
});
}
}, },
contentImghandleRemove: function (file, files) { contentImghandleRemove: function (file, files) {
var index = -1; var index = -1;

View File

@ -66,6 +66,7 @@ Vue.use(VueAwesomeSwiper)
</style> </style>
</head> </head>
<body> <body>
<h1><a href="{ms:global.url/}/news/index.html">进入</a></h1>
<div id="app" v-cloak> <div id="app" v-cloak>
<#include "header.htm"/> <#include "header.htm"/>