Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly
This commit is contained in:
commit
774cf2b2d9
@ -32,7 +32,7 @@
|
|||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="分类" prop="tags" required>
|
<el-form-item label="分类" required>
|
||||||
<el-select v-model="form.tags" @change="getQuestionAmount">
|
<el-select v-model="form.tags" @change="getQuestionAmount">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in labels"
|
v-for="item in labels"
|
||||||
@ -112,12 +112,15 @@ export default {
|
|||||||
message()
|
message()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const tagsValidator = (rule, value, message) => {
|
||||||
|
message()
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
form: {
|
form: {
|
||||||
id: '',
|
id: '',
|
||||||
type: '',
|
type: '',
|
||||||
subtype: '',
|
subtype: '',
|
||||||
tags: '无',
|
tags: '',
|
||||||
amount: 1,
|
amount: 1,
|
||||||
score: 1,
|
score: 1,
|
||||||
},
|
},
|
||||||
@ -130,13 +133,13 @@ export default {
|
|||||||
subtype: [{ required: true, message: '请选择规则类型', trigger: 'change' }],
|
subtype: [{ required: true, message: '请选择规则类型', trigger: 'change' }],
|
||||||
amount: [{ required: true, validator: number, trigger: 'blur' }],
|
amount: [{ required: true, validator: number, trigger: 'blur' }],
|
||||||
score: [{ required: true, validator: score, trigger: 'blur' }],
|
score: [{ required: true, validator: score, trigger: 'blur' }],
|
||||||
tags: [{ required: true, message: '请选择分类', trigger: 'blur' }],
|
tags: [{ validator: tagsValidator, trigger: 'blur' }],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
getLabelList().then(resp => {
|
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() {},
|
mounted() {},
|
||||||
@ -169,6 +172,8 @@ export default {
|
|||||||
rule =>
|
rule =>
|
||||||
rule.type === this.form.type &&
|
rule.type === this.form.type &&
|
||||||
rule.subtype === this.form.subtype &&
|
rule.subtype === this.form.subtype &&
|
||||||
|
rule.tags &&
|
||||||
|
this.form.tags &&
|
||||||
rule.tags.includes(this.form.tags)
|
rule.tags.includes(this.form.tags)
|
||||||
)
|
)
|
||||||
return isDuplicated
|
return isDuplicated
|
||||||
@ -181,7 +186,7 @@ export default {
|
|||||||
groupType: this.form.type,
|
groupType: this.form.type,
|
||||||
subType: this.form.subtype,
|
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 => {
|
getQuestionAmount(param).then(resp => {
|
||||||
this.topicNum = resp.data
|
this.topicNum = resp.data
|
||||||
})
|
})
|
||||||
|
@ -37,7 +37,12 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="分类">
|
<el-table-column label="分类">
|
||||||
<template slot-scope="scope">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('global.operate')" width="100">
|
<el-table-column :label="$t('global.operate')" width="100">
|
||||||
|
Loading…
Reference in New Issue
Block a user