|
@@ -17,11 +17,12 @@
|
|
|
<tr>
|
|
|
<td class="l" width="150">文章标题 <span>*</span></td>
|
|
|
<td>
|
|
|
- <input type="text" class="form-control" v-model="item.mTitle" placeholder="输入文章标题">
|
|
|
+ <input type="text" class="form-control" name="mTitle" v-model="item.mTitle" placeholder="输入文章标题">
|
|
|
</td>
|
|
|
- <td class="l">发布时间 <span>*</span></td>
|
|
|
+ <td class="l" width="150">发布时间 <span>*</span></td>
|
|
|
<td>
|
|
|
- <input type="date" class="form-control" placeholder="输入文章标题">
|
|
|
+ <input type="text" class="form-control input-text Wdate" value="#(time)"
|
|
|
+ onfocus="WdatePicker({maxDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="max">
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
@@ -34,11 +35,11 @@
|
|
|
<td class="l">文章栏目 <span>*</span></td>
|
|
|
<td>
|
|
|
<select class="form-control" v-model="item.columnId">
|
|
|
- <option :value="colmun.id" v-for="colmun in colmun_list">{{colmun.mColumnName}}</option>
|
|
|
+ <option :value="c.id" v-for="c in colmun_list">{{c.mColumnName}}</option>
|
|
|
</select>
|
|
|
</td>
|
|
|
</tr>
|
|
|
- <!--<tr>
|
|
|
+<!-- <tr>
|
|
|
<td width="150">文章封面</td>
|
|
|
<td colspan="3" style="overflow: hidden;">
|
|
|
<img class="img" alt="添加封面" :src="mCove==''?'#(path)/static/ui/img/icon_p.png':mCove">
|
|
@@ -46,12 +47,13 @@
|
|
|
</td>
|
|
|
</tr>-->
|
|
|
<tr>
|
|
|
- <td class="l">文章状态 <span>*</span></td>
|
|
|
+ <td class="l">文章发布
|
|
|
+ <span>*</span></td>
|
|
|
<td>
|
|
|
<el-switch
|
|
|
- v-model="item.isTop"
|
|
|
+ v-model="item.mRelease"
|
|
|
active-color="#13ce66"
|
|
|
- inactive-color="#ff4949">
|
|
|
+ >
|
|
|
</el-switch>
|
|
|
</td>
|
|
|
<td class="l">文章置顶</td>
|
|
@@ -59,10 +61,18 @@
|
|
|
<el-switch
|
|
|
v-model="item.isTop"
|
|
|
active-color="#13ce66"
|
|
|
- inactive-color="#ff4949">
|
|
|
+ >
|
|
|
</el-switch>
|
|
|
</td>
|
|
|
</tr>
|
|
|
+ #if(shiro.hasPermission('news:audit'))
|
|
|
+ <tr>
|
|
|
+ <td class="l" style="vertical-align: top;">文章审核 <span>*</span></td>
|
|
|
+ <td colspan="3">
|
|
|
+ <label class="spa" :class="{active:item.mAudit==index}" v-for="(audit,index) in audit_list" @click="item.mAudit=index">{{audit}}</label>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ #end
|
|
|
<tr>
|
|
|
<td class="l" style="vertical-align: top;">文章内容 <span>*</span></td>
|
|
|
<td colspan="3"><script id="editor" type="text/plain" style="width:100%;height:280px;text-align: left">{{item.mContent}}</script></td>
|
|
@@ -81,7 +91,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-#set(layer=true,util=true,vue=true,cropper=true,element=true,ueditor=true)
|
|
|
+#set(layer=true,util=true,vue=true,cropper=true,element=true,ueditor=true,date=true)
|
|
|
#@op()
|
|
|
#@js()
|
|
|
<script>
|
|
@@ -93,34 +103,44 @@
|
|
|
var vm = new Vue({
|
|
|
el: "#app",
|
|
|
data: {
|
|
|
+ audit_list:['待审核','审核通过','审核不通过'],
|
|
|
type_list:[{name:'时政信息',id:1},{name:'政策宣传',id:2}],
|
|
|
colmun_list:[],
|
|
|
- item: {mTitle:'',mContent:'',typeName:1,mRelease:0,columnId:1,isTop:false,mCove:''},
|
|
|
+ item: {mTitle:'',mContent:'',typeName:1,mRelease:true,columnId:1,isTop:false,mAudit:0,mCove:'',mTime:''},
|
|
|
show: false,
|
|
|
mCove: '',
|
|
|
dataImage: '',
|
|
|
- dialogVisible:false
|
|
|
+ select:false,
|
|
|
+ columnId:0,
|
|
|
},
|
|
|
mounted: function () {
|
|
|
- if ('#(op)' == 'edit') {
|
|
|
- //this.item =#(banner);
|
|
|
- //this.mCove = this.item.mCove;
|
|
|
- //this.item.mShow=this.item.mShow==0?true:false;
|
|
|
+ if ('#(op)' == 'edit'||'#(op)' == 'audit') {
|
|
|
+ this.item =#(news);
|
|
|
+ this.item.typeName=this.item.typeName=='时政信息'?1:2;
|
|
|
+ this.item.mRelease=this.item.mRelease==0?true:false;
|
|
|
+ this.item.isTop=this.item.isTop==0?false:true;
|
|
|
+ this.now=this.item.mAudit;
|
|
|
+ this.columnId=this.item.columnId;
|
|
|
}
|
|
|
- this.item.isTop=this.item.isTop==true?1:0;
|
|
|
- this.getColmun(1);
|
|
|
+ this.getColmun(this.item.typeName);
|
|
|
},
|
|
|
methods: {
|
|
|
//选择分类
|
|
|
selected:function(){
|
|
|
+ this.select=true;
|
|
|
this.getColmun(vm.item.typeName);
|
|
|
},
|
|
|
//选择栏目
|
|
|
getColmun:function(e){
|
|
|
+ console.log("zx4:"+this.item.columnId);
|
|
|
sendAjax("#(path)/admin/work/news/colmun_list",{type:e},function(res){
|
|
|
- vm.colmun_list=res;
|
|
|
- vm.item.columnId=res[0].id;
|
|
|
cancelLoding();
|
|
|
+ vm.colmun_list=res;
|
|
|
+ if(vm.select){
|
|
|
+ vm.item.columnId=res[0].id;
|
|
|
+ }else{
|
|
|
+ vm.item.columnId=vm.columnId;
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
//创建列表
|
|
@@ -165,10 +185,12 @@
|
|
|
}
|
|
|
})
|
|
|
$("#add").click(function () {
|
|
|
- vm.item.isTop=vm.item.isTop==true?1:0;
|
|
|
- vm.item.mContent=ue.getContent();
|
|
|
- var data = {news: JSON.stringify(vm.item)};
|
|
|
- ajaxSubmit("#(path)/admin/work/news/#(op)", data);
|
|
|
+ vm.item.isTop = vm.item.isTop == true ? 1 : 0;
|
|
|
+ vm.item.mRelease = vm.item.mRelease == true ? 0 :1;
|
|
|
+ vm.item.mContent = ue.getContent();
|
|
|
+ vm.item.mTime=$('#max').val();
|
|
|
+ var data = {news: JSON.stringify(vm.item)};
|
|
|
+ ajaxSubmit("#(path)/admin/work/news/#(op)", data);
|
|
|
});
|
|
|
</script>
|
|
|
</body>
|