Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
92da7e34
authored
Apr 14, 2023
by
dhb52
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 使用ElDialog:destroy-on-close属性解决对话框重新加载
parent
813e7d27
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
20 deletions
+7
-20
src/views/mp/autoReply/index.vue
+4
-17
src/views/mp/message/index.vue
+3
-3
No files found.
src/views/mp/autoReply/index.vue
View file @
92da7e34
...
@@ -140,7 +140,7 @@
...
@@ -140,7 +140,7 @@
</el-table>
</el-table>
<!-- 添加或修改自动回复的对话框 -->
<!-- 添加或修改自动回复的对话框 -->
<el-dialog
:title=
"title"
v-model=
"showReplyFormDialog"
width=
"800px"
append-to-body
>
<el-dialog
:title=
"title"
v-model=
"showReplyFormDialog"
width=
"800px"
destroy-on-close
>
<el-form
ref=
"formRef"
:model=
"replyForm"
:rules=
"rules"
label-width=
"80px"
>
<el-form
ref=
"formRef"
:model=
"replyForm"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"消息类型"
prop=
"requestMessageType"
v-if=
"msgType === MsgType.Message"
>
<el-form-item
label=
"消息类型"
prop=
"requestMessageType"
v-if=
"msgType === MsgType.Message"
>
<el-select
v-model=
"replyForm.requestMessageType"
placeholder=
"请选择"
>
<el-select
v-model=
"replyForm.requestMessageType"
placeholder=
"请选择"
>
...
@@ -167,7 +167,7 @@
...
@@ -167,7 +167,7 @@
<el-input
v-model=
"replyForm.requestKeyword"
placeholder=
"请输入内容"
clearable
/>
<el-input
v-model=
"replyForm.requestKeyword"
placeholder=
"请输入内容"
clearable
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"回复消息"
>
<el-form-item
label=
"回复消息"
>
<WxReplySelect
:objData=
"objData"
v-if=
"hackResetWxReplySelect"
/>
<WxReplySelect
:objData=
"objData"
/>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<
template
#
footer
>
<
template
#
footer
>
...
@@ -195,7 +195,7 @@ const message = useMessage()
...
@@ -195,7 +195,7 @@ const message = useMessage()
const
formRef
=
ref
()
const
formRef
=
ref
()
// 消息类型(Follow: 关注时回复;Message: 消息回复;Keyword: 关键词回复)
// 消息类型(Follow: 关注时回复;Message: 消息回复;Keyword: 关键词回复)
// 作为tab.name
// 作为tab.name
,enum的数字不能随意修改,与api参数相关
enum
MsgType
{
enum
MsgType
{
Follow
=
1
,
Follow
=
1
,
Message
=
2
,
Message
=
2
,
...
@@ -277,9 +277,6 @@ const rules = {
...
@@ -277,9 +277,6 @@ const rules = {
requestMatch
:
[{
required
:
true
,
message
:
'请求的关键字的匹配不能为空'
,
trigger
:
'blur'
}]
requestMatch
:
[{
required
:
true
,
message
:
'请求的关键字的匹配不能为空'
,
trigger
:
'blur'
}]
}
}
// 重置 WxReplySelect 组件,解决无法清除的问题
const
hackResetWxReplySelect
=
ref
(
false
)
const
onAccountChanged
=
(
id
?:
number
)
=>
{
const
onAccountChanged
=
(
id
?:
number
)
=>
{
queryParams
.
accountId
=
id
queryParams
.
accountId
=
id
getList
()
getList
()
...
@@ -314,7 +311,6 @@ const handleTabChange = (tabName: TabPaneName) => {
...
@@ -314,7 +311,6 @@ const handleTabChange = (tabName: TabPaneName) => {
/** 新增按钮操作 */
/** 新增按钮操作 */
const
handleAdd
=
()
=>
{
const
handleAdd
=
()
=>
{
reset
()
reset
()
resetEditor
()
// 打开表单,并设置初始化
// 打开表单,并设置初始化
objData
.
value
=
{
objData
.
value
=
{
type
:
'text'
,
type
:
'text'
,
...
@@ -328,7 +324,6 @@ const handleAdd = () => {
...
@@ -328,7 +324,6 @@ const handleAdd = () => {
/** 修改按钮操作 */
/** 修改按钮操作 */
const
handleUpdate
=
async
(
row
:
any
)
=>
{
const
handleUpdate
=
async
(
row
:
any
)
=>
{
reset
()
reset
()
resetEditor
()
const
data
=
await
MpAutoReplyApi
.
getAutoReply
(
row
.
id
)
const
data
=
await
MpAutoReplyApi
.
getAutoReply
(
row
.
id
)
// 设置属性
// 设置属性
...
@@ -386,7 +381,7 @@ const handleSubmit = async () => {
...
@@ -386,7 +381,7 @@ const handleSubmit = async () => {
}
}
showReplyFormDialog
.
value
=
false
showReplyFormDialog
.
value
=
false
getList
()
await
getList
()
}
}
// 表单重置
// 表单重置
...
@@ -408,14 +403,6 @@ const cancel = () => {
...
@@ -408,14 +403,6 @@ const cancel = () => {
reset
()
reset
()
}
}
// 表单 Editor 重置
const
resetEditor
=
()
=>
{
hackResetWxReplySelect
.
value
=
false
// 销毁组件
nextTick
(()
=>
{
hackResetWxReplySelect
.
value
=
true
// 重建组件
})
}
const
handleDelete
=
async
(
row
)
=>
{
const
handleDelete
=
async
(
row
)
=>
{
await
message
.
confirm
(
'是否确认删除此数据?'
)
await
message
.
confirm
(
'是否确认删除此数据?'
)
await
MpAutoReplyApi
.
deleteAutoReply
(
row
.
id
)
await
MpAutoReplyApi
.
deleteAutoReply
(
row
.
id
)
...
...
src/views/mp/message/index.vue
View file @
92da7e34
...
@@ -190,10 +190,9 @@
...
@@ -190,10 +190,9 @@
v-model=
"showMessageBox"
v-model=
"showMessageBox"
@
click=
"showMessageBox = true"
@
click=
"showMessageBox = true"
width=
"50%"
width=
"50%"
destroy-on-close
>
>
<
template
#
footer
>
<WxMsg
:user-id=
"userId"
/>
<WxMsg
:user-id=
"userId"
v-if=
"showMessageBox"
/>
</
template
>
</el-dialog>
</el-dialog>
</ContentWrap>
</ContentWrap>
</template>
</template>
...
@@ -262,6 +261,7 @@ const handleQuery = () => {
...
@@ -262,6 +261,7 @@ const handleQuery = () => {
/** 重置按钮操作 */
/** 重置按钮操作 */
const
resetQuery
=
async
()
=>
{
const
resetQuery
=
async
()
=>
{
// 暂存accountId,并在reset后恢复
const
accountId
=
queryParams
.
accountId
const
accountId
=
queryParams
.
accountId
queryFormRef
.
value
?.
resetFields
()
queryFormRef
.
value
?.
resetFields
()
queryParams
.
accountId
=
accountId
queryParams
.
accountId
=
accountId
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment