提交 35afd3b8 authored 作者: 吴德鹏's avatar 吴德鹏

新增是否强制更新

上级 84b45a2e
...@@ -33,6 +33,10 @@ public class TbCfVersionEntity implements Serializable { ...@@ -33,6 +33,10 @@ public class TbCfVersionEntity implements Serializable {
* 版本分类(0安卓,1苹果) * 版本分类(0安卓,1苹果)
*/ */
private Integer versionSort; private Integer versionSort;
private Integer status;
/** /**
* 设置:版本号Id * 设置:版本号Id
*/ */
...@@ -46,6 +50,7 @@ public class TbCfVersionEntity implements Serializable { ...@@ -46,6 +50,7 @@ public class TbCfVersionEntity implements Serializable {
public String getVersionId() { public String getVersionId() {
return versionId; return versionId;
} }
/** /**
* 设置:版本code * 设置:版本code
*/ */
...@@ -59,6 +64,7 @@ public class TbCfVersionEntity implements Serializable { ...@@ -59,6 +64,7 @@ public class TbCfVersionEntity implements Serializable {
public String getVersionCode() { public String getVersionCode() {
return versionCode; return versionCode;
} }
/** /**
* 设置:版本更新链接 * 设置:版本更新链接
*/ */
...@@ -72,6 +78,7 @@ public class TbCfVersionEntity implements Serializable { ...@@ -72,6 +78,7 @@ public class TbCfVersionEntity implements Serializable {
public String getVersionLike() { public String getVersionLike() {
return versionLike; return versionLike;
} }
/** /**
* 设置:版本更新内容 * 设置:版本更新内容
*/ */
...@@ -92,10 +99,19 @@ public class TbCfVersionEntity implements Serializable { ...@@ -92,10 +99,19 @@ public class TbCfVersionEntity implements Serializable {
public Integer getVersionSort() { public Integer getVersionSort() {
return versionSort; return versionSort;
} }
/** /**
* 设置: 版本分类(0安卓,1苹果) * 设置: 版本分类(0安卓,1苹果)
*/ */
public void setVersionSort(Integer versionSort) { public void setVersionSort(Integer versionSort) {
this.versionSort = versionSort; this.versionSort = versionSort;
} }
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
} }
...@@ -8,88 +8,94 @@ ...@@ -8,88 +8,94 @@
<result property="versionCode" column="version_code"/> <result property="versionCode" column="version_code"/>
<result property="versionLike" column="version_like"/> <result property="versionLike" column="version_like"/>
<result property="versionDetail" column="version_detail"/> <result property="versionDetail" column="version_detail"/>
<result property="versionSort" column="version_sort"/> <result property="versionSort" column="version_sort"/>
<result property="status" column="status"/>
</resultMap> </resultMap>
<select id="queryObject" resultType="com.platform.entity.TbCfVersionEntity"> <select id="queryObject" resultType="com.platform.entity.TbCfVersionEntity">
select select
`version_id`, `version_id`,
`version_code`, `version_code`,
`version_like`, `version_like`,
`version_detail`, `version_detail`,
`version_sort` `version_sort`,
status
from tb_cf_version from tb_cf_version
where version_id = #{id} where version_id = #{id}
</select> </select>
<select id="queryList" resultType="com.platform.entity.TbCfVersionEntity"> <select id="queryList" resultType="com.platform.entity.TbCfVersionEntity">
select select
`version_id`, `version_id`,
`version_code`, `version_code`,
`version_like`, `version_like`,
`version_detail`, `version_detail`,
`version_sort` `version_sort`,
from tb_cf_version status
WHERE 1=1 from tb_cf_version
<if test="name != null and name.trim() != ''"> WHERE 1=1
AND name LIKE concat('%',#{name},'%') <if test="name != null and name.trim() != ''">
</if> AND name LIKE concat('%',#{name},'%')
</if>
<choose> <choose>
<when test="sidx != null and sidx.trim() != ''"> <when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order} order by ${sidx} ${order}
</when> </when>
<otherwise> <otherwise>
order by version_id desc order by version_id desc
</otherwise> </otherwise>
</choose> </choose>
<if test="offset != null and limit != null"> <if test="offset != null and limit != null">
limit #{offset}, #{limit} limit #{offset}, #{limit}
</if> </if>
</select> </select>
<select id="queryTotal" resultType="int"> <select id="queryTotal" resultType="int">
select count(*) from tb_cf_version select count(*) from tb_cf_version
WHERE 1=1 WHERE 1=1
<if test="name != null and name.trim() != ''"> <if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%') AND name LIKE concat('%',#{name},'%')
</if> </if>
</select> </select>
<insert id="save" parameterType="com.platform.entity.TbCfVersionEntity"> <insert id="save" parameterType="com.platform.entity.TbCfVersionEntity">
insert into tb_cf_version( insert into tb_cf_version(
`version_id`, `version_id`,
`version_code`, `version_code`,
`version_like`, `version_like`,
`version_detail`, `version_detail`,
`version_sort`) `version_sort`,
status)
values( values(
#{versionId}, #{versionId},
#{versionCode}, #{versionCode},
#{versionLike}, #{versionLike},
#{versionDetail}, #{versionDetail},
#{versionSort}) #{versionSort},
#{status})
</insert> </insert>
<update id="update" parameterType="com.platform.entity.TbCfVersionEntity"> <update id="update" parameterType="com.platform.entity.TbCfVersionEntity">
update tb_cf_version update tb_cf_version
<set> <set>
<if test="versionCode != null">`version_code` = #{versionCode}, </if> <if test="versionCode != null">`version_code` = #{versionCode},</if>
<if test="versionSort != null">`version_sort` = #{versionSort}, </if> <if test="versionSort != null">`version_sort` = #{versionSort},</if>
<if test="versionLike != null">`version_like` = #{versionLike}, </if> <if test="versionLike != null">`version_like` = #{versionLike},</if>
<if test="versionDetail != null">`version_detail` = #{versionDetail}</if> <if test="versionDetail != null">`version_detail` = #{versionDetail},</if>
<if test="status != null">`status` = #{status}</if>
</set> </set>
where version_id = #{versionId} where version_id = #{versionId}
</update> </update>
<delete id="delete"> <delete id="delete">
delete from tb_cf_version where version_id = #{value} delete from tb_cf_version where version_id = #{value}
</delete> </delete>
<delete id="deleteBatch">
delete from tb_cf_version where version_id in
<foreach item="versionId" collection="array" open="(" separator="," close=")">
#{versionId}
</foreach>
</delete>
</mapper> <delete id="deleteBatch">
\ No newline at end of file delete from tb_cf_version where version_id in
<foreach item="versionId" collection="array" open="(" separator="," close=")">
#{versionId}
</foreach>
</delete>
</mapper>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#jdbc.password=diaoyun666 #jdbc.password=diaoyun666
jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false jdbc.url: jdbc:mysql://159.138.48.71:3306/test?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
jdbc.username: root jdbc.username: root
jdbc.password: Diaoyunnuli.8 jdbc.password: Diaoyunnuli.8
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#jdbc.password=diaoyun666 #jdbc.password=diaoyun666
jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false jdbc.url: jdbc:mysql://159.138.48.71:3306/test?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
jdbc.username: root jdbc.username: root
jdbc.password: Diaoyunnuli.8 jdbc.password: Diaoyunnuli.8
......
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
<title></title> <title></title>
#parse("sys/header.html") #parse("sys/header.html")
<style> <style>
.ui-jqgrid .ui-jqgrid-bdiv{ .ui-jqgrid .ui-jqgrid-bdiv {
height:auto!important; height: auto !important;
} }
.table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td { .table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td {
border-top: 2px solid #e7eaec; border-top: 2px solid #e7eaec;
line-height: 1.38857; line-height: 1.38857;
...@@ -17,7 +18,7 @@ ...@@ -17,7 +18,7 @@
</head> </head>
<body> <body>
<div id="rrapp" v-cloak style="height: calc(100% - 15px);"> <div id="rrapp" v-cloak style="height: calc(100% - 15px);">
<div v-show="showList" style="height: 100%;"> <div v-show="showList" style="height: 100%;">
<Row :gutter="16"> <Row :gutter="16">
<div class="search-group"> <div class="search-group">
<i-col span="4"> <i-col span="4">
...@@ -39,49 +40,70 @@ ...@@ -39,49 +40,70 @@
</div> </div>
</Row> </Row>
<div id="speedp"></div> <div id="speedp"></div>
<table id="jqGrid"></table> <table id="jqGrid"></table>
</div> </div>
<Card v-show="!showList"> <Card v-show="!showList">
<p slot="title">{{title}}</p> <p slot="title">{{title}}</p>
<i-form ref="formValidate" :model="tbCfVersion" :rules="ruleValidate" :label-width="80"> <i-form ref="formValidate" :model="tbCfVersion" :rules="ruleValidate" :label-width="80">
<Form-item label="版本code" prop="versionCode"> <Form-item label="版本code" prop="versionCode" style="width:800px">
<i-input v-model="tbCfVersion.versionCode" placeholder="版本code"/> <i-input v-model="tbCfVersion.versionCode" placeholder="版本code"/>
</Form-item> </Form-item>
<Form-item label="版本分类" prop="versionSort"> <!-- <Form-item label="版本分类" prop="versionSort" style="width:800px">
<i-select placeholder="版本分类" v-model="tbCfVersion.versionSort"> <i-select placeholder="版本分类" v-model="tbCfVersion.versionSort">
<i-option value="0">安卓</i-option> <i-option value="0">安卓</i-option>
<i-option value="1">苹果</i-option> <i-option value="1">苹果</i-option>
</i-select>
</Form-item>
<Form-item label="是否强制更新" prop="status" style="width:800px">
<i-select placeholder="是否强制更新" v-model="tbCfVersion.status">
<i-option value="1">是</i-option>
<i-option value="0">否</i-option>
</i-select>
</Form-item>-->
<Form-item label="版本分类" prop="versionSort" style="width:800px">
<i-select placeholder="请选择" v-model="tbCfVersion.versionSort">
<i-option v-for=" e in versionList"
:value="e.value">{{e.label}}
</i-option>
</i-select>
</Form-item>
<Form-item label="是否强制更新" prop="status" style="width:800px">
<i-select placeholder="请选择" v-model="tbCfVersion.status">
<i-option v-for=" e in statusList"
:value="e.value">{{e.label}}
</i-option>
</i-select> </i-select>
</Form-item> </Form-item>
<Form-item label="版本更新链接" prop="versionLike"> <Form-item label="版本更新链接" prop="versionLike" style="width:800px">
<i-input v-model="tbCfVersion.versionLike" placeholder="版本更新链接"/> <i-input v-model="tbCfVersion.versionLike" placeholder="版本更新链接"/>
</Form-item> </Form-item>
<Form-item label="版本更新内容" prop="versionDetail"> <Form-item label="版本更新内容" prop="versionDetail" style="width:800px">
<!-- <script id="Detail" name="tbCfVersion.versionDetail"type="text/plain">${pd.COLLSORT_DETAILS}</script>--> <!-- <script id="Detail" name="tbCfVersion.versionDetail"type="text/plain">${pd.COLLSORT_DETAILS}</script>-->
<textarea id="Detail" style="width: 800px;height: 600px;"></textarea> <textarea id="Detail" style="width: 800px;height: 600px;"></textarea>
</Form-item> </Form-item>
<Form-item> <Form-item>
<i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button> <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
<i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button> <i-button type="warning" @click="reload" style="margin-left: 8px"/>
返回</i-button>
<i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button> <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
</Form-item> </Form-item>
</i-form> </i-form>
</Card> </Card>
</div> </div>
<script src="${rc.contextPath}/js/sys/tbcfversion.js?_${date.systemTime}"></script> <script src="${rc.contextPath}/js/sys/tbcfversion.js?_${date.systemTime}"></script>
<script type="text/javascript"> <script type="text/javascript">
var content = UE.getEditor('Detail'); var content = UE.getEditor('Detail');
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl; UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action){ UE.Editor.prototype.getActionUrl = function (action) {
if(action == 'uploadimage' || action == 'uploadscrawl' || action == 'uploadimage'){ if (action == 'uploadimage' || action == 'uploadscrawl' || action == 'uploadimage') {
return '${rc.contextPath}/api/osstest/uploaditemimage'; return '${rc.contextPath}/api/osstest/uploaditemimage';
}else{ } else {
return this._bkGetActionUrl.call(this, action); return this._bkGetActionUrl.call(this, action);
} }
}; };
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -2,119 +2,142 @@ $(function () { ...@@ -2,119 +2,142 @@ $(function () {
$("#jqGrid").Grid({ $("#jqGrid").Grid({
url: '../tbcfversion/list', url: '../tbcfversion/list',
colModel: [ colModel: [
{label: 'versionId', name: 'versionId', index: 'version_id', key: true, hidden: true}, {label: 'versionId', name: 'versionId', index: 'version_id', key: true, hidden: true},
{label: '版本code', name: 'versionCode', index: 'version_code', width: 80}, {label: '版本code', name: 'versionCode', index: 'version_code', width: 80},
{label: '版本更新链接', name: 'versionLike', index: 'version_like', width: 80}, {label: '版本更新链接', name: 'versionLike', index: 'version_like', width: 80},
{label: '版本更新内容', name: 'versionDetail', index: 'version_detail', width: 80}, {label: '版本更新内容', name: 'versionDetail', index: 'version_detail', width: 80},
{label: '版本分类', name: 'versionSort', index: 'version_sort', width: 80,formatter:sortFormat}], {label: '版本分类', name: 'versionSort', index: 'version_sort', width: 80, formatter: sortFormat},
shrinkToFit: true, {label: '是否强制更新', name: 'status', index: 'status', width: 80, formatter: yesOrNoFormat},],
datatype : "json", shrinkToFit: true,
rowNum:15, datatype: "json",
rowList:[15,30,45], rowNum: 15,
mtype: "POST", rowList: [15, 30, 45],
rownumbers: true, mtype: "POST",
rownumWidth: 40, rownumbers: true,
gridview: true, rownumWidth: 40,
pager: '#speedp', gridview: true,
sortname: 'version_code', pager: '#speedp',
viewrecords: true, sortname: 'version_code',
sortorder: "desc" viewrecords: true,
sortorder: "desc"
}); });
}); });
let vm = new Vue({ let vm = new Vue({
el: '#rrapp', el: '#rrapp',
data: { data: {
showList: true, showList: true,
title: null, title: null,
tbCfVersion: {}, statusList: [
ruleValidate: { {
name: [ value: 1,
{required: true, message: '名称不能为空', trigger: 'blur'} label: '是'
] },
}, {
q: { value: 0,
name: '' label: '否'
} }
}, ],
methods: { versionList: [
query: function () { {
vm.reload(); value: 1,
}, label: 'ios'
add: function () { },
vm.showList = false; {
vm.title = "新增"; value: 0,
vm.tbCfVersion = {}; label: 'android'
UE.getEditor('Detail').setContent(""); // 富文本赋值 }
}, ],
update: function (event) { tbCfVersion: {},
let versionId = getSelectedRow("#jqGrid"); ruleValidate: {
if (versionId == null) { name: [
return; {required: true, message: '名称不能为空', trigger: 'blur'}
} ]
vm.showList = false; },
q: {
name: ''
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfVersion = {};
UE.getEditor('Detail').setContent(""); // 富文本赋值
},
update: function (event) {
let versionId = getSelectedRow("#jqGrid");
if (versionId == null) {
return;
}
vm.showList = false;
vm.title = "修改"; vm.title = "修改";
vm.getInfo(versionId); vm.getInfo(versionId);
}, },
saveOrUpdate: function (event) { saveOrUpdate: function (event) {
vm.tbCfVersion.versionDetail = encodeURI(UE.getEditor('Detail').getContent()); // 富文本取值 vm.tbCfVersion.versionDetail = encodeURI(UE.getEditor('Detail').getContent()); // 富文本取值
vm.tbCfVersion.versionDetail = vm.tbCfVersion.versionDetail.replace(/&nbsp;/g, " "); vm.tbCfVersion.versionDetail = vm.tbCfVersion.versionDetail.replace(/&nbsp;/g, " ");
let url = vm.tbCfVersion.versionId == null ? "../tbcfversion/save" : "../tbcfversion/update"; let url = vm.tbCfVersion.versionId == null ? "../tbcfversion/save" : "../tbcfversion/update";
Ajax.request({ Ajax.request({
url: url, url: url,
params: JSON.stringify(vm.tbCfVersion), params: JSON.stringify(vm.tbCfVersion),
type: "POST", type: "POST",
contentType: "application/json", contentType: "application/json",
successCallback: function (r) { successCallback: function (r) {
alert('操作成功', function (index) { alert('操作成功', function (index) {
vm.reload(); vm.reload();
}); });
} }
}); });
}, },
del: function (event) { del: function (event) {
let versionIds = getSelectedRows("#jqGrid"); let versionIds = getSelectedRows("#jqGrid");
if (versionIds == null){ if (versionIds == null) {
return; return;
} }
confirm('确定要删除选中的记录?', function () { confirm('确定要删除选中的记录?', function () {
Ajax.request({ Ajax.request({
url: "../tbcfversion/delete", url: "../tbcfversion/delete",
params: JSON.stringify(versionIds), params: JSON.stringify(versionIds),
type: "POST", type: "POST",
contentType: "application/json", contentType: "application/json",
successCallback: function () { successCallback: function () {
alert('操作成功', function (index) { alert('操作成功', function (index) {
vm.reload(); vm.reload();
}); });
} }
}); });
}); });
}, },
getInfo: function(versionId){ getInfo: function (versionId) {
Ajax.request({ Ajax.request({
url: "../tbcfversion/info/"+versionId, url: "../tbcfversion/info/" + versionId,
async: false, async: false,
successCallback: function (r) { successCallback: function (r) {
vm.tbCfVersion = r.tbCfVersion; vm.tbCfVersion = r.tbCfVersion;
UE.getEditor('Detail').setContent(vm.tbCfVersion.versionDetail); // 富文本赋值 UE.getEditor('Detail').setContent(vm.tbCfVersion.versionDetail); // 富文本赋值
console.log(vm.tbCfVersion); console.log(vm.tbCfVersion);
} }
}); });
}, },
reload: function (event) { reload: function (event) {
vm.showList = true; vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page'); let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', { $("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name}, postData: {'name': vm.q.name},
page: page page: page
}).trigger("reloadGrid"); }).trigger("reloadGrid");
vm.handleReset('formValidate'); vm.handleReset('formValidate');
}, },
reloadSearch: function() { reloadSearch: function () {
vm.q = { vm.q = {
name: '' name: ''
}; };
...@@ -128,5 +151,5 @@ let vm = new Vue({ ...@@ -128,5 +151,5 @@ let vm = new Vue({
handleReset: function (name) { handleReset: function (name) {
handleResetForm(this, name); handleResetForm(this, name);
} }
} }
}); });
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论