Browse Source

在当前页面新增标签

feature
mk 2 years ago
parent
commit
55a8f8b78c
  1. 16
      src/views/modules/communityService/labelConfig/addForm.vue

16
src/views/modules/communityService/labelConfig/addForm.vue

@ -7,28 +7,29 @@
class="div_form"
:rules="rules"
>
<!-- v-if="formType == 'info'&& addFormLabel" -->
<el-form-item
label="标签名称"
label-width="100px"
prop="tagName"
v-if="formType == 'info'&& addFormLabel"
>
<el-autocomplete
v-model="formData.tagName"
value-key="tagName"
:fetch-suggestions="querySearchAsync"
@blur="handelChangeTagName"
placeholder="请输入内容进行搜索"
@select="handleSelect"
></el-autocomplete>
</el-form-item>
<el-form-item label="标签名称" label-width="100px" prop="tagName" v-else>
<!-- <el-form-item label="标签名称(新增)" label-width="100px" prop="tagName" v-else>
<el-input
v-model="formData.tagName"
placeholder="请输入内容"
@blur="handelChangeTagName"
clearable
></el-input>
</el-form-item>
</el-form-item> -->
</el-form>
<p style="margin-left: 15px"><b style="color: #f56c6c">*</b> 匹配数据</p>
<el-table border :data="tableData" style="width: 100%" height="200">
@ -292,6 +293,7 @@ export default {
methods: {
async initForm(type, row) {
this.formType = type;
if (type == "info") {
await this.getFormEdit(row.tagId);
} else if (type == "edit") {
@ -315,6 +317,7 @@ export default {
this.tableData = []
this.handleClickAddRow();
this.addFormLabel = false
this.formType = "add";
} else {
this.formType = "info";
}
@ -324,8 +327,9 @@ export default {
}, 3000 * Math.random());
},
handelChangeTagName(val){
if(this.formData.tagName.length == 0 && !this.addFormLabel){
console.log('我在查看页面并且搜索框为空');
if(this.formData.tagName.length == 0 ){
this.formType = 'info'
this.tableData = []
this.addFormLabel = true
}
},
@ -336,7 +340,7 @@ export default {
},
async handleSelect(item) {
console.log(item);
await this.initForm("info", item);
await this.initForm(item.editable?'edit':'info', item);
},
async getLabelList() {
const url = "/governance/resiSearchTag/listResiSearchTags";

Loading…
Cancel
Save