|
@@ -6,7 +6,8 @@
|
|
|
<el-card shadow="hover" :style="{ marginTop: '10px', height: '60px' }">
|
|
<el-card shadow="hover" :style="{ marginTop: '10px', height: '60px' }">
|
|
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="70px">
|
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="70px">
|
|
|
<el-form-item label="设备名称" prop="deviceName">
|
|
<el-form-item label="设备名称" prop="deviceName">
|
|
|
- <el-input v-model="queryParams.deviceName" placeholder="请输入设备名称" clearable @keyup.enter="handleQuery"/>
|
|
|
|
|
|
|
+ <el-input v-model="queryParams.deviceName" placeholder="请输入设备名称" clearable
|
|
|
|
|
+ @keyup.enter="handleQuery"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
@@ -28,10 +29,15 @@
|
|
|
<el-table-column label="总对话" align="center" prop="totalNum" width="120"/>
|
|
<el-table-column label="总对话" align="center" prop="totalNum" width="120"/>
|
|
|
<el-table-column label="今日对话" align="center" prop="todayNum" width="120"/>
|
|
<el-table-column label="今日对话" align="center" prop="todayNum" width="120"/>
|
|
|
<el-table-column label="昨日对话" align="center" prop="yesterdayNum" width="120"/>
|
|
<el-table-column label="昨日对话" align="center" prop="yesterdayNum" width="120"/>
|
|
|
|
|
+ <el-table-column label="上周对话" align="center" prop="lastWeekNum" width="120"/>
|
|
|
<el-table-column label="本周对话" align="center" prop="weekNum" width="120"/>
|
|
<el-table-column label="本周对话" align="center" prop="weekNum" width="120"/>
|
|
|
<el-table-column label="本月对话" align="center" prop="monthNum" width="120"/>
|
|
<el-table-column label="本月对话" align="center" prop="monthNum" width="120"/>
|
|
|
<el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width">
|
|
<el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
|
|
+ <el-tooltip content="本月记录" placement="top">
|
|
|
|
|
+ <el-button link type="primary" icon="View" @click="handleMonthInfo(scope.row)"
|
|
|
|
|
+ v-hasPermi="['device:chatRecord:query']"></el-button>
|
|
|
|
|
+ </el-tooltip>
|
|
|
<el-tooltip content="问答列表" placement="top">
|
|
<el-tooltip content="问答列表" placement="top">
|
|
|
<el-button link type="primary" icon="Position" @click="handleInfo(scope.row)"
|
|
<el-button link type="primary" icon="Position" @click="handleInfo(scope.row)"
|
|
|
v-hasPermi="['device:chatRecord:query']"></el-button>
|
|
v-hasPermi="['device:chatRecord:query']"></el-button>
|
|
@@ -44,12 +50,28 @@
|
|
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
|
|
v-model:limit="queryParams.pageSize" @pagination="getList"/>
|
|
v-model:limit="queryParams.pageSize" @pagination="getList"/>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
|
|
+
|
|
|
|
|
+ <el-dialog :title="dialog.title" v-model="dialog.visible" append-to-body>
|
|
|
|
|
+ <div ref="chartRef" style="width: 100%; height: 400px;"></div>
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <div class="dialog-footer">
|
|
|
|
|
+ <el-button @click="cancel">关 闭</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup name="ChatRecord" lang="ts">
|
|
<script setup name="ChatRecord" lang="ts">
|
|
|
-import {listChatRecordCount,} from '@/api/smsb/device/device_chat_record';
|
|
|
|
|
-import {ChatRecordForm, ChatRecordQuery, ChatRecordVO} from '@/api/smsb/device/device_chat_record_type';
|
|
|
|
|
|
|
+import {getChatRecord, getChatRecordMonthInfo, listChatRecordCount,} from '@/api/smsb/device/device_chat_record';
|
|
|
|
|
+import {
|
|
|
|
|
+ ChatMonthRecordVO,
|
|
|
|
|
+ ChatRecordForm,
|
|
|
|
|
+ ChatRecordQuery,
|
|
|
|
|
+ ChatRecordVO
|
|
|
|
|
+} from '@/api/smsb/device/device_chat_record_type';
|
|
|
|
|
+import * as echarts from 'echarts';
|
|
|
|
|
+import {ref} from "vue";
|
|
|
|
|
|
|
|
const {proxy} = getCurrentInstance() as ComponentInternalInstance;
|
|
const {proxy} = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
|
|
@@ -61,6 +83,7 @@ const ids = ref<Array<string | number>>([]);
|
|
|
const single = ref(true);
|
|
const single = ref(true);
|
|
|
const multiple = ref(true);
|
|
const multiple = ref(true);
|
|
|
const total = ref(0);
|
|
const total = ref(0);
|
|
|
|
|
+const chartRef = ref();
|
|
|
|
|
|
|
|
const queryFormRef = ref<ElFormInstance>();
|
|
const queryFormRef = ref<ElFormInstance>();
|
|
|
const chatRecordFormRef = ref<ElFormInstance>();
|
|
const chatRecordFormRef = ref<ElFormInstance>();
|
|
@@ -103,6 +126,34 @@ const getList = async () => {
|
|
|
total.value = res.total;
|
|
total.value = res.total;
|
|
|
loading.value = false;
|
|
loading.value = false;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+const handleMonthInfo = async (row?: ChatRecordVO) => {
|
|
|
|
|
+ const res = await getChatRecordMonthInfo(row.deviceId);
|
|
|
|
|
+ dialog.title = '本月问答记录';
|
|
|
|
|
+ dialog.visible = true;
|
|
|
|
|
+ // 使用 nextTick 确保 DOM 更新后再初始化图表
|
|
|
|
|
+ await nextTick();
|
|
|
|
|
+ const chart = echarts.init(chartRef.value, 'macaroons');
|
|
|
|
|
+ chart.setOption({
|
|
|
|
|
+ tooltip: {
|
|
|
|
|
+ trigger: 'axis',
|
|
|
|
|
+ },
|
|
|
|
|
+ xAxis: {
|
|
|
|
|
+ type: 'category',
|
|
|
|
|
+ data: res.data.dates,
|
|
|
|
|
+ },
|
|
|
|
|
+ yAxis: {
|
|
|
|
|
+ type: 'value',
|
|
|
|
|
+ },
|
|
|
|
|
+ series: [{
|
|
|
|
|
+ name: '问答次数',
|
|
|
|
|
+ type: 'line',
|
|
|
|
|
+ data: res.data.counts,
|
|
|
|
|
+ smooth: true,
|
|
|
|
|
+ }],
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const handleInfo = async (row?: ChatRecordVO) => {
|
|
const handleInfo = async (row?: ChatRecordVO) => {
|
|
|
const deviceName = row.deviceName;
|
|
const deviceName = row.deviceName;
|
|
|
// 跳转页面 /source/push/review?id=1898991996092481537&type=approval&taskId=1898992031169445891
|
|
// 跳转页面 /source/push/review?id=1898991996092481537&type=approval&taskId=1898992031169445891
|