From 070dd3ec9ad599e9c668351ce3d0bd78b54f9745 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期四, 12 三月 2026 15:10:33 +0800
Subject: [PATCH] #
---
src/main/webapp/static/js/config/config.js | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 52 insertions(+), 0 deletions(-)
diff --git a/src/main/webapp/static/js/config/config.js b/src/main/webapp/static/js/config/config.js
index a3e61fe..55aedab 100644
--- a/src/main/webapp/static/js/config/config.js
+++ b/src/main/webapp/static/js/config/config.js
@@ -998,6 +998,37 @@
}
];
+ function applySelectTypeOptions(options) {
+ var normalizedOptions = [];
+ (options || []).forEach(function (item) {
+ var rawValue = '';
+ var label = '';
+ if (item && typeof item === 'object') {
+ rawValue = item.value !== undefined ? item.value : (item.rawValue !== undefined ? item.rawValue : (item.label !== undefined ? item.label : ''));
+ label = item.label !== undefined ? item.label : rawValue;
+ } else {
+ rawValue = item;
+ label = item;
+ }
+ rawValue = isEmptyValue(rawValue) ? '' : String(rawValue);
+ label = isEmptyValue(label) ? rawValue : String(label);
+ if (!rawValue) {
+ return;
+ }
+ normalizedOptions.push({
+ rawValue: rawValue,
+ label: label
+ });
+ });
+ fieldMeta.forEach(function (field) {
+ if (field.field !== 'selectType') {
+ return;
+ }
+ field.kind = 'enum';
+ field.enumOptions = normalizedOptions;
+ });
+ }
+
function isEmptyValue(value) {
return value === null || value === undefined || value === '';
}
@@ -1436,6 +1467,7 @@
}
},
created: function () {
+ this.fetchSelectTypeOptions();
this.loadTable();
},
mounted: function () {
@@ -1583,6 +1615,26 @@
}
});
},
+ fetchSelectTypeOptions: function () {
+ var self = this;
+ $.ajax({
+ url: baseUrl + '/config/getSelectTypes',
+ method: 'POST',
+ headers: self.authHeaders(),
+ success: function (res) {
+ if (self.handleForbidden(res)) {
+ return;
+ }
+ if (!res || res.code !== 200) {
+ return;
+ }
+ applySelectTypeOptions(Array.isArray(res.data) ? res.data : []);
+ self.fieldMeta = fieldMeta.slice();
+ self.allColumns = fieldMeta.slice();
+ self.requestTableLayout(80);
+ }
+ });
+ },
handleSearch: function () {
this.page.curr = 1;
this.loadTable();
--
Gitblit v1.9.1