新功能(前端组件): 更新CRUD组件
parent
695886bf26
commit
f065a867ff
|
@ -131,6 +131,7 @@
|
||||||
>{{func.label}}
|
>{{func.label}}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<slot name="head_button"/>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-if="topLayoutRight" :span="6">
|
<el-col v-if="topLayoutRight" :span="6">
|
||||||
|
@ -272,6 +273,13 @@
|
||||||
active-color="#13ce66"
|
active-color="#13ce66"
|
||||||
inactive-color="#ff4949">
|
inactive-color="#ff4949">
|
||||||
</el-switch>
|
</el-switch>
|
||||||
|
<el-input-number
|
||||||
|
v-if="value.type==='number'"
|
||||||
|
v-model="form[value.prop]"
|
||||||
|
:precision="value.precision || 0"
|
||||||
|
:step="value.step || 1"
|
||||||
|
:max="value.step || Infinity">
|
||||||
|
</el-input-number>
|
||||||
<dept-tree ref="dept_tree" v-else-if="value.type==='depts'" :value.sync="form[value.prop]"
|
<dept-tree ref="dept_tree" v-else-if="value.type==='depts'" :value.sync="form[value.prop]"
|
||||||
></dept-tree>
|
></dept-tree>
|
||||||
<users-tree ref="users_tree" v-else-if="value.type==='users'" :value.sync="form[value.prop]"
|
<users-tree ref="users_tree" v-else-if="value.type==='users'" :value.sync="form[value.prop]"
|
||||||
|
@ -834,7 +842,7 @@
|
||||||
this.selectApi(id).then(response => {
|
this.selectApi(id).then(response => {
|
||||||
let data = response.data
|
let data = response.data
|
||||||
if (data && typeof data === "object") {
|
if (data && typeof data === "object") {
|
||||||
this.form = data[Object.keys(data)[0]]
|
this.form = data
|
||||||
}
|
}
|
||||||
this.open = true;
|
this.open = true;
|
||||||
});
|
});
|
||||||
|
@ -854,7 +862,7 @@
|
||||||
this.selectApi(id).then(response => {
|
this.selectApi(id).then(response => {
|
||||||
let data = response.data
|
let data = response.data
|
||||||
if (data && typeof data === "object") {
|
if (data && typeof data === "object") {
|
||||||
this.form = data[Object.keys(data)[0]]
|
this.form = data
|
||||||
}
|
}
|
||||||
this.open = true;
|
this.open = true;
|
||||||
});
|
});
|
||||||
|
@ -900,11 +908,11 @@
|
||||||
this.fields.map(value => {
|
this.fields.map(value => {
|
||||||
if (value.form) {
|
if (value.form) {
|
||||||
if (value.required) {
|
if (value.required) {
|
||||||
dict[value.prop] = [{
|
dict[value.prop] = [{
|
||||||
required: value.required,
|
required: value.required,
|
||||||
message: value.rules_message || value.label + "不能为空",
|
message: value.rules_message || value.label + "不能为空",
|
||||||
trigger: value.trigger || "change"
|
trigger: value.trigger || "change"
|
||||||
}]
|
}]
|
||||||
if (value.validator) {
|
if (value.validator) {
|
||||||
dict[value.prop][1] = {
|
dict[value.prop][1] = {
|
||||||
validator: value.validator,
|
validator: value.validator,
|
||||||
|
|
Loading…
Reference in New Issue