Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly

This commit is contained in:
joylink_cuiweidong 2022-10-28 16:07:21 +08:00
commit 774cf2b2d9
2 changed files with 16 additions and 6 deletions

View File

@ -32,7 +32,7 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="分类" prop="tags" required>
<el-form-item label="分类" required>
<el-select v-model="form.tags" @change="getQuestionAmount">
<el-option
v-for="item in labels"
@ -112,12 +112,15 @@ export default {
message()
}
}
const tagsValidator = (rule, value, message) => {
message()
}
return {
form: {
id: '',
type: '',
subtype: '',
tags: '',
tags: '',
amount: 1,
score: 1,
},
@ -130,13 +133,13 @@ export default {
subtype: [{ required: true, message: '请选择规则类型', trigger: 'change' }],
amount: [{ required: true, validator: number, trigger: 'blur' }],
score: [{ required: true, validator: score, trigger: 'blur' }],
tags: [{ required: true, message: '请选择分类', trigger: 'blur' }],
tags: [{ validator: tagsValidator, trigger: 'blur' }],
},
}
},
created() {
getLabelList().then(resp => {
this.labels = [{ label: '无', value: '' }, ...resp.data.map(item => ({ label: item, value: item }))]
this.labels = [{ label: '无', value: '' }, ...resp.data.map(item => ({ label: item, value: item }))]
})
},
mounted() {},
@ -169,6 +172,8 @@ export default {
rule =>
rule.type === this.form.type &&
rule.subtype === this.form.subtype &&
rule.tags &&
this.form.tags &&
rule.tags.includes(this.form.tags)
)
return isDuplicated
@ -181,7 +186,7 @@ export default {
groupType: this.form.type,
subType: this.form.subtype,
}
if (this.form.tags !== '') param.tags = [this.form.tags]
if (this.form.tags !== '') param.tags = [this.form.tags]
getQuestionAmount(param).then(resp => {
this.topicNum = resp.data
})

View File

@ -37,7 +37,12 @@
</el-table-column>
<el-table-column label="分类">
<template slot-scope="scope">
<el-tag v-for="tag in scope.row.tags" :key="tag">{{ tag }}</el-tag>
<template v-if="scope.row.tags">
<el-tag v-for="tag in scope.row.tags" :key="tag">{{ tag }}</el-tag>
</template>
<template v-else>
<el-tag></el-tag>
</template>
</template>
</el-table-column>
<el-table-column :label="$t('global.operate')" width="100">