index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <script setup>
  2. import { callApi } from '@/api/voice/call';
  3. import SearchItemWrapper from '@/components/SearchItemWrapper';
  4. import useTableHeight from '@/composables/useTableHeight';
  5. const { proxy } = getCurrentInstance();
  6. const { tableContainer, tableMaxHeight } = useTableHeight();
  7. const dataPickerValue = ref([]);
  8. const loading = ref(false);
  9. const tableData = ref([]);
  10. const total = ref(0);
  11. const queryParams = ref({
  12. pageNum: 1,
  13. pageSize: 10
  14. })
  15. const tableListData = computed(() => {
  16. const { pageNum, pageSize } = queryParams.value;
  17. return tableData.value.slice((pageNum-1)*pageSize,pageNum * pageSize) || []
  18. })
  19. // 清除检索条件
  20. const handleCleanOptions = () => {
  21. queryParams.value = {
  22. pageNum: 1,
  23. pageSize: 10
  24. };
  25. total.value = 0;
  26. dataPickerValue.value = [];
  27. tableData.value = [];
  28. }
  29. const handleSearch = () => {
  30. if (dataPickerValue.value.length === 0) {
  31. return proxy.$modal.msgWarning("请先选择统计日期");
  32. }
  33. getList();
  34. }
  35. const getList = () => {
  36. const [timeBegin, timeEnd] = dataPickerValue.value || [];
  37. loading.value = true;
  38. callApi.getCallRecordCountPageList({...queryParams.value, timeBeginReq:timeBegin, timeEndReq: timeEnd}).then(({ rows, total:t }) => {
  39. tableData.value = rows.map(item => ({
  40. ...item,
  41. }));
  42. loading.value = false;
  43. total.value = t;
  44. })
  45. };
  46. onMounted(() => {})
  47. </script>
  48. <template>
  49. <div class="call-viewprot">
  50. <div class="search-card">
  51. <div class="grid grid-cols-4 gap-[24px]">
  52. <SearchItemWrapper label="统计日期">
  53. <el-date-picker v-model="dataPickerValue" type="daterange" range-separator="-" start-placeholder="起始日期"
  54. end-placeholder="结束日期" style="width: 100%;" :editable="false" value-format="YYYY-MM-DD"/>
  55. </SearchItemWrapper>
  56. <div class="flex items-center justify-start space-x-[20px]">
  57. <div class="custom-btn custom-btn_primary" @click="handleSearch">搜索</div>
  58. <div class="custom-btn custom-btn_default" @click="handleCleanOptions">重置</div>
  59. </div>
  60. </div>
  61. </div>
  62. <div class="table-card">
  63. <div style="height: 100%;" ref="tableContainer">
  64. <el-table :data="tableListData" style="width: 100%" :max-height="tableMaxHeight" v-loading="loading">
  65. <el-table-column prop="date" label="统计日期" align="center" width="130" fixed />
  66. <el-table-column prop="inTotal" label="呼入总量" align="center" min-width="120" />
  67. <el-table-column prop="successTotal" label="接通量" align="center" min-width="120" />
  68. <el-table-column prop="aiTotal" label="AI处理量" align="center" min-width="120" />
  69. <el-table-column prop="aiToHuman" label="AI转人工处理" align="center" min-width="120" />
  70. <el-table-column prop="humanAndTransferTotal" label="AI人工处理量(含转人工)" align="center" min-width="120">
  71. <template #header>
  72. <span>AI人工处理量<br>(含转人工)</span>
  73. </template>
  74. <template #default="scope">
  75. <span>{{ scope.row.humanAndTransferTotal }}</span>
  76. </template>
  77. </el-table-column>
  78. <el-table-column prop="aiRate" label="AI处理率" align="center" min-width="120">
  79. <template #default="scope">
  80. {{ scope.row.aiRate }}%
  81. </template>
  82. </el-table-column>
  83. <el-table-column prop="successRate" label="接通率" align="center" min-width="120">
  84. <template #default="scope">
  85. {{ scope.row.successRate }}%
  86. </template>
  87. </el-table-column>
  88. <!-- <el-table-column prop="failTotal" label="未接通总量" align="center" min-width="120" />
  89. <el-table-column prop="robotHearTotal" label="机器人接听" align="center" min-width="120" />
  90. <el-table-column prop="transferTotal" label="机器人转人工" align="center" min-width="120" />
  91. <el-table-column prop="humanTotal" label="人工接听" align="center" min-width="120" />
  92. <el-table-column prop="robotHandleTotal" label="机器人处理量" align="center" min-width="120" />
  93. <el-table-column prop="humanHandleTotal" label="人工处理量" align="center" min-width="120"/>
  94. <el-table-column prop="robotRate" label="机器人处理率" align="center" min-width="120">
  95. <template #default="scope">
  96. {{ scope.row.robotRate }}%
  97. </template>
  98. </el-table-column>
  99. <el-table-column prop="humanRate" label="人工处理率" align="center" min-width="">
  100. <template #default="scope">
  101. {{ scope.row.humanRate }}%
  102. </template>
  103. </el-table-column>
  104. <el-table-column prop="failRate" label="未接通率" align="center" width="140">
  105. <template #default="scope">
  106. {{ scope.row.failRate }}%
  107. </template>
  108. </el-table-column>
  109. <el-table-column prop="handle" label="操作" align="center" fixed="right" width="150">
  110. <template #default="scope">
  111. <div class="flex justify-center space-x-[20px]">
  112. <span class="text-[#165DFF] cursor-pointer" @click="jumpDetails(scope.row)">详情</span>
  113. <span class="text-[#165DFF] cursor-pointer" @click="handleDownload(scope.row)">语音下载</span>
  114. </div>
  115. </template>
  116. </el-table-column> -->
  117. </el-table>
  118. <pagination v-show="total >= 0" :total="total" v-model:page="queryParams.pageNum"
  119. v-model:limit="queryParams.pageSize" />
  120. </div>
  121. </div>
  122. </div>
  123. </template>
  124. <style lang="scss" scoped>
  125. .call-viewprot {
  126. display: flex;
  127. flex-flow: column;
  128. width: 100%;
  129. height: 100%;
  130. padding: 28px 24px 18px 24px;
  131. border-radius: 8px;
  132. background: #fff;
  133. .custom-btn {
  134. word-break: keep-all;
  135. }
  136. .search-card {
  137. padding-bottom: 20px;
  138. margin-bottom: 20px;
  139. border-bottom: 1px dashed #E5E6EB;
  140. overflow: hidden;
  141. flex-shrink: 0;
  142. }
  143. .table-card {
  144. height: 100%;
  145. }
  146. }
  147. </style>
  148. <style lang="scss">
  149. .voice-drawer {
  150. .el-drawer__header {
  151. margin-bottom: 0;
  152. color: #333;
  153. font-weight: bold;
  154. }
  155. }
  156. </style>