Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-oss-account
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 fdff2951
authored
Jul 22, 2021
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
产品功能
1 parent
baaf9eb6
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
287 additions
and
12 deletions
package-lock.json
package.json
src/api/productManage.js
src/common/notice.js
src/common/util.js
src/views/productManage/functionList/index.vue
src/views/productManage/menuList/index.vue
src/views/productManage/productList/index.vue
package-lock.json
View file @
fdff295
...
...
@@ -5485,9 +5485,9 @@
}
},
"glsx-table"
:
{
"version"
:
"1.0.
1
"
,
"resolved"
:
"https://registry.npmjs.org/glsx-table/-/glsx-table-1.0.
1
.tgz"
,
"integrity"
:
"sha512-
FdSsdJbIGle5nFyVPUf7gA2ALgoHdjgsSInMNUoYzvM+rbPg1h7YmfWBR8y380DpiQ4fj4GQZ0BWKaxJvfKeew
=="
,
"version"
:
"1.0.
3
"
,
"resolved"
:
"https://registry.npmjs.org/glsx-table/-/glsx-table-1.0.
3
.tgz"
,
"integrity"
:
"sha512-
J0Ha1J1s3SOLurkZE3HRLF1EHFF3/LsD7eu0uEfJG+qZeobpBN0wXBs54kwisiUG/rBH46JxQ5hw9ABVhQvZgQ
=="
,
"requires"
:
{
"element-ui"
:
"^2.13.1"
,
"vue"
:
"^2.6.12"
...
...
@@ -7542,6 +7542,11 @@
"minimist"
:
"0.0.8"
}
},
"moment"
:
{
"version"
:
"2.29.1"
,
"resolved"
:
"https://registry.npmjs.org/moment/-/moment-2.29.1.tgz"
,
"integrity"
:
"sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
},
"move-concurrently"
:
{
"version"
:
"1.0.1"
,
"resolved"
:
"http://registry.npm.taobao.org/move-concurrently/download/move-concurrently-1.0.1.tgz"
,
...
...
package.json
View file @
fdff295
...
...
@@ -12,9 +12,10 @@
"dependencies"
:
{
"axios"
:
"^0.18.0"
,
"element-ui"
:
"^2.15.1"
,
"glsx-table"
:
"^1.0.
1
"
,
"glsx-table"
:
"^1.0.
3
"
,
"glsx-vue-common"
:
"^1.2.9"
,
"lodash"
:
"^4.17.10"
,
"moment"
:
"^2.29.1"
,
"node-sass"
:
"^4.9.3"
,
"sass-loader"
:
"^7.1.0"
,
"sha1"
:
"^1.1.1"
,
...
...
src/api/productManage.js
View file @
fdff295
import
request
from
'./request'
const
path
=
'cn.com.glsx.merchants.'
// 产品
export
const
productApi
=
{
/** 获取财务管理列表*/
getListApi
(
data
=
{})
{
data
.
method
=
'cn.com.glsx.merchants.product.findProductByPage'
data
.
method
=
`
${
path
}
product.findProductByPage`
return
request
(
data
)
}
}
// 菜单
export
const
menuApi
=
{
/** 获取财务管理列表*/
getListApi
(
data
=
{})
{
data
.
method
=
`
${
path
}
menu.findMerProMenuByPageRemote`
return
request
(
data
)
}
}
// 功能
export
const
functionApi
=
{
/** 获取财务管理列表*/
getListApi
(
data
=
{})
{
data
.
method
=
`
${
path
}
menu.findMerchantFunction`
return
request
(
data
)
}
}
src/common/notice.js
0 → 100644
View file @
fdff295
import
Vue
from
'vue'
export
default
new
Vue
({
methods
:
{
warningTips
(
message
)
{
this
.
$notify
({
type
:
'warning'
,
title
:
message
})
},
okTips
(
message
)
{
this
.
$notify
({
type
:
'success'
,
title
:
message
||
'操作成功'
})
},
errorTips
(
message
)
{
this
.
$notify
({
type
:
'error'
,
title
:
message
||
'操作失败'
})
}
}
})
src/common/util.js
0 → 100644
View file @
fdff295
import
Vue
from
'vue'
import
{
Message
,
MessageBox
,
Loading
}
from
'element-ui'
;
import
moment
from
'moment'
let
loadingInstance
=
''
export
const
Util
=
{
/**
* 简单alert
* title 标题
* message 内容
* className 自定义class
* showCancelButton 是否展示取消按钮
* confirmButtonText 确认按钮文案
* cancelButtonText 取消按钮文案
* confirmButtonColor 确认按钮颜色
* cancelButtonColor 取消按钮颜色
*/
msg
:
function
(
options
)
{
MessageBox
({
title
:
options
.
title
||
''
,
type
:
options
.
type
||
'error'
,
message
:
options
.
message
||
''
,
className
:
options
.
className
||
''
,
showCancelButton
:
options
.
showCancelButton
||
false
,
confirmButtonText
:
options
.
confirmButtonText
||
'确认'
,
cancelButtonText
:
options
.
cancelButtonText
||
'取消'
,
confirmButtonColor
:
options
.
confirmButtonColor
||
'#1989fa'
,
cancelButtonColor
:
options
.
cancelButtonColor
||
'#000'
,
dangerouslyUseHTMLString
:
true
,
callback
:
function
(
action
,
done
)
{
if
(
action
==
'confirm'
)
{
if
(
options
.
success
)
{
(
options
.
success
)(
done
)
}
}
else
{
console
.
log
(
done
);
// done()
}
}
});
/* Vue.$vux.alert.show({
title: options.title||'',
content: options.message||'',
onShow() {
options.onShow?(options.onShow)():'';
},
onHide() {
options.onHide?(options.onHide)():'';
}
}) */
},
/**
* 提示框
*/
Info
:
function
(
options
)
{
Message
({
message
:
options
.
message
||
'提示'
,
type
:
options
.
type
||
'error'
,
duration
:
options
.
time
||
2000
,
onClose
:
options
.
onClose
||
''
});
},
/**
* 轻提示
*/
Tips
:
function
(
options
)
{
Message
({
message
:
options
.
message
||
'提示'
,
duration
:
options
.
duration
||
3000
,
type
:
options
.
type
||
'text'
,
icon
:
options
.
icon
||
''
})
},
/**
* loading
*/
loading
:
function
(
message
)
{
loadingInstance
=
Loading
.
service
({
text
:
message
||
'加载中...'
});
},
/**
* 关闭loading
*/
closeLoading
:
function
()
{
loadingInstance
.
close
();
},
/**
* 校验手机号码格式
*/
checkPhone
:
function
(
mobile
)
{
let
myreg
=
/^
(
13
[
0-9
]
|15
[
0-9
]
|16
[
0-9
]
|17
[
0-9
]
|18
[
0-9
]
|19
[
0-9
]
|14
[
0-9
])[
0-9
]{8}
$/
;
return
myreg
.
test
(
mobile
);
},
/**
* 校验固定电话
*/
validationTel
:
function
(
tel
)
{
let
reg
=
/^0
[\d]{2,3}
-
[\d]{7,8}
$/
;
return
reg
.
test
(
tel
);
},
/**
* 是否特殊字符
*/
isSpecialLetter
:
function
(
str
)
{
let
reg
=
new
RegExp
(
"[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]"
);
return
reg
.
test
(
str
);
},
/**
* 只能输入英文字母和数字,不能输入中文
*/
validationInput
:
function
(
str
)
{
let
reg
=
/
[^\w\.\/]
/ig
;
return
reg
.
test
(
str
);
},
/**
* 获取当前时间
*/
getCurrentDate
:
function
()
{
let
time
=
new
Date
();
let
y
=
time
.
getFullYear
();
let
m
=
time
.
getMonth
()
+
1
;
let
d
=
time
.
getDate
();
return
{
date
:
y
+
'/'
+
m
+
'/'
+
d
}
},
/**
* 获取浏览器参数
*/
getUrlParams
:
function
(
name
)
{
let
vars
=
[],
hash
;
let
oParams
=
{};
let
hashes
=
window
.
location
.
href
.
slice
(
window
.
location
.
href
.
indexOf
(
'?'
)
+
1
).
split
(
'&'
);
for
(
let
i
=
0
;
i
<
hashes
.
length
;
i
++
)
{
hash
=
hashes
[
i
].
split
(
'='
);
vars
.
push
(
hash
[
0
]);
oParams
[
hash
[
0
]]
=
hash
[
1
];
}
console
.
log
(
vars
);
if
(
name
){
return
oParams
[
name
];
}
else
{
return
oParams
;
}
},
/**
* 根据当前时间,计算往后30天的日期
*/
getAfterDate
:
function
(
day
)
{
let
date1
=
new
Date
();
let
date2
=
new
Date
(
date1
);
let
time
=
30
;
if
(
day
)
{
time
=
day
;
}
date2
.
setDate
(
date1
.
getDate
()
+
time
);
let
_date
=
date2
.
getFullYear
()
+
'-'
+
(
date2
.
getMonth
()
+
1
)
+
'-'
+
date2
.
getDate
();
return
{
date
:
_date
,
year
:
date2
.
getFullYear
(),
month
:
date2
.
getMonth
()
+
1
,
day
:
date2
.
getDate
()
};
},
/**
* 日期格式转换
*/
dateFormate
:
function
(
str
,
type
)
{
let
txt
=
'YYYY-MM-DD'
if
(
type
)
{
txt
=
type
}
const
m
=
moment
(
str
).
format
(
txt
)
return
m
},
/**
* 字段截取
*/
cutStr
:
function
(
str
,
num
)
{
if
(
!
str
)
{
return
''
}
let
m
=
10
let
n
=
str
if
(
num
)
{
m
=
num
}
if
(
str
.
length
>
m
)
{
n
=
str
.
slice
(
0
,
m
)
+
'...'
}
return
n
}
}
src/views/productManage/functionList/index.vue
View file @
fdff295
...
...
@@ -22,6 +22,7 @@
ref=
"functionTable"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:pageConf=
"pageConf"
:getListApi=
"getListApi"
>
<el-button
...
...
@@ -52,6 +53,7 @@
<
script
>
import
_
from
'lodash'
import
{
functionApi
}
from
'@/api/productManage'
export
default
{
name
:
'functionList'
,
data
()
{
...
...
@@ -114,11 +116,12 @@ export default {
this
.
searchSelectObj
.
funcOrName
.
value
=
''
}
}],
getListApi
:
''
,
getListApi
:
functionApi
.
getListApi
,
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNumer'
,
totalCount
:
'data.totalCount'
},
// 表格参数
tableParams
:
{
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
listName
:
'
list
'
,
listName
:
'
data.data
'
,
tableOption
:
true
,
tableColumns
:
[{
label
:
'功能名称'
,
...
...
src/views/productManage/menuList/index.vue
View file @
fdff295
...
...
@@ -28,6 +28,7 @@
<glsx-table
ref=
"menuTable"
:searchForm=
"searchForm"
:pageConf=
"pageConf"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
>
...
...
@@ -59,6 +60,8 @@
<
script
>
import
_
from
'lodash'
import
{
Util
}
from
'@/common/util'
import
{
menuApi
}
from
'@/api/productManage'
export
default
{
name
:
'menuList'
,
data
()
{
...
...
@@ -83,11 +86,12 @@ export default {
isClear
:
true
,
keyFn
:
this
.
keyDowmGetList
}],
getListApi
:
''
,
getListApi
:
menuApi
.
getListApi
,
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNumer'
,
totalCount
:
'data.totalCount'
},
// 表格参数
tableParams
:
{
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
listName
:
'
list
'
,
listName
:
'
data.data
'
,
tableOption
:
true
,
tableColumns
:
[{
label
:
'菜单名称'
,
...
...
@@ -109,7 +113,10 @@ export default {
prop
:
''
},
{
label
:
'更新时间'
,
prop
:
''
prop
:
'updatedTime'
,
formatter
:
cellValue
=>
{
return
cellValue
.
updatedTime
?
Util
.
dateFormate
(
cellValue
.
updatedTime
,
'YYYY-MM-DD HH:mm:ss'
)
:
''
}
}]
},
// 弹窗
...
...
src/views/productManage/productList/index.vue
View file @
fdff295
...
...
@@ -25,7 +25,7 @@
</glsx-combi-form>
</el-col>
</el-row>
<
d2
-table
<
glsx
-table
ref=
"productTable"
:searchForm=
"searchForm"
:pageConf=
"pageConf"
...
...
@@ -36,7 +36,7 @@
slot=
"auth-button"
type=
"text"
>
修改
</el-button>
</
d2
-table>
</
glsx
-table>
<glsx-dialog
:title=
"title"
:isVisible=
"editVisible"
...
...
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