新增多分区选择分区逻辑
This commit is contained in:
@@ -32,6 +32,10 @@
|
||||
<option value="1">未启用</option>
|
||||
</select>
|
||||
</div>
|
||||
<label for="partitionId" class="col-sm-1 control-label">地区:</label>
|
||||
<div class="col-sm-3">
|
||||
<select name="partitionId" id="partitionId" class="form-control"></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12">
|
||||
@@ -59,6 +63,14 @@
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="carGoodsForm">
|
||||
<input type="hidden" name="id" id="id" />
|
||||
<div class="form-group">
|
||||
<label for="partitionFlag" class="col-sm-4 control-label">选择分区</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="checkbox" name="partitionFlag" value="1"/>英语区<br>
|
||||
<input type="checkbox" name="partitionFlag" value="2"/>阿拉伯语区<br>
|
||||
<input type="checkbox" name="partitionFlag" value="4"/>华语区<br>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="carGoodsType" class="col-sm-3 control-label">座驾类型:</label>
|
||||
<div class="col-sm-9">
|
||||
@@ -386,6 +398,8 @@
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import ComboboxHelper from '@/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper';
|
||||
import { getPartitionInfoList } from '@/api/partition/partitionInfo';
|
||||
import { buildSelectOption } from '@/utils/system-helper';
|
||||
|
||||
export default {
|
||||
name: "CarGoodsAdminView",
|
||||
@@ -394,6 +408,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initPartition();
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
@@ -422,6 +437,25 @@ export default {
|
||||
{field: 'name.zh', title: '座驾名称', align: 'center', width: '20%'},
|
||||
{field: 'name.ar', title: '阿语座驾名称', align: 'center', width: '20%'},
|
||||
{field: 'name.en', title: '英语座驾名称', align: 'center', width: '20%'},
|
||||
{
|
||||
field: 'partitionFlag',
|
||||
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: 'carGoodsType', title: '座驾类型', align: 'center', width: '20%',
|
||||
formatter: function (val) {
|
||||
@@ -537,7 +571,8 @@ export default {
|
||||
searchText: params.searchText,
|
||||
carGoodsName: $("#query_carGoodsName").val(),
|
||||
carGoodsType: $("#query_carGoodsType").val(),
|
||||
enable: $("condition_type").val()
|
||||
enable: $("condition_type").val(),
|
||||
partitionId: $('#partitionId').val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
@@ -642,7 +677,10 @@ export default {
|
||||
$("input:radio[name='isMonsterLimit']")[0].checked = true;
|
||||
$("input:radio[name='isWeekStarLimit']")[0].checked = true;
|
||||
$("input:radio[name='isActivityLimit']")[0].checked = true;
|
||||
|
||||
|
||||
$('input[name="partitionFlag"]').each(function() {
|
||||
$(this).checked = false;
|
||||
});
|
||||
$("#nobleId").btComboBox('disable');
|
||||
ComboboxHelper.setDef("#nobleId", '0');
|
||||
|
||||
@@ -925,6 +963,24 @@ export default {
|
||||
$("#viewFileInfo").html('未上传');
|
||||
}
|
||||
|
||||
//分区
|
||||
let partitionFlag = json.entity.partitionFlag;
|
||||
if (partitionFlag & 1 != 0) {
|
||||
$("input:radio[name='partitionFlag']")[0].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='partitionFlag']")[0].checked = false;
|
||||
}
|
||||
if (partitionFlag & 2 != 0) {
|
||||
$("input:radio[name='partitionFlag']")[1].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='partitionFlag']")[1].checked = false;
|
||||
}
|
||||
if (partitionFlag & 4 != 0) {
|
||||
$("input:radio[name='partitionFlag']")[2].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='partitionFlag']")[2].checked = false;
|
||||
}
|
||||
|
||||
// 打开编辑弹窗
|
||||
$("#cardGoodsModal").modal('show');
|
||||
} else {
|
||||
@@ -1009,7 +1065,14 @@ export default {
|
||||
const nameValue = JSON.stringify(jsonName);
|
||||
// 修改属性值
|
||||
formData.name = nameValue; // 将giftName修改为"newGiftName"
|
||||
|
||||
//分区
|
||||
const partitionFlagArray = $("input:checkbox[name='partitionFlag']:checked").serializeArray();
|
||||
let partitionFlag = 0;
|
||||
for (let i = 0, len = partitionFlagArray.length; i < len; i++) {
|
||||
console.log(partitionFlagArray[i]);
|
||||
partitionFlag |= partitionFlagArray[i].value;
|
||||
}
|
||||
formData.partitionFlag = partitionFlag;
|
||||
// 将修改后的对象转换回序列化字符串
|
||||
let newSerializeStr = $.param(formData);
|
||||
$.ajax({
|
||||
@@ -1096,9 +1159,23 @@ export default {
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
initPartition() {
|
||||
getPartitionInfoList().then(res => {
|
||||
let data = res.data;
|
||||
buildSelectOption(
|
||||
"#partitionId",
|
||||
null,
|
||||
data.map((v) => {
|
||||
return {
|
||||
value: v.id,
|
||||
text: v.desc,
|
||||
};
|
||||
})
|
||||
);
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@@ -23,7 +23,11 @@
|
||||
|
||||
<label for="name" class="col-sm-1 control-label">气泡名称:</label>
|
||||
<div class="col-sm-2"><input type="text" class="form-control" name="name" id="name"></div>
|
||||
|
||||
|
||||
<label for="partitionId" class="col-sm-1 control-label">地区:</label>
|
||||
<div class="col-sm-2">
|
||||
<select name="partitionId" id="partitionId" class="form-control"></select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
@@ -53,6 +57,14 @@
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="addForm">
|
||||
<input type="hidden" name="id" id="modal_id" />
|
||||
<div class="form-group">
|
||||
<label for="partitionFlag" class="col-sm-4 control-label">选择分区</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="checkbox" name="partitionFlag" value="1"/>英语区<br>
|
||||
<input type="checkbox" name="partitionFlag" value="2"/>阿拉伯语区<br>
|
||||
<input type="checkbox" name="partitionFlag" value="4"/>华语区<br>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="modal_type" class="col-sm-4 control-label">装扮类型:</label>
|
||||
<div class="col-sm-6">
|
||||
@@ -167,6 +179,8 @@
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import { getPartitionInfoList } from '@/api/partition/partitionInfo';
|
||||
import { buildSelectOption } from '@/utils/system-helper';
|
||||
|
||||
export default {
|
||||
name: "ChatbubbleManageView",
|
||||
@@ -175,6 +189,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initPartition();
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
@@ -185,6 +200,25 @@ export default {
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'id', title: '装扮id', align: 'middle', width: '5%' },
|
||||
{
|
||||
field: 'partitionFlag',
|
||||
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: 'name.zh', title: '装扮名称', align: 'middle', width: '5%'},
|
||||
{field: 'name.ar', title: '阿语装扮名称', align: 'middle', width: '5%'},
|
||||
{field: 'name.en', title: '英语装扮名称', align: 'middle', width: '5%'},
|
||||
@@ -275,6 +309,7 @@ export default {
|
||||
type: $('#type').val(),
|
||||
name: $('#name').val(),
|
||||
id: $('#id').val(),
|
||||
partitionId: $('#partitionId').val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
@@ -333,6 +368,23 @@ export default {
|
||||
$('#addIosIconPicUrl').attr("src", row.iosUrl);
|
||||
$("#addForm #iosUrl").val(row.iosUrl);
|
||||
$("#addForm #status").val(row.status);
|
||||
//分区
|
||||
let partitionFlag = row.partitionFlag;
|
||||
if (partitionFlag & 1 != 0) {
|
||||
$("input:radio[name='partitionFlag']")[0].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='partitionFlag']")[0].checked = false;
|
||||
}
|
||||
if (partitionFlag & 2 != 0) {
|
||||
$("input:radio[name='partitionFlag']")[1].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='partitionFlag']")[1].checked = false;
|
||||
}
|
||||
if (partitionFlag & 4 != 0) {
|
||||
$("input:radio[name='partitionFlag']")[2].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='partitionFlag']")[2].checked = false;
|
||||
}
|
||||
$("#addModal").modal('show');
|
||||
});
|
||||
|
||||
@@ -389,7 +441,14 @@ export default {
|
||||
const nameValue = JSON.stringify(jsonName);
|
||||
// 修改属性值
|
||||
formData.name = nameValue; // 将giftName修改为"newGiftName"
|
||||
|
||||
//分区
|
||||
const partitionFlagArray = $("input:checkbox[name='partitionFlag']:checked").serializeArray();
|
||||
let partitionFlag = 0;
|
||||
for (let i = 0, len = partitionFlagArray.length; i < len; i++) {
|
||||
console.log(partitionFlagArray[i]);
|
||||
partitionFlag |= partitionFlagArray[i].value;
|
||||
}
|
||||
formData.partitionFlag = partitionFlag;
|
||||
// 将修改后的对象转换回序列化字符串
|
||||
let newSerializeStr = $.param(formData);
|
||||
//做下数据校验
|
||||
@@ -449,6 +508,9 @@ export default {
|
||||
$('#modal_name').val('');
|
||||
$('#ar_modal_name').val('');
|
||||
$('#en_modal_name').val('');
|
||||
$('input[name="partitionFlag"]').each(function() {
|
||||
$(this).checked = false;
|
||||
});
|
||||
}
|
||||
//判断空值
|
||||
function isEmpty(data) {
|
||||
@@ -540,9 +602,23 @@ export default {
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
initPartition() {
|
||||
getPartitionInfoList().then(res => {
|
||||
let data = res.data;
|
||||
buildSelectOption(
|
||||
"#partitionId",
|
||||
null,
|
||||
data.map((v) => {
|
||||
return {
|
||||
value: v.id,
|
||||
text: v.desc,
|
||||
};
|
||||
})
|
||||
);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@@ -37,7 +37,12 @@
|
||||
<option value="0">下架</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label for="partitionId" class="col-sm-1 control-label">地区:</label>
|
||||
<div class="col-sm-2">
|
||||
<select name="partitionId" id="partitionId" class="form-control"></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12">
|
||||
<button id="btnSearch" class="btn btn-default">
|
||||
@@ -64,6 +69,14 @@
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="addForm">
|
||||
<input type="hidden" name="headwearId" id="headwearId" />
|
||||
<div class="form-group">
|
||||
<label for="partitionFlag" class="col-sm-4 control-label">选择分区</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="checkbox" name="partitionFlag" value="1"/>英语区<br>
|
||||
<input type="checkbox" name="partitionFlag" value="2"/>阿拉伯语区<br>
|
||||
<input type="checkbox" name="partitionFlag" value="4"/>华语区<br>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="headwearName" class="col-sm-3 control-label">头饰名称:</label>
|
||||
<div class="col-sm-9">
|
||||
@@ -303,6 +316,8 @@
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import { getPartitionInfoList } from '@/api/partition/partitionInfo';
|
||||
import { buildSelectOption } from '@/utils/system-helper';
|
||||
|
||||
export default {
|
||||
name: "HeadwearAdminView",
|
||||
@@ -345,6 +360,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initPartition();
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
@@ -361,6 +377,25 @@ export default {
|
||||
{field: 'name.zh', title: '头饰名称', align: 'center', width: '5%'},
|
||||
{field: 'name.ar', title: '阿语头饰名称', align: 'center', width: '5%'},
|
||||
{field: 'name.en', title: '英语头饰名称', align: 'center', width: '5%'},
|
||||
{
|
||||
field: 'partitionFlag',
|
||||
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: 'goldSale',
|
||||
title: '金币购买',
|
||||
@@ -544,6 +579,7 @@ export default {
|
||||
headwearName: $('#sheadwearName').val(),
|
||||
limitType: $('#slimitType').val(),
|
||||
enable: $('#senable').val(),
|
||||
partitionId: $('#partitionId').val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
@@ -622,7 +658,10 @@ export default {
|
||||
$("input:radio[name='goldSale']")[0].checked = true;
|
||||
$("input:radio[name='radishSale']")[0].checked = true;
|
||||
$("input:radio[name='labelType']")[0].checked = true;
|
||||
|
||||
|
||||
$('input[name="partitionFlag"]').each(function() {
|
||||
$(this).checked = false;
|
||||
});
|
||||
$("#headwearModal").modal('show');
|
||||
});
|
||||
|
||||
@@ -658,6 +697,13 @@ export default {
|
||||
var radishPrice = $("#radishPrice").val();
|
||||
var radishRenewPrice = $("#radishRenewPrice").val();
|
||||
|
||||
//分区
|
||||
const partitionFlagArray = $("input:checkbox[name='partitionFlag']:checked").serializeArray();
|
||||
let partitionFlag = 0;
|
||||
for (let i = 0, len = partitionFlagArray.length; i < len; i++) {
|
||||
console.log(partitionFlagArray[i]);
|
||||
partitionFlag |= partitionFlagArray[i].value;
|
||||
}
|
||||
if (goldSale == 0 && radishSale == 0) {
|
||||
$("#tipMsg").text("请选择一种支持的购买方式");
|
||||
$("#tipModal").modal('show');
|
||||
@@ -716,7 +762,8 @@ export default {
|
||||
radishSale: radishSale,
|
||||
radishOriginalPrice: radishOriginalPrice,
|
||||
radishPrice: radishPrice,
|
||||
radishRenewPrice: radishRenewPrice
|
||||
radishRenewPrice: radishRenewPrice,
|
||||
partitionFlag: partitionFlag,
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
@@ -863,6 +910,24 @@ export default {
|
||||
break
|
||||
}
|
||||
|
||||
//分区
|
||||
let partitionFlag = json.partitionFlag;
|
||||
if (partitionFlag & 1 != 0) {
|
||||
$("input:radio[name='partitionFlag']")[0].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='partitionFlag']")[0].checked = false;
|
||||
}
|
||||
if (partitionFlag & 2 != 0) {
|
||||
$("input:radio[name='partitionFlag']")[1].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='partitionFlag']")[1].checked = false;
|
||||
}
|
||||
if (partitionFlag & 4 != 0) {
|
||||
$("input:radio[name='partitionFlag']")[2].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='partitionFlag']")[2].checked = false;
|
||||
}
|
||||
|
||||
// 打开编辑弹窗
|
||||
$("#headwearModal").modal('show');
|
||||
} else {
|
||||
@@ -930,9 +995,23 @@ export default {
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
initPartition() {
|
||||
getPartitionInfoList().then(res => {
|
||||
let data = res.data;
|
||||
buildSelectOption(
|
||||
"#partitionId",
|
||||
null,
|
||||
data.map((v) => {
|
||||
return {
|
||||
value: v.id,
|
||||
text: v.desc,
|
||||
};
|
||||
})
|
||||
);
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@@ -24,7 +24,10 @@
|
||||
<label for="name" class="col-sm-1 control-label">资料卡名称:</label>
|
||||
<div class="col-sm-2"><input type="text" class="form-control" name="name" id="name"></div>
|
||||
|
||||
|
||||
<label for="partitionId" class="col-sm-1 control-label">地区:</label>
|
||||
<div class="col-sm-2">
|
||||
<select name="partitionId" id="partitionId" class="form-control"></select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="col-sm-12">
|
||||
@@ -53,6 +56,14 @@
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="addForm">
|
||||
<input type="hidden" name="id" id="modal_id" />
|
||||
<div class="form-group">
|
||||
<label for="partitionFlag" class="col-sm-4 control-label">选择分区</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="checkbox" name="partitionFlag" value="1"/>英语区<br>
|
||||
<input type="checkbox" name="partitionFlag" value="2"/>阿拉伯语区<br>
|
||||
<input type="checkbox" name="partitionFlag" value="4"/>华语区<br>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="modal_type" class="col-sm-4 control-label">装扮类型:</label>
|
||||
<div class="col-sm-6">
|
||||
@@ -155,6 +166,8 @@
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import { getPartitionInfoList } from '@/api/partition/partitionInfo';
|
||||
import { buildSelectOption } from '@/utils/system-helper';
|
||||
|
||||
export default {
|
||||
name: "InfocardManageView",
|
||||
@@ -163,6 +176,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initPartition();
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
@@ -174,6 +188,25 @@ export default {
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'id', title: '装扮id', align: 'middle', width: '5%' },
|
||||
{
|
||||
field: 'partitionFlag',
|
||||
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: 'name.zh', title: '装扮名称', align: 'middle', width: '5%'},
|
||||
{field: 'name.ar', title: '阿语装扮名称', align: 'middle', width: '5%'},
|
||||
{field: 'name.en', title: '英语装扮名称', align: 'middle', width: '5%'},
|
||||
@@ -264,6 +297,7 @@ export default {
|
||||
type: $('#type').val(),
|
||||
name: $('#name').val(),
|
||||
id: $('#id').val(),
|
||||
partitionId: $('#partitionId').val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
@@ -319,6 +353,23 @@ export default {
|
||||
$('#addIconPicUrl').attr("src", row.pic);
|
||||
$("#addForm #pic").val(row.pic);
|
||||
$("#addForm #status").val(row.status);
|
||||
//分区
|
||||
let partitionFlag = row.partitionFlag;
|
||||
if (partitionFlag & 1 != 0) {
|
||||
$("input:radio[name='partitionFlag']")[0].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='partitionFlag']")[0].checked = false;
|
||||
}
|
||||
if (partitionFlag & 2 != 0) {
|
||||
$("input:radio[name='partitionFlag']")[1].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='partitionFlag']")[1].checked = false;
|
||||
}
|
||||
if (partitionFlag & 4 != 0) {
|
||||
$("input:radio[name='partitionFlag']")[2].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='partitionFlag']")[2].checked = false;
|
||||
}
|
||||
$("#addModal").modal('show');
|
||||
});
|
||||
|
||||
@@ -395,7 +446,14 @@ export default {
|
||||
const nameValue = JSON.stringify(jsonName);
|
||||
// 修改属性值
|
||||
formData.name = nameValue; // 将giftName修改为"newGiftName"
|
||||
|
||||
//分区
|
||||
const partitionFlagArray = $("input:checkbox[name='partitionFlag']:checked").serializeArray();
|
||||
let partitionFlag = 0;
|
||||
for (let i = 0, len = partitionFlagArray.length; i < len; i++) {
|
||||
console.log(partitionFlagArray[i]);
|
||||
partitionFlag |= partitionFlagArray[i].value;
|
||||
}
|
||||
formData.partitionFlag = partitionFlag;
|
||||
// 将修改后的对象转换回序列化字符串
|
||||
let newSerializeStr = $.param(formData);
|
||||
$.ajax({
|
||||
@@ -500,9 +558,23 @@ export default {
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
initPartition() {
|
||||
getPartitionInfoList().then(res => {
|
||||
let data = res.data;
|
||||
buildSelectOption(
|
||||
"#partitionId",
|
||||
null,
|
||||
data.map((v) => {
|
||||
return {
|
||||
value: v.id,
|
||||
text: v.desc,
|
||||
};
|
||||
})
|
||||
);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
function cleanModal() {
|
||||
@@ -513,6 +585,9 @@ function cleanModal() {
|
||||
$('#status').val('');
|
||||
$('#modal_type').val('');
|
||||
$('#modal_name').val('');
|
||||
$('input[name="partitionFlag"]').each(function() {
|
||||
$(this).checked = false;
|
||||
});
|
||||
}
|
||||
//判断空值
|
||||
function isEmpty(data) {
|
||||
|
@@ -33,6 +33,12 @@
|
||||
<option value="" selected="selected">全部</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label for="partitionId" class="col-sm-1 control-label">地区:</label>
|
||||
<div class="col-sm-2">
|
||||
<select name="partitionId" id="partitionId" class="form-control"></select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<div class="col-sm-12">
|
||||
@@ -61,6 +67,14 @@
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="addForm">
|
||||
<input type="hidden" name="id" id="id" />
|
||||
<div class="form-group">
|
||||
<label for="partitionFlag" class="col-sm-4 control-label">选择地区:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="checkbox" name="partitionFlag" value="1"/>英语区<br>
|
||||
<input type="checkbox" name="partitionFlag" value="2"/>阿拉伯语区<br>
|
||||
<input type="checkbox" name="partitionFlag" value="4"/>华语区<br>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nameplateType" class="col-sm-4 control-label">铭牌类型:</label>
|
||||
<div class="col-sm-6">
|
||||
@@ -191,6 +205,8 @@
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import { getConfigValueByKey } from '@/api/system/sysconf';
|
||||
import { getPartitionInfoList } from '@/api/partition/partitionInfo';
|
||||
import { buildSelectOption } from '@/utils/system-helper';
|
||||
|
||||
export default {
|
||||
name: "NameplateInfoView",
|
||||
@@ -199,6 +215,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initPartition();
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
@@ -216,6 +233,25 @@ export default {
|
||||
{field: 'name.zh', title: '铭牌名称', align: 'middle', width: '5%'},
|
||||
{field: 'name.ar', title: '阿语铭牌名称', align: 'middle', width: '5%'},
|
||||
{field: 'name.en', title: '英语铭牌名称', align: 'middle', width: '5%'},
|
||||
{
|
||||
field: 'partitionFlag',
|
||||
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: 'iconPic',
|
||||
title: '铭牌图片',
|
||||
@@ -299,6 +335,7 @@ export default {
|
||||
name: $('#name').val(),
|
||||
status: $('#status').val(),
|
||||
type: $('#type').val(),
|
||||
partitionId: $('#partitionId').val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
@@ -375,6 +412,23 @@ export default {
|
||||
$('#iconPic').val(json.iconPic);
|
||||
$('#addIconPicUrl').attr('src', json.iconPic);
|
||||
}
|
||||
//分区
|
||||
let partitionFlag = json.partitionFlag;
|
||||
if (partitionFlag & 1 != 0) {
|
||||
$("input:radio[name='partitionFlag']")[0].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='partitionFlag']")[0].checked = false;
|
||||
}
|
||||
if (partitionFlag & 2 != 0) {
|
||||
$("input:radio[name='partitionFlag']")[1].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='partitionFlag']")[1].checked = false;
|
||||
}
|
||||
if (partitionFlag & 4 != 0) {
|
||||
$("input:radio[name='partitionFlag']")[2].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='partitionFlag']")[2].checked = false;
|
||||
}
|
||||
// 打开编辑弹窗
|
||||
$("#addModal").modal('show');
|
||||
$("#modalLabel").text("编辑铭牌");
|
||||
@@ -430,6 +484,13 @@ export default {
|
||||
const nameValue = JSON.stringify(jsonName);
|
||||
var nameplateType = $('#nameplateType1').val();
|
||||
var id = $('#id').val();
|
||||
//分区
|
||||
const partitionFlagArray = $("input:checkbox[name='partitionFlag']:checked").serializeArray();
|
||||
let partitionFlag = 0;
|
||||
for (let i = 0, len = partitionFlagArray.length; i < len; i++) {
|
||||
console.log(partitionFlagArray[i]);
|
||||
partitionFlag |= partitionFlagArray[i].value;
|
||||
}
|
||||
//做下数据校验
|
||||
if (isEmpty(nameplateType) && id == null) {
|
||||
$("#tipMsg").text("铭牌类型不能为空");
|
||||
@@ -514,6 +575,7 @@ export default {
|
||||
type: type,
|
||||
iconPic: iconPic,
|
||||
id: id,
|
||||
partitionFlag: partitionFlag,
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
@@ -619,9 +681,23 @@ export default {
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
initPartition() {
|
||||
getPartitionInfoList().then(res => {
|
||||
let data = res.data;
|
||||
buildSelectOption(
|
||||
"#partitionId",
|
||||
null,
|
||||
data.map((v) => {
|
||||
return {
|
||||
value: v.id,
|
||||
text: v.desc,
|
||||
};
|
||||
})
|
||||
);
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
function cleanNamePlateModal() {
|
||||
@@ -643,6 +719,9 @@ function cleanNamePlateModal() {
|
||||
$('#name1').removeAttr("readonly");
|
||||
$('#nameplateType1').removeAttr("disabled");
|
||||
$('#fixedWord-div').removeClass("hidden");
|
||||
$('input[name="partitionFlag"]').each(function() {
|
||||
$(this).checked = false;
|
||||
});
|
||||
}
|
||||
//判断空值
|
||||
function isEmpty(data) {
|
||||
|
@@ -1,15 +1,35 @@
|
||||
<!-- eslint-disable vue/valid-v-slot -->
|
||||
<template>
|
||||
<div class="outer">
|
||||
<!-- 查询 -->
|
||||
<div class="inquire" style="display: inline-block; margin-right: 20px">
|
||||
<span class="demonstration">地区:</span>
|
||||
<el-select v-model="searchValues.partitionId" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="(item, i) in partitionInfos"
|
||||
:key="i"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<!-- 按钮 -->
|
||||
<div class="buttonBox">
|
||||
<el-button @click="addClick()" class="primary" type="primary" size="default"
|
||||
style="margin-right: 10px">新增</el-button>
|
||||
<el-button @click="getData()" class="primary" type="primary" size="default"
|
||||
style="margin-right: 10px">查询</el-button>
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<el-table :data="tableData" border style="width: 100%; margin-top: 25px">
|
||||
<el-table-column align="center" prop="id" label="资源位ID" />
|
||||
<el-table-column align="center" prop="name" label="入口名称" />
|
||||
<el-table-column align="center" prop="partitionId" label="地区">
|
||||
<template v-slot="scope">
|
||||
<span>{{ getPartitionInfo(scope.row.partitionId) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="icon" label="入口icon">
|
||||
<template v-slot="scope">
|
||||
<el-image style="width: 100px; height: 100px" :src="scope.row.icon" :zoom-rate="1.1"
|
||||
@@ -62,6 +82,13 @@
|
||||
<el-input v-model="resource.name" style="width: 75%" class="input" placeholder="请输入入口名称"
|
||||
:disabled="resource.skipType == 1"></el-input>
|
||||
</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.partitionId" style="width: 75%" placeholder="请选择">
|
||||
<el-option v-for="item in partitionInfos" :key="item.id" :label="item.desc"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="margin-bottom: 25px">
|
||||
<span style="display: inline-block; margin-right: 20px" class="col-sm-2 control-label">icon</span>
|
||||
<input type="hidden" class="form-control" name="icon" v-model="resource.icon" />
|
||||
@@ -155,6 +182,7 @@ import { getResourcePage, delResource, saveResource, effective } from "@/api/res
|
||||
import { getResourceRuleList } from '@/api/resource/resourceRule';
|
||||
import { uploadFile } from '@/api/common/upload';
|
||||
import { hideLoading, showLoading } from "@/utils/maintainer";
|
||||
import { getPartitionInfoList } from '@/api/partition/partitionInfo';
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
export default {
|
||||
@@ -205,15 +233,21 @@ export default {
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
seqNo: 0,
|
||||
ruleValue: {}
|
||||
ruleValue: {},
|
||||
partitionId: null,
|
||||
},
|
||||
imageUrl: '',
|
||||
partitionInfos: [],
|
||||
searchValues: {
|
||||
partitionId: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.initPartition();
|
||||
this.getRule();
|
||||
this.getData();
|
||||
},
|
||||
@@ -281,6 +315,7 @@ export default {
|
||||
getData() {
|
||||
getResourcePage({
|
||||
type: 3,
|
||||
partitionId: this.searchValues.partitionId,
|
||||
page: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
}).then(res => {
|
||||
@@ -325,6 +360,7 @@ export default {
|
||||
let rule = this.rules[i];
|
||||
this.resource.ruleValue[rule.ruleCode] = '';
|
||||
}
|
||||
this.partitionId = null;
|
||||
this.editDialog = true;
|
||||
},
|
||||
editClick(row) {
|
||||
@@ -349,6 +385,7 @@ export default {
|
||||
}
|
||||
this.resource.ruleValue[ruleCode] = rule;
|
||||
}
|
||||
this.resource.partitionId = row.partitionId;
|
||||
this.editDialog = true;
|
||||
},
|
||||
editDialogClick() {
|
||||
@@ -383,7 +420,8 @@ export default {
|
||||
startTime: this.resource.startTime,
|
||||
endTime: this.resource.endTime,
|
||||
seqNo: this.resource.seqNo,
|
||||
ruleValue: JSON.stringify(this.resource.ruleValue)
|
||||
ruleValue: JSON.stringify(this.resource.ruleValue),
|
||||
partitionId: this.resource.partitionId,
|
||||
}).then(res => {
|
||||
this.getData();
|
||||
this.editDialog = false;
|
||||
@@ -404,6 +442,18 @@ export default {
|
||||
handleCurrentChange(val) {
|
||||
this.getData();
|
||||
},
|
||||
initPartition() {
|
||||
getPartitionInfoList().then(res => {
|
||||
this.partitionInfos = res.data;
|
||||
});
|
||||
},
|
||||
getPartitionInfo(partitionId) {
|
||||
let partitions = this.partitionInfos.filter(v => v.id == partitionId);
|
||||
if (!partitions || partitions.length <= 0) {
|
||||
return '';
|
||||
}
|
||||
return partitions[0].desc;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -413,4 +463,8 @@ export default {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
border-top: 3px solid #d2d6de;
|
||||
.inquire {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}</style>
|
||||
|
@@ -1,15 +1,35 @@
|
||||
<!-- eslint-disable vue/valid-v-slot -->
|
||||
<template>
|
||||
<div class="outer">
|
||||
<!-- 查询 -->
|
||||
<div class="inquire" style="display: inline-block; margin-right: 20px">
|
||||
<span class="demonstration">地区:</span>
|
||||
<el-select v-model="searchValues.partitionId" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="(item, i) in partitionInfos"
|
||||
:key="i"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<!-- 按钮 -->
|
||||
<div class="buttonBox">
|
||||
<el-button @click="addClick()" class="primary" type="primary" size="default"
|
||||
style="margin-right: 10px">新增</el-button>
|
||||
<el-button @click="getData()" class="primary" type="primary" size="default"
|
||||
style="margin-right: 10px">查询</el-button>
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<el-table :data="tableData" border style="width: 100%; margin-top: 25px">
|
||||
<el-table-column align="center" prop="id" label="资源位ID" />
|
||||
<el-table-column align="center" prop="name" label="入口名称" />
|
||||
<el-table-column align="center" prop="partitionId" label="地区">
|
||||
<template v-slot="scope">
|
||||
<span>{{ getPartitionInfo(scope.row.partitionId) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="icon" label="入口icon">
|
||||
<template v-slot="scope">
|
||||
<el-image style="width: 100px; height: 100px" :src="scope.row.icon" :zoom-rate="1.1"
|
||||
@@ -62,6 +82,13 @@
|
||||
<el-input v-model="resource.name" style="width: 75%" class="input" placeholder="请输入入口名称"
|
||||
:disabled="resource.skipType == 1"></el-input>
|
||||
</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.partitionId" style="width: 75%" placeholder="请选择">
|
||||
<el-option v-for="item in partitionInfos" :key="item.id" :label="item.desc"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="margin-bottom: 25px">
|
||||
<span style="display: inline-block; margin-right: 20px" class="col-sm-2 control-label">icon</span>
|
||||
<input type="hidden" class="form-control" name="icon" v-model="resource.icon" />
|
||||
@@ -159,6 +186,7 @@ import { getResourcePage, delResource, saveResource, effective } from "@/api/res
|
||||
import { getResourceRuleList } from '@/api/resource/resourceRule';
|
||||
import { uploadFile } from '@/api/common/upload';
|
||||
import { hideLoading, showLoading } from "@/utils/maintainer";
|
||||
import { getPartitionInfoList } from '@/api/partition/partitionInfo';
|
||||
|
||||
export default {
|
||||
name: "ResourceView",
|
||||
@@ -201,15 +229,21 @@ export default {
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
seqNo: 0,
|
||||
ruleValue: {}
|
||||
ruleValue: {},
|
||||
partitionId: null,
|
||||
},
|
||||
imageUrl: '',
|
||||
partitionInfos: [],
|
||||
searchValues: {
|
||||
partitionId: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.initPartition();
|
||||
this.getRule();
|
||||
this.getData();
|
||||
},
|
||||
@@ -277,6 +311,7 @@ export default {
|
||||
getData() {
|
||||
getResourcePage({
|
||||
type: 1,
|
||||
partitionId: this.searchValues.partitionId,
|
||||
page: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
}).then(res => {
|
||||
@@ -319,6 +354,7 @@ export default {
|
||||
let rule = this.rules[i];
|
||||
this.resource.ruleValue[rule.ruleCode] = '';
|
||||
}
|
||||
this.partitionId = null;
|
||||
this.editDialog = true;
|
||||
},
|
||||
editClick(row) {
|
||||
@@ -341,6 +377,7 @@ export default {
|
||||
}
|
||||
this.resource.ruleValue[ruleCode] = rule;
|
||||
}
|
||||
this.resource.partitionId = row.partitionId;
|
||||
this.editDialog = true;
|
||||
},
|
||||
editDialogClick() {
|
||||
@@ -363,7 +400,8 @@ export default {
|
||||
startTime: this.resource.startTime,
|
||||
endTime: this.resource.endTime,
|
||||
seqNo: this.resource.seqNo,
|
||||
ruleValue: JSON.stringify(this.resource.ruleValue)
|
||||
ruleValue: JSON.stringify(this.resource.ruleValue),
|
||||
partitionId: this.resource.partitionId,
|
||||
}).then(res => {
|
||||
this.getData();
|
||||
this.editDialog = false;
|
||||
@@ -384,6 +422,18 @@ export default {
|
||||
handleCurrentChange(val) {
|
||||
this.getData();
|
||||
},
|
||||
initPartition() {
|
||||
getPartitionInfoList().then(res => {
|
||||
this.partitionInfos = res.data;
|
||||
});
|
||||
},
|
||||
getPartitionInfo(partitionId) {
|
||||
let partitions = this.partitionInfos.filter(v => v.id == partitionId);
|
||||
if (!partitions || partitions.length <= 0) {
|
||||
return '';
|
||||
}
|
||||
return partitions[0].desc;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -393,4 +443,8 @@ export default {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
border-top: 3px solid #d2d6de;
|
||||
.inquire {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}</style>
|
||||
|
@@ -1,15 +1,35 @@
|
||||
<!-- eslint-disable vue/valid-v-slot -->
|
||||
<template>
|
||||
<div class="outer">
|
||||
<!-- 查询 -->
|
||||
<div class="inquire" style="display: inline-block; margin-right: 20px">
|
||||
<span class="demonstration">地区:</span>
|
||||
<el-select v-model="searchValues.partitionId" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="(item, i) in partitionInfos"
|
||||
:key="i"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<!-- 按钮 -->
|
||||
<div class="buttonBox">
|
||||
<el-button @click="addClick()" class="primary" type="primary" size="default"
|
||||
style="margin-right: 10px">新增</el-button>
|
||||
<el-button @click="getData()" class="primary" type="primary" size="default"
|
||||
style="margin-right: 10px">查询</el-button>
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<el-table :data="tableData" border style="width: 100%; margin-top: 25px">
|
||||
<el-table-column align="center" prop="id" label="资源位ID" />
|
||||
<el-table-column align="center" prop="name" label="活动名称" />
|
||||
<el-table-column align="center" prop="partitionId" label="地区">
|
||||
<template v-slot="scope">
|
||||
<span>{{ getPartitionInfo(scope.row.partitionId) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="url" label="开屏页" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-image style="width: 100%; height: 100px" :src="scope.row.url" :zoom-rate="1.1"
|
||||
@@ -54,6 +74,13 @@
|
||||
<span style="display: inline-block; margin-right: 20px" class="col-sm-2 control-label">活动名称</span>
|
||||
<el-input v-model="resource.name" style="width: 75%" class="input" placeholder="请输入活动名称"></el-input>
|
||||
</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.partitionId" style="width: 75%" placeholder="请选择">
|
||||
<el-option v-for="item in partitionInfos" :key="item.id" :label="item.desc"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="margin-bottom: 25px">
|
||||
<span style="display: inline-block; margin-right: 20px" class="col-sm-2 control-label">开屏页</span>
|
||||
<input type="hidden" class="form-control" name="avatar" v-model="resource.url" />
|
||||
@@ -126,6 +153,7 @@ import { getResourcePage, delResource, saveResource, effective } from "@/api/res
|
||||
import { getResourceRuleList } from '@/api/resource/resourceRule';
|
||||
import { uploadFile } from '@/api/common/upload';
|
||||
import { hideLoading, showLoading } from "@/utils/maintainer";
|
||||
import { getPartitionInfoList } from '@/api/partition/partitionInfo';
|
||||
|
||||
export default {
|
||||
name: "SplashView",
|
||||
@@ -167,15 +195,21 @@ export default {
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
seqNo: 0,
|
||||
ruleValue: {}
|
||||
ruleValue: {},
|
||||
partitionId: null,
|
||||
},
|
||||
imageUrl: '',
|
||||
partitionInfos: [],
|
||||
searchValues: {
|
||||
partitionId: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.initPartition();
|
||||
this.getRule();
|
||||
this.getData();
|
||||
},
|
||||
@@ -229,6 +263,7 @@ export default {
|
||||
getData() {
|
||||
getResourcePage({
|
||||
type: 2,
|
||||
partitionId: this.searchValues.partitionId,
|
||||
page: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
}).then(res => {
|
||||
@@ -263,6 +298,7 @@ export default {
|
||||
let rule = this.rules[i];
|
||||
this.resource.ruleValue[rule.ruleCode] = '';
|
||||
}
|
||||
this.partitionId = null;
|
||||
this.editDialog = true;
|
||||
},
|
||||
editClick(row) {
|
||||
@@ -285,6 +321,7 @@ export default {
|
||||
}
|
||||
this.resource.ruleValue[ruleCode] = rule;
|
||||
}
|
||||
this.resource.partitionId = row.partitionId;
|
||||
this.editDialog = true;
|
||||
},
|
||||
editDialogClick() {
|
||||
@@ -321,7 +358,8 @@ export default {
|
||||
endTime: this.resource.endTime,
|
||||
seqNo: this.resource.seqNo,
|
||||
isEnabled: isEnabled,
|
||||
ruleValue: JSON.stringify(this.resource.ruleValue)
|
||||
ruleValue: JSON.stringify(this.resource.ruleValue),
|
||||
partitionId: this.resource.partitionId,
|
||||
}).then(res => {
|
||||
this.getData();
|
||||
this.editDialog = false;
|
||||
@@ -342,6 +380,18 @@ export default {
|
||||
handleCurrentChange(val) {
|
||||
this.getData();
|
||||
},
|
||||
initPartition() {
|
||||
getPartitionInfoList().then(res => {
|
||||
this.partitionInfos = res.data;
|
||||
});
|
||||
},
|
||||
getPartitionInfo(partitionId) {
|
||||
let partitions = this.partitionInfos.filter(v => v.id == partitionId);
|
||||
if (!partitions || partitions.length <= 0) {
|
||||
return '';
|
||||
}
|
||||
return partitions[0].desc;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -351,5 +401,9 @@ export default {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
border-top: 3px solid #d2d6de;
|
||||
.inquire {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -943,9 +943,9 @@ export default {
|
||||
$("#isSendMsg").val('');
|
||||
$("#consumeType").removeAttr("disabled");
|
||||
$('#roomExcludeId').val('');
|
||||
$("input:radio[name='partitionFlag']")[0].checked = false;
|
||||
$("input:radio[name='partitionFlag']")[1].checked = false;
|
||||
$("input:radio[name='partitionFlag']")[2].checked = false;
|
||||
$('input[name="partitionFlag"]').each(function() {
|
||||
$(this).checked = false;
|
||||
});
|
||||
window.selectConsumeChange($("#consumeType"));
|
||||
$('#roomExcludeId').val('');
|
||||
});
|
||||
|
@@ -38,6 +38,7 @@
|
||||
<div class="detail">
|
||||
<div class="part form-group">
|
||||
<div class="nick">昵称: <span></span></div>
|
||||
<div class="partitionId">地区: <span></span></div>
|
||||
<div class="erbanNo">平台号: <span></span></div>
|
||||
<div class="uid">UID: <span></span></div>
|
||||
<div class="avatar">头像:<img src="" alt="" width="70px" height="70px"></div>
|
||||
@@ -99,6 +100,12 @@
|
||||
<form id="editUser" class="form-horizontal">
|
||||
<input type="hidden" name="uid" id="editUid">
|
||||
<input type="hidden" name="app" id="app">
|
||||
<div class="form-group">
|
||||
<label for="partitionId" class="col-sm-3 control-label">选择地区:</label>
|
||||
<div class="col-sm-7">
|
||||
<select name="partitionId" id="partitionId" class="form-control validate[required]"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="editNick" class="col-sm-3 control-label">昵称:</label>
|
||||
<div class="col-sm-7">
|
||||
@@ -264,9 +271,16 @@
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import { getPartitionInfoList } from '@/api/partition/partitionInfo';
|
||||
import { buildSelectOption } from '@/utils/system-helper';
|
||||
|
||||
export default {
|
||||
name: "UserCheckAdminView",
|
||||
data() {
|
||||
return {
|
||||
partitionInfos: [],
|
||||
};
|
||||
},
|
||||
setup() {
|
||||
function delPhoto(obj) {
|
||||
var tr = $(obj).parent().parent();
|
||||
@@ -279,11 +293,13 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initPartition();
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
let $this = this;
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
@@ -330,6 +346,20 @@ export default {
|
||||
{ field: 'account.uid', title: 'Uid', align: 'center', valign: 'middle' },
|
||||
{ field: 'users.nick', title: '用户昵称', align: 'center', valign: 'middle' },
|
||||
{ field: 'users.userDesc', title: '简介', align: 'center', valign: 'middle' },
|
||||
{
|
||||
field: 'users.partitionId',
|
||||
title: '地区',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
let value = '';
|
||||
let partitions = $this.partitionInfos.filter(v => v.id == val);
|
||||
if (val && partitions.length > 0) {
|
||||
value = partitions[0].desc;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: '', title: '是否实名认证', align: 'center', valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
@@ -519,6 +549,13 @@ export default {
|
||||
$('.deviceID span').html(users.deviceId);
|
||||
$('.appVersion span').html(users.appVersion);
|
||||
}
|
||||
let partitionDesc = '';
|
||||
let partitionId = users.partitionId;
|
||||
let partitions = $this.partitionInfos.filter(v => v.id == partitionId);
|
||||
if (partitions.length > 0) {
|
||||
partitionDesc = partitions[0].desc;
|
||||
}
|
||||
$('.partitionId span').html(partitionDesc);
|
||||
$('#detailModal').modal('show');
|
||||
} else {
|
||||
$("#tipMsg").text("不存在用户详细信息,原因:该用户资料未补全");
|
||||
@@ -583,6 +620,7 @@ export default {
|
||||
var avatar = users ? users.avatar : '';
|
||||
var gender = users ? users.gender : 1;
|
||||
var defUser = users ? users.defUser : 1;
|
||||
let partitionId = users.partitionId;
|
||||
|
||||
$('#editNick').val(nick);
|
||||
$('#editPhone').val(account.phone);
|
||||
@@ -594,9 +632,8 @@ export default {
|
||||
$("#alipayAccount").val(users.alipayAccount);
|
||||
$("#alipayAccountName").val(users.alipayAccountName);
|
||||
$("#app").val(users.currentApp);
|
||||
|
||||
$("#userDesc").val(users.userDesc);
|
||||
|
||||
$('#partitionId').val(partitionId);
|
||||
|
||||
var privatePhoto = res.data.privatePhoto;
|
||||
var $photos = $('#photoTbody');
|
||||
@@ -761,7 +798,8 @@ export default {
|
||||
userDesc: $("#userDesc").val(),
|
||||
photoUrls: photoUrls,
|
||||
msg: $("#msg").val(),
|
||||
sendMsg: sendMsg
|
||||
sendMsg: sendMsg,
|
||||
partitionId: $('#partitionId').val(),
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
@@ -862,7 +900,23 @@ export default {
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
initPartition() {
|
||||
getPartitionInfoList().then(res => {
|
||||
let data = res.data;
|
||||
this.partitionInfos = data;
|
||||
buildSelectOption(
|
||||
"#partitionId",
|
||||
null,
|
||||
data.map((v) => {
|
||||
return {
|
||||
value: v.id,
|
||||
text: v.desc,
|
||||
};
|
||||
})
|
||||
);
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
|
@@ -1,5 +1,18 @@
|
||||
<template>
|
||||
<div class="outer">
|
||||
<!-- 查询 -->
|
||||
<div class="inquire" style="display: inline-block; margin-right: 20px">
|
||||
<span class="demonstration">地区:</span>
|
||||
<el-select v-model="searchValues.partitionId" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="(item, i) in partitionInfos"
|
||||
:key="i"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<!-- 按钮 -->
|
||||
<div class="buttonBox">
|
||||
<el-button class="primary" type="primary" size="default" @click="add()"
|
||||
@@ -15,6 +28,11 @@
|
||||
>
|
||||
<el-table-column prop="giftId" align="center" label="礼物id" />
|
||||
<el-table-column prop="giftName" align="center" label="礼物名称" />
|
||||
<el-table-column align="center" prop="partitionId" label="地区">
|
||||
<template v-slot="scope">
|
||||
<span>{{ getPartitionInfo(scope.row.partitionId) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="icon" label="礼物图片">
|
||||
<template v-slot="scope">
|
||||
<el-image
|
||||
@@ -71,6 +89,13 @@
|
||||
|
||||
<!-- 新增弹窗 -->
|
||||
<el-dialog v-model="addDialog" title="新增" width="28%" center>
|
||||
<div style="margin-bottom: 25px;margin-top: 10px;">
|
||||
<span style="display: inline-block; margin-right: 20px" class="col-sm-2 control-label">选择地区</span>
|
||||
<el-select v-model="resource.partitionId" style="width: 75%" placeholder="请选择">
|
||||
<el-option v-for="item in partitionInfos" :key="item.id" :label="item.desc"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="margin-bottom: 25px; margin-top: 10px">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
@@ -85,7 +110,7 @@
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, i) in giftOptions"
|
||||
v-for="(item, i) in giftOptions.filter(v => resource.partitionId == null || ((v.partitionFlag & resource.partitionId) != 0))"
|
||||
:key="i"
|
||||
:label="item.giftName"
|
||||
:value="i"
|
||||
@@ -160,6 +185,13 @@
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<el-dialog v-model="editDialog" title="编辑" width="28%" center>
|
||||
<div style="margin-bottom: 25px;margin-top: 10px;">
|
||||
<span style="display: inline-block; margin-right: 20px" class="col-sm-2 control-label">选择地区</span>
|
||||
<el-select v-model="editresource.partitionId" style="width: 75%" placeholder="请选择">
|
||||
<el-option v-for="item in partitionInfos" :key="item.id" :label="item.desc"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="margin-bottom: 25px; margin-top: 10px">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
@@ -173,7 +205,7 @@
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in editGiftOptions"
|
||||
v-for="item in editGiftOptions.filter(v => editresource.partitionId == null || ((v.partitionFlag & editresource.partitionId) != 0))"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@@ -307,6 +339,7 @@ export default {
|
||||
stockNum: null,
|
||||
seqNo: null,
|
||||
isEnabled: null,
|
||||
partitionId: null,
|
||||
},
|
||||
giftOptions: [
|
||||
//新增弹窗礼物筛选
|
||||
@@ -333,6 +366,7 @@ export default {
|
||||
seqNo: null,
|
||||
isEnabled: null,
|
||||
giftName: null,
|
||||
partitionId: null,
|
||||
},
|
||||
editGiftOptions: [
|
||||
//编辑弹窗礼物筛选
|
||||
@@ -359,9 +393,14 @@ export default {
|
||||
isEnabled: null,
|
||||
id: null,
|
||||
},
|
||||
partitionInfos: [],
|
||||
searchValues: {
|
||||
partitionId: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.initPartition();
|
||||
this.getData();
|
||||
giftGetAll({
|
||||
giftType: 2,
|
||||
@@ -408,6 +447,7 @@ export default {
|
||||
this.editresource.goldPrice = res.giftPrice;
|
||||
// @ts-ignore
|
||||
this.editresource.giftName = res.giftName;
|
||||
this.editresource.partitionId = res.partitionId;
|
||||
this.editDialog = true;
|
||||
},
|
||||
// 表单上线下线按钮
|
||||
@@ -427,6 +467,7 @@ export default {
|
||||
stockNum: this.resource.stockNum,
|
||||
seqNo: this.resource.seqNo,
|
||||
isEnabled: this.resource.isEnabled,
|
||||
partitionId: this.resource.partitionId,
|
||||
// @ts-ignore
|
||||
// @ts-ignore
|
||||
// @ts-ignore
|
||||
@@ -474,6 +515,18 @@ export default {
|
||||
// @ts-ignore
|
||||
// @ts-ignore
|
||||
handleCurrentChange(val) {},
|
||||
initPartition() {
|
||||
getPartitionInfoList().then(res => {
|
||||
this.partitionInfos = res.data;
|
||||
});
|
||||
},
|
||||
getPartitionInfo(partitionId) {
|
||||
let partitions = this.partitionInfos.filter(v => v.id == partitionId);
|
||||
if (!partitions || partitions.length <= 0) {
|
||||
return '';
|
||||
}
|
||||
return partitions[0].desc;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user