Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaotoday committed Apr 25, 2019
1 parent 96d987f commit 937ac81
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
31 changes: 31 additions & 0 deletions src/components/wx-user-name/index.vue
@@ -0,0 +1,31 @@
<template>
<span class="c-wx-user-name">{{ detail.nickName || '' }}</span>
</template>

<script>
import WxUsersModel from '@/models/admin/wx-users'
export default {
name: 'CWXUserName',
props: {
id: {
type: Number,
default: 0
}
},
data () {
return {
detail: {}
}
},
created () {
this.getDetail()
},
methods: {
async getDetail () {
const { data } = await new WxUsersModel().GET({ id: this.id })
this.detail = data
}
}
}
</script>
2 changes: 2 additions & 0 deletions src/plugins/global.js
Expand Up @@ -10,6 +10,7 @@ import CUploader from '@/components/uploader'
import CDropdown from '@/components/dropdown'
import CDel from '@/components/del'
import CBatchDel from '@/components/batch-del'
import CWXUserName from '@/components/wx-user-name'

export default {
install (Vue) {
Expand All @@ -34,5 +35,6 @@ export default {
Vue.component('CDropdown', CDropdown)
Vue.component('CDel', CDel)
Vue.component('CBatchDel', CBatchDel)
Vue.component('CWXUserName', CWXUserName)
}
}
13 changes: 11 additions & 2 deletions src/views/survey-results/list/index.vue
Expand Up @@ -10,7 +10,9 @@
<Modal
v-model="cDetail.modal"
title="详情">
<Card v-if="cDetail.value.length" style="margin-bottom: 15px;">
<Card
v-if="cDetail.value.length"
style="margin-bottom: 15px;">
<p slot="title">{{ cDetail.value | find | title }}</p>
<p>{{ cDetail.value | find | value | filter | join }}</p>
</Card>
Expand Down Expand Up @@ -52,7 +54,14 @@ export default {
{
title: '用户',
key: 'wxUserId',
width: 200
width: 150,
render: (h, params) => {
return h('CWXUserName', {
attrs: {
id: params.row.wxUserId
}
})
}
},
{
title: '主题',
Expand Down

0 comments on commit 937ac81

Please sign in to comment.