diff --git a/public/img/bg/bg.png b/public/img/bg/bg.png new file mode 100644 index 0000000..7fc4b8e Binary files /dev/null and b/public/img/bg/bg.png differ diff --git a/public/img/bg/bg.jpg b/public/img/bg/big.jpg similarity index 100% rename from public/img/bg/bg.jpg rename to public/img/bg/big.jpg diff --git a/public/img/bg/logo.png b/public/img/bg/logo.png index b3e40cc..d50ec5e 100644 Binary files a/public/img/bg/logo.png and b/public/img/bg/logo.png differ diff --git a/public/img/logo.png b/public/img/logo.png deleted file mode 100644 index b3e40cc..0000000 Binary files a/public/img/logo.png and /dev/null differ diff --git a/src/api/communication/basiccard.js b/src/api/communication/basiccard.js index 29ea936..7f49abc 100644 --- a/src/api/communication/basiccard.js +++ b/src/api/communication/basiccard.js @@ -58,14 +58,14 @@ export const allocate = () => { //租户下拉 export const tenant = () => { return request({ - url:'/api/iot-system/tenant/fillData', + url: '/api/iot-system/tenant/fillData', method: 'get', }) } //分拨操作 export const simdeliver = (params) => { return request({ - url:'/api/iot-sim/simcard/simdeliver', + url: '/api/iot-sim/simcard/simdeliver', method: 'post', params: { ...params, @@ -75,7 +75,7 @@ export const simdeliver = (params) => { //通道 export const channelfillData = () => { return request({ - url:'/api/iot-sim/channel/fillData', + url: '/api/iot-sim/channel/fillData', method: 'get', }) @@ -83,7 +83,16 @@ export const channelfillData = () => { //流量池 export const flowpoolfillData = () => { return request({ - url:'/api/iot-sim/flowpool/fillData?isSource=' + 1, + url: '/api/iot-sim/flowpool/fillData?isSource=' + 1, + method: 'get', + + }) +} + +//基础套餐 +export const dataplan = () => { + return request({ + url: '/api/iot-sim/dataplan/fillData?isSource=' + 2, method: 'get', }) diff --git a/src/config/env.js b/src/config/env.js index 8c982c7..d1f50ce 100644 --- a/src/config/env.js +++ b/src/config/env.js @@ -3,12 +3,15 @@ let iconfontVersion = ['567566_pwc3oottzol']; let iconfontUrl = `//at.alicdn.com/t/font_$key.css`; let baseUrl = ''; +let apis = ''; let codeUrl = `${baseUrl}/code` const env = process.env if (env.NODE_ENV === 'development') { baseUrl = ''; // 开发环境地址 + apis = "api/"; } else if (env.NODE_ENV === 'production') { baseUrl = 'http://223.99.228.240:18081'; //生产环境地址 + api = ""; } else if (env.NODE_ENV === 'test') { baseUrl = ``; //测试环境地址 } @@ -17,5 +20,6 @@ export { iconfontUrl, iconfontVersion, codeUrl, + apis, env } diff --git a/src/main.js b/src/main.js index 2a00c9b..f75a90f 100644 --- a/src/main.js +++ b/src/main.js @@ -22,6 +22,7 @@ import thirdRegister from './components/third-register/main'; import avueUeditor from 'avue-plugin-ueditor'; import website from '@/config/website'; import crudCommon from '@/mixins/crud'; +import {baseUrl,apis} from '@/config/env'; // 注册全局crud驱动 window.$crudCommon = crudCommon; // 加载Vue拓展 @@ -47,6 +48,10 @@ Object.keys(urls).forEach(key => { }); // 加载website Vue.prototype.website = website; +//加载baseUrl +Vue.prototype.baseUrl = baseUrl; +//加载baseUrl +Vue.prototype.apis = apis; // 动态加载阿里云字体库 iconfontVersion.forEach(ele => { loadStyle(iconfontUrl.replace('$key', ele)); diff --git a/src/page/login/index.vue b/src/page/login/index.vue index 80ee789..b3e19ed 100644 --- a/src/page/login/index.vue +++ b/src/page/login/index.vue @@ -8,7 +8,7 @@ <div class="login-time"> {{time}} </div> - <img class="img" src="/img/logo.png" alt=""> + <img class="img" src="http://static.qnaiot.com/sim/login-mid.png" alt=""> <p class="title">{{ $t('login.info') }}</p> </div> <div class="login-border"> diff --git a/src/styles/login.scss b/src/styles/login.scss index 498d5af..2df548e 100644 --- a/src/styles/login.scss +++ b/src/styles/login.scss @@ -5,7 +5,7 @@ width: 100%; height: 100%; margin: 0 auto; - background-image: url("/img/bg/bg.jpg"); + background-image: url("http://static.qnaiot.com/sim/login-bg.jpg"); background-size: 100% 100%; } diff --git a/src/views/communicationmanage/basiccard/basiccard.vue b/src/views/communicationmanage/basiccard/basiccard.vue index db029f8..f88579d 100644 --- a/src/views/communicationmanage/basiccard/basiccard.vue +++ b/src/views/communicationmanage/basiccard/basiccard.vue @@ -50,7 +50,6 @@ >出 库</el-button> --> </template> </avue-crud> - <!-- 导出 :upload-after="uploadAfter"--> <el-dialog title="导入" append-to-body @@ -114,6 +113,21 @@ ></el-option> </el-select> </el-form-item> + <el-form-item label="基础套餐" prop="dataPlanId"> + <el-select + v-model="distribution.dataPlanId" + placeholder="请选择基础套餐" + size="mini" + style="width: 90%" + > + <el-option + v-for="(item, index) in basicpackge" + :label="item.name" + :value="item.id" + :key="item.id" + ></el-option> + </el-select> + </el-form-item> <el-form-item label="开始/结束号码" prop="numbers"> <el-col :span="10"> <el-form-item prop="numStart"> @@ -160,7 +174,7 @@ import { allocate, tenant, simdeliver, - channelfillData, + dataplan, } from "@/api/communication/basiccard"; import { mapGetters } from "vuex"; import { getToken } from "@/util/auth"; @@ -191,6 +205,7 @@ export default { excelForm: { tenantId: "", isCovered: 0, + dataPlanId: "", }, excelOption: { submitBtn: false, @@ -200,7 +215,7 @@ export default { label: "通道名称", prop: "tenantId", type: "select", - dataType: "Number", + dataType: "String", span: 20, dicUrl: "/api/iot-sim/channel/fillData", props: { @@ -215,6 +230,25 @@ export default { }, ], }, + { + label: "元套餐", + prop: "dataPlanId", + type: "select", + dicUrl: "/api/iot-sim/dataplan/fillData?isSource=" + 1, + props: { + label: "name", + value: "id", + }, + dataType: "String", + span: 20, + rules: [ + { + required: true, + message: "请选择元套餐", + trigger: "change", + }, + ], + }, { label: "模板上传", prop: "excelFile", @@ -268,8 +302,10 @@ export default { deliverType: null, //分拨类型 numStart: null, //开始号码 numEnd: null, //结束号码 + dataPlanId: "", }, //分拨 distributionlist: [], //分拨类型下拉 + basicpackge: [], //基础套餐下拉 tenantlist: [], //租户下拉 distrules: { tenantId: [ @@ -279,6 +315,9 @@ export default { { required: true, message: "请选择分拨类型", trigger: "change" }, ], numbers: [{ required: true, validator: starts, trigger: "blur" }], + dataPlanId: [ + { required: true, message: "请选择基础套餐", trigger: "change" }, + ], }, channellist: [], //通道下拉 ruleForm: {}, //导入 @@ -303,12 +342,21 @@ export default { addBtn: true, viewBtn: true, delBtn: true, - excelBtn: false, //导出 + excelBtn: false, columnBtn: false, selection: false, dialogClickModal: false, dialogWidth: "60%", column: [ + { + label: "id", + prop: "id", + type: "input", + search: false, + addDisplay:false, + editDisplay:false, + width:170, + }, { label: "通道名称", prop: "channelId", @@ -316,6 +364,7 @@ export default { dataType: "String", span: 12, labelWidth: 130, + width:100, search: true, dicUrl: "/api/iot-sim/channel/fillData", props: { @@ -338,6 +387,7 @@ export default { span: 12, labelWidth: 130, searchLabelWidth: 110, + width: 110, search: true, display: true, dicUrl: "/api/iot-sim/flowpool/fillData?isSource=" + 1, @@ -360,12 +410,35 @@ export default { }, ], }, + { + label: "元套餐", + prop: "dataPlanId", + type: "select", + dicUrl: "/api/iot-sim/dataplan/fillData?isSource=" + 1, + props: { + label: "name", + value: "id", + }, + dataType: "String", + span: 12, + labelWidth: 130, + searchLabelWidth: 110, + search: true, + rules: [ + { + required: true, + message: "请选择元套餐", + trigger: "change", + }, + ], + }, { label: "批次号", prop: "batchNum", span: 12, labelWidth: 130, search: true, + width:115, addDisplay: false, rules: [ { @@ -410,6 +483,7 @@ export default { prop: "msisdn", span: 12, labelWidth: 130, + width:110, search: true, rules: [ { @@ -448,6 +522,8 @@ export default { dataType: "number", span: 12, labelWidth: 130, + addDisplay:false, + editDisplay:false, width: 70, search: true, rules: [ @@ -513,18 +589,23 @@ export default { created() { this.allocatelist(); //分拨列表 this.tenantlists(); //租户下拉 + this.basicpackges(); //基础套餐下拉 }, watch: { "excelForm.tenantId"() { const column = this.findObject(this.excelOption.column, "excelFile"); - if (this.excelForm.tenantId != "") { - if (process.env.NODE_ENV === "production") { - column.display = true; - column.action = `http://223.99.228.240:18081/iot-sim/simcard/import-simCard?channelId=${this.excelForm.tenantId}&isCovered=${this.excelForm.isCovered}`; - } else { - column.display = true; - column.action = `/api/iot-sim/simcard/import-simCard?channelId=${this.excelForm.tenantId}&isCovered=${this.excelForm.isCovered}`; - } + 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}`; + } else { + column.display = false; + } + }, + "excelForm.dataPlanId"() { + 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}`; } else { column.display = false; } @@ -532,11 +613,7 @@ export default { "excelForm.isCovered"() { const column = this.findObject(this.excelOption.column, "excelFile"); if (this.excelForm.isCovered !== "") { - if (process.env.NODE_ENV === "production") { - column.action = `http://223.99.228.240:18081/iot-sim/simcard/import-simCard?channelId=${this.excelForm.tenantId}&isCovered=${this.excelForm.isCovered}`; - } else { - column.action = `/api/iot-sim/simcard/import-simCard?channelId=${this.excelForm.tenantId}&isCovered=${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}`; } }, "form.$channelId"() { @@ -678,19 +755,11 @@ export default { }, //导出 handleExport() { - if (process.env.NODE_ENV === "production") { - window.open( - `http://223.99.228.240:18081/bd-core/tenant/dailybill/export-excel?${ - this.website.tokenHeader - }=${getToken()}` - ); - } else { - window.open( - `/api/iot-sim/simcard/export-simCard?${ - this.website.tokenHeader - }=${getToken()}` - ); - } + window.open( + `${this.baseUrl}/${this.apis}iot-sim/simcard/export-simCard?${ + this.website.tokenHeader + }=${getToken()}` + ); }, //导入弹窗开启 handleImport() { @@ -723,6 +792,14 @@ export default { } }); }, + //基础套餐下拉框 + basicpackges() { + dataplan().then((res) => { + if (res.data.code == 200) { + this.basicpackge = res.data.data; + } + }); + }, //租户下拉框 tenantlists() { tenant().then((res) => { diff --git a/src/views/communicationmanage/device/device.vue b/src/views/communicationmanage/device/device.vue index 7d2d513..d497b13 100644 --- a/src/views/communicationmanage/device/device.vue +++ b/src/views/communicationmanage/device/device.vue @@ -310,19 +310,11 @@ export default { }, //导出 handleExport() { - if (process.env.NODE_ENV === "production") { - window.open( - `http://223.99.228.240:18081/iot-sim/device/export-device?${ - this.website.tokenHeader - }=${getToken()}` - ); - } else { - window.open( - `/api/iot-sim/device/export-device?${ - this.website.tokenHeader - }=${getToken()}` - ); - } + window.open( + `${this.baseUrl}/${this.apis}iot-sim/device/export-device?${ + this.website.tokenHeader + }=${getToken()}` + ); }, onLoad(page, params = {}) { this.loading = true; diff --git a/src/views/communicationmanage/outbound/outbound.vue b/src/views/communicationmanage/outbound/outbound.vue index b918175..04e55d1 100644 --- a/src/views/communicationmanage/outbound/outbound.vue +++ b/src/views/communicationmanage/outbound/outbound.vue @@ -62,7 +62,7 @@ export default { addBtn: true, viewBtn: true, delBtn: true, - dialogDrag:true, + dialogDrag: true, columnBtn: false, selection: false, dialogClickModal: false, @@ -152,12 +152,35 @@ export default { trigger: "change", }, ], + }, + { + label: "基础套餐", + prop: "dataPlanId", + type: "select", + dicUrl: "/api/iot-sim/dataplan/fillData?isSource="+2, + props: { + label: "name", + value: "id", + }, + dataType: "String", + span: 12, + labelWidth: 130, + searchLabelWidth: 110, + width:110, + search: true, + rules: [ + { + required: true, + message: "请选择基础套餐", + trigger: "change", + }, + ], }, { - label: "卡状态", - prop: "cardStatus", + label: "生命周期状态", + prop: "lifecycleStatus", type: "select", - dicUrl: "/api/iot-system/dict/dictionary?code=card_status", + dicUrl: "/api/iot-system/dict/dictionary?code=lifecycleStatus", props: { label: "dictValue", value: "dictKey", @@ -165,10 +188,15 @@ export default { dataType: "number", span: 12, labelWidth: 130, - width: 70, + searchLabelWidth: 110, + width: 110, search: true, rules: [ - { required: true, message: "请选择卡状态", trigger: "change" }, + { + required: true, + message: "请选择生命周期状态", + trigger: "change", + }, ], }, { @@ -189,6 +217,89 @@ export default { { required: true, message: "请选择卡类型", trigger: "change" }, ], }, + { + label: "是否断网", + prop: "offNetStatus", + type: "select", + dicUrl: "/api/iot-system/dict/dictionary?code=off_netStatus", + props: { + label: "dictValue", + value: "dictKey", + }, + dataType: "number", + span: 12, + labelWidth: 130, + width: 70, + search: false, + rules: [ + { required: true, message: "请选择是否断网", trigger: "change" }, + ], + }, + { + label: "断网类型", + prop: "offNetType", + type: "select", + dicUrl: "/api/iot-system/dict/dictionary?code=off_netType", + props: { + label: "dictValue", + value: "dictKey", + }, + dataType: "number", + display: true, + span: 12, + formatter: (val, value, label) => { + if (value == -1) { + return "-"; + } else { + return `${label}`; + } + }, + labelWidth: 130, + width: 70, + search: false, + rules: [ + { required: true, message: "请选择断网类型", trigger: "change" }, + ], + }, + { + label: "实名状态", + prop: "realNameStats", + type: "select", + dicUrl: "/api/iot-system/dict/dictionary?code=real_nameStats", + props: { + label: "dictValue", + value: "dictKey", + }, + dataType: "number", + span: 12, + labelWidth: 130, + width: 70, + search: false, + rules: [ + { required: true, message: "请选择实名状态", trigger: "change" }, + ], + }, + { + label: "达量断网阙值(M)", + prop: "offNetThreshold", + span: 12, + labelWidth: 130, + searchLabelWidth: 124, + search: false, + width:120, + rules: [ + { + required: true, + message: "请输入达量断网阙值", + trigger: "blur", + }, + { + pattern: /^\d+(\.\d+)?$/, + message: "请输入正确的阙值", + trigger: "blur", + }, + ], + }, { label: "批次号", prop: "batchNum", @@ -261,7 +372,7 @@ export default { hide: true, rules: [ { required: true, message: "请输入剩余流量", trigger: "blur" }, - { + { pattern: /^\d+(\.\d+)?$/, message: "请输入正确的剩余流量", trigger: "blur", @@ -277,7 +388,7 @@ export default { hide: true, rules: [ { required: true, message: "请输入使用量", trigger: "blur" }, - { + { pattern: /^\d+(\.\d+)?$/, message: "请输入正确的使用量", trigger: "blur", @@ -291,8 +402,9 @@ export default { labelWidth: 130, type: "number", hide: true, - rules: [{ required: true, message: "请输入总量", trigger: "blur" }, - { + rules: [ + { required: true, message: "请输入总量", trigger: "blur" }, + { pattern: /^\d+(\.\d+)?$/, message: "请输入正确的总量", trigger: "blur", @@ -316,6 +428,20 @@ export default { } } }, + "form.$offNetStatus"() { + const columns = this.findObject(this.option.column, "offNetType"); + if (this.form.$offNetStatus != undefined) { + if (this.form.$offNetStatus == "未断网") { + columns.display = false; + this.form.offNetType = ""; + } else { + columns.display = true; + } + } + }, + }, + created() { + console.log(this.baseUrl, "baseUrl"); }, computed: { ...mapGetters(["permission"]), @@ -410,19 +536,11 @@ export default { }, //导出 handleExport() { - if (process.env.NODE_ENV === "production") { - window.open( - `http://223.99.228.240:18081/iot-sim/simcarddeliver/export-simCardDeliver?${ - this.website.tokenHeader - }=${getToken()}` - ); - } else { - window.open( - `/api/iot-sim/simcarddeliver/export-simCardDeliver?${ - this.website.tokenHeader - }=${getToken()}` - ); - } + window.open( + `${this.baseUrl}/${this.apis}iot-sim/simcarddeliver/export-simCardDeliver?${ + this.website.tokenHeader + }=${getToken()}` + ); }, onLoad(page, params = {}) { this.loading = true; diff --git a/src/views/util/test.vue b/src/views/util/test.vue index cc13e84..3d1b320 100644 --- a/src/views/util/test.vue +++ b/src/views/util/test.vue @@ -18,15 +18,28 @@ @refresh-change="refreshChange" @on-load="onLoad" > + <!-- 自定义顶部按钮 --> + <template slot-scope="scope" slot="menuLeft"> + <el-button type="danger" icon="el-icon-plus" size="small" @click="next" + >下一页</el-button + > + </template> + <!-- 操作栏是否显示 --> <template slot-scope="scope" slot="menuBtn"> <el-dropdown-item> <span class="el-icon-edit">文字按钮</span> </el-dropdown-item> <el-dropdown-item> - <span class="el-icon-edit">文字按钮</span> - </el-dropdown-item> - <el-dropdown-item> - <span class="el-icon-edit">文字按钮</span> + <el-popconfirm + confirm-button-text="好的" + cancel-button-text="不用了" + icon="el-icon-info" + icon-color="red" + title="这是一段内容确定删除吗?" + placement="top-start" + > + <div slot="reference">删除</div> + </el-popconfirm> </el-dropdown-item> </template> </avue-crud> @@ -40,6 +53,7 @@ import { mapGetters } from "vuex"; export default { data() { return { + visible: false, form: {}, query: {}, // loading: true, @@ -234,6 +248,11 @@ export default { // }, }, methods: { + //popper确定 + handleSure() { + this.visible = false; + this.$message.success("确定"); + }, beforeOpen(done, type) { if (["edit", "view"].includes(type)) { getDetail(this.form.id).then((res) => { diff --git a/vue.config.js b/vue.config.js index d4f9a78..48943ea 100644 --- a/vue.config.js +++ b/vue.config.js @@ -25,13 +25,14 @@ module.exports = { //开发模式反向代理配置,生产模式请使用Nginx部署并配置反向代理 devServer: { port: 1888, + open: true, proxy: { '/api': { //本地服务接口地址 // target: 'http://192.168.1.106:8081', // 民 // target: 'http://192.168.1.253:8081',//测试环境 - target: 'http://192.168.1.120:9081',//吴 - // target: 'http://223.99.228.240:18081', // 生产环境 + target: 'http://192.168.1.120:9081', //吴 + // target: 'http://223.99.228.240:18081', // 生产环境 ws: true, pathRewrite: { '^/api': '/'