Browse Source

修改统计显示

old
13176889840 4 years ago
parent
commit
c43a03cf02
  1. 4
      src/api/index.js
  2. 39
      src/views/form/statistics/analysis.vue

4
src/api/index.js

@ -32,8 +32,8 @@ api.interceptors.request.use(
* 以下代码为示例在登录状态下分别对 post get 请求加上 token 参数
*/
if (store.getters['user/isLogin']) {
request.headers.token = store.state.user.token
// request.headers.token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJnb3YiLCJjbGllbnQiOiJ3ZWIiLCJleHAiOjE2MzI5NjYwODEsInVzZXJJZCI6Ijg0ODg3ZDQzMjEzN2EzMGI3YWJhYWM1MDY5ODZkNDYxIiwiaWF0IjoxNjMyMzYxMjgxfQ.CDYJNfuF7gRRDwwmB9dJQjVOj_t_3xdrgwMqxHNAleZuQHkPMu9fI32at2aPjprhN4yBc_KT_3_Yhh30SF7YzA'
// request.headers.token = store.state.user.token
request.headers.token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJnb3YiLCJjbGllbnQiOiJ3ZWIiLCJleHAiOjE2MzI5NjYwODEsInVzZXJJZCI6Ijg0ODg3ZDQzMjEzN2EzMGI3YWJhYWM1MDY5ODZkNDYxIiwiaWF0IjoxNjMyMzYxMjgxfQ.CDYJNfuF7gRRDwwmB9dJQjVOj_t_3xdrgwMqxHNAleZuQHkPMu9fI32at2aPjprhN4yBc_KT_3_Yhh30SF7YzA'
// request.headers.Authorization = store.state.user.token
}
signRequest(request)

39
src/views/form/statistics/analysis.vue

@ -29,7 +29,31 @@
<span v-if="item.type === 'NUMBER_INPUT'">总计 {{ item.detail.sumTotal }} </span>
<span v-if="item.type === 'SWITCH'"> {{ item.detail.openTotal }} {{ item.detail.closedTotal }} </span>
</div>
<div v-else-if="item.type === 'RATE'" class="cell-rate">
<div v-for="(n, i) in item.detail.maxStarNum" :key="i" class="rate-item">
<div class="rate-item-icon">
<el-rate
:value="n"
disabled
text-color="#ff9900"
>
</el-rate>
</div>
<div class="rate-item-num">{{ item.detail.starProfile[n] || 0 }} </div>
</div>
<div class="rate-item">
<div class="rate-item-avg">平均星数</div>
<div class="rate-item-icon">
<el-rate
:value="item.detail.avgStarNum"
disabled
text-color="#ff9900"
>
</el-rate>
</div>
</div>
</div>
<div v-else-if="item.type === 'RADIO' || item.type === 'CHECKBOX' || item.type === 'SELECT'" class="cell-wrapper">
<div v-for="(n, i) in item.detail.options" :key="i" class="cell">
<div class="cell-label">{{ n.label }}</div>
@ -287,5 +311,20 @@ export default {
border-bottom: 0;
}
}
.rate-item {
display: flex;
align-items: center;
margin-top: 10px;
.rate-item-avg {
margin-right: 30px;
font-size: 14rpx;
}
.rate-item-num {
margin-left: 60px;
font-size: 14rpx;
}
}
</style>

Loading…
Cancel
Save