WarehouseMap.ets 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. import EquipmentRequest from '../common/util/request/EquipmentRequest'
  2. import JGRequest from '../common/util/request/Request'
  3. import StorageRequest from '../common/util/request/StorageRequest'
  4. import RequestParamModel from '../viewmodel/RequestParamModel'
  5. import promptAction from '@ohos.promptAction'
  6. export class routerClass {
  7. xRoute?: number
  8. YRoute?: number
  9. }
  10. export class routerHttp {
  11. XCoordinateIn?: number
  12. YCoordinateIn?: number
  13. }
  14. export class Adjustment {
  15. destx?: string
  16. code?: string
  17. msg?: string
  18. cmdId?: string
  19. state?: string
  20. }
  21. export class carPositionClass {
  22. code?: string
  23. message?: string
  24. data?: dataClass
  25. }
  26. export class dataClass {
  27. x?: number
  28. y?: number
  29. }
  30. enum ChooseStatus {
  31. Normal = 0,
  32. isChoosing = 1,
  33. Chosen = 2, //已经选择了
  34. }
  35. @Extend(Text)
  36. function commonSquare() {
  37. .width(px2vp(55))
  38. .height(px2vp(55))
  39. .fontColor($r('app.color.blue_100'))
  40. .textAlign(TextAlign.Center)
  41. .border({ width: px2vp(1), color: '#7DC8EA' })
  42. }
  43. @Extend(Button)
  44. function choiceBtnSty() {
  45. .width(px2vp(292))
  46. .borderRadius(px2vp(76))
  47. .height(px2vp(80))
  48. }
  49. @Entry
  50. @Component
  51. export struct WarehouseMap {
  52. //车的位置请求返回数据
  53. @State CarPosition: Array<carPositionClass> = []
  54. @State rgvNo: string = 'rgv1'
  55. @State route: routerClass[] = [
  56. { xRoute: 10, YRoute: 9 },
  57. { xRoute: 10, YRoute: 9 },
  58. { xRoute: 10, YRoute: 10 },
  59. { xRoute: 9, YRoute: 10 },
  60. { xRoute: 8, YRoute: 10 },
  61. ]
  62. //选择层数颜色
  63. @State selectColor: number = -1
  64. @State selectSvg: number = 0
  65. //车坐标
  66. @State carYCoordinate: number = 10
  67. @State carXCoordinate: number = 10
  68. @State carYCoordinate1: number = 8
  69. @State carXCoordinate1: number = 9
  70. //调入xy坐标
  71. @State YCoordinateIn: number = 0
  72. @State XCoordinateIn: number = 0
  73. //调出xy坐标
  74. @State YCoordinate: number = 0
  75. @State XCoordinate: number = 0
  76. //调入格子
  77. @State SelectEnter: number = ChooseStatus.Normal
  78. //调出格子
  79. @State SelectOut: ChooseStatus = ChooseStatus.Normal //点击 选调出料格
  80. @State boxNumber: number = 0 //调箱数量
  81. @State numberEnable: number = 0 //调入料格的剩余的个数
  82. @State JobHopping: number = 0
  83. scroller: Scroller = new Scroller()
  84. //选择的第几层
  85. @State selectStorey: number = -1
  86. //选调出格子有多少层
  87. @State storeyNumber: number = -1
  88. @State private storey: number[] = [6, 5, 4, 3, 2, 1]
  89. @State private YAxis: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
  90. @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]
  91. @State private XYxis: number[][] = [
  92. [-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],
  93. [-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],
  94. [-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],
  95. [-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],
  96. [-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],
  97. [-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],
  98. [-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],
  99. [-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],
  100. [-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],
  101. [-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],
  102. [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],
  103. [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],
  104. [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]
  105. ]
  106. @State yNum: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
  107. //提示弹窗
  108. promptsController: CustomDialogController = new CustomDialogController({
  109. builder: prompt({
  110. JobHopping: this.JobHopping
  111. }),
  112. alignment: DialogAlignment.Center,
  113. gridCount: 4,
  114. customStyle: true,
  115. })
  116. //硬件调仓操作
  117. AdjustmentHttp = async (): Promise<Adjustment[]> => {
  118. let res: Adjustment[] = await EquipmentRequest.post("/api/v1/wcs/box/movMultiple",
  119. //todo 坐标加1,二维数组索引从零开始
  120. {
  121. //目标位置
  122. dest: (this.XCoordinateIn + 1) + '-' + (this.YCoordinateIn + 1),
  123. //移动位置
  124. src: (this.XCoordinate + 1) + '-' + (this.YCoordinate + 1),
  125. //todo 数量暂时写死1
  126. num: "1"
  127. } as RequestParamModel)
  128. //
  129. console.log('textTag', 'post请求结果' + JSON.stringify(res)
  130. );
  131. return res
  132. }
  133. Adjustment = async (): Promise<Adjustment[]> => {
  134. let res: Adjustment[] = await EquipmentRequest.get("/api/v1/wcs/rgvs/",
  135. {
  136. // destx:this.XCoordinateIn,
  137. // destY:this.YCoordinateIn,
  138. // rgvNo:'rgvNo1'
  139. })
  140. return res
  141. }
  142. //请求车的位置
  143. CarPositionHttp = async (): Promise<carPositionClass> => {
  144. let res: carPositionClass = await EquipmentRequest.get("/api/v1/wcs/rgv/" + this.rgvNo, {}) as carPositionClass
  145. if (res !== undefined && res.data !== undefined) {
  146. this.carYCoordinate = res.data.y!
  147. this.carXCoordinate = res.data.x!
  148. }
  149. return res
  150. }
  151. // 获取仓库坐标信息,x和y轴的信息
  152. getStorageXYData = async () => {
  153. let result: number[][] = await StorageRequest.post("/api/v1/wms/position/lineInfo/")
  154. this.XYxis = result
  155. }
  156. aboutToAppear(): void {
  157. this.getStorageXYData()
  158. this.CarPositionHttp().then((res: carPositionClass) => {
  159. console.log('textTag', '-------car现在的位置执行情况结果 cccccc11' + JSON.stringify(res))
  160. })
  161. }
  162. // 停止调仓后重置数据
  163. resetData = () => {
  164. this.JobHopping = 0
  165. this.SelectOut = ChooseStatus.Normal
  166. this.SelectEnter = ChooseStatus.Normal
  167. this.storeyNumber = -1
  168. this.boxNumber = 0
  169. this.selectStorey = -1
  170. this.stop()
  171. }
  172. build() {
  173. Row() {
  174. Column() {
  175. Button(this.JobHopping === 0 ? '启动调仓' : '停止调仓', { type: ButtonType.Normal, stateEffect: true })
  176. .borderRadius(8)
  177. .borderRadius(px2vp(76))
  178. .backgroundColor(this.JobHopping === 0 ? $r('app.color.blue_100') : $r('app.color.red_100'))
  179. .width(px2vp(292))
  180. .height(px2vp(80))
  181. .onClick(() => {
  182. if (this.JobHopping === 0) {
  183. this.getStorageXYData()
  184. this.promptsController.open()
  185. } else if (this.JobHopping === 1) {
  186. this.resetData()
  187. }
  188. })
  189. Blank()
  190. if (this.SelectOut == ChooseStatus.Chosen) {
  191. Text('层数')
  192. .fontSize($r('app.float.fontSize_24'))
  193. .fontWeight(FontWeight.Medium)
  194. .textAlign(TextAlign.Center)
  195. .width(px2vp(292))
  196. .height(px2vp(80))
  197. List({ space: px2vp(20) }) {
  198. ForEach(this.storey, (item: number, index: number) => {
  199. ListItem() {
  200. Text(item.toString())
  201. .width(px2vp(291))
  202. .height(px2vp(80))
  203. .fontColor($r('app.color.black_100'))
  204. .textAlign(TextAlign.Center)
  205. .border({ width: px2vp(1) })
  206. .backgroundColor((index === (this.selectStorey - 1)) ? $r('app.color.red_100') : index >= (6 - this.storeyNumber) ? $r('app.color.green_100') : $r('app.color.white_f1f3f5'))
  207. .borderRadius(px2vp(16))
  208. .onClick(() => {
  209. if (index >= (6 - this.storeyNumber)) {
  210. this.selectStorey = index + 1
  211. this.boxNumber = this.storeyNumber - (6 - this.selectStorey)
  212. }
  213. })
  214. }
  215. })
  216. }
  217. .scrollBar(BarState.Off)
  218. .width(px2vp(292))
  219. .height(px2vp(600))
  220. }
  221. }.width(px2vp(292))
  222. .height(px2vp(800))
  223. .margin({ right: px2vp(24) })
  224. Column() {
  225. Row() {
  226. Column() {
  227. Text('y')
  228. .width(px2vp(25))
  229. .height(px2vp(25))
  230. .fontColor($r('app.color.order_producing_state_background'))
  231. .textAlign(TextAlign.Center)
  232. }
  233. .width(px2vp(25))
  234. .height(px2vp(55))
  235. .justifyContent(FlexAlign.End)
  236. Column() {
  237. Text('x')
  238. .width(px2vp(25))
  239. .height(px2vp(25))
  240. .fontColor($r('app.color.order_producing_state_background'))
  241. .textAlign(TextAlign.Center)
  242. }
  243. .width(px2vp(25))
  244. .height(px2vp(55))
  245. .justifyContent(FlexAlign.Start)
  246. }
  247. .width(px2vp(50))
  248. .height(px2vp(55))
  249. List({ space: px2vp(1) }) {
  250. ForEach(this.YAxis, (item: number, index: number) => {
  251. ListItem() {
  252. Text(item.toString())
  253. .width(px2vp(55))
  254. .height(px2vp(55))
  255. .fontColor($r('app.color.black_10'))
  256. .textAlign(TextAlign.Center)
  257. }
  258. })
  259. }
  260. .scrollBar(BarState.Off)
  261. .width(px2vp(60))
  262. .height(px2vp(745))
  263. }
  264. .width(px2vp(60))
  265. .height(px2vp(800))
  266. Scroll(this.scroller) {
  267. Column() {
  268. List({ space: px2vp(1) }) {
  269. ForEach(this.XAxis, (item: number, index: number) => {
  270. ListItem() {
  271. Text(item.toString())
  272. .width(px2vp(55))
  273. .height(px2vp(55))
  274. .fontColor($r('app.color.black_10'))
  275. .textAlign(TextAlign.Center)
  276. }
  277. })
  278. }
  279. .listDirection(Axis.Horizontal)
  280. .scrollBar(BarState.Off)
  281. .width(px2vp(2000))
  282. .height(px2vp(55))
  283. List({ space: px2vp(1) }) {
  284. ForEach(this.XYxis, (y: number[], index1: number) => {
  285. ListItem() {
  286. List({ space: px2vp(1) }) {
  287. ForEach(y, (x: number, index2: number) => {
  288. ListItem() {
  289. if (x >= 0 && x != 999) {
  290. Stack() {
  291. // 根据不同的状态展示不同的颜色
  292. // 任何状态下都展示数字
  293. Text(x.toString())
  294. .commonSquare().backgroundColor($r('app.color.white_f1f3f5'))
  295. // 调出正在选择中
  296. if (this.SelectOut == ChooseStatus.isChoosing) {
  297. if (Number(x) > 0) {
  298. Text(x.toString())
  299. .commonSquare().backgroundColor($r('app.color.green_100'))
  300. .onClick(() => {
  301. this.YCoordinate = index1
  302. this.XCoordinate = index2
  303. this.SelectOut = ChooseStatus.Chosen
  304. this.storeyNumber = x
  305. })
  306. }
  307. else {
  308. Text(x.toString())
  309. .commonSquare().backgroundColor($r('app.color.white_f1f3f5'))
  310. }
  311. }
  312. else if (this.SelectEnter == ChooseStatus.isChoosing) {
  313. if (Number(x) < 6 && index1 != this.YCoordinate && index2 != this.XCoordinate) {
  314. Text(x.toString())
  315. .commonSquare().backgroundColor($r('app.color.green_100'))
  316. .onClick(() => {
  317. this.YCoordinateIn = index1
  318. this.XCoordinateIn = index2
  319. this.SelectEnter = ChooseStatus.Chosen
  320. this.numberEnable = 6 - Number(x)
  321. })
  322. }
  323. else {
  324. Text(x.toString())
  325. .commonSquare().backgroundColor($r('app.color.white_f1f3f5'))
  326. }
  327. }
  328. // 普通状态下 调出和调入都没有在选择的情况下展示的 小车
  329. if (this.SelectOut != ChooseStatus.isChoosing && this.SelectEnter != ChooseStatus.isChoosing) {
  330. Row() {
  331. 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') : '')
  332. .width(px2vp(55))
  333. .height(px2vp(55))
  334. .margin({ right: px2vp(55) })
  335. // .onClick(() => {
  336. // if (x !== -1 && this.SelectOut === 1) {
  337. // this.YCoordinate = index1
  338. // this.XCoordinate = index2
  339. // this.SelectOut = 2
  340. // this.SelectEnter = 3
  341. // this.outSvg = 1
  342. // this.storeyNumber = x
  343. // console.log('textTag' + '调出坐标' + this.XCoordinate + this.YCoordinate)
  344. // }
  345. // })
  346. }
  347. .justifyContent(FlexAlign.End)
  348. .width(px2vp(55))
  349. .height(px2vp(55))
  350. }
  351. // 展示调出的图标
  352. if (index1 === this.YCoordinate && index2 === this.XCoordinate && this.SelectOut == ChooseStatus.Chosen) {
  353. Image($r('app.media.Retrieve_grid'))
  354. .width(px2vp(55))
  355. .height(px2vp(55))
  356. }
  357. // 展示调入的图标
  358. if (this.SelectEnter == ChooseStatus.Chosen && index1 === this.YCoordinateIn && index2 === this.XCoordinateIn) {
  359. Image($r('app.media.Transfer_grid'))
  360. .width(px2vp(55))
  361. .height(px2vp(55))
  362. }
  363. }
  364. } else {
  365. Text()
  366. .width(px2vp(55))
  367. .height(px2vp(55))
  368. .fontColor($r('app.color.black_100'))
  369. .textAlign(TextAlign.Center)
  370. }
  371. }
  372. })
  373. }
  374. .listDirection(Axis.Horizontal)
  375. }
  376. })
  377. }
  378. .scrollBar(BarState.Off)
  379. }.width(px2vp(2000))
  380. .height(px2vp(800))
  381. }
  382. .width(px2vp(1020))
  383. .height(px2vp(800))
  384. .scrollable(ScrollDirection.Horizontal) // 滚动方向纵向
  385. if (this.JobHopping === 1) {
  386. Column() {
  387. Column() {
  388. Row() {
  389. Text('调出料格')
  390. .fontWeight(FontWeight.Medium)
  391. .fontColor($r('app.color.black_100'))
  392. .fontSize($r('app.float.fontSize_24'))
  393. .width(px2vp(410))
  394. .textAlign(TextAlign.Start)
  395. }
  396. Blank()
  397. if (this.SelectOut == ChooseStatus.Chosen) {
  398. Button('取消选择', { type: ButtonType.Normal, stateEffect: true })
  399. .choiceBtnSty()
  400. .backgroundColor($r('app.color.red_100'))
  401. .onClick(() => {
  402. this.SelectOut = ChooseStatus.Normal
  403. this.storeyNumber = -1
  404. this.selectStorey = -1
  405. })
  406. }
  407. else {
  408. Button('选调出料格', { type: ButtonType.Normal, stateEffect: true })
  409. .choiceBtnSty()
  410. .backgroundColor($r('app.color.blue_100'))
  411. .onClick(() => {
  412. this.SelectOut = ChooseStatus.isChoosing
  413. })
  414. }
  415. Blank()
  416. }
  417. .width(px2vp(450))
  418. .height(px2vp(188))
  419. .padding(px2vp(20))
  420. .alignItems(HorizontalAlign.Center)
  421. .borderRadius(px2vp(16))
  422. .backgroundColor($r('app.color.black_10'))
  423. .margin({ bottom: px2vp(48) })
  424. Column() {
  425. Text('调入料格')
  426. .fontWeight(FontWeight.Medium)
  427. .fontColor($r('app.color.black_100'))
  428. .fontSize($r('app.float.fontSize_24'))
  429. .width(px2vp(410))
  430. .textAlign(TextAlign.Start)
  431. Blank()
  432. if (this.SelectEnter == ChooseStatus.Chosen) {
  433. Button('取消选择', { type: ButtonType.Normal, stateEffect: true })
  434. .choiceBtnSty()
  435. .backgroundColor($r('app.color.red_100'))
  436. .onClick(() => {
  437. this.SelectEnter = ChooseStatus.Normal
  438. })
  439. }
  440. else {
  441. Button('选调入料格', { type: ButtonType.Normal, stateEffect: true })
  442. .choiceBtnSty()
  443. .backgroundColor($r('app.color.blue_100'))
  444. .enabled(this.SelectOut == ChooseStatus.Chosen)
  445. .onClick(() => {
  446. this.SelectEnter = ChooseStatus.isChoosing
  447. })
  448. }
  449. Blank()
  450. }
  451. .width(px2vp(450))
  452. .height(px2vp(188))
  453. .padding(px2vp(20))
  454. .alignItems(HorizontalAlign.Center)
  455. .borderRadius(px2vp(16))
  456. .backgroundColor($r('app.color.black_10'))
  457. .margin({ bottom: px2vp(48) })
  458. Column() {
  459. Text('调箱数量' + this.boxNumber)
  460. .fontWeight(FontWeight.Medium)
  461. .fontColor($r('app.color.black_100'))
  462. .fontSize($r('app.float.fontSize_24'))
  463. .width(px2vp(410))
  464. .textAlign(TextAlign.Start)
  465. }
  466. .width(px2vp(450))
  467. .padding(px2vp(20))
  468. .alignItems(HorizontalAlign.Center)
  469. .borderRadius(px2vp(16))
  470. .backgroundColor($r('app.color.black_10'))
  471. .margin({ bottom: px2vp(48) })
  472. Button('确认调仓', { type: ButtonType.Normal, stateEffect: true }).choiceBtnSty()
  473. .backgroundColor((this.SelectEnter == ChooseStatus.Chosen && this.SelectOut == ChooseStatus.Chosen) ? $r('app.color.blue_100') : $r('app.color.blue_20'))
  474. .enabled(this.SelectEnter == ChooseStatus.Chosen && this.SelectOut == ChooseStatus.Chosen)
  475. .onClick(() => {
  476. this.sureToChangeStore()
  477. })
  478. }.width(px2vp(450))
  479. .height(px2vp(800))
  480. .margin({ left: px2vp(24) })
  481. } else if (this.JobHopping === 1) {
  482. }
  483. }
  484. .width(px2vp(1920))
  485. .height(px2vp(800))
  486. .padding({ left: px2vp(24), right: px2vp(24) })
  487. .margin({ top: px2vp(20) })
  488. }
  489. sureToChangeStore = async () => {
  490. // 入的要比调箱数量大
  491. if (this.boxNumber > this.numberEnable) {
  492. promptAction.showToast({
  493. message: "调入料格剩余数量小于调箱的数量!",
  494. duration: 1800,
  495. bottom: '50%'
  496. })
  497. return
  498. }
  499. // console.log("jjjjjjj", this.XCoordinate, this.YCoordinate, this.XCoordinateIn, this.YCoordinateIn)
  500. await StorageRequest.post("/api/v1/wms/common/changePosition", {
  501. src: `${this.XCoordinate + 1}-${this.YCoordinate + 1}`,
  502. dest: `${this.XCoordinateIn + 1}-${this.YCoordinateIn + 1}`,
  503. num: this.boxNumber
  504. } as RequestParamModel)
  505. this.resetData()
  506. }
  507. stop = async () => {
  508. await JGRequest.get("api/v1/wms/common/startChangePosition/0")
  509. }
  510. aboutToDisappear(): void {
  511. this.stop()
  512. }
  513. }
  514. @CustomDialog
  515. ///无批次号物料详情弹窗
  516. struct prompt {
  517. @Link JobHopping: number
  518. controller: CustomDialogController
  519. start = async () => {
  520. await JGRequest.get("api/v1/wms/common/startChangePosition/1")
  521. this.JobHopping = 1
  522. this.controller.close()
  523. }
  524. build() {
  525. Column({ space: px2vp(50) }) {
  526. Text('调仓确认')
  527. .fontSize($r('app.float.fontSize_50'))
  528. .fontWeight(FontWeight.Medium)
  529. .fontColor($r('app.color.black_100'))
  530. .textAlign(TextAlign.Center)
  531. .width(px2vp(400))
  532. .margin({ top: px2vp(30) })
  533. Text('启动调仓后,其他工位将无法叫料,是否开始?')
  534. .fontSize($r('app.float.fontSize_24'))
  535. .fontWeight(FontWeight.Medium)
  536. .fontColor($r('app.color.black_100'))
  537. .textAlign(TextAlign.Center)
  538. .width(px2vp(400))
  539. Row() {
  540. Button('取消', { type: ButtonType.Normal, stateEffect: true })
  541. .borderRadius(8)
  542. .backgroundColor($r('app.color.blue_100'))
  543. .width(px2vp(252))
  544. .height(px2vp(69))
  545. .borderRadius(px2vp(76))
  546. .onClick(() => {
  547. this.controller.close()
  548. })
  549. Blank()
  550. Button('确认', { type: ButtonType.Normal, stateEffect: true })
  551. .borderRadius(8)
  552. .backgroundColor($r('app.color.warn_1'))
  553. .width(px2vp(252))
  554. .height(px2vp(69))
  555. .borderRadius(px2vp(76))
  556. .onClick(() => {
  557. this.start()
  558. })
  559. }.width(px2vp(600))
  560. .padding({ left: px2vp(30), right: px2vp(30) })
  561. }.width(px2vp(800))
  562. .height(px2vp(400))
  563. .backgroundColor($r('app.color.white_f1f3f5'))
  564. .borderRadius(16)
  565. }
  566. }