| | |
| | | <el-form ref="form" :model="attribute" show-message="true" inline size="medium" label-suffix=":" |
| | | class="attributeForm" :rules="rules" @resetFields="resetAttributeForm" status-icon="true"> |
| | | <el-form-item label="属性编号" label-width="100px" prop="id"> |
| | | <el-input v-model="attribute.id" maxlength="30" show-word-limit type="text"></el-input> |
| | | <el-input v-model="attribute.id" maxlength="30" show-word-limit @input="handleIdInput"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="属性名称" label-width="100px" prop="name"> |
| | | <el-input v-model="attribute.name"></el-input> |
| | |
| | | this.initAttributeReferTypeList(); |
| | | }, |
| | | methods: { |
| | | handleIdInput(value){ |
| | | this.attribute.id = value.toLowerCase(); |
| | | }, |
| | | onSubmit() { |
| | | const conditionMap = {}; |
| | | if (this.form.name) { |
| | | conditionMap[`conditionMap['name_like']`] = this.form.name; |
| | | if (this.form.name || this.form.label) { |
| | | const params = {}; |
| | | if (this.form.name) { |
| | | params.name = this.form.name; |
| | | } |
| | | if (this.form.label) { |
| | | params.label = this.form.label; |
| | | } |
| | | getParentList(this.enumRefer.enumPage.currentPage, this.enumRefer.enumPage.pageSize, params) |
| | | .then((res) => { |
| | | this.enumRefer.enumPage.total = res.data.data.total; |
| | | this.enumRefer.data = res.data.data.records; |
| | | }); |
| | | } |
| | | if (this.form.label) { |
| | | conditionMap[`conditionMap['label_like']`] = this.form.label; |
| | | } |
| | | getParentList(this.enumRefer.enumPage.currentPage, this.enumRefer.enumPage.pageSize, conditionMap) |
| | | .then((res) => { |
| | | this.enumRefer.enumPage.total = res.data.data.total; |
| | | this.enumRefer.data = res.data.data.records; |
| | | }); |
| | | }, |
| | | enumOnLoad(){ |
| | | getParentList(this.enumRefer.enumPage.currentPage, this.enumRefer.enumPage.pageSize).then(res => { |