nebula/pages/rules/currency.vue

68 lines
1.6 KiB
Vue
Raw Normal View History

2020-12-10 16:24:55 +08:00
<template>
<el-row class="wrapper">
<el-col>
<h1>货币规则</h1>
</el-col>
<el-col>
<el-table :data="currencyRules">
2020-12-10 16:24:55 +08:00
<el-table-column
label="规则名称"
2020-12-10 16:24:55 +08:00
width="180"
prop="ruleName">
</el-table-column>
<el-table-column
label="奖励/消耗(巴旦木)"
2020-12-10 16:24:55 +08:00
width="180"
prop="money">
<template slot-scope="scope">
<span v-if="scope.row.awardStatus === '0'" style="color: limegreen;font-weight: bold;">+{{ scope.row.money }}</span>
<span v-else style="color: red;font-weight: bold;">-{{ scope.row.money }}</span>
</template>
2020-12-10 16:24:55 +08:00
</el-table-column>
<el-table-column
label="上限(巴旦木)"
2020-12-10 16:24:55 +08:00
width="180"
prop="maximumMoney">
</el-table-column>
<el-table-column
label="重复(天/次)"
2020-12-10 16:24:55 +08:00
width="180"
prop="repeatDays">
</el-table-column>
<el-table-column
label="规则说明"
prop="ruleDescription">
</el-table-column>
2020-12-10 16:24:55 +08:00
</el-table>
</el-col>
</el-row>
</template>
<script>
import { mapState } from 'vuex';
export default {
name: "currency",
fetch() {
let {store, params, error} = this.$nuxt.context
2020-12-10 16:24:55 +08:00
return Promise.all([
store
.dispatch('rule/fetchCurrencyRules', params)
.catch(err => error({statusCode: 404}))
])
},
computed: {
...mapState({
currencyRules: state => state.rule.currencyRules.data
})
},
mounted() {
this.$store.commit('setActiveMenu', 'currencyRule');
2020-12-10 16:24:55 +08:00
}
}
</script>
<style scoped>
</style>