|
@@ -1,12 +1,12 @@
|
|
|
-import {componentLocation} from '../model/ComponentLocation'
|
|
|
+import { componentLocation } from '../model/ComponentLocation'
|
|
|
import { TitleStateComp } from '../common/component/TitleStateComp';
|
|
|
import { BottomOperateComp } from '../common/component/BottomOperateComp';
|
|
|
import router from '@ohos.router'
|
|
|
import { TaskComp } from '../common/component/TaskComp'
|
|
|
-import { Warehousing}from '../common/component/Warehousing'
|
|
|
-import { SmartFactoryCard }from '../common/component/SmartFactoryCard'
|
|
|
+import { Warehousing } from '../common/component/Warehousing'
|
|
|
+import { SmartFactoryCard } from '../common/component/SmartFactoryCard'
|
|
|
import CommonConstants from '../common/constants/CommonConstants'
|
|
|
-import UniversalCard from '../model/UniversalCard'
|
|
|
+import UniversalCard from '../model/UniversalCard'
|
|
|
import UniversalCardModel from '../model/database/UniversalCardModel';
|
|
|
import JGRequest from '../common/util/request/Request';
|
|
|
import DictInfo from '../model/DictInfo';
|
|
@@ -17,27 +17,30 @@ import deviceManager from '@ohos.distributedDeviceManager';
|
|
|
import { RemoteDeviceModel, BUNDLE_NAME } from '../model/RemoteDeviceModel'
|
|
|
import { DeviceDialog } from '../common/DeviceDialog';
|
|
|
import Want from '@ohos.app.ability.Want';
|
|
|
+
|
|
|
const TAG: string = 'testTag'
|
|
|
const DATA_CHANGE: string = 'dataChange'
|
|
|
const DATA_CHANGE1: number = 0
|
|
|
const EXIT: string = 'exit'
|
|
|
+
|
|
|
@CustomDialog
|
|
|
struct confirmPopup {
|
|
|
- cardType: number=0
|
|
|
- private cardServices?:UniversalCard[]
|
|
|
+ cardType: number = 0
|
|
|
+ private cardServices?: UniversalCard[]
|
|
|
controller: CustomDialogController
|
|
|
@Link x: number
|
|
|
- @Link y: number
|
|
|
- @Link cardSorting:number
|
|
|
- build(){
|
|
|
- Column(){
|
|
|
- Column(){
|
|
|
- Row(){
|
|
|
+ @Link y: number
|
|
|
+ @Link cardSorting: number
|
|
|
+
|
|
|
+ build() {
|
|
|
+ Column() {
|
|
|
+ Column() {
|
|
|
+ Row() {
|
|
|
Image($r('app.media.card'))
|
|
|
.width(px2vp(50))
|
|
|
.height(px2vp(50))
|
|
|
Text('卡片服务')
|
|
|
- .padding({left:10})
|
|
|
+ .padding({ left: 10 })
|
|
|
.margin(px2vp(5))
|
|
|
.width('100%')
|
|
|
.height('100%')
|
|
@@ -46,12 +49,13 @@ struct confirmPopup {
|
|
|
.textAlign(TextAlign.Start)
|
|
|
|
|
|
|
|
|
- }.width('100%')
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
.height('80%')
|
|
|
- .padding({left:10})
|
|
|
+ .padding({ left: 10 })
|
|
|
.borderRadius(px2vp(15))
|
|
|
.backgroundColor($r('app.color.general_font_white_color'))
|
|
|
- .onClick(async ()=>{
|
|
|
+ .onClick(async () => {
|
|
|
// 第一种遍历, const后面的是变量,变量的值就是数组的元素
|
|
|
// for (const card of this.cardServices) {
|
|
|
//
|
|
@@ -59,19 +63,19 @@ struct confirmPopup {
|
|
|
// }
|
|
|
// 第二种遍历,index是数组索引
|
|
|
// 1.修改变量数组中,此卡片类型的对象(改为打开状态)
|
|
|
- let temp: UniversalCard={}
|
|
|
- let deleteIndex: number=0
|
|
|
+ let temp: UniversalCard = {}
|
|
|
+ let deleteIndex: number = 0
|
|
|
if (!this.cardServices) {
|
|
|
console.log("TextTag1", this.cardServices)
|
|
|
return
|
|
|
}
|
|
|
console.log("TextTag2", this.cardServices)
|
|
|
- for (let index=0; index < this.cardServices.length; index++) {
|
|
|
+ for (let index = 0; index < this.cardServices.length; index++) {
|
|
|
if (this.cardServices[index].cardType === this.cardType) {
|
|
|
- this.cardServices[index].cardStatus = 1
|
|
|
+ this.cardServices[index].cardStatus = 1
|
|
|
temp = this.cardServices[index]
|
|
|
deleteIndex = index
|
|
|
- console.log("TextTag3",this.cardServices)
|
|
|
+ console.log("TextTag3", this.cardServices)
|
|
|
break
|
|
|
}
|
|
|
}
|
|
@@ -82,10 +86,10 @@ struct confirmPopup {
|
|
|
this.cardServices.splice(deleteIndex, 1)
|
|
|
// 3.修改排序号
|
|
|
let sort: number = 0
|
|
|
- if (this.cardServices===undefined) {
|
|
|
+ if (this.cardServices === undefined) {
|
|
|
return
|
|
|
}
|
|
|
- for (let index=0; index < this.cardServices.length; index++) {
|
|
|
+ for (let index = 0; index < this.cardServices.length; index++) {
|
|
|
this.cardServices[index].cardSort = sort
|
|
|
// 4.更新数据库数据
|
|
|
await UniversalCardModel.updateUniversalCard(this.cardServices[index])
|
|
@@ -93,72 +97,78 @@ struct confirmPopup {
|
|
|
}
|
|
|
// 5.变量数组添加元素
|
|
|
temp.cardSort = this.cardServices.length
|
|
|
- console.log("TextTag",temp)
|
|
|
+ console.log("TextTag", temp)
|
|
|
this.cardServices.push(temp)
|
|
|
|
|
|
// 6.修改数据入库
|
|
|
await UniversalCardModel.updateUniversalCard(temp)
|
|
|
this.controller.close()
|
|
|
})
|
|
|
+
|
|
|
Divider()
|
|
|
.width('80%')
|
|
|
|
|
|
}
|
|
|
- .margin({bottom:5})
|
|
|
+ .margin({ bottom: 5 })
|
|
|
.borderRadius(px2vp(15))
|
|
|
.height('20%')
|
|
|
.width('120%')
|
|
|
.backgroundColor($r('app.color.general_font_white_color'))
|
|
|
- Image(this.cardSorting===1?$r("app.media.processImages")
|
|
|
- :this.cardSorting===2?$r('app.media.jg_circular_icon'):$r('app.media.storage'))
|
|
|
- .width(this.cardSorting===2?px2vp(120):px2vp(280))
|
|
|
- .height(this.cardSorting===2?px2vp(120):px2vp(280))
|
|
|
+
|
|
|
+ Image(this.cardSorting === 1 ? $r("app.media.processImages")
|
|
|
+ : this.cardSorting === 2 ? $r('app.media.jg_circular_icon') : $r('app.media.storage'))
|
|
|
+ .width(this.cardSorting === 2 ? px2vp(120) : px2vp(280))
|
|
|
+ .height(this.cardSorting === 2 ? px2vp(120) : px2vp(280))
|
|
|
.borderRadius(15)
|
|
|
}
|
|
|
.alignItems(HorizontalAlign.Start)
|
|
|
.width('350px')
|
|
|
.height('600px')
|
|
|
- .offset(this.cardSorting===2?{x:this.x+50+'px', y:this.y-270+'px'}:{x:this.x+5+'px', y:this.y-410+'px'})
|
|
|
+ .offset(this.cardSorting === 2 ? { x: this.x + 50 + 'px', y: this.y - 270 + 'px' } : {
|
|
|
+ x: this.x + 5 + 'px',
|
|
|
+ y: this.y - 410 + 'px'
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@Entry
|
|
|
@Component
|
|
|
struct Index {
|
|
|
-
|
|
|
- private cardType:number=0
|
|
|
- @State cardSorting:number=0
|
|
|
- @State x:number=0
|
|
|
- @State y:number=0
|
|
|
- @State cardServices: UniversalCard[]=[{}]
|
|
|
- @State SmartFactoryCardDelete:number=0
|
|
|
- @State SmartFactoryDelete:number=0
|
|
|
- @State SmartFactoryCarLongPressDelete:number=0
|
|
|
- @State storageCardDelete:number=0
|
|
|
- @State smartWarehouseCard:number=0
|
|
|
- @State avatarFrame:boolean=false
|
|
|
- @State deleteConfirmation:number=0
|
|
|
- @State longPressDelete:number=0
|
|
|
+ private cardType: number = 0
|
|
|
+ @State cardSorting: number = 0
|
|
|
+ @State x: number = 0
|
|
|
+ @State y: number = 0
|
|
|
+ @State cardServices: UniversalCard[] = [{}]
|
|
|
+ @State SmartFactoryCardDelete: number = 0
|
|
|
+ @State SmartFactoryDelete: number = 0
|
|
|
+ @State SmartFactoryCarLongPressDelete: number = 0
|
|
|
+ @State storageCardDelete: number = 0
|
|
|
+ @State smartWarehouseCard: number = 0
|
|
|
+ @State avatarFrame: boolean = false
|
|
|
+ @State deleteConfirmation: number = 0
|
|
|
+ @State longPressDelete: number = 0
|
|
|
scroller: Scroller = new Scroller()
|
|
|
- @State shutdownTransparency:number=0
|
|
|
+ @State shutdownTransparency: number = 0
|
|
|
@State YanSe: number = 0
|
|
|
- @State carswitch:number=0
|
|
|
+ @State carswitch: number = 0
|
|
|
private isHomePage: boolean = true
|
|
|
@State textValue: string = ''
|
|
|
@State inputValue: string = ''
|
|
|
confirmPopupDialogController: CustomDialogController = new CustomDialogController({
|
|
|
builder: confirmPopup({
|
|
|
- cardType:this.cardType,
|
|
|
- x:this.x,
|
|
|
- y:this.y,
|
|
|
- cardSorting:this.cardSorting,
|
|
|
- cardServices:this.cardServices
|
|
|
+ cardType: this.cardType,
|
|
|
+ x: this.x,
|
|
|
+ y: this.y,
|
|
|
+ cardSorting: this.cardSorting,
|
|
|
+ cardServices: this.cardServices
|
|
|
}
|
|
|
- ),
|
|
|
+ ),
|
|
|
alignment: DialogAlignment.TopStart,
|
|
|
- autoCancel:true,
|
|
|
- customStyle:true,
|
|
|
+ autoCancel: true,
|
|
|
+ customStyle: true,
|
|
|
})
|
|
|
- async aboutToAppear(){
|
|
|
+
|
|
|
+ async aboutToAppear() {
|
|
|
// 查询数据字典放到CommonConstants的DICT_DATA变量中
|
|
|
let res: DictInfo[] = await JGRequest.post('/api/v1/sys/dictData/all',)
|
|
|
if (res && res.length > 0) {
|
|
@@ -168,7 +178,7 @@ struct Index {
|
|
|
}
|
|
|
|
|
|
// 1.根据当前用户id查询他配置的万能卡片
|
|
|
- let res1 :UniversalCard[] | undefined = await UniversalCardModel.getListByUserId(CommonConstants.USER_ID as number)
|
|
|
+ let res1: UniversalCard[] | undefined = await UniversalCardModel.getListByUserId(CommonConstants.USER_ID as number)
|
|
|
if (res1 && res.length > 0) {
|
|
|
this.cardServices = res1
|
|
|
}
|
|
@@ -176,10 +186,10 @@ struct Index {
|
|
|
if (!this.cardServices || this.cardServices.length <= 0) {
|
|
|
// 2.1用户第一次登录,所有的万能卡片都展示
|
|
|
for (let index = 0; index < CommonConstants.CARD_TYPE_DATA.length; index++) {
|
|
|
- const card:UniversalCard = {
|
|
|
- userId:CommonConstants.USER_ID,
|
|
|
+ const card: UniversalCard = {
|
|
|
+ userId: CommonConstants.USER_ID,
|
|
|
cardType: CommonConstants.CARD_TYPE_DATA[index],
|
|
|
- cardStatus:1,
|
|
|
+ cardStatus: 1,
|
|
|
cardSort: index
|
|
|
};
|
|
|
// 3.1用户的万能卡片入库,(以后再次打开页面能够查询到)
|
|
@@ -206,18 +216,17 @@ struct Index {
|
|
|
|
|
|
})
|
|
|
}
|
|
|
- @State @Watch('dataChange') click: number = 0;
|
|
|
- @State click1: number = 0;
|
|
|
- @State @Watch('dataChange') message: string = 'Hello World';
|
|
|
+
|
|
|
+ @State @Watch('dataChange') click: number = 0;
|
|
|
+ @State click1: number = 0;
|
|
|
+ @State @Watch('dataChange') message: string = 'Hello World';
|
|
|
@State inputMsg: string = '';
|
|
|
@State isDistributed: boolean = false
|
|
|
@StorageLink('deviceList') deviceList: Array<deviceManager.DeviceBasicInfo> = []
|
|
|
@State selectedIndex: number | undefined = -1
|
|
|
-
|
|
|
private remoteDeviceModel: RemoteDeviceModel = new RemoteDeviceModel()
|
|
|
private kvStoreModel: KvStoreModel = new KvStoreModel()
|
|
|
private dialogController: CustomDialogController | null = null
|
|
|
-
|
|
|
onSelectedIndexChange = async (index: number | undefined) => {
|
|
|
console.info(TAG, `selectedIndexChange`)
|
|
|
this.selectedIndex = index
|
|
@@ -282,15 +291,15 @@ struct Index {
|
|
|
console.debug(TAG, `startAbility deviceId: ${deviceId}`)
|
|
|
let context = getContext(this) as common.UIAbilityContext
|
|
|
|
|
|
- let want: Want = {
|
|
|
- bundleName: BUNDLE_NAME,
|
|
|
- //abilityName: 'MainAbility',
|
|
|
- abilityName: 'EntryAbility',
|
|
|
- deviceId: deviceId,
|
|
|
- parameters: {
|
|
|
- isRemote: 'isRemote'
|
|
|
- }
|
|
|
+ let want: Want = {
|
|
|
+ bundleName: BUNDLE_NAME,
|
|
|
+ //abilityName: 'MainAbility',
|
|
|
+ abilityName: 'EntryAbility',
|
|
|
+ deviceId: deviceId,
|
|
|
+ parameters: {
|
|
|
+ isRemote: 'isRemote'
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
|
|
|
context.startAbility(want).then((data) => {
|
|
@@ -345,27 +354,28 @@ struct Index {
|
|
|
this.dialogController.open()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
build() {
|
|
|
- Stack(){
|
|
|
+ Stack() {
|
|
|
Row() {
|
|
|
Column() {
|
|
|
- TitleStateComp({ isHomePage: this.isHomePage,})
|
|
|
- .onClick(()=>{
|
|
|
- this.avatarFrame=!this.avatarFrame
|
|
|
+ TitleStateComp({ isHomePage: this.isHomePage, })
|
|
|
+ .onClick(() => {
|
|
|
+ this.avatarFrame = !this.avatarFrame
|
|
|
})
|
|
|
Row() {
|
|
|
Column() {
|
|
|
- Grid(){
|
|
|
- ForEach(this.cardServices, (item:UniversalCard,index:number)=>{
|
|
|
+ Grid() {
|
|
|
+ ForEach(this.cardServices, (item: UniversalCard, index: number) => {
|
|
|
if (item.cardStatus === 1) {
|
|
|
- GridItem(){
|
|
|
- if (item.cardType===3){
|
|
|
- Stack(){
|
|
|
- Column(){
|
|
|
- TaskComp({isHomePage: this.isHomePage})
|
|
|
+ GridItem() {
|
|
|
+ if (item.cardType === 3) {
|
|
|
+ Stack() {
|
|
|
+ Column() {
|
|
|
+ TaskComp({ isHomePage: this.isHomePage })
|
|
|
Text('生产操作')
|
|
|
.fontSize(px2vp(27))
|
|
|
- .margin({top:5})
|
|
|
+ .margin({ top: 5 })
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor($r('app.color.robot_set_card_white'))
|
|
|
}
|
|
@@ -374,11 +384,12 @@ struct Index {
|
|
|
.gesture(
|
|
|
LongPressGesture({ repeat: false })
|
|
|
.onActionEnd(() => {
|
|
|
- this.deleteConfirmation=1
|
|
|
+ this.deleteConfirmation = 1
|
|
|
})
|
|
|
)
|
|
|
- if (this.deleteConfirmation===1){
|
|
|
- Row(){
|
|
|
+
|
|
|
+ if (this.deleteConfirmation === 1) {
|
|
|
+ Row() {
|
|
|
Text('取消')
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontSize(px2vp(27))
|
|
@@ -389,8 +400,8 @@ struct Index {
|
|
|
.borderRadius(px2vp(21))
|
|
|
.fontColor($r('app.color.robot_set_card_blue'))
|
|
|
.backgroundColor($r('app.color.general_font_white_color'))
|
|
|
- .onClick(()=>{
|
|
|
- this.deleteConfirmation=0
|
|
|
+ .onClick(() => {
|
|
|
+ this.deleteConfirmation = 0
|
|
|
})
|
|
|
Text('删除')
|
|
|
.fontWeight(FontWeight.Medium)
|
|
@@ -401,8 +412,8 @@ struct Index {
|
|
|
.borderRadius(px2vp(21))
|
|
|
.height('20%')
|
|
|
.textAlign(TextAlign.Center)
|
|
|
- .backgroundColor( $r('app.color.robot_set_card_blue'))
|
|
|
- .onClick(async()=>{
|
|
|
+ .backgroundColor($r('app.color.robot_set_card_blue'))
|
|
|
+ .onClick(async () => {
|
|
|
this.deleteConfirmation = 0
|
|
|
// 删除卡片
|
|
|
await this.deleteCard(index);
|
|
@@ -413,31 +424,32 @@ struct Index {
|
|
|
.width('95%')
|
|
|
}
|
|
|
}
|
|
|
- } else if (item.cardType===1){
|
|
|
- Stack(){
|
|
|
- Column(){
|
|
|
+ } else if (item.cardType === 1) {
|
|
|
+ Stack() {
|
|
|
+ Column() {
|
|
|
Warehousing()
|
|
|
Text('智能仓储')
|
|
|
- .margin({top:5})
|
|
|
+ .margin({ top: 5 })
|
|
|
.fontSize(px2vp(27))
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor($r('app.color.robot_set_card_white'))
|
|
|
}
|
|
|
.height('40%')
|
|
|
.width('95%')
|
|
|
- .onClick(()=>{
|
|
|
+ .onClick(() => {
|
|
|
router.pushUrl({
|
|
|
- url:'pages/Storage'
|
|
|
+ url: 'pages/Storage'
|
|
|
})
|
|
|
})
|
|
|
.gesture(
|
|
|
LongPressGesture({ repeat: false })
|
|
|
.onActionEnd(() => {
|
|
|
- this.smartWarehouseCard=1
|
|
|
+ this.smartWarehouseCard = 1
|
|
|
})
|
|
|
)
|
|
|
- if (this.smartWarehouseCard===1){
|
|
|
- Row(){
|
|
|
+
|
|
|
+ if (this.smartWarehouseCard === 1) {
|
|
|
+ Row() {
|
|
|
Text('取消')
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontSize(px2vp(27))
|
|
@@ -448,8 +460,8 @@ struct Index {
|
|
|
.borderRadius(px2vp(21))
|
|
|
.fontColor($r('app.color.robot_set_card_blue'))
|
|
|
.backgroundColor($r('app.color.general_font_white_color'))
|
|
|
- .onClick(()=>{
|
|
|
- this.smartWarehouseCard=0
|
|
|
+ .onClick(() => {
|
|
|
+ this.smartWarehouseCard = 0
|
|
|
})
|
|
|
Text('删除')
|
|
|
.fontWeight(FontWeight.Medium)
|
|
@@ -460,9 +472,9 @@ struct Index {
|
|
|
.borderRadius(px2vp(21))
|
|
|
.height('20%')
|
|
|
.textAlign(TextAlign.Center)
|
|
|
- .backgroundColor( $r('app.color.robot_set_card_blue'))
|
|
|
- .onClick(async ()=>{
|
|
|
- this.smartWarehouseCard=0
|
|
|
+ .backgroundColor($r('app.color.robot_set_card_blue'))
|
|
|
+ .onClick(async () => {
|
|
|
+ this.smartWarehouseCard = 0
|
|
|
// 删除卡片
|
|
|
await this.deleteCard(index);
|
|
|
})
|
|
@@ -472,31 +484,32 @@ struct Index {
|
|
|
.width('95%')
|
|
|
}
|
|
|
}
|
|
|
- } else if (item.cardType===5){
|
|
|
- Stack(){
|
|
|
- Column(){
|
|
|
+ } else if (item.cardType === 5) {
|
|
|
+ Stack() {
|
|
|
+ Column() {
|
|
|
SmartFactoryCard()
|
|
|
Text('智汇工厂')
|
|
|
- .margin({top:5})
|
|
|
+ .margin({ top: 5 })
|
|
|
.fontSize(px2vp(27))
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor($r('app.color.robot_set_card_white'))
|
|
|
}
|
|
|
.height('40%')
|
|
|
.width('95%')
|
|
|
- .onClick(()=>{
|
|
|
+ .onClick(() => {
|
|
|
router.pushUrl({
|
|
|
- url:'pages/SmartFactory'
|
|
|
+ url: 'pages/StationDevicesPage'
|
|
|
})
|
|
|
})
|
|
|
.gesture(
|
|
|
LongPressGesture({ repeat: false })
|
|
|
.onActionEnd(() => {
|
|
|
- this.SmartFactoryCarLongPressDelete=1
|
|
|
+ this.SmartFactoryCarLongPressDelete = 1
|
|
|
})
|
|
|
)
|
|
|
- if (this.SmartFactoryCarLongPressDelete===1){
|
|
|
- Row(){
|
|
|
+
|
|
|
+ if (this.SmartFactoryCarLongPressDelete === 1) {
|
|
|
+ Row() {
|
|
|
Text('取消')
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontSize(px2vp(27))
|
|
@@ -507,8 +520,8 @@ struct Index {
|
|
|
.borderRadius(px2vp(21))
|
|
|
.fontColor($r('app.color.robot_set_card_blue'))
|
|
|
.backgroundColor($r('app.color.general_font_white_color'))
|
|
|
- .onClick(()=>{
|
|
|
- this.SmartFactoryCarLongPressDelete=0
|
|
|
+ .onClick(() => {
|
|
|
+ this.SmartFactoryCarLongPressDelete = 0
|
|
|
})
|
|
|
Text('删除')
|
|
|
.fontWeight(FontWeight.Medium)
|
|
@@ -519,9 +532,9 @@ struct Index {
|
|
|
.borderRadius(px2vp(21))
|
|
|
.height('20%')
|
|
|
.textAlign(TextAlign.Center)
|
|
|
- .backgroundColor( $r('app.color.robot_set_card_blue'))
|
|
|
- .onClick(async ()=>{
|
|
|
- this.SmartFactoryCarLongPressDelete=0
|
|
|
+ .backgroundColor($r('app.color.robot_set_card_blue'))
|
|
|
+ .onClick(async () => {
|
|
|
+ this.SmartFactoryCarLongPressDelete = 0
|
|
|
// 删除卡片
|
|
|
await this.deleteCard(index);
|
|
|
})
|
|
@@ -549,13 +562,14 @@ struct Index {
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
.width('100%')
|
|
|
.height('68%')
|
|
|
+
|
|
|
Row({ space: 10 }) {
|
|
|
Text().width('1%')
|
|
|
Column({ space: 10 }) {
|
|
|
Image($r("app.media.shezhi"))
|
|
|
.width('60%')
|
|
|
.height('60%')
|
|
|
- .margin({top:5})
|
|
|
+ .margin({ top: 5 })
|
|
|
Text('设置')
|
|
|
.width('100%')
|
|
|
.textAlign(TextAlign.Center)
|
|
@@ -573,11 +587,12 @@ struct Index {
|
|
|
url: 'pages/SetPage'
|
|
|
})
|
|
|
})
|
|
|
+
|
|
|
Column({ space: 10 }) {
|
|
|
Image($r("app.media.storage"))
|
|
|
.width('60%')
|
|
|
.height('60%')
|
|
|
- .margin({top:5})
|
|
|
+ .margin({ top: 5 })
|
|
|
Text('智能仓储')
|
|
|
.width('100%')
|
|
|
.textAlign(TextAlign.Center)
|
|
@@ -593,7 +608,7 @@ struct Index {
|
|
|
.onClick(() => {
|
|
|
router.pushUrl({
|
|
|
url: 'pages/Warehousing'
|
|
|
- // url: 'pages/Storage'
|
|
|
+ // url: 'pages/Storage'
|
|
|
})
|
|
|
})
|
|
|
.gesture(
|
|
@@ -601,30 +616,31 @@ struct Index {
|
|
|
.onActionEnd(() => {
|
|
|
let rect = componentLocation.getComponentRect('smartWarehousing')
|
|
|
let touchPoint: TouchObject = {
|
|
|
- displayX:0,
|
|
|
- displayY:0,
|
|
|
- windowX:0,
|
|
|
- windowY:0,
|
|
|
+ displayX: 0,
|
|
|
+ displayY: 0,
|
|
|
+ windowX: 0,
|
|
|
+ windowY: 0,
|
|
|
id: 1,
|
|
|
x: rect.left, // 组件中心点x坐标
|
|
|
- y:rect.bottom, // 组件中心点y坐标
|
|
|
+ y: rect.bottom, // 组件中心点y坐标
|
|
|
type: TouchType.Down,
|
|
|
screenX: rect.left + (rect.right - rect.left) / 2, // 组件中心点x坐标
|
|
|
screenY: rect.left + (rect.right - rect.left) / 2, // 组件中心点y坐标
|
|
|
}
|
|
|
- this.x=touchPoint.x
|
|
|
- this.y=touchPoint.y
|
|
|
- this.cardSorting=1
|
|
|
- this.cardType=1
|
|
|
+ this.x = touchPoint.x
|
|
|
+ this.y = touchPoint.y
|
|
|
+ this.cardSorting = 1
|
|
|
+ this.cardType = 1
|
|
|
this.confirmPopupDialogController.open()
|
|
|
|
|
|
})
|
|
|
)
|
|
|
+
|
|
|
Column({ space: 10 }) {
|
|
|
Image($r('app.media.jiqiren'))
|
|
|
.width('60%')
|
|
|
.height('60%')
|
|
|
- .margin({top:5})
|
|
|
+ .margin({ top: 5 })
|
|
|
Text('机器人调试')
|
|
|
.width('100%')
|
|
|
.textAlign(TextAlign.Center)
|
|
@@ -646,7 +662,7 @@ struct Index {
|
|
|
Image($r("app.media.processImages"))
|
|
|
.width('60%')
|
|
|
.height('60%')
|
|
|
- .margin({top:5})
|
|
|
+ .margin({ top: 5 })
|
|
|
Text('工序操作')
|
|
|
.width('100%')
|
|
|
.textAlign(TextAlign.Center)
|
|
@@ -670,21 +686,21 @@ struct Index {
|
|
|
.onActionEnd(() => {
|
|
|
let rect = componentLocation.getComponentRect('workingProcedure')
|
|
|
let touchPoint: TouchObject = {
|
|
|
- displayX:0,
|
|
|
- displayY:0,
|
|
|
- windowX:0,
|
|
|
- windowY:0,
|
|
|
+ displayX: 0,
|
|
|
+ displayY: 0,
|
|
|
+ windowX: 0,
|
|
|
+ windowY: 0,
|
|
|
id: 1,
|
|
|
x: rect.left, // 组件中心点x坐标
|
|
|
- y:rect.bottom, // 组件中心点y坐标
|
|
|
+ y: rect.bottom, // 组件中心点y坐标
|
|
|
type: TouchType.Down,
|
|
|
screenX: rect.left + (rect.right - rect.left) / 2, // 组件中心点x坐标
|
|
|
screenY: rect.left + (rect.right - rect.left) / 2, // 组件中心点y坐标
|
|
|
}
|
|
|
- this.x=touchPoint.x
|
|
|
- this.y=touchPoint.y
|
|
|
- this.cardSorting=0
|
|
|
- this.cardType=3
|
|
|
+ this.x = touchPoint.x
|
|
|
+ this.y = touchPoint.y
|
|
|
+ this.cardSorting = 0
|
|
|
+ this.cardType = 3
|
|
|
this.confirmPopupDialogController.open()
|
|
|
})
|
|
|
)
|
|
@@ -693,7 +709,7 @@ struct Index {
|
|
|
Image($r('app.media.baobiao'))
|
|
|
.width('60%')
|
|
|
.height('60%')
|
|
|
- .margin({top:5})
|
|
|
+ .margin({ top: 5 })
|
|
|
Text('统计报表')
|
|
|
.width('100%')
|
|
|
.textAlign(TextAlign.Center)
|
|
@@ -709,40 +725,43 @@ struct Index {
|
|
|
.height('90%')
|
|
|
.borderRadius(15)
|
|
|
.backgroundColor('#4d000000')
|
|
|
- // Column({ space: 10 }) {
|
|
|
- // Image($r('app.media.baobiao'))
|
|
|
- // .width('60%')
|
|
|
- // .height('60%')
|
|
|
- // .margin({top:5})
|
|
|
- // Text('维修站')
|
|
|
- // .width('100%')
|
|
|
- // .textAlign(TextAlign.Center)
|
|
|
- // .fontSize(16)
|
|
|
- // .fontColor('#ffff')
|
|
|
- //
|
|
|
- // }
|
|
|
- // .width('10%')
|
|
|
- // .justifyContent(FlexAlign.Center)
|
|
|
- // .height('90%')
|
|
|
- // .borderRadius(15)
|
|
|
- // .backgroundColor('#4d000000')
|
|
|
- // .onClick(()=>{
|
|
|
- // router.pushUrl({
|
|
|
- // url:'pages/MaintenanceStation'
|
|
|
- // })
|
|
|
- // })
|
|
|
- }
|
|
|
+
|
|
|
+ // Column({ space: 10 }) {
|
|
|
+ // Image($r('app.media.baobiao'))
|
|
|
+ // .width('60%')
|
|
|
+ // .height('60%')
|
|
|
+ // .margin({top:5})
|
|
|
+ // Text('维修站')
|
|
|
+ // .width('100%')
|
|
|
+ // .textAlign(TextAlign.Center)
|
|
|
+ // .fontSize(16)
|
|
|
+ // .fontColor('#ffff')
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ // .width('10%')
|
|
|
+ // .justifyContent(FlexAlign.Center)
|
|
|
+ // .height('90%')
|
|
|
+ // .borderRadius(15)
|
|
|
+ // .backgroundColor('#4d000000')
|
|
|
+ // .onClick(()=>{
|
|
|
+ // router.pushUrl({
|
|
|
+ // url:'pages/MaintenanceStation'
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ }
|
|
|
.width('100%')
|
|
|
.height('16%')
|
|
|
- Stack(){
|
|
|
- BottomOperateComp({ isHomePage: this.isHomePage})
|
|
|
- Row(){
|
|
|
- Text().width('100%')
|
|
|
+
|
|
|
+ Stack() {
|
|
|
+ BottomOperateComp({ isHomePage: this.isHomePage })
|
|
|
+ Row() {
|
|
|
+ Text()
|
|
|
+ .width('100%')
|
|
|
.height('100%')
|
|
|
.id('Warehousing')
|
|
|
- .onClick(()=>{
|
|
|
+ .onClick(() => {
|
|
|
router.pushUrl({
|
|
|
- url:'pages/SmartFactory',
|
|
|
+ url: 'pages/StationDevicesPage',
|
|
|
})
|
|
|
})
|
|
|
.gesture(
|
|
@@ -750,21 +769,21 @@ struct Index {
|
|
|
.onActionEnd(() => {
|
|
|
let rect = componentLocation.getComponentRect('Warehousing')
|
|
|
let touchPoint: TouchObject = {
|
|
|
- displayX:0,
|
|
|
- displayY:0,
|
|
|
- windowX:0,
|
|
|
- windowY:0,
|
|
|
+ displayX: 0,
|
|
|
+ displayY: 0,
|
|
|
+ windowX: 0,
|
|
|
+ windowY: 0,
|
|
|
id: 2,
|
|
|
x: rect.left, // 组件中心点x坐标
|
|
|
- y:rect.bottom, // 组件中心点y坐标
|
|
|
+ y: rect.bottom, // 组件中心点y坐标
|
|
|
type: TouchType.Down,
|
|
|
screenX: rect.left + (rect.right - rect.left) / 2, // 组件中心点x坐标
|
|
|
screenY: rect.left + (rect.right - rect.left) / 2, // 组件中心点y坐标
|
|
|
}
|
|
|
- this.x=touchPoint.x
|
|
|
- this.y=touchPoint.y
|
|
|
- this.cardSorting=2
|
|
|
- this.cardType=5
|
|
|
+ this.x = touchPoint.x
|
|
|
+ this.y = touchPoint.y
|
|
|
+ this.cardSorting = 2
|
|
|
+ this.cardType = 5
|
|
|
this.confirmPopupDialogController.open()
|
|
|
})
|
|
|
)
|
|
@@ -792,16 +811,16 @@ struct Index {
|
|
|
// 删除卡片
|
|
|
private async deleteCard(index: number) {
|
|
|
// 1.修改变量中cardStatus为2,关闭状态
|
|
|
- if (this.cardServices===undefined) {
|
|
|
- return
|
|
|
+ if (this.cardServices === undefined) {
|
|
|
+ return
|
|
|
}
|
|
|
- this.cardServices[index] = {
|
|
|
- id: this.cardServices[index].id,
|
|
|
- userId: this.cardServices[index].userId,
|
|
|
- cardType: this.cardServices[index].cardType,
|
|
|
- cardStatus: 2,
|
|
|
- cardSort: this.cardServices[index].cardSort,
|
|
|
- };
|
|
|
+ this.cardServices[index] = {
|
|
|
+ id: this.cardServices[index].id,
|
|
|
+ userId: this.cardServices[index].userId,
|
|
|
+ cardType: this.cardServices[index].cardType,
|
|
|
+ cardStatus: 2,
|
|
|
+ cardSort: this.cardServices[index].cardSort,
|
|
|
+ };
|
|
|
// 2.更新数据库,当前删除的卡片状态
|
|
|
await UniversalCardModel.updateUniversalCard(this.cardServices[index]);
|
|
|
// 3.其他数据的修改排序
|