package com.lukouguoji.aerologic.page.test

import com.lukouguoji.module_base.base.BaseViewModel
import com.lukouguoji.module_base.bean.GncShouYunBean
import com.lukouguoji.module_base.bean.SocketEventBean
import com.lukouguoji.module_base.model.BluetoothDialogModel
import com.lukouguoji.module_base.model.ConfirmDialogModel
import com.lukouguoji.module_base.model.NoticeMessageDialogModel
import com.lukouguoji.module_base.util.PrinterUtils
import dev.DevUtils

class PrintViewModel : BaseViewModel() {

    fun search() {
//        PrinterUtils.searchPrinters()
    }

    fun printTest() {
        BluetoothDialogModel()
            .showCallBack {
                PrinterUtils.printTest()
            }
    }

    fun printCar() {
        BluetoothDialogModel()
            .showCallBack {
                PrinterUtils.printCar("012")
            }
    }

    fun printBox() {
        BluetoothDialogModel()
            .showCallBack {
                PrinterUtils.printBox()
            }
    }

    fun printShouYun() {
        BluetoothDialogModel()
            .showCallBack {
                val bean = GncShouYunBean()
                bean.opDate = "2.21"
                bean.fno = "CZ8514"
                bean.dest = "PEK"
                bean.location = "167"
                bean.username = ""
                PrinterUtils.printShouYun(bean)
            }
    }

    fun mockWebSocket() {
        NoticeMessageDialogModel.show(SocketEventBean().apply {
            content =
                "航班240625/MU2266卸机完成时间从机坪转运区到进港库区环节完成运输时间超过90分钟，该航班对应的板车：012，请尽快处理！"
        })
    }

    fun showCommonDialog() {
        ConfirmDialogModel(message = "提示弹窗") {

        }.show()
    }
}