Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue-composition-api
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
宁路鹏
vue-composition-api
Commits
854bf2d5
Commit
854bf2d5
authored
Jun 07, 2022
by
nlp97
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
病案首页
parent
b91eaf30
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
308 additions
and
9 deletions
+308
-9
src/components/medicalRecordHomepage/data.js
+53
-0
src/components/medicalRecordHomepage/index.scss
+82
-0
src/components/medicalRecordHomepage/index.vue
+0
-0
src/utils/formatTime.js
+164
-0
src/views/HelloWorld.vue
+9
-9
No files found.
src/components/medicalRecordHomepage/data.js
0 → 100644
View file @
854bf2d5
/*
* @Author: ninglupeng
* @Date: 2022-06-07 09:50:19
* @LastEditors: ninglupeng
* @LastEditTime: 2022-06-07 09:50:49
* @Description:
*/
export
const
Nativeplace
=
{
'01'
:
'北京市'
,
'02'
:
'天津市'
,
'03'
:
'河北省'
,
'04'
:
'山西省'
,
'05'
:
'内蒙古'
,
'06'
:
'辽宁省'
,
'07'
:
'吉林省'
,
'08'
:
'黑龙江省'
,
'09'
:
'上海市'
,
10
:
'江苏省'
,
11
:
'浙江省'
,
12
:
'安徽省'
,
13
:
'福建省'
,
14
:
'江西省'
,
15
:
'山东省'
,
16
:
'河南省'
,
17
:
'湖北省'
,
18
:
'湖南省'
,
19
:
'广东省'
,
20
:
'广西省'
,
21
:
'海南省'
,
22
:
'四川省'
,
23
:
'重庆市'
,
24
:
'贵州省'
,
25
:
'云南省'
,
26
:
'西藏'
,
27
:
'陕西省'
,
28
:
'甘肃省'
,
29
:
'青海省'
,
30
:
'宁夏'
,
31
:
'新疆'
,
32
:
'台湾'
,
33
:
'香港特,别行政区'
,
34
:
'澳门'
,
35
:
'外籍'
,
'——'
:
'——'
,
};
export
const
sex
=
{
0
:
'未知的性别'
,
1
:
'男'
,
2
:
'女'
,
9
:
'未说明的性别'
,
'——'
:
'——'
,
};
src/components/medicalRecordHomepage/index.scss
0 → 100644
View file @
854bf2d5
@import
"../../styles/mixin.scss"
;
@media
screen
and
(
min-width
:
769px
)
and
(
max-width
:
1365px
)
{
#medicalRecord
{
font-size
:
12px
!
important
;
.pageindex
{
padding
:
20px
0px
!
important
;
}
.el-row
{
margin-bottom
:
15px
!
important
;
&
:last-child
{
margin-bottom
:
0
;
}
}
.homePageTitle
{
font-size
:
25px
;
font-weight
:
bold
;
}
.key
{
font-size
:
12px
!
important
;
}
.value
{
font-size
:
12px
!
important
;
}
}
}
@media
screen
and
(
min-width
:
1366px
)
and
(
max-width
:
1440px
)
{
#medicalRecord
{
font-size
:
12px
!
important
;
.pageindex
{
padding
:
20px
0px
!
important
;
}
.el-row
{
margin-bottom
:
15px
!
important
;
&
:last-child
{
margin-bottom
:
0
;
}
}
.homePageTitle
{
font-size
:
25px
;
font-weight
:
bold
;
}
.key
{
font-size
:
12px
!
important
;
}
.value
{
font-size
:
12px
!
important
;
}
}
}
\ No newline at end of file
src/components/medicalRecordHomepage/index.vue
0 → 100644
View file @
854bf2d5
This diff is collapsed.
Click to expand it.
src/utils/formatTime.js
0 → 100644
View file @
854bf2d5
/**
* 时间日期转换
* @param date 当前时间,new Date() 格式
* @param format 需要转换的时间格式字符串
* @description format 字符串随意,如 `YYYY-mm、YYYY-mm-dd`
* @description format 季度:"YYYY-mm-dd HH:MM:SS QQQQ"
* @description format 星期:"YYYY-mm-dd HH:MM:SS WWW"
* @description format 几周:"YYYY-mm-dd HH:MM:SS ZZZ"
* @description format 季度 + 星期 + 几周:"YYYY-mm-dd HH:MM:SS WWW QQQQ ZZZ"
* @returns 返回拼接后的时间字符串
*/
export
function
formatDate
(
date
,
format
)
{
const
we
=
date
.
getDay
();
// 星期
const
z
=
getWeek
(
date
);
// 周
const
qut
=
Math
.
floor
((
date
.
getMonth
()
+
3
)
/
3
).
toString
();
// 季度
const
opt
=
{
'Y+'
:
date
.
getFullYear
().
toString
(),
// 年
'm+'
:
(
date
.
getMonth
()
+
1
).
toString
(),
// 月(月份从0开始,要+1)
'd+'
:
date
.
getDate
().
toString
(),
// 日
'H+'
:
date
.
getHours
().
toString
(),
// 时
'M+'
:
date
.
getMinutes
().
toString
(),
// 分
'S+'
:
date
.
getSeconds
().
toString
(),
// 秒
'q+'
:
qut
,
// 季度
};
// 中文数字 (星期)
const
week
=
{
0
:
'日'
,
1
:
'一'
,
2
:
'二'
,
3
:
'三'
,
4
:
'四'
,
5
:
'五'
,
6
:
'六'
,
};
// 中文数字(季度)
const
quarter
=
{
1
:
'一'
,
2
:
'二'
,
3
:
'三'
,
4
:
'四'
,
};
if
(
/
(
W+
)
/
.
test
(
format
))
{
format
=
format
.
replace
(
RegExp
.
$1
,
RegExp
.
$1
.
length
>
1
?
(
RegExp
.
$1
.
length
>
2
?
'星期'
+
week
[
we
]
:
'周'
+
week
[
we
])
:
week
[
we
]);
}
if
(
/
(
Q+
)
/
.
test
(
format
))
format
=
format
.
replace
(
RegExp
.
$1
,
RegExp
.
$1
.
length
==
4
?
'第'
+
quarter
[
qut
]
+
'季度'
:
quarter
[
qut
]);
if
(
/
(
Z+
)
/
.
test
(
format
))
format
=
format
.
replace
(
RegExp
.
$1
,
RegExp
.
$1
.
length
==
3
?
'第'
+
z
+
'周'
:
z
+
''
);
for
(
const
k
in
opt
)
{
const
r
=
new
RegExp
(
'('
+
k
+
')'
).
exec
(
format
);
// 若输入的长度不为1,则前面补零
if
(
r
)
format
=
format
.
replace
(
r
[
1
],
RegExp
.
$1
.
length
==
1
?
opt
[
k
]
:
opt
[
k
].
padStart
(
RegExp
.
$1
.
length
,
'0'
));
}
return
format
;
}
/**
* 获取当前日期是第几周
* @param dateTime 当前传入的日期值
* @returns 返回第几周数字值
*/
export
function
getWeek
(
dateTime
)
{
const
temptTime
=
new
Date
(
dateTime
.
getTime
());
// 周几
const
weekday
=
temptTime
.
getDay
()
||
7
;
// 周1+5天=周六
temptTime
.
setDate
(
temptTime
.
getDate
()
-
weekday
+
1
+
5
);
let
firstDay
=
new
Date
(
temptTime
.
getFullYear
(),
0
,
1
);
const
dayOfWeek
=
firstDay
.
getDay
();
let
spendDay
=
1
;
if
(
dayOfWeek
!=
0
)
spendDay
=
7
-
dayOfWeek
+
1
;
firstDay
=
new
Date
(
temptTime
.
getFullYear
(),
0
,
1
+
spendDay
);
const
d
=
Math
.
ceil
((
temptTime
.
valueOf
()
-
firstDay
.
valueOf
())
/
86400000
);
const
result
=
Math
.
ceil
(
d
/
7
);
return
result
;
}
/**
* 将时间转换为 `几秒前`、`几分钟前`、`几小时前`、`几天前`
* @param param 当前时间,new Date() 格式或者字符串时间格式
* @param format 需要转换的时间格式字符串
* @description param 10秒: 10 * 1000
* @description param 1分: 60 * 1000
* @description param 1小时: 60 * 60 * 1000
* @description param 24小时:60 * 60 * 24 * 1000
* @description param 3天: 60 * 60* 24 * 1000 * 3
* @returns 返回拼接后的时间字符串
*/
export
function
formatPast
(
param
,
format
)
{
// 传入格式处理、存储转换值
let
t
,
s
;
// 获取js 时间戳
let
time
=
new
Date
().
getTime
();
// 是否是对象
typeof
param
===
'string'
||
'object'
?
(
t
=
new
Date
(
param
).
getTime
())
:
(
t
=
param
);
// 当前时间戳 - 传入时间戳
time
=
Number
.
parseInt
(
`
${
time
-
t
}
`
);
if
(
time
<
10000
)
{
// 10秒内
return
'刚刚'
;
}
else
if
(
time
<
60000
&&
time
>=
10000
)
{
// 超过10秒少于1分钟内
s
=
Math
.
floor
(
time
/
1000
);
return
`
${
s
}
秒前`
;
}
else
if
(
time
<
3600000
&&
time
>=
60000
)
{
// 超过1分钟少于1小时
s
=
Math
.
floor
(
time
/
60000
);
return
`
${
s
}
分钟前`
;
}
else
if
(
time
<
86400000
&&
time
>=
3600000
)
{
// 超过1小时少于24小时
s
=
Math
.
floor
(
time
/
3600000
);
return
`
${
s
}
小时前`
;
}
else
if
(
time
<
259200000
&&
time
>=
86400000
)
{
// 超过1天少于3天内
s
=
Math
.
floor
(
time
/
86400000
);
return
`
${
s
}
天前`
;
}
else
{
// 超过3天
const
date
=
typeof
param
===
'string'
||
'object'
?
new
Date
(
param
)
:
param
;
return
formatDate
(
date
,
format
);
}
}
/**
* 时间问候语
* @param param 当前时间,new Date() 格式
* @description param 调用 `formatAxis(new Date())` 输出 `上午好`
* @returns 返回拼接后的时间字符串
*/
export
function
formatAxis
(
param
)
{
const
hour
=
new
Date
(
param
).
getHours
();
if
(
hour
<
6
)
return
'凌晨好'
;
else
if
(
hour
<
9
)
return
'早上好'
;
else
if
(
hour
<
12
)
return
'上午好'
;
else
if
(
hour
<
14
)
return
'中午好'
;
else
if
(
hour
<
17
)
return
'下午好'
;
else
if
(
hour
<
19
)
return
'傍晚好'
;
else
if
(
hour
<
22
)
return
'晚上好'
;
else
return
'夜里好'
;
}
export
function
transformTimestamp
(
timestamp
)
{
const
date
=
new
Date
(
timestamp
);
const
Y
=
date
.
getFullYear
();
const
M
=
date
.
getMonth
()
+
1
<
10
?
'0'
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
;
const
D
=
date
.
getDate
()
<
10
?
'0'
+
date
.
getDate
()
:
date
.
getDate
();
const
h
=
(
date
.
getHours
()
<
10
?
'0'
+
date
.
getHours
()
:
date
.
getHours
())
+
':'
;
const
m
=
(
date
.
getMinutes
()
<
10
?
'0'
+
date
.
getMinutes
()
:
date
.
getMinutes
())
+
':'
;
const
s
=
date
.
getSeconds
()
<
10
?
'0'
+
date
.
getSeconds
()
:
date
.
getSeconds
();
// 秒
const
dateString
=
`
${
Y
}
-
${
M
}
-
${
D
}
${
h
}${
m
}${
s
}
`
;
return
dateString
;
}
export
function
transformTimestamps
(
timestamp
)
{
const
date
=
new
Date
(
timestamp
);
const
Y
=
date
.
getFullYear
();
const
M
=
date
.
getMonth
()
+
1
<
10
?
'0'
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
;
const
D
=
date
.
getDate
()
<
10
?
'0'
+
date
.
getDate
()
:
date
.
getDate
();
const
h
=
(
date
.
getHours
()
<
10
?
'0'
+
date
.
getHours
()
:
date
.
getHours
())
+
':'
;
const
m
=
(
date
.
getMinutes
()
<
10
?
'0'
+
date
.
getMinutes
()
:
date
.
getMinutes
())
+
':'
;
const
s
=
date
.
getSeconds
()
<
10
?
'0'
+
date
.
getSeconds
()
:
date
.
getSeconds
();
// 秒
const
dateString
=
`
${
Y
}
-
${
M
}
-
${
D
}
`
;
return
dateString
;
}
src/views/HelloWorld.vue
View file @
854bf2d5
...
...
@@ -2,7 +2,7 @@
* @Author: wsq
* @Date: 2022-04-22 14:21:50
* @LastEditors: ninglupeng
* @LastEditTime: 2022-06-07
09:46:11
* @LastEditTime: 2022-06-07
10:06:20
* @Description:
-->
<
template
>
...
...
@@ -116,11 +116,11 @@
import
http
from
'../utils/http'
;
import
{
reactive
,
toRefs
,
onMounted
,
nextTick
,
computed
}
from
'@vue/composition-api'
;
import
$
from
'jquery'
;
import
{
setItem
,
getItem
}
from
'../utils/auth'
;
// import medicalRecordHomepage from 'comp
s/medicalRecordHomepage/index.vue';
import
{
setItem
}
from
'../utils/auth'
;
import
medicalRecordHomepage
from
'../component
s/medicalRecordHomepage/index.vue'
;
export
default
{
components
:
{
//
medicalRecordHomepage,
medicalRecordHomepage
,
},
name
:
'outseeQualityControl'
,
setup
()
{
...
...
@@ -152,7 +152,7 @@ export default {
const
getSynchronous
=
(
id
)
=>
{
// var loadingInstance1 = ElLoading.service(loadingOption1);
http
.
post
(
`/medical/get/Synchronization?id=
${
'
7d1e97e6-c4ab-11ec-9bd0-00155d016553
'
}
`
)
.
post
(
`/medical/get/Synchronization?id=
${
'
3606b7a5-de50-11ec-9998-9016ba5908d0
'
}
`
)
.
then
((
data
)
=>
{
// loadingInstance1.close();
// ElMessage.success(data.message);
...
...
@@ -226,10 +226,10 @@ export default {
};
onMounted
(()
=>
{
if
(
'
7d1e97e6-c4ab-11ec-9bd0-00155d016553
'
)
{
getHomePage
(
'
7d1e97e6-c4ab-11ec-9bd0-00155d016553
'
);
getScoringDetails
(
'
7d1e97e6-c4ab-11ec-9bd0-00155d016553
'
);
setItem
(
'outpid'
,
'
7d1e97e6-c4ab-11ec-9bd0-00155d016553
'
)
if
(
'
3606b7a5-de50-11ec-9998-9016ba5908d0
'
)
{
getHomePage
(
'
3606b7a5-de50-11ec-9998-9016ba5908d0
'
);
getScoringDetails
(
'
3606b7a5-de50-11ec-9998-9016ba5908d0
'
);
setItem
(
'outpid'
,
'
3606b7a5-de50-11ec-9998-9016ba5908d0
'
)
}
});
...
...
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