index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <!-- 流量池 -->
  2. <template>
  3. <div class="container">
  4. <div class="head-title">
  5. <span>{{ route.meta.title }} </span>
  6. <span class="head-title-right">
  7. </span>
  8. </div>
  9. <!-- 搜索条件区 -->
  10. <div class="search-section">
  11. <a-form :model="searchForm" ref="formRef" layout="inline">
  12. <a-form-item field="label" :label="$t('flowPool.label')">
  13. <a-input v-model="searchForm.label" :placeholder="$t('lotCard.please') + $t('flowPool.label')"
  14. allow-clear />
  15. </a-form-item>
  16. <a-form-item field="traffic_pool_type" :label="$t('flowPool.trafficPoolType')">
  17. <a-select v-model="searchForm.traffic_pool_type" style="width: 200px;"
  18. :placeholder="$t('form.cardForm.pleaseSelect') + $t('flowPool.trafficPoolType')">
  19. <a-option v-for=" item in typeList" :key="item.id" :value="item.value">{{ item.label
  20. }}</a-option>
  21. </a-select>
  22. </a-form-item>
  23. <a-form-item>
  24. <a-space>
  25. <a-button type="primary" @click="handleSearch">{{ $t('form.Search') }}</a-button>
  26. <a-button @click="resetSearch">{{ $t('form.Reset') }}</a-button>
  27. </a-space>
  28. </a-form-item>
  29. </a-form>
  30. </div>
  31. <a-table row-key="id" :data="dataSource" :columns="columns" :pagination="pagination" :scroll="{ x: 'auto' }"
  32. @page-change="evChangePage">
  33. <template #id="{ record }">
  34. </template>
  35. </a-table>
  36. </div>
  37. </template>
  38. <script setup>
  39. import { onMounted, ref, reactive, getCurrentInstance, nextTick } from "vue";
  40. import { useRoute } from "vue-router";
  41. import { columns } from "./config";
  42. import { Message, Notification } from '@arco-design/web-vue'
  43. import { deleteTrafficPool, addTrafficPool, updateTrafficPool, trafficPoolList } from "@/api/path/flowPool.api"
  44. import { tariffList } from "@/api/path/tariffManagement.api"
  45. import { orderCancel } from "@/api/path/lotCard.api"
  46. import { enum_dict } from "@/hooks/enum";
  47. import { useSystemStore } from "@/store/modules/systemStore"
  48. const systemStore = useSystemStore()
  49. const role = ref(systemStore.getRole)
  50. const { proxy } = getCurrentInstance()
  51. const formRef = ref()
  52. const searchForm = ref({
  53. "label": "",
  54. "traffic_pool_type": ""
  55. });
  56. const typeList = ref([]);
  57. const trafficList = ref([]);
  58. const sourceList = ref([]);
  59. const dataSource = ref([]);
  60. const route = useRoute();
  61. const pagination = ref({
  62. total: 0,
  63. pageSize: 10,
  64. current: 1,
  65. })
  66. const rowSelection = reactive({
  67. type: 'checkbox',
  68. showCheckedAll: true,
  69. onlyCurrent: false,
  70. });
  71. const selectedKeys = ref([])
  72. const intData = async () => {
  73. const param = {
  74. current: pagination.value.current,
  75. size: pagination.value.pageSize,
  76. ...searchForm.value,
  77. }
  78. const { data } = await trafficPoolList(param)
  79. dataSource.value = (data.records || []).map((item, index) => {
  80. const trafficPoolType = typeList.value.find(val => val.value == item.traffic_pool_type)?.label
  81. const trafficPoolStatus = trafficList.value.find(val => val.value == item.status)?.label
  82. const sourceName = sourceList.value.find(val => val.value == item.source)?.label
  83. console.log(item, "item-------------------------");
  84. return {
  85. ...item,
  86. sourceName,// 运营商名称
  87. trafficPoolType,
  88. trafficPoolStatus,
  89. poolNumber: "NR0" + (index + 1),
  90. cardRariffName: "监控1G月租",
  91. cardFlow: "1G/月",
  92. cardNum: "11/100",
  93. UsedMonth: "1.00G",
  94. surplusFlow: "99.0G",
  95. totalFlow: "100.0G",
  96. exceededFlow: "--",
  97. }
  98. })
  99. pagination.value.total = data.total
  100. }
  101. const evChangePage = (page) => {
  102. pagination.value.current = page
  103. intData()
  104. }
  105. const handleSearch = () => {
  106. intData()
  107. }
  108. const resetSearch = () => {
  109. searchForm.value.label = ''
  110. intData()
  111. }
  112. // --------------------------------------------------------
  113. // 获取字典
  114. const handleDictValue = () => {
  115. const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
  116. sourceList.value = dictList.filter((item) => item.typeKey == enum_dict.SOURCE)
  117. trafficList.value = dictList.filter((item) => item.typeKey == enum_dict.TRAFFIC_PACKET_STATUS)
  118. typeList.value = dictList.filter((item) => item.typeKey == enum_dict.TRAFFIC_POOL_TYPE)
  119. }
  120. onMounted(() => {
  121. handleDictValue()
  122. intData()
  123. })
  124. </script>
  125. <style scoped lang="less">
  126. .m-r-10 {
  127. margin-right: 10px;
  128. }
  129. .head-title-right {}
  130. .search-section {
  131. margin-top: 20px;
  132. margin-bottom: 20px;
  133. }
  134. .container {
  135. .head-title {
  136. display: flex;
  137. justify-content: space-between;
  138. }
  139. .form-row {
  140. display: flex;
  141. .form-row-col {
  142. width: 25%;
  143. display: flex;
  144. align-items: center;
  145. .form-row-label {
  146. width: 120px;
  147. text-align: right;
  148. }
  149. }
  150. }
  151. }
  152. silent-expire-alarm {
  153. padding: 20px !important;
  154. // background: #fcf;
  155. }
  156. .search-section {
  157. margin-bottom: 20px;
  158. }
  159. .audit-btn {
  160. margin-bottom: 10px;
  161. }
  162. .echarts-box {
  163. // width: 100%;
  164. display: flex;
  165. justify-content: center;
  166. overflow: hidden;
  167. .chart-dom {
  168. width: 700px !important;
  169. height: 400px !important;
  170. }
  171. }
  172. .form-item-space-item {
  173. background-color: #f2f3f5;
  174. display: flex;
  175. align-items: center;
  176. font-size: 14px;
  177. }
  178. .form-pool-tit {
  179. display: flex;
  180. align-items: center;
  181. margin-bottom: 10px;
  182. .pool-icon {
  183. margin-right: 10px;
  184. width: 4px;
  185. height: 16px;
  186. background: #1B5DF8;
  187. font-size: 14px;
  188. color: #6C6E70;
  189. font-family: PingFang SC;
  190. }
  191. }
  192. .export-box {
  193. .export-box-item {
  194. .box-item-title {
  195. display: flex;
  196. align-items: center;
  197. font-family: PingFang SC;
  198. font-size: 16px;
  199. font-weight: 600;
  200. line-height: 24px;
  201. color: rgba(0, 0, 0, 0.85);
  202. margin-bottom: 10px;
  203. .title-icon {
  204. margin-right: 10px;
  205. width: 4px;
  206. height: 16px;
  207. background: #1B5DF8;
  208. }
  209. }
  210. .box-item-content {
  211. .item-txt {
  212. display: flex;
  213. align-items: center;
  214. margin-bottom: 10px;
  215. .item-txt-title {
  216. width: 300px;
  217. text-align: right;
  218. margin-right: 10px;
  219. }
  220. .item-txt-text {
  221. font-family: PingFang SC;
  222. font-size: 14px;
  223. font-weight: 400;
  224. line-height: 22px;
  225. text-align: left;
  226. color: #1B5DF8;
  227. }
  228. }
  229. .export-status {
  230. font-family: PingFang SC;
  231. font-size: 14px;
  232. font-weight: 400;
  233. line-height: 22px;
  234. text-align: left;
  235. color: rgba(51, 51, 51, 1);
  236. display: flex;
  237. align-items: center;
  238. .status-icon {
  239. width: 6px;
  240. height: 6px;
  241. border-radius: 50%;
  242. margin-right: 10px;
  243. }
  244. }
  245. }
  246. }
  247. }
  248. </style>