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
ac7b0e9f
Commit
ac7b0e9f
authored
Jul 02, 2021
by
水落(YangLei)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 任务管理完成
parent
c351dac8
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1271 additions
and
1203 deletions
+1271
-1203
src/api/index.js
src/api/index.js
+1
-0
src/api/task.js
src/api/task.js
+9
-0
src/components/Acron/ACron.vue
src/components/Acron/ACron.vue
+71
-68
src/components/Acron/AntCron.vue
src/components/Acron/AntCron.vue
+1159
-1112
src/components/FormMixin/index.js
src/components/FormMixin/index.js
+3
-2
src/components/action_button/index.vue
src/components/action_button/index.vue
+0
-1
src/components/table/index.vue
src/components/table/index.vue
+1
-0
src/pages/system/view/menu/MenuManagement.vue
src/pages/system/view/menu/MenuManagement.vue
+1
-2
src/pages/system/view/task/form.vue
src/pages/system/view/task/form.vue
+17
-15
src/pages/system/view/task/index.vue
src/pages/system/view/task/index.vue
+9
-3
No files found.
src/api/index.js
View file @
ac7b0e9f
import
{
request
,
METHOD
}
from
'
@/utils
'
;
export
*
from
'
./menu
'
;
export
*
from
'
./system
'
;
export
*
from
'
./task
'
;
export
function
getUserDetailInfoApi
()
{
return
request
(
'
/api/v1/detail
'
,
METHOD
.
GET
);
...
...
src/api/task.js
0 → 100644
View file @
ac7b0e9f
import
{
postReq
,
putReq
}
from
'
@/utils
'
;
export
function
addTaskApi
(
data
)
{
return
postReq
(
'
/api/v1/schedules
'
,
data
);
}
export
function
updateTaskApi
(
data
)
{
return
putReq
(
'
/api/v1/schedules
'
,
data
);
}
src/components/Acron/ACron.vue
View file @
ac7b0e9f
<
template
>
<div
class=
"components-input-demo-presuffix"
>
<a-input
:placeholder=
"placeholder"
:value=
"cron"
@
input=
"handleinput
"
>
<a-icon
slot=
"prefix"
type=
"schedule"
title=
"corn控件"
@
click=
"openModal"
/>
<a-icon
v-if=
"cron"
slot=
"suffix"
type=
"close-circle"
@
click=
"handleEmpty"
title=
"清空"
/>
</a-input>
<AntCron
ref=
"innerVueCron"
:data=
"afterCron"
@
ok=
"handleOK"
></AntCron>
</div>
<div
class=
"components-input-demo-presuffix"
>
<a-input
:placeholder=
"placeholder"
:value=
"cron"
@
input=
"handleinput"
:disabled=
"disabled
"
>
<a-icon
slot=
"prefix"
type=
"schedule"
title=
"corn控件"
@
click=
"openModal"
/>
<a-icon
v-if=
"cron"
slot=
"suffix"
type=
"close-circle"
@
click=
"handleEmpty"
title=
"清空"
/>
</a-input>
<AntCron
ref=
"innerVueCron"
:data=
"afterCron"
@
ok=
"handleOK"
></AntCron>
</div>
</
template
>
<
script
>
import
AntCron
from
"
./AntCron
"
;
import
{
replaceWeekName
}
from
"
./validator
"
;
import
AntCron
from
'
./AntCron
'
;
import
{
replaceWeekName
}
from
'
./validator
'
;
export
default
{
name
:
"
ACron
"
,
components
:
{
AntCron
},
props
:
{
value
:
{
required
:
false
,
type
:
String
,
default
:
""
name
:
'
ACron
'
,
components
:
{
AntCron
,
},
placeholder
:
{
required
:
false
,
type
:
String
,
default
:
""
}
},
data
()
{
return
{
cron
:
this
.
value
,
afterCron
:
""
};
},
watch
:
{
value
(
val
)
{
this
.
cron
=
val
;
props
:
{
value
:
{
required
:
false
,
type
:
String
,
default
:
''
,
},
placeholder
:
{
required
:
false
,
type
:
String
,
default
:
''
,
},
disabled
:
Boolean
,
},
cron
(
val
)
{
console
.
log
(
replaceWeekName
(
val
));
this
.
afterCron
=
replaceWeekName
(
val
);
console
.
log
(
val
);
this
.
$emit
(
"
input
"
,
val
);
}
},
methods
:
{
openModal
()
{
this
.
$refs
.
innerVueCron
.
show
();
data
()
{
return
{
cron
:
this
.
value
,
afterCron
:
''
,
};
},
handleOK
(
val
)
{
this
.
cron
=
val
;
this
.
$emit
(
"
change
"
,
this
.
cron
);
watch
:
{
value
(
val
)
{
this
.
cron
=
val
;
},
cron
(
val
)
{
console
.
log
(
replaceWeekName
(
val
));
this
.
afterCron
=
replaceWeekName
(
val
);
console
.
log
(
val
);
this
.
$emit
(
'
input
'
,
val
);
},
},
handleinput
(
evt
)
{
this
.
cron
=
evt
.
target
.
value
;
if
(
this
.
cron
!==
""
)
{
this
.
$emit
(
"
change
"
,
this
.
cron
);
}
else
{
this
.
$emit
(
"
change
"
,
undefined
);
}
methods
:
{
openModal
()
{
if
(
this
.
disabled
)
return
;
this
.
$refs
.
innerVueCron
.
show
();
},
handleOK
(
val
)
{
this
.
cron
=
val
;
this
.
$emit
(
'
change
'
,
this
.
cron
);
},
handleinput
(
evt
)
{
this
.
cron
=
evt
.
target
.
value
;
if
(
this
.
cron
!==
''
)
{
this
.
$emit
(
'
change
'
,
this
.
cron
);
}
else
{
this
.
$emit
(
'
change
'
,
undefined
);
}
},
handleEmpty
()
{
if
(
this
.
disabled
)
return
;
this
.
handleOK
(
''
);
},
},
model
:
{
prop
:
'
value
'
,
event
:
'
change
'
,
},
handleEmpty
()
{
this
.
handleOK
(
""
);
}
},
model
:
{
prop
:
"
value
"
,
event
:
"
change
"
}
};
</
script
>
<
style
scoped
>
.components-input-demo-presuffix
.anticon-close-circle
{
cursor
:
pointer
;
color
:
#ccc
;
transition
:
color
0.3s
;
font-size
:
12px
;
cursor
:
pointer
;
color
:
#ccc
;
transition
:
color
0.3s
;
font-size
:
12px
;
}
.components-input-demo-presuffix
.anticon-close-circle
:hover
{
color
:
#f5222d
;
color
:
#f5222d
;
}
.components-input-demo-presuffix
.anticon-close-circle
:active
{
color
:
#666
;
color
:
#666
;
}
</
style
>
\ No newline at end of file
</
style
>
src/components/Acron/AntCron.vue
View file @
ac7b0e9f
This diff is collapsed.
Click to expand it.
src/components/FormMixin/index.js
View file @
ac7b0e9f
...
...
@@ -20,15 +20,16 @@ export default {
async
submit
()
{
await
this
.
$refs
.
DrawerForm
.
validate
();
if
(
this
.
isAdd
)
{
return
this
?
.
add
();
return
this
.
add
();
}
if
(
this
.
isEdit
)
{
return
this
?
.
edit
();
return
this
.
edit
();
}
},
setData
(
data
,
type
)
{
this
.
form
=
{
...
data
};
this
.
type
=
type
;
console
.
log
(
data
,
type
);
},
},
};
src/components/action_button/index.vue
View file @
ac7b0e9f
...
...
@@ -62,7 +62,6 @@ export default {
},
created
()
{
this
.
init
();
console
.
log
(
this
.
buttonsArr
);
},
computed
:
{
basicBtns
()
{
...
...
src/components/table/index.vue
View file @
ac7b0e9f
...
...
@@ -180,6 +180,7 @@ export default {
this
.
addVisible
=
true
;
this
.
type
=
0
;
this
.
noFooter
=
false
;
this
.
title
=
'
新增
'
;
},
addDrawerClose
()
{
this
.
addVisible
=
false
;
...
...
src/pages/system/view/menu/MenuManagement.vue
View file @
ac7b0e9f
...
...
@@ -37,7 +37,6 @@ export default {
addBtn
:
{
text
:
'
新建
'
,
onOk
()
{
console
.
log
(
vm
.
addCom
);
return
vm
.
addCom
?
vm
.
$refs
[
'
addCom
'
]?.
submit
()
:
vm
.
$refs
[
'
addForm
'
]?.
submit
();
},
onCancel
()
{
...
...
@@ -50,7 +49,7 @@ export default {
{
label
:
'
新增组件
'
,
option
:
{
type
:
'
danger
'
,
style
:
'
color: #ff4d4f
'
,
},
click
(
row
)
{
vm
.
show
();
...
...
src/pages/system/view/task/form.vue
View file @
ac7b0e9f
<
template
>
<a-form-model
layout=
"vertical"
:model=
"form"
:rules=
"rules"
ref=
"DrawerForm"
>
<a-form-model-item
label=
"任务名称"
prop=
"
job
Name"
>
<a-input
v-model=
"form.
job
Name"
:disabled=
"isView"
/>
<a-form-model-item
label=
"任务名称"
prop=
"
task
Name"
>
<a-input
v-model=
"form.
task
Name"
:disabled=
"isView"
/>
</a-form-model-item>
<a-form-model-item
label=
"调度规则"
prop=
"
jobDescription
"
>
<
a-textarea
v-model=
"form.jobDescription"
:disabled=
"isView"
:rows=
"4
"
/>
<a-form-model-item
label=
"调度规则"
prop=
"
taskRule
"
>
<
ACron
v-model=
"form.taskRule"
:disabled=
"isView
"
/>
</a-form-model-item>
<a-form-model-item
label=
"实现类"
prop=
"
jobDescription
"
>
<a-input
v-model=
"form.
jobDescription
"
:disabled=
"isView"
/>
<a-form-model-item
label=
"实现类"
prop=
"
implementClass
"
>
<a-input
v-model=
"form.
implementClass
"
:disabled=
"isView"
/>
</a-form-model-item>
<a-form-model-item
label=
"说明"
prop=
"
jobDescription
"
>
<a-textarea
v-model=
"form.
jobDescription
"
:disabled=
"isView"
:rows=
"4"
/>
<a-form-model-item
label=
"说明"
prop=
"
remark
"
>
<a-textarea
v-model=
"form.
remark
"
:disabled=
"isView"
:rows=
"4"
/>
</a-form-model-item>
</a-form-model>
</
template
>
<
script
>
import
JobsApi
from
'
@/api/organization
'
;
import
{
addTaskApi
,
updateTaskApi
}
from
'
@/api
'
;
import
FormMixin
from
'
@/components/FormMixin
'
;
import
ACron
from
'
@/components/Acron/ACron.vue
'
;
export
default
{
components
:
{
ACron
},
props
:
[
'
row
'
],
mixins
:
[
FormMixin
],
data
()
{
return
{
rules
:
{
jobName
:
[{
required
:
true
,
message
:
'
Please select Activity zone
'
,
trigger
:
'
change
'
}],
jobDescription
:
[
{
required
:
true
,
message
:
'
Please select Activity zone
'
,
trigger
:
'
change
'
},
],
taskName
:
[{
required
:
true
}],
taskRule
:
[{
required
:
true
}],
},
};
},
methods
:
{
add
()
{
return
JobsApi
.
add
({
...
this
.
form
});
return
addTaskApi
({
...
this
.
form
});
},
edit
()
{
return
JobsApi
.
update
({
...
this
.
form
});
return
updateTaskApi
({
...
this
.
form
});
},
},
};
...
...
src/pages/system/view/task/index.vue
View file @
ac7b0e9f
<
template
>
<my-table
url=
"/api/v1/schedules"
rowKey=
"taskId"
:addBtn=
"addBtn"
ref=
"table"
>
<template
#drawer
>
<Form
ref=
"form"
/>
<Form
ref=
"form"
:row=
"currentClickRow"
/>
</
template
>
<a-table-column
title=
"任务名称"
data-index=
"taskName"
/>
<a-table-column
title=
"调度规则"
data-index=
"taskRule"
/>
...
...
@@ -23,7 +23,12 @@ export default {
components
:
{
ActionButton
,
Form
},
data
()
{
return
{
addBtn
:
{},
addBtn
:
{
onOk
:
()
=>
{
return
this
.
$refs
.
form
.
submit
();
},
},
currentClickRow
:
null
,
buttons
:
[
{
label
:
'
查看
'
,
...
...
@@ -47,8 +52,9 @@ export default {
type
:
'
confirm
'
,
label
:
'
失效
'
,
title
:
'
确认是否失效?
'
,
url
:
row
=>
`/api/v1/schedules/
${
row
.
taskId
}
`
,
url
:
row
=>
({
url
:
`/api/v1/schedules/
${
row
.
taskId
}
/pause`
,
method
:
'
del
'
})
,
after
:
()
=>
this
.
refreshTable
(),
isHidden
:
row
=>
row
.
isPaused
===
1
,
},
{
type
:
'
confirm
'
,
...
...
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