From ce958810cabd72b5ee6bc4b9433633b0230bcfdd Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 04 五月 2026 22:51:57 +0800
Subject: [PATCH] # WCS输送站点、堆垛机配置页面参数增加可视化配置V3.0.1.5
---
src/main/webapp/static/js/basDualCrnp/basDualCrnp.js | 136 +++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 130 insertions(+), 6 deletions(-)
diff --git a/src/main/webapp/static/js/basDualCrnp/basDualCrnp.js b/src/main/webapp/static/js/basDualCrnp/basDualCrnp.js
index b6e5e77..aa918eb 100644
--- a/src/main/webapp/static/js/basDualCrnp/basDualCrnp.js
+++ b/src/main/webapp/static/js/basDualCrnp/basDualCrnp.js
@@ -194,7 +194,7 @@
required: false,
primaryKey: false,
sortable: false,
- textarea: false,
+ textarea: true,
minWidth: 134,
enumOptions: [],
foreignQuery: '',
@@ -212,7 +212,7 @@
required: false,
primaryKey: false,
sortable: false,
- textarea: false,
+ textarea: true,
minWidth: 116,
enumOptions: [],
foreignQuery: '',
@@ -230,7 +230,7 @@
required: false,
primaryKey: false,
sortable: false,
- textarea: false,
+ textarea: true,
minWidth: 110,
enumOptions: [],
foreignQuery: '',
@@ -248,7 +248,7 @@
required: false,
primaryKey: false,
sortable: false,
- textarea: false,
+ textarea: true,
minWidth: 110,
enumOptions: [],
foreignQuery: '',
@@ -302,7 +302,7 @@
required: false,
primaryKey: false,
sortable: false,
- textarea: false,
+ textarea: true,
minWidth: 170,
enumOptions: [],
foreignQuery: '',
@@ -320,7 +320,7 @@
required: false,
primaryKey: false,
sortable: false,
- textarea: false,
+ textarea: true,
minWidth: 170,
enumOptions: [],
foreignQuery: '',
@@ -735,6 +735,10 @@
tableResizeHandler: null,
dialogForm: createFormDefaults(),
dialogDisplay: createDisplayDefaults(),
+ stationEditorFields: ['inStationList', 'outStationList'],
+ intArray2dFields: ['controlRows'],
+ intArrayFields: ['disableStationOneBays', 'disableStationTwoBays', 'deepRows'],
+ jsonEditorRows: {},
dialogRules: createFormRules()
};
},
@@ -968,6 +972,7 @@
resetDialogState: function () {
this.dialogForm = createFormDefaults();
this.dialogDisplay = createDisplayDefaults();
+ this.jsonEditorRows = {};
if (this.$refs.dialogForm) {
this.$refs.dialogForm.clearValidate();
}
@@ -984,6 +989,7 @@
self.$nextTick(function () {
self.resetDialogState();
fillFormFromRow(row, self.dialogForm, self.dialogDisplay);
+ self.initJsonEditorRows();
if (self.$refs.dialogForm) {
self.$refs.dialogForm.clearValidate();
}
@@ -992,6 +998,12 @@
submitDialog: function () {
var self = this;
if (!self.$refs.dialogForm) {
+ return;
+ }
+ self.syncAllJsonEditors();
+ var jsonError = self.validateAllJsonEditors();
+ if (jsonError) {
+ self.$message.warning(jsonError);
return;
}
self.$refs.dialogForm.validate(function (valid) {
@@ -1025,6 +1037,118 @@
return true;
});
},
+ initJsonEditorRows: function () {
+ var self = this;
+ var editors = window.WcsJsonEditors;
+ self.stationEditorFields.forEach(function (field) {
+ self.$set(self.jsonEditorRows, field, editors.parseStationList(self.dialogForm[field]));
+ });
+ self.intArray2dFields.forEach(function (field) {
+ self.$set(self.jsonEditorRows, field, editors.parseIntArray2D(self.dialogForm[field]));
+ });
+ self.intArrayFields.forEach(function (field) {
+ self.$set(self.jsonEditorRows, field, editors.parseIntArray(self.dialogForm[field]));
+ });
+ },
+ syncAllJsonEditors: function () {
+ var self = this;
+ var editors = window.WcsJsonEditors;
+ self.stationEditorFields.forEach(function (field) {
+ self.$set(self.dialogForm, field, editors.buildStationListJson(self.jsonEditorRows[field]));
+ });
+ self.intArray2dFields.forEach(function (field) {
+ self.$set(self.dialogForm, field, editors.buildIntArray2DJson(self.jsonEditorRows[field]));
+ });
+ self.intArrayFields.forEach(function (field) {
+ self.$set(self.dialogForm, field, editors.buildIntArrayJson(self.jsonEditorRows[field]));
+ });
+ },
+ validateAllJsonEditors: function () {
+ var self = this;
+ var editors = window.WcsJsonEditors;
+ var error = '';
+ self.stationEditorFields.forEach(function (field) {
+ if (error) return;
+ error = editors.validateStationList(self.jsonEditorRows[field]);
+ });
+ self.intArray2dFields.forEach(function (field) {
+ if (error) return;
+ error = editors.validateIntArray2D(self.jsonEditorRows[field]);
+ });
+ self.intArrayFields.forEach(function (field) {
+ if (error) return;
+ error = editors.validateIntArray(self.jsonEditorRows[field]);
+ });
+ return error;
+ },
+ addStationRow: function (field) {
+ if (!this.jsonEditorRows[field]) {
+ this.$set(this.jsonEditorRows, field, []);
+ }
+ this.jsonEditorRows[field].push(window.WcsJsonEditors.createEmptyStation());
+ this.syncAllJsonEditors();
+ },
+ removeStationRow: function (field, index) {
+ this.jsonEditorRows[field].splice(index, 1);
+ this.syncAllJsonEditors();
+ },
+ toggleNested: function (field, rowIndex, nestedKey) {
+ var row = this.jsonEditorRows[field][rowIndex];
+ var showKey = '_show' + nestedKey.charAt(0).toUpperCase() + nestedKey.slice(1);
+ this.$set(row, showKey, !row[showKey]);
+ },
+ addNestedStation: function (field, rowIndex, nestedKey) {
+ var row = this.jsonEditorRows[field][rowIndex];
+ var nested = {};
+ window.WcsJsonEditors.STATION_OBJ_FIELDS.forEach(function (k) { nested[k] = ''; });
+ this.$set(row, nestedKey, nested);
+ var showKey = '_show' + nestedKey.charAt(0).toUpperCase() + nestedKey.slice(1);
+ this.$set(row, showKey, true);
+ this.syncAllJsonEditors();
+ },
+ removeNestedStation: function (field, rowIndex, nestedKey) {
+ this.$set(this.jsonEditorRows[field][rowIndex], nestedKey, null);
+ this.syncAllJsonEditors();
+ },
+ syncStationField: function (field) {
+ this.$set(this.dialogForm, field, window.WcsJsonEditors.buildStationListJson(this.jsonEditorRows[field]));
+ },
+ addIntArray2DGroup: function (field) {
+ if (!this.jsonEditorRows[field]) {
+ this.$set(this.jsonEditorRows, field, []);
+ }
+ this.jsonEditorRows[field].push({ values: [''] });
+ this.syncAllJsonEditors();
+ },
+ removeIntArray2DGroup: function (field, index) {
+ this.jsonEditorRows[field].splice(index, 1);
+ this.syncAllJsonEditors();
+ },
+ addIntArray2DValue: function (field, groupIndex) {
+ this.jsonEditorRows[field][groupIndex].values.push('');
+ this.syncAllJsonEditors();
+ },
+ removeIntArray2DValue: function (field, groupIndex, valueIndex) {
+ this.jsonEditorRows[field][groupIndex].values.splice(valueIndex, 1);
+ this.syncAllJsonEditors();
+ },
+ syncIntArray2DField: function (field) {
+ this.$set(this.dialogForm, field, window.WcsJsonEditors.buildIntArray2DJson(this.jsonEditorRows[field]));
+ },
+ addIntArrayValue: function (field) {
+ if (!this.jsonEditorRows[field]) {
+ this.$set(this.jsonEditorRows, field, []);
+ }
+ this.jsonEditorRows[field].push('');
+ this.syncAllJsonEditors();
+ },
+ removeIntArrayValue: function (field, index) {
+ this.jsonEditorRows[field].splice(index, 1);
+ this.syncAllJsonEditors();
+ },
+ syncIntArrayField: function (field) {
+ this.$set(this.dialogForm, field, window.WcsJsonEditors.buildIntArrayJson(this.jsonEditorRows[field]));
+ },
removeSelection: function () {
var self = this;
var ids = self.selection.map(function (row) {
--
Gitblit v1.9.1