|
@@ -44,6 +44,7 @@
|
|
>
|
|
>
|
|
<el-input
|
|
<el-input
|
|
v-model="scope.row.fieldName"
|
|
v-model="scope.row.fieldName"
|
|
|
|
+ :disabled="scope.$index == 0"
|
|
@blur="fieldNameChange(scope.row)"
|
|
@blur="fieldNameChange(scope.row)"
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -57,7 +58,7 @@
|
|
style="margin: 0px; padding: 0px"
|
|
style="margin: 0px; padding: 0px"
|
|
>
|
|
>
|
|
<el-select
|
|
<el-select
|
|
- :disabled="!scope.row.fieldName"
|
|
|
|
|
|
+ :disabled="scope.$index == 0"
|
|
v-model="scope.row.fieldType"
|
|
v-model="scope.row.fieldType"
|
|
filterable
|
|
filterable
|
|
@blur="selectBlur(scope)"
|
|
@blur="selectBlur(scope)"
|
|
@@ -100,7 +101,7 @@
|
|
<el-input
|
|
<el-input
|
|
v-model="scope.row.fieldLength"
|
|
v-model="scope.row.fieldLength"
|
|
@blur="fieldLengthChange(scope.$index, scope.row)"
|
|
@blur="fieldLengthChange(scope.$index, scope.row)"
|
|
- :disabled="changduclick(scope.$index) || !scope.row.fieldName"
|
|
|
|
|
|
+ :disabled="changduclick(scope.$index) || scope.$index == 0"
|
|
@input="
|
|
@input="
|
|
scope.row.fieldLength = scope.row.fieldLength.replace(
|
|
scope.row.fieldLength = scope.row.fieldLength.replace(
|
|
/^(0+)|[^\d]+/g,
|
|
/^(0+)|[^\d]+/g,
|
|
@@ -115,7 +116,7 @@
|
|
<el-table-column prop="isNull" label="不是null" width="100">
|
|
<el-table-column prop="isNull" label="不是null" width="100">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-checkbox
|
|
<el-checkbox
|
|
- :disabled="!scope.row.fieldName"
|
|
|
|
|
|
+ :disabled="scope.$index == 0"
|
|
@change="isNullChange(scope.row)"
|
|
@change="isNullChange(scope.row)"
|
|
v-model="scope.row.isNull"
|
|
v-model="scope.row.isNull"
|
|
></el-checkbox>
|
|
></el-checkbox>
|
|
@@ -125,7 +126,7 @@
|
|
<el-table-column prop="isPrimary" label="主键" width="100">
|
|
<el-table-column prop="isPrimary" label="主键" width="100">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-checkbox
|
|
<el-checkbox
|
|
- :disabled="!scope.row.fieldName"
|
|
|
|
|
|
+ :disabled="scope.$index == 0"
|
|
v-model="scope.row.isPrimary"
|
|
v-model="scope.row.isPrimary"
|
|
@change="hanleCheckbox(scope.$index, scope.row)"
|
|
@change="hanleCheckbox(scope.$index, scope.row)"
|
|
></el-checkbox>
|
|
></el-checkbox>
|
|
@@ -135,7 +136,7 @@
|
|
<el-table-column prop="isAuto" label="自增" width="100">
|
|
<el-table-column prop="isAuto" label="自增" width="100">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-checkbox
|
|
<el-checkbox
|
|
- :disabled="!scope.row.fieldName"
|
|
|
|
|
|
+ :disabled="scope.$index == 0"
|
|
@change="isAutoChange(scope.row)"
|
|
@change="isAutoChange(scope.row)"
|
|
v-model="scope.row.isAuto"
|
|
v-model="scope.row.isAuto"
|
|
></el-checkbox>
|
|
></el-checkbox>
|
|
@@ -145,7 +146,7 @@
|
|
<el-table-column prop="fieldDescription" label="字段描述" width="200">
|
|
<el-table-column prop="fieldDescription" label="字段描述" width="200">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-input
|
|
<el-input
|
|
- :disabled="!scope.row.fieldName"
|
|
|
|
|
|
+ :disabled="scope.$index == 0"
|
|
@change="fieldDescriptionChange(scope.row)"
|
|
@change="fieldDescriptionChange(scope.row)"
|
|
v-model="scope.row.fieldDescription"
|
|
v-model="scope.row.fieldDescription"
|
|
></el-input>
|
|
></el-input>
|
|
@@ -160,6 +161,7 @@
|
|
size="mini"
|
|
size="mini"
|
|
type="danger"
|
|
type="danger"
|
|
icon="el-icon-delete"
|
|
icon="el-icon-delete"
|
|
|
|
+ :disabled="scope.$index == 0"
|
|
@click="handleDeleteExperience(scope.$index, scope.row)"
|
|
@click="handleDeleteExperience(scope.$index, scope.row)"
|
|
>删除
|
|
>删除
|
|
</el-button>
|
|
</el-button>
|
|
@@ -214,11 +216,11 @@ export default {
|
|
experienceData: [
|
|
experienceData: [
|
|
{
|
|
{
|
|
fieldName: "id",
|
|
fieldName: "id",
|
|
- fieldType: "",
|
|
|
|
|
|
+ fieldType: "bigint",
|
|
fieldLength: undefined,
|
|
fieldLength: undefined,
|
|
isNull: true,
|
|
isNull: true,
|
|
isPrimary: true,
|
|
isPrimary: true,
|
|
- fieldDescription: "",
|
|
|
|
|
|
+ fieldDescription: "主键",
|
|
isAuto: true,
|
|
isAuto: true,
|
|
},
|
|
},
|
|
],
|
|
],
|
|
@@ -614,6 +616,7 @@ export default {
|
|
},
|
|
},
|
|
// 下拉选中事件 // 处理选中类型后长度输入框是否禁用
|
|
// 下拉选中事件 // 处理选中类型后长度输入框是否禁用
|
|
handleSelected(tem, scope, index, val) {
|
|
handleSelected(tem, scope, index, val) {
|
|
|
|
+ console.log(val);
|
|
if (val) {
|
|
if (val) {
|
|
//判断是否是由change事件触发的函数
|
|
//判断是否是由change事件触发的函数
|
|
this.fieldTypeChange(index, val);
|
|
this.fieldTypeChange(index, val);
|
|
@@ -747,9 +750,19 @@ export default {
|
|
this.$delete(this.tableform, "fieldLength" + delindex);
|
|
this.$delete(this.tableform, "fieldLength" + delindex);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+ // 校验表格数据完整性
|
|
|
|
+ validateTableData() {
|
|
|
|
+ return this.experienceData.every((item) => {
|
|
|
|
+ return item.fieldName && item.fieldType;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
//增加经验行
|
|
//增加经验行
|
|
handleAddExperienceline() {
|
|
handleAddExperienceline() {
|
|
|
|
+ let flag = this.validateTableData();
|
|
|
|
+ if (!flag) {
|
|
|
|
+ this.$message.error("请完善表单信息");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
if (this.experienceData == undefined) {
|
|
if (this.experienceData == undefined) {
|
|
this.experienceData = new Array();
|
|
this.experienceData = new Array();
|
|
}
|
|
}
|