diff --git a/src/assets/icons/FuZhi.vue b/src/assets/icons/FuZhi.vue
new file mode 100644
index 0000000..8542a93
--- /dev/null
+++ b/src/assets/icons/FuZhi.vue
@@ -0,0 +1,3 @@
+
+
+
diff --git a/src/assets/icons/ShanChu.vue b/src/assets/icons/ShanChu.vue
new file mode 100644
index 0000000..073ae21
--- /dev/null
+++ b/src/assets/icons/ShanChu.vue
@@ -0,0 +1,3 @@
+
+
+
diff --git a/src/utils/tools.ts b/src/utils/tools.ts
index 11ffb16..dc99e3a 100644
--- a/src/utils/tools.ts
+++ b/src/utils/tools.ts
@@ -161,7 +161,59 @@ const tools = {
} else {
return '未知'
}
+ },
+ // 数组0 - index
+ array: {
+ // 交换
+ swap(arr: Array, index1: number, index2: number) {
+ arr[index1] = arr.splice(index2, 1, arr[index1])[0];
+ return arr;
+ },
+ zIndexUp(arr, index) {
+ if (index !== 0) {
+ this.swap(arr, index, index - 1);
+ }
+ },
+ zIndexDown(arr, index) {
+ if (index + 1 < arr.length) {
+ this.swap(arr, index, index + 1);
+ }
+ },
+ zIndexTop(arr, index) {
+ if (index > 0) {
+ const moveNum = index - 0;
+ for (let i = 0; i < moveNum; i++) {
+ this.swap(arr, index, index - 1);
+ index--;
+ }
+ }
+ },
+ zIndexBottom(arr, index) {
+ if (index + 1 < arr.length) {
+ const moveNum = arr.length - 1 - index;
+ for (let i = 0; i < moveNum; i++) {
+ this.swap(arr, index, index + 1);
+ index++;
+ }
+ }
+ },
+ // index1 >>> index2
+ zIndexTo(arr, index1, index2) {
+ if (index1 === index2) return;
+ if (index1 < index2) {
+ const moveNum = index2 - 1 - index1;
+ for (let i = 0; i < moveNum; i++) {
+ this.swap(arr, index1, index1 + 1);
+ index1++;
+ }
+ } else {
+ const moveNum = index1 - index2;
+ for (let i = 0; i < moveNum; i++) {
+ this.swap(arr, index1, index1 - 1);
+ index1--;
+ }
+ }
+ }
}
}
-
export default tools
diff --git a/src/views/tools/form/center.vue b/src/views/tools/form/center.vue
index 0f2ca1a..c652bd9 100644
--- a/src/views/tools/form/center.vue
+++ b/src/views/tools/form/center.vue
@@ -1,32 +1,30 @@
-
-
+
+
-
-
-
-
-
+
@@ -34,11 +32,15 @@