修改资源位多分区
This commit is contained in:
@@ -34,6 +34,16 @@
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="addForm">
|
||||
<input type="hidden" name="id" id="id" />
|
||||
<div class="form-group">
|
||||
<label for="partitionId" class="col-sm-3 control-label">选择地区:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="partitionId" id="partitionId" class="col-sm-3 form-control">
|
||||
<option value="1">英语区</option>
|
||||
<option value="2">阿拉伯语区</option>
|
||||
<option value="4">华语区</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!--A策略-->
|
||||
<div class="form-group">
|
||||
<label for="resourceA" class="col-sm-3 control-label">A策略<font color="red">*</font>:</label>
|
||||
@@ -169,6 +179,25 @@ export default {
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'id', title: '序号', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'partitionId',
|
||||
title: '地区',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
let value = '';
|
||||
if ((val & 1) != 0) {
|
||||
value += '英语区<br>';
|
||||
}
|
||||
if ((val & 2) != 0) {
|
||||
value += '阿拉伯语区<br>';
|
||||
}
|
||||
if ((val & 4) != 0) {
|
||||
value += '华语区<br>';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'resourceA',
|
||||
title: 'A',
|
||||
@@ -216,10 +245,10 @@ export default {
|
||||
width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
if (row.isDefault) return '';
|
||||
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
|
||||
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>' +
|
||||
' <button class="btn btn-sm btn-danger opt-remove" data-id=' + val +
|
||||
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
|
||||
' <button class="btn btn-sm btn-danger opt-remove" data-id="' + val +
|
||||
'" data-index="' + index + '"><i class="glyphicon glyphicon-remove"></i>删除</button>';
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -295,6 +324,7 @@ export default {
|
||||
|
||||
var beginTime = $("#beginTime").val();
|
||||
var endTime = $("#endTime").val();
|
||||
var partitionId = $('#partitionId').val();
|
||||
|
||||
if (iconA == null || iconA == '') {
|
||||
$("#tipMsg").text("保存失败,请先上传图片!");
|
||||
@@ -321,7 +351,8 @@ export default {
|
||||
contentA: contentA,
|
||||
contentB: contentB,
|
||||
beginTime: beginTime,
|
||||
endTime: endTime
|
||||
endTime: endTime,
|
||||
partitionId: partitionId,
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
@@ -343,13 +374,18 @@ export default {
|
||||
});
|
||||
|
||||
$("#table").on("click", '.opt-edit', function () {
|
||||
const currentData = $('#table').bootstrapTable('getData')[$(this).data('index')];
|
||||
let partitionId = currentData.partitionId;
|
||||
var seq = $(this).attr("data-id");
|
||||
clearModal();
|
||||
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/home/resource/getResourceByStrategySeq",
|
||||
data: { seq: seq },
|
||||
data: {
|
||||
seq: seq,
|
||||
partitionId: partitionId,
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
var json = res.data;
|
||||
@@ -383,6 +419,8 @@ export default {
|
||||
$('#iconUrlB').val(json.iconB);
|
||||
$('#iconImgUrlB').attr('src', json.iconB);
|
||||
|
||||
$('#partitionId').val(json.partitionId);
|
||||
|
||||
// 打开编辑弹窗
|
||||
$("#roomTagModal").modal('show');
|
||||
$("#modalLabel").text("编辑房间标签");
|
||||
@@ -395,6 +433,8 @@ export default {
|
||||
});
|
||||
|
||||
$("#table").on("click", '.opt-remove', function () {
|
||||
const currentData = $('#table').bootstrapTable('getData')[$(this).data('index')];
|
||||
let partitionId = currentData.partitionId;
|
||||
var seq = $(this).attr("data-id");
|
||||
if (seq == 'undefined') {
|
||||
$("#tipMsg").text("id参数有误");
|
||||
@@ -405,7 +445,10 @@ export default {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "/admin/home/resource/deleteByStrategySeq",
|
||||
data: { seq: seq },
|
||||
data: {
|
||||
seq: seq,
|
||||
partitionId: partitionId,
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
|
Reference in New Issue
Block a user