Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
gh
/
data-view
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 682f096f
authored
Jun 23, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交代码
1 parent
207a581a
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
92 additions
and
185 deletions
package.json
src/api/index.js
src/api/wxConfig.js
src/components/ViewContentLeft.vue
src/components/ViewContentRight.vue
src/components/ViewLineGroup.vue
src/main.js
src/plugins/vant.js
src/utils/util.js
vue.config.js
package.json
View file @
682f096
...
@@ -16,17 +16,14 @@
...
@@ -16,17 +16,14 @@
"core-js"
:
"^3.6.4"
,
"core-js"
:
"^3.6.4"
,
"dayjs"
:
"^1.10.5"
,
"dayjs"
:
"^1.10.5"
,
"echarts"
:
"^5.3.3"
,
"echarts"
:
"^5.3.3"
,
"glsx-common"
:
"^1.4.9"
,
"lib-flexible"
:
"^0.3.2"
,
"lib-flexible"
:
"^0.3.2"
,
"postcss-loader"
:
"^6.2.0"
,
"postcss-loader"
:
"^6.2.0"
,
"sha1"
:
"^1.1.1"
,
"sha1"
:
"^1.1.1"
,
"storejs"
:
"^1.1.0"
,
"storejs"
:
"^1.1.0"
,
"vant"
:
"^2.12.21"
,
"vconsole"
:
"^3.7.0"
,
"vconsole"
:
"^3.7.0"
,
"vue"
:
"^2.6.11"
,
"vue"
:
"^2.6.11"
,
"vue-router"
:
"^3.2.0"
,
"vue-router"
:
"^3.2.0"
,
"vuex"
:
"^3.4.0"
,
"vuex"
:
"^3.4.0"
"webpack-spritesmith"
:
"^1.1.0"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"@vue/cli-plugin-babel"
:
"~4.5.0"
,
"@vue/cli-plugin-babel"
:
"~4.5.0"
,
...
...
src/api/index.js
View file @
682f096
...
@@ -7,8 +7,6 @@
...
@@ -7,8 +7,6 @@
* @LastEditTime: 2021-06-17 18:23:27
* @LastEditTime: 2021-06-17 18:23:27
*/
*/
import
wwbenchApi
from
'./wwbenchApi'
import
wwbenchApi
from
'./wwbenchApi'
import
wxConfig
from
'./wxConfig'
export
{
export
{
wwbenchApi
,
wwbenchApi
,
wxConfig
,
}
}
\ No newline at end of file
\ No newline at end of file
src/api/wxConfig.js
View file @
682f096
import
util
from
'@/utils/util'
import
util
from
'@/utils/util'
import
{
Notify
}
from
'vant'
//
import { Notify } from 'vant'
const
url
=
'/rop-scrm-wechat/router'
const
url
=
'/rop-scrm-wechat/router'
const
WxConfig
=
{
const
WxConfig
=
{
init
(
jsApiList
)
{
init
(
jsApiList
)
{
...
@@ -44,7 +44,7 @@ const WxConfig = {
...
@@ -44,7 +44,7 @@ const WxConfig = {
})
})
},
500
)
},
500
)
}
else
{
}
else
{
Notify
(
'网络异常'
)
//
Notify('网络异常')
}
}
})
})
})
})
...
@@ -205,7 +205,7 @@ const WxConfig = {
...
@@ -205,7 +205,7 @@ const WxConfig = {
},
},
fail
(
res
)
{
fail
(
res
)
{
if
(
res
.
errMsg
.
indexOf
(
'function not exist'
)
>
-
1
)
{
if
(
res
.
errMsg
.
indexOf
(
'function not exist'
)
>
-
1
)
{
Notify
(
'版本过低请升级'
)
//
Notify('版本过低请升级')
}
}
reject
()
reject
()
}
}
...
...
src/components/ViewContentLeft.vue
View file @
682f096
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
</div>
</div>
<div
class=
"bottom"
>
<div
class=
"bottom"
>
<view-sub-title
title=
"销售数据总览"
/>
<view-sub-title
title=
"销售数据总览"
/>
<view-line-group
height=
"14.9vh"
/>
<view-pie-group
/>
<view-pie-group
/>
</div>
</div>
</div>
</div>
...
...
src/components/ViewContentRight.vue
View file @
682f096
<
template
>
<
template
>
<div
class=
"right"
>
<div
class=
"right"
>
<view-sub-title
title=
"售后数据总览"
/>
<view-sub-title
title=
"售后数据总览"
/>
<view-line-group
/>
<view-line-group
/>
<view-line-group
/>
<view-line-group
height=
"25.6vh"
hideMargin
/>
</div>
</div>
</
template
>
</
template
>
...
@@ -20,6 +24,5 @@ export default {
...
@@ -20,6 +24,5 @@ export default {
<
style
scoped
lang=
'scss'
>
<
style
scoped
lang=
'scss'
>
.right
{
.right
{
background
:
#fff
;
}
}
</
style
>
</
style
>
\ No newline at end of file
\ No newline at end of file
src/components/ViewLineGroup.vue
0 → 100644
View file @
682f096
<
template
>
<div
class=
"line-group"
>
<template
v-for=
"(i,index) in items"
>
<div
class=
"box"
:key=
"index"
:style=
"[
{'height':height},{'margin-bottom':hideMargin?0:'1vh'}]"
>
</div>
</
template
>
</div>
</template>
<
script
type=
'text/ecmascript-6'
>
export
default
{
name
:
'ViewLineGroup'
,
props
:
{
height
:
{
type
:
String
,
default
:
'19.8vh'
},
hideMargin
:
Boolean
},
data
()
{
return
{
items
:
[
1
,
2
]
}
},
mounted
()
{
},
methods
:
{
}
}
</
script
>
<
style
scoped
lang=
'scss'
>
.line-group
{
display
:
grid
;
grid-template-columns
:
repeat
(
2
,
1
fr
);
gap
:
0
8px
;
}
</
style
>
\ No newline at end of file
\ No newline at end of file
src/main.js
View file @
682f096
...
@@ -20,8 +20,6 @@ import { fetchConfig, cfg } from '@/config'
...
@@ -20,8 +20,6 @@ import { fetchConfig, cfg } from '@/config'
import
'@/assets/css/index.scss'
import
'@/assets/css/index.scss'
import
'./utils/util'
import
'./utils/util'
import
'components'
import
'components'
import
{
components
}
from
'@/plugins/vant'
components
.
forEach
(
component
=>
Vue
.
use
(
component
))
Vue
.
prototype
.
api
=
api
Vue
.
prototype
.
api
=
api
Vue
.
prototype
.
to
=
function
(
name
,
params
)
{
Vue
.
prototype
.
to
=
function
(
name
,
params
)
{
if
(
name
===
-
1
)
{
if
(
name
===
-
1
)
{
...
...
src/plugins/vant.js
deleted
100644 → 0
View file @
207a581
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-23 11:44:59
*/
// 按需全局引入 vant组件
import
{
Button
,
List
,
Cell
,
Tabbar
,
TabbarItem
,
NavBar
,
Lazyload
,
Toast
,
Search
,
ActionSheet
,
CellGroup
,
Image
as
VanImage
,
Tag
,
Field
,
Stepper
,
Divider
,
Step
,
Steps
,
NoticeBar
,
RadioGroup
,
Radio
,
Uploader
,
Tab
,
Tabs
,
DropdownMenu
,
DropdownItem
,
Grid
,
GridItem
,
Popup
,
Calendar
,
Cascader
,
Checkbox
,
CheckboxGroup
,
Notify
,
Icon
,
Empty
,
PullRefresh
,
Picker
,
Dialog
}
from
'vant'
export
const
components
=
[
Button
,
List
,
Cell
,
Tabbar
,
TabbarItem
,
NavBar
,
Search
,
ActionSheet
,
CellGroup
,
VanImage
,
Tag
,
Field
,
Stepper
,
Divider
,
Step
,
Steps
,
NoticeBar
,
RadioGroup
,
Radio
,
Uploader
,
Tab
,
Tabs
,
DropdownMenu
,
DropdownItem
,
Grid
,
GridItem
,
Popup
,
Calendar
,
Cascader
,
Checkbox
,
CheckboxGroup
,
Notify
,
Icon
,
Empty
,
PullRefresh
,
Picker
,
Dialog
]
src/utils/util.js
View file @
682f096
...
@@ -8,7 +8,7 @@ import {
...
@@ -8,7 +8,7 @@ import {
* 日期格式化
* 日期格式化
* let time = new Date().format('yyyy-MM-dd hh:mm:ss')
* let time = new Date().format('yyyy-MM-dd hh:mm:ss')
*/
*/
Date
.
prototype
.
format
=
function
(
fmt
)
{
Date
.
prototype
.
format
=
function
(
fmt
)
{
let
o
=
{
let
o
=
{
'M+'
:
this
.
getMonth
()
+
1
,
//月份
'M+'
:
this
.
getMonth
()
+
1
,
//月份
'd+'
:
this
.
getDate
(),
//日
'd+'
:
this
.
getDate
(),
//日
...
@@ -34,49 +34,49 @@ const throttle = (fn, gapTime) => {
...
@@ -34,49 +34,49 @@ const throttle = (fn, gapTime) => {
gapTime
=
1500
gapTime
=
1500
}
}
let
_lastTime
=
null
let
_lastTime
=
null
return
function
()
{
return
function
()
{
let
_nowTime
=
+
new
Date
()
let
_nowTime
=
+
new
Date
()
if
(
_nowTime
-
_lastTime
>
gapTime
||
!
_lastTime
)
{
if
(
_nowTime
-
_lastTime
>
gapTime
||
!
_lastTime
)
{
fn
.
apply
(
this
,
arguments
)
fn
.
apply
(
this
,
arguments
)
_lastTime
=
_nowTime
_lastTime
=
_nowTime
}
}
}
}
}
}
/**防止重复点击 */
/**防止重复点击 */
const
showLoading
=
(
title
=
'加载中...'
,
callBack
,
custom
)
=>
{
const
showLoading
=
(
title
=
'加载中...'
,
callBack
,
custom
)
=>
{
Toast
({
//
Toast({
type
:
'loading'
,
//
type: 'loading',
message
:
title
,
//
message: title,
forbidClick
:
true
,
//
forbidClick: true,
duration
:
0
//
duration: 0
})
//
})
if
(
callBack
&&
typeof
callBack
==
'function'
)
{
//
if (callBack && typeof callBack == 'function') {
if
(
!
custom
)
Toast
.
clear
()
//
if (!custom) Toast.clear()
callBack
()
//
callBack()
}
//
}
}
}
const
hideLoading
=
()
=>
{
const
hideLoading
=
()
=>
{
Toast
.
clear
()
//
Toast.clear()
}
}
/**num:要转换的数值,fixed:精确几位小数 */
/**num:要转换的数值,fixed:精确几位小数 */
const
decimal
=
(
num
,
fixed
)
=>
{
const
decimal
=
(
num
,
fixed
)
=>
{
let
pow
=
Math
.
pow
(
10
,
fixed
)
let
pow
=
Math
.
pow
(
10
,
fixed
)
return
Math
.
round
(
num
*
pow
)
/
pow
return
Math
.
round
(
num
*
pow
)
/
pow
}
}
const
showToast
=
(
message
=
''
,
callBack
)
=>
{
const
showToast
=
(
message
=
''
,
callBack
)
=>
{
let
params
=
{
//
let params = {
message
,
//
message,
forbidClick
:
true
,
//
forbidClick: true,
duration
:
1500
//
duration: 1500
}
//
}
Toast
(
params
)
//
Toast(params)
if
(
callBack
&&
typeof
callBack
==
'function'
)
{
//
if (callBack && typeof callBack == 'function') {
setTimeout
(()
=>
{
//
setTimeout(() => {
callBack
()
//
callBack()
},
1500
)
//
}, 1500)
}
//
}
}
}
/**触摸样式 */
/**触摸样式 */
const
touchstart
=
e
=>
{
const
touchstart
=
e
=>
{
e
.
target
.
classList
.
add
(
'btn-on-leave'
)
e
.
target
.
classList
.
add
(
'btn-on-leave'
)
}
}
...
@@ -106,10 +106,10 @@ const removeLocalStorage = key => {
...
@@ -106,10 +106,10 @@ const removeLocalStorage = key => {
// sessionStorage.removeItem(key)
// sessionStorage.removeItem(key)
}
}
const
dialog
=
(
params
=
{})
=>
{
const
dialog
=
(
params
=
{})
=>
{
if
(
!
params
.
confirmButtonColor
)
params
.
confirmButtonColor
=
'#FF7336'
//
if (!params.confirmButtonColor) params.confirmButtonColor = '#FF7336'
return
Dialog
.
confirm
(
params
)
//
return Dialog.confirm(params)
}
}
/**拨打电话 */
/**拨打电话 */
const
makePhoneCall
=
phoneNumber
=>
{
const
makePhoneCall
=
phoneNumber
=>
{
window
.
location
.
href
=
`tel://
${
phoneNumber
}
`
window
.
location
.
href
=
`tel://
${
phoneNumber
}
`
}
}
...
@@ -137,18 +137,18 @@ const setClipboardData = data => {
...
@@ -137,18 +137,18 @@ const setClipboardData = data => {
transfer
.
select
()
transfer
.
select
()
if
(
document
.
execCommand
(
'copy'
))
document
.
execCommand
(
'copy'
)
if
(
document
.
execCommand
(
'copy'
))
document
.
execCommand
(
'copy'
)
transfer
.
blur
()
transfer
.
blur
()
Toast
(
'内容已复制'
)
//
Toast('内容已复制')
document
.
body
.
removeChild
(
transfer
)
document
.
body
.
removeChild
(
transfer
)
}
}
/**接口请求时失败让用户刷新 */
/**接口请求时失败让用户刷新 */
const
refreshPage
=
(
message
=
'系统异常'
)
=>
{
const
refreshPage
=
(
message
=
'系统异常'
)
=>
{
return
Dialog
.
alert
({
//
return Dialog.alert({
message
,
//
message,
theme
:
'round-button'
,
//
theme: 'round-button',
confirmButtonText
:
'点击重试'
,
//
confirmButtonText: '点击重试',
confirmButtonColor
:
'#FF7336'
//
confirmButtonColor: '#FF7336'
})
//
})
}
}
const
toTop
=
()
=>
{
const
toTop
=
()
=>
{
let
bodySrcollTop
=
document
.
body
.
scrollTop
let
bodySrcollTop
=
document
.
body
.
scrollTop
...
...
vue.config.js
View file @
682f096
...
@@ -9,19 +9,6 @@ const name = defaultSettings.title || 'vue mobile template'
...
@@ -9,19 +9,6 @@ const name = defaultSettings.title || 'vue mobile template'
// 生产环境,测试和正式
// 生产环境,测试和正式
const
IS_PROD
=
[
'production'
,
'prod'
].
includes
(
process
.
env
.
NODE_ENV
)
const
IS_PROD
=
[
'production'
,
'prod'
].
includes
(
process
.
env
.
NODE_ENV
)
/**
* 雪碧图插件
*/
const
SpritesmithPlugin
=
require
(
'webpack-spritesmith'
)
const
spritesmithFunction
=
data
=>
{
let
{
spritesheet
,
sprites
}
=
data
let
shared
=
`.sprite-icon { background-image: url(
${
data
.
sprites
[
0
].
image
}
);background-size:
${
spritesheet
.
width
/
2
}
px
${
spritesheet
.
height
/
2
}
px;}`
let
perSprite
=
sprites
.
map
(
sprite
=>
{
let
{
name
,
width
,
height
,
offset_x
,
offset_y
}
=
sprite
return
`.icon-
${
name
}
{ width:
${
width
/
2
}
px; height:
${
height
/
2
}
px; background-position:
${
offset_x
/
2
}
px
${
offset_y
/
2
}
px;}`
}).
join
(
'\n'
)
return
`
${
shared
}
\n
${
perSprite
}
`
}
module
.
exports
=
{
module
.
exports
=
{
publicPath
:
IS_PROD
?
'./'
:
'/dj-scrm-wx-work-lwk/'
,
// 署应用包时的基本 URL。 vue-router hash 模式使用
publicPath
:
IS_PROD
?
'./'
:
'/dj-scrm-wx-work-lwk/'
,
// 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: '/dj-scrm-wx-work-main/', // 署应用包时的基本 URL。 vue-router history模式使用 微信开发环境需打开
// publicPath: '/dj-scrm-wx-work-main/', // 署应用包时的基本 URL。 vue-router history模式使用 微信开发环境需打开
...
@@ -68,34 +55,6 @@ module.exports = {
...
@@ -68,34 +55,6 @@ module.exports = {
config
.
name
=
name
config
.
name
=
name
config
.
resolve
.
modules
=
[
'node_modules'
,
'./src/assets/spritesmith'
]
config
.
resolve
.
modules
=
[
'node_modules'
,
'./src/assets/spritesmith'
]
const
Plugins
=
[
const
Plugins
=
[
new
SpritesmithPlugin
({
// 引入图片文件夹
src
:
{
cwd
:
path
.
resolve
(
__dirname
,
'./src/assets/spritesmith'
),
glob
:
[
'*.png'
,
'*.jpg'
]
},
// 生成图片的路径
target
:
{
image
:
path
.
resolve
(
__dirname
,
'./src/assets/images/sprite.png'
),
// 生成SCSS
css
:
[
[
path
.
resolve
(
__dirname
,
'./src/assets/css/sprite.scss'
),
{
format
:
'function_based_template'
}]
]
},
customTemplates
:
{
'function_based_template'
:
spritesmithFunction
,
},
//background引用路径
apiOptions
:
{
cssImageRef
:
'../images/sprite.png'
},
// 每个图片间距
spritesmithOptions
:
{
padding
:
20
}
})
]
]
config
.
plugins
=
[...
config
.
plugins
,
...
Plugins
]
config
.
plugins
=
[...
config
.
plugins
,
...
Plugins
]
// 为生产环境修改配置...
// 为生产环境修改配置...
...
...
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