Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
SHR
/
tFIMS
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 679a62a9
authored
Sep 27, 2019
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
表格组件-修改
1 parent
f3377ffa
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
80 additions
and
51 deletions
src/api/deviceManagement.js
src/api/maintainManagement.js
src/api/materiaOrderManagement.js
src/api/subSysManagement.js
src/api/sys.account.js
src/api/trafficManagement.js
src/components/d2-table/index.vue
src/plugin/axios/index.js
src/store/modules/d2admin/modules/refreshtable.js
src/views/deviceManagement/index.vue
src/views/maintainManagement/index.vue
src/views/materiaOrderManagement/index.vue
src/views/subSysManagement/index.vue
src/views/trafficManagement/index.vue
src/views/userManage/loginLogs/index.vue
src/views/userManage/role/index.vue
src/views/userManage/user/index.vue
src/api/deviceManagement.js
View file @
679a62a
...
...
@@ -7,11 +7,13 @@ function getListApi(data) {
}
function
editApi
(
data
)
{
data
.
refreshTable
=
true
data
.
method
=
`
${
path
}
edit`
return
request
(
data
)
}
function
removeApi
(
data
)
{
data
.
refreshTable
=
true
data
.
method
=
`
${
path
}
remove`
return
request
(
data
)
}
...
...
src/api/maintainManagement.js
View file @
679a62a
...
...
@@ -8,6 +8,7 @@ function getListApi(data) {
}
function
removeApi
(
data
)
{
data
.
refreshTable
=
true
data
.
method
=
`
${
path
}
delete`
return
request
(
data
)
}
...
...
src/api/materiaOrderManagement.js
View file @
679a62a
...
...
@@ -13,6 +13,7 @@ function detailApi(data) {
}
function
removeApi
(
data
)
{
data
.
refreshTable
=
true
data
.
method
=
`
${
path
}
delete`
return
request
(
data
)
}
...
...
src/api/subSysManagement.js
View file @
679a62a
...
...
@@ -12,10 +12,12 @@ function getListApi(data) {
}
function
editApi
(
data
)
{
data
.
refreshTable
=
true
return
request
(
data
)
}
function
removeApi
(
data
)
{
data
.
refreshTable
=
true
data
.
method
=
`
${
path
}
remove`
return
request
(
data
)
}
...
...
src/api/sys.account.js
View file @
679a62a
/*
* @Author: limin
* @Date: 2019-08-26 18:02:55
* @Last Modified by:
limin
* @Last Modified time: 2019-09-
18 20:06:38
* @Last Modified by:
chenwq
* @Last Modified time: 2019-09-
27 17:08:06
*/
import
request
from
'./request'
...
...
@@ -31,6 +31,7 @@ export function AccountLogin(data) {
*/
export
function
Reg
(
data
=
{})
{
data
.
method
=
REG_URL
data
.
refreshTable
=
true
return
request
(
data
,
RequestMethods
.
GET
)
}
...
...
@@ -57,6 +58,7 @@ export function UserList(data = {}) {
* @param {*} data 参数
*/
export
function
PassWordReset
(
data
=
{})
{
data
.
refreshTable
=
true
data
.
method
=
`
${
USER_PATH
}
password.reset`
return
request
(
data
,
RequestMethods
.
GET
)
}
...
...
@@ -66,6 +68,7 @@ export function PassWordReset(data = {}) {
* @param {*} data 参数
*/
export
function
AccountModify
(
data
=
{})
{
data
.
refreshTable
=
true
data
.
method
=
`
${
USER_PATH
}
modify`
return
request
(
data
,
RequestMethods
.
GET
)
}
...
...
@@ -75,6 +78,7 @@ export function AccountModify(data = {}) {
* @param {*} data 参数
*/
export
function
AccountIncrease
(
data
=
{})
{
data
.
refreshTable
=
true
data
.
method
=
`
${
USER_PATH
}
validity.increase`
return
request
(
data
,
RequestMethods
.
GET
)
}
...
...
@@ -84,6 +88,7 @@ export function AccountIncrease(data = {}) {
* @param {*} data 参数
*/
export
function
AccountForbidden
(
data
=
{})
{
data
.
refreshTable
=
true
data
.
method
=
`
${
USER_PATH
}
forbidden`
return
request
(
data
,
RequestMethods
.
GET
)
}
...
...
@@ -93,6 +98,7 @@ export function AccountForbidden(data = {}) {
* @param {*} data 参数
*/
export
function
AccountActived
(
data
=
{})
{
data
.
refreshTable
=
true
data
.
method
=
`
${
USER_PATH
}
actived`
return
request
(
data
,
RequestMethods
.
GET
)
}
...
...
@@ -102,6 +108,7 @@ export function AccountActived(data = {}) {
* @param {*} data 参数
*/
export
function
AccountValidate
(
data
=
{})
{
data
.
refreshTable
=
true
data
.
method
=
`
${
USER_PATH
}
check`
return
request
(
data
,
RequestMethods
.
GET
)
}
...
...
@@ -129,6 +136,7 @@ export function RoleAuthData(data = {}) {
* @param {*} data 参数
*/
export
function
RoleReg
(
data
=
{})
{
data
.
refreshTable
=
true
data
.
method
=
`
${
ROLE_PATH
}
register`
return
request
(
data
,
RequestMethods
.
GET
)
}
...
...
@@ -138,6 +146,7 @@ export function RoleReg(data = {}) {
* @param {*} data 参数
*/
export
function
RoleModify
(
data
=
{})
{
data
.
refreshTable
=
true
data
.
method
=
`
${
ROLE_PATH
}
modify`
return
request
(
data
,
RequestMethods
.
GET
)
}
...
...
src/api/trafficManagement.js
View file @
679a62a
...
...
@@ -13,10 +13,12 @@ function getListApi(data) {
function
editApi
(
data
)
{
// data.method = `${path}edit`
data
.
refreshTable
=
true
return
request
(
data
)
}
function
removeApi
(
data
)
{
data
.
refreshTable
=
true
data
.
method
=
`
${
path
}
remove`
return
request
(
data
)
}
...
...
src/components/d2-table/index.vue
View file @
679a62a
...
...
@@ -157,6 +157,9 @@ export default {
this
.
oldValue
=
_
.
cloneDeep
(
val
)
},
deep
:
true
},
'$store.state.d2admin.refreshtable.value'
(
val
)
{
this
.
refreshTable
()
}
},
...
...
@@ -173,7 +176,6 @@ export default {
...
this
.
page
,
...
this
.
searchForm
}
console
.
log
(
'刷新--'
)
// console.log(params)
this
.
getListApi
(
params
).
then
(
res
=>
{
this
.
data
=
res
[
this
.
tableParams
.
listName
]
...
...
src/plugin/axios/index.js
View file @
679a62a
...
...
@@ -11,6 +11,7 @@ import {
import
Qs
from
'qs'
axios
.
defaults
.
withCredentials
=
true
const
expiresMinute
=
60
// 过期时间(分钟)
var
refreshTable
=
false
// 标记是否刷新表格
// 创建一个错误
export
function
errorCreate
(
msg
)
{
const
error
=
new
Error
(
msg
)
...
...
@@ -55,6 +56,7 @@ service.interceptors.request.use(
config
=>
{
return
new
Promise
(
async
resolve
=>
{
const
{
url
,
params
}
=
config
params
.
refreshTable
&&
(
refreshTable
=
true
)
await
store
.
commit
(
'd2admin/loading/set'
,
true
)
const
uuid
=
util
.
cookies
.
get
(
'uuid'
)
// 如果请求链接不在排除列表 (排除列表: 登录 基础数据) 并且cookie 过期(判断是否长时间未操作)
...
...
@@ -90,12 +92,17 @@ service.interceptors.response.use(
switch
(
+
code
)
{
case
0
:
// [ 示例 ] code === 0 代表没有错误
if
(
refreshTable
)
{
store
.
commit
(
'd2admin/refreshtable/set'
,
!
store
.
state
.
d2admin
.
refreshtable
.
value
)
refreshTable
=
false
}
return
data
default
:
// 不是正确的 code
errorCreate
(
`
${
dataAxios
.
message
}
`
)
break
}
refreshTable
=
false
},
error
=>
{
...
...
src/store/modules/d2admin/modules/refreshtable.js
0 → 100644
View file @
679a62a
/*
* @Author: chenwq
* @Date: 2019-09-27 11:39:49
* @Last Modified by: chenwq
* @Last Modified time: 2019-09-27 15:27:39
*/
export
default
{
namespaced
:
true
,
state
:
{
// 刷新表格
value
:
false
},
getters
:
{
/**
* 返回刷新表格状态
* @param {*} state
*/
refresh
(
state
)
{
return
state
.
value
}
},
mutations
:
{
/**
* @description 设置表格刷新
* @param {Object} state state
* @param {Boolean} refresh refresh
*/
set
(
state
,
refresh
)
{
return
new
Promise
(
resolve
=>
{
state
.
value
=
refresh
resolve
(
true
)
})
}
},
actions
:
{
reset
({
state
})
{
state
.
value
=
false
}
}
}
src/views/deviceManagement/index.vue
View file @
679a62a
...
...
@@ -53,7 +53,6 @@
</auth-button>
</d2-table-header>
<d2-table
ref=
"table"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
...
...
@@ -192,10 +191,6 @@ export default {
/* 接口请求-start */
getList
()
{
this
.
$refs
.
table
.
refreshTable
()
},
delObjMutiAttr
(
obj
,
keys
)
{
keys
.
map
(
key
=>
delete
obj
[
key
])
return
obj
...
...
@@ -216,7 +211,6 @@ export default {
.
then
(
res
=>
{
this
.
handleEditClose
()
notice
.
okTips
()
this
.
getList
()
})
.
catch
(()
=>
{
notice
.
errorTips
()
...
...
@@ -274,7 +268,7 @@ export default {
}
else
{
notice
.
okTips
(
'本次导入结果:全部成功!'
)
}
this
.
getList
(
)
this
.
$store
.
commit
(
'd2admin/refreshtable/set'
,
!
this
.
$store
.
state
.
d2admin
.
refreshtable
.
value
)
document
.
getElementById
(
'fileUpload'
).
value
=
null
})
.
catch
(()
=>
{
...
...
@@ -325,7 +319,7 @@ export default {
})
.
then
(
res
=>
{
notice
.
okTips
()
this
.
getList
()
//
this.getList()
})
.
catch
(()
=>
{
notice
.
errorTips
()
...
...
src/views/maintainManagement/index.vue
View file @
679a62a
...
...
@@ -46,7 +46,6 @@
</el-form>
<d2-table-header
title=
"作业单列表"
><auth-button
category=
"Button"
></auth-button></d2-table-header>
<d2-table
ref=
"table"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
...
...
@@ -250,13 +249,11 @@ export default {
watch
:
{
'creatTime'
(
value
)
{
// !value && this.getList()
Object
.
assign
(
this
.
searchForm
,
util
.
formatTime
(
this
.
creatTime
))
}
},
mounted
()
{
// this.getList()
this
.
loadBaseData
()
},
...
...
@@ -276,10 +273,10 @@ export default {
return
Object
.
assign
(
this
.
searchForm
,
util
.
formatTime
(
this
.
creatTime
))
},
getList
()
{
this
.
getParams
()
this
.
$refs
.
table
.
refreshTable
()
},
//
getList() {
//
this.getParams()
//
this.$refs.table.refreshTable()
//
},
exportOrder
()
{
// const params = this.getParams()
exportApi
(
this
.
searchForm
).
then
(
res
=>
{
...
...
@@ -300,7 +297,7 @@ export default {
id
:
row
.
id
}).
then
(
res
=>
{
notice
.
okTips
()
this
.
getList
()
//
this.getList()
}).
catch
(()
=>
{
notice
.
errorTips
()
})
...
...
src/views/materiaOrderManagement/index.vue
View file @
679a62a
...
...
@@ -199,7 +199,6 @@ export default {
orderCode
:
row
.
orderCode
}).
then
(()
=>
{
notice
.
okTips
()
this
.
getList
()
}).
catch
(()
=>
{
notice
.
errorTips
()
})
...
...
src/views/subSysManagement/index.vue
View file @
679a62a
...
...
@@ -47,7 +47,6 @@
</el-form>
<d2-table-header
title=
"子系统列表"
><auth-button
category=
"Button"
:data=
"editFormReset"
></auth-button></d2-table-header>
<d2-table
ref=
"table"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
...
...
@@ -195,10 +194,6 @@ export default {
// })
// },
getList
()
{
this
.
$refs
.
table
.
refreshTable
()
},
editSubSystem
(
value
)
{
// console.log(value)
const
params
=
_
.
cloneDeep
(
this
.
editFormReset
)
...
...
@@ -215,7 +210,6 @@ export default {
editApi
(
params
).
then
(
res
=>
{
this
.
handleEditClose
()
notice
.
okTips
()
this
.
getList
()
}).
catch
(()
=>
{
notice
.
errorTips
()
})
...
...
@@ -248,7 +242,6 @@ export default {
usedStatus
:
2
}).
then
(()
=>
{
notice
.
okTips
()
this
.
getList
()
}).
catch
(()
=>
{
notice
.
errorTips
()
})
...
...
src/views/trafficManagement/index.vue
View file @
679a62a
...
...
@@ -28,7 +28,6 @@
</el-form>
<d2-table-header
title=
"车辆列表"
><auth-button
category=
"Button"
:data=
"editFormReset"
></auth-button></d2-table-header>
<d2-table
ref=
"table"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
...
...
@@ -134,10 +133,6 @@ export default {
this
.
baseData
.
station
=
data
},
getList
()
{
this
.
$refs
.
table
.
refreshTable
()
},
editTraffic
(
value
)
{
// console.log(value)
const
params
=
_
.
cloneDeep
(
this
.
editFormReset
)
...
...
@@ -149,7 +144,6 @@ export default {
editApi
(
params
).
then
(
res
=>
{
this
.
handleEditClose
()
notice
.
okTips
()
this
.
getList
()
}).
catch
(()
=>
{
notice
.
errorTips
()
})
...
...
@@ -182,7 +176,6 @@ export default {
usedStatus
:
2
}).
then
(
res
=>
{
notice
.
okTips
()
this
.
getList
()
}).
catch
(()
=>
{
notice
.
errorTips
()
})
...
...
src/views/userManage/loginLogs/index.vue
View file @
679a62a
...
...
@@ -32,7 +32,6 @@
</el-form>
<d2-table-header
title=
"登录日志列表"
></d2-table-header>
<d2-table
ref=
"table"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
...
...
src/views/userManage/role/index.vue
View file @
679a62a
...
...
@@ -3,8 +3,8 @@
<d2-container
class=
"role"
>
<d2-table-header
title=
"角色列表"
><auth-button
category=
"action"
label=
"创建角色"
></auth-button></d2-table-header>
<d2-table
ref=
"table"
:tableParams=
"tableParams"
:pagination=
"pagination"
:getListApi=
"getListApi"
>
<auth-button
...
...
@@ -63,7 +63,6 @@ export default {
// this.fetchData()
this
.
$event
.
$on
(
'e-role-dialog-close'
,
async
isReload
=>
{
if
(
isReload
)
{
this
.
getList
()
const
{
roles
}
=
await
RoleList
()
this
.
set
({
name
:
BaseData
.
ROLE
.
KEY
,
value
:
roles
})
}
...
...
@@ -74,9 +73,6 @@ export default {
methods
:
{
...
mapActions
(
'd2admin/base'
,
[
'set'
]),
getList
()
{
this
.
$refs
.
table
.
refreshTable
()
},
async
handleEdit
(
row
)
{
this
.
editData
=
row
&&
await
RoleDetail
({
roleId
:
row
.
roleId
})
this
.
editVisible
=
true
...
...
src/views/userManage/user/index.vue
View file @
679a62a
...
...
@@ -60,7 +60,6 @@
</el-form>
<d2-table-header
title=
"用户列表"
><auth-button
category=
"action"
label=
"创建用户"
></auth-button></d2-table-header>
<d2-table
ref=
"table"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
...
...
@@ -209,7 +208,7 @@ export default {
this
.
fetchData
()
this
.
$event
.
$on
(
'e-reg-dialog-close'
,
isReload
=>
{
this
.
registerDialogVisible
=
false
isReload
&&
this
.
getUserList
()
//
isReload && this.getUserList()
})
},
...
...
@@ -228,10 +227,6 @@ export default {
Object
.
freeze
(
this
.
baseData
)
},
/* 接口请求-start */
getUserList
()
{
// Object.assign(this.searchForm, util.formatTime(this.searchTimes))
this
.
$refs
.
table
.
refreshTable
()
},
filterTag
(
value
,
row
)
{
return
row
.
status
===
value
},
...
...
@@ -244,9 +239,6 @@ export default {
}
this
.
openDialog
(
row
)
},
// async handleSearch() {
// this.getUserList()
// },
handleEdit
(
row
)
{
row
=
util
.
deepClone
(
row
)
row
.
data
=
{
...
...
@@ -269,13 +261,12 @@ export default {
},
// ------------
// 列表各种操作
async
handleOperation
(
{
row
,
e
}
)
{
async
handleOperation
(
row
,
e
)
{
const
_actionText
=
e
.
target
.
innerText
const
res
=
await
this
.
apiMapping
[
_actionText
]({
userId
:
row
.
userId
})
const
{
operateStatus
}
=
res
if
(
operateStatus
)
{
notice
.
okTips
(
`
${
_actionText
}
成功!`
)
this
.
getUserList
()
}
else
{
notice
.
errorTips
(
`
${
_actionText
}
失败!`
)
}
...
...
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