Commit 1deaf4c9 authored by honghy's avatar honghy Committed by wux

短信日志模板预览

parent 9ba1e2b8
...@@ -92,9 +92,9 @@ ...@@ -92,9 +92,9 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('模板编号')" align="center" prop="templateId"> <el-table-column :label="$t('模板编号')" align="center" prop="templateId">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<router-link :to="`/system/sms/sms-template?apiTemplateId=${row.apiTemplateId}`" class="link-type"> <el-button size="mini" type="text" @click="look(row.templateId)">
{{ row.templateId }} {{ row.templateId }}
</router-link> </el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('短信类型')" align="center" prop="templateType"> <el-table-column :label="$t('短信类型')" align="center" prop="templateType">
...@@ -196,12 +196,80 @@ ...@@ -196,12 +196,80 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 预览模板 -->
<el-dialog :visible.sync="open2" width="500px" append-to-body>
<el-form label-width="140px">
<el-form-item :label="$t('短信渠道编号')" prop="channelId">
<el-select v-model="form2.channelId" :placeholder="$t('请选择短信渠道编号')">
<el-option v-for="channel in channelOptions"
:key="channel.id" :value="channel.id"
:label="channel.signature + '【' + getDictDataLabel(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE, channel.code) + '】'" />
</el-select>
</el-form-item>
<el-form-item :label="$t('发送类型')" prop="messageType">
<el-select v-model="form2.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="type">
<el-select v-model="form2.type" :placeholder="$t('请选择短信类型')">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
<el-form-item label="节点" prop="nodeValue">
<el-select v-model="form2.nodeValue" placeholder="请选择节点类型">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.SYSTEM_SMS_NODE_NODE)"
:key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item :label="$t('运输方式')" prop="transportId">
<el-select v-model="form2.transportId" :placeholder="$t('请选择运输方式类型')">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.ECW_TRANSPORT_TYPE)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
<el-option key="0" label="无" :value="parseInt(0)" />
</el-select>
</el-form-item>
<el-form-item :label="$t('模板编号')" prop="code">
<el-input v-model="form2.code" :placeholder="$t('请输入模板编号')" />
</el-form-item>
<el-form-item :label="$t('模板名称')" prop="name">
<el-input v-model="form2.name" :placeholder="$t('请输入模板名称')" />
</el-form-item>
<el-form-item :label="$t('开启状态')" prop="status">
<el-radio-group v-model="form2.status">
<el-radio v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)"
:key="dict.value" :label="parseInt(dict.value)">{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="短信API模板编号" prop="apiTemplateId">
<el-input v-model="form2.apiTemplateId" placeholder="请输入短信 API 的模板编号" />
</el-form-item>
<el-form-item :label="$t('模板内容')" prop="content">
<el-input type="textarea" v-model="form2.content" :placeholder="$t('请输入模板内容')" />
</el-form-item>
<el-form-item :label="$t('备注')" prop="remark">
<el-input v-model="form2.remark" :placeholder="$t('请输入备注')" />
</el-form-item>
<el-form-item label="语言" prop="language">
<el-select v-model="form2.language" placeholder="请选择语言">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.SYSTEM_SMS_TEMPLATE_LANGUAGE)"
:key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-form>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getSmsLogPage, exportSmsLogExcel } from "@/api/system/sms/smsLog"; import { getSmsLogPage, exportSmsLogExcel } from "@/api/system/sms/smsLog";
import { getSimpleSmsChannels } from "@/api/system/sms/smsChannel"; import { getSimpleSmsChannels } from "@/api/system/sms/smsChannel";
import {getSmsTemplate} from '@/api/system/sms/smsTemplate'
export default { export default {
name: "SmsLog", name: "SmsLog",
...@@ -239,6 +307,8 @@ export default { ...@@ -239,6 +307,8 @@ export default {
}, },
// 短信渠道 // 短信渠道
channelOptions: [], channelOptions: [],
form2: {},
open2: false,
}; };
}, },
created() { created() {
...@@ -310,6 +380,12 @@ export default { ...@@ -310,6 +380,12 @@ export default {
} }
} }
return this.$t('找不到签名:') + channelId; return this.$t('找不到签名:') + channelId;
},
look(templateId) {
getSmsTemplate(templateId).then(response => {
this.form2 = response.data
this.open2 = true
});
} }
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment