Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
confucius
Commits
fc573372
Commit
fc573372
authored
May 20, 2024
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
df16d6d1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
564 additions
and
539 deletions
+564
-539
quasar.conf.js
quasar.conf.js
+1
-1
common.js
src/api/common/common.js
+4
-4
personalData.vue
src/pages/user/personalData.vue
+404
-397
erpindex.js
src/utils/erpindex.js
+155
-137
No files found.
quasar.conf.js
View file @
fc573372
...
@@ -47,7 +47,7 @@ module.exports = function(ctx) {
...
@@ -47,7 +47,7 @@ module.exports = function(ctx) {
vueRouterMode
:
'history'
,
// available values: 'hash', 'history'
vueRouterMode
:
'history'
,
// available values: 'hash', 'history'
env
:
ctx
.
dev
?
{
env
:
ctx
.
dev
?
{
API
:
'http://localhost:
5001
/api'
,
API
:
'http://localhost:
8300
/api'
,
// API: 'http://192.168.10.128:8300/api',
// API: 'http://192.168.10.128:8300/api',
// API: 'https://eduapi.oytour.com/api',
// API: 'https://eduapi.oytour.com/api',
API_ZC
:
'http://192.168.5.238:8087/api'
,
API_ZC
:
'http://192.168.5.238:8087/api'
,
...
...
src/api/common/common.js
View file @
fc573372
...
@@ -25,8 +25,8 @@ export function getFontConfig() {
...
@@ -25,8 +25,8 @@ export function getFontConfig() {
export
function
CommonConfig
()
{
export
function
CommonConfig
()
{
return
{
return
{
FileConfig
:
{
FileConfig
:
{
FileUrl
:
'http://192.168.5.
46
:8130'
,
//本地服务器文件预览地址
FileUrl
:
'http://192.168.5.
214
:8130'
,
//本地服务器文件预览地址
UploadUrl
:
'http://192.168.5.
46
:8120'
UploadUrl
:
'http://192.168.5.
214
:8120'
}
}
}
}
}
}
...
@@ -296,7 +296,7 @@ export function UploadFileToALi(uploadConfig, fileFullPath, fileObj, uploadLoadd
...
@@ -296,7 +296,7 @@ export function UploadFileToALi(uploadConfig, fileFullPath, fileObj, uploadLoadd
if
(
locationName
.
indexOf
(
'localhost'
)
!==
-
1
)
{
if
(
locationName
.
indexOf
(
'localhost'
)
!==
-
1
)
{
uploadConfig
.
UploadDomain
=
fileConfig
.
FileConfig
.
UploadUrl
;
uploadConfig
.
UploadDomain
=
fileConfig
.
FileConfig
.
UploadUrl
;
}
}
let
url
=
uploadConfig
.
UploadDomain
+
"/Upload/UploadToALiOSS?filePath="
+
newFileName
;
let
url
=
uploadConfig
.
UploadDomain
+
"/Upload/UploadToALiOSS?
isDomain=1&
filePath="
+
newFileName
;
let
formData
=
new
FormData
()
let
formData
=
new
FormData
()
formData
.
append
(
'myfile'
,
fileObj
)
formData
.
append
(
'myfile'
,
fileObj
)
let
xhr
=
new
XMLHttpRequest
()
let
xhr
=
new
XMLHttpRequest
()
...
@@ -332,7 +332,7 @@ export function UploadFileToTencent(uploadConfig, fileFullPath, fileObj, uploadL
...
@@ -332,7 +332,7 @@ export function UploadFileToTencent(uploadConfig, fileFullPath, fileObj, uploadL
if
(
locationName
.
indexOf
(
'localhost'
)
!==
-
1
)
{
if
(
locationName
.
indexOf
(
'localhost'
)
!==
-
1
)
{
uploadConfig
.
UploadDomain
=
fileConfig
.
FileConfig
.
UploadUrl
;
uploadConfig
.
UploadDomain
=
fileConfig
.
FileConfig
.
UploadUrl
;
}
}
let
url
=
uploadConfig
.
UploadDomain
+
"/Upload/UploadToTecent?filePath="
+
newFileName
;
let
url
=
uploadConfig
.
UploadDomain
+
"/Upload/UploadToTecent?
isDomain=1&
filePath="
+
newFileName
;
let
formData
=
new
FormData
()
let
formData
=
new
FormData
()
formData
.
append
(
'myfile'
,
fileObj
)
formData
.
append
(
'myfile'
,
fileObj
)
let
xhr
=
new
XMLHttpRequest
()
let
xhr
=
new
XMLHttpRequest
()
...
...
src/pages/user/personalData.vue
View file @
fc573372
...
@@ -21,7 +21,8 @@
...
@@ -21,7 +21,8 @@
width
:
1px
;
width
:
1px
;
padding
:
20px
26px
;
padding
:
20px
26px
;
}
}
.personalData
.box_r2
{
.personalData
.box_r2
{
flex
:
1
;
flex
:
1
;
width
:
1px
;
width
:
1px
;
padding
:
0px
0px
;
padding
:
0px
0px
;
...
@@ -102,6 +103,7 @@
...
@@ -102,6 +103,7 @@
margin-top
:
20px
;
margin-top
:
20px
;
}
}
</
style
>
</
style
>
<
template
>
<
template
>
<div
class=
"page-body personalData row"
style=
"background: transparent;"
>
<div
class=
"page-body personalData row"
style=
"background: transparent;"
>
...
@@ -117,7 +119,8 @@
...
@@ -117,7 +119,8 @@
<div
class=
"text-muted"
style=
"font-size:14px;margin-top: 12px;"
>
<div
class=
"text-muted"
style=
"font-size:14px;margin-top: 12px;"
>
{{
showObj
.
SchoolName
}}
·
{{
showObj
.
PostName
}}
</div>
{{
showObj
.
SchoolName
}}
·
{{
showObj
.
PostName
}}
</div>
<div
class=
"q-mt-xs"
>
<div
class=
"q-mt-xs"
>
<q-btn
style=
"background: var(--q-color-negative);color: white;margin-top: 10px;"
size=
"sm"
@
click=
"logout"
>
退出登录
</q-btn>
<q-btn
style=
"background: var(--q-color-negative);color: white;margin-top: 10px;"
size=
"sm"
@
click=
"logout"
>
退出登录
</q-btn>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -161,21 +164,21 @@
...
@@ -161,21 +164,21 @@
<div
style=
"font-size: 12px;color: #999999;margin-top: 12px;"
>
图片格式:png、jpg、jpeg
</div>
<div
style=
"font-size: 12px;color: #999999;margin-top: 12px;"
>
图片格式:png、jpg、jpeg
</div>
<div
class=
"box_r_title"
>
基础资料
</div>
<div
class=
"box_r_title"
>
基础资料
</div>
<div
class=
"box_r_input"
>
<div
class=
"box_r_input"
>
<q-input
v-model=
"datamodify.EmployeeName"
label=
"姓名"
<q-input
v-model=
"datamodify.EmployeeName"
label=
"姓名"
:rules=
"[val => !!val || '姓名不能为空']"
lazy-rules
filled
:rules=
"[val => !!val || '姓名不能为空']"
lazy-rules
filled
maxlength=
"20"
/>
maxlength=
"20"
/>
</div>
</div>
<div
class=
"box_r_input"
>
<div
class=
"box_r_input"
>
<q-select
filled
stack-label
option-value=
"SId"
option-label=
"SName"
v-model=
"datamodify.School_
Id"
<q-select
filled
stack-label
option-value=
"SId"
option-label=
"SName"
v-model=
"datamodify.School_Id"
ref=
"S
Id"
ref=
"SId"
:options=
"CompanyList"
label=
"校区"
:dense=
"false"
emit-value
map-options
/>
:options=
"CompanyList"
label=
"校区"
:dense=
"false"
emit-value
map-options
/>
</div>
</div>
<div
class=
"box_r_title"
>
联系方式
</div>
<div
class=
"box_r_title"
>
联系方式
</div>
<div
class=
"box_r_input"
>
<div
class=
"box_r_input"
>
<q-input
v-model=
"datamodify.EmployeeTel"
label=
"电话"
type=
'number'
<q-input
v-model=
"datamodify.EmployeeTel"
label=
"电话"
type=
'number'
:rules=
"[val => !!val || '电话不能为空']"
:rules=
"[val => !!val || '电话不能为空']"
lazy-rules
filled
maxlength=
"11"
/>
lazy-rules
filled
maxlength=
"11"
/>
</div>
</div>
<div
class=
"box_r_input"
>
<div
class=
"box_r_input"
>
<q-input
v-model=
"datamodify.Email"
label=
"邮箱"
<q-input
v-model=
"datamodify.Email"
label=
"邮箱"
:rules=
"[val => !!val || '邮箱不能为空']"
lazy-rules
filled
:rules=
"[val => !!val || '邮箱不能为空']"
lazy-rules
filled
maxlength=
"20"
/>
maxlength=
"20"
/>
</div>
</div>
<q-btn
color=
"primary"
style=
"width: 300px;margin-top: 50px;"
:loading=
"loading1"
@
click=
'dataSubmit'
>
<q-btn
color=
"primary"
style=
"width: 300px;margin-top: 50px;"
:loading=
"loading1"
@
click=
'dataSubmit'
>
<div
class=
"ellipsis"
>
<div
class=
"ellipsis"
>
...
@@ -201,7 +204,8 @@
...
@@ -201,7 +204,8 @@
<q-input
v-model=
"passwordMsg.NewSurePassWord"
label=
"请再次输入新密码"
type=
'password'
ref=
'NewSurePassWord'
<q-input
v-model=
"passwordMsg.NewSurePassWord"
label=
"请再次输入新密码"
type=
'password'
ref=
'NewSurePassWord'
:rules=
"[val => !!val || '请再次输入新密码']"
lazy-rules
filled
/>
:rules=
"[val => !!val || '请再次输入新密码']"
lazy-rules
filled
/>
</div>
</div>
<q-btn
color=
"primary"
style=
"width: 300px;margin-top: 50px;"
:loading=
"loading2"
label=
"确定修改"
type=
"submit"
>
</q-btn>
<q-btn
color=
"primary"
style=
"width: 300px;margin-top: 50px;"
:loading=
"loading2"
label=
"确定修改"
type=
"submit"
>
</q-btn>
</form>
</form>
...
@@ -221,9 +225,9 @@
...
@@ -221,9 +225,9 @@
UploadSelfFile
UploadSelfFile
}
from
'../../api/common/common'
}
from
'../../api/common/common'
const
defaultpassword
=
{
const
defaultpassword
=
{
OldPassWord
:
''
,
OldPassWord
:
''
,
NewPassWord
:
''
,
NewPassWord
:
''
,
NewSurePassWord
:
''
,
NewSurePassWord
:
''
,
}
}
import
summaryInfo
from
'../../components/user/summaryInfo'
import
summaryInfo
from
'../../components/user/summaryInfo'
import
Lockr
from
'lockr'
import
Lockr
from
'lockr'
...
@@ -237,12 +241,12 @@
...
@@ -237,12 +241,12 @@
data
()
{
data
()
{
return
{
return
{
loading1
:
false
,
loading1
:
false
,
loading2
:
false
,
loading2
:
false
,
showObj
:
{},
showObj
:
{},
rightType
:
0
,
//右边显示类型
rightType
:
0
,
//右边显示类型
datamodify
:
{},
datamodify
:
{},
CompanyList
:
[],
CompanyList
:
[],
passwordMsg
:
Object
.
assign
({},
defaultpassword
),
passwordMsg
:
Object
.
assign
({},
defaultpassword
),
}
}
},
},
created
()
{
created
()
{
...
@@ -260,7 +264,7 @@
...
@@ -260,7 +264,7 @@
this
.
getBranchList
()
this
.
getBranchList
()
},
},
methods
:
{
methods
:
{
getBranchList
()
{
//获取校区
getBranchList
()
{
//获取校区
getSchoolDropdown
({}).
then
(
res
=>
{
getSchoolDropdown
({}).
then
(
res
=>
{
this
.
CompanyList
=
res
.
Data
;
this
.
CompanyList
=
res
.
Data
;
}).
catch
(()
=>
{
}).
catch
(()
=>
{
...
@@ -269,13 +273,16 @@
...
@@ -269,13 +273,16 @@
},
},
uploadFileBtn
(
file
)
{
//上传
uploadFileBtn
(
file
)
{
//上传
UploadSelfFile
(
'studentIcon'
,
file
.
file
,
x
=>
{
//UploadFileToTencent
//UploadSelfFile
this
.
UploadFileToTencent
(
'studentIcon'
,
file
.
file
,
x
=>
{
if
(
x
.
Code
==
1
)
{
if
(
x
.
Code
==
1
)
{
this
.
datamodify
.
UserIcon
=
x
.
FileUrl
this
.
datamodify
.
UserIcon
=
x
.
FileUrl
}
}
},
1
);
},
1
);
},
},
logout
()
{
//退出登录
logout
()
{
//退出登录
this
.
$store
this
.
$store
.
dispatch
(
'LogOut'
)
.
dispatch
(
'LogOut'
)
.
then
(()
=>
{
.
then
(()
=>
{
...
@@ -285,7 +292,7 @@
...
@@ -285,7 +292,7 @@
})
})
},
},
dataSubmit
()
{
//资料提交
dataSubmit
()
{
//资料提交
if
(
this
.
datamodify
.
UserIcon
==
null
||
this
.
datamodify
.
UserIcon
==
''
)
{
if
(
this
.
datamodify
.
UserIcon
==
null
||
this
.
datamodify
.
UserIcon
==
''
)
{
this
.
$q
.
notify
({
this
.
$q
.
notify
({
type
:
'negative'
,
type
:
'negative'
,
...
@@ -334,14 +341,14 @@
...
@@ -334,14 +341,14 @@
this
.
showObj
.
Email
=
this
.
datamodify
.
Email
this
.
showObj
.
Email
=
this
.
datamodify
.
Email
this
.
showObj
.
School_Id
=
this
.
datamodify
.
School_Id
this
.
showObj
.
School_Id
=
this
.
datamodify
.
School_Id
this
.
CompanyList
.
map
(
x
=>
{
this
.
CompanyList
.
map
(
x
=>
{
if
(
x
.
SId
==
this
.
datamodify
.
School_Id
)
{
if
(
x
.
SId
==
this
.
datamodify
.
School_Id
)
{
this
.
showObj
.
SchoolName
=
x
.
SName
;
this
.
showObj
.
SchoolName
=
x
.
SName
;
return
return
}
}
})
})
Lockr
.
set
(
"loginUserInfo"
,
this
.
showObj
)
Lockr
.
set
(
"loginUserInfo"
,
this
.
showObj
)
this
.
$store
.
dispatch
(
"setUserUpdate"
,
this
.
showObj
)
this
.
$store
.
dispatch
(
"setUserUpdate"
,
this
.
showObj
)
// location.reload()
// location.reload()
// this.$router.push({
// this.$router.push({
// path: this.redirect || '/home'
// path: this.redirect || '/home'
...
@@ -358,14 +365,13 @@
...
@@ -358,14 +365,13 @@
})
})
},
},
passwordSubmit
()
{
passwordSubmit
()
{
this
.
$refs
.
OldPassWord
.
validate
()
this
.
$refs
.
OldPassWord
.
validate
()
this
.
$refs
.
NewPassWord
.
validate
()
this
.
$refs
.
NewPassWord
.
validate
()
this
.
$refs
.
NewSurePassWord
.
validate
()
this
.
$refs
.
NewSurePassWord
.
validate
()
if
(
this
.
$refs
.
OldPassWord
.
hasError
||
this
.
$refs
.
NewPassWord
.
hasError
||
this
.
$refs
.
NewSurePassWord
.
hasError
)
{
if
(
this
.
$refs
.
OldPassWord
.
hasError
||
this
.
$refs
.
NewPassWord
.
hasError
||
this
.
$refs
.
NewSurePassWord
.
hasError
)
{
this
.
formHasError
=
true
this
.
formHasError
=
true
}
}
else
{
else
{
// 掉接口
// 掉接口
updateUserPassword
(
this
.
passwordMsg
).
then
(
res
=>
{
updateUserPassword
(
this
.
passwordMsg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
if
(
res
.
Code
==
1
)
{
...
@@ -408,4 +414,5 @@
...
@@ -408,4 +414,5 @@
</
script
>
</
script
>
<
style
lang=
"sass"
>
<
style
lang=
"sass"
>
@import
url('~assets/css/table.sass')
@import
url('~assets/css/table.sass')
</
style
>
</
style
>
src/utils/erpindex.js
View file @
fc573372
...
@@ -160,7 +160,7 @@ export default {
...
@@ -160,7 +160,7 @@ export default {
document
.
body
.
appendChild
(
link
);
document
.
body
.
appendChild
(
link
);
link
.
click
();
link
.
click
();
successCall
(
res
);
successCall
(
res
);
}).
catch
(
function
(
res
)
{
});
}).
catch
(
function
(
res
)
{});
},
},
//HTTP提交数据
//HTTP提交数据
...
@@ -272,7 +272,7 @@ export default {
...
@@ -272,7 +272,7 @@ export default {
}
}
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
data
.
resultCode
==
10000
||
res
.
data
.
resultCode
==
10001
)
{
}
else
if
(
res
.
resultCode
==
10005
)
{
if
(
res
.
data
.
resultCode
==
10000
||
res
.
data
.
resultCode
==
10001
)
{}
else
if
(
res
.
resultCode
==
10005
)
{
this
.
$router
.
go
(
-
1
);
this
.
$router
.
go
(
-
1
);
}
else
{
}
else
{
successCall
(
res
);
successCall
(
res
);
...
@@ -296,7 +296,7 @@ export default {
...
@@ -296,7 +296,7 @@ export default {
document
.
body
.
appendChild
(
link
);
document
.
body
.
appendChild
(
link
);
link
.
click
();
link
.
click
();
successCall
(
res
);
successCall
(
res
);
}).
catch
(
function
(
res
)
{
});
}).
catch
(
function
(
res
)
{
});
},
},
//价钱格式化,三位数逗号分隔,保留两位小数 duanjun
//价钱格式化,三位数逗号分隔,保留两位小数 duanjun
Vue
.
prototype
.
moneyFormat
=
function
(
value
)
{
Vue
.
prototype
.
moneyFormat
=
function
(
value
)
{
...
@@ -433,7 +433,9 @@ export default {
...
@@ -433,7 +433,9 @@ export default {
},
},
//上传文件到云存储
//上传文件到云存储
Vue
.
prototype
.
UploadFileToTencent
=
function
(
path
,
fileObj
,
callback
)
{
Vue
.
prototype
.
UploadFileToTencent
=
function
(
path
,
fileObj
,
callback
)
{
var
upInfo
=
JSON
.
parse
(
localStorage
.
uploadInfo
);
var
localCache
=
this
.
getLocalStorage
();
if
(
localCache
&&
localCache
.
UploadConfig
)
{
let
maxSize
=
500
*
1024
let
maxSize
=
500
*
1024
if
((
fileObj
.
type
==
"image/png"
||
fileObj
.
type
==
"image/jpeg"
)
&&
fileObj
.
size
>
maxSize
)
{
if
((
fileObj
.
type
==
"image/png"
||
fileObj
.
type
==
"image/jpeg"
)
&&
fileObj
.
size
>
maxSize
)
{
let
that
=
this
let
that
=
this
...
@@ -454,20 +456,34 @@ export default {
...
@@ -454,20 +456,34 @@ export default {
var
newFile
=
new
File
([
u8arr
],
fileObj
.
name
,
{
var
newFile
=
new
File
([
u8arr
],
fileObj
.
name
,
{
type
:
mime
type
:
mime
});
});
this
.
RealFileToTencent
(
path
,
newFile
,
callback
)
}).
catch
(
function
(
error
)
{
}).
always
(
function
()
{
//不管成功或失败,都会执行
})
}
else
{
this
.
RealFileToTencent
(
path
,
fileObj
,
callback
)
}
}
},
//真实上传文件方法
Vue
.
prototype
.
RealFileToTencent
=
function
(
path
,
fileObj
,
callback
)
{
let
str
=
''
;
let
str
=
''
;
str
=
"/2024/"
str
=
"/2024/"
var
newFileName
=
str
+
path
;
var
newFileName
=
str
+
path
;
var
upInfo
=
this
.
getLocalStorage
().
UploadConfig
;
let
url
=
upInfo
.
UploadDomain
+
"/Upload/UploadToTecent?filePath="
+
newFileName
;
var
u_url
=
upInfo
.
UploadDomain
;
//u_url = "http://192.168.5.46:8120"
let
url
=
u_url
+
"/Upload/UploadToTecent?isDomain=1&filePath="
+
newFileName
;
let
formData
=
new
FormData
()
let
formData
=
new
FormData
()
formData
.
append
(
'myfile'
,
newFile
)
formData
.
append
(
'myfile'
,
fileObj
)
let
xhr
=
new
XMLHttpRequest
()
let
xhr
=
new
XMLHttpRequest
()
xhr
.
onload
=
function
()
{
xhr
.
onload
=
function
()
{
uploadLoadding
.
hide
();
var
jsonObj
=
JSON
.
parse
(
xhr
.
responseText
);
var
jsonObj
=
JSON
.
parse
(
xhr
.
responseText
);
if
(
jsonObj
.
StatusCode
===
1
&&
callback
)
{
if
(
jsonObj
.
StatusCode
===
1
&&
callback
)
{
var
uploadResult
=
{
var
uploadResult
=
{
resultCode
:
1
,
Code
:
1
,
FileName
:
fileObj
.
name
,
FileName
:
fileObj
.
name
,
FileUrl
:
jsonObj
.
FilePath
,
FileUrl
:
jsonObj
.
FilePath
,
}
}
...
@@ -478,15 +494,7 @@ export default {
...
@@ -478,15 +494,7 @@ export default {
}
}
xhr
.
open
(
'post'
,
url
,
true
)
xhr
.
open
(
'post'
,
url
,
true
)
xhr
.
send
(
formData
)
xhr
.
send
(
formData
)
}).
catch
(
function
(
error
)
{
}).
always
(
function
()
{
//不管成功或失败,都会执行
})
}
else
{
}
}
},
//公用判断图片地址 判断是否包含http
//公用判断图片地址 判断是否包含http
Vue
.
prototype
.
getIconLink
=
function
(
url
)
{
Vue
.
prototype
.
getIconLink
=
function
(
url
)
{
...
@@ -519,7 +527,7 @@ export default {
...
@@ -519,7 +527,7 @@ export default {
});
});
return
getBlob
return
getBlob
},
},
Vue
.
prototype
.
accAdd
=
function
(
arg1
,
arg2
)
{
//加法精密计算
Vue
.
prototype
.
accAdd
=
function
(
arg1
,
arg2
)
{
//加法精密计算
var
r1
;
var
r1
;
var
r2
;
var
r2
;
var
m
;
var
m
;
...
@@ -552,18 +560,16 @@ export default {
...
@@ -552,18 +560,16 @@ export default {
return
(
arg1
+
arg2
)
/
m
;
return
(
arg1
+
arg2
)
/
m
;
},
},
// 减法
// 减法
Vue
.
prototype
.
subtr
=
function
(
arg1
,
arg2
)
{
Vue
.
prototype
.
subtr
=
function
(
arg1
,
arg2
)
{
var
r1
,
r2
,
m
,
n
;
var
r1
,
r2
,
m
,
n
;
try
{
try
{
r1
=
arg1
.
toString
().
split
(
"."
)[
1
].
length
;
r1
=
arg1
.
toString
().
split
(
"."
)[
1
].
length
;
}
}
catch
(
e
)
{
catch
(
e
)
{
r1
=
0
;
r1
=
0
;
}
}
try
{
try
{
r2
=
arg2
.
toString
().
split
(
"."
)[
1
].
length
;
r2
=
arg2
.
toString
().
split
(
"."
)[
1
].
length
;
}
}
catch
(
e
)
{
catch
(
e
)
{
r2
=
0
;
r2
=
0
;
}
}
m
=
Math
.
pow
(
10
,
Math
.
max
(
r1
,
r2
));
m
=
Math
.
pow
(
10
,
Math
.
max
(
r1
,
r2
));
...
@@ -573,17 +579,29 @@ export default {
...
@@ -573,17 +579,29 @@ export default {
return
((
arg1
*
m
-
arg2
*
m
)
/
m
).
toFixed
(
n
);
return
((
arg1
*
m
-
arg2
*
m
)
/
m
).
toFixed
(
n
);
}
}
// 乘法获取准确值
// 乘法获取准确值
Vue
.
prototype
.
accMul
=
function
(
arg1
,
arg2
){
Vue
.
prototype
.
accMul
=
function
(
arg1
,
arg2
)
{
var
m
=
0
,
s1
=
arg1
.
toString
(),
s2
=
arg2
.
toString
();
var
m
=
0
,
try
{
m
+=
s1
.
split
(
"."
)[
1
].
length
}
catch
(
e
){}
s1
=
arg1
.
toString
(),
try
{
m
+=
s2
.
split
(
"."
)[
1
].
length
}
catch
(
e
){}
s2
=
arg2
.
toString
();
return
Number
(
s1
.
replace
(
"."
,
""
))
*
Number
(
s2
.
replace
(
"."
,
""
))
/
Math
.
pow
(
10
,
m
)
try
{
m
+=
s1
.
split
(
"."
)[
1
].
length
}
catch
(
e
)
{}
try
{
m
+=
s2
.
split
(
"."
)[
1
].
length
}
catch
(
e
)
{}
return
Number
(
s1
.
replace
(
"."
,
""
))
*
Number
(
s2
.
replace
(
"."
,
""
))
/
Math
.
pow
(
10
,
m
)
}
}
// 除法获取精确值
// 除法获取精确值
Vue
.
prototype
.
accDiv
=
function
(
arg1
,
arg2
)
{
Vue
.
prototype
.
accDiv
=
function
(
arg1
,
arg2
)
{
var
t1
=
0
,
t2
=
0
,
r1
,
r2
;
var
t1
=
0
,
try
{
t1
=
arg1
.
toString
().
split
(
"."
)[
1
].
length
}
catch
(
e
)
{
}
t2
=
0
,
try
{
t2
=
arg2
.
toString
().
split
(
"."
)[
1
].
length
}
catch
(
e
)
{
}
r1
,
r2
;
try
{
t1
=
arg1
.
toString
().
split
(
"."
)[
1
].
length
}
catch
(
e
)
{}
try
{
t2
=
arg2
.
toString
().
split
(
"."
)[
1
].
length
}
catch
(
e
)
{}
Math
.
r1
=
Number
(
arg1
.
toString
().
replace
(
"."
,
""
))
Math
.
r1
=
Number
(
arg1
.
toString
().
replace
(
"."
,
""
))
Math
.
r2
=
Number
(
arg2
.
toString
().
replace
(
"."
,
""
))
Math
.
r2
=
Number
(
arg2
.
toString
().
replace
(
"."
,
""
))
return
(
Math
.
r1
/
Math
.
r2
)
*
Math
.
pow
(
10
,
t2
-
t1
);
return
(
Math
.
r1
/
Math
.
r2
)
*
Math
.
pow
(
10
,
t2
-
t1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment