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

新增是否强制更新

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