From 770a2f37c0b0e9228fb6bbe4ceea9fe8125ad3d1 Mon Sep 17 00:00:00 2001
From: liaozetao <1107136310@qq.com>
Date: Wed, 18 Oct 2023 16:54:04 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=A0=E9=99=A4=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../js/bootstrap-combobox-helper.js | 40 +++++++++++--------
src/views/car/CarGoodsAdminView.vue | 9 +++++
.../treasure/SeizeTreasureConvertItemView.vue | 25 +++++++++++-
.../treasure/SeizeTreasurePoolItemView.vue | 25 +++++++++++-
.../treasure/SeizeTreasureRewardView.vue | 25 +++++++++++-
5 files changed, 105 insertions(+), 19 deletions(-)
diff --git a/src/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper.js b/src/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper.js
index 1384101..a991d3f 100644
--- a/src/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper.js
+++ b/src/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper.js
@@ -29,26 +29,34 @@ export default {
}
},
// 构建下拉组合框
- build: function (url, idstr, defval) {
+ build: function (val, idstr, defval) {
var _this = this;
- if (url) {
- $.ajax({
- type: 'post',
- url: url,
- dataType: 'json',
- success: function (json) {
- $(idstr).empty();
- $.each(json, function (n, value) {
- $(idstr).append("");
- });
- $(idstr).btComboBox();
- _this.setDef(idstr, defval);
- }
- });
+ if (val) {
+ if (Object.prototype.toString.call(val) === '[object Object]') {
+ $(idstr).empty();
+ $.each(val, function (n, value) {
+ $(idstr).append("");
+ });
+ $(idstr).btComboBox();
+ _this.setDef(idstr, defval);
+ } else {
+ $.ajax({
+ type: 'post',
+ url: val,
+ dataType: 'json',
+ success: function (json) {
+ $(idstr).empty();
+ $.each(json, function (n, value) {
+ $(idstr).append("");
+ });
+ $(idstr).btComboBox();
+ _this.setDef(idstr, defval);
+ }
+ });
+ }
} else {
$(idstr).btComboBox();
_this.setDef(idstr, defval);
}
}
-
}
\ No newline at end of file
diff --git a/src/views/car/CarGoodsAdminView.vue b/src/views/car/CarGoodsAdminView.vue
index 3bd3fb3..1e4016a 100644
--- a/src/views/car/CarGoodsAdminView.vue
+++ b/src/views/car/CarGoodsAdminView.vue
@@ -594,6 +594,15 @@ export default {
$("#radishRenewPrice").val("");
$("#radishOriginalPrice").val("");
+ $("input:radio[name='goldSale']")[0].checked = true;
+ $("input:radio[name='radishSale']")[0].checked = true;
+ $("input:radio[name='enable']")[0].checked = true;
+ $("input:radio[name='isSale']")[0].checked = true;
+ $("input:radio[name='isNobleLimit']")[0].checked = true;
+ $("input:radio[name='isMonsterLimit']")[0].checked = true;
+ $("input:radio[name='isWeekStarLimit']")[0].checked = true;
+ $("input:radio[name='isActivityLimit']")[0].checked = true;
+
$("#nobleId").btComboBox('disable');
ComboboxHelper.setDef("#nobleId", '0');
diff --git a/src/views/treasure/SeizeTreasureConvertItemView.vue b/src/views/treasure/SeizeTreasureConvertItemView.vue
index 953820c..0f3a749 100644
--- a/src/views/treasure/SeizeTreasureConvertItemView.vue
+++ b/src/views/treasure/SeizeTreasureConvertItemView.vue
@@ -358,7 +358,7 @@ export default {
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
- return '';
+ return '' + '';
}
}
],
@@ -490,6 +490,29 @@ export default {
});
}
});
+
+ $('#table').on('click', '.opt-del', function () {
+ const currentData = $('#table').bootstrapTable('getData')[$(this).data('index')];
+ var id = currentData.id;
+ const msg = '确定要删除吗?';
+ if (confirm(msg)) {
+ $.ajax({
+ type: "get",
+ url: "/admin/seize-treasure/convert/item/del?id=" + id,
+ dataType: "json",
+ success: function (json) {
+ if (json.success == 'true' || json.code == 200) {
+ $("#tipMsg").text("删除成功");
+ $("#tipModal").modal('show');
+ TableHelper.doRefresh("#table");
+ } else {
+ $("#tipMsg").text("删除失败." + json.message);
+ $("#tipModal").modal('show');
+ }
+ }
+ });
+ }
+ });
});
}
},
diff --git a/src/views/treasure/SeizeTreasurePoolItemView.vue b/src/views/treasure/SeizeTreasurePoolItemView.vue
index 2e616bf..0e2e337 100644
--- a/src/views/treasure/SeizeTreasurePoolItemView.vue
+++ b/src/views/treasure/SeizeTreasurePoolItemView.vue
@@ -279,7 +279,7 @@ export default {
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
- return '';
+ return '' + '';
}
}
],
@@ -365,6 +365,29 @@ export default {
});
$("#deployedModal").modal('show');
});
+
+ $('#table').on('click', '.opt-del', function () {
+ const currentData = $('#table').bootstrapTable('getData')[$(this).data('index')];
+ var id = currentData.id;
+ const msg = '确定要删除吗?';
+ if (confirm(msg)) {
+ $.ajax({
+ type: "get",
+ url: "/admin/seize-treasure/pool/item/del?id=" + id,
+ dataType: "json",
+ success: function (json) {
+ if (json.success == 'true' || json.code == 200) {
+ $("#tipMsg").text("删除成功");
+ $("#tipModal").modal('show');
+ TableHelper.doRefresh("#table");
+ } else {
+ $("#tipMsg").text("删除失败." + json.message);
+ $("#tipModal").modal('show');
+ }
+ }
+ });
+ }
+ });
},
optEdit() {
$('#table').on('click', '.opt-edit', function () {
diff --git a/src/views/treasure/SeizeTreasureRewardView.vue b/src/views/treasure/SeizeTreasureRewardView.vue
index 78425df..288359f 100644
--- a/src/views/treasure/SeizeTreasureRewardView.vue
+++ b/src/views/treasure/SeizeTreasureRewardView.vue
@@ -340,7 +340,7 @@ export default {
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
- return '';
+ return '' + '';
}
}
],
@@ -501,6 +501,29 @@ export default {
}
});
});
+
+ $('#table').on('click', '.opt-del', function () {
+ const currentData = $('#table').bootstrapTable('getData')[$(this).data('index')];
+ var id = currentData.id;
+ const msg = '确定要删除吗?';
+ if (confirm(msg)) {
+ $.ajax({
+ type: "get",
+ url: "/admin/seize-treasure/reward/del?id=" + id,
+ dataType: "json",
+ success: function (json) {
+ if (json.success == 'true' || json.code == 200) {
+ $("#tipMsg").text("删除成功");
+ $("#tipModal").modal('show');
+ TableHelper.doRefresh("#table");
+ } else {
+ $("#tipMsg").text("删除失败." + json.message);
+ $("#tipModal").modal('show');
+ }
+ }
+ });
+ }
+ });
}
},
unmounted() {