wiki评论和空间
This commit is contained in:
@@ -33,6 +33,7 @@ public class WikiPageZanController {
|
|||||||
UpdateWrapper<WikiPageZan> wrapper = new UpdateWrapper<>();
|
UpdateWrapper<WikiPageZan> wrapper = new UpdateWrapper<>();
|
||||||
wrapper.eq("page_id", wikiPageZan.getPageId());
|
wrapper.eq("page_id", wikiPageZan.getPageId());
|
||||||
wrapper.eq(wikiPageZan.getCommentId() != null, "comment_id", wikiPageZan.getCommentId());
|
wrapper.eq(wikiPageZan.getCommentId() != null, "comment_id", wikiPageZan.getCommentId());
|
||||||
|
wrapper.eq("yn", 1);
|
||||||
List<WikiPageZan> zanList = wikiPageZanService.list(wrapper);
|
List<WikiPageZan> zanList = wikiPageZanService.list(wrapper);
|
||||||
return DocResponseJson.ok(zanList);
|
return DocResponseJson.ok(zanList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,11 +13,11 @@
|
|||||||
<el-container style="height: 100%;">
|
<el-container style="height: 100%;">
|
||||||
<el-header>
|
<el-header>
|
||||||
<!--<div class="logo" @click="aboutDialogVisible = true">zyplayer-doc-wiki</div>-->
|
<!--<div class="logo" @click="aboutDialogVisible = true">zyplayer-doc-wiki</div>-->
|
||||||
<el-dropdown @command="notOpen" trigger="click">
|
<el-dropdown @command="userSettingDropdown" trigger="click">
|
||||||
<i class="el-icon-setting" style="margin-right: 15px; font-size: 16px;cursor: pointer;color: #fff;"> </i>
|
<i class="el-icon-setting" style="margin-right: 15px; font-size: 16px;cursor: pointer;color: #fff;"> </i>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item command="">我的资料</el-dropdown-item>
|
<el-dropdown-item command="">我的资料</el-dropdown-item>
|
||||||
<el-dropdown-item command="">退出登录</el-dropdown-item>
|
<el-dropdown-item command="userSignOut">退出登录</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</el-header>
|
</el-header>
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
<div style="padding: 10px;">
|
<div style="padding: 10px;">
|
||||||
<!--<el-row><el-switch v-model="isCollapse"></el-switch></el-row>-->
|
<!--<el-row><el-switch v-model="isCollapse"></el-switch></el-row>-->
|
||||||
<div style="margin-bottom: 10px;">
|
<div style="margin-bottom: 10px;">
|
||||||
<el-select v-model="nowSpaceId" @change="spaceChangeEvents" filterable placeholder="选择空间" style="width: 100%;">
|
<el-select v-model="choiceSpace" @change="spaceChangeEvents" filterable placeholder="选择空间" style="width: 100%;">
|
||||||
<el-option-group label="">
|
<el-option-group label="">
|
||||||
<el-option key="0" label="创建空间" value="0"></el-option>
|
<el-option key="0" label="创建空间" value="0"></el-option>
|
||||||
</el-option-group>
|
</el-option-group>
|
||||||
@@ -59,16 +59,9 @@
|
|||||||
<div class="wiki-author">
|
<div class="wiki-author">
|
||||||
<span>创建:{{wikiPage.createUserName}} {{wikiPage.createTime}} <span v-show="wikiPage.updateUserName">修改:{{wikiPage.updateUserName}} {{wikiPage.updateTime}}</span></span>
|
<span>创建:{{wikiPage.createUserName}} {{wikiPage.createTime}} <span v-show="wikiPage.updateUserName">修改:{{wikiPage.updateUserName}} {{wikiPage.updateTime}}</span></span>
|
||||||
<div style="float: right;">
|
<div style="float: right;">
|
||||||
<el-upload
|
<el-upload class="upload-page-file" action="zyplayer-doc-wiki/common/upload"
|
||||||
class="upload-page-file"
|
:on-success="uploadFileSuccess" :on-error="uploadFileError"
|
||||||
action="zyplayer-doc-wiki/common/upload"
|
name="files" show-file-list multiple :data="uploadFormData" :limit="999">
|
||||||
:on-success="uploadFileSuccess"
|
|
||||||
:on-error="uploadFileError"
|
|
||||||
name="files"
|
|
||||||
show-file-list
|
|
||||||
multiple
|
|
||||||
:data="uploadFormData"
|
|
||||||
:limit="999">
|
|
||||||
<el-button icon="el-icon-upload">上传附件</el-button>
|
<el-button icon="el-icon-upload">上传附件</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</div>
|
</div>
|
||||||
@@ -94,9 +87,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 40px; font-size: 14px;">
|
<div style="margin-top: 40px; font-size: 14px;">
|
||||||
<span style="vertical-align: top;" class="is-link">
|
<span style="vertical-align: top;" class="is-link">
|
||||||
<img src="webjars/doc-wiki/img/zan.png" style="vertical-align: middle;">
|
<span v-show="wikiPage.selfZan == 0" v-on:click="zanPage(1)"><img src="webjars/doc-wiki/img/zan.png" style="vertical-align: middle;"> 赞</span>
|
||||||
<span v-show="wikiPage.selfZan == 0" v-on:click="zanPage(1)">赞</span>
|
<span v-show="wikiPage.selfZan == 1" v-on:click="zanPage(0)"><img src="webjars/doc-wiki/img/zan.png" style="vertical-align: middle;"> 踩</span>
|
||||||
<span v-show="wikiPage.selfZan == 1" v-on:click="zanPage(0)">踩</span>
|
|
||||||
</span>
|
</span>
|
||||||
<span style="margin-left: 10px;vertical-align: top;">
|
<span style="margin-left: 10px;vertical-align: top;">
|
||||||
<span v-if="wikiPage.selfZan == 0 && wikiPage.zanNum <= 0">成为第一个赞同者</span>
|
<span v-if="wikiPage.selfZan == 0 && wikiPage.zanNum <= 0">成为第一个赞同者</span>
|
||||||
@@ -154,15 +146,15 @@
|
|||||||
</el-container>
|
</el-container>
|
||||||
<!--新建空间弹窗-->
|
<!--新建空间弹窗-->
|
||||||
<el-dialog title="创建空间" :visible.sync="newSpaceDialogVisible" width="600px">
|
<el-dialog title="创建空间" :visible.sync="newSpaceDialogVisible" width="600px">
|
||||||
<el-form label-width="100px">
|
<el-form label-width="100px" :model="newSpaceForm" :rules="newSpaceFormRules" ref="newSpaceForm">
|
||||||
<el-form-item label="空间名:">
|
<el-form-item label="空间名:" prop="name">
|
||||||
<el-input v-model="newSpaceForm.name"></el-input>
|
<el-input v-model="newSpaceForm.name"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="空间描述:">
|
<el-form-item label="空间描述:" prop="spaceExplain">
|
||||||
<el-input v-model="newSpaceForm.spaceExplain"></el-input>
|
<el-input v-model="newSpaceForm.spaceExplain"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onNewSpaceSubmit">立即创建</el-button>
|
<el-button type="primary" @click="onNewSpaceSubmit('newSpaceForm')">立即创建</el-button>
|
||||||
<el-button @click="onNewSpaceCancel">取消</el-button>
|
<el-button @click="onNewSpaceCancel">取消</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -227,6 +219,12 @@
|
|||||||
nowSpaceId: '',
|
nowSpaceId: '',
|
||||||
newSpaceDialogVisible: false,
|
newSpaceDialogVisible: false,
|
||||||
newSpaceForm: {name: '', spaceExplain: ''},
|
newSpaceForm: {name: '', spaceExplain: ''},
|
||||||
|
newSpaceFormRules: {
|
||||||
|
name: [
|
||||||
|
{required: true, message: '请输入空间名', trigger: 'blur'},
|
||||||
|
{min: 2, max: 25, message: '长度在 2 到 25 个字符', trigger: 'blur'}
|
||||||
|
],
|
||||||
|
},
|
||||||
// 依据目录树存储的map全局对象
|
// 依据目录树存储的map全局对象
|
||||||
treePathDataMap: new Map(),
|
treePathDataMap: new Map(),
|
||||||
// 搜索的输入内容
|
// 搜索的输入内容
|
||||||
@@ -261,7 +259,24 @@
|
|||||||
onNewSpaceCancel() {
|
onNewSpaceCancel() {
|
||||||
this.newSpaceDialogVisible = false;
|
this.newSpaceDialogVisible = false;
|
||||||
},
|
},
|
||||||
onNewSpaceSubmit() {
|
userSettingDropdown(command) {
|
||||||
|
console.log("command:" + command);
|
||||||
|
if (command == 'userSignOut') {
|
||||||
|
this.userSignOut();
|
||||||
|
} else {
|
||||||
|
Toast.notOpen();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
userSignOut() {
|
||||||
|
ajaxTemp("logout", "post", "json", {}, function () {
|
||||||
|
}, function () {
|
||||||
|
}, function () {
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onNewSpaceSubmit(formName) {
|
||||||
|
this.$refs[formName].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
var param = {name: app.newSpaceForm.name, spaceExplain: app.newSpaceForm.spaceExplain};
|
var param = {name: app.newSpaceForm.name, spaceExplain: app.newSpaceForm.spaceExplain};
|
||||||
ajaxTemp("zyplayer-doc-wiki/space/update", "post", "json", param, function (json) {
|
ajaxTemp("zyplayer-doc-wiki/space/update", "post", "json", param, function (json) {
|
||||||
if (validateResult(json)) {
|
if (validateResult(json)) {
|
||||||
@@ -276,6 +291,8 @@
|
|||||||
app.doGetPageList(null);
|
app.doGetPageList(null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
zanPage(yn) {
|
zanPage(yn) {
|
||||||
var param = {yn: yn, pageId: app.wikiPage.id};
|
var param = {yn: yn, pageId: app.wikiPage.id};
|
||||||
@@ -310,12 +327,7 @@
|
|||||||
ajaxTemp("zyplayer-doc-wiki/page/comment/update", "post", "json", param, function (json) {
|
ajaxTemp("zyplayer-doc-wiki/page/comment/update", "post", "json", param, function (json) {
|
||||||
if (validateResult(json)) {
|
if (validateResult(json)) {
|
||||||
var data = json.data;
|
var data = json.data;
|
||||||
var color = page.userHeadColor[data.createUserId];
|
data.color = app.getUserHeadBgColor(data.createUserId);
|
||||||
if (!color) {
|
|
||||||
color = page.colorArr[Math.ceil(Math.random() * page.colorArr.length) - 1];
|
|
||||||
page.userHeadColor[data.createUserId] = color;
|
|
||||||
}
|
|
||||||
data.color = color;
|
|
||||||
app.commentTextInput = "";
|
app.commentTextInput = "";
|
||||||
app.commentList.push(data);
|
app.commentList.push(data);
|
||||||
}
|
}
|
||||||
@@ -411,10 +423,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
spaceChangeEvents(data) {
|
spaceChangeEvents(data) {
|
||||||
app.nowSpaceId = data;
|
|
||||||
if (data == 0) {
|
if (data == 0) {
|
||||||
app.newSpaceDialogVisible = true;
|
app.newSpaceDialogVisible = true;
|
||||||
|
app.choiceSpace = app.nowSpaceId;
|
||||||
} else {
|
} else {
|
||||||
|
app.nowSpaceId = data;
|
||||||
|
app.rightContentType = 0;
|
||||||
app.doGetPageList(null);
|
app.doGetPageList(null);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -459,21 +473,11 @@
|
|||||||
if (validateResult(json)) {
|
if (validateResult(json)) {
|
||||||
var commentList = json.data || [];
|
var commentList = json.data || [];
|
||||||
for (var i = 0; i < commentList.length; i++) {
|
for (var i = 0; i < commentList.length; i++) {
|
||||||
var color = page.userHeadColor[commentList[i].createUserId];
|
commentList[i].color = app.getUserHeadBgColor(commentList[i].createUserId);
|
||||||
if (!color) {
|
|
||||||
color = page.colorArr[Math.ceil(Math.random() * page.colorArr.length) - 1];
|
|
||||||
page.userHeadColor[commentList[i].createUserId] = color;
|
|
||||||
}
|
|
||||||
commentList[i].color = color;
|
|
||||||
var subCommentList = commentList[i].commentList || [];
|
var subCommentList = commentList[i].commentList || [];
|
||||||
for (var j = 0; j < subCommentList.length; j++) {
|
for (var j = 0; j < subCommentList.length; j++) {
|
||||||
var subItem = subCommentList[j];
|
var subItem = subCommentList[j];
|
||||||
var colorSub = page.userHeadColor[subItem.createUserId];
|
subItem.color = app.getUserHeadBgColor(subItem.createUserId);
|
||||||
if (!colorSub) {
|
|
||||||
colorSub = page.colorArr[Math.ceil(Math.random() * page.colorArr.length) - 1];
|
|
||||||
page.userHeadColor[subItem.createUserId] = colorSub;
|
|
||||||
}
|
|
||||||
subItem.color = colorSub;
|
|
||||||
}
|
}
|
||||||
commentList[i].commentList = subCommentList;
|
commentList[i].commentList = subCommentList;
|
||||||
}
|
}
|
||||||
@@ -481,8 +485,16 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
getUserHeadBgColor(userId) {
|
||||||
|
var color = page.userHeadColor[userId];
|
||||||
|
if (!color) {
|
||||||
|
color = page.colorArr[Math.ceil(Math.random() * page.colorArr.length) - 1];
|
||||||
|
page.userHeadColor[userId] = color;
|
||||||
|
}
|
||||||
|
return color;
|
||||||
|
},
|
||||||
searchByKeywords() {
|
searchByKeywords() {
|
||||||
app.pathIndex = createTreeViewByTreeWithMerge(app.dubboDocList, app.searchKeywords);
|
//app.pathIndex = createTreeViewByTreeWithMerge(app.dubboDocList, app.searchKeywords);
|
||||||
},
|
},
|
||||||
doGetPageList(parentId, node) {
|
doGetPageList(parentId, node) {
|
||||||
var nodePath = "";
|
var nodePath = "";
|
||||||
@@ -504,26 +516,20 @@
|
|||||||
id: item.id,
|
id: item.id,
|
||||||
label: item.name,
|
label: item.name,
|
||||||
nodePath: nodePath + item.name,
|
nodePath: nodePath + item.name,
|
||||||
children: [{label: '', needLoad: true}],
|
children: [{label: '', needLoad: true}],// 初始化一个对象,点击展开时重新查询加载
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (parentId > 0) {
|
if (parentId > 0) {
|
||||||
node.children = pathIndex;
|
node.children = pathIndex;
|
||||||
} else {
|
} else {
|
||||||
app.wikiPageList = pathIndex;
|
app.wikiPageList = pathIndex;
|
||||||
// 清空页面信息
|
|
||||||
app.rightContentType = 0;
|
|
||||||
app.newPageId = "";
|
|
||||||
app.newPageTitle = "";
|
|
||||||
page.newPageContentEditor.txt.html("");
|
|
||||||
app.lastClickNode = {};
|
app.lastClickNode = {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
init(){
|
init(){
|
||||||
var E = window.wangEditor;
|
page.newPageContentEditor = new window.wangEditor('#newPageContentDiv');
|
||||||
page.newPageContentEditor = new E('#newPageContentDiv');
|
|
||||||
page.newPageContentEditor.customConfig.uploadImgServer = 'zyplayer-doc-wiki/common/upload';
|
page.newPageContentEditor.customConfig.uploadImgServer = 'zyplayer-doc-wiki/common/upload';
|
||||||
page.newPageContentEditor.create();
|
page.newPageContentEditor.create();
|
||||||
}
|
}
|
||||||
@@ -531,17 +537,9 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
html,body,#app {
|
html,body,#app {margin: 0; padding: 0; height: 100%;}
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
pre{margin: 0;white-space: pre-wrap;font-size: 14px; font-family: auto;}
|
pre{margin: 0;white-space: pre-wrap;font-size: 14px; font-family: auto;}
|
||||||
.el-menu {
|
.el-menu {box-sizing: border-box;border-right: 0;margin-right: 3px;}
|
||||||
box-sizing: border-box;
|
|
||||||
border-right: 0;
|
|
||||||
margin-right: 3px;
|
|
||||||
}
|
|
||||||
.el-header {background-color: #409EFF; color: #333; line-height: 40px; text-align: right;height: 40px !important;}
|
.el-header {background-color: #409EFF; color: #333; line-height: 40px; text-align: right;height: 40px !important;}
|
||||||
.doc-body-box{
|
.doc-body-box{
|
||||||
overflow-x: hidden;overflow-y: auto;width: 100%;
|
overflow-x: hidden;overflow-y: auto;width: 100%;
|
||||||
|
|||||||
@@ -0,0 +1,140 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||||||
|
<title>测试</title>
|
||||||
|
<link rel="shortcut icon" href="../doc-wiki/img/wiki.ico"/>
|
||||||
|
<link rel="stylesheet" href="../doc-wiki/css/element-ui.css">
|
||||||
|
<link rel="stylesheet" href="../doc-wiki/css/doc-wiki.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app">
|
||||||
|
<el-form :model="ruleFormData" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
|
||||||
|
<el-form-item label="活动名称" prop="name">
|
||||||
|
<el-input v-model="ruleFormData.name"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="活动区域" prop="region">
|
||||||
|
<el-select v-model="ruleForm.region" placeholder="请选择活动区域">
|
||||||
|
<el-option label="区域一" value="shanghai"></el-option>
|
||||||
|
<el-option label="区域二" value="beijing"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="活动时间" required>
|
||||||
|
<el-col :span="11">
|
||||||
|
<el-form-item prop="date1">
|
||||||
|
<el-date-picker type="date" placeholder="选择日期" v-model="ruleForm.date1" style="width: 100%;"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col class="line" :span="2">-</el-col>
|
||||||
|
<el-col :span="11">
|
||||||
|
<el-form-item prop="date2">
|
||||||
|
<el-time-picker type="fixed-time" placeholder="选择时间" v-model="ruleForm.date2" style="width: 100%;"></el-time-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="即时配送" prop="delivery">
|
||||||
|
<el-switch v-model="ruleForm.delivery"></el-switch>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="活动性质" prop="type">
|
||||||
|
<el-checkbox-group v-model="ruleForm.type">
|
||||||
|
<el-checkbox label="美食/餐厅线上活动" name="type"></el-checkbox>
|
||||||
|
<el-checkbox label="地推活动" name="type"></el-checkbox>
|
||||||
|
<el-checkbox label="线下主题活动" name="type"></el-checkbox>
|
||||||
|
<el-checkbox label="单纯品牌曝光" name="type"></el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="特殊资源" prop="resource">
|
||||||
|
<el-radio-group v-model="ruleForm.resource">
|
||||||
|
<el-radio label="线上品牌商赞助"></el-radio>
|
||||||
|
<el-radio label="线下场地免费"></el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="活动形式" prop="desc">
|
||||||
|
<el-input type="textarea" v-model="ruleForm.desc"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="submitForm('ruleForm')">立即创建</el-button>
|
||||||
|
<el-button @click="resetForm('ruleForm')">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
<script type="text/javascript" src="../doc-wiki/vue/vue.js"></script>
|
||||||
|
<script type="text/javascript" src="../doc-wiki/js/element-ui.js"></script>
|
||||||
|
<!-- ajax 用到了jquery -->
|
||||||
|
<script type="text/javascript" src="../doc-wiki/js/jquery-3.1.0.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../doc-wiki/js/common.js"></script>
|
||||||
|
<script type="text/javascript" src="../doc-wiki/js/toast.js"></script>
|
||||||
|
<script type="text/javascript" src="../doc-wiki/js/formatjson.js"></script>
|
||||||
|
<script type="text/javascript" src="../doc-wiki/js/doc-wiki-tree.js"></script>
|
||||||
|
<script type="text/javascript" src="../doc-wiki/lib/wangEditor/wangEditor.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var app = new Vue({
|
||||||
|
el: '#app',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
ruleFormData: {
|
||||||
|
name: '',
|
||||||
|
region: '',
|
||||||
|
date1: '',
|
||||||
|
date2: '',
|
||||||
|
delivery: false,
|
||||||
|
type: [],
|
||||||
|
resource: '',
|
||||||
|
desc: ''
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
name: [
|
||||||
|
{ required: true, message: '请输入活动名称', trigger: 'blur' },
|
||||||
|
{ min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
region: [
|
||||||
|
{ required: true, message: '请选择活动区域', trigger: 'change' }
|
||||||
|
],
|
||||||
|
date1: [
|
||||||
|
{ type: 'date', required: true, message: '请选择日期', trigger: 'change' }
|
||||||
|
],
|
||||||
|
date2: [
|
||||||
|
{ type: 'date', required: true, message: '请选择时间', trigger: 'change' }
|
||||||
|
],
|
||||||
|
type: [
|
||||||
|
{ type: 'array', required: true, message: '请至少选择一个活动性质', trigger: 'change' }
|
||||||
|
],
|
||||||
|
resource: [
|
||||||
|
{ required: true, message: '请选择活动资源', trigger: 'change' }
|
||||||
|
],
|
||||||
|
desc: [
|
||||||
|
{ required: true, message: '请填写活动形式', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
|
||||||
|
},
|
||||||
|
mounted: function () {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
submitForm(formName) {
|
||||||
|
this.$refs[formName].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
alert('submit!');
|
||||||
|
} else {
|
||||||
|
console.log('error submit!!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
resetForm(formName) {
|
||||||
|
this.$refs[formName].resetFields();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
</html>
|
||||||
|
|
||||||
Reference in New Issue
Block a user