新增分区
This commit is contained in:
@@ -6,6 +6,14 @@
|
|||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<h1 id="itemTitle"></h1>
|
<h1 id="itemTitle"></h1>
|
||||||
</section>
|
</section>
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<label for="partitionId" class="col-sm-1 control-label">地区:</label>
|
||||||
|
<div class="col-sm-2">
|
||||||
|
<select name="partitionId" id="partitionId" class="form-control">
|
||||||
|
<option value="4" selected>华语区</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div id="toolbar">
|
<div id="toolbar">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<button id="btnSearch" class="btn btn-default">
|
<button id="btnSearch" class="btn btn-default">
|
||||||
@@ -16,22 +24,32 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="hidden" id="currentPageNum">
|
<input type="hidden" id="currentPageNum" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- .content -->
|
<!-- .content -->
|
||||||
<div id="table"></div>
|
<div id="table"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<div class="modal fade" id="roomTabModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
|
<div
|
||||||
|
class="modal fade"
|
||||||
|
id="roomTabModal"
|
||||||
|
tabindex="-1"
|
||||||
|
role="dialog"
|
||||||
|
aria-labelledby="modalLabel"
|
||||||
|
>
|
||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
|
<button
|
||||||
aria-hidden="true">×</span>
|
type="button"
|
||||||
|
class="close"
|
||||||
|
data-dismiss="modal"
|
||||||
|
aria-label="Close"
|
||||||
|
>
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title" id="modalLabel">编辑房间标签</h4>
|
<h4 class="modal-title" id="modalLabel">编辑房间标签</h4>
|
||||||
</div>
|
</div>
|
||||||
@@ -39,34 +57,81 @@
|
|||||||
<form class="form-horizontal" id="addForm">
|
<form class="form-horizontal" id="addForm">
|
||||||
<input type="hidden" name="id" id="id" />
|
<input type="hidden" name="id" id="id" />
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="modal_seq" class="col-sm-3 control-label">排序<font color="red">*</font>:</label>
|
<label for="modal_seq" class="col-sm-3 control-label"
|
||||||
|
>排序<font color="red">*</font>:</label
|
||||||
|
>
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
<input type="text" class="form-control validate[custom[integer]]" name="seq" id="modal_seq"
|
<input
|
||||||
placeholder="数字小的排前面,必填">
|
type="text"
|
||||||
|
class="form-control validate[custom[integer]]"
|
||||||
|
name="seq"
|
||||||
|
id="modal_seq"
|
||||||
|
placeholder="数字小的排前面,必填"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="modal_name" class="col-sm-3 control-label">名称<font color="red">*</font>:</label>
|
<label for="modal_name" class="col-sm-3 control-label"
|
||||||
|
>名称<font color="red">*</font>:</label
|
||||||
|
>
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
<input type="text" class="form-control validate[required]" name="name" id="modal_name">
|
<input
|
||||||
|
type="text"
|
||||||
|
class="form-control validate[required]"
|
||||||
|
name="name"
|
||||||
|
id="modal_name"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="ar_modal_name" class="col-sm-3 control-label">阿语名称<font color="red">*</font>:</label>
|
<label for="ar_modal_name" class="col-sm-3 control-label"
|
||||||
|
>阿语名称<font color="red">*</font>:</label
|
||||||
|
>
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
<input type="text" class="form-control validate[required]" name="name" id="ar_modal_name">
|
<input
|
||||||
|
type="text"
|
||||||
|
class="form-control validate[required]"
|
||||||
|
name="name"
|
||||||
|
id="ar_modal_name"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="en_modal_name" class="col-sm-3 control-label">英语名称<font color="red">*</font>:</label>
|
<label for="en_modal_name" class="col-sm-3 control-label"
|
||||||
|
>英语名称<font color="red">*</font>:</label
|
||||||
|
>
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
<input type="text" class="form-control validate[required]" name="name" id="en_modal_name">
|
<input
|
||||||
|
type="text"
|
||||||
|
class="form-control validate[required]"
|
||||||
|
name="name"
|
||||||
|
id="en_modal_name"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="status" class="col-sm-3 control-label">显示状态<font color="red">*</font>:</label>
|
<label for="tr_modal_name" class="col-sm-3 control-label"
|
||||||
|
>土耳其名称<font color="red">*</font>:</label
|
||||||
|
>
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
<select name="status" id="modal_status" class="form-control validate[required]">
|
<input
|
||||||
|
type="text"
|
||||||
|
class="form-control validate[required]"
|
||||||
|
name="name"
|
||||||
|
id="tr_modal_name"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="status" class="col-sm-3 control-label"
|
||||||
|
>显示状态<font color="red">*</font>:</label
|
||||||
|
>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<select
|
||||||
|
name="status"
|
||||||
|
id="modal_status"
|
||||||
|
class="form-control validate[required]"
|
||||||
|
>
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
<option value="1">显示</option>
|
<option value="1">显示</option>
|
||||||
<option value="0">不显示</option>
|
<option value="0">不显示</option>
|
||||||
@@ -74,32 +139,64 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="room_tab_show" class="col-sm-3 control-label">房间管理列表展示状态<font color="red">*</font>
|
<label for="room_tab_show" class="col-sm-3 control-label"
|
||||||
:</label>
|
>房间管理列表展示状态<font color="red">*</font> :</label
|
||||||
|
>
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
<select name="room_tab_show" id="modal_room_tab_show"
|
<select
|
||||||
class="form-control validate[required]">
|
name="room_tab_show"
|
||||||
|
id="modal_room_tab_show"
|
||||||
|
class="form-control validate[required]"
|
||||||
|
>
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
<option value="true">展示</option>
|
<option value="true">展示</option>
|
||||||
<option value="false">不展示</option>
|
<option value="false">不展示</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group" id="imgBox">
|
||||||
|
<label class="col-sm-3 control-label">icon</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<img
|
||||||
|
src=""
|
||||||
|
id="iconImgUrl"
|
||||||
|
style="width: 108px; height: 45px"
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
type="file"
|
||||||
|
id="iconFile"
|
||||||
|
name="uploadFile"
|
||||||
|
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg"
|
||||||
|
/>
|
||||||
|
<button class="btn btn-success" type="button" id="iconBtn">
|
||||||
|
上传
|
||||||
|
</button>
|
||||||
|
<input
|
||||||
|
type="hidden"
|
||||||
|
id="iconUrl"
|
||||||
|
name="alertWinPic"
|
||||||
|
class="form-control validate[required]"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||||
|
关闭
|
||||||
|
</button>
|
||||||
<button type="button" class="btn btn-primary" id="add">确定</button>
|
<button type="button" class="btn btn-primary" id="add">确定</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
import TableHelper from "@/utils/bootstrap-table-helper";
|
||||||
|
import { getPartitionInfoList } from "@/api/partition/partitionInfo";
|
||||||
|
import { buildSelectOption } from "@/utils/system-helper";
|
||||||
export default {
|
export default {
|
||||||
name: "RoomTabView",
|
name: "RoomTabView",
|
||||||
setup() {
|
setup() {
|
||||||
@@ -107,53 +204,103 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.$nextTick(function () {
|
this.$nextTick(function () {
|
||||||
|
this.initPartition();
|
||||||
this.initData();
|
this.initData();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initData() {
|
initData() {
|
||||||
$(function () {
|
$(function () {
|
||||||
$('#table').bootstrapTable('destroy');
|
$("#table").bootstrapTable("destroy");
|
||||||
$('#table').bootstrapTable({
|
$("#table").bootstrapTable({
|
||||||
columns: [
|
columns: [
|
||||||
{ field: 'seq', title: '排序', align: 'center', width: '5%' },
|
{ field: "seq", title: "排序", align: "center", width: "5%" },
|
||||||
{field: 'name.zh', title: 'Tab名称', align: 'center', width: '10%'},
|
|
||||||
{field: 'name.ar', title: '阿语Tab名称', align: 'center', width: '10%'},
|
|
||||||
{field: 'name.en', title: '英语Tab名称', align: 'center', width: '10%'},
|
|
||||||
{
|
{
|
||||||
field: 'status', title: '显示状态', align: 'center', valign: 'middle', width: '5%',
|
field: "name.zh",
|
||||||
formatter: function (val, row, index) {
|
title: "Tab名称",
|
||||||
if (val) {
|
align: "center",
|
||||||
return '显示';
|
width: "10%",
|
||||||
} else {
|
|
||||||
return '不显示';
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'roomTabShow', title: '房间管理列表展示状态', align: 'center', valign: 'middle', width: '5%',
|
field: "name.ar",
|
||||||
formatter: function (val, row, index) {
|
title: "阿语Tab名称",
|
||||||
if (val) {
|
align: "center",
|
||||||
return '展示';
|
width: "10%",
|
||||||
} else {
|
|
||||||
return '不展示';
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'id',
|
field: "name.en",
|
||||||
title: '操作',
|
title: "英语Tab名称",
|
||||||
align: 'center',
|
align: "center",
|
||||||
width: '10%',
|
width: "10%",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "name.tr",
|
||||||
|
title: "土耳其Tab名称",
|
||||||
|
align: "center",
|
||||||
|
width: "10%",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "status",
|
||||||
|
title: "显示状态",
|
||||||
|
align: "center",
|
||||||
|
valign: "middle",
|
||||||
|
width: "5%",
|
||||||
formatter: function (val, row, index) {
|
formatter: function (val, row, index) {
|
||||||
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
|
if (val) {
|
||||||
|
return "显示";
|
||||||
|
} else {
|
||||||
|
return "不显示";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "icon",
|
||||||
|
title: "图标",
|
||||||
|
align: "center",
|
||||||
|
valign: "middle",
|
||||||
|
width: "10%",
|
||||||
|
formatter: function (val, row, index) {
|
||||||
|
if (null != val && val != "") {
|
||||||
|
return (
|
||||||
|
'<img src="' +
|
||||||
|
val +
|
||||||
|
'" alt="" style="width: 50px; height: 50px;">'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return "-";
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "roomTabShow",
|
||||||
|
title: "房间管理列表展示状态",
|
||||||
|
align: "center",
|
||||||
|
valign: "middle",
|
||||||
|
width: "5%",
|
||||||
|
formatter: function (val, row, index) {
|
||||||
|
if (val) {
|
||||||
|
return "展示";
|
||||||
|
} else {
|
||||||
|
return "不展示";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "id",
|
||||||
|
title: "操作",
|
||||||
|
align: "center",
|
||||||
|
width: "10%",
|
||||||
|
formatter: function (val, row, index) {
|
||||||
|
return (
|
||||||
|
'<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' +
|
||||||
|
val +
|
||||||
|
">" +
|
||||||
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>' +
|
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>' +
|
||||||
' <button class="btn btn-sm btn-danger opt-remove" data-id=' + val +
|
' <button class="btn btn-sm btn-danger opt-remove" data-id=' +
|
||||||
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
|
val +
|
||||||
}
|
'><i class="glyphicon glyphicon-remove"></i>删除</button>'
|
||||||
}
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
undefinedText: 0,
|
undefinedText: 0,
|
||||||
cache: false,
|
cache: false,
|
||||||
@@ -165,27 +312,30 @@ export default {
|
|||||||
search: false,
|
search: false,
|
||||||
sidePagination: "server", //表示服务端请求
|
sidePagination: "server", //表示服务端请求
|
||||||
queryParamsType: "undefined",
|
queryParamsType: "undefined",
|
||||||
queryParams: function queryParams(params) { //设置查询参数
|
queryParams: function queryParams(params) {
|
||||||
|
//设置查询参数
|
||||||
$("#currentPageNum").val(params.pageNumber);
|
$("#currentPageNum").val(params.pageNumber);
|
||||||
var param = {
|
var param = {
|
||||||
page: params.pageNumber,
|
page: params.pageNumber,
|
||||||
pageSize: params.pageSize,
|
pageSize: params.pageSize,
|
||||||
|
partitionId: $("#partitionId").val(),
|
||||||
};
|
};
|
||||||
return param;
|
return param;
|
||||||
},
|
},
|
||||||
ajax: function (request) { //使用ajax请求
|
ajax: function (request) {
|
||||||
|
//使用ajax请求
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: '/admin/roomTab/list',
|
url: "/admin/roomTab/list",
|
||||||
contentType: 'application/json;charset=utf-8',
|
contentType: "application/json;charset=utf-8",
|
||||||
dataType: 'json',
|
dataType: "json",
|
||||||
data: request.data,
|
data: request.data,
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
request.success({
|
request.success({
|
||||||
"rows": res.rows.map(i=>{
|
rows: res.rows.map((i) => {
|
||||||
let name = i.name;
|
let name = i.name;
|
||||||
if (name.startsWith('{') && name.endsWith('}')) {
|
if (name.startsWith("{") && name.endsWith("}")) {
|
||||||
i.name = JSON.parse(i.name);
|
i.name = JSON.parse(i.name);
|
||||||
} else {
|
} else {
|
||||||
i.name = {
|
i.name = {
|
||||||
@@ -196,45 +346,46 @@ export default {
|
|||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}),
|
}),
|
||||||
"total": res.total
|
total: res.total,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
error: function (error) {
|
error: function (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
toolbar: '#toolbar',
|
});
|
||||||
onLoadSuccess: function () { //加载成功时执行
|
},
|
||||||
|
toolbar: "#toolbar",
|
||||||
|
onLoadSuccess: function () {
|
||||||
|
//加载成功时执行
|
||||||
console.log("load success");
|
console.log("load success");
|
||||||
},
|
},
|
||||||
onLoadError: function () { //加载失败时执行
|
onLoadError: function () {
|
||||||
|
//加载失败时执行
|
||||||
console.log("load fail");
|
console.log("load fail");
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// 查询刷新
|
// 查询刷新
|
||||||
$('#btnSearch').on('click', function () {
|
$("#btnSearch").on("click", function () {
|
||||||
TableHelper.doRefresh('#table');
|
TableHelper.doRefresh("#table");
|
||||||
});
|
});
|
||||||
|
|
||||||
//新建标签
|
//新建标签
|
||||||
$("#btnAdd").click(function () {
|
$("#btnAdd").click(function () {
|
||||||
$("#id").val("");
|
$("#id").val("");
|
||||||
$("#modal_name").val("");
|
$("#modal_name").val("");
|
||||||
$("#ar_modal_name").val("");
|
$("#ar_modal_name").val("");
|
||||||
$("#en_modal_name").val("");
|
$("#en_modal_name").val("");
|
||||||
|
$("#tr_modal_name").val("");
|
||||||
$("#modal_seq").val("");
|
$("#modal_seq").val("");
|
||||||
$("#modal_status").val("");
|
$("#modal_status").val("");
|
||||||
$("#modal_room_tab_show").val("");
|
$("#modal_room_tab_show").val("");
|
||||||
$("#modal_type").val("");
|
$("#modal_type").val("");
|
||||||
$("#modal_istop").val("");
|
$("#modal_istop").val("");
|
||||||
$("#modal_description").val("");
|
$("#modal_description").val("");
|
||||||
$('#addActPic').val('');
|
$("#addActPic").val("");
|
||||||
$('#addUploadFile').val('');
|
$("#addUploadFile").val("");
|
||||||
$('#addImgUrl').attr('src', '');
|
$("#addImgUrl").attr("src", "");
|
||||||
$("#roomTabModal").modal('show');
|
$("#roomTabModal").modal("show");
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#add").click(function () {
|
$("#add").click(function () {
|
||||||
@@ -244,14 +395,16 @@ export default {
|
|||||||
var ar_name = $("#ar_modal_name").val();
|
var ar_name = $("#ar_modal_name").val();
|
||||||
// 英语名称
|
// 英语名称
|
||||||
var en_name = $("#en_modal_name").val();
|
var en_name = $("#en_modal_name").val();
|
||||||
|
var tr_name = $("#tr_modal_name").val();
|
||||||
// 国际化字段
|
// 国际化字段
|
||||||
var jsonName = {"zh":name,"ar":ar_name,"en":en_name}
|
var jsonName = { zh: name, ar: ar_name, en: en_name, tr: tr_name };
|
||||||
const nameValue = JSON.stringify(jsonName);
|
const nameValue = JSON.stringify(jsonName);
|
||||||
var seq = $("#modal_seq").val();
|
var seq = $("#modal_seq").val();
|
||||||
var status = $("#modal_status").val();
|
var status = $("#modal_status").val();
|
||||||
var roomTabShow = $("#modal_room_tab_show").val();
|
var roomTabShow = $("#modal_room_tab_show").val();
|
||||||
|
var icon = $("#iconImgUrl").attr("src");
|
||||||
|
|
||||||
if ($("#addForm").validationEngine('validate')) {
|
if ($("#addForm").validationEngine("validate")) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "post",
|
type: "post",
|
||||||
url: "/admin/roomTab/save",
|
url: "/admin/roomTab/save",
|
||||||
@@ -261,31 +414,31 @@ export default {
|
|||||||
seq: seq,
|
seq: seq,
|
||||||
status: status,
|
status: status,
|
||||||
roomTabShow: roomTabShow,
|
roomTabShow: roomTabShow,
|
||||||
|
icon: icon,
|
||||||
},
|
},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (json) {
|
success: function (json) {
|
||||||
if (json.code == 200) {
|
if (json.code == 200) {
|
||||||
$("#tipMsg").text("保存成功");
|
$("#tipMsg").text("保存成功");
|
||||||
$("#tipModal").modal('show');
|
$("#tipModal").modal("show");
|
||||||
TableHelper.doRefresh("#table");
|
TableHelper.doRefresh("#table");
|
||||||
$("#roomTabModal").modal('hide');
|
$("#roomTabModal").modal("hide");
|
||||||
} else {
|
} else {
|
||||||
$("#tipMsg").text("保存失败." + json.msg);
|
$("#tipMsg").text("保存失败." + json.msg);
|
||||||
$("#tipModal").modal('show');
|
$("#tipModal").modal("show");
|
||||||
TableHelper.doRefresh("#table");
|
TableHelper.doRefresh("#table");
|
||||||
$("#roomTabModal").modal('hide');
|
$("#roomTabModal").modal("hide");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#table").on("click", '.opt-edit', function () {
|
$("#table").on("click", ".opt-edit", function () {
|
||||||
var id = $(this).attr("data-id");
|
var id = $(this).attr("data-id");
|
||||||
$('#addImgUrl').attr('src', '');
|
$("#addImgUrl").attr("src", "");
|
||||||
$('#addActPic').val('');
|
$("#addActPic").val("");
|
||||||
$('#addUploadFile').val('');
|
$("#addUploadFile").val("");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "get",
|
type: "get",
|
||||||
url: "/admin/roomTab/get",
|
url: "/admin/roomTab/get",
|
||||||
@@ -297,19 +450,24 @@ export default {
|
|||||||
var json = ret.data.roomTab;
|
var json = ret.data.roomTab;
|
||||||
$("#id").val(id);
|
$("#id").val(id);
|
||||||
let name = json.name;
|
let name = json.name;
|
||||||
if (name.startsWith('{') && name.endsWith('}')) {
|
$('#iconImgUrl').attr('src',json.icon);
|
||||||
|
if (name.startsWith("{") && name.endsWith("}")) {
|
||||||
var jsonName = JSON.parse(json.name);
|
var jsonName = JSON.parse(json.name);
|
||||||
$("#modal_name").val(jsonName.zh);
|
$("#modal_name").val(jsonName.zh);
|
||||||
// 阿语名称
|
// 阿语名称
|
||||||
$("#ar_modal_name").val(jsonName.ar);
|
$("#ar_modal_name").val(jsonName.ar);
|
||||||
// 英语名称
|
// 英语名称
|
||||||
$("#en_modal_name").val(jsonName.en);
|
$("#en_modal_name").val(jsonName.en);
|
||||||
|
// 土耳其名称
|
||||||
|
$("#tr_modal_name").val(jsonName.tr);
|
||||||
} else {
|
} else {
|
||||||
$("#modal_name").val(name);
|
$("#modal_name").val(name);
|
||||||
// 阿语名称
|
// 阿语名称
|
||||||
$("#ar_modal_name").val(name);
|
$("#ar_modal_name").val(name);
|
||||||
// 英语名称
|
// 英语名称
|
||||||
$("#en_modal_name").val(name);
|
$("#en_modal_name").val(name);
|
||||||
|
// 土耳其名称
|
||||||
|
$("#tr_modal_name").val(name);
|
||||||
}
|
}
|
||||||
$("#modal_seq").val(json.seq);
|
$("#modal_seq").val(json.seq);
|
||||||
if (json.status == 1) {
|
if (json.status == 1) {
|
||||||
@@ -323,47 +481,104 @@ export default {
|
|||||||
$("#modal_room_tab_show").val("false");
|
$("#modal_room_tab_show").val("false");
|
||||||
}
|
}
|
||||||
// 打开编辑弹窗
|
// 打开编辑弹窗
|
||||||
$("#roomTabModal").modal('show');
|
$("#roomTabModal").modal("show");
|
||||||
$("#modalLabel").text("编辑房间Tab");
|
$("#modalLabel").text("编辑房间Tab");
|
||||||
} else {
|
} else {
|
||||||
$("#tipMsg").text("获取菜单信息出错");
|
$("#tipMsg").text("获取菜单信息出错");
|
||||||
$("#tipModal").modal('show');
|
$("#tipModal").modal("show");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#table").on("click", '.opt-remove', function () {
|
$("#table").on("click", ".opt-remove", function () {
|
||||||
var id = $(this).attr("data-id");
|
var id = $(this).attr("data-id");
|
||||||
if (id == 'undefined') {
|
if (id == "undefined") {
|
||||||
$("#tipMsg").text("id参数有误");
|
$("#tipMsg").text("id参数有误");
|
||||||
$("#tipModal").modal('show');
|
$("#tipModal").modal("show");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (confirm("你确认删除吗? \r\n 删除后隐藏tab不会显示,请谨慎操作!")) {
|
if (
|
||||||
|
confirm("你确认删除吗? \r\n 删除后隐藏tab不会显示,请谨慎操作!")
|
||||||
|
) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'post',
|
type: "post",
|
||||||
url: "/admin/roomTab/hide",
|
url: "/admin/roomTab/hide",
|
||||||
data: { id: id },
|
data: { id: id },
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (json) {
|
success: function (json) {
|
||||||
if (json.code == 200) {
|
if (json.code == 200) {
|
||||||
$("#tipMsg").text("删除成功");
|
$("#tipMsg").text("删除成功");
|
||||||
$("#tipModal").modal('show');
|
$("#tipModal").modal("show");
|
||||||
TableHelper.doRefresh("#table");
|
TableHelper.doRefresh("#table");
|
||||||
} else {
|
} else {
|
||||||
$("#tipMsg").text("删除失败");
|
$("#tipMsg").text("删除失败");
|
||||||
$("#tipModal").modal('show');
|
$("#tipModal").modal("show");
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#iconBtn").on("click", function () {
|
||||||
|
if ($("#iconFile").val() == "") {
|
||||||
|
$("#tipMsg").text("上传图片为空");
|
||||||
|
$("#tipModal").modal("show");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$.ajaxFileUpload({
|
||||||
|
fileElementId: "iconFile", //需要上传的文件域的ID,即<input type="file">的ID。
|
||||||
|
url: "/admin/upload/img", //后台方法的路径
|
||||||
|
type: "post", //当要提交自定义参数时,这个参数要设置成post
|
||||||
|
dataType: "json", //服务器返回的数据类型。可以为xml,script,json,html。如果不填写,jQuery会自动判断。
|
||||||
|
secureuri: false, //是否启用安全提交,默认为false。
|
||||||
|
async: true, //是否是异步
|
||||||
|
success: function (json) {
|
||||||
|
//提交成功后自动执行的处理函数,参数data就是服务器返回的数据。
|
||||||
|
if (json.path) {
|
||||||
|
$("#iconUrl").val(json.path);
|
||||||
|
$("#iconImgUrl").attr("src", json.path);
|
||||||
|
} else {
|
||||||
|
$("#tipMsg").text(json.msg);
|
||||||
|
$("#tipModal").modal("show");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (data, status, e) {
|
||||||
|
//提交失败自动执行的处理函数。
|
||||||
|
console.error(e);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function clearModal() {
|
||||||
|
$("#iconImgUrl").attr("src", "");
|
||||||
|
|
||||||
|
$("#addForm")
|
||||||
|
.find("input[type=text],input[type=hidden],input[type=file]")
|
||||||
|
.each(function () {
|
||||||
|
$(this).val("");
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#type").val(1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
initPartition() {
|
||||||
|
getPartitionInfoList().then((res) => {
|
||||||
|
let data = res.data;
|
||||||
|
buildSelectOption(
|
||||||
|
"#partitionId",
|
||||||
|
4,
|
||||||
|
data.map((v) => {
|
||||||
|
return {
|
||||||
|
value: v.id,
|
||||||
|
text: v.desc,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@@ -16,6 +16,14 @@
|
|||||||
method="post"
|
method="post"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<label for="partitionId" class="col-sm-1 control-label">地区:</label>
|
||||||
|
<div class="col-sm-2">
|
||||||
|
<select name="partitionId" id="partitionId" class="form-control">
|
||||||
|
<option value="4" selected>华语区</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<label for="erbanNo" class="col-sm-1 control-label"
|
<label for="erbanNo" class="col-sm-1 control-label"
|
||||||
>平台号:</label
|
>平台号:</label
|
||||||
@@ -240,6 +248,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import TableHelper from "@/utils/bootstrap-table-helper";
|
import TableHelper from "@/utils/bootstrap-table-helper";
|
||||||
import { showLoading, hideLoading } from "@/utils/maintainer";
|
import { showLoading, hideLoading } from "@/utils/maintainer";
|
||||||
|
import { getPartitionInfoList } from "@/api/partition/partitionInfo";
|
||||||
|
import { buildSelectOption } from "@/utils/system-helper";
|
||||||
|
|
||||||
var picker1 = $("#beginDate").datetimepicker({
|
var picker1 = $("#beginDate").datetimepicker({
|
||||||
format: "yyyy-mm-dd hh:ii:00",
|
format: "yyyy-mm-dd hh:ii:00",
|
||||||
@@ -325,6 +335,7 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.$nextTick(function () {
|
this.$nextTick(function () {
|
||||||
this.initData();
|
this.initData();
|
||||||
|
this.initPartition();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -503,6 +514,7 @@ export default {
|
|||||||
beginDate: $("#beginDate").val(),
|
beginDate: $("#beginDate").val(),
|
||||||
endDate: $("#endDate").val(),
|
endDate: $("#endDate").val(),
|
||||||
wolrdId: $("#wolrdId").val(),
|
wolrdId: $("#wolrdId").val(),
|
||||||
|
partitionId: $("#partitionId").val(),
|
||||||
};
|
};
|
||||||
return param;
|
return param;
|
||||||
},
|
},
|
||||||
@@ -640,6 +652,21 @@ export default {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
initPartition() {
|
||||||
|
getPartitionInfoList().then((res) => {
|
||||||
|
let data = res.data;
|
||||||
|
buildSelectOption(
|
||||||
|
"#partitionId",
|
||||||
|
4,
|
||||||
|
data.map((v) => {
|
||||||
|
return {
|
||||||
|
value: v.id,
|
||||||
|
text: v.desc,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user