Skip to content

Commit 87981c8

Browse files
committed
update
1 parent 7a23089 commit 87981c8

File tree

19 files changed

+1009
-271
lines changed

19 files changed

+1009
-271
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ pnpm-debug.log*
2020
*.ntvs*
2121
*.njsproj
2222
*.sln
23-
*.sw?
23+
*.sw?

10DaysSprint.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
- 工位的故障状态设置(弹窗)(前、后)
99
- 工位的查找(带筛选器的复杂查询,后端注意)(前、后)
1010
- 工位的详细信息查看(弹窗)(父组件、长度、宽度、坐标)(前、后)
11+
- put /station/
1112
## 布局管理(/layout):
12-
- 工位的详细信息查看(页面右上)(父组件、长度、宽度、坐标)(前)
13+
- 工位的详细信息查看(页面右上)(父组件、长度、宽度、坐标)(前)(finished)
1314
- 底层组件的添加(添加判断逻辑、添加图片)(前)
14-
- 图片样式的添加(弹窗)(看我之前写的oss来写)(前、后)
15+
- 图片样式的添加(弹窗)(看我之前写的oss来写)(前、后)(finished)
1516
- 画布的上色(前)(finished)
1617
## 预约管理(/manage):
1718
- 预约记录的查询(带筛选器的复杂查询,后端注意)(前、后)

src/assets/district.svg

Lines changed: 1 addition & 0 deletions
Loading

