3 changed files with 193 additions and 5 deletions
@ -0,0 +1,118 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" :title="$t('verify')" :close-on-click-modal="false" :close-on-press-escape="false"> |
|||
<el-form :label-width="$i18n.locale === 'en-US' ? '100px' : '80px'"> |
|||
<el-form-item label="群名称:"> |
|||
<div>{{dataForm.groupName}}</div> |
|||
</el-form-item> |
|||
<el-form-item label="群主:"> |
|||
<div>{{dataForm.nickname}}</div> |
|||
</el-form-item> |
|||
<el-form-item label="创建时间:"> |
|||
<div>{{dataForm.createdTime}}</div> |
|||
</el-form-item> |
|||
<el-form-item label="群介绍:"> |
|||
<div>{{dataForm.groupIntroduction}}</div> |
|||
</el-form-item> |
|||
<el-form-item label="处理:" prop="state"> |
|||
<el-select v-model="dataForm.state" placeholder="请选择"> |
|||
<el-option |
|||
v-for="option in options" |
|||
:key="option.value" |
|||
:label="option.label" |
|||
:value="option.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="处理意见:" prop="processingOpinions" v-if="adviceVisible"> |
|||
<el-input v-model="dataForm.processingOpinions" type="textarea" placeholder="不超过500字"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<template slot="footer"> |
|||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|||
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import debounce from 'lodash/debounce' |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
adviceVisible: false, |
|||
dataForm: { |
|||
id: '', |
|||
groupName: '', |
|||
createdTime: '', |
|||
groupIntroduction: '', |
|||
nickname: '', |
|||
state: '5', |
|||
processingOpinions: '' |
|||
}, |
|||
options: [{ |
|||
value: '5', |
|||
label: '审核通过' |
|||
}, { |
|||
value: '10', |
|||
label: '审核拒绝' |
|||
}] |
|||
} |
|||
}, |
|||
watch: { |
|||
'dataForm.state': function (val) { |
|||
if (val === '5') { |
|||
this.adviceVisible = false |
|||
} else { |
|||
this.adviceVisible = true |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.visible = true |
|||
this.$nextTick(() => { |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
} |
|||
}) |
|||
}, |
|||
getInfo () { |
|||
this.$http.get(`/group/group/detail/${this.dataForm.id}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.dataForm = { |
|||
...this.dataForm, |
|||
...res.data |
|||
} |
|||
}).catch(() => {}) |
|||
}, |
|||
dataFormSubmitHandle: debounce(function () { |
|||
if (this.adviceVisible) { |
|||
if (this.dataForm.processingOpinions === '') { |
|||
return this.$message.error('处理意见不能为空') |
|||
} |
|||
if (this.dataForm.processingOpinions > 500) { |
|||
return this.$message.error('处理意见不能超过500字') |
|||
} |
|||
} |
|||
this.$http['post']( |
|||
'/group/group/operate', this.dataForm).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.visible = false |
|||
this.$emit('refreshDataList') |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}, 1000, { 'leading': true, 'trailing': false }) |
|||
} |
|||
} |
|||
</script> |
Loading…
Reference in new issue