import API from "@/api"

export default {

    /**
     * 航线下拉
     * @param {*} params 
     * @returns 
     */
    drd(params) {
        return API.FCKERNEL.DrdAirway(params)
    },

    /**
     * 航线转换
     * @param {*} params 
     * @returns 
     */
    trans(params) {
        return API.FCKERNEL.TransAirway(params)
    },

    /**
     * 上传航线
     * @param {*} data 
     */
    async upload(id) {
        let data = await API.FCKERNEL.TransAirway({ id })

        console.log(data,'上传航线');
        this.uav_mqtt_fn({
            type: 521,
            data
        })
    },

    upload_message(data) {
        if (data.state === "UPLOAD_FINISH" && (data.totalWaypointCount === data.uploadedWaypointIndex)) {
            this.$el_message("航线上传成功")
        }
    }
}