评分管理-需求变更

This commit is contained in:
aixianling
2024-07-19 09:44:34 +08:00
parent 1cac8ab8e0
commit be9aa08cd9
2 changed files with 111 additions and 133 deletions

View File

@@ -1,4 +1,4 @@
VUE_APP_SCOPE=fengdu VUE_APP_SCOPE=fengdu
#VUE_APP_API=https://web.fdfengshou.cn/ #VUE_APP_API=https://web.fdfengshou.cn/
#VUE_APP_API=http://192.168.1.87:9000/ VUE_APP_API=http://192.168.1.87:9000/
VUE_APP_API=http://test87web.cunwuyun.cn/ #VUE_APP_API=http://test87web.cunwuyun.cn/

View File

@@ -3,21 +3,21 @@
<ai-list> <ai-list>
<template #content> <template #content>
<div class="card_list"> <div class="card_list">
<div class="card" v-for="(item,index) in cardList" :key="index"> <div class="card" v-for="(label,key) in cardSta" :key="key">
<h2>{{ item.label }}</h2> <h2>{{ label }}</h2>
<p class="color1">{{ item.value || 0 }}</p> <p class="color1">{{ cardData[key] || 0 }}</p>
</div> </div>
</div> </div>
<ai-title title="评分列表"></ai-title> <ai-title title="评分列表"></ai-title>
<ai-search-bar> <ai-search-bar>
<template #left> <template #left>
<el-button type="primary" icon="iconfont iconAdd" @click="handleAdd">添加</el-button> <el-button type="primary" icon="iconfont iconAdd" @click="handleAdd">添加</el-button>
<ai-select <!-- <ai-select-->
v-model="search.type" <!-- v-model="search.type"-->
@change="onChange" <!-- @change="onChange"-->
placeholder="请选择事件类型" <!-- placeholder="请选择事件类型"-->
:selectList="$dict.getDict('shopScoreType')"> <!-- :selectList="$dict.getDict('shopScoreType')">-->
</ai-select> <!-- </ai-select>-->
<ai-select <ai-select
v-model="search.listType" v-model="search.listType"
@change="(search.current = 1), getList()" @change="(search.current = 1), getList()"
@@ -70,20 +70,19 @@
</template> </template>
</ai-list> </ai-list>
<ai-dialog title="评分规则" :visible.sync="dialog" width="800px" @closed="onClosed" @onConfirm="onConfirm"> <ai-dialog title="评分规则" :visible.sync="dialog" width="800px" @closed="onClosed" @onConfirm="onConfirm">
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px"> <el-form ref="formRef" :model="form" :rules="rules" label-width="120px" size="small">
<el-form-item label="事件类型:" prop="type"> <!-- <el-form-item label="事件类型:" prop="type">-->
<ai-select <!-- <ai-select v-model="form.type" placeholder="请选择事件类型" dict="shopScoreType"/>-->
v-model="form.type" <!-- </el-form-item>-->
placeholder="请选择事件类型" <!-- <el-form-item label="自定义事件:" prop="listType">-->
:selectList="$dict.getDict('shopScoreType')"> <!-- <el-input v-model="form.listType" :disabled="form.type === '' || form.type === null || form.type === undefined" placeholder="请输入自定义事件" size="small"></el-input>-->
</ai-select> <!-- </el-form-item>-->
</el-form-item> <el-form-item label="事件名称:" prop="listType">
<el-form-item label="自定义事件:" prop="listType"> <el-input v-model="form.listType" placeholder="请输入事件名称" clearable/>
<el-input v-model="form.listType" :disabled="form.type === '' || form.type === null || form.type === undefined" placeholder="请输入自定义事件" size="small"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="规则:">常规</el-form-item> <el-form-item label="规则:">常规</el-form-item>
<el-form-item label="分值:" prop="score"> <el-form-item label="分值:" prop="score">
<el-input-number v-model="form.score" :precision="2" size="small" placeholder="请输入分值"></el-input-number> <el-input-number v-model="form.score" :precision="2" size="small" placeholder="请输入分值" :min="0"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ai-dialog> </ai-dialog>
@@ -109,34 +108,20 @@ export default {
size: 10, size: 10,
}, },
dictList: [], dictList: [],
cardList: [ cardSta: {
{ rulesCount: "规则总数量",
label: '规则总数量', positiveCount: "启动规则项",
value: 0 negativeCount: "停用规则项",
positiveScore: "规则总分数",
// negativeScore: "负向事件总分数",
}, },
{ cardData: {},
label: '正向事件规则项',
value: 0
},
{
label: '正向事件总分数',
value: 0
},
{
label: '负向事件规则项',
value: 0
},
{
label: '负向事件总分数',
value: 0
},
],
total: 10, total: 10,
colConfigs: [ colConfigs: [
{type: "selection"}, {type: "selection"},
{ prop: 'type', label: '类型', align: 'center' ,render:(h,{row})=>{ // { prop: 'type', label: '类型', align: 'center' ,render:(h,{row})=>{
return h('span',null,this.dict.getLabel('shopScoreType',row.type)) // return h('span',null,this.dict.getLabel('shopScoreType',row.type))
}}, // }},
{prop: 'listType', label: '事件', align: 'center'}, {prop: 'listType', label: '事件', align: 'center'},
{prop: 'rule', label: '规则', align: 'center'}, {prop: 'rule', label: '规则', align: 'center'},
{slot: 'score'}, {slot: 'score'},
@@ -160,6 +145,7 @@ export default {
}, },
created() { created() {
this.queryListTypeByType()
this.$dict.load('shopScoreType', 'shopScoreEvent').then(() => { this.$dict.load('shopScoreType', 'shopScoreEvent').then(() => {
this.getStatic() this.getStatic()
this.getList() this.getList()
@@ -181,16 +167,11 @@ export default {
async queryListTypeByType(type) { async queryListTypeByType(type) {
try { try {
const {code, data} = await this.instance.post('/app/appscorerules/queryListTypeByType', null, { const {code, data} = await this.instance.post('/app/appscorerules/queryListTypeByType', null, {
params:{ params: {type}
type
}
}) })
if (code === 0) { if (code === 0) {
this.dictList = data?.map(item=>{ this.dictList = [...new Set(data?.map(e => e.listType) || [])].map(item => {
return { return {dictName: item, dictValue: item}
dictName:item.listType,
dictValue:item.listType
}
}) })
} }
} catch (e) { } catch (e) {
@@ -269,10 +250,7 @@ export default {
try { try {
const {code, data} = await this.instance.post('/app/appscorerules/queryAppScoreRulesCount') const {code, data} = await this.instance.post('/app/appscorerules/queryAppScoreRulesCount')
if (code === 0) { if (code === 0) {
const array = ['rulesCount','positiveCount','positiveScore','negativeCount','negativeScore'] this.cardData = data
array.forEach((item,index)=>{
this.cardList[index].value = data[item]
})
} }
} catch (e) { } catch (e) {
console.error(e) console.error(e)