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
cda32065
Commit
cda32065
authored
Jun 06, 2024
by
高滢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(安全隐患管理): 模块
parent
3677e848
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
452 additions
and
2 deletions
+452
-2
SaftyManage.ts
src/api/project/SaftyManage.ts
+20
-0
potentialSafety.ts
src/router/routes/modules/potentialSafety.ts
+1
-1
safetyEducation.ts
src/router/routes/modules/safetyEducation.ts
+1
-1
data.ts
src/views/potentialSafety/data.ts
+188
-0
index.vue
src/views/potentialSafety/index.vue
+93
-0
safetyDrawer.vue
src/views/potentialSafety/safetyDrawer.vue
+78
-0
index.vue
src/views/safetyEducation/index.vue
+71
-0
No files found.
src/api/project/SaftyManage.ts
0 → 100644
View file @
cda32065
import
{
defHttp
}
from
'@/utils/http/axios'
;
import
{
ProjectModel
,
ProjectParams
}
from
'@/api/project/model/projectModel'
;
enum
Api
{
GetList
=
'/pro/dangerManagement/page'
,
UpdateProject
=
'/pro/dangerManagement/update'
,
DeleteProject
=
'/pro/dangerManagement/del'
,
}
export
const
getListByPage
=
(
params
?:
ProjectParams
)
=>
defHttp
.
post
<
ProjectModel
>
({
url
:
Api
.
GetList
,
data
:
params
});
export
const
addItem
=
(
params
?:
any
)
=>
defHttp
.
post
<
ProjectModel
>
({
url
:
Api
.
UpdateProject
,
data
:
params
});
export
const
updateItem
=
(
params
?:
any
)
=>
defHttp
.
post
<
ProjectModel
>
({
url
:
Api
.
UpdateProject
,
data
:
params
});
export
const
deleteItem
=
(
params
?:
any
)
=>
defHttp
.
delete
<
ProjectModel
>
({
url
:
Api
.
DeleteProject
,
params
});
src/router/routes/modules/potentialSafety.ts
View file @
cda32065
...
@@ -17,7 +17,7 @@ const potentialSafety: AppRouteModule = {
...
@@ -17,7 +17,7 @@ const potentialSafety: AppRouteModule = {
{
{
path
:
'index'
,
path
:
'index'
,
name
:
'potentialSafety'
,
name
:
'potentialSafety'
,
component
:
()
=>
import
(
'@/views/
dashboard/analysis
/index.vue'
),
component
:
()
=>
import
(
'@/views/
potentialSafety
/index.vue'
),
meta
:
{
meta
:
{
// affix: true,
// affix: true,
title
:
'安全隐患管理'
,
title
:
'安全隐患管理'
,
...
...
src/router/routes/modules/safetyEducation.ts
View file @
cda32065
...
@@ -17,7 +17,7 @@ const safetyEducation: AppRouteModule = {
...
@@ -17,7 +17,7 @@ const safetyEducation: AppRouteModule = {
{
{
path
:
'index'
,
path
:
'index'
,
name
:
'safetyEducation'
,
name
:
'safetyEducation'
,
component
:
()
=>
import
(
'@/views/
dashboard/analysis
/index.vue'
),
component
:
()
=>
import
(
'@/views/
safetyEducation
/index.vue'
),
meta
:
{
meta
:
{
// affix: true,
// affix: true,
title
:
'安全教育培训'
,
title
:
'安全教育培训'
,
...
...
src/views/potentialSafety/data.ts
0 → 100644
View file @
cda32065
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'
,
},
},
{
label
:
'隐患描述'
,
field
:
'describe'
,
labelWidth
:
'140px'
,
required
:
true
,
component
:
'Input'
,
},
{
label
:
'隐患级别'
,
labelWidth
:
'140px'
,
field
:
'level'
,
required
:
true
,
component
:
'Select'
,
componentProps
:
{
options
:
[
{
label
:
'一级'
,
value
:
'一级'
,
},
{
label
:
'二级'
,
value
:
'二级'
,
},
{
label
:
'三级'
,
value
:
'三级'
,
},
],
},
},
{
label
:
'计划费用(万元)'
,
labelWidth
:
'140px'
,
field
:
'planCost'
,
required
:
true
,
component
:
'Input'
,
},
{
label
:
'实际费用(万元)'
,
labelWidth
:
'140px'
,
field
:
'planCost'
,
required
:
true
,
component
:
'Input'
,
},
{
field
:
'actualTime'
,
labelWidth
:
'140px'
,
label
:
'实际时间'
,
required
:
true
,
component
:
'DatePicker'
,
componentProps
:
{
placeholder
:
'选择实际时间'
,
style
:
{
width
:
'100%'
},
valueFormat
:
'YYYY-MM-DD'
,
format
:
'YYYY-MM-DD'
,
},
},
{
field
:
'planTime'
,
labelWidth
:
'140px'
,
label
:
'计划时间'
,
required
:
true
,
component
:
'DatePicker'
,
componentProps
:
{
placeholder
:
'选择计划时间'
,
style
:
{
width
:
'100%'
},
valueFormat
:
'YYYY-MM-DD'
,
format
:
'YYYY-MM-DD'
,
},
},
{
label
:
'隐患后的评估情况'
,
labelWidth
:
'140px'
,
field
:
'assessmentSituation'
,
required
:
true
,
component
:
'Input'
,
},
{
label
:
'责任人'
,
labelWidth
:
'140px'
,
field
:
'responsiblePerson'
,
required
:
true
,
component
:
'Select'
,
componentProps
:
{
options
:
[
{
label
:
'责任人一'
,
value
:
'责任人一'
,
},
{
label
:
'责任人二'
,
value
:
'责任人二'
,
},
],
},
},
];
export
const
columns
:
BasicColumn
[]
=
[
{
title
:
'填报周期'
,
dataIndex
:
'fillingPeriod'
,
width
:
150
,
},
{
title
:
'隐患描述'
,
dataIndex
:
'describe'
,
width
:
150
,
},
{
title
:
'隐患级别'
,
dataIndex
:
'level'
,
width
:
150
,
},
{
title
:
'计划费用(万元)'
,
dataIndex
:
'planCost'
,
width
:
180
,
},
{
title
:
'实际费用(万元)'
,
dataIndex
:
'actualCost'
,
width
:
180
,
},
{
title
:
'计划时间'
,
dataIndex
:
'planTime'
,
width
:
180
,
},
{
title
:
'实际时间'
,
dataIndex
:
'actualTime'
,
width
:
180
,
},
{
title
:
'隐患治理后的评估情况'
,
dataIndex
:
'assessmentSituation'
,
width
:
180
,
},
{
title
:
'责任人'
,
dataIndex
:
'responsiblePerson'
,
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
:
'ProjecName'
,
label
:
''
,
component
:
'Select'
,
componentProps
:
{
options
:
[
{
label
:
'公司名称1'
,
value
:
'公司名称1'
},
{
label
:
'公司名称2'
,
value
:
'公司名称2'
},
],
placeholder
:
'公司名称'
,
},
colProps
:
{
span
:
4
},
},
];
src/views/potentialSafety/index.vue
0 → 100644
View file @
cda32065
<
template
>
<div>
<BasicTable
@
register=
"registerTable"
:title=
"'安全隐患管理'"
>
<template
#
toolbar
>
<a-button
type=
"primary"
icon=
""
@
click=
"handleCreate"
>
新建安全隐患
</a-button>
</
template
>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.key === 'action'"
>
<TableAction
:actions=
"[
{
label: '详情',
onClick: handleDetails.bind(null, record, true),
},
{
label: '编辑',
onClick: handleEdit.bind(null, record, false),
},
{
label: '删除',
color: 'error',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record),
},
},
]"
/>
</
template
>
</template>
</BasicTable>
<safety-drawer
@
register=
"registerDrawer"
@
success=
"handleSuccess"
/>
</div>
</template>
<
script
setup
lang=
"ts"
>
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
getListByPage
}
from
'@/api/project/SaftyManage'
;
import
{
columns
,
searchFormSchema
,
}
from
'@/views/potentialSafety/data'
;
import
{
useDrawer
}
from
"@/components/Drawer"
;
import
SafetyDrawer
from
"@/views/potentialSafety/safetyDrawer.vue"
;
import
{
deleteItem
}
from
"@/api/project/SaftyManage"
;
const
[
registerDrawer
,
{
openDrawer
}]
=
useDrawer
();
const
[
registerTable
,
{
reload
}]
=
useTable
({
api
:
getListByPage
,
columns
,
formConfig
:
{
labelWidth
:
120
,
schemas
:
searchFormSchema
,
},
useSearchForm
:
true
,
showTableSetting
:
false
,
bordered
:
true
,
showIndexColumn
:
false
,
actionColumn
:
{
width
:
80
,
title
:
'操作'
,
dataIndex
:
'action'
,
fixed
:
undefined
,
},
});
async
function
handleEdit
(
record
:
Recordable
,
disabled
:
boolean
)
{
openDrawer
(
true
,
{
record
,
isUpdate
:
true
,
});
}
async
function
handleDetails
(
record
:
Recordable
,
disabled
:
boolean
)
{
openDrawer
(
true
,
{
record
,
isUpdate
:
true
,
disabled
,
});
}
function
handleDelete
(
record
:
Recordable
)
{
deleteItem
({
id
:
record
.
id
});
reload
();
}
function
handleCreate
()
{
openDrawer
(
true
,
{
isUpdate
:
false
,
});
}
</
script
>
<
style
scoped
lang=
"less"
></
style
>
src/views/potentialSafety/safetyDrawer.vue
0 → 100644
View file @
cda32065
<
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/SaftyManage'
;
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
0 → 100644
View file @
cda32065
<
template
>
<div>
<BasicTable
@
register=
"registerTable"
:title=
"'变更签证管理'"
>
<template
#
toolbar
>
<a-button
type=
"primary"
icon=
""
>
新建变更签证管理
</a-button>
</
template
>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.key === 'action'"
>
<TableAction
:actions=
"[
{
icon: 'clarity:note-edit-line',
onClick: handleEdit.bind(null, record),
},
{
icon: 'ant-design:delete-outlined',
color: 'error',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record),
},
},
]"
/>
</
template
>
</template>
</BasicTable>
</div>
</template>
<
script
setup
lang=
"ts"
>
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
getListByPage
}
from
'@/api/project/biddingPlan'
;
import
{
columns
,
searchFormSchema
,
}
from
'@/views/changeSignature/changeSignatrue.data'
;
const
[
registerTable
,
{
reload
}]
=
useTable
({
api
:
getListByPage
,
columns
,
formConfig
:
{
labelWidth
:
120
,
schemas
:
searchFormSchema
,
},
useSearchForm
:
true
,
showTableSetting
:
false
,
bordered
:
true
,
showIndexColumn
:
false
,
actionColumn
:
{
width
:
80
,
title
:
'操作'
,
dataIndex
:
'action'
,
// slots: { customRender: 'action' },
fixed
:
undefined
,
},
});
function
handleEdit
(
record
:
Recordable
)
{
openDrawer
(
true
,
{
record
,
isUpdate
:
true
,
});
}
function
handleDelete
(
record
:
Recordable
)
{
console
.
log
(
record
);
}
</
script
>
<
style
scoped
lang=
"less"
></
style
>
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