|
@@ -136,18 +136,19 @@
|
|
|
|
|
|
<template #footer>
|
|
|
<div class="footer_button">
|
|
|
- <a-button type="primary" status="warning">同步卡信息 V</a-button>
|
|
|
- <a-button type="primary" status="warning">停复机 V</a-button>
|
|
|
- <a-button type="primary" status="warning">断复机 V</a-button>
|
|
|
- <a-button type="primary" status="warning">校准用量</a-button>
|
|
|
+ <!-- <a-button type="primary" status="warning">同步卡信息 V</a-button> -->
|
|
|
+ <a-button type="primary" status="warning" @click="SIMCardService(0)">暂停SIM卡服务</a-button>
|
|
|
+ <a-button type="primary" status="warning" @click="SIMCardService(1)">恢复SIM卡服务</a-button>
|
|
|
+ <a-button type="primary" status="warning">关闭SIM卡</a-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</a-modal>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
import { onMounted, ref, nextTick } from "vue";
|
|
|
-import { getDataCDR, getDataCDRDate } from '@/api/path/lotCard.api'
|
|
|
+import { getDataCDR, PauseSIMService, RecoverSIMService, OffSIMCard } from '@/api/path/lotCard.api'
|
|
|
import { Getdictionary } from '@/mixins/index'
|
|
|
+import { Message } from '@arco-design/web-vue'
|
|
|
// 图表插件
|
|
|
import * as echarts from "echarts";
|
|
|
const props = defineProps({
|
|
@@ -158,12 +159,6 @@ const visible = ref(false)
|
|
|
const Card_info = ref({})
|
|
|
const dataPackage = ref()
|
|
|
const dataSource = ref([]);
|
|
|
-const pagination = ref({
|
|
|
- total: 0,
|
|
|
- pageSize: 10,
|
|
|
- current: 1,
|
|
|
-})
|
|
|
-
|
|
|
const chartContainer = ref(null)
|
|
|
const chart = ref(null)
|
|
|
// 图表插件
|
|
@@ -327,8 +322,6 @@ const open = (data) => {
|
|
|
|
|
|
// 使用量
|
|
|
const intData = async () => {
|
|
|
- let sourceName = await Getdictionary('source');
|
|
|
-
|
|
|
// 获取今天的日期
|
|
|
const today = new Date();
|
|
|
const toDay = today.toISOString().split('T')[0];
|
|
@@ -341,17 +334,13 @@ const intData = async () => {
|
|
|
// 获取 CDR 数据
|
|
|
let res = await getDataCDR({
|
|
|
iccid: Card_info.value.iccid,
|
|
|
- source: sourceName.find(val => val.label == Card_info.value.source)?.value,
|
|
|
+ source: Card_info.value.source,
|
|
|
startDate: formattedDate,
|
|
|
endDate: toDay
|
|
|
});
|
|
|
|
|
|
- option.value.series[0].data = (res.data || [])
|
|
|
- .filter(val => val.usage !== undefined)
|
|
|
- .map(val => val.usage);
|
|
|
+ dataAmount.value = res.data
|
|
|
|
|
|
- // 打印合并后的数据
|
|
|
- console.log(option.value.series[0].data);
|
|
|
|
|
|
// 定义季度时间段
|
|
|
const time = ['1-3', '4-6', '7-9', '9-12'];
|
|
@@ -367,27 +356,36 @@ const intData = async () => {
|
|
|
// 获取每个时间段的数据
|
|
|
let res = await getDataCDR({
|
|
|
iccid: Card_info.value.iccid,
|
|
|
- source: sourceName.find(val => val.label == Card_info.value.source)?.value,
|
|
|
+ source: Card_info.value.source,
|
|
|
startDate: startDate,
|
|
|
endDate: endDate
|
|
|
});
|
|
|
|
|
|
// 将当前时间段的数据中的 'usage' 字段合并到 series[0].data 数组中
|
|
|
const usageData = (res.data || [])
|
|
|
- .filter(val => val.usage !== undefined)
|
|
|
- .map(val => val.usage);
|
|
|
- option.value.series[0].data.push(...usageData);
|
|
|
+ .filter(val => val.usage !== undefined)
|
|
|
+ .map(val => val.usage);
|
|
|
+ option.value.series[0].data.push(...usageData);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-const evChangePage = (page) => {
|
|
|
- pagination.value.current = page
|
|
|
+// SIM卡操作
|
|
|
+const SIMCardService = async (index) => {
|
|
|
+ const Inform = {
|
|
|
+ iccid: Card_info.value.iccid, source: Card_info.value.source
|
|
|
+ }
|
|
|
+ // 暂停SIM卡
|
|
|
+ let res = index == 0 ? await PauseSIMService(Inform) : (index == 1 ? await RecoverSIMService(Inform) : '')
|
|
|
+ if (res.code === 200) {
|
|
|
+ Message.success({
|
|
|
+ content: res.message,
|
|
|
+ duration: 2000,
|
|
|
+ })
|
|
|
+ handleSubmit()
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
const handleSubmit = () => {
|
|
|
- emit('submit', { ...formData });
|
|
|
+ emit('submit', true);
|
|
|
visible.value = false
|
|
|
};
|
|
|
|