src/canvas/domain.js

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@ export const Middle = {
1616
middleBottom:2,
1717
middleRight:3
1818
}
19-
export var redrawAll = function(ctx,canvas,rects,rotatePoint,isWordsShow){
20-
ctx.clearRect(0,0,canvas.clientWidth+10,canvas.clientHeight+10)
19+
export var redrawAll = function(ctx,canvas,rects,rotatePoint,isWordsShow,canvasWidth,canvasHeight){
20+
ctx.clearRect(0,0,canvasWidth+10,canvasHeight+10)
2121
var index = -1;
2222
for(var i=0;i<rects.length;i++){
2323
rects[i].draw(ctx,isWordsShow)
2424
if(rects[i].isSelected)
2525
index = i
2626
}
27+
if(index!=-1)
28+
rects[index].draw(ctx,isWordsShow)
2729
if(!rotatePoint)
2830
return
2931
if(index!=-1){
@@ -43,6 +45,8 @@ export function RoratePoint(image,point){
4345
this.distance = 23
4446
this.anchor = {x:point.x+this.width/2,y:point.y+this.height/2}
4547
this.draw = function(ctx){
48+
if(this.anchor.x<=0||this.anchor.y<=0)
49+
return;
4650
ctx.save()
4751
ctx.translate(this.anchor.x,this.anchor.y)
4852
ctx.drawImage(this.image,-this.width/2,-this.height/2,this.width,this.height)
@@ -61,7 +65,7 @@ export function RoratePoint(image,point){
6165
this.anchor.y = (leftTop.y+rightTop.y)/2 - this.distance*Math.cos(Rect.rotate)
6266
}
6367
}
64-
export function Rect(id,image,point,width,height,rotate,pid,sid,status){
68+
export function Rect(id,image,point,width,height,rotate,pid,sid,status,isConflictable,isReservable){
6569
this.id = id
6670
this.pid = pid
6771
this.image = image
@@ -74,8 +78,10 @@ export function Rect(id,image,point,width,height,rotate,pid,sid,status){
7478
this.isConflict = false
7579
this.sid = sid
7680
this.status = status
81+
this.isConflictable = isConflictable
82+
this.isReservable = isReservable
7783
this.getCopy = ()=>{
78-
return new Rect(this.id,this.image,new Point(this.anchor.x-width/2,this.anchor.y-height/2),this.width,this.height,this.rotate,this.pid,this.sid)
84+
return new Rect(this.id,this.image,new Point(this.anchor.x-width/2,this.anchor.y-height/2),this.width,this.height,this.rotate,this.pid,this.sid,this.status,this.isConflictable,this.isReservable)
7985
}
8086
this.draw = function(ctx,isWordsShow){
8187
this.drawImg(ctx,isWordsShow)
@@ -107,7 +113,9 @@ export function Rect(id,image,point,width,height,rotate,pid,sid,status){
107113
ctx.translate(this.anchor.x,this.anchor.y)
108114
ctx.rotate(this.rotate)
109115
ctx.strokeStyle = "rgb(0,0,255)"
110-
ctx.setLineDash([5,5])
116+
ctx.setLineDash([10,10])
117+
if(isWordsShow==true)
118+
ctx.lineWidth = 3;
111119
ctx.strokeRect(-this.width/2,-this.height/2,this.width,this.height)
112120
ctx.restore()
113121
}
@@ -140,7 +148,7 @@ export function Rect(id,image,point,width,height,rotate,pid,sid,status){
140148
ctx.restore()
141149
}
142150
ctx.rotate(-this.rotate)
143-
const fontSize = this.width*5/12;
151+
const fontSize = Math.min(this.width,this.height)*7/12;
144152
ctx.font = `${fontSize}px PingFang HK`
145153
ctx.fillStyle = 'black'
146154
ctx.textAlign = "center";
@@ -232,6 +240,8 @@ export function isPointInAnyRect(point,rects){
232240
}
233241
//判断矩形和矩形是否冲突的办法
234242
export function isTheRectsConflict(rectA,rectB){
243+
if(!rectA.isConflictable||!rectB.isConflictable)
244+
return false
235245
var ALT = rectA.getCorner(Corner.leftTop)
236246
var ART = rectA.getCorner(Corner.rightTop)
237247
var ALB = rectA.getCorner(Corner.leftBottom)
@@ -314,12 +324,14 @@ export function getColorFromStatus(status){
314324
case 0:
315325
return false;
316326
case 1:
317-
return `rgb(61, 204, 15)`;
327+
return `rgb(61, 204, 15,0.6)`;
318328
case 2:
319-
return `rgb(52, 168, 238)`;
329+
return `rgb(52, 168, 238,0.4)`;
320330
case 3:
321-
return `rgb(251, 205, 22)`;
331+
return `rgb(251, 205, 22,0.4)`;
322332
case 4:
323-
return `rgb(249, 22, 11)`;
333+
return `rgb(249, 22, 11,0.4)`;
334+
default:
335+
return false;
324336
}
325337
}

src/components/EditList/EditHeader.vue

Lines changed: 94 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,37 @@
22
<div id="editHead">
33
<div id="headName">工位编辑列表</div>
44
<div class="serchInfo">
5-
<p>工位号:</p>
5+
<p>区域:</p>
66
<el-cascader
77
size="small"
88
class="selectText"
9-
v-model="seat"
9+
v-model="selectArea"
1010
clearable
1111
placeholder="请选择"
1212
:options="cascadeAreas"
1313
>
1414
</el-cascader>
1515
</div>
16+
<div class="serchInfo">
17+
<p>工位号:</p>
18+
<el-select
19+
size="small"
20+
class="selectText"
21+
v-model="seat"
22+
clearable
23+
filterable
24+
placeholder="请选择"
25+
:disabled="!seats.length"
26+
>
27+
<el-option
28+
v-for="(item, index) in seats"
29+
:key="index"
30+
:label="item"
31+
:value="item"
32+
>
33+
</el-option>
34+
</el-select>
35+
</div>
1636
<div class="serchInfo">
1737
<p>员工姓名:</p>
1838
<el-select
@@ -55,46 +75,76 @@
5575
</template>
5676

5777
<script>
78+
import { watch } from 'vue';
5879
export default {
5980
data() {
6081
return {
61-
selectArea: "",
82+
selectArea: [],
6283
seat: "",
6384
emp: "",
6485
post: "",
6586
cascadeAreas: [],
87+
seats:[]
6688
};
6789
},
6890
props: {
6991
areas: [],
7092
emps: [],
7193
posts: [],
94+
curArea:{}
95+
},
96+
mounted(){
97+
this.searchReservations()
7298
},
7399
watch: {
74-
selectArea() {
75-
this.seats = [];
76-
this.$http
77-
.get("/manage/number", { timeout: 2000 })
78-
.then((res) => {
79-
if (res.data.code == 1) {
80-
var temp;
81-
for (let i = 1; i <= res.data.data; i++) {
82-
temp = i + "";
83-
for (let j = 0; j < 3 - temp.length; j++) {
84-
temp = "0" + temp;
100+
selectArea:{
101+
deep:true,
102+
handler(){
103+
this.seats = [];
104+
if(this.selectArea.length!=3)
105+
return
106+
this.$http
107+
.get(`/manage/number?buildingName=${this.selectArea[0]}&floorName=${this.selectArea[1]}&name=${this.selectArea[2]}`, { timeout: 2000 })
108+
.then((res) => {
109+
if (res.data.code == 1) {
110+
var temp;
111+
var len;
112+
for (let i = 1; i <= res.data.data; i++) {
113+
temp = i + "";
114+
len = temp.length
115+
for (let j = 0; j < 3 - len; j++) {
116+
temp = "0" + temp;
117+
}
118+
this.seats.push(temp);
85119
}
86-
this.seats.push(temp);
120+
} else {
121+
this.$message.error(res.data.data);
87122
}
88-
} else {
89-
this.$message.error(res.data.data);
90-
}
91-
})
92-
.catch(() => {
93-
this.$message.error("服务器访问异常");
94-
});
123+
})
124+
.catch(() => {
125+
this.$message.error("服务器访问异常");
126+
});
127+
this.searchReservations()
128+
}
129+
} ,
130+
seat(){
131+
this.searchReservations()
132+
},
133+
emp(){
134+
this.searchReservations()
135+
},
136+
post(){
137+
this.searchReservations()
95138
},
96139
areas(){
97140
this.transformAreaToCascade()
141+
},
142+
curArea(){
143+
// if(this.selectArea.length==0){
144+
// this.selectArea[0]=(this.curArea.buildingName);
145+
// this.selectArea[1]=(this.curArea.floorName);
146+
// this.selectArea[2]=(this.curArea.name);
147+
// }
98148
}
99149
},
100150
methods: {
@@ -139,6 +189,25 @@ export default {
139189
});
140190
}
141191
},
192+
searchReservations(){
193+
// if(this.selectArea.length!=0||this.seat!=""||this.emp!=""||this.post!=""){
194+
this.$http.post("/reservations/search",{
195+
buildingName:this.selectArea[0],
196+
floorName:this.selectArea[1],
197+
name:this.selectArea[2],
198+
workstationSid:this.seat,
199+
username:this.emp,
200+
post: this.post
201+
}).then(res=>{
202+
if(res.data.data==null)
203+
res.data.data = []
204+
this.$emit("changeItems",res.data.data);
205+
})
206+
.catch(e=>{
207+
this.$message.error("服务器访问异常")
208+
})
209+
// }
210+
}
142211
},
143212
};
144213
</script>
@@ -184,6 +253,9 @@ export default {
184253
#editHead > div:nth-child(4) {
185254
top: 126px;
186255
}
256+
#editHead > div:nth-child(5) {
257+
top: 166px;
258+
}
187259
.serchInfo > p {
188260
position: absolute;
189261
top: 0;

src/components/EditList/EditList.vue

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
<template>
22
<div id="edit">
33
<div id="head">
4-
<EditHeaderVue :areas="areas" :emps="emps" :posts="posts"/>
4+
<EditHeaderVue :curArea="curArea" @changeItems="changeItems" :areas="areas" :emps="emps" :posts="posts"/>
55
</div>
66
<div id="blackLine"></div>
77
<div id="items">
8-
<EmpItemVue v-for="(itemInfo,index) in itemInfos" :key="index" :itemInfo="itemInfo"/>
8+
<template v-if="itemInfos.length>0">
9+
<EmpItemVue v-for="(itemInfo,index) in itemInfos" :key="index" :itemInfo="itemInfo"/>
10+
</template>
11+
<template v-else>
12+
<div id="noticeInfo">暂无记录</div>
13+
</template>
914
</div>
1015
</div>
1116
</template>
@@ -17,27 +22,44 @@ export default {
1722
name: 'EditList',
1823
data(){
1924
return{
20-
showSave:false
21-
// itemInfo:{
22-
// name: "张三",
23-
// url: "../assets/round_people.png",
24-
// wid:2367181912,
25-
// sid:"A401",
26-
// post:"高级开发工程师",
27-
// begin:"2023-3-01",
28-
// end:"2023-3-01"
29-
// }
25+
showSave:false,
26+
itemInfos: [],
3027
}
3128
},
3229
components: {
3330
EditHeaderVue,
3431
EmpItemVue
3532
},
3633
props:{
37-
itemInfos:[],
3834
emps:[],
3935
posts:[],
40-
areas:[]
36+
areas:[],
37+
curArea:{}
38+
},
39+
methods:{
40+
changeItems(data){
41+
console.log(data)
42+
this.itemInfos = data;
43+
data.forEach((val,index)=>{
44+
switch(this.itemInfos[index].status){
45+
case 0:
46+
this.itemInfos[index].status = "已预约"
47+
return
48+
case 1:
49+
this.itemInfos[index].status = "使用中"
50+
return
51+
case 2:
52+
this.itemInfos[index].status = "已完成"
53+
return
54+
case 3:
55+
this.itemInfos[index].status = "已违约"
56+
return
57+
case 4:
58+
this.itemInfos[index].status = "已取消"
59+
return
60+
}
61+
})
62+
}
4163
}
4264
}
4365
</script>
@@ -64,7 +86,7 @@ export default {
6486
}
6587
#head{
6688
width: 100%;
67-
min-height: 177px;
89+
min-height: 210px;
6890
}
6991
#items{
7092
position:relative;
@@ -77,6 +99,14 @@ export default {
7799
#items::-webkit-scrollbar{
78100
display: none;
79101
}
102+
#noticeInfo{
103+
position: absolute;
104+
font-size: 20px;
105+
color: rgb(102, 102, 102);
106+
font-weight: 600;
107+
left: 40%;
108+
top: 50%;
109+
}
80110
// #empty{
81111
// position: absolute;
82112
// height: 47px;

0 commit comments

Comments
 (0)