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
e475dc6c
Commit
e475dc6c
authored
Jul 03, 2024
by
牛虎林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
厉害记录添加接口组件开发完成
parent
0d347129
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
189 additions
and
14 deletions
+189
-14
operations.ts
src/api/operations/operations.ts
+41
-0
Operations.vue
src/components/Operations/Operations.vue
+99
-0
EnterpriseProject.vue
...views/dashboard/analysis/components/EnterpriseProject.vue
+12
-12
index.vue
src/views/settlementManagement/index.vue
+7
-1
settlementManageEdit.vue
src/views/settlementManagement/settlementManageEdit.vue
+30
-1
No files found.
src/api/operations/operations.ts
0 → 100644
View file @
e475dc6c
import
{
ProjectParams
,
ProjectModel
,
}
from
'@/api/project/model/projectModel'
;
import
{
defHttp
}
from
'@/utils/http/axios'
;
enum
Api
{
//查询厉害记录
operationList
=
'/pro/operator/oper-list'
,
//添加变更记录
addItem
=
'/pro/operator/add-operator'
,
}
export
enum
operateType
{
update
=
"修改"
,
add
=
"新增"
,
delete
=
"删除"
,
audit
=
"审核"
,
}
export
const
addItemData
=
{
operateType
:
null
,
businessType
:
null
,
businessId
:
null
,
}
export
const
getOperationList
=
(
params
?:
ProjectParams
)
=>
defHttp
.
get
<
ProjectModel
>
({
url
:
Api
.
operationList
,
params
})
export
const
addItemApi
=
(
params
?:
any
)
=>
defHttp
.
post
<
ProjectModel
>
(
{
url
:
Api
.
addItem
,
data
:
params
,
headers
:
{
'Content-Type'
:
'application/json;charset=UTF-8'
,
},
}
);
src/components/Operations/Operations.vue
0 → 100644
View file @
e475dc6c
<
template
>
<BasicDrawer
v-bind=
"$attrs"
@
register=
"registerDrawer"
showFooter
title=
"历史记录"
width=
"500px"
@
ok=
"handleSubmit"
>
<Timeline>
<Timeline
.
Item
v-for=
"item in showData"
>
<div
class=
"timeCard"
>
<div
class=
"timeCard-time"
>
{{
formatDateToMMDD
(
item
.
operatorTime
)
}}
</div>
<div
class=
"timeCard-content"
>
<img
src=
"/src/assets/images/header.jpg"
class=
"timeCard-head"
alt=
""
/>
<div
class=
"timeCard-right"
>
<div
class=
"timeCard-right-name"
><span>
{{
item
.
operator
}}
</span>
<span
style=
"font-size: 12px;margin-left: 10px"
>
{{
item
.
deptName
}}
</span>
</div
>
<div
class=
"timeCard-right-detail"
>
{{
item
.
operateType
}}
了数据
</div>
<div
class=
"timeCard-right-times"
>
<Icon
icon=
"ant-design:clock-circle-twotone"
/>
{{
item
.
operatorTime
}}
</div
>
</div>
</div>
</div>
</Timeline
.Item
>
</Timeline>
</BasicDrawer>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
onMounted
,
ref
}
from
'vue'
;
import
{
BasicDrawer
,
useDrawerInner
}
from
'@/components/Drawer'
;
import
{
Timeline
}
from
"ant-design-vue"
;
import
Icon
from
"@/components/Icon/Icon.vue"
;
import
{
getOperationList
}
from
"@/api/operations/operations"
import
{
dateUtil
}
from
"@/utils/dateUtil"
;
const
showData
=
ref
([])
onMounted
(
async
()
=>
{});
const
[
registerDrawer
,
{
setDrawerProps
,
closeDrawer
}]
=
useDrawerInner
(
async
(
data
)
=>
{
console
.
log
(
data
,
"传递数据查看"
)
const
showDataList
=
await
getOperationList
(
data
)
showData
.
value
=
showDataList
console
.
log
(
showDataList
,
"传递数据查看"
)
});
function
handleSubmit
()
{
closeDrawer
();
}
function
formatDateToMMDD
(
dateString
)
{
const
dateParts
=
dateString
.
split
(
'-'
);
// 分割输入的日期字符串
const
month
=
dateParts
[
1
].
padStart
(
2
,
'0'
);
// 获取月份并保证两位数
const
day
=
dateParts
[
2
].
padStart
(
2
,
'0'
);
// 获取日期并保证两位数
return
`
${
month
}
-
${
day
}
`
;
}
</
script
>
<
style
lang=
"less"
scoped
>
.timeCard {
&-time {
font-size: 14px;
font-weight: 600;
}
&-content {
display: flex;
align-items: flex-start;
justify-content: flex-start;
margin: 10px;
}
&-right {
width: 400px;
padding: 10px;
box-shadow: rgba(0, 0, 0, 0.098) 0px 0px 5px;
border-radius: 10px;
&-name {
display: flex;
align-items: center;
justify-content: flex-start;
}
&-detail {
display: flex;
align-items: center;
justify-content: flex-start;
}
&-times {
display: flex;
align-items: center;
justify-content: flex-start;
}
}
&-head {
border-radius: 50%;
width: 40px;
margin-right: 10px;
}
}
</
style
>
src/views/dashboard/analysis/components/EnterpriseProject.vue
View file @
e475dc6c
...
...
@@ -57,18 +57,18 @@ onMounted( async ()=>{
axisLabel
:
{
//设置字体大小
show
:
true
,
formatter
:
function
(
value
)
{
const
charPerLine
=
6
;
// 每行显示的字符数
let
result
=
''
;
for
(
let
i
=
0
;
i
<
value
.
length
;
i
+=
charPerLine
)
{
if
(
i
+
charPerLine
<
value
.
length
)
{
result
+=
value
.
substring
(
i
,
i
+
charPerLine
)
+
'
\
n'
;
}
else
{
result
+=
value
.
substring
(
i
);
}
}
return
result
;
},
//
formatter: function (value) {
//
const charPerLine = 6; // 每行显示的字符数
//
let result = '';
//
for (let i = 0; i
<
value
.
length
;
i
+=
charPerLine
)
{
//
if (i + charPerLine
<
value
.
length
)
{
// result += value.substring(i, i + charPerLine) + '\n'
+ '\n';
//
} else {
//
result += value.substring(i);
//
}
//
}
//
return result;
//
},
textStyle
:
{
//设置字体大小
fontSize
:
10
,
...
...
src/views/settlementManagement/index.vue
View file @
e475dc6c
...
...
@@ -54,6 +54,9 @@
</div>
</template>
<
script
lang=
"ts"
setup
>
//审核相关操作
import
{
operateType
,
addItemApi
,
addItemData
}
from
"@/api/operations/operations"
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
yearModal
from
'@/components/yearModal/yearModal.vue'
;
import
{
useModal
}
from
'@/components/Modal'
;
...
...
@@ -127,7 +130,10 @@ async function handleDelete(record: Recordable) {
async
function
examine
(
record
:
Recordable
,
disabled
:
boolean
)
{
const
id
=
record
.
id
const
res
=
await
auditItem
({
id
})
console
.
log
(
res
)
addItemData
.
operateType
=
operateType
.
audit
addItemData
.
businessId
=
record
.
id
addItemData
.
businessType
=
"结算管理"
const
showDatem
=
await
addItemApi
(
addItemData
)
reload
();
}
function
handleSuccess
()
{
...
...
src/views/settlementManagement/settlementManageEdit.vue
View file @
e475dc6c
...
...
@@ -2,6 +2,7 @@
<PageWrapper
:title=
"getTitle"
:contentBackground=
"false"
headerSticky
>
<template
#
extra
>
<a-button
type=
"primary"
@
click=
"handleSubmit"
v-if=
"isUpdate"
>
提交
</a-button>
<a-button
type=
"primary"
@
click=
"history"
v-if=
"historyData"
>
历史记录
</a-button>
<a-button
type=
"default"
@
click=
"router.back()"
>
返回
</a-button>
<!--
<a-button
type=
"success"
@
click=
"examine"
v-if=
"isUpdate==false && statusResult !='0'"
>
审核
</a-button>
-->
</
template
>
...
...
@@ -26,12 +27,20 @@
</a-button>
<contractDrawer
@
register=
"registerDrawer"
@
success=
"handleSuccess"
/>
<projectlibraryModel
@
register=
"register"
@
close=
"handleNewData"
/>
<Operations
@
register=
"registerDrawer"
/>
</PageWrapper>
</template>
<
script
lang=
"ts"
setup
>
//历史记录相关
import
{
operateType
,
addItemApi
,
addItemData
}
from
"@/api/operations/operations"
//历史记录
import
Operations
from
"@/components/Operations/Operations.vue"
//历史记录是否可查
const
historyData
=
ref
(
true
)
//标题
import
{
router
}
from
'@/router'
;
const
getTitle
=
ref
(
''
);
import
{
unref
,
computed
,
onMounted
,
ref
,
reactive
}
from
'vue'
;
import
projectlibraryModel
from
'@/components/ContractModel/Contract.vue'
;
...
...
@@ -54,6 +63,7 @@
import
{
nextTick
}
from
'vue'
;
const
[
registerDrawer
,
{
openDrawer
}]
=
useDrawer
();
import
{
useModal
}
from
'@/components/Modal'
;
import
SafetyEducationDrawer
from
"@/views/project/safetyEducationDrawer/safetyEducationDrawer.vue"
;
const
[
register
,
{
openModal
:
openModal
}]
=
useModal
();
const
{
createMessage
}
=
useMessage
();
const
isUpdate
=
ref
(
false
);
...
...
@@ -73,6 +83,7 @@
routeId
.
value
=
id
;
statusResult
.
value
=
route
.
query
.
statusResult
;
if
(
!
id
)
{
historyData
.
value
=
false
isUpdate
.
value
=
route
.
query
.
add
=
'add'
?
true
:
false
;
console
.
log
(
isUpdate
.
value
);
formData
.
value
.
management
=
[];
...
...
@@ -222,8 +233,17 @@
management
:
unref
(
formData
).
management
}
res
=
await
updateItem
(
requestDate
);
addItemData
.
operateType
=
operateType
.
update
addItemData
.
businessId
=
routeId
.
value
addItemData
.
businessType
=
"结算管理"
const
showDatem
=
await
addItemApi
(
addItemData
)
}
else
{
res
=
await
addItems
(
unref
(
formData
));
addItemData
.
operateType
=
operateType
.
add
addItemData
.
businessId
=
res
addItemData
.
businessType
=
"结算管理"
const
showDatem
=
await
addItemApi
(
addItemData
)
console
.
log
(
showDatem
,
"记录添加成功"
)
}
loading
.
value
=
false
;
// loading.value = false;
...
...
@@ -239,4 +259,13 @@
await
auditItem
({
id
});
statusResult
.
value
=
'1'
;
}
function
history
(){
openDrawer
(
true
,{
businessId
:
routeId
.
value
,
businessType
:
"结算管理"
,
});
console
.
log
(
"历史记录"
)
}
</
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