|
@@ -1,83 +1,85 @@
|
|
|
import EquipmentRequest from '../common/util/request/EquipmentRequest'
|
|
|
import StorageRequest from '../common/util/request/StorageRequest'
|
|
|
import RequestParamModel from '../viewmodel/RequestParamModel'
|
|
|
-export class routerClass{
|
|
|
- xRoute?:number
|
|
|
- YRoute?:number
|
|
|
+
|
|
|
+export class routerClass {
|
|
|
+ xRoute?: number
|
|
|
+ YRoute?: number
|
|
|
}
|
|
|
-export class routerHttp{
|
|
|
- XCoordinateIn?:number
|
|
|
- YCoordinateIn?:number
|
|
|
+
|
|
|
+export class routerHttp {
|
|
|
+ XCoordinateIn?: number
|
|
|
+ YCoordinateIn?: number
|
|
|
}
|
|
|
|
|
|
@Entry
|
|
|
@Component
|
|
|
export struct WarehouseMap {
|
|
|
//车的位置请求返回数据
|
|
|
- @State CarPosition: Array<carPositionClass> =[]
|
|
|
- @State rgvNo:string='rgv1'
|
|
|
- @State route:routerClass[]=[
|
|
|
- {xRoute:10,YRoute:9},
|
|
|
- {xRoute:10,YRoute:9},
|
|
|
-{xRoute:10,YRoute:10},
|
|
|
-{xRoute:9,YRoute:10},
|
|
|
-{xRoute:8,YRoute:10},
|
|
|
+ @State CarPosition: Array<carPositionClass> = []
|
|
|
+ @State rgvNo: string = 'rgv1'
|
|
|
+ @State route: routerClass[] = [
|
|
|
+ { xRoute: 10, YRoute: 9 },
|
|
|
+ { xRoute: 10, YRoute: 9 },
|
|
|
+ { xRoute: 10, YRoute: 10 },
|
|
|
+ { xRoute: 9, YRoute: 10 },
|
|
|
+ { xRoute: 8, YRoute: 10 },
|
|
|
]
|
|
|
- @State routeIndex:number=0
|
|
|
+ @State routeIndex: number = 0
|
|
|
//路径开关
|
|
|
- @State routeIndexSwitch:number=0
|
|
|
+ @State routeIndexSwitch: number = 0
|
|
|
//选择层数颜色
|
|
|
- @State selectColor:number=-1
|
|
|
+ @State selectColor: number = -1
|
|
|
//调入svg
|
|
|
- @State enterSvg:number=0
|
|
|
+ @State enterSvg: number = 0
|
|
|
//调出svg
|
|
|
- @State outSvg:number=0
|
|
|
- @State selectSvg:number=0
|
|
|
+ @State outSvg: number = 0
|
|
|
+ @State selectSvg: number = 0
|
|
|
//车坐标
|
|
|
- @State carYCoordinate:number=10
|
|
|
- @State carXCoordinate:number=10
|
|
|
- @State carYCoordinate1:number=8
|
|
|
- @State carXCoordinate1:number=9
|
|
|
+ @State carYCoordinate: number = 10
|
|
|
+ @State carXCoordinate: number = 10
|
|
|
+ @State carYCoordinate1: number = 8
|
|
|
+ @State carXCoordinate1: number = 8
|
|
|
//调入xy坐标
|
|
|
- @State YCoordinateIn:number=0
|
|
|
- @State XCoordinateIn:number=0
|
|
|
+ @State YCoordinateIn: number = 0
|
|
|
+ @State XCoordinateIn: number = 0
|
|
|
//调出xy坐标
|
|
|
- @State YCoordinate:number=0
|
|
|
- @State XCoordinate:number=0
|
|
|
+ @State YCoordinate: number = 0
|
|
|
+ @State XCoordinate: number = 0
|
|
|
//调入格子
|
|
|
- @State SelectEnter:number=0
|
|
|
+ @State SelectEnter: number = 0
|
|
|
//调出格子
|
|
|
- @State SelectOut:number=0
|
|
|
- @State boxNumber:number=0
|
|
|
- @State JobHopping:number=0
|
|
|
+ @State SelectOut: number = 0
|
|
|
+ @State boxNumber: number = 0
|
|
|
+ @State JobHopping: number = 0
|
|
|
scroller: Scroller = new Scroller()
|
|
|
//选择的第几层
|
|
|
- @State selectStorey:number=-1
|
|
|
+ @State selectStorey: number = -1
|
|
|
//选调出格子有多少层
|
|
|
- @State storeyNumber:number=-1
|
|
|
- @State private storey:number[]=[6,5,4,3,2,1]
|
|
|
- @State private YAxis:number[]=[1,2,3,4,5,6,7,8,9,10,11,12,13]
|
|
|
- @State private XAxis:number[]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]
|
|
|
- @State private XYxis:number[][]=[
|
|
|
- [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,6,0,6,6],
|
|
|
- [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,6,0,6,6],
|
|
|
- [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,-1,-1,-1,-1,-1,-1,-1,-1],
|
|
|
- [-1,-1,-1,-1,-1,-1,-1,0,0,0,6,6,6,0,6,6,0,-1,-1,-1,-1,-1,-1,-1,-1],
|
|
|
- [-1,-1,-1,-1,-1,-1,-1,0,6,0,6,5,6,0,6,6,0,-1,-1,-1,-1,-1,-1,-1,-1],
|
|
|
- [-1,-1,-1,-1,-1,6,6,6,6,6,6,6,6,6,6,6,0,-1,-1,-1,-1,-1,-1,-1,-1],
|
|
|
- [-1,-1,-1,-1,-1,6,6,6,6,6,6,6,6,6,6,6,0,-1,-1,-1,-1,-1,-1,-1,-1],
|
|
|
- [-1,0,0,0,0,6,6,6,6,6,6,3,6,6,6,6,0,-1,-1,-1,-1,-1,-1,-1,-1],
|
|
|
- [-1,-1,-1,-1,-1,6,6,6,6,6,6,6,6,6,6,6,0,-1,-1,-1,-1,-1,-1,-1,-1],
|
|
|
- [-1,-1,-1,-1,-1,6,6,6,6,5,6,6,6,6,6,6,0,-1,-1,-1,-1,-1,-1,-1,-1],
|
|
|
- [0,0,0,-1,-1,6,6,6,2,6,6,6,6,3,6,6,0,-1,-1,-1,-1,-1,-1,-1,-1],
|
|
|
- [0,0,0,0,0,6,6,6,6,6,6,6,6,6,4,6,0,-1,-1,-1,-1,-1,-1,-1,-1],
|
|
|
- [0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]
|
|
|
+ @State storeyNumber: number = -1
|
|
|
+ @State private storey: number[] = [6, 5, 4, 3, 2, 1]
|
|
|
+ @State private YAxis: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
|
|
|
+ @State private XAxis: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
|
|
|
+ @State private XYxis: number[][] = [
|
|
|
+ [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 6, 0, 6, 6],
|
|
|
+ [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 6, 0, 6, 6],
|
|
|
+ [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1],
|
|
|
+ [-1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 6, 6, 6, 0, 6, 6, 0, -1, -1, -1, -1, -1, -1, -1, -1],
|
|
|
+ [-1, -1, -1, -1, -1, -1, -1, 0, 6, 0, 6, 5, 6, 0, 6, 6, 0, -1, -1, -1, -1, -1, -1, -1, -1],
|
|
|
+ [-1, -1, -1, -1, -1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, -1, -1, -1, -1, -1, -1, -1, -1],
|
|
|
+ [-1, -1, -1, -1, -1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, -1, -1, -1, -1, -1, -1, -1, -1],
|
|
|
+ [-1, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 3, 6, 6, 6, 6, 0, -1, -1, -1, -1, -1, -1, -1, -1],
|
|
|
+ [-1, -1, -1, -1, -1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, -1, -1, -1, -1, -1, -1, -1, -1],
|
|
|
+ [-1, -1, -1, -1, -1, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 6, 0, -1, -1, -1, -1, -1, -1, -1, -1],
|
|
|
+ [0, 0, 0, -1, -1, 6, 6, 6, 2, 6, 6, 6, 6, 3, 6, 6, 0, -1, -1, -1, -1, -1, -1, -1, -1],
|
|
|
+ [0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 6, 0, -1, -1, -1, -1, -1, -1, -1, -1],
|
|
|
+ [0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
|
|
|
]
|
|
|
- @State yNum:number[]=[1,2,3,4,5,6,7,8,9,10,11,12,13]
|
|
|
+ @State yNum: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
|
|
|
//提示弹窗
|
|
|
promptsController: CustomDialogController = new CustomDialogController({
|
|
|
- builder:prompt({
|
|
|
- JobHopping:this.JobHopping
|
|
|
+ builder: prompt({
|
|
|
+ JobHopping: this.JobHopping
|
|
|
|
|
|
}),
|
|
|
alignment: DialogAlignment.Center,
|
|
@@ -85,91 +87,99 @@ export struct WarehouseMap {
|
|
|
customStyle: true,
|
|
|
})
|
|
|
//硬件调仓操作
|
|
|
- AdjustmentHttp= async() : Promise<Adjustment[]> => {
|
|
|
- let res:Adjustment[] = await EquipmentRequest.post("/api/v1/wcs/box/movMultiple",
|
|
|
+ AdjustmentHttp = async (): Promise<Adjustment[]> => {
|
|
|
+ let res: Adjustment[] = await EquipmentRequest.post("/api/v1/wcs/box/movMultiple",
|
|
|
//todo 坐标加1,二维数组索引从零开始
|
|
|
{
|
|
|
//目标位置
|
|
|
- dest:(this.XCoordinateIn+1)+'-'+(this.YCoordinateIn+1),
|
|
|
+ dest: (this.XCoordinateIn + 1) + '-' + (this.YCoordinateIn + 1),
|
|
|
//移动位置
|
|
|
- src:(this.XCoordinate+1)+'-'+(this.YCoordinate+1),
|
|
|
+ src: (this.XCoordinate + 1) + '-' + (this.YCoordinate + 1),
|
|
|
//todo 数量暂时写死1
|
|
|
- num:"1"
|
|
|
- }as RequestParamModel)
|
|
|
+ num: "1"
|
|
|
+ } as RequestParamModel)
|
|
|
//
|
|
|
- console.log('textTag', 'post请求结果' +JSON.stringify(res)
|
|
|
+ console.log('textTag', 'post请求结果' + JSON.stringify(res)
|
|
|
);
|
|
|
return res
|
|
|
}
|
|
|
- Adjustment= async() : Promise<Adjustment[]> => {
|
|
|
- let res:Adjustment[] = await EquipmentRequest.get("/api/v1/wcs/rgvs/",
|
|
|
+ Adjustment = async (): Promise<Adjustment[]> => {
|
|
|
+ let res: Adjustment[] = await EquipmentRequest.get("/api/v1/wcs/rgvs/",
|
|
|
{
|
|
|
// destx:this.XCoordinateIn,
|
|
|
// destY:this.YCoordinateIn,
|
|
|
// rgvNo:'rgvNo1'
|
|
|
})
|
|
|
- console.log('textTag', 'get请求结果' +JSON.stringify(res));
|
|
|
+ console.log('textTag', 'get请求结果' + JSON.stringify(res));
|
|
|
return res
|
|
|
}
|
|
|
//请求车的位置
|
|
|
- CarPositionHttp= async() : Promise<carPositionClass> => {
|
|
|
- let res: carPositionClass= await EquipmentRequest.get("/api/v1/wcs/rgv/" + this.rgvNo, {
|
|
|
- }) as carPositionClass
|
|
|
- if (res!==undefined&&res.data!==undefined){
|
|
|
- this.carYCoordinate=res.data.y!
|
|
|
- this.carXCoordinate=res.data.x!
|
|
|
+ CarPositionHttp = async (): Promise<carPositionClass> => {
|
|
|
+ let res: carPositionClass = await EquipmentRequest.get("/api/v1/wcs/rgv/" + this.rgvNo, {}) as carPositionClass
|
|
|
+ if (res !== undefined && res.data !== undefined) {
|
|
|
+ this.carYCoordinate = res.data.y!
|
|
|
+ this.carXCoordinate = res.data.x!
|
|
|
}
|
|
|
console.log('textTag', '----------' + JSON.stringify(res));
|
|
|
- console.log('textTag', '----------' + JSON.stringify(this.carYCoordinate));
|
|
|
- console.log('textTag', '----------' + JSON.stringify(this.carXCoordinate));
|
|
|
- return res
|
|
|
+ return res
|
|
|
+ }
|
|
|
+ // 获取仓库坐标信息,x和y轴的信息
|
|
|
+ getStorageXYData = async () => {
|
|
|
+ let result: number[][] = await StorageRequest.post("/api/v1/wms/position/lineInfo/")
|
|
|
+
|
|
|
+ this.XYxis = result
|
|
|
+ console.log("---", JSON.stringify(result))
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
aboutToAppear(): void {
|
|
|
- this.CarPositionHttp().then((res:carPositionClass)=> {
|
|
|
+ this.getStorageXYData()
|
|
|
+ this.CarPositionHttp().then((res: carPositionClass) => {
|
|
|
|
|
|
console.log('textTag', '-------car现在的位置执行情况结果 cccccc11' + JSON.stringify(res))
|
|
|
})
|
|
|
|
|
|
}
|
|
|
+
|
|
|
build() {
|
|
|
Row() {
|
|
|
- Column(){
|
|
|
- Button(this.JobHopping===0?'启动调仓':'停止调仓', { type: ButtonType.Normal, stateEffect: true })
|
|
|
+ Column() {
|
|
|
+ Button(this.JobHopping == 0 ? '启动调仓' : '停止调仓', { type: ButtonType.Normal, stateEffect: true })
|
|
|
.borderRadius(8)
|
|
|
.borderRadius(px2vp(76))
|
|
|
- .backgroundColor(this.JobHopping===0?$r('app.color.blue_100'):$r('app.color.red_100'))
|
|
|
+ .backgroundColor(this.JobHopping == 0 ? $r('app.color.blue_100') : $r('app.color.red_100'))
|
|
|
.width(px2vp(292))
|
|
|
.height(px2vp(80))
|
|
|
- .onClick(()=>{
|
|
|
- if (this.JobHopping===0) {
|
|
|
+ .onClick(() => {
|
|
|
+ if (this.JobHopping == 0) {
|
|
|
this.promptsController.open()
|
|
|
- }else if (this.JobHopping===1) {
|
|
|
- this.JobHopping=0
|
|
|
+ } else if (this.JobHopping == 1) {
|
|
|
+ this.JobHopping = 0
|
|
|
}
|
|
|
})
|
|
|
Blank()
|
|
|
- if (this.storeyNumber!==-1){
|
|
|
+ if (this.storeyNumber !== -1) {
|
|
|
Text('层数')
|
|
|
.fontSize($r('app.float.fontSize_24'))
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.textAlign(TextAlign.Center)
|
|
|
.width(px2vp(292))
|
|
|
.height(px2vp(80))
|
|
|
- List({space:px2vp(20)}){
|
|
|
- ForEach(this.storey, (item:number,index:number) => {
|
|
|
- ListItem(){
|
|
|
+ List({ space: px2vp(20) }) {
|
|
|
+ ForEach(this.storey, (item: number, index: number) => {
|
|
|
+ ListItem() {
|
|
|
Text(item.toString())
|
|
|
.width(px2vp(291))
|
|
|
.height(px2vp(80))
|
|
|
.fontColor($r('app.color.black_100'))
|
|
|
.textAlign(TextAlign.Center)
|
|
|
- .border({width:px2vp(1)})
|
|
|
- .backgroundColor((index===(this.selectStorey-1))?$r('app.color.red_100'):index>=(6-this.storeyNumber)?$r('app.color.green_100'):$r('app.color.white_f1f3f5'))
|
|
|
+ .border({ width: px2vp(1) })
|
|
|
+ .backgroundColor((index == (this.selectStorey - 1)) ? $r('app.color.red_100') : index >= (6 - this.storeyNumber) ? $r('app.color.green_100') : $r('app.color.white_f1f3f5'))
|
|
|
.borderRadius(px2vp(16))
|
|
|
- .onClick(()=>{
|
|
|
- if (index>=(6-this.storeyNumber)) {
|
|
|
- this.selectStorey=index+1
|
|
|
- console.log('textTag'+'选择第几层的料箱'+this.selectStorey)
|
|
|
+ .onClick(() => {
|
|
|
+ if (index >= (6 - this.storeyNumber)) {
|
|
|
+ this.selectStorey = index + 1
|
|
|
+ console.log('textTag' + '选择第几层的料箱' + this.selectStorey)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -182,11 +192,11 @@ export struct WarehouseMap {
|
|
|
|
|
|
}.width(px2vp(292))
|
|
|
.height(px2vp(800))
|
|
|
- .margin({right:px2vp(24)})
|
|
|
+ .margin({ right: px2vp(24) })
|
|
|
|
|
|
Column() {
|
|
|
- Row(){
|
|
|
- Column(){
|
|
|
+ Row() {
|
|
|
+ Column() {
|
|
|
Text('y')
|
|
|
.width(px2vp(25))
|
|
|
.height(px2vp(25))
|
|
@@ -196,7 +206,8 @@ export struct WarehouseMap {
|
|
|
.width(px2vp(25))
|
|
|
.height(px2vp(55))
|
|
|
.justifyContent(FlexAlign.End)
|
|
|
- Column(){
|
|
|
+
|
|
|
+ Column() {
|
|
|
Text('x')
|
|
|
.width(px2vp(25))
|
|
|
.height(px2vp(25))
|
|
@@ -209,9 +220,10 @@ export struct WarehouseMap {
|
|
|
}
|
|
|
.width(px2vp(50))
|
|
|
.height(px2vp(55))
|
|
|
- List({space:px2vp(1)}){
|
|
|
- ForEach(this.YAxis, (item:number,index:number) => {
|
|
|
- ListItem(){
|
|
|
+
|
|
|
+ List({ space: px2vp(1) }) {
|
|
|
+ ForEach(this.YAxis, (item: number, index: number) => {
|
|
|
+ ListItem() {
|
|
|
Text(item.toString())
|
|
|
.width(px2vp(55))
|
|
|
.height(px2vp(55))
|
|
@@ -227,11 +239,12 @@ export struct WarehouseMap {
|
|
|
}
|
|
|
.width(px2vp(60))
|
|
|
.height(px2vp(800))
|
|
|
- Scroll(this.scroller){
|
|
|
- Column(){
|
|
|
- List({space:px2vp(1)}){
|
|
|
- ForEach(this.XAxis, (item:number,index:number) => {
|
|
|
- ListItem(){
|
|
|
+
|
|
|
+ Scroll(this.scroller) {
|
|
|
+ Column() {
|
|
|
+ List({ space: px2vp(1) }) {
|
|
|
+ ForEach(this.XAxis, (item: number, index: number) => {
|
|
|
+ ListItem() {
|
|
|
Text(item.toString())
|
|
|
.width(px2vp(55))
|
|
|
.height(px2vp(55))
|
|
@@ -243,50 +256,50 @@ export struct WarehouseMap {
|
|
|
}
|
|
|
.listDirection(Axis.Horizontal)
|
|
|
.scrollBar(BarState.Off)
|
|
|
- .width(px2vp(2000))
|
|
|
+ .width(px2vp(1620))
|
|
|
.height(px2vp(55))
|
|
|
- List({space:px2vp(1)}) {
|
|
|
- ForEach(this.XYxis, (y: number[],index1:number) => {
|
|
|
+
|
|
|
+ List({ space: px2vp(1) }) {
|
|
|
+ ForEach(this.XYxis, (y: number[], index1: number) => {
|
|
|
ListItem() {
|
|
|
- List({space:px2vp(1)}) {
|
|
|
- ForEach(y, (x: number,index2:number) => {
|
|
|
+ List({ space: px2vp(1) }) {
|
|
|
+ ForEach(y, (x: number, index2: number) => {
|
|
|
ListItem() {
|
|
|
- if (x>=0) {
|
|
|
- Stack(){
|
|
|
- Text(x===0?'':x.toString())
|
|
|
+ if (x >= 0) {
|
|
|
+ Stack() {
|
|
|
+ Text(x == 999 ? '' : x.toString())
|
|
|
.width(px2vp(55))
|
|
|
.height(px2vp(55))
|
|
|
.fontColor($r('app.color.blue_100'))
|
|
|
.textAlign(TextAlign.Center)
|
|
|
- .border({width:px2vp(1),color:'#7DC8EA'})
|
|
|
- .backgroundColor(((index1===4
|
|
|
- &&index2===7)||(index1===3&&index2===7)||(index1===3&&index2===9)||(index1===4&&index2===9)||(index1===4&&index2===13)||(index1===3&&index2===13))?'#E84026 ':x===0?$r('app.color.white_f1f3f5'):(this.SelectOut===1||this.SelectEnter===1)?$r('app.color.green_100'):'')
|
|
|
- if (this.routeIndexSwitch===1){
|
|
|
+ .border({ width: px2vp(1), color: '#7DC8EA' })
|
|
|
+ .backgroundColor(x == 999 ? '#E84026 ' : x == 0 ? $r('app.color.white_f1f3f5') : (this.SelectOut == 1 || this.SelectEnter == 1) ? $r('app.color.green_100') : '')
|
|
|
+ if (this.routeIndexSwitch == 1) {
|
|
|
//for (let num = 0; num < this.route.length; num++) {
|
|
|
- Text()
|
|
|
- .width(px2vp(55))
|
|
|
- .height(px2vp(55))
|
|
|
- .fontColor($r('app.color.black_100'))
|
|
|
- .textAlign(TextAlign.Center)
|
|
|
- // .backgroundColor((index1===this.route[this.routeIndex].YRoute&&index2===this.route[this.routeIndex].xRoute)?$r('app.color.green_100'):'')
|
|
|
- // }
|
|
|
+ Text()
|
|
|
+ .width(px2vp(55))
|
|
|
+ .height(px2vp(55))
|
|
|
+ .fontColor($r('app.color.black_100'))
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ // .backgroundColor((index1==this.route[this.routeIndex].YRoute&&index2==this.route[this.routeIndex].xRoute)?$r('app.color.green_100'):'')
|
|
|
+ // }
|
|
|
|
|
|
}
|
|
|
|
|
|
- Row(){
|
|
|
- Image((index1===this.carYCoordinate&&index2===this.carXCoordinate)?$r('app.media.robot_top'):(index1===this.carYCoordinate&&index2===this.carXCoordinate+1)?$r("app.media.robot_arm"):(index1===this.carYCoordinate1&&index2===this.carXCoordinate1)?$r('app.media.car_top'):(index1===this.carYCoordinate1&&index2===this.carXCoordinate1-1)?$r('app.media.car_bottom'):'')
|
|
|
+ Row() {
|
|
|
+ Image((index1 == this.carYCoordinate && index2 == this.carXCoordinate) ? $r('app.media.robot_top') : (index1 == this.carYCoordinate && index2 == this.carXCoordinate + 1) ? $r("app.media.robot_arm") : (index1 == this.carYCoordinate1 && index2 == this.carXCoordinate1) ? $r('app.media.car_top') : (index1 == this.carYCoordinate1 && index2 == this.carXCoordinate1 - 1) ? $r('app.media.car_bottom') : '')
|
|
|
.width(px2vp(55))
|
|
|
.height(px2vp(55))
|
|
|
- .margin({right:px2vp(55)})
|
|
|
- .onClick(()=>{
|
|
|
- if (x!==-1&&this.SelectOut===1) {
|
|
|
- this.YCoordinate=index1
|
|
|
- this.XCoordinate=index2
|
|
|
- this.SelectOut=2
|
|
|
- this.SelectEnter=3
|
|
|
- this.outSvg=1
|
|
|
- this.storeyNumber=x
|
|
|
- console.log('textTag'+'调出坐标'+ this.XCoordinate+this.YCoordinate)
|
|
|
+ .margin({ right: px2vp(55) })
|
|
|
+ .onClick(() => {
|
|
|
+ if (x != -1 && this.SelectOut == 1) {
|
|
|
+ this.YCoordinate = index1
|
|
|
+ this.XCoordinate = index2
|
|
|
+ this.SelectOut = 2
|
|
|
+ this.SelectEnter = 3
|
|
|
+ this.outSvg = 1
|
|
|
+ this.storeyNumber = x
|
|
|
+ console.log('textTag' + '调出坐标' + this.XCoordinate + this.YCoordinate)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -294,29 +307,29 @@ export struct WarehouseMap {
|
|
|
.width(px2vp(55))
|
|
|
.height(px2vp(55))
|
|
|
|
|
|
- if ((this.outSvg===1)){
|
|
|
- Image(((index1===this.YCoordinate&&index2===this.XCoordinate))?$r('app.media.Retrieve_grid'):'')
|
|
|
+ if ((this.outSvg == 1)) {
|
|
|
+ Image(((index1 == this.YCoordinate && index2 == this.XCoordinate)) ? $r('app.media.Retrieve_grid') : '')
|
|
|
.width(px2vp(55))
|
|
|
.height(px2vp(55))
|
|
|
- .onClick(()=>{
|
|
|
- if (x!==-1&&this.SelectEnter===1&&this.SelectOut===2){
|
|
|
- this.YCoordinateIn=index1
|
|
|
- this.XCoordinateIn=index2
|
|
|
- this.SelectEnter=2
|
|
|
- this.enterSvg=1
|
|
|
- console.log('textTag'+'调入坐标' +this.XCoordinateIn+this.YCoordinateIn)
|
|
|
+ .onClick(() => {
|
|
|
+ if (x !== -1 && this.SelectEnter == 1 && this.SelectOut == 2) {
|
|
|
+ this.YCoordinateIn = index1
|
|
|
+ this.XCoordinateIn = index2
|
|
|
+ this.SelectEnter = 2
|
|
|
+ this.enterSvg = 1
|
|
|
+ console.log('textTag' + '调入坐标' + this.XCoordinateIn + this.YCoordinateIn)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- if (this.enterSvg===1){
|
|
|
- Image((((index1===this.YCoordinateIn&&index2===this.XCoordinateIn)))?$r('app.media.Transfer_grid'):'')
|
|
|
+ if (this.enterSvg == 1) {
|
|
|
+ Image((((index1 == this.YCoordinateIn && index2 == this.XCoordinateIn))) ? $r('app.media.Transfer_grid') : '')
|
|
|
.width(px2vp(55))
|
|
|
.height(px2vp(55))
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
Text()
|
|
|
.width(px2vp(55))
|
|
|
.height(px2vp(55))
|
|
@@ -331,18 +344,17 @@ export struct WarehouseMap {
|
|
|
})
|
|
|
}
|
|
|
.scrollBar(BarState.Off)
|
|
|
- }.width(px2vp(2000))
|
|
|
+ }.width(px2vp(1620))
|
|
|
.height(px2vp(800))
|
|
|
|
|
|
-
|
|
|
}
|
|
|
- .width(px2vp(1020))
|
|
|
+ .width(px2vp(1620))
|
|
|
.height(px2vp(800))
|
|
|
.scrollable(ScrollDirection.Horizontal) // 滚动方向纵向
|
|
|
- if (this.JobHopping===1){
|
|
|
- Column(){
|
|
|
- Column(){
|
|
|
- Row(){
|
|
|
+ if (this.JobHopping == 1) {
|
|
|
+ Column() {
|
|
|
+ Column() {
|
|
|
+ Row() {
|
|
|
Text('调出料格')
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor($r('app.color.black_100'))
|
|
@@ -352,32 +364,34 @@ export struct WarehouseMap {
|
|
|
}
|
|
|
|
|
|
Blank()
|
|
|
- Button(this.SelectOut===2?'取消选择':'选调出料格', { type: ButtonType.Normal, stateEffect: true })
|
|
|
+ Button(this.SelectOut == 2 ? '取消选择' : '选调出料格', { type: ButtonType.Normal, stateEffect: true })
|
|
|
.borderRadius(8)
|
|
|
- .backgroundColor(this.SelectOut===2?$r('app.color.red_100'):$r('app.color.blue_100'))
|
|
|
+ .backgroundColor(this.SelectOut == 2 ? $r('app.color.red_100') : $r('app.color.blue_100'))
|
|
|
.width(px2vp(292))
|
|
|
.borderRadius(px2vp(76))
|
|
|
.height(px2vp(80))
|
|
|
- .onClick(()=>{
|
|
|
- if (this.SelectOut===0||this.SelectOut===2) {
|
|
|
- this.SelectOut=1
|
|
|
- this.YCoordinate=0
|
|
|
- this.XCoordinate=0
|
|
|
- this.outSvg=0
|
|
|
- this.enterSvg=0
|
|
|
+ .onClick(() => {
|
|
|
+ if (this.SelectOut == 0 || this.SelectOut == 2) {
|
|
|
+ this.SelectOut = 1
|
|
|
+ this.YCoordinate = 0
|
|
|
+ this.XCoordinate = 0
|
|
|
+ this.outSvg = 0
|
|
|
+ this.enterSvg = 0
|
|
|
}
|
|
|
- console.log('textTag'+'-----'+this.SelectOut)
|
|
|
+ console.log('textTag' + '-----' + this.SelectOut)
|
|
|
})
|
|
|
Blank()
|
|
|
|
|
|
- }.width(px2vp(450))
|
|
|
+ }
|
|
|
+ .width(px2vp(450))
|
|
|
.height(px2vp(188))
|
|
|
.padding(px2vp(20))
|
|
|
.alignItems(HorizontalAlign.Center)
|
|
|
.borderRadius(px2vp(16))
|
|
|
.backgroundColor($r('app.color.black_10'))
|
|
|
- .margin({bottom:px2vp(48)})
|
|
|
- Column(){
|
|
|
+ .margin({ bottom: px2vp(48) })
|
|
|
+
|
|
|
+ Column() {
|
|
|
Text('调入料格')
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor($r('app.color.black_100'))
|
|
@@ -385,41 +399,43 @@ export struct WarehouseMap {
|
|
|
.width(px2vp(410))
|
|
|
.textAlign(TextAlign.Start)
|
|
|
Blank()
|
|
|
- Button(this.SelectEnter===2?'取消选择':'选调入料格', { type: ButtonType.Normal, stateEffect: true })
|
|
|
+ Button(this.SelectEnter == 2 ? '取消选择' : '选调入料格', { type: ButtonType.Normal, stateEffect: true })
|
|
|
.borderRadius(8)
|
|
|
- .backgroundColor(this.SelectEnter===3?$r('app.color.blue_100'):this.SelectEnter===2?$r('app.color.red_100'):$r('app.color.blue_20'))
|
|
|
+ .backgroundColor(this.SelectEnter == 3 ? $r('app.color.blue_100') : this.SelectEnter == 2 ? $r('app.color.red_100') : $r('app.color.blue_20'))
|
|
|
.width(px2vp(292))
|
|
|
.height(px2vp(80))
|
|
|
.borderRadius(px2vp(76))
|
|
|
- .onClick(()=>{
|
|
|
- if (this.SelectEnter===3) {
|
|
|
- this.SelectEnter=1
|
|
|
- console.log('textTag'+'-----'+this.SelectEnter)
|
|
|
- }else if (this.SelectEnter===2){
|
|
|
- this.SelectEnter=1
|
|
|
+ .onClick(() => {
|
|
|
+ if (this.SelectEnter == 3) {
|
|
|
+ this.SelectEnter = 1
|
|
|
+ console.log('textTag' + '-----' + this.SelectEnter)
|
|
|
+ } else if (this.SelectEnter == 2) {
|
|
|
+ this.SelectEnter = 1
|
|
|
//this.outSvg=0
|
|
|
- this.enterSvg=0
|
|
|
- this.XCoordinateIn=0
|
|
|
- this.YCoordinateIn=0
|
|
|
+ this.enterSvg = 0
|
|
|
+ this.XCoordinateIn = 0
|
|
|
+ this.YCoordinateIn = 0
|
|
|
}
|
|
|
})
|
|
|
Blank()
|
|
|
|
|
|
- }.width(px2vp(450))
|
|
|
+ }
|
|
|
+ .width(px2vp(450))
|
|
|
.height(px2vp(188))
|
|
|
.padding(px2vp(20))
|
|
|
.alignItems(HorizontalAlign.Center)
|
|
|
.borderRadius(px2vp(16))
|
|
|
.backgroundColor($r('app.color.black_10'))
|
|
|
- .margin({bottom:px2vp(48)})
|
|
|
- Column(){
|
|
|
+ .margin({ bottom: px2vp(48) })
|
|
|
+
|
|
|
+ Column() {
|
|
|
Text('调箱数量')
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor($r('app.color.black_100'))
|
|
|
.fontSize($r('app.float.fontSize_24'))
|
|
|
.width(px2vp(410))
|
|
|
.textAlign(TextAlign.Start)
|
|
|
- Row(){
|
|
|
+ Row() {
|
|
|
Text('调动箱数')
|
|
|
.fontWeight(FontWeight.Regular)
|
|
|
.fontColor($r('app.color.black_60'))
|
|
@@ -432,117 +448,122 @@ export struct WarehouseMap {
|
|
|
.fontSize($r('app.float.fontSize_20'))
|
|
|
.width(px2vp(150))
|
|
|
.textAlign(TextAlign.End)
|
|
|
- }.width(px2vp(300))
|
|
|
- .height(px2vp(30))
|
|
|
+ }.width(px2vp(300))
|
|
|
+ .height(px2vp(30))
|
|
|
+
|
|
|
Blank()
|
|
|
- Row(){
|
|
|
- Image($r('app.media.add_disabled'))
|
|
|
- .width(px2vp(50))
|
|
|
- .height(px2vp(50))
|
|
|
- .onClick(()=>{
|
|
|
- if (this.boxNumber<6) {
|
|
|
- this.boxNumber++
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- Text(this.boxNumber.toString())
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
- .fontColor($r('app.color.black_100'))
|
|
|
- .fontSize($r('app.float.fontSize_24'))
|
|
|
- .width(px2vp(80))
|
|
|
- .textAlign(TextAlign.Center)
|
|
|
-
|
|
|
- Image($r('app.media.subtract_disabled'))
|
|
|
- .width(px2vp(50))
|
|
|
- .height(px2vp(50))
|
|
|
- .onClick(()=>{
|
|
|
- if (this.boxNumber>0) {
|
|
|
- this.boxNumber--
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- }.width(px2vp(450))
|
|
|
- .height(px2vp(80))
|
|
|
- .justifyContent(FlexAlign.Center)
|
|
|
+ Row() {
|
|
|
+ Image($r('app.media.add_disabled'))
|
|
|
+ .width(px2vp(50))
|
|
|
+ .height(px2vp(50))
|
|
|
+ .onClick(() => {
|
|
|
+ if (this.boxNumber < 6) {
|
|
|
+ this.boxNumber++
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ Text(this.boxNumber.toString())
|
|
|
+ .fontWeight(FontWeight.Medium)
|
|
|
+ .fontColor($r('app.color.black_100'))
|
|
|
+ .fontSize($r('app.float.fontSize_24'))
|
|
|
+ .width(px2vp(80))
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+
|
|
|
+ Image($r('app.media.subtract_disabled'))
|
|
|
+ .width(px2vp(50))
|
|
|
+ .height(px2vp(50))
|
|
|
+ .onClick(() => {
|
|
|
+ if (this.boxNumber > 0) {
|
|
|
+ this.boxNumber--
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ }.width(px2vp(450))
|
|
|
+ .height(px2vp(80))
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+
|
|
|
Blank()
|
|
|
|
|
|
- }.width(px2vp(450))
|
|
|
+ }
|
|
|
+ .width(px2vp(450))
|
|
|
.height(px2vp(188))
|
|
|
.padding(px2vp(20))
|
|
|
.alignItems(HorizontalAlign.Center)
|
|
|
.borderRadius(px2vp(16))
|
|
|
.backgroundColor($r('app.color.black_10'))
|
|
|
- .margin({bottom:px2vp(48)})
|
|
|
+ .margin({ bottom: px2vp(48) })
|
|
|
+
|
|
|
Button('确认调仓', { type: ButtonType.Normal, stateEffect: true })
|
|
|
.borderRadius(8)
|
|
|
- .backgroundColor(this.SelectEnter===2?$r('app.color.blue_100'):$r('app.color.blue_20'))
|
|
|
+ .backgroundColor(this.SelectEnter == 2 ? $r('app.color.blue_100') : $r('app.color.blue_20'))
|
|
|
.width(px2vp(292))
|
|
|
.height(px2vp(80))
|
|
|
.borderRadius(px2vp(76))
|
|
|
- .onClick(()=>{
|
|
|
+ .onClick(() => {
|
|
|
// this.Adjustment().then((res:Adjustment[])=> {
|
|
|
// console.log('textTag', '-------执行情况结果 cccccc11' + JSON.stringify(res))
|
|
|
// })
|
|
|
for (let index = 0; index < this.route.length; index++) {
|
|
|
this.routeIndex = index
|
|
|
}
|
|
|
- this.routeIndexSwitch=1
|
|
|
- this.enterSvg=0
|
|
|
- this.SelectEnter=0
|
|
|
- this.SelectOut=0
|
|
|
- this.storeyNumber=-1
|
|
|
- this.outSvg=0
|
|
|
- this.AdjustmentHttp().then((res:Adjustment[])=> {
|
|
|
- console.log('textTag', '-------执行情况结果 cccccc111111' + JSON.stringify(res))
|
|
|
- })
|
|
|
+ this.routeIndexSwitch = 1
|
|
|
+ this.enterSvg = 0
|
|
|
+ this.SelectEnter = 0
|
|
|
+ this.SelectOut = 0
|
|
|
+ this.storeyNumber = -1
|
|
|
+ this.outSvg = 0
|
|
|
+ this.AdjustmentHttp().then((res: Adjustment[]) => {
|
|
|
+ console.log('textTag', '-------执行情况结果 cccccc111111' + JSON.stringify(res))
|
|
|
+ })
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
-
|
|
|
}.width(px2vp(450))
|
|
|
.height(px2vp(800))
|
|
|
- .margin({left:px2vp(24)})
|
|
|
- }else if (this.JobHopping===1){
|
|
|
+ .margin({ left: px2vp(24) })
|
|
|
+ } else if (this.JobHopping == 1) {
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
.width(px2vp(1920))
|
|
|
.height(px2vp(800))
|
|
|
- .padding({left:px2vp(24),right:px2vp(24)})
|
|
|
- .margin({top:px2vp(20)})
|
|
|
+ .padding({ left: px2vp(24), right: px2vp(24) })
|
|
|
+ .margin({ top: px2vp(20) })
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@CustomDialog
|
|
|
///无批次号物料详情弹窗
|
|
|
struct prompt {
|
|
|
- @Link JobHopping:number
|
|
|
+ @Link JobHopping: number
|
|
|
controller: CustomDialogController
|
|
|
+
|
|
|
build() {
|
|
|
- Column({space:px2vp(50)}){
|
|
|
+ Column({ space: px2vp(50) }) {
|
|
|
Text('调仓确认')
|
|
|
.fontSize($r('app.float.fontSize_50'))
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor($r('app.color.black_100'))
|
|
|
.textAlign(TextAlign.Center)
|
|
|
.width(px2vp(400))
|
|
|
- .margin({top:px2vp(30)})
|
|
|
+ .margin({ top: px2vp(30) })
|
|
|
Text('启动调仓后,其他工位将无法叫料,是否开始?')
|
|
|
.fontSize($r('app.float.fontSize_24'))
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor($r('app.color.black_100'))
|
|
|
.textAlign(TextAlign.Center)
|
|
|
.width(px2vp(400))
|
|
|
- Row(){
|
|
|
+ Row() {
|
|
|
Button('取消', { type: ButtonType.Normal, stateEffect: true })
|
|
|
.borderRadius(8)
|
|
|
.backgroundColor($r('app.color.blue_100'))
|
|
|
.width(px2vp(252))
|
|
|
.height(px2vp(69))
|
|
|
.borderRadius(px2vp(76))
|
|
|
- .onClick(()=>{
|
|
|
+ .onClick(() => {
|
|
|
this.controller.close()
|
|
|
})
|
|
|
Blank()
|
|
@@ -552,12 +573,12 @@ struct prompt {
|
|
|
.width(px2vp(252))
|
|
|
.height(px2vp(69))
|
|
|
.borderRadius(px2vp(76))
|
|
|
- .onClick(()=>{
|
|
|
- this.JobHopping=1
|
|
|
+ .onClick(() => {
|
|
|
+ this.JobHopping = 1
|
|
|
this.controller.close()
|
|
|
})
|
|
|
}.width(px2vp(600))
|
|
|
- .padding({left:px2vp(30),right:px2vp(30)})
|
|
|
+ .padding({ left: px2vp(30), right: px2vp(30) })
|
|
|
|
|
|
}.width(px2vp(800))
|
|
|
.height(px2vp(400))
|
|
@@ -565,20 +586,22 @@ struct prompt {
|
|
|
.borderRadius(16)
|
|
|
}
|
|
|
}
|
|
|
-export class
|
|
|
-Adjustment{
|
|
|
- destx?:string
|
|
|
- code?:string
|
|
|
- msg?:string
|
|
|
- cmdId?:string
|
|
|
- state?:string
|
|
|
+
|
|
|
+export class Adjustment {
|
|
|
+ destx?: string
|
|
|
+ code?: string
|
|
|
+ msg?: string
|
|
|
+ cmdId?: string
|
|
|
+ state?: string
|
|
|
}
|
|
|
-export class carPositionClass{
|
|
|
- code?:string
|
|
|
- message?:string
|
|
|
- data?:dataClass
|
|
|
+
|
|
|
+export class carPositionClass {
|
|
|
+ code?: string
|
|
|
+ message?: string
|
|
|
+ data?: dataClass
|
|
|
}
|
|
|
-export class dataClass{
|
|
|
+
|
|
|
+export class dataClass {
|
|
|
x?: number
|
|
|
y?: number
|
|
|
}
|