|
|
@@ -40,7 +40,7 @@
|
|
|
<el-form-item label="搜索字段">
|
|
|
<el-switch
|
|
|
active-color="#13ce66"
|
|
|
- inactive-color="#ff4949"
|
|
|
+ inactive-color="#ccc"
|
|
|
:disabled="ruleForm.type !== 'varchar'"
|
|
|
v-model="ruleForm.isQuery"
|
|
|
:active-value="1"
|
|
|
@@ -74,7 +74,7 @@ export default {
|
|
|
tableId: null,
|
|
|
name: "",
|
|
|
remark: "",
|
|
|
- length: 512,
|
|
|
+ length: 16,
|
|
|
type: "varchar",
|
|
|
isQuery: 0,
|
|
|
},
|
|
|
@@ -100,8 +100,8 @@ export default {
|
|
|
methods: {
|
|
|
valueChange(value) {
|
|
|
let temp = 0;
|
|
|
- if (value === "varchar") temp = 512;
|
|
|
- else if (value === "int") temp = 8;
|
|
|
+ if (value === "varchar") temp = 16;
|
|
|
+ else if (value === "int") temp = 1;
|
|
|
this.ruleForm.length = temp;
|
|
|
if (value !== "varchar") this.ruleForm.isQuery = 0;
|
|
|
},
|
|
|
@@ -111,9 +111,11 @@ export default {
|
|
|
: "";
|
|
|
if (this.ruleForm.type === "int") {
|
|
|
if (Number(value) > 8) this.ruleForm.length = 8;
|
|
|
+ if(Number(value) <= 0) this.ruleForm.length = 1;
|
|
|
}
|
|
|
if (this.ruleForm.type === "varchar") {
|
|
|
if (Number(value) > 512) this.ruleForm.length = 512;
|
|
|
+ if(Number(value) <= 0) this.ruleForm.length = 1;
|
|
|
}
|
|
|
},
|
|
|
// 点击取消
|