From 79163f668fa8c06bc38458df2f313c19f7e3ec85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E8=B4=A4=E9=87=91?= <1960116313@qq.com> Date: Wed, 18 May 2022 13:54:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E7=9B=AE=E6=A0=87?= =?UTF-8?q?=E6=B5=81=E9=87=8F=E6=B1=A0=E9=A1=B5=E9=9D=A2=20fix:=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=9F=BA=E7=A1=80=E5=8D=A1=E5=AF=BC=E5=85=A5=20=20=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=A1=E5=87=BA=E5=BA=93=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basiccard/basiccard.vue | 48 +- .../communicationmanage/flowpool/flowpool.vue | 97 ++-- .../communicationmanage/outbound/outbound.vue | 166 +++---- .../targetflowpool/targetflowpool.vue | 415 ++++++++++++++++++ 4 files changed, 587 insertions(+), 139 deletions(-) create mode 100644 src/views/communicationmanage/targetflowpool/targetflowpool.vue diff --git a/src/views/communicationmanage/basiccard/basiccard.vue b/src/views/communicationmanage/basiccard/basiccard.vue index a4a52af..7151499 100644 --- a/src/views/communicationmanage/basiccard/basiccard.vue +++ b/src/views/communicationmanage/basiccard/basiccard.vue @@ -205,8 +205,8 @@ export default { data() { var starts = (rule, value, callback) => { if ( - this.distribution.numEnd == null || - this.distribution.numStart == null + this.distribution.numEnd == "" || + this.distribution.numStart == "" ) { callback(new Error("开始号码结束号码均不能为空")); } else if ( @@ -229,10 +229,12 @@ export default { tenantId: "", isCovered: 0, dataPlanId: "", + flowPoolId: "", }, excelOption: { submitBtn: false, emptyBtn: true, + labelWidth: 130, column: [ { label: "通道名称", @@ -272,6 +274,26 @@ export default { }, ], }, + { + label: "元流量池名称", + prop: "flowPoolId", + type: "select", + span: 20, + display: true, + dicUrl: "/api/iot-sim/flowpool/fillData?isSource=" + 1, + props: { + label: "name", + value: "id", + }, + dataType: "String", + rules: [ + { + required: true, + message: "请选择元流量池名称", + trigger: "change", + }, + ], + }, { label: "模板上传", prop: "excelFile", @@ -280,6 +302,7 @@ export default { display: false, loadText: "模板上传中,请稍等", span: 24, + showFileList: false, propsHttp: { res: "data", }, @@ -323,8 +346,8 @@ export default { distribution: { tenantId: "", //租户id deliverType: null, //分拨类型 - numStart: null, //开始号码 - numEnd: null, //结束号码 + numStart: "", //开始号码 + numEnd: "", //结束号码 dataPlanId: "", }, //分拨 redistribution: { @@ -624,7 +647,7 @@ export default { const column = this.findObject(this.excelOption.column, "excelFile"); if (this.excelForm.tenantId != "" && this.excelForm.dataPlanId != "") { column.display = true; - column.action = `${this.baseUrl}/${this.apis}iot-sim/simcard/import-simCard?channelId=${this.excelForm.tenantId}&isCovered=${this.excelForm.isCovered}&dataPlanId=${this.excelForm.dataPlanId}`; + column.action = `${this.baseUrl}/${this.apis}iot-sim/simcard/import-simCard?channelId=${this.excelForm.tenantId}&isCovered=${this.excelForm.isCovered}&dataPlanId=${this.excelForm.dataPlanId}&flowPoolId=${this.excelForm.flowPoolId}`; } else { column.display = false; } @@ -633,7 +656,7 @@ export default { const column = this.findObject(this.excelOption.column, "excelFile"); if (this.excelForm.tenantId != "" && this.excelForm.dataPlanId != "") { column.display = true; - column.action = `${this.baseUrl}/${this.apis}iot-sim/simcard/import-simCard?channelId=${this.excelForm.tenantId}&isCovered=${this.excelForm.isCovered}&dataPlanId=${this.excelForm.dataPlanId}`; + column.action = `${this.baseUrl}/${this.apis}iot-sim/simcard/import-simCard?channelId=${this.excelForm.tenantId}&isCovered=${this.excelForm.isCovered}&dataPlanId=${this.excelForm.dataPlanId}&flowPoolId=${this.excelForm.flowPoolId}`; } else { column.display = false; } @@ -641,11 +664,16 @@ export default { "excelForm.isCovered"() { const column = this.findObject(this.excelOption.column, "excelFile"); if (this.excelForm.isCovered !== "") { - column.action = `${this.baseUrl}/${this.apis}iot-sim/simcard/import-simCard?channelId=${this.excelForm.tenantId}&isCovered=${this.excelForm.isCovered}&dataPlanId=${this.excelForm.dataPlanId}`; + column.action = `${this.baseUrl}/${this.apis}iot-sim/simcard/import-simCard?channelId=${this.excelForm.tenantId}&isCovered=${this.excelForm.isCovered}&dataPlanId=${this.excelForm.dataPlanId}&flowPoolId=${this.excelForm.flowPoolId}`; + } + }, + "excelForm.flowPoolId"() { + const column = this.findObject(this.excelOption.column, "excelFile"); + if (this.excelForm.flowPoolId != "") { + column.action = `${this.baseUrl}/${this.apis}iot-sim/simcard/import-simCard?channelId=${this.excelForm.tenantId}&isCovered=${this.excelForm.isCovered}&dataPlanId=${this.excelForm.dataPlanId}&flowPoolId=${this.excelForm.flowPoolId}`; } }, "form.$channelId"() { - console.log(this.form.channelId, "channelId"); const columns = this.findObject(this.option.column, "flowPoolId"); if (this.form.$channelId != undefined) { if (this.form.$channelId.indexOf("电信") != -1) { @@ -815,7 +843,7 @@ export default { //导入弹窗关闭 handleCloses() { this.excelBox = false; - this.$refs.excelForm.resetFields(); + // this.$refs.excelForm.resetFields(); }, //下载模板 handleTemplate() { @@ -889,7 +917,7 @@ export default { } }); } else { - simCallback(this.distribution).then((res) => { + simCallback(this.distribution).then((res) => { if (res.data.data == "") { this.$message.success("操作成功"); this.$refs.distribution.resetFields(); diff --git a/src/views/communicationmanage/flowpool/flowpool.vue b/src/views/communicationmanage/flowpool/flowpool.vue index 4741834..5910231 100644 --- a/src/views/communicationmanage/flowpool/flowpool.vue +++ b/src/views/communicationmanage/flowpool/flowpool.vue @@ -58,6 +58,9 @@ export default { currentPage: 1, total: 0, }, + isSources: { + isSource: 1, + }, option: { tip: false, searchShow: true, @@ -72,13 +75,14 @@ export default { selection: false, dialogClickModal: false, dialogWidth: "60%", + labelWidth: 150, column: [ { label: "通道名称", prop: "channelId", type: "select", span: 12, - labelWidth: 130, + search: true, dataType: "String", dicUrl: "/api/iot-sim/channel/fillData", @@ -98,7 +102,7 @@ export default { label: "流量池编号", prop: "code", span: 12, - labelWidth: 130, + searchLabelWidth: 90, search: false, rules: [ @@ -113,7 +117,7 @@ export default { label: "流量池名称", prop: "name", span: 12, - labelWidth: 130, + searchLabelWidth: 90, search: true, rules: [ @@ -128,7 +132,7 @@ export default { label: "流量池总量", prop: "total", span: 12, - labelWidth: 130, + searchLabelWidth: 90, search: false, hide: false, @@ -150,7 +154,7 @@ export default { label: "提醒阈值", prop: "remindRatio", span: 12, - labelWidth: 130, + searchLabelWidth: 90, search: false, hide: false, @@ -180,7 +184,7 @@ export default { }, dataType: "number", span: 12, - labelWidth: 130, + search: false, hide: true, rules: [ @@ -202,7 +206,7 @@ export default { }, dataType: "number", prop: "type", - labelWidth: 130, + searchLabelWidth: 140, search: false, rules: [ @@ -213,34 +217,12 @@ export default { }, ], }, - { - label: "源/目标流量池", - type: "select", - span: 12, - dicUrl: "/api/iot-system/dict/dictionary?code=is_source", - props: { - label: "dictValue", - value: "dictKey", - }, - dataType: "number", - prop: "isSource", - labelWidth: 130, - searchLabelWidth: 110, - search: false, - rules: [ - { - required: true, - message: "请选择源/目标流量池", - trigger: "change", - }, - ], - }, { - label: "单卡最大使用量(M)", + label: "单卡最大使用量(M)", prop: "maxUsage", span: 12, - labelWidth: 130, + search: false, hide: true, type: "number", @@ -261,7 +243,7 @@ export default { label: "已激活数量", prop: "activationNum", span: 12, - labelWidth: 130, + search: false, hide: true, addDisplay: false, @@ -284,7 +266,6 @@ export default { label: "管理员名称", prop: "account", span: 12, - labelWidth: 130, search: false, addDisplay: false, editDisplay: false, @@ -334,14 +315,23 @@ export default { }, //新增 rowSave(row, done, loading) { - add(row).then( - () => { - this.onLoad(this.page); - this.$message({ - type: "success", - message: "操作成功!", - }); - done(); + add(Object.assign(row, this.isSources)).then( + (res) => { + if (res.data.data == 1) { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "操作成功!", + }); + done(); + } else { + this.$message({ + type: "error", + message: "操作失败!", + }); + done(); //关闭表单 + loading(); // 按钮停止加载 + } }, (error) => { window.console.log(error); @@ -352,13 +342,22 @@ export default { //修改 rowUpdate(row, index, done, loading) { update(row).then( - () => { - this.onLoad(this.page); - this.$message({ - type: "success", - message: "操作成功!", - }); - done(); + (res) => { + if (res.data.data == 1) { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "操作成功!", + }); + done(); + } else { + this.$message({ + type: "error", + message: "操作失败!", + }); + done(); //关闭表单 + loading(); // 按钮停止加载 + } }, (error) => { window.console.log(error); @@ -398,7 +397,7 @@ export default { getList( page.currentPage, page.pageSize, - Object.assign(params, this.query) + Object.assign(params, this.query, this.isSources) ).then((res) => { const data = res.data.data; this.page.total = data.total; diff --git a/src/views/communicationmanage/outbound/outbound.vue b/src/views/communicationmanage/outbound/outbound.vue index c554ace..da55bcc 100644 --- a/src/views/communicationmanage/outbound/outbound.vue +++ b/src/views/communicationmanage/outbound/outbound.vue @@ -25,7 +25,7 @@ size="small" type="primary" icon="el-icon-download" - @click="handleExport" + @click="handleAllocate" >导出 + + - - - - - - + @@ -82,25 +68,38 @@ > - - - - + + + + + + + + - + + + + + - 导出 - 取消 + + + 导 出 + + 取 + 消 @@ -120,6 +119,25 @@ import { mapGetters } from "vuex"; import { getToken } from "@/util/auth"; export default { data() { + var starts = (rule, value, callback) => { + if ( + this.distribution.numEnd == "" || + this.distribution.numStart == "" + ) { + callback(new Error("开始号码结束号码均不能为空")); + } else if ( + this.distribution.numEnd < 0 || + this.distribution.numStart < 0 + ) { + callback(new Error("开始号码结束号码均不能为负数")); + } else if ( + Number(this.distribution.numStart) > Number(this.distribution.numEnd) + ) { + callback(new Error("开始号码必须小于结束号码")); + } else { + callback(); + } + }; return { form: {}, query: {}, @@ -128,29 +146,23 @@ export default { tenantId: null, //租户 userId: null, //客户 }, + dialogVisible: false, //分拨弹窗布尔 selectionList: [], tenantlist: [], //租户下拉 userlist: [], //用户下拉 - typelist: [ - { - label: "租户", - id: 1, - }, - { - label: "客户", - id: 2, - }, - ], - importBox: false, //导出布尔 + + //导出 + distribution: { + tenantId: "", //租户id + numStart: "", //开始号码 + numEnd: "", //结束号码 + }, loading: true, - importrules: { - type: [ - { required: true, message: "请选择租户/客户", trigger: "change" }, - ], + distrules: { tenantId: [ - { required: true, message: "请选择租户", trigger: "change" }, + { required: true, message: "请选择客户", trigger: "change" }, ], - userId: [{ required: true, message: "请选择客户", trigger: "change" }], + numbers: [{ required: true, validator: starts, trigger: "blur" }], }, page: { pageSize: 10, @@ -686,39 +698,33 @@ export default { this.onLoad(this.page, this.query); }, //导出弹窗开启 - handleExport() { - this.importBox = true; + handleAllocate() { + this.dialogVisible = true; + }, + //导出弹窗关闭 + handleClose() { + this.dialogVisible = false; + this.$refs.distribution.resetFields(); }, //确认导出 onSubmit() { - this.$refs.iform.validate((valid) => { + this.$refs.distribution.validate((valid) => { if (valid) { - console.log( - `${this.baseUrl}/${ - this.apis - }iot-sim/simcarddeliver/export-simCardDeliver?${ - this.website.tokenHeader - }=${getToken()}&tenantId=${this.iform.tenantId}&userId=${ - this.iform.userId - }` - ); window.open( `${this.baseUrl}/${ this.apis }iot-sim/simcarddeliver/export-simCardDeliver?${ this.website.tokenHeader - }=${getToken()}&tenantId=${this.iform.tenantId}&userId=${ - this.iform.userId - }` + }=${getToken()}&tenantId=${this.distribution.tenantId}&numStart=${ + this.distribution.numStart + }&numEnd=${this.distribution.numEnd}` ); + this.dialogVisible = false; + this.$refs.distribution.resetFields(); } }); }, - //导出弹窗关闭 - handleimportCloses() { - this.importBox = false; - this.$refs.iform.resetFields(); - }, + //租户下拉框 tenantlists() { tenant().then((res) => { diff --git a/src/views/communicationmanage/targetflowpool/targetflowpool.vue b/src/views/communicationmanage/targetflowpool/targetflowpool.vue new file mode 100644 index 0000000..76bb3cd --- /dev/null +++ b/src/views/communicationmanage/targetflowpool/targetflowpool.vue @@ -0,0 +1,415 @@ + + + + +