From 0270a67887d804345025d2aa638dff9d93f5bd1a Mon Sep 17 00:00:00 2001 From: lichong <18518571399@163.com> Date: Tue, 22 Oct 2024 09:16:09 +0800 Subject: [PATCH] 10.22 --- front/electron-builder.yml | 2 +- front/package.json | 3 +- front/src/renderer/src/views/shujufenxi.vue | 198 ++++++++++++++++++-- jihuoqi/electron-builder.yml | 4 +- 4 files changed, 185 insertions(+), 22 deletions(-) diff --git a/front/electron-builder.yml b/front/electron-builder.yml index 4a61ecd..0cf4d3b 100644 --- a/front/electron-builder.yml +++ b/front/electron-builder.yml @@ -1,5 +1,5 @@ appId: com.electron.lichong -productName: 桌面应用 +productName: 数据统计 directories: buildResources: build files: diff --git a/front/package.json b/front/package.json index b743d99..7a425f1 100644 --- a/front/package.json +++ b/front/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "1.0.7", + "version": "1.0.9", "description": "An Electron application with Vue", "main": "./out/main/index.js", "author": "lichong", @@ -19,6 +19,7 @@ "dayjs": "^1.11.11", "dexie": "^4.0.8", "element-plus": "^2.7.1", + "html2canvas": "^1.4.1", "js-sha256": "^0.11.0", "lodash": "^4.17.21", "node-machine-id": "^1.1.12", diff --git a/front/src/renderer/src/views/shujufenxi.vue b/front/src/renderer/src/views/shujufenxi.vue index 211002a..8868832 100644 --- a/front/src/renderer/src/views/shujufenxi.vue +++ b/front/src/renderer/src/views/shujufenxi.vue @@ -95,7 +95,7 @@ </h4> </div> </template> - <div> + <div id="screenshot"> <screen-short v-if="screenshotStatus" @get-image-data="getImg" @destroy-component="destroyComponent"> </screen-short> <el-descriptions :title="checkDailishangRaw.name" direction="vertical" :column="7" size="large" border> @@ -139,7 +139,7 @@ </template> {{ zhongjiangshuTotal - Number((((tongjiValue || 0) * (checkDailishangRaw.dailifei || 0)) / - 100).toFixed(2)) - Number(((tongjiValue * (fuwufei.fuwufeiValue || 0)) / 100).toFixed(2)) + 100).toFixed(2)) }} </el-descriptions-item> <el-descriptions-item> @@ -162,19 +162,158 @@ }} </el-descriptions-item> </el-descriptions> - <el-row style="margin: 8px 0 0 0 ;"> - <el-col :span="8" style="text-align: center;">合计</el-col> - <el-col :span="8" style="text-align: center;">¥{{ allhejialljineLocalTemp }}</el-col> - <el-col :span="8" style="text-align: center;">输赢总预测</el-col> - </el-row> - <div style="height: 24vh; overflow-y: auto;"> - <el-row v-for="(item, index) in alljineLocalTemp" :key="index"> - <el-col :span="8" style="text-align: center;">{{ item.value }}</el-col> - <el-col :span="8" style="text-align: center;">¥{{ item.jine }}</el-col> - <el-col :span="8" :style="`text-align: center;color:${item.pei > 0 ? '#000000' : '#ff0000'}`">¥ {{ item.pei - }}</el-col> - </el-row> - </div> + <el-table :data="alljineLocalTemp" style="width: 100%;margin-top: 8px" height="calc(40vh - 70px)" border> + <el-table-column prop="value" label="合计" align="center"> + </el-table-column> + <el-table-column prop="jine" align="center"> + <template #header="{ column }"> + <span>¥ {{ allhejialljineLocalTemp }}</span> + </template> + <template #default="scope"> + <span>¥ {{ scope.row.jine }}</span> + </template> + </el-table-column> + <el-table-column prop="value" label="输赢总预测" align="center"> + <template #default="scope"> + <span :style="`color:${scope.row.pei > 0 ? '#000000' : '#ff0000'}`"> + ¥ {{ scope.row.pei }}</span> + </template> + </el-table-column> + </el-table> + <!-- <el-descriptions :title="selectChangci.title" direction="vertical" :column="6" size="large" border> + <el-descriptions-item> + <template #label> + <div class="cell-item"> + 代理商姓名 + </div> + </template> + {{ checkDailishangRaw.name }} + </el-descriptions-item> + <el-descriptions-item> + <template #label> + <div class="cell-item"> + 代理费(%) + </div> + </template> + {{ checkDailishangRaw.dailifei || 0 }} + </el-descriptions-item> + <el-descriptions-item> + <template #label> + <div class="cell-item"> + 联系方式 + </div> + </template> + {{ checkDailishangRaw.phone }} + </el-descriptions-item> + <el-descriptions-item> + <template #label> + <div class="cell-item"> + 总金额 + </div> + </template> + {{ _.sum(_.values(this.dataObj)) }} + </el-descriptions-item> + <el-descriptions-item> + <template #label> + <div class="cell-item"> + 代理费 + </div> + </template> + {{ ((_.sum(_.values(this.dataObj)) * ((checkDailishangRaw.dailifei || 0))) / 100).toFixed(2) }} + </el-descriptions-item> + <el-descriptions-item> + <template #label> + <div class="cell-item"> + 剩余金额 + </div> + </template> + {{ ((_.sum(_.values(this.dataObj)) * (100 - (checkDailishangRaw.dailifei || 0))) / 100).toFixed(2) }} + </el-descriptions-item> + </el-descriptions> --> + </div> + <div id="screenshot1" v-show="false" style="padding: 12px;"> + <el-descriptions :title="checkDailishangRaw.name" direction="vertical" :column="7" size="large" border> + <el-descriptions-item> + <template #label> + <div class="cell-item"> + 开奖 + </div> + </template> + {{ selectChangci.jiangxiang }} + </el-descriptions-item> + <el-descriptions-item> + <template #label> + <div class="cell-item"> + 总押注 + </div> + </template> + {{ tongjiValue || 0 }} + </el-descriptions-item> + <el-descriptions-item> + <template #label> + <div class="cell-item"> + 代理费 + </div> + </template> + {{ (((tongjiValue || 0) * (checkDailishangRaw.dailifei || 0)) / 100).toFixed(2) }} + </el-descriptions-item> + <el-descriptions-item> + <template #label> + <div class="cell-item"> + 中奖数 + </div> + </template> + {{ zhongjiangshucount }} + </el-descriptions-item> + <el-descriptions-item> + <template #label> + <div class="cell-item"> + 中奖赔付 + </div> + </template> + {{ + zhongjiangshuTotal - Number((((tongjiValue || 0) * (checkDailishangRaw.dailifei || 0)) / + 100).toFixed(2)) + }} + </el-descriptions-item> + <el-descriptions-item> + <template #label> + <div class="cell-item"> + 服务费 + </div> + </template> + {{ ((tongjiValue * (fuwufei.fuwufeiValue || 0)) / 100).toFixed(2) }} + </el-descriptions-item> + <el-descriptions-item> + <template #label> + <div class="cell-item"> + 输赢 + </div> + </template> + {{ ((tongjiValue || 0) - Number((((tongjiValue || 0) * ((checkDailishangRaw.dailifei || 0))) / + 100).toFixed(2)) - zhongjiangshuTotal + - Number(((tongjiValue * (fuwufei.fuwufeiValue || 0)) / 100).toFixed(2))).toFixed(2) + }} + </el-descriptions-item> + </el-descriptions> + <el-table :data="alljineLocalTemp" style="width: 100%;margin-top: 8px" border> + <el-table-column prop="value" label="合计" align="center" :width="182"> + </el-table-column> + <el-table-column prop="jine" align="center" :width="200"> + <template #header="{ column }"> + <span>¥ {{ allhejialljineLocalTemp }}</span> + </template> + <template #default="scope"> + <span>¥ {{ scope.row.jine }}</span> + </template> + </el-table-column> + <el-table-column prop="value" label="输赢总预测" align="center" :width="200"> + <template #default="scope"> + <span :style="`color:${scope.row.pei > 0 ? '#000000' : '#ff0000'}`"> + ¥ {{ scope.row.pei }}</span> + </template> + </el-table-column> + </el-table> <!-- <el-descriptions :title="selectChangci.title" direction="vertical" :column="6" size="large" border> <el-descriptions-item> <template #label> @@ -259,6 +398,7 @@ <script> import _ from 'lodash' +import html2canvas from 'html2canvas' import { myDatabase } from '../assets/js/db.js' import dayjs from 'dayjs' import { ElMessage, ElMessageBox } from 'element-plus' @@ -975,6 +1115,8 @@ export default { rightClear() { this.rightText = "" this.rightTableData = [] + this.rightTableDataTempti = [] + this.rightTableDataTempfu = [] this.resultTitle = 0 this.resultTitleti = 0 this.resultTitlefu = 0 @@ -1012,7 +1154,29 @@ export default { }, jietu() { - this.screenshotStatus = true;//显示截图插件 + // this.screenshotStatus = true;//显示截图插件 + let element = document.getElementById('screenshot1'); + + // 保存原始的 display 属性 + let originalDisplay = element.style.display; + + // 临时将 display 属性更改为 block + element.style.display = 'block'; + + // 使用 html2canvas 进行截图 + html2canvas(element).then(canvas => { + // 将 canvas 转换为图片数据 URL + let imgData = canvas.toDataURL('image/png'); + + // 创建一个隐藏的 a 标签来下载图片 + let a = document.createElement('a'); + a.href = imgData; + a.download = `${dayjs().format('YYYYMMDDHHmmss')}.png`; + a.click(); + + // 恢复原始的 display 属性 + element.style.display = originalDisplay; + }); }, //截图按了√以后生成64编码 @@ -1734,7 +1898,6 @@ export default { this.tongjiValue = 0 this.zhongjiangshuTotal = 0 this.zhongjiangshucount = 0 - console.log(1688, alljineLocal); for (let key in alljineLocal) { this.tongjiValue += alljineLocal[key].all this.zhongjiangshuTotal += alljineLocal[key].zhong @@ -1767,7 +1930,6 @@ export default { type: [] } for (let m = 0; m < alljineLocalGroupy[key].length; m++) { - console.log(88888, alljineLocalGroupy[key]) let element = alljineLocalGroupy[key][m]; alljineLocalGroupyItem.pei = alljineLocalGroupyItem.pei + (((100 - (this.fuwufei.fuwufeiValue || 0)) * Number(element.pei)) / 100) alljineLocalGroupyItem.jine += element.jine diff --git a/jihuoqi/electron-builder.yml b/jihuoqi/electron-builder.yml index 0111957..11b1388 100644 --- a/jihuoqi/electron-builder.yml +++ b/jihuoqi/electron-builder.yml @@ -1,5 +1,5 @@ appId: com.electron.jihuoqi -productName: 激活器 +productName: 数据统计激活器 directories: buildResources: build files: @@ -14,7 +14,7 @@ win: executableName: jihuoqi-app nsis: oneClick: false - artifactName: 激活器-${version}-setup.${ext} + artifactName: 数据统计激活器-${version}-setup.${ext} allowToChangeInstallationDirectory: true shortcutName: ${productName} uninstallDisplayName: ${productName}