master
Yangwl 1 month ago
parent c86f213615
commit 25cefccfc6

@ -51,7 +51,7 @@
"LastEditors": "zhou lei", //
"Description": "",
"FilePath": "Do not edit", //
"custom_string_obkoro1": "联系方式:910592680@qq.com 18669792120 科海达信息技术有限公司"
"custom_string_obkoro1": "联系方式:910592680@qq.com 18669792120 "
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"

@ -5,7 +5,7 @@
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/App.vue
* 联系方式:910592680@qq.com 18669792120 科海达信息技术有限公司
* 联系方式:910592680@qq.com 18669792120
-->
<script lang="ts">
import Vue from 'vue';

@ -5,7 +5,7 @@
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/components/base/page.ts
* :910592680@qq.com 18669792120
* :910592680@qq.com 18669792120
*/
import { Component, Vue } from 'vue-property-decorator';
import { page } from '@/utils/page';

@ -5,7 +5,7 @@
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/main.ts
* :910592680@qq.com 18669792120
* :910592680@qq.com 18669792120
*/
import Vue from 'vue';
import uView from 'uview-ui';

2
src/sfc.d.ts vendored

@ -5,7 +5,7 @@
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/sfc.d.ts
* :910592680@qq.com 18669792120
* :910592680@qq.com 18669792120
*/
// 1. 确保在声明补充的类型之前导入 'vue'
declare module '*.vue' {

@ -5,7 +5,7 @@
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/utils/mixin.ts
* :910592680@qq.com 18669792120
* :910592680@qq.com 18669792120
*/
import Vue from 'vue';
import { Component } from 'vue-property-decorator';

@ -1,39 +1,39 @@
/*
* @Author: zhou lei
* @Date: 2023-02-22 19:08:18
* @LastEditTime: 2023-02-22 19:19:54
* @LastEditors: zhou lei
* @Description:
* @FilePath: \hgwms-factory-app\src\utils\subtraction.ts
* :910592680@qq.com 18669792120
*/
//自定义减法,解决浮点类型相减精度问题
export function subtraction(arg1: number, arg2: number) {
let r1: number, r2: number;
try {
r1 = arg1.toString().split('.')[1].length;
} catch (e) {
r1 = 0;
}
try {
r2 = arg2.toString().split('.')[1].length;
} catch (e) {
r2 = 0;
}
const c = Math.abs(r1 - r2);
const m = Math.pow(10, Math.max(r1, r2));
if (c > 0) {
const cm = Math.pow(10, c);
if (r1 > r2) {
arg1 = Number(arg1.toString().replace('.', ''));
arg2 = Number(arg2.toString().replace('.', '')) * cm;
} else {
arg1 = Number(arg1.toString().replace('.', '')) * cm;
arg2 = Number(arg2.toString().replace('.', ''));
}
} else {
arg1 = Number(arg1.toString().replace('.', ''));
arg2 = Number(arg2.toString().replace('.', ''));
}
return (arg1 - arg2) / m;
}
/*
* @Author: zhou lei
* @Date: 2023-02-22 19:08:18
* @LastEditTime: 2023-02-22 19:19:54
* @LastEditors: zhou lei
* @Description:
* @FilePath: \hgwms-factory-app\src\utils\subtraction.ts
* :910592680@qq.com 18669792120
*/
//自定义减法,解决浮点类型相减精度问题
export function subtraction(arg1: number, arg2: number) {
let r1: number, r2: number;
try {
r1 = arg1.toString().split('.')[1].length;
} catch (e) {
r1 = 0;
}
try {
r2 = arg2.toString().split('.')[1].length;
} catch (e) {
r2 = 0;
}
const c = Math.abs(r1 - r2);
const m = Math.pow(10, Math.max(r1, r2));
if (c > 0) {
const cm = Math.pow(10, c);
if (r1 > r2) {
arg1 = Number(arg1.toString().replace('.', ''));
arg2 = Number(arg2.toString().replace('.', '')) * cm;
} else {
arg1 = Number(arg1.toString().replace('.', '')) * cm;
arg2 = Number(arg2.toString().replace('.', ''));
}
} else {
arg1 = Number(arg1.toString().replace('.', ''));
arg2 = Number(arg2.toString().replace('.', ''));
}
return (arg1 - arg2) / m;
}

@ -5,7 +5,7 @@
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/types/vue-form.d.ts
* :910592680@qq.com 18669792120
* :910592680@qq.com 18669792120
*/
declare module 'vue/types/form' {
/**

@ -6,7 +6,7 @@
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/types/vue-prototype.d.ts
* :910592680@qq.com 18669792120
* :910592680@qq.com 18669792120
*/
import Vue from 'vue';
// 在 types/vue.d.ts 里 Vue 有构造函数类型

Loading…
Cancel
Save