|
@@ -5,64 +5,64 @@
|
|
|
<!-- <el-form-item label="数据库名称" prop="dataBaseName">
|
|
|
<el-input v-model="form.dataBaseName" style="width: 600px;"></el-input>
|
|
|
</el-form-item> -->
|
|
|
- <el-form-item label="数据表名称" prop="tableName">
|
|
|
+ <el-form-item :label="$t('dataModeling.dataTableName')" prop="tableName">
|
|
|
<el-input
|
|
|
- v-model="form.tableName"
|
|
|
- :disabled="isEdited"
|
|
|
- style="width: 600px"
|
|
|
+ v-model="form.tableName"
|
|
|
+ :disabled="isEdited"
|
|
|
+ style="width: 600px"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="表描述">
|
|
|
+ <el-form-item :label="$t('dataModeling.tableName')">
|
|
|
<el-input v-model="form.tableComment" style="width: 600px"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-card>
|
|
|
<el-card>
|
|
|
<div class="titleitem">
|
|
|
- <span>数据表字段</span>
|
|
|
+ <span>{{ $t('dataModeling.dataTableField') }}</span>
|
|
|
</div>
|
|
|
<el-form ref="tableform" :rules="tableform" :model="experienceDataForm">
|
|
|
<el-table
|
|
|
- ref="dragTable"
|
|
|
- :data="experienceData"
|
|
|
- stripe
|
|
|
- row-key="tag"
|
|
|
- style="width: 100%"
|
|
|
+ ref="dragTable"
|
|
|
+ :data="experienceData"
|
|
|
+ stripe
|
|
|
+ row-key="tag"
|
|
|
+ style="width: 100%"
|
|
|
>
|
|
|
<el-table-column
|
|
|
- type="index"
|
|
|
- label="序号"
|
|
|
- width="50"
|
|
|
- class-name="allowDrag"
|
|
|
+ type="index"
|
|
|
+ :label="$t('dataModeling.No')"
|
|
|
+ width="50"
|
|
|
+ class-name="allowDrag"
|
|
|
/>
|
|
|
- <el-table-column prop="fieldName" label="字段名称" width="200">
|
|
|
+ <el-table-column prop="fieldName" :label="$t('dataModeling.fieldName')" width="200">
|
|
|
<template slot-scope="scope">
|
|
|
<el-form-item
|
|
|
- :prop="'fieldName' + scope.$index"
|
|
|
- :name="'fieldName' + scope.$index"
|
|
|
- style="margin: 0px; padding: 0px"
|
|
|
+ :prop="'fieldName' + scope.$index"
|
|
|
+ :name="'fieldName' + scope.$index"
|
|
|
+ style="margin: 0px; padding: 0px"
|
|
|
>
|
|
|
<el-input
|
|
|
- v-model="scope.row.fieldName"
|
|
|
- :disabled="scope.$index == 0"
|
|
|
- @blur="fieldNameChange(scope.row)"
|
|
|
+ v-model="scope.row.fieldName"
|
|
|
+ :disabled="scope.$index == 0"
|
|
|
+ @blur="fieldNameChange(scope.row)"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="fieldType" label="字段类型" width="200">
|
|
|
+ <el-table-column prop="fieldType" :label="$t('dataModeling.fieldType')" width="200">
|
|
|
<template slot-scope="scope">
|
|
|
<el-form-item
|
|
|
- :prop="'fieldType' + scope.$index"
|
|
|
- :name="'fieldType' + scope.$index"
|
|
|
- style="margin: 0px; padding: 0px"
|
|
|
+ :prop="'fieldType' + scope.$index"
|
|
|
+ :name="'fieldType' + scope.$index"
|
|
|
+ style="margin: 0px; padding: 0px"
|
|
|
>
|
|
|
<el-select
|
|
|
- :disabled="scope.$index == 0"
|
|
|
- v-model="scope.row.fieldType"
|
|
|
- filterable
|
|
|
- @blur="selectBlur(scope)"
|
|
|
- @change="
|
|
|
+ :disabled="scope.$index == 0"
|
|
|
+ v-model="scope.row.fieldType"
|
|
|
+ filterable
|
|
|
+ @blur="selectBlur(scope)"
|
|
|
+ @change="
|
|
|
handleSelected(
|
|
|
dataType.find(
|
|
|
(item) => item.label === scope.row.fieldType
|
|
@@ -79,30 +79,30 @@
|
|
|
<el-option v-for="item in dict.type.mysql_data_type" :label="item.dictLabel" :value="item.dictValue">
|
|
|
</el-option> -->
|
|
|
<el-option
|
|
|
- v-for="item in dataType"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
+ v-for="item in dataType"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column prop="fieldLength" label="长度" width="200">
|
|
|
+ <el-table-column prop="fieldLength" :label="$t('dataModeling.length')" width="200">
|
|
|
<template slot-scope="scope">
|
|
|
<el-form-item
|
|
|
- :prop="'fieldLength' + scope.$index"
|
|
|
- :name="'fieldLength' + scope.$index"
|
|
|
- style="margin: 0px; padding: 0px"
|
|
|
+ :prop="'fieldLength' + scope.$index"
|
|
|
+ :name="'fieldLength' + scope.$index"
|
|
|
+ style="margin: 0px; padding: 0px"
|
|
|
>
|
|
|
<!-- <el-input v-model="scope.row.fieldLength"-->
|
|
|
<!-- :disabled="handleSelected(dict.type.mysql_data_type.find(item => item.label === scope.row.fieldType), scope)"></el-input>-->
|
|
|
<el-input
|
|
|
- v-model="scope.row.fieldLength"
|
|
|
- @blur="fieldLengthChange(scope.$index, scope.row)"
|
|
|
- :disabled="changduclick(scope.$index) || scope.$index == 0"
|
|
|
- @input="
|
|
|
+ v-model="scope.row.fieldLength"
|
|
|
+ @blur="fieldLengthChange(scope.$index, scope.row)"
|
|
|
+ :disabled="changduclick(scope.$index) || scope.$index == 0"
|
|
|
+ @input="
|
|
|
scope.row.fieldLength = scope.row.fieldLength.replace(
|
|
|
/^(0+)|[^\d]+/g,
|
|
|
''
|
|
@@ -113,57 +113,57 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column prop="isNull" label="不是null" width="100">
|
|
|
+ <el-table-column prop="isNull" :label="$t('dataModeling.notNull')" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
<el-checkbox
|
|
|
- :disabled="scope.$index == 0"
|
|
|
- @change="isNullChange(scope.row)"
|
|
|
- v-model="scope.row.isNull"
|
|
|
+ :disabled="scope.$index == 0"
|
|
|
+ @change="isNullChange(scope.row)"
|
|
|
+ v-model="scope.row.isNull"
|
|
|
></el-checkbox>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column prop="isPrimary" label="主键" width="100">
|
|
|
+ <el-table-column prop="isPrimary" :label="$t('dataModeling.primaryKey')" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
<el-checkbox
|
|
|
- :disabled="scope.$index == 0"
|
|
|
- v-model="scope.row.isPrimary"
|
|
|
- @change="hanleCheckbox(scope.$index, scope.row)"
|
|
|
+ :disabled="scope.$index == 0"
|
|
|
+ v-model="scope.row.isPrimary"
|
|
|
+ @change="hanleCheckbox(scope.$index, scope.row)"
|
|
|
></el-checkbox>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column prop="isAuto" label="自增" width="100">
|
|
|
+ <el-table-column prop="isAuto" :label="$t('dataModeling.SelfIncrement')" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
<el-checkbox
|
|
|
- :disabled="scope.$index == 0"
|
|
|
- @change="isAutoChange(scope.row)"
|
|
|
- v-model="scope.row.isAuto"
|
|
|
+ :disabled="scope.$index == 0"
|
|
|
+ @change="isAutoChange(scope.row)"
|
|
|
+ v-model="scope.row.isAuto"
|
|
|
></el-checkbox>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column prop="fieldDescription" label="字段描述" width="200">
|
|
|
+ <el-table-column prop="fieldDescription" :label="$t('dataModeling.fieldDescription')" width="200">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input
|
|
|
- :disabled="scope.$index == 0"
|
|
|
- @change="fieldDescriptionChange(scope.row)"
|
|
|
- v-model="scope.row.fieldDescription"
|
|
|
+ :disabled="scope.$index == 0"
|
|
|
+ @change="fieldDescriptionChange(scope.row)"
|
|
|
+ v-model="scope.row.fieldDescription"
|
|
|
></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="operate" label="操作">
|
|
|
+ <el-table-column prop="operate" :label="$t('operation')">
|
|
|
<template slot-scope="scope">
|
|
|
<!-- <el-button size="mini" type="success" icon="el-icon-save"
|
|
|
@click="handlesaveExperience(scope.$index, scope.row)">保存
|
|
|
</el-button> -->
|
|
|
<el-button
|
|
|
- size="mini"
|
|
|
- type="danger"
|
|
|
- icon="el-icon-delete"
|
|
|
- :disabled="scope.$index == 0"
|
|
|
- @click="handleDeleteExperience(scope.$index, scope.row)"
|
|
|
- >删除
|
|
|
+ size="mini"
|
|
|
+ type="danger"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ :disabled="scope.$index == 0"
|
|
|
+ @click="handleDeleteExperience(scope.$index, scope.row)"
|
|
|
+ >{{$t('delete')}}
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -171,18 +171,18 @@
|
|
|
</el-form>
|
|
|
<div>
|
|
|
<el-button
|
|
|
- type="primary"
|
|
|
- icon="el-icon-plus"
|
|
|
- size="mini"
|
|
|
- @click="handleAddExperienceline"
|
|
|
- >新增字段
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ size="mini"
|
|
|
+ @click="handleAddExperienceline"
|
|
|
+ >{{$t('dataModeling.addField')}}
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
|
|
|
<div style="margin-top: 15px">
|
|
|
- <el-button v-if="!isEdited" @click="add" type="primary">添加</el-button>
|
|
|
- <el-button v-else @click="edit" type="primary">修改</el-button>
|
|
|
+ <el-button v-if="!isEdited" @click="add" type="primary">{{$t('dataModeling.add')}}</el-button>
|
|
|
+ <el-button v-else @click="edit" type="primary">{{$t('update')}}</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -220,7 +220,7 @@ export default {
|
|
|
fieldLength: undefined,
|
|
|
isNull: true,
|
|
|
isPrimary: true,
|
|
|
- fieldDescription: "主键",
|
|
|
+ fieldDescription: this.$t('dataModeling.primaryKey'),
|
|
|
isAuto: true,
|
|
|
},
|
|
|
],
|
|
@@ -282,19 +282,19 @@ export default {
|
|
|
let rulesAdd = {};
|
|
|
this.experienceData.forEach((item, index) => {
|
|
|
this.$set(
|
|
|
- this.experienceDataForm,
|
|
|
- "fieldName" + index,
|
|
|
- item.fieldName
|
|
|
+ this.experienceDataForm,
|
|
|
+ "fieldName" + index,
|
|
|
+ item.fieldName
|
|
|
);
|
|
|
this.$set(
|
|
|
- this.experienceDataForm,
|
|
|
- "fieldType" + index,
|
|
|
- item.fieldType
|
|
|
+ this.experienceDataForm,
|
|
|
+ "fieldType" + index,
|
|
|
+ item.fieldType
|
|
|
);
|
|
|
this.$set(
|
|
|
- this.experienceDataForm,
|
|
|
- "fieldLength" + index,
|
|
|
- item.fieldLength
|
|
|
+ this.experienceDataForm,
|
|
|
+ "fieldLength" + index,
|
|
|
+ item.fieldLength
|
|
|
);
|
|
|
// rulesAdd['' + index] = item.fieldName
|
|
|
// rulesAdd['fieldType' + index] = item.fieldType
|
|
@@ -318,12 +318,12 @@ export default {
|
|
|
}
|
|
|
//更改
|
|
|
this.modifySQLString.modify[row.oldVal.fieldName].fieldName =
|
|
|
- this.mysqlMotifySQLString("fieldName", row);
|
|
|
+ this.mysqlMotifySQLString("fieldName", row);
|
|
|
this.sqlStringList.push(this.mysqlMotifySQLString("fieldName", row));
|
|
|
} else if (row.fieldType) {
|
|
|
//新增
|
|
|
this.modifySQLString.addNew[row.fieldName] =
|
|
|
- this.mysqlMotifySQLString("addNew", row);
|
|
|
+ this.mysqlMotifySQLString("addNew", row);
|
|
|
this.sqlStringList.push(this.mysqlMotifySQLString("addNew", row));
|
|
|
}
|
|
|
}
|
|
@@ -337,12 +337,12 @@ export default {
|
|
|
}
|
|
|
if (row.oldVal) {
|
|
|
this.modifySQLString.modify[row.fieldName].fieldType =
|
|
|
- this.mysqlMotifySQLString("fieldType", row);
|
|
|
+ this.mysqlMotifySQLString("fieldType", row);
|
|
|
this.sqlStringList.push(this.mysqlMotifySQLString("fieldType", row));
|
|
|
} else if (row.fieldName) {
|
|
|
//新增
|
|
|
this.modifySQLString.addNew[row.fieldName] =
|
|
|
- this.mysqlMotifySQLString("addNew", row);
|
|
|
+ this.mysqlMotifySQLString("addNew", row);
|
|
|
this.sqlStringList.push(this.mysqlMotifySQLString("addNew", row));
|
|
|
}
|
|
|
}
|
|
@@ -356,9 +356,9 @@ export default {
|
|
|
}
|
|
|
if (row.oldVal) {
|
|
|
this.modifySQLString.modify[row.fieldName].fieldLength =
|
|
|
- this.mysqlMotifySQLString("fieldLength", row);
|
|
|
+ this.mysqlMotifySQLString("fieldLength", row);
|
|
|
this.sqlStringList.push(
|
|
|
- this.mysqlMotifySQLString("fieldLength", row)
|
|
|
+ this.mysqlMotifySQLString("fieldLength", row)
|
|
|
);
|
|
|
}
|
|
|
}
|
|
@@ -374,12 +374,12 @@ export default {
|
|
|
this.modifySQLString.modify[row.fieldName] = {};
|
|
|
}
|
|
|
this.modifySQLString.modify[row.fieldName].isNull = row.isNull
|
|
|
- ? this.mysqlMotifySQLString("NOT NULL", row)
|
|
|
- : this.mysqlMotifySQLString("NULL", row);
|
|
|
- this.sqlStringList.push(
|
|
|
- row.isNull
|
|
|
? this.mysqlMotifySQLString("NOT NULL", row)
|
|
|
- : this.mysqlMotifySQLString("NULL", row)
|
|
|
+ : this.mysqlMotifySQLString("NULL", row);
|
|
|
+ this.sqlStringList.push(
|
|
|
+ row.isNull
|
|
|
+ ? this.mysqlMotifySQLString("NOT NULL", row)
|
|
|
+ : this.mysqlMotifySQLString("NULL", row)
|
|
|
);
|
|
|
}
|
|
|
}
|
|
@@ -392,7 +392,7 @@ export default {
|
|
|
if (row.isPrimary && (!row.oldVal || !row.oldVal.isPrimary)) {
|
|
|
//添加新的主键
|
|
|
this.modifySQLString.modify[row.fieldName].addPrimary =
|
|
|
- this.mysqlMotifySQLString("primary", row);
|
|
|
+ this.mysqlMotifySQLString("primary", row);
|
|
|
this.sqlStringList.push(this.mysqlMotifySQLString("primary", row));
|
|
|
}
|
|
|
this.experienceData.forEach((item, index) => {
|
|
@@ -403,9 +403,9 @@ export default {
|
|
|
}
|
|
|
//去掉原来的主键
|
|
|
this.modifySQLString.delete[item.fieldName].dropPrimary =
|
|
|
- this.mysqlMotifySQLString("drop primary", item);
|
|
|
+ this.mysqlMotifySQLString("drop primary", item);
|
|
|
this.sqlStringList.push(
|
|
|
- this.mysqlMotifySQLString("drop primary", item)
|
|
|
+ this.mysqlMotifySQLString("drop primary", item)
|
|
|
);
|
|
|
}
|
|
|
item.isPrimary = false;
|
|
@@ -425,19 +425,19 @@ export default {
|
|
|
if (row.oldVal) {
|
|
|
if (row.oldVal.isAuto != row.isAuto) {
|
|
|
this.modifySQLString.modify[row.fieldName].increment = row.isAuto
|
|
|
- ? this.mysqlMotifySQLString("increment", row)
|
|
|
- : this.mysqlMotifySQLString("no increment", row);
|
|
|
+ ? this.mysqlMotifySQLString("increment", row)
|
|
|
+ : this.mysqlMotifySQLString("no increment", row);
|
|
|
sqlString = row.isAuto
|
|
|
- ? this.mysqlMotifySQLString("increment", row)
|
|
|
- : this.mysqlMotifySQLString("no increment", row);
|
|
|
+ ? this.mysqlMotifySQLString("increment", row)
|
|
|
+ : this.mysqlMotifySQLString("no increment", row);
|
|
|
}
|
|
|
} else {
|
|
|
this.modifySQLString.modify[row.fieldName].increment = row.isAuto
|
|
|
- ? this.mysqlMotifySQLString("increment", row)
|
|
|
- : this.mysqlMotifySQLString("no increment", row);
|
|
|
+ ? this.mysqlMotifySQLString("increment", row)
|
|
|
+ : this.mysqlMotifySQLString("no increment", row);
|
|
|
sqlString = row.isAuto
|
|
|
- ? this.mysqlMotifySQLString("increment", row)
|
|
|
- : this.mysqlMotifySQLString("no increment", row);
|
|
|
+ ? this.mysqlMotifySQLString("increment", row)
|
|
|
+ : this.mysqlMotifySQLString("no increment", row);
|
|
|
}
|
|
|
if (sqlString) {
|
|
|
this.sqlStringList.push(sqlString);
|
|
@@ -452,12 +452,12 @@ export default {
|
|
|
if (row.oldVal) {
|
|
|
if (row.oldVal.fieldDescription != row.fieldDescription) {
|
|
|
this.modifySQLString.modify[row.fieldName].fieldDescription =
|
|
|
- this.mysqlMotifySQLString("describe", row);
|
|
|
+ this.mysqlMotifySQLString("describe", row);
|
|
|
sqlString = this.mysqlMotifySQLString("describe", row);
|
|
|
}
|
|
|
} else {
|
|
|
this.modifySQLString.modify[row.fieldName].fieldDescription =
|
|
|
- this.mysqlMotifySQLString("describe", row);
|
|
|
+ this.mysqlMotifySQLString("describe", row);
|
|
|
sqlString = this.mysqlMotifySQLString("describe", row);
|
|
|
}
|
|
|
if (sqlString) {
|
|
@@ -470,8 +470,8 @@ export default {
|
|
|
let sqlString = "";
|
|
|
if (row.oldVal) {
|
|
|
this.modifySQLString.delete[row.fieldName] = this.mysqlMotifySQLString(
|
|
|
- "deleteField",
|
|
|
- row
|
|
|
+ "deleteField",
|
|
|
+ row
|
|
|
);
|
|
|
sqlString = this.mysqlMotifySQLString("deleteField", row);
|
|
|
}
|
|
@@ -486,7 +486,7 @@ export default {
|
|
|
// 拼接mysql的修改语句
|
|
|
mysqlMotifySQLString(type, row) {
|
|
|
let table_name = this.form.tableName,
|
|
|
- res = "ALTER TABLE";
|
|
|
+ res = "ALTER TABLE";
|
|
|
|
|
|
switch (type) {
|
|
|
case "fieldName": //改字段
|
|
@@ -518,7 +518,7 @@ export default {
|
|
|
break;
|
|
|
case "describe": //修改字段描述
|
|
|
res += ` ${table_name} MODIFY ${row.fieldName} ${row.fieldType}${
|
|
|
- row.fieldLength ? "" : "(" + row.fieldLength + ")"
|
|
|
+ row.fieldLength ? "" : "(" + row.fieldLength + ")"
|
|
|
} comment '${row.fieldDescription}';`;
|
|
|
break;
|
|
|
case "deleteField":
|
|
@@ -630,17 +630,17 @@ export default {
|
|
|
scope.row.fieldLength = "";
|
|
|
this.tableform["fieldLength" + scope.$index].required = false; // 禁用长度输入框的校验
|
|
|
return this.$set(
|
|
|
- this.experienceDataForm,
|
|
|
- "fieldType" + scope.$index,
|
|
|
- scope.row.fieldType
|
|
|
+ this.experienceDataForm,
|
|
|
+ "fieldType" + scope.$index,
|
|
|
+ scope.row.fieldType
|
|
|
);
|
|
|
}
|
|
|
this.Inoputdisabled[scope.$index] = false; // 解除禁用
|
|
|
this.tableform["fieldLength" + scope.$index].required = true; // 启用长度输入框的校验
|
|
|
return this.$set(
|
|
|
- this.experienceDataForm,
|
|
|
- "fieldType" + scope.$index,
|
|
|
- scope.row.fieldType
|
|
|
+ this.experienceDataForm,
|
|
|
+ "fieldType" + scope.$index,
|
|
|
+ scope.row.fieldType
|
|
|
);
|
|
|
},
|
|
|
|
|
@@ -677,8 +677,8 @@ export default {
|
|
|
} else {
|
|
|
//字段名去重校验
|
|
|
if (
|
|
|
- this.experienceData.filter((item) => item.fieldName == value)
|
|
|
- .length == 1
|
|
|
+ this.experienceData.filter((item) => item.fieldName == value)
|
|
|
+ .length == 1
|
|
|
) {
|
|
|
callback();
|
|
|
} else {
|
|
@@ -831,27 +831,27 @@ export default {
|
|
|
field: this.experienceData,
|
|
|
};
|
|
|
createDatabase(query)
|
|
|
- .then((res) => {
|
|
|
- this.$modal.msgSuccess(res.msg);
|
|
|
- if (res.code === 200) {
|
|
|
- this.visible = false;
|
|
|
- this.$emit("ok");
|
|
|
- Object.keys(this.form).forEach((key) => (this.form[key] = ""));
|
|
|
- this.experienceData = [];
|
|
|
- this.$tab.closePage().then(() => {
|
|
|
- this.$router.push({
|
|
|
- path: "/data/datamodeling",
|
|
|
+ .then((res) => {
|
|
|
+ this.$modal.msgSuccess(res.msg);
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.visible = false;
|
|
|
+ this.$emit("ok");
|
|
|
+ Object.keys(this.form).forEach((key) => (this.form[key] = ""));
|
|
|
+ this.experienceData = [];
|
|
|
+ this.$tab.closePage().then(() => {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/data/datamodeling",
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
- // 新增成功之后关闭当前页面
|
|
|
- // this.$router.replace({
|
|
|
- // path: "/data/datamodeling",
|
|
|
- // });
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- console.log(err);
|
|
|
- });
|
|
|
+ // 新增成功之后关闭当前页面
|
|
|
+ // this.$router.replace({
|
|
|
+ // path: "/data/datamodeling",
|
|
|
+ // });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
edit() {
|
|
@@ -897,23 +897,23 @@ export default {
|
|
|
field: this.experienceData,
|
|
|
};
|
|
|
editTable(query)
|
|
|
- .then((res) => {
|
|
|
- this.$modal.msgSuccess(res.msg);
|
|
|
- if (res.code === 200) {
|
|
|
- this.visible = false;
|
|
|
- this.$emit("ok");
|
|
|
- Object.keys(this.form).forEach((key) => (this.form[key] = ""));
|
|
|
- this.experienceData = [];
|
|
|
- this.$tab.closePage().then(() => {
|
|
|
- this.$router.push({
|
|
|
- path: "/data/datamodeling",
|
|
|
+ .then((res) => {
|
|
|
+ this.$modal.msgSuccess(res.msg);
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.visible = false;
|
|
|
+ this.$emit("ok");
|
|
|
+ Object.keys(this.form).forEach((key) => (this.form[key] = ""));
|
|
|
+ this.experienceData = [];
|
|
|
+ this.$tab.closePage().then(() => {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/data/datamodeling",
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- console.log(err);
|
|
|
- });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
// 关闭当前页面
|
|
|
this.$tab.closePage();
|
|
|
});
|
|
@@ -921,7 +921,7 @@ export default {
|
|
|
//处理表格行拖拽
|
|
|
initDragTable() {
|
|
|
const el = this.$refs.dragTable.$el.querySelectorAll(
|
|
|
- ".el-table__body-wrapper > table > tbody"
|
|
|
+ ".el-table__body-wrapper > table > tbody"
|
|
|
)[0];
|
|
|
const sortable = Sortable.create(el, {
|
|
|
handle: ".allowDrag",
|