Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
syzy_se
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
管理员
syzy_se
Commits
f9b3c523
Commit
f9b3c523
authored
Apr 01, 2023
by
yangbenyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加设备预约
parent
85819035
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
687 additions
and
184 deletions
+687
-184
application.properties
src/main/resources/application.properties
+1
-1
calendar.js
.../static/js/laboratory/laboratoryEquipmentMake/calendar.js
+439
-0
edit.js
...rces/static/js/laboratory/laboratoryEquipmentMake/edit.js
+92
-2
index.js
...ces/static/js/laboratory/laboratoryEquipmentMake/index.js
+86
-89
edit.html
...es/templates/laboratory/laboratoryEquipmentMake/edit.html
+42
-86
index.html
...s/templates/laboratory/laboratoryEquipmentMake/index.html
+27
-6
No files found.
src/main/resources/application.properties
View file @
f9b3c523
#默认数据库配置
spring.datasource.url
=
jdbc:mysql://127.0.0.1:3306/syzy_se?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false
spring.datasource.username
=
root
spring.datasource.password
=
root
spring.datasource.password
=
123456
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
#默认数据库配置
...
...
src/main/resources/static/js/laboratory/laboratoryEquipmentMake/calendar.js
0 → 100644
View file @
f9b3c523
var
Calendar
=
function
(
element
,
options
)
{
this
.
el
=
$
(
element
);
this
.
options
=
$
.
extend
(
true
,
{},
this
.
options
,
options
);
this
.
init
();
}
Calendar
.
prototype
=
{
options
:
{
mode
:
"month"
,
weekMode
:
[
"一"
,
"二"
,
"三"
,
"四"
,
"五"
,
"六"
,
"日"
],
newDate
:
new
Date
(),
width
:
null
,
height
:
null
,
showModeBtn
:
true
,
//是否显示切换按钮
showEvent
:
true
,
maxEvent
:
null
,
//最多不得超过数目(多出仅提示)
whereForm
:{
key
:
"startDate"
,
name
:
"name"
}
},
init
:
function
()
{
var
me
=
this
,
el
=
me
.
el
,
opts
=
me
.
options
;
el
.
addClass
(
"calendar"
);
opts
.
width
=
el
.
width
();
opts
.
height
=
el
.
height
();
typeof
(
opts
.
newDate
)
==
"string"
?
opts
.
newDate
=
me
.
_getDateByString
(
opts
.
newDate
)
:
""
;
me
.
_createCalendar
();
//绑定事件
//changeMode
el
.
on
(
"click"
,
".calendar-mode-select .btn"
,
function
(
e
)
{
e
.
stopPropagation
();
var
modeText
=
$
(
this
).
text
();
var
mode
=
modeText
==
"月"
?
"month"
:
"year"
;
me
.
changeMode
(
mode
);
})
//calendar-cell日期点击事件
el
.
on
(
"click"
,
".calendar-cell"
,
function
(
e
)
{
e
.
stopPropagation
();
$
(
".dropdown-month"
).
removeClass
(
"open"
);
$
(
".dropdown-year"
).
removeClass
(
"open"
);
var
cellDate
=
new
Date
(
$
(
this
).
attr
(
"title"
).
replace
(
/
[\u
4e00-
\u
9fa5
]
/g
,
","
))
;
var
viewData
=
me
.
viewData
;
var
year
=
cellDate
.
getFullYear
();
var
month
=
cellDate
.
getMonth
();
var
date
=
cellDate
.
getDate
();
if
(
opts
.
mode
==
"year"
)
{
if
(
opts
.
cellClick
)
opts
.
cellClick
.
call
(
me
,
{
events
:
viewData
[
month
]?
viewData
[
month
]:[],
date
:(
year
+
"-"
+
(
month
+
1
))})
}
//点击月视图中其他月份不触发
else
if
(
opts
.
mode
==
"month"
&&
month
==
opts
.
newDate
.
getMonth
())
{
if
(
opts
.
cellClick
)
opts
.
cellClick
.
call
(
me
,
{
events
:
viewData
[
date
]?
viewData
[
date
]:[],
date
:
year
+
"-"
+
(
month
+
1
)
+
"-"
+
date
})
}
})
//年份下拉
el
.
on
(
"click"
,
".calendar-year-select"
,
function
(
e
)
{
e
.
stopPropagation
();
$
(
".dropdown-month"
).
removeClass
(
"open"
);
$
(
".dropdown-year"
).
toggleClass
(
"open"
);
//创建下拉数据
var
yearText
=
opts
.
newDate
.
getFullYear
();
var
s
=
''
;
for
(
var
i
=
0
;
i
<
21
;
i
++
)
{
if
(
i
==
10
)
{
s
+=
'<li class="year-item active">'
}
else
{
s
+=
'<li class="year-item">'
}
s
+=
'<span class="year-check">'
+
(
yearText
-
10
+
i
)
+
'</span>'
s
+=
'<span >年</span>'
s
+=
'</li>'
}
me
.
el
.
find
(
".dropdown-year"
).
html
(
s
);
})
//年份改变
el
.
on
(
"click"
,
".year-item"
,
function
(
e
)
{
e
.
stopPropagation
();
$
(
".dropdown-year"
).
removeClass
(
"open"
);
var
yearText
=
$
(
this
).
text
();
var
yearNum
=
yearText
.
split
(
"年"
)[
0
];
if
(
yearNum
==
opts
.
newDate
.
getFullYear
())
return
;
opts
.
newDate
.
setFullYear
(
yearNum
);
opts
.
mode
==
"month"
?
me
.
_refreshCalendar
(
opts
.
newDate
)
:
me
.
_refreshYearCalendar
(
opts
.
newDate
);
$
(
".calendar-year-text"
).
text
(
yearText
);
})
//触发选择月份
el
.
on
(
"click"
,
".calendar-month-select"
,
function
(
e
)
{
e
.
stopPropagation
();
$
(
".dropdown-year"
).
removeClass
(
"open"
);
$
(
".dropdown-month"
).
toggleClass
(
"open"
);
})
//月份check事件
el
.
on
(
"click"
,
".month-item"
,
function
(
e
)
{
e
.
stopPropagation
();
$
(
".dropdown-month"
).
removeClass
(
"open"
);
var
monthText
=
$
(
this
).
text
();
var
monthNum
=
monthText
.
split
(
"月"
)[
0
];
if
(
monthNum
==
(
opts
.
newDate
.
getMonth
()
+
1
))
return
;
var
beforeDate
=
opts
.
newDate
.
getDate
();
opts
.
newDate
.
setMonth
(
monthNum
-
1
);
var
afterDate
=
opts
.
newDate
.
getDate
();
//处理日期30号,切换到2月不存在30号
if
(
beforeDate
!=
afterDate
)
{
opts
.
newDate
.
setDate
(
opts
.
newDate
.
getDate
()
-
1
);
}
me
.
_refreshCalendar
(
opts
.
newDate
);
$
(
".calendar-month-text"
).
text
(
monthText
);
})
$
(
document
.
body
).
on
(
"click"
,
function
(
e
)
{
$
(
".dropdown-month"
).
removeClass
(
"open"
);
$
(
".dropdown-year"
).
removeClass
(
"open"
);
})
},
//公开方法
changeMode
:
function
(
mode
)
{
var
me
=
this
;
if
(
mode
==
me
.
options
.
mode
)
return
;
me
.
options
.
mode
=
mode
;
me
.
_createCalendar
();
},
loadData
:
function
(
data
){
var
me
=
this
;
if
(
!
data
)
throw
(
"数据错误"
);
me
.
options
.
data
=
data
;
me
.
_createCalendar
();
},
getViewDate
:
function
(
viewDate
)
{
var
me
=
this
,
opts
=
me
.
options
,
mode
=
opts
.
mode
,
data
=
opts
.
data
;
if
(
!
data
||
data
.
length
==
0
)
return
[];
var
viewData
=
{},
modeYear
=
viewDate
.
getFullYear
(),
modeMonth
=
viewDate
.
getMonth
();
//筛选视图数据并转化为对象
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
var
item
=
data
[
i
];
var
start
=
me
.
_getDateByString
(
item
[
opts
.
whereForm
[
"key"
]]);
//此处日期格式转化非标准,可自定义修改获取方式
var
year
=
start
.
getFullYear
();
var
month
=
start
.
getMonth
();
var
date
=
start
.
getDate
();
if
(
mode
==
"month"
&&
year
==
modeYear
&&
modeMonth
==
month
)
{
if
(
!
viewData
[
date
])
viewData
[
date
]
=
[];
viewData
[
date
].
push
(
item
);
}
else
if
(
mode
==
"year"
&&
year
==
modeYear
)
{
if
(
!
viewData
[
month
])
viewData
[
month
]
=
[];
viewData
[
month
].
push
(
item
);
}
}
return
viewData
;
},
_getDateByString
:
function
(
stringDate
)
{
var
me
=
this
;
var
year
=
stringDate
.
split
(
"-"
)[
0
];
var
month
=
parseInt
(
stringDate
.
split
(
"-"
)[
1
])
-
1
;
var
date
=
stringDate
.
split
(
"-"
)[
2
];
return
new
Date
(
year
,
month
,
date
);
},
//私有方法
_createCalendar
:
function
()
{
var
me
=
this
;
var
dateMode
=
me
.
options
.
mode
;
me
.
_createView
()
},
_createView
:
function
()
{
var
me
=
this
,
el
=
me
.
el
,
opts
=
me
.
options
,
mode
=
opts
.
mode
,
newDate
=
opts
.
newDate
,
html
=
''
;
html
+=
me
.
_createToolbar
();
html
+=
'<div class="calendar-body">'
;
html
+=
'<table class="calendar-table" cellspacing="0">'
if
(
mode
==
"month"
)
{
html
+=
me
.
_createHeader
();
}
html
+=
me
.
_createBody
();
html
+=
'</table>'
html
+=
'</div>'
el
.
html
(
html
);
if
(
mode
==
"month"
)
{
me
.
_refreshCalendar
(
newDate
);
}
else
{
me
.
_refreshYearCalendar
(
newDate
);
}
},
_createToolbar
:
function
()
{
var
me
=
this
,
newDare
=
me
.
options
.
newDate
,
mode
=
me
.
options
.
mode
,
showModeBtn
=
me
.
options
.
showModeBtn
,
s
=
''
;
var
year
=
newDare
.
getFullYear
();
var
month
=
newDare
.
getMonth
()
+
1
;
s
+=
'<div class="calendar-header">'
s
+=
'<div class="calendar-select calendar-year-select" >'
s
+=
'<span class="calendar-year-text"> '
+
year
+
'年</span >'
s
+=
'<span class="calendar-icon"><i class="fa fa-angle-down"></i></span>'
s
+=
'<ul id="dropdown-year" class="dropdown-year">'
s
+=
'</ul>'
s
+=
'</div > '
if
(
mode
==
"month"
)
{
s
+=
'<div class="calendar-select calendar-month-select">'
s
+=
'<span class="calendar-month-text"> '
+
month
+
'月</span >'
s
+=
'<span class="calendar-icon"><i class="fa fa-angle-down"></i></span>'
//创建月份下拉(写死)
s
+=
'<ul class="dropdown-month">'
for
(
var
i
=
1
;
i
<=
12
;
i
++
)
{
s
+=
'<li class="month-item">'
s
+=
'<span class="month-check">'
+
i
+
'</span>'
s
+=
'<span >月</span>'
s
+=
'</li>'
}
s
+=
'</ul>'
s
+=
'</div > '
}
if
(
showModeBtn
)
{
s
+=
'<div class="calendar-select calendar-mode-select">'
s
+=
'<div class="btn-group">'
if
(
mode
==
"month"
)
{
s
+=
'<span class="btn calendar-select-active">月</span>'
s
+=
'<span class="btn">年</span>'
}
else
{
s
+=
'<span class="btn">月</span>'
s
+=
'<span class="btn calendar-select-active">年</span>'
}
s
+=
'</div>'
s
+=
'</div>'
}
s
+=
'</div >'
return
s
;
},
_createHeader
:
function
()
{
var
me
=
this
,
opts
=
me
.
options
,
weekMode
=
opts
.
weekMode
;
var
s
=
'<thead><tr>'
;
weekMode
.
forEach
(
function
(
item
)
{
s
+=
' <th class="calendar-column-header" title="周'
+
item
+
'"><span class="calendar-column-header-inner">'
+
item
+
'</span></th>'
;
});
s
+=
'</thead></tr>'
;
return
s
;
},
_createBody
:
function
()
{
var
me
=
this
;
var
s
=
' <tbody class="calendar-tbody">'
;
s
+=
'</tbody>'
;
return
s
;
},
_refreshYearCalendar
:
function
(
newDate
)
{
var
me
=
this
,
showEvent
=
me
.
options
.
showEvent
,
maxEvent
=
me
.
options
.
maxEvent
,
s
=
''
;
//每次都重新获取会不会影响性能
me
.
viewData
=
viewData
=
me
.
getViewDate
(
newDate
);
var
year
=
newDate
.
getFullYear
(),
month
=
newDate
.
getMonth
();
//四行三列
for
(
var
i
=
0
;
i
<
4
;
i
++
)
{
s
+=
'<tr>'
for
(
var
l
=
0
;
l
<
3
;
l
++
)
{
renderMonth
=
i
*
3
+
l
;
if
(
month
==
renderMonth
)
{
s
+=
'<td title="'
+
year
+
'年'
+
(
renderMonth
+
1
)
+
'月" class="calendar-cell calendar-thisMonth">'
;
}
else
{
s
+=
'<td title="'
+
year
+
'年'
+
(
renderMonth
+
1
)
+
'月" class="calendar-cell">'
;
}
s
+=
'<div class="calendar-date">'
;
s
+=
'<div class="calendar-value">'
+
(
renderMonth
+
1
)
+
'月</div>'
;
s
+=
'<div class="calendar-content"><ul class="events">'
if
(
showEvent
&&
viewData
[
renderMonth
])
{
if
(
maxEvent
&&
viewData
[
renderMonth
].
length
>
maxEvent
)
{
s
+=
'<span class="total">'
+
viewData
[
renderMonth
].
length
+
'个事件..</span>'
}
else
{
viewData
[
renderMonth
].
forEach
(
function
(
item
)
{
s
+=
'<li><span>'
+
item
[
me
.
options
[
"whereForm"
][
'name'
]]
+
'</span></li>'
;
})
}
}
s
+=
'</ul ></div > '
;
s
+=
'</div></td>'
;
}
s
+=
'</tr>'
;
}
me
.
el
.
find
(
".calendar-tbody"
).
html
(
s
);
},
_refreshCalendar
:
function
(
newDate
)
{
var
me
=
this
,
showEvent
=
me
.
options
.
showEvent
,
maxEvent
=
me
.
options
.
maxEvent
,
s
=
''
;
me
.
viewData
=
viewData
=
me
.
getViewDate
(
newDate
);
var
_newDate
=
me
.
_cloneDate
(
newDate
);
//当前date
var
nowNum
=
_newDate
.
getDate
();
//第一天周几
_newDate
.
setDate
(
1
);
var
weekDay
=
_newDate
.
getDay
()
==
0
?
7
:
_newDate
.
getDay
();
//视图第一天
var
viewDate
=
me
.
_cloneDate
(
_newDate
);
viewDate
.
setDate
(
viewDate
.
getDate
()
-
weekDay
+
1
);
//当前第几周/行 (暂不处理)
var
spileDate
=
(
newDate
.
getTime
()
-
viewDate
.
getTime
())
/
(
1000
*
60
*
60
*
24
);
renderDate
=
me
.
_cloneDate
(
viewDate
);
//固定六行
for
(
var
i
=
0
;
i
<
6
;
i
++
)
{
s
+=
'<tr>'
for
(
var
l
=
0
;
l
<
7
;
l
++
)
{
var
year
=
renderDate
.
getFullYear
();
var
month
=
renderDate
.
getMonth
()
+
1
;
var
date
=
renderDate
.
getDate
();
if
(
renderDate
.
getMonth
()
<
newDate
.
getMonth
())
{
s
+=
'<td title="'
+
year
+
'年'
+
month
+
'月'
+
date
+
'日" class="calendar-cell calendar-last-month-cell">'
;
}
else
if
(
renderDate
.
getMonth
()
>
newDate
.
getMonth
())
{
s
+=
'<td title="'
+
year
+
'年'
+
month
+
'月'
+
date
+
'日" class="calendar-cell calendar-next-month-cell">'
;
}
else
if
(
date
==
nowNum
)
{
s
+=
'<td title="'
+
year
+
'年'
+
month
+
'月'
+
date
+
'日" class="calendar-cell calendar-today">'
;
}
else
{
s
+=
'<td title="'
+
year
+
'年'
+
month
+
'月'
+
date
+
'日" class="calendar-cell">'
;
}
s
+=
'<div class="calendar-date">'
;
s
+=
'<div class="calendar-value">'
+
date
+
'</div>'
;
s
+=
'<div class="calendar-content"><ul class="events">'
;
if
(
showEvent
&&
viewData
[
date
]
&&
renderDate
.
getMonth
()
==
newDate
.
getMonth
())
{
if
(
maxEvent
&&
viewData
[
date
].
length
>
maxEvent
)
{
s
+=
'<span class="total">'
+
viewData
[
date
].
length
+
'个事件..</span>'
;
}
else
{
viewData
[
date
].
forEach
(
function
(
item
)
{
s
+=
'<li><span>'
+
item
[
me
.
options
[
"whereForm"
][
'name'
]]
+
'</span></li>'
;
});
}
}
s
+=
'</ul ></div > '
;
s
+=
'</div></td>'
;
renderDate
.
setDate
(
renderDate
.
getDate
()
+
1
);
}
s
+=
'</tr>'
;
}
me
.
el
.
find
(
".calendar-tbody"
).
html
(
s
);
},
_cloneDate
:
function
(
date
)
{
return
new
Date
(
date
.
getFullYear
(),
date
.
getMonth
(),
date
.
getDate
());
},
};
$
.
fn
.
calendar
=
function
(
options
)
{
var
isSTR
=
typeof
options
==
"string"
,
args
,
ret
;
if
(
isSTR
)
{
args
=
$
.
makeArray
(
arguments
)
args
.
splice
(
0
,
1
);
}
var
name
=
"calendar"
,
type
=
Calendar
;
var
jq
=
this
.
each
(
function
()
{
var
ui
=
$
.
data
(
this
,
name
);
if
(
!
ui
)
{
ui
=
new
type
(
this
,
options
);
$
.
data
(
this
,
name
,
ui
);
}
if
(
isSTR
)
{
ret
=
ui
[
options
].
apply
(
ui
,
args
);
}
});
return
isSTR
?
ret
:
jq
;
};
\ No newline at end of file
src/main/resources/static/js/laboratory/laboratoryEquipmentMake/edit.js
View file @
f9b3c523
layui
.
define
([
'form'
,
'laydate'
,
'table'
,
'laboratoryEquipmentMakeApi'
],
function
(
exports
)
{
layui
.
define
([
'form'
,
'laydate'
,
'
laytpl'
,
'
table'
,
'laboratoryEquipmentMakeApi'
],
function
(
exports
)
{
var
form
=
layui
.
form
;
var
laboratoryEquipmentMakeApi
=
layui
.
laboratoryEquipmentMakeApi
;
var
index
=
layui
.
index
;
var
table
=
layui
.
table
;
var
laytpl
=
layui
.
laytpl
;
var
dateHref
=
''
;
var
view
=
{
init
:
function
(){
Lib
.
initGenrealForm
(
$
(
"#updateForm"
),
form
);
//
Lib.initGenrealForm($("#updateForm"),form);
this
.
initSubmit
();
},
initSubmit
:
function
(){
dateHref
=
location
.
href
.
split
(
"="
)[
1
];
var
res
=
{
"code"
:
0
,
"msg"
:
"成功"
,
"count"
:
2
,
"data"
:[{
"id"
:
1
,
"processinstId"
:
"1"
,
"equipment"
:
"123"
,
"topicName"
:
"323"
,
"experimenter"
:
"232"
,
"createTime"
:
"2023-03-31 11:08:05"
,
"updateTime"
:
"2023-03-31 11:08:02"
,
"startTime"
:
"2023-03-02"
,
"endTime"
:
"2023-03-04"
,
"remarks"
:
null
,
"laboratoryId"
:
null
},{
"id"
:
2
,
"processinstId"
:
"2"
,
"equipment"
:
"4545"
,
"topicName"
:
"454"
,
"experimenter"
:
"545"
,
"createTime"
:
"2023-03-31 11:08:10"
,
"updateTime"
:
"2023-03-31 11:08:12"
,
"startTime"
:
"2023-03-05"
,
"endTime"
:
"2023-03-07"
,
"remarks"
:
null
,
"laboratoryId"
:
null
}]}
var
dataList
=
res
.
data
.
filter
(
function
(
v
){
if
(
v
.
startTime
==
dateHref
){
return
v
;
}
})
console
.
log
(
dataList
)
table
.
render
({
elem
:
"#taskList"
,
id
:
"taskList"
,
height
:
400
,
data
:
dataList
,
cols
:[[
{
field
:
"startTime"
,
title
:
"任务时间"
},
{
field
:
"topicName"
,
title
:
"任务名称"
},
{
field
:
"remarks"
,
title
:
"备注"
},
{
title
:
"操作"
,
templet
:
function
(){
return
'<input type="button" lay-event="detail" value="编辑" class="layui-btn layui-btn-xs" /><input type="button" lay-event="del" value="删除" class="layui-btn layui-btn-xs layui-btn-danger" />'
}}
]]
});
//添加
$
(
"#addTask"
).
click
(
function
(){
laytpl
(
$
(
"#taskFormTemplate"
).
html
()
).
render
({
topicName
:
''
,
remarks
:
''
},
function
(
string
){
layer
.
open
({
title
:
"添加"
,
area
:
[
"800px"
,
"90%"
],
content
:
string
,
success
:
function
(
layout
){
form
.
render
();
// console.log(JSON.stringify(res))
},
yes
:
function
(
index
,
layout
){
res
.
data
.
push
({
startTime
:
dateHref
,
topicName
:
$
(
layout
).
find
(
"[name='name']"
).
val
(),
remarks
:
$
(
layout
).
find
(
"[name='remarks']"
).
val
()
})
table
.
reload
(
"taskList"
,{
data
:
res
.
data
})
layer
.
close
(
index
);
// parent.window.dataReload();
}
})
});
})
//点击删除-编辑
table
.
on
(
"tool(taskList)"
,
function
(
obj
){
console
.
log
(
obj
)
if
(
obj
.
event
===
'detail'
){
laytpl
(
$
(
"#taskFormTemplate"
).
html
()
).
render
(
obj
.
data
,
function
(
string
){
layer
.
open
({
title
:
"编辑"
,
area
:
[
"800px"
,
"90%"
],
content
:
string
,
success
:
function
(
layout
){
form
.
render
();
// console.log(JSON.stringify(res))
},
yes
:
function
(
index
,
layout
){
res
.
data
.
map
(
function
(
v
){
if
(
v
.
topicName
==
$
(
layout
).
find
(
"[name='name']"
).
val
().
trim
()){
v
[
"topicName"
]
=
$
(
layout
).
find
(
"[name='name']"
).
val
().
trim
();
v
[
"remarks"
]
=
$
(
layout
).
find
(
"[name='remarks']"
).
val
().
trim
();
}
})
// ({ startTime:dateHref, topicName: $(layout).find("[name='name']").val(), remarks: $(layout).find("[name='remarks']").val() })
table
.
reload
(
"taskList"
,{
data
:
res
.
data
})
layer
.
close
(
index
);
// parent.window.dataReload();
}
})
})
}
else
if
(
obj
.
event
===
'del'
){
layer
.
confirm
(
'确定删除吗?'
,
function
(
index
){
obj
.
del
();
// 删除对应行(tr)的 DOM 结构,并更新缓存
layer
.
close
(
index
);
// parent.window.dataReload();
})
}
})
$
(
"#updateButton"
).
click
(
function
(){
form
.
on
(
'submit(form)'
,
function
(){
laboratoryEquipmentMakeApi
.
updateLaboratoryEquipmentMake
(
$
(
'#updateForm'
),
function
(){
...
...
src/main/resources/static/js/laboratory/laboratoryEquipmentMake/index.js
View file @
f9b3c523
layui
.
define
([
'form'
,
'laydate'
,
'table'
],
function
(
exports
)
{
layui
.
define
([
'form'
,
'laydate'
,
'table'
,
'layer'
],
function
(
exports
)
{
var
form
=
layui
.
form
;
var
laydate
=
layui
.
laydate
;
var
table
=
layui
.
table
;
var
layer
=
layui
.
layer
;
var
laboratoryEquipmentMakeTable
=
null
;
var
view
=
{
init
:
function
(){
var
_this
=
this
;
this
.
initTable
();
this
.
initSearchForm
();
this
.
initToolBar
();
//
this.initSearchForm();
//
this.initToolBar();
window
.
dataReload
=
function
(){
Lib
.
doSearchForm
(
$
(
"#searchForm"
),
laboratoryEquipmentMakeTable
)
_this
.
initTable
();
//Lib.doSearchForm($("#searchForm"),laboratoryEquipmentMakeTable)
}
},
initTable
:
function
(){
laboratoryEquipmentMakeTable
=
table
.
render
({
elem
:
'#laboratoryEquipmentMakeTable'
,
height
:
Lib
.
getTableHeight
(
1
),
cellMinWidth
:
100
,
method
:
'post'
,
url
:
Common
.
ctxPath
+
'/laboratory/laboratoryEquipmentMake/list.json'
// 数据接口
,
page
:
Lib
.
tablePage
// 开启分页
,
limit
:
10
,
cols
:
[
[
// 表头
{
type
:
'checkbox'
,
fixed
:
'left'
,
},
{
field
:
'id'
,
title
:
'主键'
,
fixed
:
'left'
,
width
:
60
,
},
{
field
:
'processinstId'
,
title
:
'流程主键'
,
},
{
field
:
'equipment'
,
title
:
'设备'
,
},
{
field
:
'topicName'
,
title
:
'课题名称'
,
},
{
field
:
'experimenter'
,
title
:
'实验人'
,
},
{
field
:
'createTime'
,
title
:
'创建时间'
,
},
{
field
:
'updateTime'
,
title
:
'修改时间'
,
},
{
field
:
'startTime'
,
title
:
'开始时间'
,
},
{
field
:
'endTime'
,
title
:
'结束时间'
,
},
{
// url : Common.ctxPath + '/laboratory/laboratoryEquipmentMake/list.json' // 数据接口
var
data
=
[
// { startDate: "2018-6-10", name: "事件1" },
{
startTime
:
"2018-7-10"
,
topicName
:
"事件2"
},
{
startTime
:
"2018-8-10"
,
topicName
:
"事件3"
},
{
startTime
:
"2018-9-10"
,
topicName
:
"事件4"
},
{
startTime
:
"2018-10-10"
,
topicName
:
"事件5"
},
{
startTime
:
"2018-11-1"
,
topicName
:
"事件6"
},
{
startTime
:
"2018-11-1"
,
topicName
:
"事件7"
},
{
startTime
:
"2018-12-1"
,
topicName
:
"事件8"
},
{
startTime
:
"2018-12-1"
,
topicName
:
"事件9"
},
{
startTime
:
"2018-12-1"
,
topicName
:
"事10"
},
{
startTime
:
"2019-1-10"
,
topicName
:
"事件11"
},
{
startTime
:
"2019-1-10"
,
topicName
:
"任务22"
},
{
startTime
:
"2019-2-10"
,
topicName
:
"事件12"
},
{
startTime
:
"2019-3-10"
,
topicName
:
"事件13"
},
{
startTime
:
"2019-4-10"
,
topicName
:
"事件14"
},
{
startTime
:
"2019-5-10"
,
topicName
:
"事件15"
},
{
startTime
:
"2019-6-10"
,
topicName
:
"事件16"
},
{
startTime
:
"2019-7-10"
,
topicName
:
"事件17"
},
{
startTime
:
"2019-8-10"
,
topicName
:
"事件18"
},
{
startTime
:
"2019-9-10"
,
topicName
:
"事件19"
},
{
startTime
:
"2019-10-10"
,
topicName
:
"事件20"
},
{
startTime
:
"2019-11-10"
,
topicName
:
"事件21"
},
{
startTime
:
"2023-03-05"
,
topicName
:
"事件22"
},
{
startTime
:
"2023-03-05"
,
topicName
:
"事件23"
},
// { startTime: "2020-2-10", topicName: "事件24" },
];
/* field : 'topicName',
title : '课题名称',
field : 'experimenter',
title : '实验人',
field : 'remarks',
title : '备注',
},
{
field
:
'laboratoryId'
,
title
:
'实验室id'
,
}
]
]
});
table
.
on
(
'checkbox(laboratoryEquipmentMakeTable)'
,
function
(
obj
){
var
laboratoryEquipmentMake
=
obj
.
data
;
if
(
obj
.
checked
){
//按钮逻辑Lib.buttonEnable()
}
else
{
}
})
*/
$
.
post
(
Common
.
ctxPath
+
'/laboratory/laboratoryEquipmentMake/list.json'
,{},
function
(
res
){
console
.
log
(
JSON
.
stringify
(
res
))
$
(
"#calendarbox"
).
calendar
({
data
:
res
.
data
,
mode
:
"month"
,
maxEvent
:
1
,
whereForm
:{
key
:
"startTime"
,
//日期
name
:
"topicName"
//任务名称
},
showModeBtn
:
false
,
newDate
:
"2023-03-05"
,
cellClick
:
function
(
res
)
{
var
dateUrl
=
res
.
date
.
split
(
"-"
);
var
url
=
"/laboratory/laboratoryEquipmentMake/edit.do?date="
+
dateUrl
[
0
]
+
"-"
+
(
dateUrl
[
1
]
<=
9
?
'0'
+
dateUrl
[
1
]
:
dateUrl
[
1
])
+
"-"
+
(
dateUrl
[
2
]
<=
9
?
'0'
+
dateUrl
[
2
]
:
dateUrl
[
2
]
);
console
.
log
(
res
.
events
[
0
][
'startTime'
])
Common
.
openDlg
(
url
,
"管理>"
+
res
.
events
[
0
][
'startTime'
]
+
">编辑"
,{
//area: ["80%","80%"]
});
// layer.open({
// type: 2,
// title:"操作",
// area: ["800px","90%"],
// content: url ,
// success: function(layout){
//
// console.log(JSON.stringify(res))
// //viewCell的事件列表
// }
// })
}
})
})
//刷新数据
function
refresh
(
data
){
$
(
"#calendarbox"
).
data
(
"calendar"
).
loadData
(
data
||
[])
}
},
initSearchForm
:
function
(){
...
...
@@ -104,8 +101,8 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
initToolBar
:
function
(){
toolbar
=
{
add
:
function
()
{
// 获取选中数据
var
url
=
"/laboratory/laboratoryEquipmentMake/add.do"
;
Common
.
openDlg
(
url
,
"LaboratoryEquipmentMake管理>新增"
);
/*
var url = "/laboratory/laboratoryEquipmentMake/add.do";
Common.openDlg(url,"LaboratoryEquipmentMake管理>新增");
*/
},
edit
:
function
()
{
// 获取选中数目
var
data
=
Common
.
getOneFromTable
(
table
,
"laboratoryEquipmentMakeTable"
);
...
...
@@ -122,10 +119,10 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
});
}
};
$
(
'.ext-toolbar'
).
on
(
'click'
,
function
()
{
/*
$('.ext-toolbar').on('click', function() {
var type = $(this).data('type');
toolbar[type] ? toolbar[type].call(this) : '';
});
});
*/
}
}
exports
(
'index'
,
view
);
...
...
src/main/resources/templates/laboratory/laboratoryEquipmentMake/edit.html
View file @
f9b3c523
<!--# layout("/common/layout.html",{"jsBase":"/js/laboratory/laboratoryEquipmentMake/"}){ -->
<form
class=
"layui-form layui-form-pane"
id=
"updateForm"
>
<div
class=
"layui-row"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
流程主键
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"processinstId"
name=
"processinstId"
value=
"${laboratoryEquipmentMake.processinstId}"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
设备
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"equipment"
name=
"equipment"
value=
"${laboratoryEquipmentMake.equipment}"
class=
"layui-input"
>
</div>
</div>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
课题名称
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"topicName"
name=
"topicName"
value=
"${laboratoryEquipmentMake.topicName}"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
实验人
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"experimenter"
name=
"experimenter"
value=
"${laboratoryEquipmentMake.experimenter}"
class=
"layui-input"
>
</div>
</div>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
创建时间
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"createTime"
name=
"createTime"
value=
"${laboratoryEquipmentMake.createTime,"
yyyy-MM-dd
"}"
class=
"layui-input input-date"
>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
修改时间
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"updateTime"
name=
"updateTime"
value=
"${laboratoryEquipmentMake.updateTime,"
yyyy-MM-dd
"}"
class=
"layui-input input-date"
>
</div>
</div>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
开始时间
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"startTime"
name=
"startTime"
value=
"${laboratoryEquipmentMake.startTime}"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
结束时间
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"endTime"
name=
"endTime"
value=
"${laboratoryEquipmentMake.endTime}"
class=
"layui-input"
>
</div>
</div>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
备注
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"remarks"
name=
"remarks"
value=
"${laboratoryEquipmentMake.remarks}"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
实验室id
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"laboratoryId"
name=
"laboratoryId"
value=
"${laboratoryEquipmentMake.laboratoryId}"
class=
"layui-input"
>
</div>
</div>
</div>
</div>
<!-- 业务对象须有hidden字段,保存delFlag和version字段-->
<input
type=
"hidden"
name=
"id"
value=
${laboratoryEquipmentMake.id}
/>
<layui:submitButtons
id=
"updateButton"
/>
</form>
<style>
.taskFormTemplate
{
padding
:
20px
;
}
</style>
<!-- <form class="layui-form layui-form-pane" id="updateForm"> -->
<div
class=
"layui-btn-group"
>
<button
type=
"button"
id=
"addTask"
class=
"layui-btn layui-btn-sm"
>
添加
</button>
</div>
<div
class=
"layui-form-item"
>
<table
class=
"layui-hide"
id=
"taskList"
lay-filter=
"taskList"
></table>
</div>
<!--#} -->
<script>
layui
.
use
([
'edit'
],
function
(){
...
...
@@ -92,3 +19,31 @@ layui.use(['edit'], function(){
laboratoryEquipmentMakeEdit
.
init
();
});
</script>
<script
type=
"text/template"
id=
"taskTemplate"
>
<
div
class
=
"layui-btn-group"
>
<
button
type
=
"button"
id
=
"addTask"
class
=
"layui-btn layui-btn-sm"
>
添加
<
/button
>
<
/div
>
<
div
class
=
"layui-form-item"
>
<
table
class
=
"layui-hide"
id
=
"taskList"
lay
-
filter
=
"taskList"
><
/table
>
<
/div
>
</script>
<script
type=
"text/template"
id=
"taskFormTemplate"
>
<
form
class
=
"layui-form taskFormTemplate"
>
<
div
class
=
"layui-form-item"
>
<
div
class
=
"layui-inline"
>
<
label
class
=
"layui-form-label"
style
=
"min-width:80px;"
>
设备名称
<
/label
>
<
div
class
=
"layui-input-inline"
><
input
type
=
"text"
name
=
"name"
value
=
"{{ d.topicName }}"
class
=
"layui-input"
/><
/div
>
<
/div
>
<
/div
>
<
div
class
=
"layui-form-item"
>
<
label
class
=
"layui-form-label"
style
=
"min-width:80px;"
>
设备描述
<
/label
>
<
div
class
=
"layui-input-block"
>
<
textarea
name
=
"remarks"
placeholder
=
"请输入内容"
value
=
"{{ d.remarks }}"
class
=
"layui-textarea"
><
/textarea
>
<
/div
>
<
/div
>
<
/form
>
</script>
\ No newline at end of file
src/main/resources/templates/laboratory/laboratoryEquipmentMake/index.html
View file @
f9b3c523
<!--#layout("/common/layout.html",{"jsBase":"/js/laboratory/laboratoryEquipmentMake/"}){ -->
<layui:searchForm
formId=
"searchForm"
condition=
"${search}"
>
<
!-- <
layui:searchForm formId="searchForm" condition="${search}">
</layui:searchForm>
<div class="layui-btn-group">
...
...
@@ -8,13 +8,34 @@
<layui:accessButton function="laboratoryEquipmentMake.del" action="del">删除</layui:accessButton>
</div>
<table
id=
"laboratoryEquipmentMakeTable"
lay-filter=
"laboratoryEquipmentMakeTable"
></table>
<table id="laboratoryEquipmentMakeTable" lay-filter="laboratoryEquipmentMakeTable"></table> -->
<style>
html
,
body
{
width
:
100%
;
height
:
100%
;
padding
:
0
;
margin
:
0
;}
ul
,
li
{
padding
:
0
;
margin
:
0
;
list-style
:
none
;}
#calendarbox
{
width
:
60%
;
margin-left
:
auto
;
margin-right
:
auto
;}
.calendar
{
position
:
relative
;
font-family
:
"Chinese Quote"
,
"Microsoft YaHei"
;
font-size
:
14px
;}
.calendar-header
{
padding
:
11px
16px
11px
0
;
text-align
:
right
;}
.calendar-select
{
line-height
:
1.5
;
color
:
rgba
(
0
,
0
,
0
,
0.65
);
-webkit-box-sizing
:
border-box
;
box-sizing
:
border-box
;
margin
:
0
;
padding
:
0
;
list-style
:
none
;
display
:
inline-block
;
position
:
relative
;
outline
:
0
;}
.calendar-table
{
width
:
100%
;
height
:
100%
;}
.calendar-column-header
,
.calendar-cell
{
width
:
14%
}
.calendar-column-header
{
font-weight
:
400
;
text-align
:
center
;
padding-right
:
12px
;}
.calendar-table
{
table-layout
:
fixed
;}
.calendar-cell
{
color
:
rgba
(
0
,
0
,
0
,
0.65
);}
.calendar-cell.calendar-last-month-cell
,
.calendar-cell.calendar-next-month-cell
{
color
:
rgba
(
0
,
0
,
0
,
0.25
);}
.calendar-date
{
padding
:
4px
8px
;
margin
:
0
4px
;
border-top
:
2px
solid
#e8e8e8
;}
.calendar-cell.calendar-thisMonth
.calendar-date
,
.calendar-cell.calendar-today
.calendar-date
{
border-top-color
:
#1890ff
;
background-color
:
#e6f7ff
;
color
:
#1890ff
;}
.calendar-date
:hover
{
background
:
#e6f7ff
;}
.calendar-value
{
text-align
:
center
;}
.calendar-content
{
height
:
60px
;
overflow-x
:
hidden
;
overflow-y
:
auto
;
position
:
static
;
width
:
auto
;
left
:
auto
;
bottom
:
auto
;}
.calendar-select
{
font-size
:
13px
;
vertical-align
:
middle
;}
.btn.calendar-select-active
{
border-color
:
#40a9ff
;
z-index
:
2
;}
.calendar-select
:first-child
{
margin-right
:
10px
;}
.calendar-year-select
,
.calendar-month-select
{
border-radius
:
4px
;
border
:
1px
solid
#d9d9d9
;}
.calendar-year-select
:hover
,
.calendar-month-select
:hover
{
border-color
:
#40a9ff
;}
.calendar-year-text
,
.calendar-month-text
{
margin
:
0
10px
;
line-height
:
28px
;}
.calendar-icon
{
margin
:
0
10px
0
0
;}
.calendar-icon
*
{
color
:
rgba
(
0
,
0
,
0
,
0.25
);}
.btn
{
float
:
left
;
padding
:
5px
10px
;
border
:
1px
solid
#d9d9d9
;
border-radius
:
4px
;}
.btn-group
{
float
:
left
;
display
:
inline
;
padding
:
0
8px
;}
.btn-group
>
.btn
{
position
:
relative
;
float
:
left
;}
.btn-group
>
.btn
:hover
{
z-index
:
2
;
border-color
:
#40a9ff
;}
.btn-group
.btn
+
.btn
{
margin-left
:
-1px
;}
.btn-group
>
.btn
:first-child
{
border-top-right-radius
:
0
;
border-bottom-right-radius
:
0
;}
.btn-group
>
.btn
:last-child:not
(
:first-child
)
{
border-top-left-radius
:
0
;
border-bottom-left-radius
:
0
;}
ul
.dropdown-month
,
.dropdown-month
li
,
ul
.dropdown-year
,
.dropdown-year
li
{
list-style
:
none
;
text-align
:
center
;
padding
:
0
;
margin
:
0
;}
.dropdown-month.open
,
.dropdown-year.open
{
display
:
inline-block
;
margin-top
:
1px
;
width
:
100%
;}
.dropdown-month
,
.dropdown-year
{
height
:
250px
;
overflow-y
:
auto
;
overflow-x
:
hidden
;
display
:
none
;
position
:
absolute
;
left
:
0
;
top
:
100%
;
background
:
#fff
;
width
:
50px
;
border
:
1px
solid
#eee
;
box-shadow
:
0px
6px
12px
rgba
(
0
,
0
,
0
,
0.175
);
-webkit-box-shadow
:
0
6px
12px
rgba
(
0
,
0
,
0
,
0.175
)
}
.dropdown-month
.month-item
,
.dropdown-year
.year-item
{
font-size
:
12px
;
position
:
relative
;
display
:
block
;
padding
:
5px
2px
;
line-height
:
20px
;
font-weight
:
normal
;
color
:
rgba
(
0
,
0
,
0
,
0.65
);
white-space
:
nowrap
;
cursor
:
pointer
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
-webkit-transition
:
background
0.3s
ease
;
transition
:
background
0.3s
ease
;}
.month-item
:hover
,
.year-item
:hover
{
background
:
#e6f7ff
;}
.year-item.active
{
background-color
:
#fafafa
;
font-weight
:
600
;
color
:
rgba
(
0
,
0
,
0
,
0.65
);}
ul
.events
li
{
white-space
:
nowrap
;
font-size
:
13px
;
padding
:
2px
2px
;}
ul
.events
.total
{
font-size
:
14px
;
font-weight
:
600
;}
ul
.events
li
span
{
margin-left
:
5px
;}
ul
.events
li
:before
{
content
:
"*"
}
*
::-webkit-scrollbar
{
width
:
8px
;
background-color
:
#fff
;}
*
::-webkit-scrollbar-thumb
{
background-color
:
#ddd
;
border-radius
:
8px
;
-webkit-box-shadow
:
inset
0
0
6px
rgba
(
255
,
255
,
255
,
.3
);}
.taskFormTemplate
{
position
:
absolute
;
left
:
0
;
right
:
0
;
top
:
0
;
bottom
:
0
;
width
:
90%
;
height
:
90%
;
margin
:
auto
;
background-color
:
#fff
;
border
:
1px
solid
#999
;
border-radius
:
10px
;
padding
:
20px
;
box-shadow
:
0
0
18px
1px
#999
;
display
:
none
;
}
</style>
<div
id=
"calendarbox"
class=
"calendar"
></div>
<!--#} -->
<script
type=
"text/javascript"
src=
"${ctxPath}/js/laboratory/laboratoryEquipmentMake/calendar.js?v=${jsVer}"
></script>
<script>
layui
.
use
([
'index'
],
function
(){
var
index
=
layui
.
index
index
.
init
();
layui
.
use
([
'index'
,
'layer'
],
function
(){
var
index
=
layui
.
index
index
.
init
();
});
</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