Explorar el Código

!1192 库表管理时,新增表的时候,上移或下移列出现索引越界问题
Merge pull request !1192 from 轻风2016/next

zuohuaijun hace 1 año
padre
commit
0575d4c449
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. 7 0
      Web/src/views/system/database/component/addTable.vue

+ 7 - 0
Web/src/views/system/database/component/addTable.vue

@@ -300,6 +300,13 @@ function handleColDown(record: EditRecordRow, index: number) {
 }
 
 function ChangeExForArray(index1: number, index2: number, array: Array<EditRecordRow>) {
+	let maxIndex = state.tableData.length - 1;//最大索引
+    if (index2 > maxIndex) {
+        index2 = 0;
+    };
+    if (index2 < 0) {
+        index2 = maxIndex;
+    }
 	let temp = array[index1];
 	array[index1] = array[index2];
 	array[index2] = temp;