修改版本判断逻辑

This commit is contained in:
liaozetao
2024-02-21 14:57:44 +08:00
parent 80dca35881
commit 49cdeb7407
3 changed files with 94 additions and 44 deletions

View File

@@ -75,7 +75,7 @@
</div>
<div style="margin-bottom: 25px;margin-top: 70px;">
<span style="display: inline-block; margin-right: 20px" class="col-sm-2 control-label">跳转位置</span>
<el-select v-model="resource.skipType" style="width: 75%" placeholder="请选择">
<el-select v-model="resource.skipType" style="width: 75%" placeholder="请选择" :disabled="resource.id != null && resource.skipType == 1">
<el-option v-for="item in options" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
@@ -116,7 +116,7 @@
<span style="display: inline-block; margin-right: 20px" class="col-sm-2 control-label">{{ rule.ruleName
}}</span>
<el-input v-model="resource.ruleValue[rule.ruleCode]" style="width: 75%" class="input"
:placeholder="rule.description" v-if="rule.ruleKind != 'IN'"></el-input>
:placeholder="rule.description" v-if="rule.ruleKind != 'IN' && (!resource.ruleValue['PLATFORM'] || resource.ruleValue['PLATFORM'] == '' || resource.ruleValue['PLATFORM'] == 'null' || (rule.ruleCode == 'IOS_LOW_VERSION' && resource.ruleValue['PLATFORM'] == 'ios') || (rule.ruleCode == 'IOS_HIGH_VERSION' && resource.ruleValue['PLATFORM'] == 'ios') || (rule.ruleCode == 'ANDROID_LOW_VERSION' && resource.ruleValue['PLATFORM'] == 'android') || (rule.ruleCode == 'ANDROID_HIGH_VERSION' && resource.ruleValue['PLATFORM'] == 'android'))"></el-input>
<el-select v-model="resource.ruleValue[rule.ruleCode]" style="width: 75%" placeholder="请选择"
v-if="rule.ruleKind == 'IN'">
<el-option label="全部" :value="''"></el-option>
@@ -354,13 +354,20 @@ export default {
if (endTime) {
this.resource.endTime = new Date(endTime).format("yyyy-MM-dd hh:mm:ss");
}
let id = this.resource.id;
let skipType = this.resource.skipType;
if (!id && skipType == 1) {
$("#tipMsg").text('APP NATIVE不允许新增');
$("#tipModal").modal('show');
return;
}
saveResource({
id: this.resource.id,
code: this.resource.code,
name: this.resource.name,
icon: this.resource.icon,
type: 3,
skipType: this.resource.skipType,
skipType: skipType,
showType: this.resource.showType,
skipContent: this.resource.skipContent,
url: this.resource.url,

View File

@@ -7,13 +7,6 @@
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<!--<div class="col-sm-12">
<label for="roomTab" class="col-sm-2 control-label">房间Tab:</label>
<div class="col-sm-2">
<select name="roomTab" id="roomTab" class="col-sm-2 form-control" data-btn-class="btn-warning" onchange="selectOnTabChange(this)">
</select>
</div>
</div>-->
<div class="col-sm-12">
<label for="erbanNo" class="col-sm-2 control-label">房主平台号:</label>
<div class="col-sm-2">
@@ -82,6 +75,16 @@
<input type="text" class="input-sm form-control datetime" name="topEnd" id="modal_topEnd">
</div>
</div>
<div class="form-group">
<label for="modal_isShow" class="col-sm-3 control-label">是否在App首页展示<font color="red">*</font></label>
<div class="col-sm-9">
<select name="isShow" id="modal_isShow" class="form-control validate[required]">
<option value=""></option>
<option value="1"></option>
<option value="0"></option>
</select>
</div>
</div>
</form>
</div>
<div class="modal-footer">
@@ -130,6 +133,23 @@ export default {
{ field: 'roomUid', title: '房主Uid', align: 'center', width: '5%' },
{ field: 'roomTitle', title: '房间标题', align: 'center', width: '8%' },
{ field: 'roomTag', title: '房间标签', align: 'center', width: '5%' },
{
field: 'isPermitRoom',
title: '房间类型',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
let value = '';
if (val == 1) {
value = '牌照房';
} else if (val == 4) {
value = '个播房';
} else {
value = '非牌照房';
}
return value;
}
},
{
field: 'iconContent',
title: '图标内容',
@@ -140,7 +160,26 @@ export default {
}
},
{
field: 'isTop', title: '是否置顶', align: 'center', valign: 'middle', width: '5%',
field: 'isTop',
title: '是否置顶',
align: 'center',
valign: 'middle',
width: '5%',
formatter: function (val, row, index) {
if (val) {
return '是';
} else {
return '否';
}
}
},
{
field: 'isShow',
title: '是否在App首页展示',
align: 'center',
valign: 'middle',
width: '5%',
formatter: function (val, row, index) {
if (val) {
return '是';
@@ -160,9 +199,7 @@ export default {
width: '10%',
formatter: function (val, row, index) {
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id="' + val + '" data-index="' + index + '">' +
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>' +
'&nbsp;&nbsp;<button class="btn btn-sm btn-danger opt-remove" data-id="' + val +
'" data-index="' + index + '"><i class="glyphicon glyphicon-remove"></i>删除</button>';
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>';
}
}
],
@@ -246,6 +283,7 @@ export default {
iconContent: iconContent,
topStart: topStart,
topEnd: topEnd,
isShow: isShow,
},
dataType: "json",
success: function (json) {
@@ -287,6 +325,7 @@ export default {
$("#modal_isTop").val(json.isTop ? 1 : 0);
$("#modal_topStart").val(formatTime(json.topStart));
$("#modal_topEnd").val(formatTime(json.topEnd));
$("#modal_isShow").val(json.isShow ? 1 : 0);
} else {
$("#tipMsg").text("获取菜单信息出错");
$("#tipModal").modal('show');

View File

@@ -71,14 +71,18 @@
</div>
</div>
<div class="form-group">
<label for="modal_isHome" class="col-sm-3 control-label">首页展示设<font color="red">*</font>
</label>
<label for="modal_topStart" class="col-sm-3 control-label">顶开始时间<font color="red">*</font>
:</label>
<div class="col-sm-9">
<select name="isHome" id="modal_isHome" class="form-control validate[required]">
<option value=""></option>
<option value="1"></option>
<option value="0"></option>
</select>
<input type="text" class="input-sm form-control datetime" name="topStart"
id="modal_topStart">
</div>
</div>
<div class="form-group">
<label for="modal_topEnd" class="col-sm-3 control-label">置顶结束时间<font color="red">*</font>
:</label>
<div class="col-sm-9">
<input type="text" class="input-sm form-control datetime" name="topEnd" id="modal_topEnd">
</div>
</div>
</form>
@@ -92,7 +96,6 @@
</div>
</div>
<!-- 增加房间弹框 -->
<div class="modal fade" id="addRoomTabMapModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
@@ -112,16 +115,6 @@
placeholder="多个平台号使用换行符分隔"></textarea>
</div>
</div>
<!--<div class="form-group">
<label for="modal_isHome2" class="col-sm-3 control-label">首页展示设置<font color="red">*</font></label>
<div class="col-sm-9">
<select name="isHome2" id="modal_isHome2" class="form-control validate[required]">
<option value=""></option>
<option value="1"></option>
<option value="0"></option>
</select>
</div>
</div>-->
</form>
</div>
<div class="modal-footer">
@@ -169,6 +162,23 @@ export default {
{ field: 'erbanNo', title: '房主平台号', align: 'center', width: '5%' },
{ field: 'roomUid', title: '房主Uid', align: 'center', width: '5%' },
{ field: 'roomTitle', title: '房间标题', align: 'center', width: '8%' },
{
field: 'isPermitRoom',
title: '房间类型',
align: 'center',
width: '8%',
formatter: function (val, row, index) {
let value = '';
if (val == 1) {
value = '牌照房';
} else if (val == 4) {
value = '个播房';
} else {
value = '非牌照房';
}
return value;
}
},
{ field: 'roomTag', title: '房间标签', align: 'center', width: '5%' },
{
field: 'isTop', title: '是否置顶', align: 'center', valign: 'middle', width: '5%',
@@ -182,17 +192,6 @@ export default {
}
},
{ field: 'seq', title: '置顶排序', align: 'center', width: '5%' },
/*{
field: 'isHome', title: '首页展示', align: 'center', valign: 'middle', width: '5%',
formatter: function (val, row, index) {
if (val) {
return '是';
} else {
return '否';
}
}
},*/
{
field: 'id',
title: '操作',
@@ -319,7 +318,8 @@ export default {
var seq = $("#modal_seq").val();
var isHome = $("#modal_isHome").val();
var isTop = $("#modal_isTop").val();
var topStart = $('#modal_topStart').val();
var topEnd = $('#modal_topEnd').val();
if ($("#addForm").validationEngine('validate')) {
$.ajax({
type: "post",
@@ -329,6 +329,8 @@ export default {
seq: seq,
isHome: isHome,
isTop: isTop,
topStart: topStart,
topEnd: topEnd,
},
dataType: "json",
success: function (json) {
@@ -364,6 +366,8 @@ export default {
$("#modal_seq").val(json.seq);
$("#modal_isTop").val(json.isTop ? 1 : 0);
$("#modal_isHome").val(json.isHome ? 1 : 0);
$('#modal_topStart').val(json.topStart);
$('#modal_topEnd').val(json.topEnd);
// 打开编辑弹窗
$("#roomTabMapModal").modal('show');
$("#modalLabel").text("编辑");