文章分类

This commit is contained in:
tianbj 2019-12-17 18:16:35 +08:00
parent 3932bb6bbd
commit 56de943904
4 changed files with 13 additions and 10 deletions

View File

@ -185,7 +185,7 @@
</select> </select>
<!--条件查询--> <!--条件查询-->
<select id="query" resultMap="resultMap"> <select id="query" resultMap="resultMap">
select * from cms_content select ct.* from cms_content ct join cms_category cc on ct.content_category_id=cc.id
<where> <where>
<if test="contentTitle != null and contentTitle != ''"> and content_title like CONCAT('%',#{contentTitle},'%')</if> <if test="contentTitle != null and contentTitle != ''"> and content_title like CONCAT('%',#{contentTitle},'%')</if>
<if test="contentCategoryId != null and contentCategoryId != ''"> and content_category_id=#{contentCategoryId}</if> <if test="contentCategoryId != null and contentCategoryId != ''"> and content_category_id=#{contentCategoryId}</if>
@ -201,12 +201,12 @@
<if test="contentDetails != null and contentDetails != ''"> and content_details=#{contentDetails}</if> <if test="contentDetails != null and contentDetails != ''"> and content_details=#{contentDetails}</if>
<if test="contentUrl != null and contentUrl != ''"> and content_url=#{contentUrl}</if> <if test="contentUrl != null and contentUrl != ''"> and content_url=#{contentUrl}</if>
<if test="contentHit != null"> and content_hit=#{contentHit}</if> <if test="contentHit != null"> and content_hit=#{contentHit}</if>
<if test="appId != null"> and app_id=#{appId} </if> <if test="appId != null"> and ct.app_id=#{appId} </if>
<if test="createBy &gt; 0"> and create_by=#{createBy} </if> <if test="createBy &gt; 0"> and ct.create_by=#{createBy} </if>
<if test="createDate != null"> and create_date=#{createDate} </if> <if test="createDate != null"> and ct.create_date=#{createDate} </if>
<if test="updateBy &gt; 0"> and update_by=#{updateBy} </if> <if test="updateBy &gt; 0"> and ct.update_by=#{updateBy} </if>
<if test="updateDate != null"> and update_date=#{updateDate} </if> <if test="updateDate != null"> and update_date=#{updateDate} </if>
<if test="del != null"> and del=#{del} </if> <if test="del != null"> and ct.del=#{del} </if>
<include refid="net.mingsoft.base.dao.IBaseDao.sqlWhere"></include> <include refid="net.mingsoft.base.dao.IBaseDao.sqlWhere"></include>
</where> </where>
order by id desc order by id desc

View File

@ -213,6 +213,7 @@
}, },
contentCategoryIdOptions: [], contentCategoryIdOptions: [],
returnIsShow: true, returnIsShow: true,
type:'',
//表单数据 //表单数据
form: { form: {
// 文章标题 // 文章标题
@ -274,7 +275,8 @@
this.$refs.form[0].validate((valid) => { this.$refs.form[0].validate((valid) => {
if (valid) { if (valid) {
that.saveDisabled = true; that.saveDisabled = true;
if(that.categoryIdOptions.filter(f => f['id'] == that.form.contentCategoryId)[0].categoryType == '2'){ //判断
if(that.categoryIdOptions.filter(f => f['id'] == that.form.contentCategoryId)[0].categoryType == '2' && that.returnIsShow){
that.$notify({ that.$notify({
title: '提示', title: '提示',
message: '所属栏目不能为封面', message: '所属栏目不能为封面',
@ -487,10 +489,11 @@
this.contentTypeOptionsGet(); this.contentTypeOptionsGet();
this.form.id = ms.util.getParameter("id"); this.form.id = ms.util.getParameter("id");
this.form.contentCategoryId = ms.util.getParameter("categoryId"); this.form.contentCategoryId = ms.util.getParameter("categoryId");
this.type = ms.util.getParameter("type");
if (this.form.id) { if (this.form.id) {
this.get(this.form.id); this.get(this.form.id);
} }
if (this.form.contentCategoryId) { if (this.type) {
this.list(this.form.contentCategoryId); this.list(this.form.contentCategoryId);
this.returnIsShow = false; this.returnIsShow = false;
} }

View File

@ -37,7 +37,7 @@
if(data.categoryType == '1'){ if(data.categoryType == '1'){
this.action = ms.manager +"/cms/content/main.do?categoryId="+data.id; this.action = ms.manager +"/cms/content/main.do?categoryId="+data.id;
} else if(data.categoryType == '2'){ } else if(data.categoryType == '2'){
this.action = ms.manager +"/cms/content/form.do?categoryId="+data.id; this.action = ms.manager +"/cms/content/form.do?categoryId="+data.id+"&type=2";
} else{ } else{
this.action = ms.manager +"/cms/content/main.do"; this.action = ms.manager +"/cms/content/main.do";
} }

View File

@ -239,7 +239,7 @@
if(id){ if(id){
location.href=this.manager+"/cms/content/form.do?id="+id; location.href=this.manager+"/cms/content/form.do?id="+id;
}else { }else {
location.href=this.manager+"/cms/content/form.do"; location.href=this.manager+"/cms/content/form.do?categoryId="+this.form.contentCategoryId;
} }
}, },
//表格数据转换 //表格数据转换