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
df6b3c14
Commit
df6b3c14
authored
Jun 28, 2021
by
陈浩玮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
16a99e67
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
52 deletions
+73
-52
src/api/organization.js
src/api/organization.js
+0
-12
src/components/FormMixin/index.js
src/components/FormMixin/index.js
+34
-0
src/components/table/index.vue
src/components/table/index.vue
+16
-4
src/pages/system/view/organization/jobmanagement/JobManagement.vue
.../system/view/organization/jobmanagement/JobManagement.vue
+8
-8
src/pages/system/view/organization/jobmanagement/form.vue
src/pages/system/view/organization/jobmanagement/form.vue
+15
-28
No files found.
src/api/organization.js
View file @
df6b3c14
import
{
delReq
,
getReq
,
postReq
,
putReq
}
from
'
@/utils
'
;
import
{
delReq
,
getReq
,
postReq
,
putReq
}
from
'
@/utils
'
;
// export function delMenuApi(id) {
// return delReq(`/api/v1/menus/${id}`);
// }
// export function getMenuDataApi() {
// return getReq('/api/v1/menus');
// }
// export function addMenuApi(data) {
// return postReq('/api/v1/menus', data);
// }
function
addJobsApi
(
data
)
{
function
addJobsApi
(
data
)
{
return
postReq
(
'
/api/v1/jobs
'
,
data
);
return
postReq
(
'
/api/v1/jobs
'
,
data
);
}
}
...
...
src/components/FormMixin/index.js
0 → 100644
View file @
df6b3c14
export
default
{
data
()
{
return
{
type
:
0
,
form
:
{},
};
},
computed
:
{
isAdd
()
{
return
this
.
type
===
0
;
},
isEdit
()
{
return
this
.
type
===
1
;
},
isView
()
{
return
this
.
type
===
2
;
},
},
methods
:
{
async
submit
()
{
await
this
.
$refs
.
DrawerForm
.
validate
();
if
(
this
.
isAdd
)
{
return
this
?.
add
();
}
if
(
this
.
isEdit
)
{
return
this
?.
edit
();
}
},
setData
(
data
,
type
)
{
this
.
form
=
data
;
this
.
type
=
type
;
},
},
};
src/components/table/index.vue
View file @
df6b3c14
...
@@ -30,13 +30,12 @@
...
@@ -30,13 +30,12 @@
<!-- 新增 -->
<!-- 新增 -->
<a-drawer
<a-drawer
:title=
"
addBtn.title || '新建'
"
:title=
"
title
"
placement=
"right"
placement=
"right"
:visible=
"addVisible"
:visible=
"addVisible"
@
close=
"addDrawerClose"
@
close=
"addDrawerClose"
v-if=
"addBtn"
v-if=
"addBtn"
:maskClosable=
"!!addBtn.maskClosable"
:maskClosable=
"!!addBtn.maskClosable"
:closable=
"false"
:drawerStyle=
"drawerStyle"
:drawerStyle=
"drawerStyle"
:bodyStyle=
"bodyStyle"
:bodyStyle=
"bodyStyle"
:width=
"addBtn.width || 600"
:width=
"addBtn.width || 600"
...
@@ -44,7 +43,7 @@
...
@@ -44,7 +43,7 @@
>
>
<div
class=
"tw-overflow-y-hidden"
>
<div
class=
"tw-overflow-y-hidden"
>
<div
class=
"tw-overflow-y-auto tw-h-full"
>
<div
class=
"tw-overflow-y-auto tw-h-full"
>
<slot
name=
"
add
"
/>
<slot
name=
"
drawer
"
/>
</div>
</div>
</div>
</div>
<a-divider
/>
<a-divider
/>
...
@@ -78,6 +77,7 @@ export default {
...
@@ -78,6 +77,7 @@ export default {
pageSize
:
10
,
pageSize
:
10
,
};
};
return
{
return
{
title
:
'
新增
'
,
data
:
[],
data
:
[],
queryForm
:
{
queryForm
:
{
...
this
.
initQuery
,
...
this
.
initQuery
,
...
@@ -147,7 +147,19 @@ export default {
...
@@ -147,7 +147,19 @@ export default {
}
}
this
.
submitLoading
=
false
;
this
.
submitLoading
=
false
;
},
},
showAdd
()
{
show
({
type
,
title
}
=
{})
{
if
(
type
===
0
)
{
this
.
title
=
'
新增
'
;
}
if
(
type
===
1
)
{
this
.
title
=
'
编辑
'
;
}
if
(
type
===
2
)
{
this
.
title
=
'
查看
'
;
}
if
(
title
)
{
this
.
title
=
title
;
}
this
.
addVisible
=
true
;
this
.
addVisible
=
true
;
},
},
},
},
...
...
src/pages/system/view/organization/jobmanagement/JobManagement.vue
View file @
df6b3c14
<
template
>
<
template
>
<my-table
url=
"/api/v1/jobs"
rowKey=
"jobId"
:addBtn=
"addBtn"
ref=
"table"
>
<my-table
url=
"/api/v1/jobs"
rowKey=
"jobId"
:addBtn=
"addBtn"
ref=
"table"
noPage
>
<template
#
add
>
<template
#
drawer
>
<Form
ref=
"form"
/>
<Form
ref=
"form"
/>
</
template
>
</
template
>
<
template
#search=
"{ query }"
>
<
!-- <
template #search="{ query }">
<a-form-model-item label="名称">
<a-form-model-item label="名称">
<a-input v-model="query.jobName" />
<a-input v-model="query.jobName" />
</a-form-model-item>
</a-form-model-item>
</
template
>
</template>
-->
<a-table-column
title=
"名称"
data-index=
"jobName"
/>
<a-table-column
title=
"名称"
data-index=
"jobName"
/>
<a-table-column
title=
"描述"
data-index=
"jobDescription"
/>
<a-table-column
title=
"描述"
data-index=
"jobDescription"
/>
<a-table-column
title=
"操作"
>
<a-table-column
title=
"操作"
>
<
template
#default=
"row"
>
<
template
#default=
"row"
>
<a
@
click=
"() => view(row)"
>
编辑
</a>
<a
@
click=
"() => view(row
, 1
)"
>
编辑
</a>
<a-divider
type=
"vertical"
/>
<a-divider
type=
"vertical"
/>
<PopconfirmDelete
:url=
"`/api/v1/
roles/$
{row.role
Id}`" :cb="refreshTable" />
<PopconfirmDelete
:url=
"`/api/v1/
jobs/$
{row.job
Id}`" :cb="refreshTable" />
</
template
>
</
template
>
</a-table-column>
</a-table-column>
</my-table>
</my-table>
...
@@ -35,9 +35,9 @@ export default {
...
@@ -35,9 +35,9 @@ export default {
this
.
$refs
[
'
table
'
]?.
getData
();
this
.
$refs
[
'
table
'
]?.
getData
();
},
},
view
(
data
,
type
)
{
view
(
data
,
type
)
{
this
.
$refs
[
'
table
'
]?.
show
Add
(
);
this
.
$refs
[
'
table
'
]?.
show
({
type
}
);
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'
form
'
].
setData
(
data
,
type
);
this
.
$refs
[
'
form
'
].
setData
(
{
...
data
}
,
type
);
});
});
},
},
},
},
...
...
src/pages/system/view/organization/jobmanagement/form.vue
View file @
df6b3c14
<
template
>
<
template
>
<a-form-model
layout=
"vertical"
:model=
"form"
:rules=
"rules"
>
<a-form-model
layout=
"vertical"
:model=
"form"
:rules=
"rules"
ref=
"DrawerForm"
>
<a-form-model-item
label=
"名称"
>
<a-form-model-item
label=
"名称"
prop=
"jobName"
>
<a-input
v-model=
"form.jobName"
:disabled=
"isView"
/>
<a-input
v-model=
"form.jobName"
:disabled=
"isView"
/>
</a-form-model-item>
</a-form-model-item>
<a-form-model-item
label=
"描述"
>
<a-form-model-item
label=
"描述"
prop=
"jobDescription"
>
<a-textarea
v-model=
"form.jobDescription"
:disabled=
"isView"
:rows=
"4"
/>
<a-textarea
v-model=
"form.jobDescription"
:disabled=
"isView"
:rows=
"4"
/>
</a-form-model-item>
</a-form-model-item>
</a-form-model>
</a-form-model>
...
@@ -11,38 +11,25 @@
...
@@ -11,38 +11,25 @@
<
script
>
<
script
>
import
JobsApi
from
'
@/api/organization
'
;
import
JobsApi
from
'
@/api/organization
'
;
import
FormMixin
from
'
@/components/FormMixin
'
;
export
default
{
export
default
{
mixins
:
[
FormMixin
],
data
()
{
data
()
{
return
{
return
{
type
:
0
,
rules
:
{
form
:
{},
jobName
:
[{
required
:
true
,
message
:
'
Please select Activity zone
'
,
trigger
:
'
change
'
}],
rules
:
{},
jobDescription
:
[
checkedKeys
:
[],
{
required
:
true
,
message
:
'
Please select Activity zone
'
,
trigger
:
'
change
'
},
};
],
},
computed
:
{
isAdd
()
{
return
this
.
type
===
0
;
},
isEdit
()
{
return
this
.
type
===
1
;
},
isView
()
{
return
this
.
type
===
2
;
},
},
};
},
},
methods
:
{
methods
:
{
submit
()
{
add
()
{
if
(
this
.
isEdit
)
{
return
JobsApi
.
add
({
...
this
.
form
});
return
JobsApi
.
add
({
...
this
.
form
});
}
if
(
this
.
isAdd
)
{
return
JobsApi
.
update
({
...
this
.
form
});
}
},
},
setData
(
data
,
type
)
{
edit
()
{
this
.
form
=
data
;
return
JobsApi
.
update
({
...
this
.
form
});
this
.
type
=
type
;
},
},
},
},
};
};
...
...
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