|
|
@@ -106,8 +106,10 @@
|
|
|
<el-checkbox v-model="row.autoIncrease"></el-checkbox>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column width="60" align="center">
|
|
|
- <template slot-scope="{ row, column, $index }" v-if="$index>1">
|
|
|
+ <el-table-column width="130" align="center">
|
|
|
+ <template slot-scope="{ row, column, $index }" v-if="$index>1||formData.dataBaseType!='Mysql'">
|
|
|
+ <el-button @click="moveUp($index)" size="small" type="text">上移</el-button>
|
|
|
+ <el-button @click="moveDown($index)" size="small" type="text">下移</el-button>
|
|
|
<el-button @click="removeField($index)" size="small" type="text">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -502,7 +504,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
removeField(i) {
|
|
|
- if (this.fields.length > 1) {
|
|
|
+ if (this.fields.length > 0) {
|
|
|
this.fields.splice(i, 1);
|
|
|
}
|
|
|
},
|
|
|
@@ -577,6 +579,41 @@ export default {
|
|
|
this.subtables.splice(i, 1);
|
|
|
}
|
|
|
},
|
|
|
+ moveUp(i) {
|
|
|
+ if (i > 0) {
|
|
|
+
|
|
|
+ var tempFields = [...this.fields];
|
|
|
+ var tempField = tempFields[i - 1];
|
|
|
+
|
|
|
+
|
|
|
+ tempFields[i - 1] = tempFields[i];
|
|
|
+ tempFields[i] = tempField;
|
|
|
+
|
|
|
+ this.fields = tempFields;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ moveDown(i) {
|
|
|
+ if (this.fields.length - 1 > i) {
|
|
|
+
|
|
|
+ var tempFields = [...this.fields];
|
|
|
+
|
|
|
+ var tempField = tempFields[i + 1];
|
|
|
+
|
|
|
+
|
|
|
+ tempFields[i + 1] = tempFields[i];
|
|
|
+ tempFields[i] = tempField;
|
|
|
+
|
|
|
+ this.fields = tempFields;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
|
|
|
}
|
|
|
}
|