Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-business
/
develop-platform
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 522ce35c
authored
Dec 21, 2020
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改
1 parent
99c24530
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
332 additions
and
177 deletions
src/api/api.js
src/api/request.js
src/api/sys.base.js
src/components/d2-table/index.vue
src/plugin/axios/index.js
src/router/routes.js
src/store/modules/d2admin/modules/base.js
src/views/apiManage/apiList.vue
src/views/apiManage/apiRecord.vue
src/views/appMarket/appMarket.vue
src/views/customer/customer.vue
src/views/device/device.vue
src/views/user/user.vue
src/api/api.js
0 → 100644
View file @
522ce35
import
request
from
'./request'
export
const
BASE_DATA_URL
=
'fims.configuration.from.conftype'
// 客户管理
export
function
customerList
(
data
)
{
data
.
method
=
'customermgr/getCustomerMgrList'
return
request
(
data
)
}
// 设备管理
export
function
deviceList
(
data
)
{
data
.
method
=
'devicemgr/getDeviceMgrList'
return
request
(
data
)
}
// 获取客户名称下拉列表
export
function
userDropList
(
data
)
{
data
.
method
=
'usermgr/getDropDownOptions'
return
request
(
data
)
}
// 获取客户名称、设备类型下拉列表
export
function
userDeviceDropList
(
data
)
{
data
.
method
=
'devicemgr/getDropDownOptions'
return
request
(
data
)
}
// 用户管理
export
function
userList
(
data
)
{
data
.
method
=
'usermgr/getUserMgrList'
return
request
(
data
)
}
// API列表
export
function
apiList
(
data
)
{
data
.
method
=
'apimgr/getApiMgrList'
return
request
(
data
)
}
// API调用记录
export
function
apiRecordList
(
data
)
{
data
.
method
=
'apicallmgr/getApiCallMgrList'
return
request
(
data
)
}
// APP营销
export
function
appMarketList
(
data
)
{
data
.
method
=
'admgr/getAdMgrList'
return
request
(
data
)
}
src/api/request.js
View file @
522ce35
...
@@ -2,37 +2,42 @@
...
@@ -2,37 +2,42 @@
* @Author: limin
* @Author: limin
* @Date: 2019-08-26 18:02:41
* @Date: 2019-08-26 18:02:41
* @Last Modified by: chenwq
* @Last Modified by: chenwq
* @Last Modified time: 2020-1
1-27 22:22:02
* @Last Modified time: 2020-1
2-18 15:29:30
*/
*/
import
axios
from
'@/plugin/axios'
import
axios
from
'@/plugin/axios'
import
sign
from
'./sign'
//
import sign from './sign'
import
RequestMethods
from
'./request.methods'
import
RequestMethods
from
'./request.methods'
import
util
from
'@/libs/util.js'
// import util from '@/libs/util.js'
import
{
baseConfig
}
from
'@/main'
const
request
=
(
params
=
{},
method
=
RequestMethods
.
GET
,
noSignAttr
=
[])
=>
{
const
request
=
(
params
=
{},
method
=
RequestMethods
.
GET
,
noSignAttr
=
[])
=>
{
// params.source = 'glsx'
// params.source = 'glsx'
params
.
appKey
=
window
.
location
.
href
.
includes
(
'dj.glsx.com.cn'
)
?
'd7ffc3346fc9a45bccaaa35300d59022'
:
'48e5e13229b82c1b4e6e8c96151f0637'
//
params.appKey = window.location.href.includes('dj.glsx.com.cn') ? 'd7ffc3346fc9a45bccaaa35300d59022' : '48e5e13229b82c1b4e6e8c96151f0637'
params
.
timestamp
=
new
Date
().
getTime
()
//
params.timestamp = new Date().getTime()
params
.
v
=
'1.0.0'
//
params.v = '1.0.0'
params
.
format
=
'json'
//
params.format = 'json'
params
.
locale
=
'zh_CN'
//
params.locale = 'zh_CN'
if
(
params
.
method
!==
'dj.api.user.login'
)
{
//
if (params.method !== 'dj.api.user.login') {
params
.
sessionId
=
util
.
cookies
.
get
(
'token'
)
//
params.sessionId = util.cookies.get('token')
}
//
}
/**
/**
* mock - url = params.method
* mock - url = params.method
* 调后端接口 - url = ''
* 调后端接口 - url = ''
*/
*/
const
url
=
params
.
method
// ''
const
url
=
baseConfig
.
axios
.
baseURL
+
params
.
method
/**
/**
* 调后端接口,请使用以下代码。
* 调后端接口,请使用以下代码。
*/
*/
var
reqData
=
(
method
===
RequestMethods
.
POST
)
?
{
var
reqData
=
(
method
===
RequestMethods
.
POST
)
?
{
// baseURL: process.env.VUE_APP_API + '?method=' + params.method,
// baseURL: process.env.VUE_APP_API + '?method=' + params.method,
baseURL
:
process
.
env
.
VUE_APP_API
,
// baseURL: process.env.VUE_APP_API,
data
:
sign
(
params
,
noSignAttr
)
// data: sign(params, noSignAttr)
data
:
params
}
:
{
}
:
{
params
:
sign
(
params
,
noSignAttr
)
// params: sign(params, noSignAttr)
params
:
params
}
}
return
axios
({
return
axios
({
url
,
url
,
...
...
src/api/sys.base.js
View file @
522ce35
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: limin
* @Author: limin
* @Date: 2019-08-26 18:02:55
* @Date: 2019-08-26 18:02:55
* @Last Modified by: chenwq
* @Last Modified by: chenwq
* @Last Modified time: 2020-1
1-12 14:56:05
* @Last Modified time: 2020-1
2-18 15:23:40
*/
*/
import
request
from
'./request'
import
request
from
'./request'
...
...
src/components/d2-table/index.vue
View file @
522ce35
...
@@ -283,7 +283,7 @@ export default {
...
@@ -283,7 +283,7 @@ export default {
}
}
})
})
}
}
this
.
total
=
res
.
total
this
.
total
=
res
.
page
.
total
this
.
loading
=
false
this
.
loading
=
false
}).
catch
(()
=>
{
}).
catch
(()
=>
{
this
.
loading
=
false
this
.
loading
=
false
...
...
src/plugin/axios/index.js
View file @
522ce35
...
@@ -71,7 +71,6 @@ service.interceptors.request.use(
...
@@ -71,7 +71,6 @@ service.interceptors.request.use(
// })
// })
// }
// }
// config.url = baseConfig.axios.baseURL + config.url
// config.url = baseConfig.axios.baseURL + config.url
config
.
url
=
baseConfig
.
axios
.
baseURL
// config.timeout = baseConfig.axios.timeout
// config.timeout = baseConfig.axios.timeout
resolve
(
config
)
resolve
(
config
)
})
})
...
@@ -92,13 +91,6 @@ service.interceptors.response.use(
...
@@ -92,13 +91,6 @@ service.interceptors.response.use(
const
ruleResult
=
baseConfig
.
axios
.
result
const
ruleResult
=
baseConfig
.
axios
.
result
// 这个状态码是和后端约定的
// 这个状态码是和后端约定的
// 有 code 代表这是一个后端接口 可以进行进一步的判断
// 有 code 代表这是一个后端接口 可以进行进一步的判断
var
goBackArr
=
[
'20'
,
'21'
]
if
(
goBackArr
.
includes
(
dataAxios
[
ruleResult
.
code_key
]))
{
// await store.dispatch('d2admin/account/logout')
util
.
cookies
.
remove
(
'token'
)
router
.
replace
(
'/login'
)
return
}
switch
(
+
dataAxios
[
ruleResult
.
code_key
])
{
switch
(
+
dataAxios
[
ruleResult
.
code_key
])
{
case
ruleResult
.
code_success_value
:
case
ruleResult
.
code_success_value
:
// [ 示例 ] code === 0 代表没有错误
// [ 示例 ] code === 0 代表没有错误
...
...
src/router/routes.js
View file @
522ce35
...
@@ -134,6 +134,17 @@ export const resources = {
...
@@ -134,6 +134,17 @@ export const resources = {
parentId
:
'105'
,
parentId
:
'105'
,
cache
:
true
cache
:
true
},
},
auth
:
[{
authId
:
'1050101'
,
parentId
:
'10501'
,
label
:
'启用'
,
handle
:
'handleUpOrDown'
,
ruleObj
:
{
attr
:
'status'
,
rule
:
{
0
:
'启用'
,
1
:
'停用'
}
}
}
],
component
:
_import
(
'apiManage/apiList'
)
component
:
_import
(
'apiManage/apiList'
)
},
},
'10502'
:
{
'10502'
:
{
...
@@ -172,7 +183,7 @@ export const resources = {
...
@@ -172,7 +183,7 @@ export const resources = {
handle
:
'handleEdit'
handle
:
'handleEdit'
},
{
},
{
authId
:
'10603'
,
authId
:
'10603'
,
parentId
:
'10
701
'
,
parentId
:
'10
6
'
,
label
:
'下架'
,
label
:
'下架'
,
handle
:
'handleUpOrDown'
,
handle
:
'handleUpOrDown'
,
ruleObj
:
{
ruleObj
:
{
...
...
src/store/modules/d2admin/modules/base.js
View file @
522ce35
...
@@ -2,27 +2,18 @@
...
@@ -2,27 +2,18 @@
* @Author: limin
* @Author: limin
* @Date: 2019-09-01 17:56:57
* @Date: 2019-09-01 17:56:57
* @Last Modified by: chenwq
* @Last Modified by: chenwq
* @Last Modified time: 2020-1
1-15 10:22:06
* @Last Modified time: 2020-1
2-17 15:30:09
*/
*/
import
{
// import { FetchRoleList } from '@/api/sys.base'
getChannelType
,
// const map = {
getProductType
// [BaseData.ROLE.KEY]: FetchRoleList,
}
from
'@/api/sys.base'
// }
import
{
BaseData
}
from
'@/common/constants'
const
map
=
{
[
BaseData
.
channelType
]:
getChannelType
,
[
BaseData
.
productType
]:
getProductType
}
export
default
{
export
default
{
namespaced
:
true
,
namespaced
:
true
,
state
:
{
state
:
{
// 渠道类型
// // 角色
channelType
:
[],
// role: [],
// 产品分类
productType
:
[]
},
},
actions
:
{
actions
:
{
/**
/**
...
@@ -30,38 +21,22 @@ export default {
...
@@ -30,38 +21,22 @@ export default {
* 每次登录会强制 初始化
* 每次登录会强制 初始化
* @param {*} param0
* @param {*} param0
*/
*/
init
({
init
({
state
,
dispatch
,
commit
})
{
state
,
dispatch
,
commit
})
{
return
new
Promise
(
async
resolve
=>
{
return
new
Promise
(
async
resolve
=>
{
Promise
.
all
([
// Promise.all([
getChannelType
({}),
// FetchRoleList(),
getProductType
({})
// ]).then(async([role, station, post, subsys]) => {
]).
then
(
async
([
channelType
,
productType
])
=>
{
// state.role = role
state
.
channelType
=
channelType
.
slice
(
0
,
2
)
// await dispatch('save2db', { name: '', value: state })
state
.
productType
=
productType
resolve
(
state
)
await
dispatch
(
'save2db'
,
{
// })
name
:
''
,
value
:
state
})
resolve
(
state
)
})
})
})
},
},
// 重置
// 重置
clear
({
clear
({
state
,
dispatch
})
{
state
,
dispatch
})
{
return
new
Promise
(
async
resolve
=>
{
return
new
Promise
(
async
resolve
=>
{
state
.
channelType
=
[]
// state.role = []
state
.
productType
=
[]
// await dispatch('save2db', { name: '', value: state })
await
dispatch
(
'save2db'
,
{
name
:
''
,
value
:
state
})
resolve
(
state
)
resolve
(
state
)
})
})
},
},
...
@@ -72,36 +47,21 @@ export default {
...
@@ -72,36 +47,21 @@ export default {
* @param {*} param0
* @param {*} param0
* @param {*} name 名称 state 中的任意一个 强烈建议 使用 @/common/constants/BaseData 中的常量 便于灵活修改
* @param {*} name 名称 state 中的任意一个 强烈建议 使用 @/common/constants/BaseData 中的常量 便于灵活修改
*/
*/
get
({
get
({
state
,
dispatch
},
name
)
{
state
,
dispatch
},
name
)
{
return
new
Promise
(
async
resolve
=>
{
return
new
Promise
(
async
resolve
=>
{
let
__data
=
state
[
name
]
let
__data
=
state
[
name
]
if
(
__data
)
{
if
(
__data
)
{
__data
=
await
dispatch
(
'getFromdb'
,
`base.
${
name
}
`
)
||
await
dispatch
(
'getFromAjax'
,
name
)
__data
=
await
dispatch
(
'getFromdb'
,
`base.
${
name
}
`
)
||
await
dispatch
(
'getFromAjax'
,
name
)
state
[
name
]
=
__data
state
[
name
]
=
__data
await
dispatch
(
'save2db'
,
{
await
dispatch
(
'save2db'
,
{
name
,
value
:
__data
})
name
,
value
:
__data
})
}
}
resolve
(
__data
)
resolve
(
__data
)
})
})
},
},
set
({
set
({
state
,
dispatch
},
{
name
,
value
})
{
state
,
dispatch
},
{
name
,
value
})
{
return
new
Promise
(
async
resolve
=>
{
return
new
Promise
(
async
resolve
=>
{
state
[
name
]
=
value
state
[
name
]
=
value
await
dispatch
(
'save2db'
,
{
await
dispatch
(
'save2db'
,
{
name
,
value
})
name
,
value
})
resolve
(
value
)
resolve
(
value
)
})
})
},
},
...
@@ -111,16 +71,13 @@ export default {
...
@@ -111,16 +71,13 @@ export default {
* 内存 -> 前端持久化数据库 -> 后台接口
* 内存 -> 前端持久化数据库 -> 后台接口
* @param {*} param0
* @param {*} param0
*/
*/
load
({
load
({
state
,
dispatch
})
{
state
,
dispatch
})
{
return
new
Promise
(
async
resolve
=>
{
return
new
Promise
(
async
resolve
=>
{
if
(
state
.
channelTyp
e
.
length
===
0
)
{
// if (state.rol
e.length === 0) {
state
=
await
dispatch
(
'getFromdb'
,
'base'
)
||
await
dispatch
(
'init'
)
//
state = await dispatch('getFromdb', 'base') || await dispatch('init')
}
//
}
const
{
channelType
,
productType
}
=
state
// const { role, station, post, subsys
} = state
resolve
({
channelType
,
productType
})
resolve
({})
})
})
},
},
/**
/**
...
@@ -128,17 +85,13 @@ export default {
...
@@ -128,17 +85,13 @@ export default {
* @param {*} param0
* @param {*} param0
* @param {*} path 数据 路径
* @param {*} path 数据 路径
*/
*/
getFromdb
({
getFromdb
({
dispatch
},
path
)
{
dispatch
},
path
)
{
return
new
Promise
(
async
resolve
=>
{
return
new
Promise
(
async
resolve
=>
{
const
value
=
await
dispatch
(
'd2admin/db/get'
,
{
const
value
=
await
dispatch
(
'd2admin/db/get'
,
{
dbName
:
'database'
,
dbName
:
'database'
,
path
,
path
,
user
:
false
user
:
false
},
{
},
{
root
:
true
})
root
:
true
})
resolve
(
value
)
resolve
(
value
)
})
})
},
},
...
@@ -148,21 +101,14 @@ export default {
...
@@ -148,21 +101,14 @@ export default {
* @param {*} param0
* @param {*} param0
* @param {*} param1 value 需要持久化的数据 path 需要持久化的数据路径
* @param {*} param1 value 需要持久化的数据 path 需要持久化的数据路径
*/
*/
save2db
({
save2db
({
dispatch
},
{
value
,
name
})
{
dispatch
},
{
value
,
name
})
{
return
new
Promise
(
async
resolve
=>
{
return
new
Promise
(
async
resolve
=>
{
await
dispatch
(
'd2admin/db/set'
,
{
await
dispatch
(
'd2admin/db/set'
,
{
dbName
:
'database'
,
dbName
:
'database'
,
path
:
name
?
`base.
${
name
}
`
:
'base'
,
path
:
name
?
`base.
${
name
}
`
:
'base'
,
value
,
value
,
user
:
false
user
:
false
},
{
},
{
root
:
true
})
root
:
true
})
resolve
(
value
)
resolve
(
value
)
})
})
},
},
...
@@ -171,19 +117,13 @@ export default {
...
@@ -171,19 +117,13 @@ export default {
* @param {*} param0
* @param {*} param0
* @param {*} name @/common/constants/BaseData 中的常量
* @param {*} name @/common/constants/BaseData 中的常量
*/
*/
getFromAjax
({
getFromAjax
({
state
,
dispatch
,
commit
},
name
)
{
state
,
dispatch
,
commit
},
name
)
{
return
new
Promise
(
async
resolve
=>
{
return
new
Promise
(
async
resolve
=>
{
// const value = await map[name]({ [TYPE_NAME]: Object.values(BaseData).find(data => data.KEY === name).TYPE })
// const value = await map[name]({ [TYPE_NAME]: Object.values(BaseData).find(data => data.KEY === name).TYPE })
resolve
()
resolve
()
})
})
},
},
async
reset
({
async
reset
({
dispatch
})
{
dispatch
})
{
await
dispatch
(
'clear'
)
await
dispatch
(
'clear'
)
}
}
}
}
...
...
src/views/apiManage/apiList.vue
View file @
522ce35
...
@@ -3,31 +3,40 @@
...
@@ -3,31 +3,40 @@
<d2-container>
<d2-container>
<d2-table-header
title=
"API列表"
></d2-table-header>
<d2-table-header
title=
"API列表"
></d2-table-header>
<d2-table
<d2-table
:hasNum=
"false"
:searchForm=
"searchForm"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
:getListApi=
"getListApi"
></d2-table>
>
<auth-button
slot=
"auth-button"
slot-scope=
"scope"
:data=
"scope.scope"
></auth-button>
</d2-table>
</d2-container>
</d2-container>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
apiList
}
from
'@api/api'
export
default
{
export
default
{
name
:
'apiList'
,
name
:
'apiList'
,
data
()
{
data
()
{
return
{
return
{
searchForm
:
{},
searchForm
:
{},
getListApi
:
''
,
getListApi
:
apiList
,
tableParams
:
{
tableParams
:
{
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
listName
:
'list'
,
listName
:
'list'
,
tableOption
:
true
,
tableColumns
:
[{
tableColumns
:
[{
label
:
'id'
,
label
:
'id'
,
prop
:
'id'
,
prop
:
'id'
,
width
:
'
20
0px'
width
:
'
5
0px'
},
{
},
{
label
:
'API分类'
,
label
:
'API分类'
,
prop
:
'apiClassification'
,
prop
:
'apiClassification'
,
fomatter
:
(
cellValue
)
=>
{
fo
r
matter
:
(
cellValue
)
=>
{
return
{
return
{
1
:
'授权管理'
,
1
:
'授权管理'
,
2
:
'设备管理'
,
2
:
'设备管理'
,
...
@@ -40,7 +49,7 @@ export default {
...
@@ -40,7 +49,7 @@ export default {
},
{
},
{
label
:
'请求方式'
,
label
:
'请求方式'
,
prop
:
'requestMethod'
,
prop
:
'requestMethod'
,
fomatter
:
(
cellValue
)
=>
{
fo
r
matter
:
(
cellValue
)
=>
{
return
{
return
{
1
:
'GET'
,
1
:
'GET'
,
2
:
'POST'
2
:
'POST'
...
@@ -55,7 +64,7 @@ export default {
...
@@ -55,7 +64,7 @@ export default {
},
{
},
{
label
:
'状态'
,
label
:
'状态'
,
prop
:
'status'
,
prop
:
'status'
,
fomatter
:
(
cellValue
)
=>
{
fo
r
matter
:
(
cellValue
)
=>
{
return
{
return
{
0
:
'停用'
,
0
:
'停用'
,
1
:
'可用'
1
:
'可用'
...
...
src/views/apiManage/apiRecord.vue
View file @
522ce35
...
@@ -6,9 +6,16 @@
...
@@ -6,9 +6,16 @@
inline=
"true"
inline=
"true"
>
>
<el-form-item
label=
"访问时间:"
>
<el-form-item
label=
"访问时间:"
>
<el-select
:size=
"$store.state.d2admin.size.value"
>
<el-date-picker
<el-option></el-option>
v-model=
"accessTime"
</el-select>
:size=
"$store.state.d2admin.size.value"
type=
"daterange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
:clearable=
"false"
>
</el-date-picker>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
<el-button
...
@@ -20,9 +27,11 @@
...
@@ -20,9 +27,11 @@
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<d2-table
<d2-table
:hasNum=
"false"
:searchForm=
"searchForm"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
:getListApi=
"getListApi"
:beforeSearchFn=
"beforeSearchFn"
>
>
<auth-button
<auth-button
slot=
"auth-button"
slot=
"auth-button"
...
@@ -34,19 +43,21 @@
...
@@ -34,19 +43,21 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
apiRecordList
}
from
'@api/api'
export
default
{
export
default
{
name
:
'apiRecord'
,
name
:
'apiRecord'
,
data
()
{
data
()
{
return
{
return
{
searchForm
:
{},
searchForm
:
{},
getListApi
:
''
,
accessTime
:
''
,
getListApi
:
apiRecordList
,
tableParams
:
{
tableParams
:
{
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
listName
:
'list'
,
listName
:
'list'
,
tableColumns
:
[{
tableColumns
:
[{
label
:
'序号'
,
label
:
'序号'
,
prop
:
'id'
,
prop
:
'id'
,
width
:
'
20
0px'
width
:
'
5
0px'
},
{
},
{
label
:
'访问时间'
,
label
:
'访问时间'
,
prop
:
'createTime'
prop
:
'createTime'
...
@@ -55,12 +66,12 @@ export default {
...
@@ -55,12 +66,12 @@ export default {
prop
:
'customerName'
prop
:
'customerName'
},
{
},
{
label
:
'调用API'
,
label
:
'调用API'
,
prop
:
'apiId'
,
prop
:
'apiId'
width
:
'180px'
},
{
},
{
label
:
'调用结果'
,
label
:
'调用结果'
,
prop
:
'callResult'
,
prop
:
'callResult'
,
fomatter
:
(
cellValue
)
=>
{
width
:
'80px'
,
formatter
:
(
cellValue
)
=>
{
return
{
return
{
0
:
'失败'
,
0
:
'失败'
,
1
:
'成功'
1
:
'成功'
...
@@ -73,7 +84,21 @@ export default {
...
@@ -73,7 +84,21 @@ export default {
mounted
()
{
},
mounted
()
{
},
methods
:
{}
methods
:
{
beforeSearchFn
()
{
return
new
Promise
(
resolve
=>
{
if
(
this
.
accessTime
&&
this
.
accessTime
.
length
)
{
this
.
searchForm
.
registerStartTime
=
new
Date
(
this
.
accessTime
[
0
]).
toLocaleDateString
().
replace
(
/
\/
/g
,
'-'
)
+
' 00:00:00'
this
.
searchForm
.
registerEndTime
=
new
Date
(
this
.
accessTime
[
1
]).
toLocaleDateString
().
replace
(
/
\/
/g
,
'-'
)
+
' 23:59:59'
}
resolve
()
})
},
handleRest
()
{
this
.
accessTime
=
[]
this
.
searchForm
=
{}
}
}
}
}
</
script
>
</
script
>
...
...
src/views/appMarket/appMarket.vue
View file @
522ce35
...
@@ -5,10 +5,17 @@
...
@@ -5,10 +5,17 @@
<auth-button
category=
"Button"
></auth-button>
<auth-button
category=
"Button"
></auth-button>
</d2-table-header>
</d2-table-header>
<d2-table
<d2-table
:hasNum=
"false"
:searchForm=
"searchForm"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
:getListApi=
"getListApi"
>
>
<img
slot=
"image"
slot-scope=
"scope"
class=
"pro-img"
:src=
"scope.scope.image"
/>
<auth-button
<auth-button
slot=
"auth-button"
slot=
"auth-button"
slot-scope=
"scope"
slot-scope=
"scope"
...
@@ -19,30 +26,34 @@
...
@@ -19,30 +26,34 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
appMarketList
}
from
'@api/api'
export
default
{
export
default
{
name
:
'appMarket'
,
name
:
'appMarket'
,
data
()
{
data
()
{
return
{
return
{
searchForm
:
{},
searchForm
:
{},
getListApi
:
''
,
getListApi
:
appMarketList
,
tableParams
:
{
tableParams
:
{
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
listName
:
'list'
,
listName
:
'list'
,
tableOption
:
true
,
tableColumns
:
[{
tableColumns
:
[{
label
:
'id'
,
label
:
'id'
,
prop
:
'id'
,
prop
:
'id'
,
width
:
'
20
0px'
width
:
'
5
0px'
},
{
},
{
label
:
'标题'
,
label
:
'标题'
,
prop
:
'title'
prop
:
'title'
},
{
},
{
label
:
'图片'
,
label
:
'图片'
,
prop
:
'image'
prop
:
'image'
,
addHtml
:
'image'
,
width
:
'120px'
},
{
},
{
label
:
'位置'
,
label
:
'位置'
,
prop
:
'position'
,
prop
:
'position'
,
width
:
'1
8
0px'
,
width
:
'1
0
0px'
,
fomatter
:
(
cellValue
)
=>
{
fo
r
matter
:
(
cellValue
)
=>
{
return
{
return
{
1
:
'商城banner'
,
1
:
'商城banner'
,
2
:
'智能-家'
,
2
:
'智能-家'
,
...
@@ -52,7 +63,7 @@ export default {
...
@@ -52,7 +63,7 @@ export default {
},
{
},
{
label
:
'打开界面'
,
label
:
'打开界面'
,
prop
:
'interfaceType'
,
prop
:
'interfaceType'
,
fomatter
:
(
cellValue
)
=>
{
fo
r
matter
:
(
cellValue
)
=>
{
return
{
return
{
1
:
'APP'
,
1
:
'APP'
,
2
:
'H5'
2
:
'H5'
...
@@ -64,7 +75,8 @@ export default {
...
@@ -64,7 +75,8 @@ export default {
},
{
},
{
label
:
'状态'
,
label
:
'状态'
,
prop
:
'status'
,
prop
:
'status'
,
fomatter
:
(
cellValue
)
=>
{
width
:
'80px'
,
formatter
:
(
cellValue
)
=>
{
return
{
return
{
0
:
'下架'
,
0
:
'下架'
,
1
:
'上架'
1
:
'上架'
...
@@ -82,4 +94,8 @@ export default {
...
@@ -82,4 +94,8 @@ export default {
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.pro-img
{
width
:
80px
;
height
:
80px
;
}
</
style
>
</
style
>
src/views/customer/customer.vue
View file @
522ce35
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
<d2-container>
<d2-container>
<d2-table-header
title=
"客户列表"
></d2-table-header>
<d2-table-header
title=
"客户列表"
></d2-table-header>
<d2-table
<d2-table
:hasNum=
"false"
:searchForm=
"searchForm"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
:getListApi=
"getListApi"
...
@@ -17,19 +18,21 @@
...
@@ -17,19 +18,21 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
customerList
}
from
'@api/api'
export
default
{
export
default
{
name
:
'customer'
,
name
:
'customer'
,
data
()
{
data
()
{
return
{
return
{
searchForm
:
{},
searchForm
:
{},
getListApi
:
''
,
getListApi
:
customerList
,
tableParams
:
{
tableParams
:
{
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
listName
:
'list'
,
listName
:
'list'
,
tableOption
:
true
,
tableColumns
:
[{
tableColumns
:
[{
label
:
'id'
,
label
:
'id'
,
prop
:
'id'
,
prop
:
'id'
,
width
:
'
20
0px'
width
:
'
5
0px'
},
{
},
{
label
:
'客户名称'
,
label
:
'客户名称'
,
prop
:
'customerName'
prop
:
'customerName'
...
@@ -42,16 +45,17 @@ export default {
...
@@ -42,16 +45,17 @@ export default {
width
:
'180px'
width
:
'180px'
},
{
},
{
label
:
'省份'
,
label
:
'省份'
,
prop
:
'province'
prop
:
'province
Name
'
},
{
},
{
label
:
'城市'
,
label
:
'城市'
,
prop
:
'city'
prop
:
'city
Name
'
},
{
},
{
label
:
'详细地址'
,
label
:
'详细地址'
,
prop
:
'address'
prop
:
'address'
},
{
},
{
label
:
'账号状态'
,
label
:
'账号状态'
,
prop
:
'status'
,
prop
:
'status'
,
width
:
'100px'
,
formatter
:
(
cellValue
)
=>
{
formatter
:
(
cellValue
)
=>
{
return
{
return
{
0
:
'停用'
,
0
:
'停用'
,
...
@@ -66,7 +70,8 @@ export default {
...
@@ -66,7 +70,8 @@ export default {
mounted
()
{
},
mounted
()
{
},
methods
:
{}
methods
:
{
}
}
}
</
script
>
</
script
>
...
...
src/views/device/device.vue
View file @
522ce35
...
@@ -6,30 +6,61 @@
...
@@ -6,30 +6,61 @@
inline=
"true"
inline=
"true"
>
>
<el-form-item
label=
"客户名称:"
>
<el-form-item
label=
"客户名称:"
>
<el-select
:size=
"$store.state.d2admin.size.value"
>
<el-select
<el-option></el-option>
v-model=
"searchForm.customerName"
:size=
"$store.state.d2admin.size.value"
clearable
>
<el-option
v-for=
"(item, index) in baseData.userList"
:key=
"index"
:label=
"item"
:value=
"item"
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"设备类型:"
>
<el-form-item
label=
"设备类型:"
>
<el-select
:size=
"$store.state.d2admin.size.value"
>
<el-select
<el-option></el-option>
v-model=
"searchForm.deviceType"
:size=
"$store.state.d2admin.size.value"
clearable
>
<el-option
v-for=
"(item, index) in baseData.deviceList"
:key=
"index"
:label=
"item"
:value=
"item"
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"激活时间:"
>
<el-form-item
label=
"激活时间:"
>
<el-select
:size=
"$store.state.d2admin.size.value"
>
<el-date-picker
<el-option></el-option>
v-model=
"registerTime"
</el-select>
:size=
"$store.state.d2admin.size.value"
type=
"daterange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
:clearable=
"false"
>
</el-date-picker>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
<el-button
:id=
"tableParams.btnId"
type=
"primary"
type=
"primary"
icon=
"el-icon-search"
icon=
"el-icon-search"
:size=
"$store.state.d2admin.size.value"
:size=
"$store.state.d2admin.size.value"
:id=
"tableParams.btnId"
>
查询
</el-button>
>
查询
</el-button>
<el-button
:size=
"$store.state.d2admin.size.value"
@
click=
"handleRest"
>
重置
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<d2-table
<d2-table
:hasNum=
"false"
:beforeSearchFn=
"beforeSearchFn"
:searchForm=
"searchForm"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
:getListApi=
"getListApi"
...
@@ -38,26 +69,28 @@
...
@@ -38,26 +69,28 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
deviceList
,
userDeviceDropList
}
from
'@api/api'
export
default
{
export
default
{
name
:
'device'
,
name
:
'device'
,
data
()
{
data
()
{
return
{
return
{
searchForm
:
{},
searchForm
:
{},
getListApi
:
''
,
registerTime
:
[],
getListApi
:
deviceList
,
tableParams
:
{
tableParams
:
{
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
listName
:
'list'
,
listName
:
'list'
,
tableColumns
:
[{
tableColumns
:
[{
label
:
'序号'
,
label
:
'序号'
,
prop
:
'id'
,
prop
:
'id'
,
width
:
'
20
0px'
width
:
'
5
0px'
},
{
},
{
label
:
'设备SN'
,
label
:
'设备SN'
,
prop
:
'deviceSn'
prop
:
'deviceSn'
},
{
},
{
label
:
'类型'
,
label
:
'类型'
,
prop
:
'deviceType'
,
prop
:
'deviceType'
,
fomatter
:
(
cellValue
)
=>
{
fo
r
matter
:
(
cellValue
)
=>
{
return
cellValue
.
deviceType
return
cellValue
.
deviceType
}
}
},
{
},
{
...
@@ -70,24 +103,44 @@ export default {
...
@@ -70,24 +103,44 @@ export default {
},
{
},
{
label
:
'状态'
,
label
:
'状态'
,
prop
:
'status'
,
prop
:
'status'
,
fomatter
:
(
cellValue
)
=>
{
fo
r
matter
:
(
cellValue
)
=>
{
return
{
return
{
0
:
'异常'
,
0
:
'异常'
,
1
:
'正常'
1
:
'正常'
}[
cellValue
.
status
]
}[
cellValue
.
status
]
}
}
}]
}]
},
baseData
:
{
userList
:
[],
deviceList
:
[]
}
}
}
}
},
},
components
:
{},
mounted
()
{
userDeviceDropList
({}).
then
(
res
=>
{
computed
:
{},
// console.log(res)
this
.
baseData
.
userList
=
res
.
customerNameList
mounted
()
{
},
this
.
baseData
.
deviceList
=
res
.
deviceTypeList
})
},
methods
:
{}
methods
:
{
beforeSearchFn
()
{
return
new
Promise
(
resolve
=>
{
if
(
this
.
registerTime
&&
this
.
registerTime
.
length
)
{
this
.
searchForm
.
registerStartTime
=
new
Date
(
this
.
registerTime
[
0
]).
toLocaleDateString
().
replace
(
/
\/
/g
,
'-'
)
+
' 00:00:00'
this
.
searchForm
.
registerEndTime
=
new
Date
(
this
.
registerTime
[
1
]).
toLocaleDateString
().
replace
(
/
\/
/g
,
'-'
)
+
' 23:59:59'
}
resolve
()
})
},
handleRest
()
{
this
.
registerTime
=
[]
this
.
searchForm
=
{}
}
}
}
}
</
script
>
</
script
>
...
...
src/views/user/user.vue
View file @
522ce35
...
@@ -6,14 +6,30 @@
...
@@ -6,14 +6,30 @@
inline=
"true"
inline=
"true"
>
>
<el-form-item
label=
"客户名称:"
>
<el-form-item
label=
"客户名称:"
>
<el-select
:size=
"$store.state.d2admin.size.value"
>
<el-select
<el-option></el-option>
v-model=
"searchForm.customerName"
:size=
"$store.state.d2admin.size.value"
clearable
>
<el-option
v-for=
"(item, index) in baseData.userList"
:key=
"index"
:label=
"item"
:value=
"item"
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"注册时间:"
>
<el-form-item
label=
"注册时间:"
>
<el-select
:size=
"$store.state.d2admin.size.value"
>
<el-date-picker
<el-option></el-option>
v-model=
"registerTime"
</el-select>
:size=
"$store.state.d2admin.size.value"
type=
"daterange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
:clearable=
"false"
>
</el-date-picker>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
<el-button
...
@@ -22,9 +38,15 @@
...
@@ -22,9 +38,15 @@
:size=
"$store.state.d2admin.size.value"
:size=
"$store.state.d2admin.size.value"
:id=
"tableParams.btnId"
:id=
"tableParams.btnId"
>
查询
</el-button>
>
查询
</el-button>
<el-button
:size=
"$store.state.d2admin.size.value"
@
click=
"handleRest"
>
重置
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<d2-table
<d2-table
:hasNum=
"false"
:beforeSearchFn=
"beforeSearchFn"
:searchForm=
"searchForm"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
:getListApi=
"getListApi"
...
@@ -33,35 +55,38 @@
...
@@ -33,35 +55,38 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
userList
,
userDropList
}
from
'@api/api'
export
default
{
export
default
{
name
:
'user'
,
name
:
'user'
,
data
()
{
data
()
{
return
{
return
{
searchForm
:
{},
searchForm
:
{},
getListApi
:
''
,
registerTime
:
[],
getListApi
:
userList
,
tableParams
:
{
tableParams
:
{
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
listName
:
'list'
,
listName
:
'list'
,
tableColumns
:
[{
tableColumns
:
[{
label
:
'id'
,
label
:
'id'
,
prop
:
'id'
,
prop
:
'id'
,
width
:
'
20
0px'
width
:
'
5
0px'
},
{
},
{
label
:
'昵称'
,
label
:
'昵称'
,
prop
:
'nickname'
prop
:
'nickname'
},
{
},
{
label
:
'联系电话'
,
label
:
'联系电话'
,
prop
:
'contactNumber'
prop
:
'contactNumber'
,
width
:
'100px'
},
{
},
{
label
:
'微信ID'
,
label
:
'微信ID'
,
prop
:
'wechatId'
,
prop
:
'wechatId'
,
width
:
'180px'
width
:
'180px'
},
{
},
{
label
:
'省份'
,
label
:
'省份'
,
prop
:
'province'
prop
:
'province
Name
'
},
{
},
{
label
:
'城市'
,
label
:
'城市'
,
prop
:
'city'
prop
:
'city
Name
'
},
{
},
{
label
:
'所属客户名称'
,
label
:
'所属客户名称'
,
prop
:
'customerName'
prop
:
'customerName'
...
@@ -72,13 +97,35 @@ export default {
...
@@ -72,13 +97,35 @@ export default {
label
:
'最后登录时间'
,
label
:
'最后登录时间'
,
prop
:
'lastLoginTime'
prop
:
'lastLoginTime'
}]
}]
},
baseData
:
{
userList
:
[]
}
}
}
}
},
},
mounted
()
{
},
mounted
()
{
userDropList
({}).
then
(
res
=>
{
this
.
baseData
.
userList
=
res
})
},
methods
:
{}
methods
:
{
beforeSearchFn
()
{
return
new
Promise
(
resolve
=>
{
console
.
log
(
this
.
registerTime
)
if
(
this
.
registerTime
&&
this
.
registerTime
.
length
)
{
this
.
searchForm
.
registerStartTime
=
new
Date
(
this
.
registerTime
[
0
]).
toLocaleDateString
().
replace
(
/
\/
/g
,
'-'
)
+
' 00:00:00'
this
.
searchForm
.
registerEndTime
=
new
Date
(
this
.
registerTime
[
1
]).
toLocaleDateString
().
replace
(
/
\/
/g
,
'-'
)
+
' 23:59:59'
}
resolve
()
})
},
handleRest
()
{
this
.
registerTime
=
[]
this
.
searchForm
=
{}
}
}
}
}
</
script
>
</
script
>
...
...
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