Commit 90855357 by caoyanzhi

update: 对接创蓝短信

parent 86a59a6a
......@@ -16,7 +16,7 @@
"core-js": "^2.6.5",
"element-ui": "^2.13.0",
"js-cookie": "^2.2.0",
"vue": "^2.6.11",
"vue": "2.6.6",
"vue-router": "^3.1.5"
},
"devDependencies": {
......@@ -38,7 +38,7 @@
"sass-loader": "^7.1.0",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"vue-template-compiler": "^2.6.10"
"vue-template-compiler": "2.6.6"
},
"husky": {
"hooks": {
......
......@@ -48,13 +48,16 @@ export default {
};
},
created() {
this.getTableHeader();
this.getChannelList();
this.getChannelList().then(this.getTableHeader);
this.getTableData();
},
methods: {
// table methods
getTableHeader() {
const formatter = row => {
const channel = this.channelList.find(el => el.channelId == row.sendSmsType) || {};
return channel.channelName || '--';
};
this.tableData.tableHeader = [
{ label: '品牌名称', prop: 'brandName' },
{ label: '公司名称', prop: 'enterpriseName' },
......@@ -62,24 +65,7 @@ export default {
{
label: '发送通道',
prop: 'sendSmsType',
formatter(row) {
let text = '';
switch (row.sendSmsType) {
case 0:
text = '多通道';
break;
case 1:
text = '腾讯云';
break;
case 3:
text = '大汉三通';
break;
default:
text = '--';
break;
}
return text;
}
formatter
},
{ label: '短信模板总数', prop: 'maxTemplateCount' },
{ label: '已用短信模板数', prop: 'useTemplateCount' }
......@@ -113,9 +99,14 @@ export default {
this.$router.push(`/messageTemplateDetail?id=${row.enterpriseId}&tabId=${this.$route.query.tabId}`);
},
// others
async getChannelList() {
const { result } = await getAllChannel();
this.channelList = result.concat({ channelId: 0, channelName: '多通道' }) || [];
getChannelList() {
return getAllChannel().then(res => {
if (!Array.isArray(res.result)) {
res.result = [];
}
res.result.unshift({ channelId: 0, channelName: '多通道' });
this.channelList = res.result;
});
},
searchTypeChange() {
this.tableData.currentPage = 1;
......
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