Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Starter Web Vue
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
product
kim3-web-vue
Starter Web Vue
Commits
09240bbb
Commit
09240bbb
authored
Jun 28, 2021
by
水落(YangLei)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 任务页面开发
parent
dd8c1d90
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
103 additions
and
19 deletions
+103
-19
src/components/action_button/index.vue
src/components/action_button/index.vue
+55
-0
src/components/table/index.vue
src/components/table/index.vue
+22
-6
src/pages/frame/store/accountModule.js
src/pages/frame/store/accountModule.js
+6
-10
src/pages/system/view/menu/MenuManagement.vue
src/pages/system/view/menu/MenuManagement.vue
+0
-1
src/pages/system/view/role/RoleManagement.vue
src/pages/system/view/role/RoleManagement.vue
+2
-2
src/pages/system/view/task/index.vue
src/pages/system/view/task/index.vue
+13
-0
src/router/config.js
src/router/config.js
+5
-0
No files found.
src/components/action_button/index.vue
0 → 100644
View file @
09240bbb
<
template
>
<a-table-column
:title=
"title"
>
<template
#default
="
row
"
>
<template
v-for=
"btn of basicBtns"
>
<PopconfirmDelete
:url=
"`/api/v1/roles/$
{row.roleId}`"
:cb="refreshTable"
:key="btn.label"
v-if="btn.type === 'del'"
/>
<a
@
click=
"() => btn?.click(row, btn)"
:key=
"btn.label"
>
{{
btn
.
label
}}
</a>
<a-divider
type=
"vertical"
:key=
"btn.label + 'divider'"
/>
</
template
>
<
template
v-if=
"moreBtns.length"
>
<a-popover>
<template
slot=
"content"
>
<a
v-for=
"btn of moreBtns"
:key=
"btn.label"
@
click=
"() => btn?.click(row, btn)"
>
{{
btn
.
label
}}
</a>
</
template
>
<a>
...
</a>
</a-popover>
</template>
</template>
</a-table-column>
</template>
<
script
>
export
default
{
props
:
{
title
:
{
type
:
String
,
default
:
'
操作
'
,
},
buttons
:
{
type
:
Array
,
default
:
()
=>
[
{
label
:
'
查看
'
,
onClick
(
row
)
{},
type
:
'
del
'
,
},
],
},
},
computed
:
{
basicBtns
()
{
return
this
.
buttons
.
length
>
3
?
this
.
buttons
.
slice
(
0
,
3
)
:
this
.
buttons
;
},
moreBtns
()
{
return
this
.
buttons
.
length
>
3
?
this
.
buttons
.
slice
(
3
)
:
[];
},
},
};
</
script
>
src/components/table/index.vue
View file @
09240bbb
...
...
@@ -7,7 +7,7 @@
<div
class=
"tw-text-right tw-mt-2"
>
<a-space>
<a-button
@
click=
"queryForm =
{}">重置
</a-button>
<a-button
@
click=
"queryForm =
{
...initQuery
}">重置
</a-button>
<a-button
type=
"primary"
@
click=
"getData"
>
查询
</a-button>
</a-space>
</div>
...
...
@@ -39,7 +39,7 @@
:closable=
"false"
:drawerStyle=
"drawerStyle"
:bodyStyle=
"bodyStyle"
:width=
"addBtn.width"
:width=
"addBtn.width
|| 600
"
destroyOnClose
>
<div
class=
"tw-overflow-y-hidden"
>
...
...
@@ -73,9 +73,15 @@ export default {
noPage
:
Boolean
,
},
data
()
{
this
.
initQuery
=
{
pageNum
:
1
,
pageSize
:
10
,
};
return
{
data
:
[],
queryForm
:
{},
queryForm
:
{
...
this
.
initQuery
,
},
loading
:
false
,
addVisible
:
false
,
submitLoading
:
false
,
...
...
@@ -106,14 +112,24 @@ export default {
async
getData
()
{
this
.
loading
=
true
;
try
{
const
res
=
await
request
(
this
.
url
,
METHOD
.
GET
);
if
(
this
.
formatData
)
this
.
data
=
this
.
formatData
(
res
);
else
this
.
data
=
res
;
this
.
noPage
?
await
this
.
getDataNoPage
()
:
await
this
.
getDataWithPage
();
}
catch
(
error
)
{
// todo
}
this
.
loading
=
false
;
},
async
getDataNoPage
()
{
const
res
=
await
request
(
this
.
url
,
METHOD
.
GET
);
if
(
this
.
formatData
)
this
.
data
=
this
.
formatData
(
res
);
else
this
.
data
=
res
;
},
async
getDataWithPage
()
{
const
res
=
await
request
(
this
.
url
,
METHOD
.
GET
,
this
.
queryForm
);
if
(
this
.
formatData
)
this
.
data
=
this
.
formatData
(
res
);
else
this
.
data
=
res
.
records
;
},
add
()
{
this
.
addVisible
=
true
;
},
...
...
src/pages/frame/store/accountModule.js
View file @
09240bbb
...
...
@@ -8,7 +8,7 @@ export default {
},
//大量共享的方法
getters
:
{
user
:
(
state
)
=>
{
user
:
state
=>
{
if
(
!
state
.
user
)
{
try
{
const
user
=
localStorage
.
getItem
(
process
.
env
.
VUE_APP_USER_KEY
);
...
...
@@ -19,31 +19,27 @@ export default {
}
return
state
.
user
;
},
permissions
:
(
state
)
=>
{
permissions
:
state
=>
{
if
(
!
state
.
permissions
)
{
try
{
const
permissions
=
localStorage
.
getItem
(
process
.
env
.
VUE_APP_PERMISSIONS_KEY
);
state
.
permissions
=
JSON
.
parse
(
permissions
);
state
.
permissions
=
state
.
permissions
?
state
.
permissions
:
[];
state
.
permissions
=
[];
}
catch
(
e
)
{
console
.
error
(
e
.
message
);
}
}
return
state
.
permissions
;
},
roles
:
(
state
)
=>
{
roles
:
state
=>
{
if
(
!
state
.
roles
)
{
try
{
const
roles
=
localStorage
.
getItem
(
process
.
env
.
VUE_APP_ROLES_KEY
);
state
.
roles
=
JSON
.
parse
(
roles
);
state
.
roles
=
state
.
roles
?
state
.
roles
:
[];
state
.
roles
=
[];
}
catch
(
e
)
{
console
.
error
(
e
.
message
);
}
}
return
state
.
roles
;
},
routesConfig
:
(
state
)
=>
{
routesConfig
:
state
=>
{
if
(
!
state
.
routesConfig
)
{
try
{
const
routesConfig
=
localStorage
.
getItem
(
process
.
env
.
VUE_APP_ROUTES_KEY
);
...
...
src/pages/system/view/menu/MenuManagement.vue
View file @
09240bbb
...
...
@@ -37,7 +37,6 @@ export default {
addBtn
:
{
text
:
'
新建
'
,
title
:
'
菜单配置
'
,
width
:
400
,
onOk
()
{
return
vm
.
$refs
[
'
addForm
'
]?.
submit
();
},
...
...
src/pages/system/view/role/RoleManagement.vue
View file @
09240bbb
<
template
>
<my-table
url=
"/api/v1/roles"
rowKey=
"roleId"
:addBtn=
"addBtn"
ref=
"table"
>
<my-table
url=
"/api/v1/roles"
rowKey=
"roleId"
:addBtn=
"addBtn"
ref=
"table"
noPage
>
<template
#add
>
<Form
ref=
"form"
/>
</
template
>
...
...
@@ -26,7 +26,7 @@ export default {
components
:
{
Form
,
PopconfirmDelete
},
data
()
{
return
{
addBtn
:
{
width
:
400
,
onOk
:
()
=>
this
.
$refs
[
'
form
'
]?.
submit
()
},
addBtn
:
{
onOk
:
()
=>
this
.
$refs
[
'
form
'
]?.
submit
()
},
};
},
methods
:
{
...
...
src/pages/system/view/task/index.vue
0 → 100644
View file @
09240bbb
<
template
>
<my-table
url=
"/api/v1/schedules"
rowKey=
"taskId"
>
<a-table-column
title=
"任务名称"
data-index=
"taskName"
/>
<a-table-column
title=
"调度规则"
data-index=
"taskRule"
/>
<a-table-column
title=
"实现类"
data-index=
"implementClass"
/>
<a-table-column
title=
"说明"
data-index=
"remark"
/>
<a-table-column
title=
"操作"
data-index=
"remark"
/>
</my-table>
</
template
>
<
script
>
export
default
{};
</
script
>
src/router/config.js
View file @
09240bbb
...
...
@@ -95,6 +95,11 @@ const options = {
name
:
'
日志管理
'
,
component
:
()
=>
import
(
'
@/pages/system/view/log
'
),
},
{
path
:
'
task_management
'
,
name
:
'
任务管理
'
,
component
:
()
=>
import
(
'
@/pages/system/view/task/index.vue
'
),
},
],
},
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment