Browse Source

feat:新增流量历史

confidence
杜贤金 3 years ago
parent
commit
9c3e546967
  1. 14
      src/api/communication/outbound.js
  2. 13
      src/api/informationmanage/carduse.js
  3. 94
      src/views/communicationmanage/outbound/outbound.vue
  4. 213
      src/views/informationmanage/carduse/index.vue

14
src/api/communication/outbound.js

@ -74,7 +74,7 @@ export const syncRealNameStatus = (id) => {
return request({
url: '/api/iot-sim/sim/syncRealNameStatus',
method: 'get',
params:{
params: {
id
}
})
@ -85,7 +85,17 @@ export const updateSimStatus = (row) => {
return request({
url: '/api/iot-sim/sim/updateSimStatus',
method: 'post',
params:{
params: {
...row
}
})
}
//设置阈值
export const updateThreshold = (row) => {
return request({
url: '/api/iot-sim/sim/updateThreshold',
method: 'post',
params: {
...row
}
})

13
src/api/informationmanage/carduse.js

@ -0,0 +1,13 @@
import request from '@/router/axios';
//列表
export const getList = (current, size, params) => {
return request({
url: '/api/iot-sim/flowhis/page',
method: 'get',
params: {
...params,
current,
size,
}
})
}

94
src/views/communicationmanage/outbound/outbound.vue

@ -93,6 +93,13 @@
</div>
</el-popconfirm>
</el-dropdown-item>
<el-dropdown-item>
<div class="el-icon-setting" @click="handleNetThreshold(scope.row)">
&nbsp;{{
scope.row.offNetThreshold == null ? "设置阈值" : "修改阈值"
}}
</div>
</el-dropdown-item>
</template>
</avue-crud>
@ -173,6 +180,39 @@
>
</span>
</el-dialog>
<!-- 阈值 -->
<el-dialog
:title="offTitle"
v-dialogDrag
:visible.sync="offShow"
class="avue-dialog avue-dialog--top"
append-to-body
:close-on-click-modal="false"
:before-close="handleOffClose"
width="30%"
>
<el-form
:model="ruleForm"
:rules="netRules"
ref="ruleForm"
class="demo-ruleForm"
style="width: 90%"
>
<el-form-item label="阈值(M)" prop="offNetThreshold" label-width="80px">
<el-input
v-model="ruleForm.offNetThreshold"
placeholder="请输入阈值(M)"
size="mini"
></el-input>
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="primary" @click="submitOff" size="small"
>保存</el-button
>
<el-button @click="handleOffClose" size="small">取消</el-button>
</div>
</el-dialog>
</basic-container>
</template>
@ -188,6 +228,7 @@ import {
exporttype,
syncRealNameStatus,
updateSimStatus,
updateThreshold,
} from "@/api/communication/outbound";
import { syncUsage } from "@/api/informationmanage/sim.js";
import { mapGetters } from "vuex";
@ -229,7 +270,18 @@ export default {
selectionList: [],
tenantlist: [], //
userlist: [], //
//
offShow: false,
offTitle: "",
ruleForm: {
offNetThreshold: "",
},
offId: "",
netRules: {
offNetThreshold: [
{ required: true, message: "请输入阈值", trigger: "blur" },
],
},
//
distribution: {
tenantId: "", //id
@ -518,6 +570,8 @@ export default {
labelWidth: 130,
searchLabelWidth: 124,
search: false,
addDisplay: false,
editDisplay: false,
width: 120,
rules: [
{
@ -921,6 +975,44 @@ export default {
}
});
},
//
handleNetThreshold(row) {
this.offShow = true;
this.offId = row.id;
if (row.offNetThreshold == null) {
this.offTitle = "设置阈值";
} else {
this.offTitle = "修改阈值";
this.ruleForm.offNetThreshold = row.offNetThreshold;
}
},
//
submitOff() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
updateThreshold({
id: this.offId,
offNetThreshold: this.ruleForm.offNetThreshold,
}).then((res) => {
if (res.data.code == 200) {
this.$message.success("保存成功!");
this.offShow = false;
this.$refs.ruleForm.resetFields();
this.onLoad(this.page);
} else {
this.$message.success("保存失败!");
this.offShow = false;
this.$refs.ruleForm.resetFields();
}
});
}
});
},
//
handleOffClose() {
this.offShow = false;
this.$refs.ruleForm.resetFields();
},
onLoad(page, params = {}) {
this.loading = true;
getList(

213
src/views/informationmanage/carduse/index.vue

@ -0,0 +1,213 @@
<template>
<basic-container>
<avue-crud
:option="option"
:table-loading="loading"
:data="data"
:page.sync="page"
:permission="permissionList"
:before-open="beforeOpen"
v-model="form"
ref="crud"
@row-update="rowUpdate"
@row-save="rowSave"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
>
</avue-crud>
</basic-container>
</template>
<script>
import { getList } from "@/api/informationmanage/carduse";
import { mapGetters } from "vuex";
export default {
data() {
return {
form: {},
query: {
type: 2,
},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
option: {
tip: false,
searchShow: true,
searchMenuSpan: 6,
border: true,
index: true,
viewBtn: false,
addBtn: false,
menu: false,
selection: false,
dialogClickModal: false,
dialogWidth: "45%",
column: [
{
label: "用量(M)",
prop: "usageM",
width: 200,
},
{
label: "ICCID",
prop: "iccid",
search: true,
},
{
label: "MSISDN",
prop: "msisdn",
search: true,
},
{
label: "时间",
prop: "time",
},
{
label: "时间",
prop: "type",
type: "select",
search: true,
hide: true,
// searchClearable: false,
searchValue: 2,
dicData: [
{
label: "昨日",
value: 1,
},
{
label: "本周",
value: 2,
},
{
label: "上周",
value: 3,
},
{
label: "本月",
value: 4,
},
],
},
],
},
data: [],
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
// addBtn: this.vaildData(this.permission.product_topic_add, false),
// viewBtn: this.vaildData(this.permission.product_topic_view, false),
// delBtn: this.vaildData(this.permission.product_topic_delete, false),
// editBtn: this.vaildData(this.permission.product_topic_edit, false),
};
},
},
methods: {
rowSave(row, done, loading) {
add(row).then(
() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!",
});
done();
},
(error) => {
loading();
window.console.log(error);
}
);
},
rowUpdate(row, index, done, loading) {
update(row).then(
() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!",
});
done();
},
(error) => {
loading();
console.log(error);
}
);
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!",
});
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getDetail(this.form.id).then((res) => {
this.form = res.data.data;
});
}
done();
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = true;
getList(
page.currentPage,
page.pageSize,
Object.assign(params, this.query)
).then((res) => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
});
},
},
};
</script>
<style></style>
Loading…
Cancel
Save