Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-finance
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1e11d13c
authored
Sep 11, 2023
by
王琦琳
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'v4.27.0' into 'develop'
V4.27.0 See merge request
!5
2 parents
fbe13977
95caa796
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
63 deletions
src/common/util.js
src/common/util.js
View file @
1e11d13
// import Vue from 'vue'
// import Vue from 'vue'
import
{
Message
,
MessageBox
,
Loading
}
from
'element-ui'
//
import { Message, MessageBox, Loading } from 'element-ui'
// import moment from 'moment'
// import moment from 'moment'
import
dayjs
from
'dayjs'
import
dayjs
from
'dayjs'
let
loadingInstance
=
''
let
loadingInstance
=
''
...
@@ -16,81 +16,81 @@ export const Util = {
...
@@ -16,81 +16,81 @@ export const Util = {
* confirmButtonColor 确认按钮颜色
* confirmButtonColor 确认按钮颜色
* cancelButtonColor 取消按钮颜色
* cancelButtonColor 取消按钮颜色
*/
*/
msg
:
function
(
options
)
{
//
msg: function(options) {
MessageBox
({
//
MessageBox({
title
:
options
.
title
||
''
,
//
title: options.title || '',
type
:
options
.
type
||
'error'
,
//
type: options.type || 'error',
message
:
options
.
message
||
''
,
//
message: options.message || '',
className
:
options
.
className
||
''
,
//
className: options.className || '',
showCancelButton
:
options
.
showCancelButton
||
false
,
//
showCancelButton: options.showCancelButton || false,
confirmButtonText
:
options
.
confirmButtonText
||
'确认'
,
//
confirmButtonText: options.confirmButtonText || '确认',
cancelButtonText
:
options
.
cancelButtonText
||
'取消'
,
//
cancelButtonText: options.cancelButtonText || '取消',
confirmButtonColor
:
options
.
confirmButtonColor
||
'#1989fa'
,
//
confirmButtonColor: options.confirmButtonColor || '#1989fa',
cancelButtonColor
:
options
.
cancelButtonColor
||
'#000'
,
//
cancelButtonColor: options.cancelButtonColor || '#000',
dangerouslyUseHTMLString
:
true
,
//
dangerouslyUseHTMLString: true,
callback
:
function
(
action
,
done
)
{
//
callback: function(action, done) {
if
(
action
==
'confirm'
)
{
//
if (action == 'confirm') {
if
(
options
.
success
)
{
//
if (options.success) {
options
.
success
(
done
)
//
options.success(done)
}
//
}
}
else
{
//
} else {
console
.
log
(
done
)
//
console.log(done)
// done()
//
// done()
}
//
}
}
//
}
})
//
})
/* Vue.$vux.alert.show({
//
/* Vue.$vux.alert.show({
title: options.title||'',
//
title: options.title||'',
content: options.message||'',
//
content: options.message||'',
onShow() {
//
onShow() {
options.onShow?(options.onShow)():'';
//
options.onShow?(options.onShow)():'';
},
//
},
onHide() {
//
onHide() {
options.onHide?(options.onHide)():'';
//
options.onHide?(options.onHide)():'';
}
//
}
}) */
//
}) */
},
//
},
/**
/**
* 提示框
* 提示框
*/
*/
Info
:
function
(
options
)
{
//
Info: function(options) {
Message
({
//
Message({
message
:
options
.
message
||
'提示'
,
//
message: options.message || '提示',
type
:
options
.
type
||
'error'
,
//
type: options.type || 'error',
duration
:
options
.
time
||
2000
,
//
duration: options.time || 2000,
onClose
:
options
.
onClose
||
''
//
onClose: options.onClose || ''
})
//
})
},
//
},
/**
/**
* 轻提示
* 轻提示
*/
*/
Tips
:
function
(
options
)
{
//
Tips: function(options) {
Message
({
//
Message({
message
:
options
.
message
||
'提示'
,
//
message: options.message || '提示',
duration
:
options
.
duration
||
3000
,
//
duration: options.duration || 3000,
type
:
options
.
type
||
'text'
,
//
type: options.type || 'text',
icon
:
options
.
icon
||
''
//
icon: options.icon || ''
})
//
})
},
//
},
/**
/**
* loading
* loading
*/
*/
loading
:
function
(
message
)
{
//
loading: function(message) {
loadingInstance
=
Loading
.
service
({
//
loadingInstance = Loading.service({
text
:
message
||
'加载中...'
//
text: message || '加载中...'
})
//
})
},
//
},
/**
/**
* 关闭loading
* 关闭loading
*/
*/
closeLoading
:
function
()
{
//
closeLoading: function() {
loadingInstance
.
close
()
//
loadingInstance.close()
},
//
},
/**
/**
* 校验手机号码格式
* 校验手机号码格式
...
@@ -332,10 +332,10 @@ export const Util = {
...
@@ -332,10 +332,10 @@ export const Util = {
}
}
}
}
export
const
showModal
=
Util
.
msg
//
export const showModal = Util.msg
export
const
showToast
=
Util
.
Info
//
export const showToast = Util.Info
export
const
showLoading
=
Util
.
loading
//
export const showLoading = Util.loading
export
const
hideLoading
=
Util
.
closeLoading
//
export const hideLoading = Util.closeLoading
export
const
deepClone
=
Util
.
deepClone
export
const
deepClone
=
Util
.
deepClone
export
const
downLoadFile
=
Util
.
downLoadFile
export
const
downLoadFile
=
Util
.
downLoadFile
export
const
returnFloat
=
Util
.
returnFloat
export
const
returnFloat
=
Util
.
returnFloat
Write
Preview
Markdown
is supported
Attach a file
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 post a comment