modal-content.vue
7.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<script setup lang="ts">
import {
Tabs,
TabPane,
Row,
Col,
Avatar,
Form,
FormItem,
Divider,
ImagePreviewGroup,
Space,
Image,
RadioGroup,
Textarea,
Table,
TableColumn,
} from '@arco-design/web-vue';
import AudioPlayer from '@/components/audio-player/index.vue';
import { useCertifyApi } from '@/http/user';
import { Option } from '@/types/global';
import { ref } from 'vue';
import { Router } from 'vue-router';
import { FormInstance } from '@arco-design/web-vue/es/form';
import { UserCertify } from '@/utils/model';
const { statusOption } = useCertifyApi;
const props = defineProps<{
activeKey: string;
router: Router;
row: UserCertify;
platformOption: Option[];
certifyOption: Option[];
disabled?: boolean;
submit?: (value: { status: number; reason: string }) => Promise<UserCertify>;
close?: () => void;
}>();
const auditStatus = [
{ value: 1, label: '通过' },
{ value: 2, label: '拒绝' },
];
const formRef = ref<FormInstance>();
const formValue = ref({ status: props.row.status || 0, reason: props.row.reason || '' });
const onSubmit = async () => {
return (await formRef.value?.validate()) ? Promise.reject() : props.submit?.(formValue.value);
};
// const router = useRouter();
const goUserDetailPage = (userId: any) => {
props.close?.();
const r = props.router;
if (props.row.user?.identity === 1) {
return r.push({ name: 'user-singer-show', params: { id: userId } });
}
if ([2, 3].includes(Number(props.row.user?.identity))) {
return r.push({ name: 'user-business-show', params: { id: userId } });
}
return r.push({ name: 'user-register-show', params: { id: userId } });
};
defineExpose({ onSubmit });
</script>
<template>
<Tabs :default-active-key="activeKey || 'audit'" type="rounded" size="small">
<TabPane key="audit" title="认证申请">
<Row align="center">
<Col flex="80px" style="margin-right: 20px; cursor: pointer">
<Avatar :size="80" :image-url="row.user?.avatar || ''" @click="goUserDetailPage(row.user?.id)" />
</Col>
<Col flex="auto">
<Form v-if="row.user" :model="row.user" auto-label-width>
<FormItem hide-label row-class="mb-0" @click="goUserDetailPage(row.user?.id)">
<div style="font-weight: bold; font-size: 18px; cursor: pointer"> {{ row.user.nick_name || '' }}</div>
<span style="font-size: 12px; margin-left: 10px; cursor: pointer">{{ row.user.real_name }}</span>
</FormItem>
<FormItem label="当前身份" show-colon row-class="mb-0">
<Space>
<template #split>
<Divider direction="vertical" />
</template>
<span v-if="row.user.identity === 0">未认证</span>
<span v-if="[1, 3].includes(row.user.identity)">音乐人</span>
<span v-if="[2, 3].includes(row.user.identity)">经纪人</span>
</Space>
</FormItem>
<FormItem label="当前能力" show-colon row-class="mb-0">
{{ row.user.auth_tags?.map((item) => item.name).join('|') }}
</FormItem>
</Form>
</Col>
</Row>
<Divider orientation="left">注册来源</Divider>
<Row align="center" style="margin-top: 14px">
<Col v-if="row.user?.register_type == 2">
<span class="span">注册来源(用户推荐):</span>
<span style="color: rgb(18, 92, 254, 1); cursor: pointer" @click="goUserDetailPage(row.user?.inviter.id)">{{
row.user?.inviter.nick_name
}}</span>
</Col>
<Col v-else-if="row.user?.register_type == 1">
<span class="span">注册来源(自行注册):</span>
<span class="span">{{ row.user?.register_remark }}</span>
</Col>
<Col v-else>
<span class="span">注册来源:无</span>
</Col>
</Row>
<Divider orientation="left">认证信息</Divider>
<Form ref="formRef" :model="formValue" :disabled="disabled || false" auto-label-width>
<FormItem label="平台用户名" show-colon>{{ row.nick_name }}</FormItem>
<FormItem label="所属平台" show-colon>
{{
platformOption
.filter((item) => row.platform.includes(String(item.value)))
?.map((item) => item.label)
?.join('|')
}}
</FormItem>
<FormItem label="代表作" show-colon>{{ row.works }}</FormItem>
<FormItem label="相关截图" show-colon>
<ImagePreviewGroup infinite>
<Space>
<Image v-for="item in row.img" :key="item" :width="60" :height="60" :src="item" />
</Space>
</ImagePreviewGroup>
</FormItem>
<FormItem label="认证能力" show-colon>
{{
certifyOption
.filter((item) => row.tags.includes(Number(item.value)))
?.map((item) => item.label)
?.join('|')
}}
</FormItem>
<FormItem label="附带音频" show-colon>
<Space direction="vertical" fill style="width: 100%">
<Row v-if="row.audio_info?.local" align="center">
<Col flex="auto">
<AudioPlayer :url="row.audio_info.local" />
</Col>
<Col flex="100px">
<div style="line-height: 30px; height: 36px; margin-left: 10px">本地音频</div>
</Col>
</Row>
<Row v-if="row.audio_info?.online" align="center">
<Col flex="auto">
<AudioPlayer :url="row.audio_info.online" />
</Col>
<Col flex="100px">
<div style="line-height: 30px; height: 36px; margin-left: 10px">在线演唱</div>
</Col>
</Row>
</Space>
</FormItem>
<FormItem
label="审核结果"
field="status"
show-colon
:rules="[{ type: 'number', required: true, min: 1, message: '请选择审核结果' }]"
>
<RadioGroup v-model="formValue.status" :options="auditStatus" />
</FormItem>
<FormItem
v-show="formValue.status === 2"
field="reason"
:hide-asterisk="true"
:rules="formValue.status === 2 ? [{ required: true, minLength: 1, message: '请输入拒绝理由' }] : []"
>
<Textarea v-model="formValue.reason" show-word-limit :max-length="100" :auto-size="{ minRows: 3, maxRows: 3 }" />
</FormItem>
</Form>
</TabPane>
<TabPane key="record" :title="`审核记录(${row.records.length})`">
<Table :data="row.records" :bordered="false" :table-layout-fixed="true" :pagination="false" :scroll="{ y: 800 }">
<template #columns>
<TableColumn data-index="id" title="序号" :width="60">
<template #cell="{ rowIndex }">
{{ row.records.length - rowIndex }}
</template>
</TableColumn>
<TableColumn title="操作人" data-index="operator_id">
<template #cell="{ record }">
<template v-if="record.operator">{{ `${record.operator.nick_name}(${record.operator.real_name})` }}</template>
</template>
</TableColumn>
<TableColumn title="操作时间" data-index="updated_at" />
<TableColumn title="操作结果" data-index="status">
<template #cell="{ record }">{{ statusOption.find((item) => item.value === record.status)?.label }}</template>
</TableColumn>
<TableColumn title="说明" data-index="reason" />
</template>
</Table>
</TabPane>
</Tabs>
</template>
<style scoped lang="less">
.arco-form-item {
margin-bottom: 10px;
}
.span {
color: rgb(78, 89, 105, 1);
font-size: 14px;
}
</style>