|
@@ -17,6 +17,16 @@
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="warning"
|
|
|
|
|
+ plain
|
|
|
|
|
+ icon="el-icon-download"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ :loading="exportLoading"
|
|
|
|
|
+ @click="handleExport"
|
|
|
|
|
+ >导出</el-button>
|
|
|
|
|
+ </el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
|
@@ -41,7 +51,7 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import { listFastgptEventLogTotal, exportFastgptEventLogTotal, getFastGptRoleAppKeyList} from "@/api/fastGpt/fastgptEventLogTotal";
|
|
import { listFastgptEventLogTotal, exportFastgptEventLogTotal, getFastGptRoleAppKeyList} from "@/api/fastGpt/fastgptEventLogTotal";
|
|
|
-import { getFastGptPushTokenTotal} from "@/api/fastGpt/fastgptPushTokenTotal";
|
|
|
|
|
|
|
+import { getFastGptPushTokenTotal, exportTokenTotal} from "@/api/fastGpt/fastgptPushTokenTotal";
|
|
|
import SelectTree from "@/components/TreeSelect/index.vue";
|
|
import SelectTree from "@/components/TreeSelect/index.vue";
|
|
|
import {getDeptData} from "@/api/system/employeeStats";
|
|
import {getDeptData} from "@/api/system/employeeStats";
|
|
|
import TreeSelect from '@riophae/vue-treeselect'
|
|
import TreeSelect from '@riophae/vue-treeselect'
|
|
@@ -236,24 +246,41 @@ export default {
|
|
|
},
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
handleExport() {
|
|
|
- const queryParams = this.queryParams;
|
|
|
|
|
|
|
+ this.$confirm('是否确认导出token统计数据?', '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ // 显示全屏加载提示
|
|
|
|
|
+ const loadingInstance = this.$loading({
|
|
|
|
|
+ lock: true,
|
|
|
|
|
+ text: '正在导出数据,请稍候...',
|
|
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
- if(this.selectedCompanyList != null && this.selectedCompanyList.length > 0) {
|
|
|
|
|
- this.queryParams.userIds = this.selectedCompanyList;
|
|
|
|
|
- }else {
|
|
|
|
|
- this.queryParams.userIds = [];
|
|
|
|
|
- }
|
|
|
|
|
- this.$confirm('是否确认导出所有ai事件埋点统计数据项?', "警告", {
|
|
|
|
|
- confirmButtonText: "确定",
|
|
|
|
|
- cancelButtonText: "取消",
|
|
|
|
|
- type: "warning"
|
|
|
|
|
- }).then(() => {
|
|
|
|
|
- this.exportLoading = true;
|
|
|
|
|
- return exportFastgptEventLogTotal(queryParams);
|
|
|
|
|
- }).then(response => {
|
|
|
|
|
- this.download(response.msg);
|
|
|
|
|
- this.exportLoading = false;
|
|
|
|
|
- }).catch(() => {});
|
|
|
|
|
|
|
+ this.exportLoading = true;
|
|
|
|
|
+
|
|
|
|
|
+ // 准备导出数据,使用POST方式传递数据
|
|
|
|
|
+ const exportData = {
|
|
|
|
|
+ companyId: this.queryParams.companyId,
|
|
|
|
|
+ beginTime: this.queryParams.beginTime,
|
|
|
|
|
+ endTime: this.queryParams.endTime
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ exportTokenTotal(exportData)
|
|
|
|
|
+ .then(response => {
|
|
|
|
|
+ this.download(response.msg);
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ this.$message.error('导出失败');
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ loadingInstance.close();
|
|
|
|
|
+ this.exportLoading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.$message.info('已取消导出');
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|