Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web-project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
紫光云
web-project
Commits
90cb58fa
Commit
90cb58fa
authored
Jun 07, 2024
by
高滢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(安全教育培训): 页面
parent
cec29ea6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
332 additions
and
16 deletions
+332
-16
safetyEducation.ts
src/api/project/safetyEducation.ts
+20
-0
data.ts
src/views/potentialSafety/data.ts
+6
-0
index.vue
src/views/potentialSafety/index.vue
+3
-3
safetyDrawer.vue
src/views/potentialSafety/safetyDrawer.vue
+1
-1
data.ts
src/views/safetyEducation/data.ts
+190
-0
educationDrawer.vue
src/views/safetyEducation/educationDrawer.vue
+78
-0
index.vue
src/views/safetyEducation/index.vue
+34
-12
No files found.
src/api/project/
SaftyManage
.ts
→
src/api/project/
safetyEducation
.ts
View file @
90cb58fa
...
@@ -2,19 +2,19 @@ import { defHttp } from '@/utils/http/axios';
...
@@ -2,19 +2,19 @@ import { defHttp } from '@/utils/http/axios';
import
{
ProjectModel
,
ProjectParams
}
from
'@/api/project/model/projectModel'
;
import
{
ProjectModel
,
ProjectParams
}
from
'@/api/project/model/projectModel'
;
enum
Api
{
enum
Api
{
GetList
=
'/pro/dangerManagement
/page'
,
GetList
=
'/pro/educationTraining
/page'
,
UpdateProject
=
'/pro/dangerManagement
/update'
,
UpdateProject
=
'/pro/educationTraining
/update'
,
DeleteProject
=
'/pro/dangerManagement
/del'
,
DeleteProject
=
'/pro/educationTraining
/del'
,
}
}
export
const
getListByPage
=
(
params
?:
ProjectParams
)
=>
export
const
getListByPage
=
(
params
?:
ProjectParams
)
=>
defHttp
.
post
<
ProjectModel
>
({
url
:
Api
.
GetList
,
data
:
params
});
defHttp
.
post
<
ProjectModel
>
({
url
:
Api
.
GetList
,
data
:
params
});
export
const
addItem
=
(
params
?:
any
)
=>
export
const
addItem
=
(
params
?:
any
)
=>
defHttp
.
post
<
ProjectModel
>
({
url
:
Api
.
UpdateProject
,
data
:
params
});
defHttp
.
post
<
ProjectModel
>
({
url
:
Api
.
UpdateProject
,
data
:
params
});
export
const
updateItem
=
(
params
?:
any
)
=>
export
const
updateItem
=
(
params
?:
any
)
=>
defHttp
.
post
<
ProjectModel
>
({
url
:
Api
.
UpdateProject
,
data
:
params
});
defHttp
.
post
<
ProjectModel
>
({
url
:
Api
.
UpdateProject
,
data
:
params
});
export
const
deleteItem
=
(
params
?:
any
)
=>
export
const
deleteItem
=
(
params
?:
any
)
=>
defHttp
.
delete
<
ProjectModel
>
({
url
:
Api
.
DeleteProject
,
params
});
defHttp
.
delete
<
ProjectModel
>
({
url
:
Api
.
DeleteProject
,
params
});
src/views/potentialSafety/data.ts
View file @
90cb58fa
...
@@ -50,6 +50,9 @@ export const formSchema: FormSchema[] = [
...
@@ -50,6 +50,9 @@ export const formSchema: FormSchema[] = [
field
:
'planCost'
,
field
:
'planCost'
,
required
:
true
,
required
:
true
,
component
:
'Input'
,
component
:
'Input'
,
componentProps
:
{
addonAfter
:
'万元'
,
},
},
},
{
{
label
:
'实际费用(万元)'
,
label
:
'实际费用(万元)'
,
...
@@ -57,6 +60,9 @@ export const formSchema: FormSchema[] = [
...
@@ -57,6 +60,9 @@ export const formSchema: FormSchema[] = [
field
:
'planCost'
,
field
:
'planCost'
,
required
:
true
,
required
:
true
,
component
:
'Input'
,
component
:
'Input'
,
componentProps
:
{
addonAfter
:
'万元'
,
},
},
},
{
{
field
:
'actualTime'
,
field
:
'actualTime'
,
...
...
src/views/potentialSafety/index.vue
View file @
90cb58fa
...
@@ -35,14 +35,14 @@
...
@@ -35,14 +35,14 @@
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
getListByPage
}
from
'@/api/project/
S
aftyManage'
;
import
{
getListByPage
}
from
'@/api/project/
s
aftyManage'
;
import
{
import
{
columns
,
columns
,
searchFormSchema
,
searchFormSchema
,
}
from
'@/views/potentialSafety/data'
;
}
from
'@/views/potentialSafety/data'
;
import
{
useDrawer
}
from
"@/components/Drawer"
;
import
{
useDrawer
}
from
"@/components/Drawer"
;
import
SafetyDrawer
from
"@/views/potentialSafety/safetyDrawer.vue"
;
import
SafetyDrawer
from
"@/views/potentialSafety/safetyDrawer.vue"
;
import
{
deleteItem
}
from
"@/api/project/
S
aftyManage"
;
import
{
deleteItem
}
from
"@/api/project/
s
aftyManage"
;
const
[
registerDrawer
,
{
openDrawer
}]
=
useDrawer
();
const
[
registerDrawer
,
{
openDrawer
}]
=
useDrawer
();
const
[
registerTable
,
{
reload
}]
=
useTable
({
const
[
registerTable
,
{
reload
}]
=
useTable
({
api
:
getListByPage
,
api
:
getListByPage
,
...
@@ -56,7 +56,7 @@ const [registerTable, { reload }] = useTable({
...
@@ -56,7 +56,7 @@ const [registerTable, { reload }] = useTable({
bordered
:
true
,
bordered
:
true
,
showIndexColumn
:
false
,
showIndexColumn
:
false
,
actionColumn
:
{
actionColumn
:
{
width
:
8
0
,
width
:
15
0
,
title
:
'操作'
,
title
:
'操作'
,
dataIndex
:
'action'
,
dataIndex
:
'action'
,
fixed
:
undefined
,
fixed
:
undefined
,
...
...
src/views/potentialSafety/safetyDrawer.vue
View file @
90cb58fa
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
import
{
BasicForm
,
useForm
,
FormActionType
}
from
'@/components/Form'
;
import
{
BasicForm
,
useForm
,
FormActionType
}
from
'@/components/Form'
;
import
{
formSchema
}
from
'./data'
;
import
{
formSchema
}
from
'./data'
;
import
{
BasicDrawer
,
useDrawerInner
}
from
'@/components/Drawer'
;
import
{
BasicDrawer
,
useDrawerInner
}
from
'@/components/Drawer'
;
import
{
addItem
,
updateItem
}
from
'@/api/project/
S
aftyManage'
;
import
{
addItem
,
updateItem
}
from
'@/api/project/
s
aftyManage'
;
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
isUpdate
=
ref
(
true
);
const
isUpdate
=
ref
(
true
);
...
...
src/views/safetyEducation/data.ts
0 → 100644
View file @
90cb58fa
import
{
BasicColumn
,
FormSchema
}
from
'@/components/Table'
;
export
const
formSchema
:
FormSchema
[]
=
[
{
field
:
'fillingPeriod'
,
labelWidth
:
'140px'
,
label
:
'填报周期'
,
required
:
true
,
component
:
'DatePicker'
,
componentProps
:
{
placeholder
:
'选择填报周期'
,
style
:
{
width
:
'100%'
},
valueFormat
:
'YYYY-MM-DD'
,
format
:
'YYYY-MM-DD'
,
},
},
{
field
:
'trainingTime'
,
labelWidth
:
'140px'
,
label
:
'培训时间'
,
required
:
true
,
component
:
'DatePicker'
,
componentProps
:
{
placeholder
:
'选择培训时间'
,
style
:
{
width
:
'100%'
},
valueFormat
:
'YYYY-MM-DD'
,
format
:
'YYYY-MM-DD'
,
},
},
{
label
:
'培训主题'
,
labelWidth
:
'140px'
,
field
:
'trainingTheme'
,
required
:
true
,
component
:
'Input'
,
},
{
label
:
'培训类型'
,
labelWidth
:
'140px'
,
field
:
'trainingType'
,
required
:
true
,
component
:
'Select'
,
componentProps
:
{
options
:
[
{
label
:
'类型一'
,
value
:
'类型一'
,
},
{
label
:
'类型二'
,
value
:
'类型二'
,
},
],
},
},
{
label
:
'培训形式'
,
labelWidth
:
'140px'
,
field
:
'trainingFormat'
,
required
:
true
,
component
:
'Input'
},
{
field
:
'trainingMeet'
,
labelWidth
:
'140px'
,
label
:
'培训会议'
,
required
:
true
,
component
:
'Input'
},
{
field
:
'trainers'
,
labelWidth
:
'140px'
,
label
:
'培训人员'
,
required
:
true
,
component
:
'Select'
,
componentProps
:
{
options
:
[
{
label
:
'人员一'
,
value
:
'人员一'
,
},
{
label
:
'人员二'
,
value
:
'人员二'
,
},
],
},
},
{
label
:
'学时(合计)'
,
labelWidth
:
'140px'
,
field
:
'knowledge'
,
required
:
true
,
component
:
'Input'
,
},
{
label
:
'人数(人)'
,
labelWidth
:
'140px'
,
field
:
'numberOfPeople'
,
required
:
true
,
component
:
'Input'
,
},
{
label
:
'备注'
,
labelWidth
:
'140px'
,
field
:
'remark'
,
required
:
true
,
component
:
'Input'
,
},
];
export
const
columns
:
BasicColumn
[]
=
[
{
title
:
'填报周期'
,
dataIndex
:
'fillingPeriod'
,
width
:
150
,
},
{
title
:
'培训时间'
,
dataIndex
:
'trainingTime'
,
width
:
150
,
},
{
title
:
'培训主题'
,
dataIndex
:
'trainingTheme'
,
width
:
150
,
},
{
title
:
'培训类型'
,
dataIndex
:
'trainingType'
,
width
:
180
,
},
{
title
:
'培训形式'
,
dataIndex
:
'trainingFormat'
,
width
:
180
,
},
{
title
:
'计划会议'
,
dataIndex
:
'trainingMeet'
,
width
:
180
,
},
{
title
:
'培训人员'
,
dataIndex
:
'trainers'
,
width
:
180
,
},
{
title
:
'学识(合计)'
,
dataIndex
:
'knowledge'
,
width
:
180
,
},
{
title
:
'人数'
,
dataIndex
:
'numberOfPeople'
,
width
:
180
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
width
:
180
,
},
];
export
const
searchFormSchema
:
FormSchema
[]
=
[
{
field
:
'fillingPeriod'
,
label
:
''
,
component
:
'DatePicker'
,
componentProps
:
{
placeholder
:
'选择填报周期'
,
style
:
{
width
:
'100%'
},
valueFormat
:
'YYYY-MM-DD'
,
format
:
'YYYY-MM-DD'
,
},
colProps
:
{
span
:
4
},
},
{
field
:
'trainers'
,
label
:
''
,
component
:
'Select'
,
componentProps
:
{
options
:
[
{
label
:
'人员一'
,
value
:
'人员一'
},
{
label
:
'人员二'
,
value
:
'人员二'
},
],
placeholder
:
'培训人员'
,
},
colProps
:
{
span
:
4
},
},
];
src/views/safetyEducation/educationDrawer.vue
0 → 100644
View file @
90cb58fa
<
template
>
<BasicDrawer
v-bind=
"$attrs"
@
register=
"registerDrawer"
showFooter
:title=
"getTitle"
width=
"700px"
@
ok=
"handleSubmit"
>
<BasicForm
ref=
"formElRef"
@
register=
"registerForm"
>
<!--
<template
#
menu=
"
{ model, field }">
</
template
>
-->
</BasicForm>
</BasicDrawer>
</template>
<
script
lang=
"ts"
setup
>
import
{
ref
,
unref
}
from
'vue'
;
import
{
BasicForm
,
useForm
,
FormActionType
}
from
'@/components/Form'
;
import
{
formSchema
}
from
'./data'
;
import
{
BasicDrawer
,
useDrawerInner
}
from
'@/components/Drawer'
;
import
{
addItem
,
updateItem
}
from
'@/api/project/safetyEducation'
;
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
isUpdate
=
ref
(
true
);
const
detailId
=
ref
(
0
);
const
formElRef
=
ref
<
Nullable
<
FormActionType
>>
(
null
);
const
[
registerForm
,
{
resetFields
,
setFieldsValue
,
validate
}]
=
useForm
({
labelWidth
:
90
,
baseColProps
:
{
span
:
24
},
schemas
:
formSchema
,
showActionButtonGroup
:
false
,
});
const
[
registerDrawer
,
{
setDrawerProps
,
closeDrawer
}]
=
useDrawerInner
(
async
(
data
)
=>
{
resetFields
();
setDrawerProps
({
confirmLoading
:
false
});
isUpdate
.
value
=
!!
data
?.
isUpdate
;
if
(
isUpdate
.
value
)
{
detailId
.
value
=
data
.
record
.
id
;
getTitle
.
value
=
'编辑安全教育'
;
}
else
{
getTitle
.
value
=
'创建安全教育'
;
}
if
(
data
.
disabled
==
true
)
{
getTitle
.
value
=
'查看安全教育'
;
const
formEl
=
unref
(
formElRef
);
if
(
!
formEl
)
return
;
await
formEl
.
setProps
({
disabled
:
true
,
});
}
if
(
unref
(
isUpdate
))
{
setFieldsValue
({
...
data
.
record
,
});
}
});
const
getTitle
=
ref
(
''
);
async
function
handleSubmit
()
{
try
{
const
values
=
await
validate
();
setDrawerProps
({
confirmLoading
:
true
});
if
(
isUpdate
.
value
)
{
values
.
id
=
detailId
.
value
;
}
// TODO custom api
console
.
log
(
values
);
let
res
=
isUpdate
.
value
?
await
updateItem
(
values
)
:
await
addItem
(
values
);
console
.
log
(
res
);
closeDrawer
();
emit
(
'success'
,
res
);
}
finally
{
setDrawerProps
({
confirmLoading
:
false
});
}
}
</
script
>
src/views/safetyEducation/index.vue
View file @
90cb58fa
<
template
>
<
template
>
<div>
<div>
<BasicTable
@
register=
"registerTable"
:title=
"'
变更签证管理
'"
>
<BasicTable
@
register=
"registerTable"
:title=
"'
安全教育培训
'"
>
<template
#
toolbar
>
<template
#
toolbar
>
<a-button
type=
"primary"
icon=
""
>
新建变更签证管理
</a-button>
<a-button
type=
"primary"
icon=
""
@
click=
"handleCreate"
>
新建安全教育
</a-button>
</
template
>
</
template
>
<
template
#
bodyCell=
"{ column, record }"
>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.key === 'action'"
>
<template
v-if=
"column.key === 'action'"
>
<TableAction
<TableAction
:actions=
"[
:actions=
"[
{
{
icon: 'clarity:note-edit-line
',
label: '详情
',
onClick: handle
Edit.bind(null, record
),
onClick: handle
Details.bind(null, record, true
),
},
},
{
{
icon: 'ant-design:delete-outlined',
label: '编辑',
onClick: handleEdit.bind(null, record, false),
},
{
label: '删除',
color: 'error',
color: 'error',
popConfirm: {
popConfirm: {
title: '是否确认删除',
title: '是否确认删除',
...
@@ -26,16 +30,20 @@
...
@@ -26,16 +30,20 @@
</
template
>
</
template
>
</template>
</template>
</BasicTable>
</BasicTable>
<safety-drawer
@
register=
"registerDrawer"
@
success=
"handleSuccess"
/>
</div>
</div>
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
getListByPage
}
from
'@/api/project/
biddingPla
n'
;
import
{
getListByPage
}
from
'@/api/project/
safetyEducatio
n'
;
import
{
import
{
columns
,
columns
,
searchFormSchema
,
searchFormSchema
,
}
from
'@/views/changeSignature/changeSignatrue.data'
;
}
from
'@/views/potentialSafety/data'
;
import
{
useDrawer
}
from
"@/components/Drawer"
;
import
SafetyDrawer
from
"@/views/safetyEducation/educationDrawer.vue"
;
import
{
deleteItem
}
from
"@/api/project/safetyEducation"
;
const
[
registerDrawer
,
{
openDrawer
}]
=
useDrawer
();
const
[
registerTable
,
{
reload
}]
=
useTable
({
const
[
registerTable
,
{
reload
}]
=
useTable
({
api
:
getListByPage
,
api
:
getListByPage
,
columns
,
columns
,
...
@@ -48,23 +56,37 @@ const [registerTable, { reload }] = useTable({
...
@@ -48,23 +56,37 @@ const [registerTable, { reload }] = useTable({
bordered
:
true
,
bordered
:
true
,
showIndexColumn
:
false
,
showIndexColumn
:
false
,
actionColumn
:
{
actionColumn
:
{
width
:
8
0
,
width
:
15
0
,
title
:
'操作'
,
title
:
'操作'
,
dataIndex
:
'action'
,
dataIndex
:
'action'
,
// slots: { customRender: 'action' },
fixed
:
undefined
,
fixed
:
undefined
,
},
},
});
});
function
handleEdit
(
record
:
Recordable
)
{
async
function
handleEdit
(
record
:
Recordable
,
disabled
:
boolean
)
{
openDrawer
(
true
,
{
openDrawer
(
true
,
{
record
,
record
,
isUpdate
:
true
,
isUpdate
:
true
,
});
});
}
}
async
function
handleDetails
(
record
:
Recordable
,
disabled
:
boolean
)
{
openDrawer
(
true
,
{
record
,
isUpdate
:
true
,
disabled
,
});
}
function
handleDelete
(
record
:
Recordable
)
{
function
handleDelete
(
record
:
Recordable
)
{
console
.
log
(
record
);
deleteItem
({
id
:
record
.
id
});
reload
();
}
function
handleCreate
()
{
openDrawer
(
true
,
{
isUpdate
:
false
,
});
}
}
</
script
>
</
script
>
...
...
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