fix: Merge后的修复

This commit is contained in:
dhb52 2023-04-09 13:41:14 +08:00
parent 75750c1bd3
commit 99166ee664
3 changed files with 56 additions and 57 deletions

View File

@ -3,32 +3,33 @@
<doc-alert title="自动回复" url="https://doc.iocoder.cn/mp/auto-reply/" /> <doc-alert title="自动回复" url="https://doc.iocoder.cn/mp/auto-reply/" />
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form
:model="queryParams"
ref="queryFormRef"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="公众号" prop="accountId">
<el-select v-model="queryParams.accountId" placeholder="请选择公众号">
<el-option
v-for="item in accounts"
:key="parseInt(item.id)"
:label="item.name"
:value="parseInt(item.id)"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery"><Icon icon="ep:search" />搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" />重置</el-button>
</el-form-item>
</el-form>
<ContentWrap> <ContentWrap>
<!-- tab 切换 --> <el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="公众号" prop="accountId">
<el-select v-model="queryParams.accountId" placeholder="请选择公众号" class="!w-240px">
<el-option
v-for="item in accountList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" />搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" />重置</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- tab 切换 -->
<ContentWrap>
<el-tabs v-model="type" @tab-change="handleTabChange"> <el-tabs v-model="type" @tab-change="handleTabChange">
<!-- 操作工具栏 --> <!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
@ -36,7 +37,6 @@
<el-button <el-button
type="primary" type="primary"
plain plain
size="small"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['mp:auto-reply:create']" v-hasPermi="['mp:auto-reply:create']"
v-if="type !== '1' || list.length <= 0" v-if="type !== '1' || list.length <= 0"
@ -62,8 +62,10 @@
</template> </template>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</ContentWrap>
<!-- 列表 --> <!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<el-table-column <el-table-column
label="请求消息类型" label="请求消息类型"
@ -82,34 +84,31 @@
</el-table-column> </el-table-column>
<el-table-column label="回复消息类型" align="center"> <el-table-column label="回复消息类型" align="center">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.MP_MESSAGE_TYPE" :value="scope.row.responseMessageType" /> <dict-tag :type="DICT_TYPE.MP_MESSAGE_TYPE" :value="scope.row.responsType" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="回复内容" align="center"> <el-table-column label="回复内容" align="center">
<template #default="scope"> <template #default="scope">
<div v-if="scope.row.responseMessageType === 'text'">{{ <div v-if="scope.row.responsType === 'text'">{{ scope.row.responseContent }}</div>
scope.row.responseContent <div v-else-if="scope.row.responsType === 'voice'">
}}</div>
<div v-else-if="scope.row.responseMessageType === 'voice'">
<WxVoicePlayer :url="scope.row.responseMediaUrl" /> <WxVoicePlayer :url="scope.row.responseMediaUrl" />
</div> </div>
<div v-else-if="scope.row.responseMessageType === 'image'"> <div v-else-if="scope.row.responsType === 'image'">
<a target="_blank" :href="scope.row.responseMediaUrl"> <a target="_blank" :href="scope.row.responseMediaUrl">
<img :src="scope.row.responseMediaUrl" style="width: 100px" /> <img :src="scope.row.responseMediaUrl" style="width: 100px" />
</a> </a>
</div> </div>
<div <div
v-else-if=" v-else-if="
scope.row.responseMessageType === 'video' || scope.row.responsType === 'video' || scope.row.responsType === 'shortvideo'
scope.row.responseMessageType === 'shortvideo'
" "
> >
<WxVideoPlayer :url="scope.row.responseMediaUrl" style="margin-top: 10px" /> <WxVideoPlayer :url="scope.row.responseMediaUrl" style="margin-top: 10px" />
</div> </div>
<div v-else-if="scope.row.responseMessageType === 'news'"> <div v-else-if="scope.row.responsType === 'news'">
<WxNews :articles="scope.row.responseArticles" /> <WxNews :articles="scope.row.responseArticles" />
</div> </div>
<div v-else-if="scope.row.responseMessageType === 'music'"> <div v-else-if="scope.row.responsType === 'music'">
<WxMusic <WxMusic
:title="scope.row.responseTitle" :title="scope.row.responseTitle"
:description="scope.row.responseDescription" :description="scope.row.responseDescription"
@ -120,9 +119,15 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180"
>
<template #default="scope"> <template #default="scope">
<span>{{ formatDate(scope.row.createTime) }}</span> <span>{{ scope.row.createTime }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@ -211,7 +216,7 @@ import {
} from '@/api/mp/autoReply' } from '@/api/mp/autoReply'
import { DICT_TYPE, getDictOptions } from '@/utils/dict' import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import { ContentWrap } from '@/components/ContentWrap' import { ContentWrap } from '@/components/ContentWrap'
const message = useMessage() const message = useMessage()
@ -226,7 +231,7 @@ const requestMessageTypes = ['text', 'image', 'voice', 'video', 'shortvideo', 'l
// //
const loading = ref(true) const loading = ref(true)
// //
const showSearch = ref(true) // const showSearch = ref(true)
// //
const total = ref(0) const total = ref(0)
// //
@ -257,14 +262,14 @@ const rules = {
const hackResetWxReplySelect = ref(false) // WxReplySelect const hackResetWxReplySelect = ref(false) // WxReplySelect
// //
const accounts = ref([]) const accountList = ref([])
onMounted(() => { onMounted(() => {
getSimpleAccountList().then((data) => { getSimpleAccountList().then((data) => {
accounts.value = data accountList.value = data
// //
if (accounts.value.length > 0) { if (accountList.value.length > 0) {
queryParams.accountId = accounts.value[0].id queryParams.accountId = accountList.value[0].id
} }
// //
getList() getList()
@ -303,8 +308,8 @@ const handleQuery = () => {
const resetQuery = () => { const resetQuery = () => {
queryFormRef.value?.resetFields() queryFormRef.value?.resetFields()
// //
if (accounts.value.length > 0) { if (accountList.value.length > 0) {
queryParams.accountId = accounts.value[0].id queryParams.accountId = accountList.value[0].id
} }
handleQuery() handleQuery()
} }
@ -336,14 +341,14 @@ const handleUpdate = (row) => {
getAutoReply(row.id).then((data) => { getAutoReply(row.id).then((data) => {
// //
form.value = { ...data } form.value = { ...data }
delete form.value['responseMessageType'] delete form.value['responsType']
delete form.value['responseContent'] delete form.value['responseContent']
delete form.value['responseMediaId'] delete form.value['responseMediaId']
delete form.value['responseMediaUrl'] delete form.value['responseMediaUrl']
delete form.value['responseDescription'] delete form.value['responseDescription']
delete form.value['responseArticles'] delete form.value['responseArticles']
objData.value = { objData.value = {
type: data.responseMessageType, type: data.responsType,
accountId: queryParams.accountId, accountId: queryParams.accountId,
content: data.responseContent, content: data.responseContent,
mediaId: data.responseMediaId, mediaId: data.responseMediaId,
@ -371,7 +376,7 @@ const handleSubmit = () => {
// //
const form = { ...form.value } const form = { ...form.value }
form.responseMessageType = objData.value.type form.responsType = objData.value.type
form.responseContent = objData.value.content form.responseContent = objData.value.content
form.responseMediaId = objData.value.mediaId form.responseMediaId = objData.value.mediaId
form.responseMediaUrl = objData.value.url form.responseMediaUrl = objData.value.url

View File

@ -47,7 +47,6 @@
/> />
<el-table-column label="操作" align="center" fixed="right"> <el-table-column label="操作" align="center" fixed="right">
<template #default="scope"> <template #default="scope">
<el-button type="primary" link @click="selectMaterialFun(scope.row)" <el-button type="primary" link @click="selectMaterialFun(scope.row)"
>选择<Icon icon="ep:plus" /> >选择<Icon icon="ep:plus" />
</el-button> </el-button>

View File

@ -2,12 +2,7 @@
<doc-alert title="公众号菜单" url="https://doc.iocoder.cn/mp/menu/" /> <doc-alert title="公众号菜单" url="https://doc.iocoder.cn/mp/menu/" />
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<ContentWrap> <ContentWrap>
<el-form <el-form class="-mb-15px" ref="queryFormRef" :inline="true" label-width="68px">
class="-mb-15px"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="公众号" prop="accountId"> <el-form-item label="公众号" prop="accountId">
<el-select v-model="accountId" placeholder="请选择公众号" class="!w-240px"> <el-select v-model="accountId" placeholder="请选择公众号" class="!w-240px">
<el-option <el-option