奖品设置修改为搜索框

This commit is contained in:
liaozetao
2023-10-23 12:32:38 +08:00
parent 815356ce7f
commit 059d43db48
2 changed files with 5 additions and 3 deletions

View File

@@ -32,10 +32,10 @@ export default {
build: function (val, idstr, defval) { build: function (val, idstr, defval) {
var _this = this; var _this = this;
if (val) { if (val) {
if (Object.prototype.toString.call(val) === '[object Object]') { if (Object.prototype.toString.call(val) === '[object Array]') {
$(idstr).empty(); $(idstr).empty();
$.each(val, function (n, value) { $.each(val, function (n, obj) {
$(idstr).append("<option value='" + value.oval + "' data-value='" + value.oval + "'>" + value.otxt + "</option>"); $(idstr).append("<option value='" + obj.value + "' data-value='" + obj.value + "'>" + obj.text + "</option>");
}); });
$(idstr).btComboBox(); $(idstr).btComboBox();
_this.setDef(idstr, defval); _this.setDef(idstr, defval);

View File

@@ -131,6 +131,7 @@
<script> <script>
import TableHelper from '@/utils/bootstrap-table-helper'; import TableHelper from '@/utils/bootstrap-table-helper';
import ComboboxHelper from '@/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper';
import { isNumber } from '@/utils/string'; import { isNumber } from '@/utils/string';
export default { export default {
@@ -258,6 +259,7 @@ export default {
$select.append($option); $select.append($option);
} }
$div.append($select); $div.append($select);
ComboboxHelper.build(options, '#rewardRefId', rewardRefId);
} else { } else {
var $input = $('<input/>'); var $input = $('<input/>');
$input.attr('type', 'text'); $input.attr('type', 'text');