Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-operator-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-app-operator-master
Commits
5ce35a8b
Commit
5ce35a8b
authored
Nov 23, 2024
by
honghy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试短信节点
parent
ede403d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
2 deletions
+83
-2
smsNode.js
src/api/system/sms/smsNode.js
+9
-0
smsNode.vue
src/views/system/sms/smsNode.vue
+74
-2
No files found.
src/api/system/sms/smsNode.js
View file @
5ce35a8b
...
...
@@ -52,3 +52,12 @@ export function exportSmsNodeExcel(query) {
responseType
:
'
blob
'
})
}
// 测试短信节点
export
function
testSms
(
data
)
{
return
request
({
url
:
'
/system/sms-node/test
'
,
method
:
'
post
'
,
data
:
data
})
}
src/views/system/sms/smsNode.vue
View file @
5ce35a8b
...
...
@@ -129,6 +129,7 @@
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"test(scope.row)"
>
测试
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['system:sms-node:update']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
...
...
@@ -216,11 +217,40 @@
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
<!-- 对话框(发送短信) -->
<el-dialog
:title=
"$t('测试发送短信')"
:visible.sync=
"sendSmsOpen"
width=
"500px"
append-to-body
>
<el-form
ref=
"sendSmsForm"
:model=
"sendSmsForm"
:rules=
"sendSmsRules"
label-width=
"140px"
>
<el-form-item
:label=
"$t('发送类型')"
prop=
"messageType"
>
<el-select
v-model=
"sendSmsForm.messageType"
placeholder=
"请选择发送类型"
>
<el-option
v-for=
"dict in this.getDictDatas(DICT_TYPE.SYSTEM_SMS_TEMPLATE_MESSAGE_TYPE)"
:key=
"dict.value"
:label=
"dict.label"
:value=
"parseInt(dict.value)"
/>
</el-select>
</el-form-item>
<el-form-item
:label=
"$t('区号')"
prop=
"countryCode"
>
<el-input
v-model=
"sendSmsForm.countryCode"
:placeholder=
"$t('请输入区号')"
/>
</el-form-item>
<el-form-item
:label=
"$t('手机号')"
prop=
"mobile"
>
<el-input
v-model=
"sendSmsForm.mobile"
:placeholder=
"$t('请输入手机号')"
/>
</el-form-item>
<el-form-item
label=
"模板序号"
prop=
"nodeTemplateSn"
>
<el-input
v-model=
"sendSmsForm.nodeTemplateSn"
placeholder=
"请输入模板序号"
/>
</el-form-item>
<el-form-item
label=
"参数(JSON)"
prop=
"templateParams"
>
<el-input
v-model=
"sendSmsForm.templateParams"
type=
"textarea"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitSendSmsForm"
>
{{ $t('确 定') }}
</el-button>
<el-button
@
click=
"cancelSendSms"
>
{{ $t('取 消') }}
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
createSmsNode
,
updateSmsNode
,
deleteSmsNode
,
getSmsNode
,
getSmsNodePage
,
exportSmsNodeExcel
}
from
"
@/api/system/sms/smsNode
"
;
import
{
createSmsNode
,
updateSmsNode
,
deleteSmsNode
,
getSmsNode
,
getSmsNodePage
,
exportSmsNodeExcel
,
testSms
}
from
"
@/api/system/sms/smsNode
"
;
import
{
getCountryListAll
}
from
'
@/api/ecw/country
'
import
{
getSmsTemplateList
}
from
'
@/api/system/sms/smsTemplate
'
...
...
@@ -277,7 +307,16 @@ export default {
isOrders
:
[{
required
:
true
,
message
:
"
多订单不能为空
"
,
trigger
:
"
change
"
}],
},
countryMap
:
new
Map
(),
smsTemplateMap
:
new
Map
()
smsTemplateMap
:
new
Map
(),
sendSmsOpen
:
false
,
sendSmsForm
:
{},
sendSmsRules
:
{
mobile
:
[{
required
:
true
,
message
:
this
.
$t
(
"
手机不能为空
"
),
trigger
:
"
blur
"
}],
countryCode
:
[{
required
:
true
,
message
:
"
区号不能为空
"
,
trigger
:
"
blur
"
}],
messageType
:
[{
required
:
true
,
message
:
"
发送类型不能为空
"
,
trigger
:
"
blur
"
}],
nodeTemplateSn
:
[{
required
:
true
,
message
:
"
模板序号不能为空
"
,
trigger
:
"
blur
"
}],
},
node
:
{}
};
},
async
created
()
{
...
...
@@ -419,6 +458,39 @@ export default {
}
else
{
this
.
form
.
countryCode
=
this
.
countryList
.
filter
(
a
=>
a
.
id
==
val
)[
0
].
tel
}
},
test
(
row
)
{
this
.
sendSmsForm
=
{
mobile
:
''
,
countryCode
:
''
,
templateParams
:
''
,
messageType
:
null
,
nodeTemplateSn
:
1
}
this
.
node
=
row
this
.
sendSmsOpen
=
true
},
/** 取消发送短信 */
cancelSendSms
()
{
this
.
sendSmsOpen
=
false
;
},
/** 提交按钮 */
submitSendSmsForm
()
{
this
.
$refs
[
"
sendSmsForm
"
].
validate
(
valid
=>
{
if
(
!
valid
)
{
return
;
}
this
.
node
[
'
countryCode
'
]
=
this
.
sendSmsForm
.
countryCode
this
.
node
[
'
mobile
'
]
=
this
.
sendSmsForm
.
countryCode
+
''
+
this
.
sendSmsForm
.
mobile
this
.
node
[
'
templateParams
'
]
=
JSON
.
parse
(
this
.
sendSmsForm
.
templateParams
)
this
.
node
[
'
messageType
'
]
=
this
.
sendSmsForm
.
messageType
this
.
node
[
'
nodeTemplateSn
'
]
=
this
.
sendSmsForm
.
nodeTemplateSn
// 添加的提交
testSms
(
this
.
node
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"
提交发送成功!
"
);
this
.
sendSmsOpen
=
false
;
});
});
}
}
};
...
...
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