Commit 9e9f7966 authored by zhengke's avatar zhengke

修改问题

parent ed2d3f6e
......@@ -26,7 +26,7 @@
<el-input v-model="addMsg.Major" placeholder="请输入专业" />
</el-form-item>
<el-form-item label="工作年限" prop="WorkYears" class="is-required" size="small">
<el-input v-model="addMsg.WorkYears" placeholder="请输入工作年限" />
<el-input v-model="addMsg.WorkYears" @keyup.native="checkInteger(addMsg,'WorkYears')" placeholder="请输入工作年限" />
</el-form-item>
<el-form-item label="上架状态" size="small">
<el-switch v-model="addMsg.TeacherStatus" active-color="#409EFF" :active-value="1"
......
......@@ -175,7 +175,10 @@
created() {
this.getTemplate(); //获取评价类型下拉数据
this.getplat(); //获取所属平台下拉数据
if(this.$route.query.ArticleId){
this.msg.ArticleId=this.$route.query.ArticleId;
this.getList(); //获取列表数据
}
},
mounted() {},
methods: {
......
......@@ -32,7 +32,8 @@
<el-button @click="tableSet(3)" size="mini">删除</el-button>
</div>
</div>
<el-table v-loading="loading" :data="tableData" @selection-change="tableSelect" border style="width: 100%;margin:20px 0">
<el-table v-loading="loading" :data="tableData" @selection-change="tableSelect" border
style="width: 100%;margin:20px 0">
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column prop="ID" width="80" label="编号">
......@@ -55,7 +56,8 @@
</el-table-column>
<el-table-column label="留言数">
<template slot-scope="scope">
<span style="color:#409EFF;text-decoration:underline;cursor:pointer;" @click="CommonJump('informationEvalution')">{{scope.row.CommentNum}}</span>
<span style="color:#409EFF;text-decoration:underline;cursor:pointer;"
@click="CommonJump('informationEvalution',{ArticleId:scope.row.ID})">{{scope.row.CommentNum}}</span>
</template>
</el-table-column>
<el-table-column prop="BrowseNum" label="实际浏览数">
......@@ -83,26 +85,39 @@
</div>
<div class="content">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="120px">
<el-form-item label="标题" prop="Name">
<el-input type="text" class="w300" v-model="addMsg.Name" size="small"></el-input>
</el-form-item>
<el-form-item label="标签" class="is-required">
<el-tag :key="index" v-for="(tag,index) in addMsg.LableNameList" closable :disable-transitions="false"
@close="handleClose(tag)">
{{tag}}
</el-tag>
<el-input class="input-new-tag" v-if="inputVisible" v-model="inputValue" ref="saveTagInput" size="small"
@keyup.enter.native="handleInputConfirm" @blur="handleInputConfirm">
</el-input>
<el-button v-else class="button-new-tag" size="small" @click="showInput">+ 标签</el-button>
</el-form-item>
<el-form-item label="资讯状态">
<el-select class="w300" v-model="addMsg.ArticleStatus" size="small" placeholder="请选择">
<el-option label="上架" :value="1"></el-option>
<el-option label="下架" :value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="关联老师" prop="TeacherId">
<el-form-item label="关联老师">
<el-select class="w150" style="margin-right: 10px;" v-model="addMsg.TeacherId" size="small"
placeholder="请选择" @change='changeSupplier'>
<el-option label="不限" :value="0"></el-option>
<el-option v-for="item in teacherList" :key="item.ID" :label="item.Name" :value="item.ID">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="头像" class="is-required" size="small">
<el-form-item label="头像" size="small">
<el-button @click="openChangeDig(1)" size="small">选择文件</el-button>
<div class="app-gallery-item" style="position: relative;width: 100px;margin-top: 10px;">
<img v-if="!addMsg.ArticlePic || addMsg.ArticlePic==''"
src="../../assets/img/default.png" style="width:80px;height:80px" alt="">
<img v-else style="width:80px;height:80px" :src="addMsg.ArticlePic"
alt="">
<img v-if="!addMsg.ArticlePic || addMsg.ArticlePic==''" src="../../assets/img/default.png"
style="width:80px;height:80px" alt="">
<img v-else style="width:80px;height:80px" :src="addMsg.ArticlePic" alt="">
</div>
</el-form-item>
<el-form-item label="排序">
......@@ -121,30 +136,6 @@
<el-form-item label="虚拟浏览数量">
<el-input type="number" class="w300" v-model="addMsg.FictitiousBrowseNum" size="small"></el-input>
</el-form-item>
<el-form-item label="标题">
<el-input type="text" class="w300" v-model="addMsg.Name" size="small"></el-input>
</el-form-item>
<el-form-item label="标签">
<el-tag
:key="index"
v-for="(tag,index) in addMsg.LableNameList"
closable
:disable-transitions="false"
@close="handleClose(tag)">
{{tag}}
</el-tag>
<el-input
class="input-new-tag"
v-if="inputVisible"
v-model="inputValue"
ref="saveTagInput"
size="small"
@keyup.enter.native="handleInputConfirm"
@blur="handleInputConfirm"
>
</el-input>
<el-button v-else class="button-new-tag" size="small" @click="showInput">+ 标签</el-button>
</el-form-item>
<el-form-item label="是否可以留言">
<el-switch v-model="addMsg.IsComment" class="w300" active-color="#409EFF" :active-value="1"
:inactive-value="0">
......@@ -199,29 +190,24 @@
LableName: '', //标签
IsComment: 0, //是否可以留言,0-否,1-是
Describe: '', //资讯内容
TeacherId:'',
LableNameList:[],//标签数组
ArticlePic:'',//图片
TeacherId: '',
LableNameList: [], //标签数组
ArticlePic: '', //图片
},
//选中IDs
CheckedIds: [],
teacherList:[],//老师的选择
teacherList: [], //老师的选择
rules: {
Name: [{
required: true,
message: '请输入标题',
trigger: 'change'
}],
TeacherId: [{
required: true,
message: '请选择关联老师',
trigger: 'change'
}]
},
inputVisible: false,
inputValue: '',
changeState:false,
imgType:0,
changeState: false,
imgType: 0,
defaultMsg: "",
config: {
initialFrameWidth: null,
......@@ -267,14 +253,14 @@
this.addMsg.ID = myData.ID;
this.addMsg.ArticleStatus = myData.ArticleStatus;
this.addMsg.Sort = myData.Sort;
this.addMsg.ShelvesDate = this.dateFunction(myData.ShelvesDate);
this.addMsg.DownDate = this.dateFunction(myData.DownDate);
this.addMsg.ShelvesDate = myData.ShelvesDate;
this.addMsg.DownDate = myData.DownDate;
this.addMsg.FictitiousBrowseNum = myData.FictitiousBrowseNum;
this.addMsg.Name = myData.Name;
this.addMsg.LableName = myData.LableName;
this.addMsg.IsComment = myData.IsComment;
this.addMsg.Describe = myData.Describe;
if(myData.LableNameList !=null && myData.LableNameList.length>0){
if (myData.LableNameList != null && myData.LableNameList.length > 0) {
this.addMsg.LableNameList = myData.LableNameList;
}
if (this.addMsg.Describe && this.addMsg.Describe != "") {
......@@ -315,9 +301,9 @@
},
//保存
saveMsg() {
if(this.addMsg.ArticlePic==''){
this.Error('请上传图片')
return false
if(this.addMsg.LableNameList.length==0){
this.Error('请选择标签');
return;
}
let content = this.$refs.ue.getUEContent();
this.addMsg.Describe = content;
......@@ -332,7 +318,7 @@
}
})
},
getTeacherList(){
getTeacherList() {
this.apipost("/api/Education/GetTeacherList", {}, res => {
if (res.data.resultCode == 1) {
this.teacherList = res.data.data
......@@ -343,12 +329,6 @@
},
changeSupplier(val) {},
dateFunction(time) {
var zoneDate = new Date(time).toJSON();
var date = new Date(+new Date(zoneDate) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(
/\.[\d]{3}Z/, '');
return date;
},
//单个删除
Delete(item) {
let that = this;
......@@ -401,8 +381,8 @@
}
if (num == 3) {
str = "是否确认删除选中的资讯?";
var mymsg={
Ids:GoodsIds
var mymsg = {
Ids: GoodsIds
}
}
let that = this;
......@@ -411,34 +391,33 @@
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if(num==1||num==2){
if (num == 1 || num == 2) {
this.BatchShevlves(msg);
}
if(num==3){
if (num == 3) {
this.BatchDelete(mymsg);
}
}).catch(() => {
});
}).catch(() => {});
},
//批量上下架
BatchShevlves(msg){
BatchShevlves(msg) {
this.apipost("/api/Education/EnableArticleInfo", msg, res => {
if (res.data.resultCode == 1) {
this.getList();
this.Success(res.data.message);
this.CheckedIds=[];
this.CheckedIds = [];
} else {
this.Error(res.data.message);
}
})
},
//批量删除
BatchDelete(msg){
BatchDelete(msg) {
this.apipost("/api/Education/DelArticleInfo", msg, res => {
if (res.data.resultCode == 1) {
this.getList();
this.Success(res.data.message);
this.CheckedIds=[];
this.CheckedIds = [];
} else {
this.Error(res.data.message);
}
......@@ -467,10 +446,10 @@
openChangeDig(num) {
this.changeState = true;
this.imgType=num;
this.imgType = num;
},
SelectId(msg){
if(this.imgType==1){
SelectId(msg) {
if (this.imgType == 1) {
let url = this.getIconLink(msg.url)
this.addMsg.ArticlePic = url
}
......@@ -517,9 +496,11 @@
.informationManage .w300 {
width: 300px !important;
}
.informationManage .el-tag + .el-tag {
.informationManage .el-tag+.el-tag {
margin-left: 10px;
}
.informationManage .button-new-tag {
margin-left: 10px;
height: 32px;
......@@ -527,6 +508,7 @@
padding-top: 0;
padding-bottom: 0;
}
.informationManage .input-new-tag {
width: 90px;
margin-left: 10px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment