diff --git a/src/env.d.ts b/src/env.d.ts index 61298b3..0ed4f7a 100644 --- a/src/env.d.ts +++ b/src/env.d.ts @@ -1,5 +1,16 @@ + +import type { HTMLAttributes } from 'vue' + +declare global { + namespace JSX { + interface IntrinsicElements { + [elemName: string]: HTMLAttributes + } + } +} + declare module '*.vue' { - import type { DefineComponent } from 'vue' - const component: DefineComponent<{}, {}, any> - export default component + import type { DefineComponent } from 'vue' + const component: DefineComponent<{}, {}, any> + export default component } \ No newline at end of file diff --git a/src/plugins/download.js b/src/plugins/download.js index a4a0377..17584f9 100644 --- a/src/plugins/download.js +++ b/src/plugins/download.js @@ -32,6 +32,16 @@ export default { console.log(progressEvent) //progressEvent.loaded 下载文件的当前大小 //progressEvent.total 下载文件的总大小 如果后端没有返回 请让他加上 + let progressPercent = Math.round((progressEvent.loaded / progressEvent.total) * 100); + let loading = ElLoading.service({ + lock: true, + text: `下载中,请稍候${progressPercent}%`, + background: 'rgba(0, 0, 0, 0.7)', + }) + loading.setText(`下载中,请稍候${progressPercent}%`) + if (progressPercent == 100) { + loading.close() + } } }).then((res) => { const isBlob = blobValidate(res.data); diff --git a/src/utils/hiprintPrinter.ts b/src/utils/hiprintPrinter.ts index 98d3805..e729a73 100644 --- a/src/utils/hiprintPrinter.ts +++ b/src/utils/hiprintPrinter.ts @@ -63,7 +63,7 @@ function initSocket(onPrinterUpdate?: OnPrinterUpdate) { socket.on("connect_error", (err: Error) => { console.log('连接错误', err); ElMessageBox.alert( - `连接失败!
请确保目标服务器已 下载 并运行 打印服务!`, + `连接失败!
请确保目标服务器已下载安装 并 运行 打印服务!`, "客户端未连接", { dangerouslyUseHTMLString: true, @@ -79,12 +79,17 @@ function initSocket(onPrinterUpdate?: OnPrinterUpdate) { const downExe = () => { // 下载逻辑实现 - console.log('开始下载打印服务'); - Download.name('hiprint_win_x64-1.0.13.exe') + // console.log('开始下载打印服务'); + Download.name('hiprint_win_x64-1.0.13.exe', false) +}; +const yxHiprint = () => { + // 唤起客户端 + window.open("hiprint://"); }; // 挂载到window,使其能被全局访问 -(window as any).downExe = downExe +(window as any).downExe = downExe; +(window as any).yxHiprint = yxHiprint; function silentPrintPdf(url: string, printOptions?: object) { const printStore = usePrintStore(); if (!url) { diff --git a/src/views/checkCode/report/index.vue b/src/views/checkCode/report/index.vue index 379edcb..d3b54ab 100644 --- a/src/views/checkCode/report/index.vue +++ b/src/views/checkCode/report/index.vue @@ -93,9 +93,9 @@
检验结果
对比历史 - 复制全部数据 - 复制异常数据 - 复制正常数据 + 复制全部数据 + 复制异常数据 + 复制正常数据 知识库
@@ -351,7 +351,6 @@ const rightColumns = ref([ { prop: 'refs', label: '参考值', align: 'center', visible: true, key: 3 }, { prop: 'dw', label: '单位', align: 'center', visible: true, key: 4 }, { prop: 'jgbz', label: '结果标志', align: 'center', visible: true, key: 5 }, - ]) // 表格配置 const rightTableConfig = ref( @@ -386,7 +385,9 @@ const periods = ref([]) const compareTableData = ref([]) +const aaaa = () => { +} // 历史数据对比 const openDB = () => { // 00507620 @@ -419,6 +420,49 @@ const openDB = () => { }) } + +interface copyItem { + xmdh: string; + xmmc: string; + csjg: string | number; + refs: string | number; + dw: string; + jgbz: string; +} +// 复制函数 +const copyData = (type: string) => { + let str = '' + const getCommonRow = (item: copyItem) => `${item.xmdh}\t${item.xmmc}\t${item.csjg}\t${item.refs}\t${item.dw}\t${item.jgbz}\t\r\n`; + rightTableData.value.forEach((v: any) => { + if (type == 'All') { + str = str + getCommonRow(v) + str = str + v.xmmc + v.csjg + v.dw + + ','; + } + if (type == 'N' && v.jgbz != 'M' && v.jgbz != '') { + str = str + getCommonRow(v) + } + if (type == 'Y' && v.jgbz == 'M' && v.jgbz != '') { + str = str + getCommonRow(v) + } + }) + + var input = document.createElement('textarea'); + if (!str) return ElMessage.error('没有数据可复制'); + // 把文字放进input中,供复制 + input.value = str; + document.body.appendChild(input); + // 选中创建的input + input.select(); + var copy_result = document.execCommand('copy'); + if (copy_result) { + ElMessage.success('复制成功'); + } else { + ElMessage.error('复制失败'); + } + // 移除 + document.body.removeChild(input); +} + // 数据重组 const formatGroupedData = (data: any[]) => { if (!data || data.length === 0) return []; @@ -492,7 +536,6 @@ const getEcharts = (data: any) => { axisLabel: { rotate: 30, textStyle: { - color: "#8D949B " } }, diff --git a/src/views/dictionary/blood/index copy.vue b/src/views/dictionary/blood/index copy.vue new file mode 100644 index 0000000..b337763 --- /dev/null +++ b/src/views/dictionary/blood/index copy.vue @@ -0,0 +1,296 @@ + + + + + diff --git a/src/views/dictionary/blood/index.vue b/src/views/dictionary/blood/index.vue new file mode 100644 index 0000000..362ad18 --- /dev/null +++ b/src/views/dictionary/blood/index.vue @@ -0,0 +1,529 @@ + + + + + diff --git a/tsconfig.json b/tsconfig.json index fa0fc83..e1705a2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -32,6 +32,8 @@ // "allowUnknownInTemplate": true // 允许模板中使用未知属性 // } }, + "jsx": "preserve", + "types": ["element-plus/global"], "include": ["src/**/*","src/**/*.ts", "src/**/*.vue","src/**/**/*.vue", "src/**/*.tsx", "src/**/*.d.ts", "auto-imports.d.ts"], // **表示任意目录,而 * 表示任意文件。这表明 src 目录中的所有文件都将被编译 "exclude": ["node_modules", "dist"] ,// 指示不需要编译的文件目录 }