function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
import n from "jspack";
import { n as r, c as e } from "./index-BcLRpF0n.js";
import t from "recorder-core";
import "recorder-core/src/engine/mp3";
import "recorder-core/src/engine/mp3-engine";
import "recorder-core/src/engine/pcm";
import { mapGetters as i } from "vuex";
import a from "mqtt";
import { _ as s } from "./mount_head-c1OIlkSj.js";
import "vue";
import "vue-clipboard2";
import "interactjs";
import "prismjs";
import "prismjs/themes/prism-okaidia.css";
import "@liveqing/liveplayer";
import "jquery";
import "mqtt/dist/mqtt";
import "axios";
import "element-ui";
import "vue-router";
import "moment";
import "terraformer-wkt-parser";
import "dayjs";
import "file-saver";
import "nanoid";
import "js-base64";
import "element-ui/lib/theme-chalk/index.css";
var o = /*#__PURE__*/function () {
  function o(n) {
    var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
    var e = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
    var t = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
    var i = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
    _classCallCheck(this, o);
    _defineProperty(this, "msgId", void 0);
    _defineProperty(this, "mlen", 0);
    _defineProperty(this, "incompat_flags", 0);
    _defineProperty(this, "compat_flags", 0);
    _defineProperty(this, "seq", 0);
    _defineProperty(this, "srcSystem", 0);
    _defineProperty(this, "srcComponent", 0);
    this.msgId = n, this.mlen = r, this.seq = e, this.srcSystem = t, this.srcComponent = i;
  }
  return _createClass(o, [{
    key: "pack",
    value: function pack() {
      return n.Pack("BBBBBBBHB", [253, this.mlen, this.incompat_flags, this.compat_flags, this.seq, this.srcSystem, this.srcComponent, (255 & this.msgId) << 8 | this.msgId >> 8 & 255, this.msgId >> 16]);
    }
  }]);
}();
var l = /*#__PURE__*/function () {
  function l() {
    _classCallCheck(this, l);
    _defineProperty(this, "header", void 0);
    _defineProperty(this, "payload", void 0);
  }
  return _createClass(l, [{
    key: "pack",
    value: function pack(r, e, t) {
      this.payload = t;
      var i = this.payload.length;
      for (; i > 1 && 0 == this.payload[i - 1];) i -= 1;
      this.payload = this.payload.slice(0, i);
      this.header = new o(this.msg_id, this.payload.length, r.seq, r.srcSystem, r.srcComponent, 0, 0), this.msgbuf = this.header.pack().concat(this.payload);
      var a = l.x25Crc(this.msgbuf.slice(1));
      return a = l.x25Crc([e], a), this.msgbuf = this.msgbuf.concat(n.Pack("<H", [a])), this.msgbuf;
    }
  }], [{
    key: "x25Crc",
    value: function x25Crc(n, r) {
      var e = r || 65535;
      return n.forEach(function (n) {
        var r = n ^ 255 & e;
        r = 255 & (r ^ r << 4), e = e >> 8 ^ r << 8 ^ r << 3 ^ r >> 4, e &= 65535;
      }), e;
    }
  }]);
}();
_defineProperty(l, "HEADER_LEN", 10);
var c = {
  props: {
    rotate: {
      type: Number,
      "default": 0
    },
    volume: {
      type: Number,
      "default": 0
    }
  },
  data: function data() {
    return {
      time: "",
      handleChangeVolumeTime: ""
    };
  },
  mounted: function mounted() {},
  inject: ["PagerP1", "PoliceKey"],
  methods: {
    stopFn: function stopFn() {
      clearInterval(this.time);
    },
    rotateFn: function rotateFn(n) {
      var _this = this;
      clearInterval(this.time), this.time = 1 == n ? setInterval(function () {
        if (_this.rotate < 60) {
          _this.rotate++;
          var _n = {
            data: _this.rotate,
            type: 2314
          };
          _this.mqtt_publish(_n);
        }
      }, 100) : setInterval(function () {
        if (_this.rotate > 0) {
          _this.rotate--;
          var _n2 = {
            data: _this.rotate,
            type: 2314
          };
          _this.mqtt_publish(_n2);
        }
      }, 100);
    },
    handleChangeVolume: function handleChangeVolume(n) {
      var _this2 = this;
      this.stophandleChangeVolume(), this.handleChangeVolumeTime = setInterval(function () {
        if (0 == _this2.volume && -1 == n || 100 == _this2.volume && 1 == n) return;
        _this2.volume += n;
        var r = {
          data: _this2.volume,
          type: 2315
        };
        _this2.mqtt_publish(r);
      }, 100);
    },
    stophandleChangeVolume: function stophandleChangeVolume() {
      clearInterval(this.handleChangeVolumeTime);
    },
    mqtt_publish: function mqtt_publish(n) {
      var _this3 = this;
      return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
        var _r;
        return _regeneratorRuntime().wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              if (!_this3.PoliceKey()) {
                _context.next = 5;
                break;
              }
              _context.next = 3;
              return _this3.PoliceKey();
            case 3:
              _r = _context.sent;
              _this3.PagerP1.mqtt.client.publish("SPEAK/OBTAIN/".concat(_r, "-01"), new TextEncoder().encode(JSON.stringify(n)), {
                qos: 0
              }, function (n) {});
            case 5:
            case "end":
              return _context.stop();
          }
        }, _callee);
      }))();
    },
    mqtt_json2uint8array: function mqtt_json2uint8array(n) {
      if (!n) return n;
      var r = this.PagerP1.mqtt.encoder;
      r || (r = new TextEncoder());
      return r.encode(JSON.stringify(n));
    }
  }
};
var d = function d() {
    var n = this,
      r = n.$createElement,
      e = n._self._c || r;
    return e("div", {
      staticClass: "angleControlBox mt16"
    }, [e("div", {
      staticClass: "angleControlBg w99 h99 dib"
    }, [e("div", {
      staticClass: "dib wih100 ht100 pr"
    }, [e("div", {
      staticClass: "angleControlLB tc w40 ml50 mt40 h30"
    }), n._v(" "), e("img", {
      staticClass: "pa top0 left21",
      attrs: {
        src: "328347aa8fd738eb.png",
        alt: ""
      }
    }), n._v(" "), e("div", {
      staticClass: "light pa left30 top20",
      style: "transform: rotate(" + (90 - n.rotate) + "deg);"
    }, [e("img", {
      attrs: {
        src: "1548e9784d06abdd.png",
        alt: ""
      }
    })]), n._v(" "), e("div", {
      staticClass: "iconfont icon-zuo1 pa top40 left15 c08c"
    }), n._v(" "), e("div", {
      staticClass: "rolate iconfont icon-zuo1 pa top40 right15 c08c"
    })])]), n._v(" "), n._m(0), n._v(" "), e("div", {
      staticClass: "h56 wih100 bg tc"
    }, [e("div", {
      staticClass: "AngleControl dib w100 h56 tc pr"
    }, [e("div", {
      staticClass: "left5 top18 pa w28 lh28 h28 left cp",
      on: {
        mousedown: function mousedown(r) {
          return n.rotateFn(1);
        },
        mouseup: function mouseup(r) {
          return n.stopFn();
        }
      }
    }, [e("div", {
      staticClass: "iconfont icon-zuo1"
    })]), n._v(" "), e("div", {
      staticClass: "pa right5 top18 w28 lh28 h28 right cp",
      on: {
        mousedown: function mousedown(r) {
          return n.rotateFn(-1);
        },
        mouseup: function mouseup(r) {
          return n.stopFn();
        }
      }
    }, [e("div", {
      staticClass: "rolate mr5 iconfont icon-zuo1"
    })])])]), n._v(" "), e("div", {
      staticClass: "mt12 cf f16"
    }, [e("img", {
      staticClass: "dib w24 h24 mr10",
      attrs: {
        src: "2e381c548410a9c0.png",
        alt: ""
      }
    }), n._v(" "), e("div", {
      staticClass: "dib vas"
    }, [n._v("音量调节")]), n._v(" "), e("div", {
      staticClass: "jcsb pl20 mr10"
    }, [e("div", {
      staticClass: "dib rightBtn mr5",
      on: {
        mousedown: function mousedown(r) {
          return n.handleChangeVolume(-1);
        },
        mouseup: function mouseup(r) {
          return n.stophandleChangeVolume();
        }
      }
    }, [e("img", {
      attrs: {
        src: "d2e13a011ef96795.png",
        alt: ""
      }
    })]), n._v(" "), e("el-progress", {
      staticClass: "w120 lh1.3",
      attrs: {
        "text-inside": !0,
        percentage: n.volume,
        "stroke-width": 17
      }
    }), n._v(" "), e("div", {
      staticClass: "dib rightBtn ml5",
      on: {
        mousedown: function mousedown(r) {
          return n.handleChangeVolume(1);
        },
        mouseup: function mouseup(r) {
          return n.stophandleChangeVolume();
        }
      }
    }, [e("img", {
      attrs: {
        src: "f03b74b7da6907b2.png",
        alt: ""
      }
    })])], 1)])]);
  },
  p = [function () {
    var n = this,
      r = n.$createElement,
      e = n._self._c || r;
    return e("div", {}, [e("img", {
      attrs: {
        src: "9f550ebdad12ff72.png",
        alt: ""
      }
    }), n._v(" "), e("span", {
      staticClass: "dib vas cf"
    }, [n._v("角度调节")])]);
  }];
d._withStripped = !0;
var m = r({
  render: d,
  staticRenderFns: p
}, function (n) {
  n && n("data-v-44718151_0", {
    source: '.angleControlBox[data-v-44718151] {\n  width: 127px;\n  margin: 0 auto;\n  text-align: center;\n}\n.angleControlBox .left21[data-v-44718151] {\n  z-index: 10;\n}\n.angleControlBox .angleControlBg[data-v-44718151] {\n  background-image: url("./assets/bg2.png");\n  background-repeat: no-repeat;\n  background-size: 100%;\n}\n.angleControlBox .angleControlBg .angleControlLB[data-v-44718151] {\n  transform-origin: 50% 0px;\n  background-repeat: no-repeat;\n}\n.angleControlBox .rightBtn[data-v-44718151] {\n  box-sizing: border-box;\n  border-radius: 50%;\n  width: 16px;\n  height: 16px;\n  cursor: pointer;\n  padding-left: 1px;\n}\n.angleControlBox .rightBtn[data-v-44718151]:hover {\n  opacity: 0.7;\n}\n.angleControlBox .AngleControl[data-v-44718151] {\n  background-image: url("./assets/jdbj2.png");\n  background-repeat: no-repeat;\n  background-size: 100%;\n}\n.angleControlBox .AngleControl .left[data-v-44718151] {\n  border-radius: 50%;\n  color: #3d4654;\n  background: #9aabbd;\n}\n.angleControlBox .AngleControl .left[data-v-44718151]:hover {\n  color: #08c2d1;\n}\n.angleControlBox .AngleControl .right[data-v-44718151] {\n  border-radius: 50%;\n  color: #3d4654;\n  background: #9aabbd;\n}\n.angleControlBox .AngleControl .right[data-v-44718151]:hover {\n  color: #08c2d1;\n}\n.rolate[data-v-44718151] {\n  transform: rotateY(180deg);\n}\n.c08c[data-v-44718151] {\n  color: #08c2d1;\n}\n[data-v-44718151] .el-progress-bar__innerText {\n  color: #000;\n}\n.right5[data-v-44718151] {\n  right: -10px;\n}\n\n/*# sourceMappingURL=angleControl.vue.map */',
    map: {
      version: 3,
      sources: ["E:\\work\\standardization\\mmc-stl-module\\src\\components\\MMCFlightControlCenter\\components\\mount\\PagerP1_New\\components\\angleControl.vue", "angleControl.vue"],
      names: [],
      mappings: "AAgLA;EACA,YAAA;EACA,cAAA;EACA,kBAAA;AC/KA;ADgLA;EACA,WAAA;AC9KA;ADgLA;EACA,yCAAA;EACA,4BAAA;EACA,qBAAA;AC9KA;AD+KA;EACA,yBAAA;EAEA,4BAAA;AC9KA;ADiLA;EACA,sBAAA;EACA,kBAAA;EAEA,WAAA;EACA,YAAA;EAGA,eAAA;EAEA,iBAAA;ACnLA;ADqLA;EACA,YAAA;ACnLA;ADsLA;EACA,2CAAA;EACA,4BAAA;EACA,qBAAA;ACpLA;ADqLA;EACA,kBAAA;EACA,cAAA;EAEA,mBAAA;ACpLA;ADsLA;EACA,cAAA;ACpLA;ADsLA;EACA,kBAAA;EACA,cAAA;EACA,mBAAA;ACpLA;ADsLA;EACA,cAAA;ACpLA;ADwLA;EACA,0BAAA;ACrLA;ADuLA;EACA,cAAA;ACpLA;ADsLA;EACA,WAAA;ACnLA;ADqLA;EACA,YAAA;AClLA;;AAEA,2CAA2C",
      file: "angleControl.vue",
      sourcesContent: ['<template>\r\n  <div class="angleControlBox mt16">\r\n    <div class="angleControlBg w99 h99 dib">\r\n      <div class="dib wih100 ht100 pr">\r\n        <div class="angleControlLB tc w40 ml50 mt40 h30" />\r\n        <img class="pa top0 left21" src="./assets/lbt2.png" alt />\r\n        <div class="light pa left30 top20" :style="`transform: rotate(${90 - rotate}deg);`">\r\n          <img src="./assets/lb2.png" alt />\r\n        </div>\r\n        <div class="iconfont icon-zuo1 pa top40 left15 c08c" />\r\n        <div class="rolate iconfont icon-zuo1 pa top40 right15 c08c" />\r\n      </div>\r\n    </div>\r\n\r\n    <div class>\r\n      <img class src="./assets/jd.png" alt />\r\n      <span class="dib vas cf">角度调节</span>\r\n    </div>\r\n    <div class="h56 wih100 bg tc">\r\n      <div class="AngleControl dib w100 h56 tc pr">\r\n        <div\r\n          class="left5 top18 pa w28 lh28 h28 left cp"\r\n          @mousedown="rotateFn(1)"\r\n          @mouseup="stopFn()"\r\n        >\r\n          <div class="iconfont icon-zuo1" />\r\n        </div>\r\n        <div\r\n          class="pa right5 top18 w28 lh28 h28 right cp"\r\n          @mousedown="rotateFn(-1)"\r\n          @mouseup="stopFn()"\r\n        >\r\n          <div class="rolate mr5 iconfont icon-zuo1" />\r\n        </div>\r\n      </div>\r\n    </div>\r\n    <div class="mt12 cf f16">\r\n      <img class="dib w24 h24 mr10" src="./assets/Voice.png" alt />\r\n      <div class="dib vas">音量调节</div>\r\n      <div class="jcsb pl20 mr10">\r\n        <div\r\n          class="dib rightBtn mr5"\r\n          @mousedown="handleChangeVolume(-1)"\r\n          @mouseup="stophandleChangeVolume()"\r\n        >\r\n          <img class src="./assets/del.png" alt />\r\n        </div>\r\n        <el-progress\r\n          class="w120 lh1.3"\r\n          :text-inside="true"\r\n          :percentage="volume"\r\n          :stroke-width="17"\r\n        />\r\n        <div\r\n          class="dib rightBtn ml5"\r\n          @mousedown="handleChangeVolume(1)"\r\n          @mouseup="stophandleChangeVolume()"\r\n        >\r\n          <img class src="./assets/plus.png" alt />\r\n        </div>\r\n      </div>\r\n    </div>\r\n  </div>\r\n</template>\r\n\r\n<script>\r\nimport CmdSetSystemVolume from \'../utils/cmd_set_system_volume\'; // 设置系统音量\r\nimport CmdServoAngle from \'../utils/cmd_servo_angle\'; // 设置偏转角\r\nexport default {\r\n  props: {\r\n    rotate: {\r\n      type: Number,\r\n      default: 0\r\n    },\r\n    volume: {\r\n      type: Number,\r\n      default: 0\r\n    }\r\n  },\r\n  data() {\r\n    return {\r\n      // volume: 0,\r\n      // rotate: 0,\r\n      time: \'\',\r\n      handleChangeVolumeTime: \'\'\r\n    };\r\n  },\r\n  mounted() {\r\n    // setTimeout(() => {\r\n    //   this.volume = this.PagerP1.volume;\r\n    //   this.rotate = this.PagerP1.angle;\r\n    // }, 1000);\r\n  },\r\n  inject: [\'PagerP1\', \'PoliceKey\'],\r\n  methods: {\r\n    stopFn() {\r\n      clearInterval(this.time);\r\n    },\r\n    rotateFn(type) {\r\n      clearInterval(this.time);\r\n      if (type == 1) {\r\n        this.time = setInterval(() => {\r\n          if (this.rotate < 60) {\r\n            this.rotate++;\r\n            const message = {\r\n              data: this.rotate,\r\n              type: 2314\r\n            };\r\n            this.mqtt_publish(message);\r\n            // this.rotate++;\r\n          }\r\n        }, 100);\r\n      } else {\r\n        this.time = setInterval(() => {\r\n          if (this.rotate > 0) {\r\n            this.rotate--;\r\n            const message = {\r\n              data: this.rotate,\r\n              type: 2314\r\n            };\r\n            this.mqtt_publish(message);\r\n            // this.rotate--;\r\n          }\r\n        }, 100);\r\n      }\r\n    },\r\n    // 控制音量 start\r\n    handleChangeVolume(cate) {\r\n      this.stophandleChangeVolume();\r\n      this.handleChangeVolumeTime = setInterval(() => {\r\n        if ((this.volume == 0 && cate == -1) || (this.volume == 100 && cate == 1)) {\r\n          return;\r\n        }\r\n        this.volume += cate;\r\n        const message = {\r\n          data: this.volume,\r\n          type: 2315\r\n        };\r\n        this.mqtt_publish(message);\r\n      }, 100);\r\n    },\r\n    stophandleChangeVolume() {\r\n      clearInterval(this.handleChangeVolumeTime);\r\n    },\r\n    async mqtt_publish(message) {\r\n      if (this.PoliceKey()) {\r\n        const key = await this.PoliceKey();\r\n        this.PagerP1.mqtt.client.publish(\r\n          `SPEAK/OBTAIN/${key}-01`,\r\n          new TextEncoder().encode(JSON.stringify(message)),\r\n          {\r\n            qos: 0\r\n          },\r\n          (e) => {\r\n            // console.log("发送指令成功:", message);\r\n          }\r\n        );\r\n      }\r\n    },\r\n    mqtt_json2uint8array(data) {\r\n      if (!data) {\r\n        return data;\r\n      }\r\n      let { encoder } = this.PagerP1.mqtt;\r\n      if (!encoder) {\r\n        encoder = new TextEncoder();\r\n      }\r\n      const uint8array = encoder.encode(JSON.stringify(data));\r\n      return uint8array;\r\n    }\r\n    // 控制音量 end\r\n  }\r\n};\r\n<\/script>\r\n\r\n<style lang="scss" scoped>\r\n.angleControlBox {\r\n  width: 127px;\r\n  margin: 0 auto;\r\n  text-align: center;\r\n  .left21 {\r\n    z-index: 10;\r\n  }\r\n  .angleControlBg {\r\n    background-image: url(\'./assets/bg2.png\');\r\n    background-repeat: no-repeat;\r\n    background-size: 100%;\r\n    .angleControlLB {\r\n      transform-origin: 50% 0px;\r\n      // background-image: url("~./assets/LB2.png");\r\n      background-repeat: no-repeat;\r\n    }\r\n  }\r\n  .rightBtn {\r\n    box-sizing: border-box;\r\n    border-radius: 50%;\r\n    // border: 1px solid #08c2d1;\r\n    width: 16px;\r\n    height: 16px;\r\n    // line-height: 20px;\r\n    // text-align: center;\r\n    cursor: pointer;\r\n    // font-size: 20px;\r\n    padding-left: 1px;\r\n\r\n    &:hover {\r\n      opacity: 0.7;\r\n    }\r\n  }\r\n  .AngleControl {\r\n    background-image: url(\'./assets/jdbj2.png\');\r\n    background-repeat: no-repeat;\r\n    background-size: 100%;\r\n    .left {\r\n      border-radius: 50%;\r\n      color: #3d4654;\r\n\r\n      background: #9aabbd;\r\n    }\r\n    .left:hover {\r\n      color: #08c2d1;\r\n    }\r\n    .right {\r\n      border-radius: 50%;\r\n      color: #3d4654;\r\n      background: #9aabbd;\r\n    }\r\n    .right:hover {\r\n      color: #08c2d1;\r\n    }\r\n  }\r\n}\r\n.rolate {\r\n  transform: rotateY(180deg);\r\n}\r\n.c08c {\r\n  color: #08c2d1;\r\n}\r\n::v-deep .el-progress-bar__innerText {\r\n  color: #000;\r\n}\r\n.right5 {\r\n  right: -10px;\r\n}\r\n</style>\r\n', '.angleControlBox {\n  width: 127px;\n  margin: 0 auto;\n  text-align: center;\n}\n.angleControlBox .left21 {\n  z-index: 10;\n}\n.angleControlBox .angleControlBg {\n  background-image: url("./assets/bg2.png");\n  background-repeat: no-repeat;\n  background-size: 100%;\n}\n.angleControlBox .angleControlBg .angleControlLB {\n  transform-origin: 50% 0px;\n  background-repeat: no-repeat;\n}\n.angleControlBox .rightBtn {\n  box-sizing: border-box;\n  border-radius: 50%;\n  width: 16px;\n  height: 16px;\n  cursor: pointer;\n  padding-left: 1px;\n}\n.angleControlBox .rightBtn:hover {\n  opacity: 0.7;\n}\n.angleControlBox .AngleControl {\n  background-image: url("./assets/jdbj2.png");\n  background-repeat: no-repeat;\n  background-size: 100%;\n}\n.angleControlBox .AngleControl .left {\n  border-radius: 50%;\n  color: #3d4654;\n  background: #9aabbd;\n}\n.angleControlBox .AngleControl .left:hover {\n  color: #08c2d1;\n}\n.angleControlBox .AngleControl .right {\n  border-radius: 50%;\n  color: #3d4654;\n  background: #9aabbd;\n}\n.angleControlBox .AngleControl .right:hover {\n  color: #08c2d1;\n}\n\n.rolate {\n  transform: rotateY(180deg);\n}\n\n.c08c {\n  color: #08c2d1;\n}\n\n::v-deep .el-progress-bar__innerText {\n  color: #000;\n}\n\n.right5 {\n  right: -10px;\n}\n\n/*# sourceMappingURL=angleControl.vue.map */']
    },
    media: void 0
  });
}, c, "data-v-44718151", false, undefined, !1, e);
var A = /*#__PURE__*/function (_l2) {
  function A(n, r) {
    var _this4;
    _classCallCheck(this, A);
    (_this4 = _callSuper(this, A), _defineProperty(_assertThisInitialized(_this4), "format", "<B250A"), _defineProperty(_assertThisInitialized(_this4), "msg_id", 100098), _defineProperty(_assertThisInitialized(_this4), "order_map", [0, 1]), _defineProperty(_assertThisInitialized(_this4), "crc_extra", 14), _defineProperty(_assertThisInitialized(_this4), "name", "CMD_STREAM_UP_DATA")), _this4.len = n, _this4.data = r;
    return _this4;
  }
  _inherits(A, _l2);
  return _createClass(A, [{
    key: "pack",
    value: function pack() {
      return _get(_getPrototypeOf(A.prototype), "pack", this).call(this, this, this.crc_extra, n.Pack(this.format, [this.len, this.data]));
    }
  }]);
}(l);
var h = {
  data: function data() {
    return {
      text: "",
      write: !1,
      ttsState: 10,
      options: [{
        value: "1",
        label: "普通话女"
      }, {
        value: "0",
        label: "普通话男"
      }],
      value: "1",
      options2: [{
        value2: "50",
        label2: "正常"
      }, {
        value2: "100",
        label2: "最快"
      }, {
        value2: "75",
        label2: "较快"
      }, {
        value2: "25",
        label2: "较慢"
      }, {
        value2: "0",
        label2: "最慢"
      }],
      value2: "50",
      options3: [{
        ttsCycle: 10,
        label3: "单次"
      }, {
        ttsCycle: 11,
        label3: "循环"
      }],
      ttsCycle: 10,
      flag: !0
    };
  },
  watch: {
    ttsState: {
      handler: function handler(n) {
        10 == n ? (this.flag = !0, this.write = !1) : (this.flag = !1, this.write = !0);
      }
    }
  },
  mounted: function mounted() {},
  inject: ["PagerP1", "PoliceKey"],
  beforeDestroy: function beforeDestroy() {
    this.changeType(10), this.handleSendsupse();
  },
  methods: {
    changeType: function changeType(n) {
      var r = {
        data: n,
        type: 2307
      };
      this.mqtt_publish(r);
    },
    handleSendTTSText: function handleSendTTSText() {
      if ("" == this.text) return this.$message.info("文字不能为空！");
      if (this.flag = !1, 11 != this.ttsState) if (this.flag) this.handleSendsupse();else {
        var _n3 = null;
        var _r2 = {
          data: 11,
          type: 2306
        };
        this.mqtt_publish(_r2), _n3 = {
          data: {
            text: this.text,
            speed: this.value2,
            voice: this.value
          },
          type: 2305
        }, this.mqtt_publish(_n3), this.$emit("playAudio", 13);
      }
    },
    handleSendsupse: function handleSendsupse() {
      this.mqtt_publish({
        data: 10,
        type: 2306
      });
    },
    mqtt_publish: function mqtt_publish(n) {
      var _this5 = this;
      return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
        var r;
        return _regeneratorRuntime().wrap(function _callee2$(_context2) {
          while (1) switch (_context2.prev = _context2.next) {
            case 0:
              _context2.next = 2;
              return _this5.PoliceKey();
            case 2:
              r = _context2.sent;
              _this5.PagerP1.mqtt.client.publish("SPEAK/OBTAIN/".concat(r, "-01"), new TextEncoder().encode(JSON.stringify(n)), {
                qos: 0
              }, function (r) {
                console.log("发送指令成功:", n);
              }), _this5.PagerP1.mqtt.client.on("message", function (n, r, e) {
                var t = JSON.parse(e.payload.toString());
                _this5.ttsState = t.ttsState;
              });
            case 4:
            case "end":
              return _context2.stop();
          }
        }, _callee2);
      }))();
    }
  }
};
var u = function u() {
  var n = this,
    r = n.$createElement,
    e = n._self._c || r;
  return e("div", {
    staticClass: "itemAMaxBox"
  }, [e("el-input", {
    attrs: {
      type: "textarea",
      placeholder: "请输入想要发送的文字",
      disabled: n.write,
      maxlength: "70",
      "show-word-limit": ""
    },
    model: {
      value: n.text,
      callback: function callback(r) {
        n.text = r;
      },
      expression: "text"
    }
  }), n._v(" "), e("div", {
    staticClass: "jcsb selectBox ml14 pr24 mt20"
  }, [e("div", [e("span", [n._v(" 语音:")]), n._v(" "), e("el-select", {
    staticClass: "dib w100",
    attrs: {
      size: "mini",
      placeholder: "请选择",
      disabled: n.write
    },
    model: {
      value: n.value,
      callback: function callback(r) {
        n.value = r;
      },
      expression: "value"
    }
  }, n._l(n.options, function (n) {
    return e("el-option", {
      key: n.value,
      attrs: {
        label: n.label,
        value: n.value
      }
    });
  }), 1)], 1), n._v(" "), e("div", [e("span", [n._v(" 速度:")]), n._v(" "), e("el-select", {
    staticClass: "dib w100",
    attrs: {
      size: "mini",
      placeholder: "请选择",
      "popper-append-to-body": "",
      disabled: n.write
    },
    model: {
      value: n.value2,
      callback: function callback(r) {
        n.value2 = r;
      },
      expression: "value2"
    }
  }, n._l(n.options2, function (n) {
    return e("el-option", {
      key: n.value2,
      attrs: {
        label: n.label2,
        value: n.value2
      }
    });
  }), 1)], 1), n._v(" "), e("div", [e("span", [n._v(" 重复:")]), n._v(" "), e("el-select", {
    staticClass: "dib w100",
    attrs: {
      size: "mini",
      placeholder: "请选择"
    },
    on: {
      change: n.changeType
    },
    model: {
      value: n.ttsCycle,
      callback: function callback(r) {
        n.ttsCycle = r;
      },
      expression: "ttsCycle"
    }
  }, n._l(n.options3, function (n) {
    return e("el-option", {
      key: n.ttsCycle,
      attrs: {
        label: n.label3,
        value: n.ttsCycle
      }
    });
  }), 1)], 1)]), n._v(" "), e("div", {
    staticClass: "bottomBtnBox jcsb mt10 pl24 pr24"
  }, [n._m(0), n._v(" "), e("div", {
    staticClass: "cf f14"
  }, [e("div", {
    staticClass: "w30 h30 btnStyle tc",
    on: {
      click: n.handleSendTTSText
    }
  }, [n.flag ? e("div", {
    staticClass: "w5 cp h5 mt6 ml7 iconfont icon-a-bofang2px"
  }) : e("div", {
    staticClass: "w20 cp h20 mt6 ml5 iconfont icon-a-zanting2px"
  })]), n._v(" "), e("div", [n._v("播放")])]), n._v(" "), n._m(1)])], 1);
};
u._withStripped = !0;
var f = r({
  render: u,
  staticRenderFns: [function () {
    var n = this,
      r = n.$createElement,
      e = n._self._c || r;
    return e("div", {
      staticClass: "cf f14"
    }, [e("div", {
      staticClass: "w35 h35 lh35 tc"
    }, [e("div", {
      staticClass: "w15 h15 ml5 iconfont"
    })]), n._v(" "), e("div")]);
  }, function () {
    var n = this,
      r = n.$createElement,
      e = n._self._c || r;
    return e("div", {
      staticClass: "cf f14"
    }, [e("div", {
      staticClass: "w45 h45 tc"
    }, [e("div", {
      staticClass: "w5 h5 mt13 ml26 iconfontbf"
    })]), n._v(" "), e("div")]);
  }]
}, function (n) {
  n && (n("data-v-2e2d796c_0", {
    source: ".itemAMaxBox[data-v-2e2d796c] {\n  width: 327px;\n  height: 231px;\n  text-align: center;\n  border-radius: 2px 2px 0px 0px;\n  border: 1px solid #315ec7;\n}\n.itemAMaxBox .selectBox[data-v-2e2d796c] {\n  color: #b0b3be;\n}\n.itemAMaxBox .selectBox[data-v-2e2d796c]  el-select .el-input--mini {\n  background: #3768b3;\n}\n.itemAMaxBox .bottomBtnBox .btnStyle[data-v-2e2d796c] {\n  cursor: pointer;\n  border-radius: 50%;\n  background: #9bacbe;\n  color: #3e495b;\n  border: 10px solid #000;\n}\n.itemAMaxBox .bottomBtnBox .btnStyle .bf[data-v-2e2d796c] {\n  transform: rotate(90deg);\n}\n.itemAMaxBox .bottomBtnBox .btnStyle[data-v-2e2d796c]:hover {\n  color: #315ec7;\n}\n[data-v-2e2d796c] .el-textarea {\n  margin-top: 5px;\n  width: 315px;\n  height: 98px;\n  resize: none;\n  outline: none;\n  background: rgba(24, 39, 76, 0.7);\n  border: 1px solid #315ec7;\n  border-radius: 10px;\n  color: #d6d9df;\n  text-indent: 1em;\n}\n[data-v-2e2d796c] .el-textarea .el-textarea__inner {\n  width: 100% !important;\n  border: 1px solid #315ec7;\n  background: rgba(24, 39, 76, 0.7) !important;\n}\n[data-v-2e2d796c] .el-textarea textarea {\n  height: 98px;\n}\n[data-v-2e2d796c] .el-textarea .el-input__count {\n  background: transparent;\n  color: #fff;\n}\ntextarea[data-v-2e2d796c]::-webkit-input-placeholder {\n  /* WebKit browsers */\n  color: #d6d9df;\n}\ntextarea[data-v-2e2d796c]:-moz-placeholder {\n  /* Mozilla Firefox 4 to 18 */\n  color: #d6d9df;\n}\ntextarea[data-v-2e2d796c]::-moz-placeholder {\n  /* Mozilla Firefox 19+ */\n  color: #d6d9df;\n}\ntextarea[data-v-2e2d796c]::-ms-input-placeholder {\n  /* Internet Explorer 10+ */\n  color: #d6d9df;\n}\n\n/*# sourceMappingURL=itemA.vue.map */",
    map: {
      version: 3,
      sources: ["E:\\work\\standardization\\mmc-stl-module\\src\\components\\MMCFlightControlCenter\\components\\mount\\PagerP1_New\\components\\itemA.vue", "itemA.vue"],
      names: [],
      mappings: "AAqRA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;EACA,8BAAA;EACA,yBAAA;ACpRA;ADqRA;EACA,cAAA;ACnRA;ADqRA;EACA,mBAAA;ACnRA;ADwRA;EACA,eAAA;EACA,kBAAA;EAEA,mBAAA;EACA,cAAA;EACA,uBAAA;ACvRA;ADwRA;EACA,wBAAA;ACtRA;ADyRA;EACA,cAAA;ACvRA;AD2RA;EACA,eAAA;EACA,YAAA;EACA,YAAA;EACA,YAAA;EACA,aAAA;EACA,iCAAA;EACA,yBAAA;EACA,mBAAA;EACA,cAAA;EACA,gBAAA;ACxRA;ADyRA;EACA,sBAAA;EACA,yBAAA;EACA,4CAAA;ACvRA;ADyRA;EACA,YAAA;ACvRA;ADyRA;EACA,uBAAA;EACA,WAAA;ACvRA;AD4RA;EACA,oBAAA;EACA,cAAA;ACzRA;AD2RA;EACA,4BAAA;EACA,cAAA;ACxRA;AD0RA;EACA,wBAAA;EACA,cAAA;ACvRA;ADyRA;EACA,0BAAA;EACA,cAAA;ACtRA;;AAEA,oCAAoC",
      file: "itemA.vue",
      sourcesContent: ['<template>\r\n  <div class="itemAMaxBox">\r\n    <el-input\r\n      v-model="text"\r\n      type="textarea"\r\n      placeholder="请输入想要发送的文字"\r\n      :disabled="write"\r\n      maxlength="70"\r\n      show-word-limit\r\n    />\r\n    <div class="jcsb selectBox ml14 pr24 mt20">\r\n      <div>\r\n        <span> 语音:</span>\r\n        <el-select\r\n          v-model="value"\r\n          size="mini"\r\n          class="dib w100"\r\n          placeholder="请选择"\r\n          :disabled="write"\r\n        >\r\n          <el-option\r\n            v-for="item in options"\r\n            :key="item.value"\r\n            :label="item.label"\r\n            :value="item.value"\r\n          />\r\n        </el-select>\r\n      </div>\r\n      <div>\r\n        <span> 速度:</span>\r\n        <el-select\r\n          v-model="value2"\r\n          size="mini"\r\n          class="dib w100"\r\n          placeholder="请选择"\r\n          popper-append-to-body\r\n          :disabled="write"\r\n        >\r\n          <el-option\r\n            v-for="item in options2"\r\n            :key="item.value2"\r\n            :label="item.label2"\r\n            :value="item.value2"\r\n          />\r\n        </el-select>\r\n      </div>\r\n      <div>\r\n        <span> 重复:</span>\r\n        <el-select\r\n          v-model="ttsCycle"\r\n          size="mini"\r\n          class="dib w100"\r\n          placeholder="请选择"\r\n          @change="changeType"\r\n        >\r\n          <el-option\r\n            v-for="item in options3"\r\n            :key="item.ttsCycle"\r\n            :label="item.label3"\r\n            :value="item.ttsCycle"\r\n          />\r\n        </el-select>\r\n      </div>\r\n    </div>\r\n    <div class="bottomBtnBox jcsb mt10 pl24 pr24">\r\n      <div class="cf f14">\r\n        <div class="w35 h35 lh35 tc">\r\n          <div class="w15 h15 ml5 iconfont" />\r\n        </div>\r\n        <div />\r\n      </div>\r\n      <div class="cf f14">\r\n        <div class="w30 h30 btnStyle tc" @click="handleSendTTSText">\r\n          <div v-if="flag" class="w5 cp h5 mt6 ml7 iconfont icon-a-bofang2px" />\r\n          <div v-else class="w20 cp h20 mt6 ml5 iconfont icon-a-zanting2px" />\r\n        </div>\r\n        <div>播放</div>\r\n      </div>\r\n      <div class="cf f14">\r\n        <div class="w45 h45 tc">\r\n          <div class="w5 h5 mt13 ml26 iconfontbf" />\r\n        </div>\r\n        <div />\r\n      </div>\r\n      \x3c!-- <div class="cf f14">\r\n        <div class="w35 h35 btnStyle" @click="handleSendsupse">\r\n          <div class="w5 h5 mt10 ml9 iconfont icon-baocun1"></div>\r\n        </div>\r\n        <div>暂停</div>\r\n      </div> --\x3e\r\n    </div>\r\n  </div>\r\n</template>\r\n\r\n<script>\r\nimport CmdTtsText from \'../utils/cmd_tts_text\';\r\nimport CMD_TTS_STATE from \'../utils/cmd_record_state\';\r\nimport MavLink20Processor from \'../utils/mavlink20_processor\';\r\nimport CmdReadFileList from \'../utils/cmd_read_file_list\';\r\nimport CmdRecordName from \'../utils/cmd_record_name\';\r\nimport CmdSetSystemVolume from \'../utils/cmd_set_system_volume\';\r\nimport CmdStreamFunction from \'../utils/cmd_stream_function\';\r\nimport CmdStreamUpData from \'../utils/cmd_stream_up_data\';\r\nimport CmdSaveFile from \'../utils/cmd_save_file\';\r\nexport default {\r\n  data() {\r\n    return {\r\n      text: \'\',\r\n      write: false,\r\n      ttsState: 10,\r\n      options: [\r\n        {\r\n          value: \'1\',\r\n          label: \'普通话女\'\r\n        },\r\n        {\r\n          value: \'0\',\r\n          label: \'普通话男\'\r\n        }\r\n        // {\r\n        //   value: "xiaomei",\r\n        //   label: "广东话",\r\n        // },\r\n        // {\r\n        //   value: "xiaoqiang",\r\n        //   label: "湖南话",\r\n        // },\r\n        // {\r\n        //   value: "xiaorong",\r\n        //   label: "四川话",\r\n        // },\r\n        // {\r\n        //   value: "xiaoqian",\r\n        //   label: "东北话",\r\n        // },\r\n        // {\r\n        //   value: "xiaokun",\r\n        //   label: "河南话",\r\n        // },\r\n        // {\r\n        //   value: "xiaoying",\r\n        //   label: "陕西话",\r\n        // },\r\n      ],\r\n      value: \'1\',\r\n\r\n      options2: [\r\n        {\r\n          value2: \'50\',\r\n          label2: \'正常\'\r\n        },\r\n        {\r\n          value2: \'100\',\r\n          label2: \'最快\'\r\n        },\r\n        {\r\n          value2: \'75\',\r\n          label2: \'较快\'\r\n        },\r\n        {\r\n          value2: \'25\',\r\n          label2: \'较慢\'\r\n        },\r\n        {\r\n          value2: \'0\',\r\n          label2: \'最慢\'\r\n        }\r\n      ],\r\n      value2: \'50\',\r\n\r\n      options3: [\r\n        {\r\n          ttsCycle: 10,\r\n          label3: \'单次\'\r\n        },\r\n        {\r\n          ttsCycle: 11,\r\n          label3: \'循环\'\r\n        }\r\n        // {\r\n        //   ttsCycle: -1,\r\n        //   label3: "未初始化",\r\n        // },\r\n      ],\r\n      ttsCycle: 10,\r\n      flag: true\r\n    };\r\n  },\r\n  watch: {\r\n    ttsState: {\r\n      handler(val) {\r\n        if (val == 10) {\r\n          this.flag = true;\r\n          this.write = false;\r\n        } else {\r\n          this.flag = false;\r\n          this.write = true;\r\n        }\r\n      }\r\n    }\r\n  },\r\n  mounted() {\r\n    //   setInterval(() => {\r\n    //   this.ttsCycle = this.PagerP1.ttsCycle\r\n    // }, 100);\r\n  },\r\n  inject: [\'PagerP1\', \'PoliceKey\'],\r\n  beforeDestroy() {\r\n    this.changeType(10);\r\n    this.handleSendsupse();\r\n  },\r\n  methods: {\r\n    changeType(e) {\r\n      const data = {\r\n        data: e,\r\n        type: 2307\r\n      };\r\n      this.mqtt_publish(data);\r\n    },\r\n    handleSendTTSText() {\r\n      if (this.text == \'\') return this.$message.info(\'文字不能为空！\');\r\n      this.flag = false;\r\n      if (this.ttsState == 11) return;\r\n      if (!this.flag) {\r\n        // this.write = true;\r\n        let message = null;\r\n        const start = {\r\n          data: 11,\r\n          type: 2306\r\n        };\r\n        this.mqtt_publish(start);\r\n        message = {\r\n          data: {\r\n            text: this.text,\r\n            speed: this.value2,\r\n            voice: this.value\r\n          },\r\n          type: 2305\r\n        };\r\n        this.mqtt_publish(message);\r\n        this.$emit(\'playAudio\', 13);\r\n      } else {\r\n        this.handleSendsupse();\r\n      }\r\n    },\r\n    handleSendsupse() {\r\n      // this.flag = true\r\n      // this.write = false;\r\n      const message = {\r\n        data: 10,\r\n        type: 2306\r\n      };\r\n      this.mqtt_publish(message);\r\n    },\r\n    async mqtt_publish(message) {\r\n      const key = await this.PoliceKey();\r\n      // console.log(`SPEAK/OBTAIN/${key}-01`, "发送主题");\r\n      this.PagerP1.mqtt.client.publish(\r\n        `SPEAK/OBTAIN/${key}-01`,\r\n        new TextEncoder().encode(JSON.stringify(message)),\r\n        {\r\n          qos: 0\r\n        },\r\n        (e) => {\r\n          console.log(\'发送指令成功:\', message);\r\n        }\r\n      );\r\n      this.PagerP1.mqtt.client.on(\'message\', (topic, payload, packet) => {\r\n        const data = JSON.parse(packet.payload.toString());\r\n        this.ttsState = data.ttsState;\r\n      });\r\n    }\r\n  }\r\n};\r\n<\/script>\r\n\r\n<style lang="scss" scoped>\r\n.itemAMaxBox {\r\n  width: 327px;\r\n  height: 231px;\r\n  text-align: center;\r\n  border-radius: 2px 2px 0px 0px;\r\n  border: 1px solid #315ec7;\r\n  .selectBox {\r\n    color: #b0b3be;\r\n    ::v-deep el-select {\r\n      .el-input--mini {\r\n        background: #3768b3;\r\n      }\r\n    }\r\n  }\r\n  .bottomBtnBox {\r\n    .btnStyle {\r\n      cursor: pointer;\r\n      border-radius: 50%;\r\n\r\n      background: #9bacbe;\r\n      color: #3e495b;\r\n      border: 10px solid #000;\r\n      .bf {\r\n        transform: rotate(90deg);\r\n      }\r\n    }\r\n    .btnStyle:hover {\r\n      color: #315ec7;\r\n    }\r\n  }\r\n}\r\n::v-deep .el-textarea {\r\n  margin-top: 5px;\r\n  width: 315px;\r\n  height: 98px;\r\n  resize: none;\r\n  outline: none;\r\n  background: rgba(24, 39, 76, 0.7);\r\n  border: 1px solid #315ec7;\r\n  border-radius: 10px;\r\n  color: #d6d9df;\r\n  text-indent: 1em;\r\n  .el-textarea__inner {\r\n    width: 100% !important;\r\n    border: 1px solid #315ec7;\r\n    background: rgba(24, 39, 76, 0.7) !important;\r\n  }\r\n  textarea {\r\n    height: 98px;\r\n  }\r\n  .el-input__count {\r\n    background: transparent;\r\n    color: #fff;\r\n  }\r\n  // padding-top: 10px;\r\n}\r\n\r\ntextarea::-webkit-input-placeholder {\r\n  /* WebKit browsers */\r\n  color: #d6d9df;\r\n}\r\ntextarea:-moz-placeholder {\r\n  /* Mozilla Firefox 4 to 18 */\r\n  color: #d6d9df;\r\n}\r\ntextarea::-moz-placeholder {\r\n  /* Mozilla Firefox 19+ */\r\n  color: #d6d9df;\r\n}\r\ntextarea::-ms-input-placeholder {\r\n  /* Internet Explorer 10+ */\r\n  color: #d6d9df;\r\n}\r\n</style>\r\n<style lang="scss">\r\n.itemAMaxBox {\r\n  .selectBox {\r\n    color: #b0b3be;\r\n    .el-select {\r\n      .el-input__inner {\r\n        border: 1px solid #3768b3;\r\n        background: #132550;\r\n        border-radius: 4px 4px 0 0;\r\n        color: #fff;\r\n      }\r\n    }\r\n  }\r\n}\r\n</style>\r\n', ".itemAMaxBox {\n  width: 327px;\n  height: 231px;\n  text-align: center;\n  border-radius: 2px 2px 0px 0px;\n  border: 1px solid #315ec7;\n}\n.itemAMaxBox .selectBox {\n  color: #b0b3be;\n}\n.itemAMaxBox .selectBox ::v-deep el-select .el-input--mini {\n  background: #3768b3;\n}\n.itemAMaxBox .bottomBtnBox .btnStyle {\n  cursor: pointer;\n  border-radius: 50%;\n  background: #9bacbe;\n  color: #3e495b;\n  border: 10px solid #000;\n}\n.itemAMaxBox .bottomBtnBox .btnStyle .bf {\n  transform: rotate(90deg);\n}\n.itemAMaxBox .bottomBtnBox .btnStyle:hover {\n  color: #315ec7;\n}\n\n::v-deep .el-textarea {\n  margin-top: 5px;\n  width: 315px;\n  height: 98px;\n  resize: none;\n  outline: none;\n  background: rgba(24, 39, 76, 0.7);\n  border: 1px solid #315ec7;\n  border-radius: 10px;\n  color: #d6d9df;\n  text-indent: 1em;\n}\n::v-deep .el-textarea .el-textarea__inner {\n  width: 100% !important;\n  border: 1px solid #315ec7;\n  background: rgba(24, 39, 76, 0.7) !important;\n}\n::v-deep .el-textarea textarea {\n  height: 98px;\n}\n::v-deep .el-textarea .el-input__count {\n  background: transparent;\n  color: #fff;\n}\n\ntextarea::-webkit-input-placeholder {\n  /* WebKit browsers */\n  color: #d6d9df;\n}\n\ntextarea:-moz-placeholder {\n  /* Mozilla Firefox 4 to 18 */\n  color: #d6d9df;\n}\n\ntextarea::-moz-placeholder {\n  /* Mozilla Firefox 19+ */\n  color: #d6d9df;\n}\n\ntextarea::-ms-input-placeholder {\n  /* Internet Explorer 10+ */\n  color: #d6d9df;\n}\n\n/*# sourceMappingURL=itemA.vue.map */"]
    },
    media: void 0
  }), n("data-v-2e2d796c_1", {
    source: ".itemAMaxBox .selectBox {\n  color: #b0b3be;\n}\n.itemAMaxBox .selectBox .el-select .el-input__inner {\n  border: 1px solid #3768b3;\n  background: #132550;\n  border-radius: 4px 4px 0 0;\n  color: #fff;\n}\n\n/*# sourceMappingURL=itemA.vue.map */",
    map: {
      version: 3,
      sources: ["E:\\work\\standardization\\mmc-stl-module\\src\\components\\MMCFlightControlCenter\\components\\mount\\PagerP1_New\\components\\itemA.vue", "itemA.vue"],
      names: [],
      mappings: "AAiWA;EACA,cAAA;AChWA;ADkWA;EACA,yBAAA;EACA,mBAAA;EACA,0BAAA;EACA,WAAA;AChWA;;AAEA,oCAAoC",
      file: "itemA.vue",
      sourcesContent: ['<template>\r\n  <div class="itemAMaxBox">\r\n    <el-input\r\n      v-model="text"\r\n      type="textarea"\r\n      placeholder="请输入想要发送的文字"\r\n      :disabled="write"\r\n      maxlength="70"\r\n      show-word-limit\r\n    />\r\n    <div class="jcsb selectBox ml14 pr24 mt20">\r\n      <div>\r\n        <span> 语音:</span>\r\n        <el-select\r\n          v-model="value"\r\n          size="mini"\r\n          class="dib w100"\r\n          placeholder="请选择"\r\n          :disabled="write"\r\n        >\r\n          <el-option\r\n            v-for="item in options"\r\n            :key="item.value"\r\n            :label="item.label"\r\n            :value="item.value"\r\n          />\r\n        </el-select>\r\n      </div>\r\n      <div>\r\n        <span> 速度:</span>\r\n        <el-select\r\n          v-model="value2"\r\n          size="mini"\r\n          class="dib w100"\r\n          placeholder="请选择"\r\n          popper-append-to-body\r\n          :disabled="write"\r\n        >\r\n          <el-option\r\n            v-for="item in options2"\r\n            :key="item.value2"\r\n            :label="item.label2"\r\n            :value="item.value2"\r\n          />\r\n        </el-select>\r\n      </div>\r\n      <div>\r\n        <span> 重复:</span>\r\n        <el-select\r\n          v-model="ttsCycle"\r\n          size="mini"\r\n          class="dib w100"\r\n          placeholder="请选择"\r\n          @change="changeType"\r\n        >\r\n          <el-option\r\n            v-for="item in options3"\r\n            :key="item.ttsCycle"\r\n            :label="item.label3"\r\n            :value="item.ttsCycle"\r\n          />\r\n        </el-select>\r\n      </div>\r\n    </div>\r\n    <div class="bottomBtnBox jcsb mt10 pl24 pr24">\r\n      <div class="cf f14">\r\n        <div class="w35 h35 lh35 tc">\r\n          <div class="w15 h15 ml5 iconfont" />\r\n        </div>\r\n        <div />\r\n      </div>\r\n      <div class="cf f14">\r\n        <div class="w30 h30 btnStyle tc" @click="handleSendTTSText">\r\n          <div v-if="flag" class="w5 cp h5 mt6 ml7 iconfont icon-a-bofang2px" />\r\n          <div v-else class="w20 cp h20 mt6 ml5 iconfont icon-a-zanting2px" />\r\n        </div>\r\n        <div>播放</div>\r\n      </div>\r\n      <div class="cf f14">\r\n        <div class="w45 h45 tc">\r\n          <div class="w5 h5 mt13 ml26 iconfontbf" />\r\n        </div>\r\n        <div />\r\n      </div>\r\n      \x3c!-- <div class="cf f14">\r\n        <div class="w35 h35 btnStyle" @click="handleSendsupse">\r\n          <div class="w5 h5 mt10 ml9 iconfont icon-baocun1"></div>\r\n        </div>\r\n        <div>暂停</div>\r\n      </div> --\x3e\r\n    </div>\r\n  </div>\r\n</template>\r\n\r\n<script>\r\nimport CmdTtsText from \'../utils/cmd_tts_text\';\r\nimport CMD_TTS_STATE from \'../utils/cmd_record_state\';\r\nimport MavLink20Processor from \'../utils/mavlink20_processor\';\r\nimport CmdReadFileList from \'../utils/cmd_read_file_list\';\r\nimport CmdRecordName from \'../utils/cmd_record_name\';\r\nimport CmdSetSystemVolume from \'../utils/cmd_set_system_volume\';\r\nimport CmdStreamFunction from \'../utils/cmd_stream_function\';\r\nimport CmdStreamUpData from \'../utils/cmd_stream_up_data\';\r\nimport CmdSaveFile from \'../utils/cmd_save_file\';\r\nexport default {\r\n  data() {\r\n    return {\r\n      text: \'\',\r\n      write: false,\r\n      ttsState: 10,\r\n      options: [\r\n        {\r\n          value: \'1\',\r\n          label: \'普通话女\'\r\n        },\r\n        {\r\n          value: \'0\',\r\n          label: \'普通话男\'\r\n        }\r\n        // {\r\n        //   value: "xiaomei",\r\n        //   label: "广东话",\r\n        // },\r\n        // {\r\n        //   value: "xiaoqiang",\r\n        //   label: "湖南话",\r\n        // },\r\n        // {\r\n        //   value: "xiaorong",\r\n        //   label: "四川话",\r\n        // },\r\n        // {\r\n        //   value: "xiaoqian",\r\n        //   label: "东北话",\r\n        // },\r\n        // {\r\n        //   value: "xiaokun",\r\n        //   label: "河南话",\r\n        // },\r\n        // {\r\n        //   value: "xiaoying",\r\n        //   label: "陕西话",\r\n        // },\r\n      ],\r\n      value: \'1\',\r\n\r\n      options2: [\r\n        {\r\n          value2: \'50\',\r\n          label2: \'正常\'\r\n        },\r\n        {\r\n          value2: \'100\',\r\n          label2: \'最快\'\r\n        },\r\n        {\r\n          value2: \'75\',\r\n          label2: \'较快\'\r\n        },\r\n        {\r\n          value2: \'25\',\r\n          label2: \'较慢\'\r\n        },\r\n        {\r\n          value2: \'0\',\r\n          label2: \'最慢\'\r\n        }\r\n      ],\r\n      value2: \'50\',\r\n\r\n      options3: [\r\n        {\r\n          ttsCycle: 10,\r\n          label3: \'单次\'\r\n        },\r\n        {\r\n          ttsCycle: 11,\r\n          label3: \'循环\'\r\n        }\r\n        // {\r\n        //   ttsCycle: -1,\r\n        //   label3: "未初始化",\r\n        // },\r\n      ],\r\n      ttsCycle: 10,\r\n      flag: true\r\n    };\r\n  },\r\n  watch: {\r\n    ttsState: {\r\n      handler(val) {\r\n        if (val == 10) {\r\n          this.flag = true;\r\n          this.write = false;\r\n        } else {\r\n          this.flag = false;\r\n          this.write = true;\r\n        }\r\n      }\r\n    }\r\n  },\r\n  mounted() {\r\n    //   setInterval(() => {\r\n    //   this.ttsCycle = this.PagerP1.ttsCycle\r\n    // }, 100);\r\n  },\r\n  inject: [\'PagerP1\', \'PoliceKey\'],\r\n  beforeDestroy() {\r\n    this.changeType(10);\r\n    this.handleSendsupse();\r\n  },\r\n  methods: {\r\n    changeType(e) {\r\n      const data = {\r\n        data: e,\r\n        type: 2307\r\n      };\r\n      this.mqtt_publish(data);\r\n    },\r\n    handleSendTTSText() {\r\n      if (this.text == \'\') return this.$message.info(\'文字不能为空！\');\r\n      this.flag = false;\r\n      if (this.ttsState == 11) return;\r\n      if (!this.flag) {\r\n        // this.write = true;\r\n        let message = null;\r\n        const start = {\r\n          data: 11,\r\n          type: 2306\r\n        };\r\n        this.mqtt_publish(start);\r\n        message = {\r\n          data: {\r\n            text: this.text,\r\n            speed: this.value2,\r\n            voice: this.value\r\n          },\r\n          type: 2305\r\n        };\r\n        this.mqtt_publish(message);\r\n        this.$emit(\'playAudio\', 13);\r\n      } else {\r\n        this.handleSendsupse();\r\n      }\r\n    },\r\n    handleSendsupse() {\r\n      // this.flag = true\r\n      // this.write = false;\r\n      const message = {\r\n        data: 10,\r\n        type: 2306\r\n      };\r\n      this.mqtt_publish(message);\r\n    },\r\n    async mqtt_publish(message) {\r\n      const key = await this.PoliceKey();\r\n      // console.log(`SPEAK/OBTAIN/${key}-01`, "发送主题");\r\n      this.PagerP1.mqtt.client.publish(\r\n        `SPEAK/OBTAIN/${key}-01`,\r\n        new TextEncoder().encode(JSON.stringify(message)),\r\n        {\r\n          qos: 0\r\n        },\r\n        (e) => {\r\n          console.log(\'发送指令成功:\', message);\r\n        }\r\n      );\r\n      this.PagerP1.mqtt.client.on(\'message\', (topic, payload, packet) => {\r\n        const data = JSON.parse(packet.payload.toString());\r\n        this.ttsState = data.ttsState;\r\n      });\r\n    }\r\n  }\r\n};\r\n<\/script>\r\n\r\n<style lang="scss" scoped>\r\n.itemAMaxBox {\r\n  width: 327px;\r\n  height: 231px;\r\n  text-align: center;\r\n  border-radius: 2px 2px 0px 0px;\r\n  border: 1px solid #315ec7;\r\n  .selectBox {\r\n    color: #b0b3be;\r\n    ::v-deep el-select {\r\n      .el-input--mini {\r\n        background: #3768b3;\r\n      }\r\n    }\r\n  }\r\n  .bottomBtnBox {\r\n    .btnStyle {\r\n      cursor: pointer;\r\n      border-radius: 50%;\r\n\r\n      background: #9bacbe;\r\n      color: #3e495b;\r\n      border: 10px solid #000;\r\n      .bf {\r\n        transform: rotate(90deg);\r\n      }\r\n    }\r\n    .btnStyle:hover {\r\n      color: #315ec7;\r\n    }\r\n  }\r\n}\r\n::v-deep .el-textarea {\r\n  margin-top: 5px;\r\n  width: 315px;\r\n  height: 98px;\r\n  resize: none;\r\n  outline: none;\r\n  background: rgba(24, 39, 76, 0.7);\r\n  border: 1px solid #315ec7;\r\n  border-radius: 10px;\r\n  color: #d6d9df;\r\n  text-indent: 1em;\r\n  .el-textarea__inner {\r\n    width: 100% !important;\r\n    border: 1px solid #315ec7;\r\n    background: rgba(24, 39, 76, 0.7) !important;\r\n  }\r\n  textarea {\r\n    height: 98px;\r\n  }\r\n  .el-input__count {\r\n    background: transparent;\r\n    color: #fff;\r\n  }\r\n  // padding-top: 10px;\r\n}\r\n\r\ntextarea::-webkit-input-placeholder {\r\n  /* WebKit browsers */\r\n  color: #d6d9df;\r\n}\r\ntextarea:-moz-placeholder {\r\n  /* Mozilla Firefox 4 to 18 */\r\n  color: #d6d9df;\r\n}\r\ntextarea::-moz-placeholder {\r\n  /* Mozilla Firefox 19+ */\r\n  color: #d6d9df;\r\n}\r\ntextarea::-ms-input-placeholder {\r\n  /* Internet Explorer 10+ */\r\n  color: #d6d9df;\r\n}\r\n</style>\r\n<style lang="scss">\r\n.itemAMaxBox {\r\n  .selectBox {\r\n    color: #b0b3be;\r\n    .el-select {\r\n      .el-input__inner {\r\n        border: 1px solid #3768b3;\r\n        background: #132550;\r\n        border-radius: 4px 4px 0 0;\r\n        color: #fff;\r\n      }\r\n    }\r\n  }\r\n}\r\n</style>\r\n', ".itemAMaxBox .selectBox {\n  color: #b0b3be;\n}\n.itemAMaxBox .selectBox .el-select .el-input__inner {\n  border: 1px solid #3768b3;\n  background: #132550;\n  border-radius: 4px 4px 0 0;\n  color: #fff;\n}\n\n/*# sourceMappingURL=itemA.vue.map */"]
    },
    media: void 0
  }));
}, h, "data-v-2e2d796c", false, undefined, !1, e);
var g = {
  data: function data() {
    return {
      flag: !0,
      isPlay: !1,
      hours: "00",
      time: "00:00:00",
      setIntervalTime: "",
      s: 0,
      h: 0,
      f: 0,
      action: null,
      result: null,
      type: null
    };
  },
  inject: ["PagerP1", "PoliceKey"],
  watch: {
    action: {
      handler: function handler(n) {
        12 == n && 0 == this.type && 0 == this.result && this.say();
      }
    }
  },
  mounted: function mounted() {},
  beforeDestroy: function beforeDestroy() {
    this.handleStartShoutDown();
  },
  methods: {
    reset: function reset() {
      clearInterval(this.setIntervalTime), this.time = "00:00:00", this.s = 0, this.h = 0, this.f = 0, this.isPlay = !1;
    },
    change: function change() {
      this.flag = !this.flag, this.reset(), this.flag ? this.handleStartShoutDown() : (this.handleStartShout(), this.init());
    },
    play: function play() {
      this.isPlay = !this.isPlay, this.isPlay ? (this.init(), this.handleStartShout(), this.$emit("playAudio", 14)) : (this.handleStartShoutDown(), this.reset());
    },
    init: function init() {
      var _this6 = this;
      this.setIntervalTime = setInterval(function () {
        _this6.s += 1, 60 === _this6.s && (_this6.s = 0, _this6.f += 1, 60 === _this6.f && (_this6.h += 1)), _this6.s < 10 && _this6.f < 10 ? _this6.time = "0" + _this6.h + ":0" + _this6.f + ":0" + _this6.s : _this6.s < 10 && _this6.f >= 10 ? _this6.time = "0" + _this6.h + ":" + _this6.f + ":0" + _this6.s : _this6.s >= 10 && _this6.f < 10 ? _this6.time = "0" + _this6.h + ":0" + _this6.f + ":" + _this6.s : _this6.s >= 10 && _this6.f >= 10 && (_this6.time = "0" + _this6.h + ":" + _this6.f + ":" + _this6.s);
      }, 1e3);
    },
    handleStartShout: function handleStartShout() {
      this.mqtt_publish({
        data: 12,
        type: 2317
      });
    },
    say: function say() {
      var n = this;
      var r,
        e,
        i,
        a,
        s = 0,
        o = function o(a, _o2) {
          var l = Date.now();
          if (t.prototype, 0 == s && (s = l, e = 0, i = null), _o2 || !(l - s < 1)) {
            s = l;
            for (var c = t.SampleData(a.buffers, a.srcSampleRate, 16e3, i, {
                frameType: _o2 ? "" : r
              }), d = i ? i.index : 0; d < c.index; d++) a.buffers[d] = null;
            if (i = c, _o2 || !(e >= 2)) {
              e++;
              var p = Date.now(),
                m = t({
                  type: r,
                  sampleRate: 16e3,
                  bitRate: 16
                });
              m.mock(c.data, c.sampleRate), m.stop(function (r, t) {
                e && e--, r.encTime = Date.now() - p, function (r) {
                  var e = new Uint8Array(r);
                  var t = _toConsumableArray(e),
                    i = [];
                  for (; t.length > 0;) {
                    var _n4 = t.splice(0, 250),
                      _r3 = _toConsumableArray(Uint8Array.from(_n4)),
                      _e = new A(_r3.length, _r3).pack();
                    i.push.apply(i, _toConsumableArray(_e));
                  }
                  Uint8Array.from(i);
                  var a = {
                    data: Array.from(e),
                    type: 2318
                  };
                  n.mqtt_publish(a);
                }(c.data.buffer);
              }, function (n) {
                e && e--;
              });
            }
          }
        };
      this.recStop = function () {
        a.close(), o(a, !0);
      }, function (n) {
        a && a.close(), a = t({
          type: "unknown",
          onProcess: function onProcess(n, r, e, t) {
            o(a, !1);
          }
        });
        var e = setTimeout(function () {}, 8e3);
        a.open(function () {
          clearTimeout(e), a.start(), function (n) {
            r = n, s = 0;
          }(n);
        }, function (n, r) {
          clearTimeout(e);
        });
      }("pcm");
    },
    handleStartShoutDown: function handleStartShoutDown() {
      this.recStop && this.recStop();
      this.mqtt_publish({
        data: 13,
        type: 2317
      });
    },
    mqtt_publish: function mqtt_publish(n) {
      var _this7 = this;
      return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
        var _r4;
        return _regeneratorRuntime().wrap(function _callee3$(_context3) {
          while (1) switch (_context3.prev = _context3.next) {
            case 0:
              if (!_this7.PoliceKey()) {
                _context3.next = 5;
                break;
              }
              _context3.next = 3;
              return _this7.PoliceKey();
            case 3:
              _r4 = _context3.sent;
              _this7.PagerP1.mqtt.client.publish("SPEAK/OBTAIN/".concat(_r4, "-01"), new TextEncoder().encode(JSON.stringify(n)), {
                qos: 0
              }, function (r) {
                console.log("发送指令成功:", n);
              }), _this7.PagerP1.mqtt.client.on("message", function (n, r, e) {
                var t = JSON.parse(e.payload.toString());
                _this7.action = t.action, _this7.result = t.result, _this7.type = t.type;
              });
            case 5:
            case "end":
              return _context3.stop();
          }
        }, _callee3);
      }))();
    }
  }
};
var v = function v() {
    var n = this,
      r = n.$createElement,
      e = n._self._c || r;
    return e("div", [e("div", {
      staticClass: "itemBMaxBox tc"
    }, [e("div", {
      staticClass: "wih100 tc"
    }, [(n.flag, e("div", [e("div", {
      staticClass: "mt24 cf f16 fw700"
    }, [n._v("实时广播")]), n._v(" "), e("div", {
      staticClass: "cf mt5 f12"
    }, [n._v(n._s(n.time))])]))]), n._v(" "), n._m(0), n._v(" "), n.flag ? e("div", {
      staticClass: "bottomBtnBox jcsb mt30 pl24 pr24"
    }, [n._m(1), n._v(" "), e("div", {
      staticClass: "cf f14"
    }, [e("div", {
      staticClass: "w30 h30 lh30 btnStyle tc cp",
      on: {
        click: n.play
      }
    }, [e("div", {
      staticClass: "w5 h5 ml8 iconfont",
      "class": n.isPlay ? "icon-wanchengluyin" : "icon-kaishiluyin"
    })]), n._v(" "), e("div", [n._v(n._s(n.isPlay ? "结束喊话" : "开始喊话"))])]), n._v(" "), e("div", {
      staticClass: "cf f14",
      "class": {
        vish: !n.isPlay
      }
    }, [n._m(2), n._v(" "), e("div")])]) : n._e()])]);
  },
  b = [function () {
    var n = this.$createElement,
      r = this._self._c || n;
    return r("div", {
      staticClass: "wih100"
    }, [r("div", {
      staticClass: "AudioBG tc mt24 dib"
    }, [r("img", {
      attrs: {
        src: "011c3638793e6f77.png",
        alt: ""
      }
    })])]);
  }, function () {
    var n = this,
      r = n.$createElement,
      e = n._self._c || r;
    return e("div", {
      staticClass: "cf f14"
    }, [e("div", {
      staticClass: "w35 h35 lh35 tc"
    }, [e("div", {
      staticClass: "w15 h15 ml8 iconfont"
    })]), n._v(" "), e("div")]);
  }, function () {
    var n = this.$createElement,
      r = this._self._c || n;
    return r("div", {
      staticClass: "w35 h35"
    }, [r("div", {
      staticClass: "w5 h5 mt10 ml9 iconfont"
    })]);
  }];
v._withStripped = !0;
var x = r({
  render: v,
  staticRenderFns: b
}, function (n) {
  n && n("data-v-47037db6_0", {
    source: ".itemBMaxBox[data-v-47037db6] {\n  width: 327px;\n  height: 231px;\n  border-radius: 2px 2px 0px 0px;\n  border: 1px solid #315ec7;\n}\n.AudioBG[data-v-47037db6] {\n  padding: 5px 5px;\n  border: 1px solid #3263a5;\n}\n.bottomBtnBox .btnStyle[data-v-47037db6] {\n  cursor: pointer;\n  border-radius: 50%;\n  background: #9bacbe;\n  color: #3e495b;\n  border: 10px solid #000;\n}\n.bottomBtnBox .btnStyle .bf[data-v-47037db6] {\n  transform: rotate(90deg);\n}\n.bottomBtnBox .btnStyle[data-v-47037db6]:hover {\n  color: #43deff;\n}\n.vish[data-v-47037db6] {\n  visibility: hidden;\n}\n.jcenter[data-v-47037db6] {\n  display: flex;\n  justify-content: center;\n}\n\n/*# sourceMappingURL=itemB.vue.map */",
    map: {
      version: 3,
      sources: ["E:\\work\\standardization\\mmc-stl-module\\src\\components\\MMCFlightControlCenter\\components\\mount\\PagerP1_New\\components\\itemB.vue", "itemB.vue"],
      names: [],
      mappings: "AAqWA;EACA,YAAA;EACA,aAAA;EACA,8BAAA;EACA,yBAAA;ACpWA;ADsWA;EAGA,gBAAA;EACA,yBAAA;ACrWA;ADwWA;EACA,eAAA;EACA,kBAAA;EACA,mBAAA;EACA,cAAA;EACA,uBAAA;ACrWA;ADsWA;EACA,wBAAA;ACpWA;ADuWA;EACA,cAAA;ACrWA;ADwWA;EACA,kBAAA;ACrWA;ADuWA;EACA,aAAA;EACA,uBAAA;ACpWA;;AAEA,oCAAoC",
      file: "itemB.vue",
      sourcesContent: ['<template>\r\n  <div>\r\n    <div class="itemBMaxBox tc">\r\n      <div class="wih100 tc">\r\n        <div v-if="flag">\r\n          <div class="mt24 cf f16 fw700">实时广播</div>\r\n          <div class="cf mt5 f12">{{ time }}</div>\r\n        </div>\r\n        <div v-else>\r\n          <div class="mt24 cf f16 fw700">实时广播</div>\r\n          <div class="cf mt5 f12">{{ time }}</div>\r\n        </div>\r\n      </div>\r\n      <div class="wih100">\r\n        <div class="AudioBG tc mt24 dib">\r\n          <img class="" src="../../assets/images/PagerP1/AudioBG2.png" alt="" />\r\n        </div>\r\n      </div>\r\n      <div v-if="flag" class="bottomBtnBox jcsb mt30 pl24 pr24">\r\n        <div class="cf f14">\r\n          <div class="w35 h35 lh35 tc">\r\n            <div class="w15 h15 ml8 iconfont" />\r\n          </div>\r\n          <div />\r\n        </div>\r\n        <div class="cf f14">\r\n          <div class="w30 h30 lh30 btnStyle tc cp" @click="play">\r\n            <div\r\n              class="w5 h5 ml8 iconfont"\r\n              :class="isPlay ? \'icon-wanchengluyin\' : \'icon-kaishiluyin\'"\r\n            />\r\n          </div>\r\n          <div>{{ !isPlay ? \'开始喊话\' : \'结束喊话\' }}</div>\r\n        </div>\r\n        <div class="cf f14" :class="{ vish: !isPlay }">\r\n          <div class="w35 h35">\r\n            <div class="w5 h5 mt10 ml9 iconfont" />\r\n          </div>\r\n          <div />\r\n        </div>\r\n      </div>\r\n      \x3c!-- <div class="mt40" v-if="!flag">\r\n        <div class="bottomBtnBox mr jcenter">\r\n          <div class="cf f14" @click="change">\r\n            <div class="w45 h45 lh45 btnStyle tc cp">\r\n              <div class="w15 h15 ml13 iconfont icon-moshiqiehuan"></div>\r\n            </div>\r\n            <div>模式切换</div>\r\n          </div>\r\n        </div>\r\n      </div> --\x3e\r\n    </div>\r\n  </div>\r\n</template>\r\n\r\n<script>\r\nimport CmdStreamFunction from \'../utils/cmd_stream_function\';\r\nimport CmdStreamUpData from \'../utils/cmd_stream_up_data\';\r\n// 必须引入的核心，换成require也是一样的。注意：recorder-core会自动往window下挂载名称为Recorder对象，全局可调用window.Recorder，也许可自行调整相关源码清除全局污染\r\nimport Recorder from \'recorder-core\';\r\n// 需要使用到的音频格式编码引擎的js文件统统加载进来\r\nimport \'recorder-core/src/engine/mp3\';\r\nimport \'recorder-core/src/engine/mp3-engine\';\r\nimport \'recorder-core/src/engine/pcm\';\r\nexport default {\r\n  data() {\r\n    return {\r\n      flag: true,\r\n      isPlay: false,\r\n      hours: \'00\',\r\n      time: \'00:00:00\',\r\n      setIntervalTime: \'\',\r\n      s: 0,\r\n      h: 0,\r\n      f: 0,\r\n      action: null,\r\n      result: null,\r\n      type: null\r\n    };\r\n  },\r\n  inject: [\'PagerP1\', \'PoliceKey\'],\r\n  watch: {\r\n    action: {\r\n      handler(val) {\r\n        if (val == 12 && this.type == 0 && this.result == 0) {\r\n          this.say();\r\n        }\r\n      }\r\n    }\r\n  },\r\n  mounted() {},\r\n  beforeDestroy() {\r\n    this.handleStartShoutDown();\r\n  },\r\n  methods: {\r\n    reset() {\r\n      clearInterval(this.setIntervalTime);\r\n      this.time = \'00:00:00\';\r\n      this.s = 0;\r\n      this.h = 0;\r\n      this.f = 0;\r\n      this.isPlay = false;\r\n    },\r\n    change() {\r\n      this.flag = !this.flag;\r\n      this.reset();\r\n      if (!this.flag) {\r\n        this.handleStartShout();\r\n        this.init();\r\n      } else {\r\n        this.handleStartShoutDown();\r\n      }\r\n    },\r\n\r\n    play() {\r\n      this.isPlay = !this.isPlay;\r\n      if (!this.isPlay) {\r\n        // 完成录音\r\n        this.handleStartShoutDown();\r\n        this.reset();\r\n      } else {\r\n        // this.init();\r\n        this.init();\r\n        this.handleStartShout();\r\n        this.$emit(\'playAudio\', 14);\r\n      }\r\n    },\r\n    init() {\r\n      this.setIntervalTime = setInterval(() => {\r\n        this.s += 1;\r\n        if (this.s === 60) {\r\n          this.s = 0;\r\n          this.f += 1;\r\n          if (this.f === 60) {\r\n            this.h += 1;\r\n          }\r\n        }\r\n        if (this.s < 10 && this.f < 10) {\r\n          this.time = \'0\' + this.h + \':\' + 0 + this.f + \':\' + 0 + this.s;\r\n        } else if (this.s < 10 && this.f >= 10) {\r\n          this.time = \'0\' + this.h + \':\' + this.f + \':\' + 0 + this.s;\r\n        } else if (this.s >= 10 && this.f < 10) {\r\n          this.time = \'0\' + this.h + \':\' + 0 + this.f + \':\' + this.s;\r\n        } else if (this.s >= 10 && this.f >= 10) {\r\n          this.time = \'0\' + this.h + \':\' + this.f + \':\' + this.s;\r\n        }\r\n      }, 1000);\r\n    },\r\n    handleStartShout() {\r\n      // 结束喊话指令\r\n      // let cmd = new CmdStreamFunction(13, 0);\r\n      // let message = cmd.pack();\r\n      // message = Uint8Array.from(message);\r\n      // this.mqtt_publish(message);\r\n      // // 开始喊话指令\r\n      // cmd = new CmdStreamFunction(12, 0);\r\n      // message = cmd.pack();\r\n      // message = Uint8Array.from(message);\r\n      const message = {\r\n        data: 12,\r\n        type: 2317\r\n      };\r\n      this.mqtt_publish(message);\r\n      const _this = this;\r\n    },\r\n    say() {\r\n      const _this = this;\r\n      function sendAllBytes(arrayBuffer) {\r\n        // console.log(arrayBuffer);\r\n        var uint8array = new Uint8Array(arrayBuffer);\r\n        const list = [...uint8array];\r\n        const mav_list = [];\r\n        while (list.length > 0) {\r\n          const byte250 = list.splice(0, 250);\r\n          const uint8array = Uint8Array.from(byte250);\r\n          const array = [...uint8array];\r\n          const cmd = new CmdStreamUpData(array.length, array);\r\n          const message = cmd.pack();\r\n          mav_list.push(...message);\r\n        }\r\n        const message = Uint8Array.from(mav_list);\r\n        const datas = {\r\n          data: Array.from(uint8array),\r\n          type: 2318\r\n        };\r\n        _this.mqtt_publish(datas);\r\n      }\r\n\r\n      var testSampleRate = 16000;\r\n      var testBitRate = 16;\r\n      var SendInterval = 1;\r\n\r\n      /** ****\r\n          转码发送间隔（实际间隔比这个变量值偏大点，取决于BufferSize）。这个值可以设置很大，但不能设置很低，毕竟转码和传输还是要花费一定时间的，设备性能低下可能还处理不过来。\r\n\r\n          mp3格式下一般大于500ms就能保证能够正常转码处理，wav大于100ms，剩下的问题就是传输速度了。由于转码操作都是串行的，录制过程中转码生成出来mp3顺序都是能够得到保证，但结束时最后几段数据可能产生顺序问题，需要留意。由于传输通道不一定稳定，后端接收到的顺序可能错乱，因此可以携带编号进行传输，完成后进行一次排序以纠正顺序错乱的问题。\r\n\r\n          mp3格式在间隔太低的情况下中间的停顿会非常明显，可适当调大间隔以规避此影响，因为mp3编码时首尾出现了填充的静默数据（mp3.js编码器内已尽力消除了这些静默，但还是会有些许的静默停顿）；wav格式没有此问题，测试时可以打开 testOutputWavLog + mp3、wav合并demo 来对比音质。\r\n\r\n          当出现性能问题时，可能音频编码不过来，将采取丢弃部分帧的策略。\r\n        ******/\r\n\r\n      // 重置环境\r\n      var RealTimeSendTryReset = function (type) {\r\n        realTimeSendTryType = type;\r\n        realTimeSendTryTime = 0;\r\n      };\r\n\r\n      var realTimeSendTryType;\r\n      var realTimeSendTryEncBusy;\r\n      var realTimeSendTryTime = 0;\r\n      var realTimeSendTryNumber;\r\n      var transferUploadNumberMax;\r\n      var realTimeSendTryChunk;\r\n\r\n      // =====实时处理核心函数==========\r\n      var RealTimeSendTry = function (rec, isClose) {\r\n        var t1 = Date.now();\r\n        var endT = 0;\r\n        var recImpl = Recorder.prototype;\r\n        if (realTimeSendTryTime == 0) {\r\n          realTimeSendTryTime = t1;\r\n          realTimeSendTryEncBusy = 0;\r\n          realTimeSendTryNumber = 0;\r\n          transferUploadNumberMax = 0;\r\n          realTimeSendTryChunk = null;\r\n        }\r\n        if (!isClose && t1 - realTimeSendTryTime < SendInterval) {\r\n          return; // 控制缓冲达到指定间隔才进行传输\r\n        }\r\n        realTimeSendTryTime = t1;\r\n        var number = ++realTimeSendTryNumber;\r\n\r\n        // 借用SampleData函数进行数据的连续处理，采样率转换是顺带的\r\n        var chunk = Recorder.SampleData(\r\n          rec.buffers,\r\n          rec.srcSampleRate,\r\n          testSampleRate,\r\n          realTimeSendTryChunk,\r\n          { frameType: isClose ? \'\' : realTimeSendTryType }\r\n        );\r\n\r\n        // 清理已处理完的缓冲数据，释放内存以支持长时间录音，最后完成录音时不能调用stop，因为数据已经被清掉了\r\n        for (var i = realTimeSendTryChunk ? realTimeSendTryChunk.index : 0; i < chunk.index; i++) {\r\n          rec.buffers[i] = null;\r\n        }\r\n        realTimeSendTryChunk = chunk; // 此时的chunk.data就是原始的音频pcm数据，直接保存即为pcm文件、加个wav头即为wav文件、丢给mp3编码器转一下码即为mp3文件\r\n\r\n        // 实时编码队列阻塞处理\r\n        if (!isClose) {\r\n          if (realTimeSendTryEncBusy >= 2) {\r\n            // console.log("编码队列阻塞，已丢弃一帧");\r\n            return;\r\n          }\r\n        }\r\n        realTimeSendTryEncBusy++;\r\n\r\n        // 通过mock方法实时转码成mp3、wav；pcm格式可以不经过此操作，直接发送chunk.data\r\n        var encStartTime = Date.now();\r\n        var recMock = Recorder({\r\n          type: realTimeSendTryType,\r\n          sampleRate: testSampleRate, // 采样率\r\n          bitRate: testBitRate // 比特率\r\n        });\r\n        recMock.mock(chunk.data, chunk.sampleRate);\r\n\r\n        recMock.stop(\r\n          function (blob, duration) {\r\n            realTimeSendTryEncBusy && realTimeSendTryEncBusy--;\r\n            blob.encTime = Date.now() - encStartTime;\r\n            sendAllBytes(chunk.data.buffer);\r\n          },\r\n          function (msg) {\r\n            realTimeSendTryEncBusy && realTimeSendTryEncBusy--;\r\n          }\r\n        );\r\n      };\r\n\r\n      // 调用录音\r\n      var rec;\r\n      function recStartPcm() {\r\n        recStart(\'pcm\');\r\n      }\r\n      function recStart(type) {\r\n        if (rec) {\r\n          rec.close();\r\n        }\r\n        rec = Recorder({\r\n          type: \'unknown\',\r\n          onProcess: function (buffers, powerLevel, bufferDuration, bufferSampleRate) {\r\n            // 推入实时处理，因为是unknown格式，这里简化函数调用，没有用到buffers和bufferSampleRate，因为这些数据和rec.buffers是完全相同的。\r\n            RealTimeSendTry(rec, false);\r\n          }\r\n        });\r\n\r\n        var t = setTimeout(function () {}, 8000);\r\n\r\n        rec.open(\r\n          function () {\r\n            // 打开麦克风授权获得相关资源\r\n            clearTimeout(t);\r\n            rec.start(); // 开始录音\r\n\r\n            RealTimeSendTryReset(type); // 重置\r\n          },\r\n          function (msg, isUserNotAllow) {\r\n            clearTimeout(t);\r\n          }\r\n        );\r\n      }\r\n      function recStop() {\r\n        rec.close(); // 直接close掉即可，这个例子不需要获得最终的音频文件\r\n\r\n        RealTimeSendTry(rec, true); // 最后一次发送\r\n      }\r\n\r\n      this.recStop = recStop;\r\n\r\n      recStartPcm();\r\n    },\r\n    handleStartShoutDown() {\r\n      this.recStop && this.recStop();\r\n      // if(this.action == 13 && this.type == 0 && this.result == 0){\r\n      const message = {\r\n        data: 13,\r\n        type: 2317\r\n      };\r\n      this.mqtt_publish(message);\r\n      // }\r\n    },\r\n    async mqtt_publish(message) {\r\n      if (this.PoliceKey()) {\r\n        const key = await this.PoliceKey();\r\n        this.PagerP1.mqtt.client.publish(\r\n          `SPEAK/OBTAIN/${key}-01`,\r\n          new TextEncoder().encode(JSON.stringify(message)),\r\n          {\r\n            qos: 0\r\n          },\r\n          (e) => {\r\n            console.log(\'发送指令成功:\', message);\r\n          }\r\n        );\r\n        this.PagerP1.mqtt.client.on(\'message\', (topic, payload, packet) => {\r\n          const data = JSON.parse(packet.payload.toString());\r\n          this.action = data.action;\r\n          this.result = data.result;\r\n          this.type = data.type;\r\n          // console.log(this.action,this.result,this.type);\r\n        });\r\n      }\r\n    }\r\n  }\r\n};\r\n<\/script>\r\n\r\n<style lang="scss" scoped>\r\n.itemBMaxBox {\r\n  width: 327px;\r\n  height: 231px;\r\n  border-radius: 2px 2px 0px 0px;\r\n  border: 1px solid #315ec7;\r\n}\r\n.AudioBG {\r\n  // width: 267px;\r\n  // height: 25px;\r\n  padding: 5px 5px;\r\n  border: 1px solid #3263a5;\r\n}\r\n.bottomBtnBox {\r\n  .btnStyle {\r\n    cursor: pointer;\r\n    border-radius: 50%;\r\n    background: #9bacbe;\r\n    color: #3e495b;\r\n    border: 10px solid #000;\r\n    .bf {\r\n      transform: rotate(90deg);\r\n    }\r\n  }\r\n  .btnStyle:hover {\r\n    color: #43deff;\r\n  }\r\n}\r\n.vish {\r\n  visibility: hidden;\r\n}\r\n.jcenter {\r\n  display: flex;\r\n  justify-content: center;\r\n}\r\n</style>\r\n', ".itemBMaxBox {\n  width: 327px;\n  height: 231px;\n  border-radius: 2px 2px 0px 0px;\n  border: 1px solid #315ec7;\n}\n\n.AudioBG {\n  padding: 5px 5px;\n  border: 1px solid #3263a5;\n}\n\n.bottomBtnBox .btnStyle {\n  cursor: pointer;\n  border-radius: 50%;\n  background: #9bacbe;\n  color: #3e495b;\n  border: 10px solid #000;\n}\n.bottomBtnBox .btnStyle .bf {\n  transform: rotate(90deg);\n}\n.bottomBtnBox .btnStyle:hover {\n  color: #43deff;\n}\n\n.vish {\n  visibility: hidden;\n}\n\n.jcenter {\n  display: flex;\n  justify-content: center;\n}\n\n/*# sourceMappingURL=itemB.vue.map */"]
    },
    media: void 0
  });
}, g, "data-v-47037db6", false, undefined, !1, e);
var C = {
  data: function data() {
    return {
      activeBg: null,
      itemName: "",
      videoFlag: !0,
      status: 11,
      scflag: !1,
      oldName: "",
      loading: !1,
      options: [{
        recodeCycle: 10,
        type: "单曲"
      }, {
        recodeCycle: 11,
        type: "单曲循环"
      }],
      recodeCycle: 10,
      action: null,
      result: null,
      types: null,
      e: null
    };
  },
  watch: {
    PagerP1: {
      handler: function handler(n) {
        11 == n.recodeState ? this.videoFlag = !1 : this.videoFlag = !0;
      }
    },
    action: {
      handler: function handler(n) {
        this.upload(this.e);
      }
    }
  },
  created: function created() {
    this.handleGetMusicList();
  },
  mounted: function mounted() {
    var _this8 = this;
    setInterval(function () {
      _this8.recodeCycle = _this8.PagerP1.recodeCycle, 11 == _this8.PagerP1.recodeState ? _this8.videoFlag = !1 : _this8.videoFlag = !0;
    }, 100);
  },
  methods: {
    reset: function reset() {
      this.mqtt_publish({
        data: "",
        type: 2323
      }), this.$message.success("已刷新");
    },
    del: function del(n) {
      var _this9 = this;
      this.$confirm("是否删除此音乐？", "确认", {
        cancelButtonText: "取消",
        confirmButtonText: "确定",
        showClose: !1
      }).then(function () {
        var r = {
          data: n,
          type: 2324
        };
        _this9.mqtt_publish(r);
      })["catch"](function () {
        _this9.$message({
          type: "info",
          message: "已取消操作"
        });
      });
    },
    onChange: function onChange(n) {
      var r = {
        data: n,
        type: 2310
      };
      this.mqtt_publish(r);
    },
    handClick: function handClick(n, r) {
      this.activeBg = r, this.itemName = n, this.videoFlag = !0;
    },
    startMusic: function startMusic() {
      var n = {
        data: this.itemName,
        type: 2308
      };
      this.mqtt_publish(n), this.oldName = this.itemName, this.videoFlag = !1;
    },
    handlePlayMusic: function handlePlayMusic() {
      if (!this.itemName) return this.$message.info("未选择曲目");
      if (0 == this.itemName.indexOf("$")) return this.$message.warning("此歌曲正在增响中，刷新后重试！");
      if (this.itemName != this.oldName) this.startMusic();else {
        this.videoFlag ? (this.status = 11, this.$emit("playAudio", 26)) : this.status = 12;
        var _n5 = {
          data: this.status,
          type: 2309
        };
        this.videoFlag = !this.videoFlag, this.oldName = this.itemName, this.mqtt_publish(_n5);
      }
    },
    stopMusic: function stopMusic() {
      this.mqtt_publish({
        data: 12,
        type: 2309
      }), this.videoFlag = !0;
    },
    handleGetMusicList: function handleGetMusicList() {},
    delSong: function delSong() {
      var n = {
        data: this.itemName,
        type: 2323
      };
      this.mqtt_publish(n);
    },
    handleUploadMusicFile: function handleUploadMusicFile(n) {
      this.e = n;
      var r = {
        data: 10,
        type: 2322
      };
      this.mqtt_publish(r), console.log("流上传开始:", r);
    },
    upload: function upload(n) {
      var _this10 = this;
      return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
        var r, e, _n6, _n7, _e2, _t;
        return _regeneratorRuntime().wrap(function _callee4$(_context4) {
          while (1) switch (_context4.prev = _context4.next) {
            case 0:
              console.log("upload", n);
              r = n.target.files[0], e = r.name.replace(" ", "");
              _context4.prev = 2;
              if (!(_this10.PagerP1.music.list.length > 0 && _this10.PagerP1.music.list.forEach(function (n) {
                if (n == e) throw new Error("退出循环");
              }), _this10.scflag = !0, _this10.loading = !0, 10 == _this10.action && 0 == _this10.result && 1 == _this10.types)) {
                _context4.next = 8;
                break;
              }
              _context4.next = 6;
              return _this10.main(r);
            case 6:
              _n6 = {
                data: 11,
                type: 2322
              };
              _this10.mqtt_publish(_n6);
            case 8:
              if (!(11 == _this10.action && 0 == _this10.result && 1 == _this10.types)) {
                _context4.next = 17;
                break;
              }
              _n7 = {
                data: 11,
                type: 2322
              };
              _this10.mqtt_publish(_n7);
              _e2 = {
                data: r.name.replace(" ", ""),
                type: 2320
              };
              _context4.next = 14;
              return _this10.mqtt_publish(_e2);
            case 14:
              _this10.$message.success("上传成功!");
              _t = {
                data: "",
                type: 2323
              };
              _this10.mqtt_publish(_t), _this10.scflag = !1, _this10.loading = !1, document.querySelector("#btn_file").value = "";
            case 17:
              _context4.next = 22;
              break;
            case 19:
              _context4.prev = 19;
              _context4.t0 = _context4["catch"](2);
              "退出循环" === _context4.t0.message && (_this10.$message.error("上传的歌曲与列表中歌曲存在相同名字，请重试！"), document.querySelector("#btn_file").value = "");
            case 22:
            case "end":
              return _context4.stop();
          }
        }, _callee4, null, [[2, 19]]);
      }))();
    },
    sleep: function () {
      var _sleep = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(n) {
        return _regeneratorRuntime().wrap(function _callee5$(_context5) {
          while (1) switch (_context5.prev = _context5.next) {
            case 0:
              return _context5.abrupt("return", new Promise(function (r) {
                return setTimeout(r, n);
              }));
            case 1:
            case "end":
              return _context5.stop();
          }
        }, _callee5);
      }));
      function sleep(_x) {
        return _sleep.apply(this, arguments);
      }
      return sleep;
    }(),
    main: function main(n) {
      var _this11 = this;
      return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
        var r, e, t, _n8, _n9;
        return _regeneratorRuntime().wrap(function _callee6$(_context6) {
          while (1) switch (_context6.prev = _context6.next) {
            case 0:
              _context6.next = 2;
              return _this11.blob2arraybuffer(n);
            case 2:
              r = _context6.sent;
              e = Array.from(new Uint8Array(r));
              t = Math.ceil(e.length / 2500);
              console.log(t);
              _n8 = 0;
            case 7:
              if (!(_n8 < t)) {
                _context6.next = 15;
                break;
              }
              _context6.next = 10;
              return _this11.sleep(10);
            case 10:
              _n9 = e.splice(0, 2500);
              _this11.s(_n9);
            case 12:
              _n8++;
              _context6.next = 7;
              break;
            case 15:
            case "end":
              return _context6.stop();
          }
        }, _callee6);
      }))();
    },
    s: function s(n) {
      var r = {
        data: n,
        type: 2318
      };
      this.mqtt_publish(r);
    },
    mqtt_publish: function mqtt_publish(n) {
      var _this12 = this;
      return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
        var _r5;
        return _regeneratorRuntime().wrap(function _callee7$(_context7) {
          while (1) switch (_context7.prev = _context7.next) {
            case 0:
              if (!_this12.PoliceKey()) {
                _context7.next = 5;
                break;
              }
              _context7.next = 3;
              return _this12.PoliceKey();
            case 3:
              _r5 = _context7.sent;
              _this12.PagerP1.mqtt.client.publish("SPEAK/OBTAIN/".concat(_r5, "-01"), new TextEncoder().encode(JSON.stringify(n)), {
                qos: 0
              }, function (r) {
                console.log("发送成功", n);
              }), _this12.PagerP1.mqtt.client.on("message", function (n, r, e) {
                var t = JSON.parse(e.payload.toString());
                _this12.PagerP1.recodeState = t.recodeState, _this12.action = t.action, _this12.result = t.result, _this12.types = t.type;
              });
            case 5:
            case "end":
              return _context7.stop();
          }
        }, _callee7);
      }))();
    },
    blob2arraybuffer: function () {
      var _blob2arraybuffer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(n) {
        return _regeneratorRuntime().wrap(function _callee8$(_context8) {
          while (1) switch (_context8.prev = _context8.next) {
            case 0:
              return _context8.abrupt("return", n ? new Promise(function (r, e) {
                var t = new FileReader();
                t.onload = function () {
                  return r(t.result);
                }, t.onerror = function (n) {
                  return e(n);
                }, t.readAsArrayBuffer(n);
              }) : Promise.reject(n));
            case 1:
            case "end":
              return _context8.stop();
          }
        }, _callee8);
      }));
      function blob2arraybuffer(_x2) {
        return _blob2arraybuffer.apply(this, arguments);
      }
      return blob2arraybuffer;
    }()
  },
  inject: ["PagerP1", "PoliceKey"]
};
var y = function y() {
  var n = this,
    r = n.$createElement,
    e = n._self._c || r;
  return e("div", {
    directives: [{
      name: "loading",
      rawName: "v-loading",
      value: n.loading,
      expression: "loading"
    }],
    staticClass: "itemCMaxBox",
    attrs: {
      "element-loading-text": "音频上传中...",
      "element-loading-spinner": "el-icon-loading",
      "element-loading-background": "rgba(0, 0, 0, 0.4)"
    }
  }, [e("div", {
    staticClass: "jcsb cf mt24"
  }, [e("span", [n._v("音频列表:(" + n._s(n.PagerP1.music.list.length || 0) + "条)")]), n._v(" "), e("div", {
    staticClass: "w15 h15 iconfont c40d icon-gengxin cp",
    on: {
      click: n.reset
    }
  })]), n._v(" "), e("div", {
    staticClass: "w315 h98 itemCList"
  }, n._l(n.PagerP1.music.list, function (r, t) {
    return e("div", {
      key: t,
      staticClass: "h26 lh26 jcsb pl10 pr10 cf cp",
      "class": n.activeBg == t ? "bg148" : "bg149",
      on: {
        click: function click(e) {
          return n.handClick(r, t);
        }
      }
    }, [e("div", {
      staticClass: "List"
    }, [e("span", {
      staticClass: "mr15"
    }, [n._v(n._s(t + 1))]), n._v(" "), e("span", [n._v(n._s(r))])]), n._v(" "), e("div", {
      staticClass: "del",
      on: {
        click: function click(e) {
          return n.del(r);
        }
      }
    }, [e("span", {
      staticClass: "iconfont icon-shanchu"
    })])]);
  }), 0), n._v(" "), e("div", {
    staticClass: "bottomBtnBox tc jcsb mt10 pr24"
  }, [e("div", {
    staticClass: "cf f14"
  }, [e("div", {
    staticClass: "w30 h30 btnStyle lh35 tc",
    "class": n.scflag ? "pointerEvents" : ""
  }, [e("div", {
    staticClass: "w15 h15 ml8 iconfont pr icon-a-shangchuan2px"
  }, [e("input", {
    ref: "btn_file",
    staticClass: "pa top0 cp w30 h30",
    attrs: {
      id: "btn_file",
      type: "file",
      accept: "audio/*"
    },
    on: {
      change: n.handleUploadMusicFile
    }
  })])]), n._v(" "), n.scflag ? e("div", [n._v("上传中...")]) : e("div", [n._v("上传")])]), n._v(" "), e("div", {
    staticClass: "cf f14 ml5"
  }, [e("div", {
    staticClass: "w30 h30 btnStyle cp tc",
    on: {
      click: n.handlePlayMusic
    }
  }, [n.videoFlag ? e("div", {
    staticClass: "w5 h5 mt7 ml8 iconfont icon-a-bofang2px"
  }) : e("div", {
    staticClass: "w20 h20 mt7 ml5 iconfont icon-a-zanting2px"
  })]), n._v(" "), e("div", [n._v("播放")])]), n._v(" "), e("div", {
    staticClass: "cf f14 mt20 ml10"
  }, [e("span", [n._v("播放模式:")]), n._v(" "), e("el-select", {
    staticClass: "dib w100",
    attrs: {
      size: "mini",
      placeholder: "请选择",
      "popper-append-to-body": ""
    },
    on: {
      change: n.onChange
    },
    model: {
      value: n.recodeCycle,
      callback: function callback(r) {
        n.recodeCycle = r;
      },
      expression: "recodeCycle"
    }
  }, n._l(n.options, function (n) {
    return e("el-option", {
      key: n.recodeCycle,
      attrs: {
        label: n.type,
        value: n.recodeCycle
      }
    });
  }), 1)], 1)])]);
};
y._withStripped = !0;
var B = r({
    render: y,
    staticRenderFns: []
  }, function (n) {
    n && n("data-v-13499aa8_0", {
      source: ".itemCMaxBox[data-v-13499aa8] {\n  padding: 0 8px;\n  border: 1px solid #315ec7;\n}\n.itemCMaxBox input[type=file][data-v-13499aa8] {\n  color: transparent;\n  opacity: 0;\n  top: 0px;\n  left: -7px;\n  width: 20px;\n  cursor: pointer !important;\n  text-decoration: none;\n}\n.itemCMaxBox .itemCList[data-v-13499aa8] {\n  border: 1px solid #3360a6;\n  overflow-y: auto;\n  border-radius: 10px;\n}\n.itemCMaxBox .itemCList .List[data-v-13499aa8] {\n  width: 360px;\n  overflow: hidden;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n}\n.itemCMaxBox .bottomBtnBox .btnStyle[data-v-13499aa8] {\n  border-radius: 50%;\n  background: #9bacbe;\n  color: #3e495b;\n  border: 10px solid #000;\n}\n.itemCMaxBox .bottomBtnBox .btnStyle .bf[data-v-13499aa8] {\n  transform: rotate(90deg);\n}\n.itemCMaxBox .bottomBtnBox .btnStyle[data-v-13499aa8]:hover {\n  color: #43deff;\n}\n[data-v-13499aa8] el-select .el-input--mini {\n  background: #3768b3;\n}\n.c40d[data-v-13499aa8] {\n  color: #40d4f5;\n}\n.bg148[data-v-13499aa8] {\n  opacity: 1;\n  background: #315ec7;\n  color: #ffffff;\n  border-radius: 2px;\n  border-radius: 5px;\n}\n.bg149[data-v-13499aa8] {\n  opacity: 0.5;\n}\n.pointerEvents[data-v-13499aa8] {\n  pointer-events: none;\n}\n[data-v-13499aa8] .el-select .el-input__inner {\n  border: 1px solid #3768b3;\n  background: #132550;\n  border-radius: 4px 4px 0 0;\n  color: #fff;\n}\n\n/*# sourceMappingURL=itemC.vue.map */",
      map: {
        version: 3,
        sources: ["E:\\work\\standardization\\mmc-stl-module\\src\\components\\MMCFlightControlCenter\\components\\mount\\PagerP1_New\\components\\itemC.vue", "itemC.vue"],
        names: [],
        mappings: "AAmZA;EACA,cAAA;EACA,yBAAA;AClZA;ADmZA;EACA,kBAAA;EACA,UAAA;EACA,QAAA;EACA,UAAA;EACA,WAAA;EACA,0BAAA;EACA,qBAAA;ACjZA;ADmZA;EACA,yBAAA;EACA,gBAAA;EACA,mBAAA;ACjZA;ADkZA;EACA,YAAA;EACA,gBAAA;EACA,mBAAA;EACA,uBAAA;AChZA;ADoZA;EACA,kBAAA;EAEA,mBAAA;EACA,cAAA;EACA,uBAAA;ACnZA;ADoZA;EACA,wBAAA;AClZA;ADqZA;EACA,cAAA;ACnZA;ADwZA;EACA,mBAAA;ACrZA;ADwZA;EACA,cAAA;ACrZA;ADuZA;EACA,UAAA;EACA,mBAAA;EACA,cAAA;EACA,kBAAA;EACA,kBAAA;ACpZA;ADsZA;EACA,YAAA;ACnZA;ADqZA;EACA,oBAAA;AClZA;ADqZA;EACA,yBAAA;EACA,mBAAA;EACA,0BAAA;EACA,WAAA;AClZA;;AAEA,oCAAoC",
        file: "itemC.vue",
        sourcesContent: ['<template>\r\n  <div\r\n    v-loading="loading"\r\n    class="itemCMaxBox"\r\n    element-loading-text="音频上传中..."\r\n    element-loading-spinner="el-icon-loading"\r\n    element-loading-background="rgba(0, 0, 0, 0.4)"\r\n  >\r\n    <div class="jcsb cf mt24">\r\n      <span>音频列表:({{ PagerP1.music.list.length || 0 }}条)</span>\r\n      <div class="w15 h15 iconfont c40d icon-gengxin cp" @click="reset" />\r\n    </div>\r\n    <div class="w315 h98 itemCList">\r\n      <div\r\n        v-for="(item, index) in PagerP1.music.list"\r\n        :key="index"\r\n        :class="activeBg == index ? \'bg148\' : \'bg149\'"\r\n        class="h26 lh26 jcsb pl10 pr10 cf cp"\r\n        @click="handClick(item, index)"\r\n      >\r\n        <div class="List">\r\n          <span class="mr15">{{ index + 1 }}</span>\r\n          <span>{{ item }}</span>\r\n        </div>\r\n        <div class="del" @click="del(item)">\r\n          <span class="iconfont icon-shanchu" />\r\n        </div>\r\n      </div>\r\n    </div>\r\n    <div class="bottomBtnBox tc jcsb mt10 pr24">\r\n      <div class="cf f14">\r\n        <div class="w30 h30 btnStyle lh35 tc" :class="scflag ? \'pointerEvents\' : \'\'">\r\n          <div class="w15 h15 ml8 iconfont pr icon-a-shangchuan2px">\r\n            <input\r\n              id="btn_file"\r\n              ref="btn_file"\r\n              class="pa top0 cp w30 h30"\r\n              type="file"\r\n              accept="audio/*"\r\n              @change="handleUploadMusicFile"\r\n            />\r\n          </div>\r\n        </div>\r\n        <div v-if="!scflag">上传</div>\r\n        <div v-else>上传中...</div>\r\n      </div>\r\n      <div class="cf f14 ml5">\r\n        <div class="w30 h30 btnStyle cp tc" @click="handlePlayMusic">\r\n          <div v-if="videoFlag" class="w5 h5 mt7 ml8 iconfont icon-a-bofang2px" />\r\n          <div v-else class="w20 h20 mt7 ml5 iconfont icon-a-zanting2px" />\r\n        </div>\r\n        <div>播放</div>\r\n      </div>\r\n      \x3c!-- <div class="cf f14" v-if="itemName" @click="delSong">\r\n        <div class="w30 h30 btnStyle cp">\r\n          <div class="w5 h5 mt10 ml9 iconfont icon-shanchu"></div>\r\n        </div>\r\n        <div>删除</div>\r\n      </div>--\x3e\r\n      <div class="cf f14 mt20 ml10">\r\n        <span>播放模式:</span>\r\n        <el-select\r\n          v-model="recodeCycle"\r\n          size="mini"\r\n          class="dib w100"\r\n          placeholder="请选择"\r\n          popper-append-to-body\r\n          @change="onChange"\r\n        >\r\n          <el-option\r\n            v-for="item in options"\r\n            :key="item.recodeCycle"\r\n            :label="item.type"\r\n            :value="item.recodeCycle"\r\n          />\r\n        </el-select>\r\n      </div>\r\n    </div>\r\n  </div>\r\n</template>\r\n\r\n<script>\r\nimport MavLink20Processor from \'../utils/mavlink20_processor\';\r\nimport CmdTtsText from \'../utils/cmd_tts_text\';\r\nimport CmdReadFileList from \'../utils/cmd_read_file_list\';\r\nimport CmdRecordName from \'../utils/cmd_record_name\';\r\nimport CmdSetSystemVolume from \'../utils/cmd_set_system_volume\';\r\nimport CmdStreamFunction from \'../utils/cmd_stream_function\';\r\nimport CmdStreamUpData from \'../utils/cmd_stream_up_data\';\r\nimport CmdSaveFile from \'../utils/cmd_save_file\';\r\nimport CmdRecordStateA from \'../utils/cmd_record_state\';\r\n\r\nexport default {\r\n  data() {\r\n    return {\r\n      activeBg: null,\r\n      itemName: \'\',\r\n      videoFlag: true,\r\n      status: 11,\r\n      scflag: false,\r\n      oldName: \'\',\r\n      loading: false,\r\n      options: [\r\n        {\r\n          recodeCycle: 10,\r\n          type: \'单曲\'\r\n        },\r\n        {\r\n          recodeCycle: 11,\r\n          type: \'单曲循环\'\r\n        }\r\n        // {\r\n        //   recodeCycle: 12,\r\n        //   type: "列表",\r\n        // },\r\n        // {\r\n        //   recodeCycle: 13,\r\n        //   type: "列表循环",\r\n        // },\r\n        // {\r\n        //   recodeCycle: 14,\r\n        //   type: "随机",\r\n        // },\r\n        // {\r\n        //   recodeCycle: -1,\r\n        //   type: "未初始化",\r\n        // },\r\n      ],\r\n      // recodeState: 10,\r\n      recodeCycle: 10,\r\n      action: null,\r\n      result: null,\r\n      types: null,\r\n      e: null\r\n    };\r\n  },\r\n  watch: {\r\n    PagerP1: {\r\n      handler(val) {\r\n        if (val.recodeState == 11) {\r\n          this.videoFlag = false;\r\n        } else {\r\n          this.videoFlag = true;\r\n        }\r\n      }\r\n    },\r\n    action: {\r\n      handler(val) {\r\n        this.upload(this.e);\r\n      }\r\n    }\r\n  },\r\n  created() {\r\n    // // 获取列表\r\n    this.handleGetMusicList();\r\n  },\r\n  mounted() {\r\n    setInterval(() => {\r\n      this.recodeCycle = this.PagerP1.recodeCycle;\r\n      if (this.PagerP1.recodeState == 11) {\r\n        this.videoFlag = false;\r\n      } else {\r\n        this.videoFlag = true;\r\n      }\r\n    }, 100);\r\n  },\r\n  methods: {\r\n    reset() {\r\n      const res = {\r\n        data: \'\',\r\n        type: 2323\r\n      };\r\n      this.mqtt_publish(res);\r\n      this.$message.success(\'已刷新\');\r\n    },\r\n    del(item) {\r\n      this.$confirm(\'是否删除此音乐？\', \'确认\', {\r\n        cancelButtonText: \'取消\',\r\n        confirmButtonText: \'确定\',\r\n        // customClass: "uav_controlPane",\r\n        showClose: false\r\n      })\r\n        .then(() => {\r\n          const message = {\r\n            data: item,\r\n            type: 2324\r\n          };\r\n          this.mqtt_publish(message);\r\n        })\r\n        .catch(() => {\r\n          this.$message({\r\n            type: \'info\',\r\n            message: \'已取消操作\'\r\n          });\r\n        });\r\n    },\r\n    onChange(val) {\r\n      const message = {\r\n        data: val,\r\n        type: 2310\r\n      };\r\n      this.mqtt_publish(message);\r\n    },\r\n    handClick(item, index) {\r\n      this.activeBg = index;\r\n      this.itemName = item;\r\n      // this.stopMusic();\r\n      // this.startMusic()\r\n      this.videoFlag = true;\r\n    },\r\n    startMusic() {\r\n      const message = {\r\n        data: this.itemName,\r\n        type: 2308\r\n      };\r\n      this.mqtt_publish(message);\r\n      this.oldName = this.itemName;\r\n      this.videoFlag = false;\r\n    },\r\n    handlePlayMusic() {\r\n      /**\r\n       * 10 停止\r\n       * 11 播放\r\n       * 12 暂停\r\n       * 13 询问状态\r\n       * 14\r\n       */\r\n      if (!this.itemName) return this.$message.info(\'未选择曲目\');\r\n      if (this.itemName.indexOf(\'$\') == 0) {\r\n        return this.$message.warning(\'此歌曲正在增响中，刷新后重试！\');\r\n      }\r\n      if (this.itemName != this.oldName) {\r\n        this.startMusic();\r\n      } else {\r\n        if (this.videoFlag) {\r\n          this.status = 11;\r\n          // this.videoFlag = false;\r\n          this.$emit(\'playAudio\', 26);\r\n        } else {\r\n          this.status = 12;\r\n          // this.videoFlag = true;\r\n        }\r\n        const message = {\r\n          data: this.status,\r\n          type: 2309\r\n        };\r\n        this.videoFlag = !this.videoFlag;\r\n        this.oldName = this.itemName;\r\n        this.mqtt_publish(message);\r\n      }\r\n    },\r\n    stopMusic() {\r\n      const message = {\r\n        data: 12,\r\n        type: 2309\r\n      };\r\n      this.mqtt_publish(message);\r\n      this.videoFlag = true;\r\n    },\r\n    handleGetMusicList() {\r\n      // let cmdReadFileList = new CmdReadFileList();\r\n      // let message = cmdReadFileList.pack();\r\n      // message = Uint8Array.from(message);\r\n      // this.mqtt_publish(message);\r\n    },\r\n    // 删除单个文件\r\n    delSong() {\r\n      const data = {\r\n        data: this.itemName,\r\n        type: 2323\r\n      };\r\n      this.mqtt_publish(data);\r\n    },\r\n    // 上传文件\r\n    handleUploadMusicFile(e) {\r\n      this.e = e;\r\n      const start = {\r\n        data: 10,\r\n        type: 2322\r\n      };\r\n      this.mqtt_publish(start);\r\n      console.log(\'流上传开始:\', start);\r\n    },\r\n    async upload(e) {\r\n      console.log(\'upload\', e);\r\n      const file = e.target.files[0];\r\n      const name = file.name.replace(\' \', \'\');\r\n      try {\r\n        if (this.PagerP1.music.list.length > 0) {\r\n          this.PagerP1.music.list.forEach((val) => {\r\n            if (val == name) {\r\n              throw new Error(\'退出循环\');\r\n            }\r\n          });\r\n        }\r\n\r\n        // 状态更改\r\n        this.scflag = true;\r\n        this.loading = true;\r\n        if (this.action == 10 && this.result == 0 && this.types == 1) {\r\n          await this.main(file);\r\n          const end = {\r\n            data: 11,\r\n            type: 2322\r\n          };\r\n          this.mqtt_publish(end);\r\n        }\r\n\r\n        // 保存\r\n        if (this.action == 11 && this.result == 0 && this.types == 1) {\r\n          const end = {\r\n            data: 11,\r\n            type: 2322\r\n          };\r\n          this.mqtt_publish(end);\r\n          const message = {\r\n            data: file.name.replace(\' \', \'\'),\r\n            type: 2320\r\n          };\r\n          await this.mqtt_publish(message);\r\n          this.$message.success(\'上传成功!\');\r\n          const res = {\r\n            data: \'\',\r\n            type: 2323\r\n          };\r\n          this.mqtt_publish(res);\r\n          this.scflag = false;\r\n          this.loading = false;\r\n          document.querySelector(\'#btn_file\').value = \'\';\r\n        }\r\n      } catch (e) {\r\n        if (e.message === \'退出循环\') {\r\n          this.$message.error(\'上传的歌曲与列表中歌曲存在相同名字，请重试！\');\r\n          document.querySelector(\'#btn_file\').value = \'\';\r\n        }\r\n      }\r\n    },\r\n    async sleep(time) {\r\n      return new Promise((res) => setTimeout(res, time));\r\n    },\r\n    async main(file) {\r\n      const arrayBuffer = await this.blob2arraybuffer(file);\r\n      const fileBuffer = Array.from(new Uint8Array(arrayBuffer));\r\n      const slice_size = 2500;\r\n      const total_count = Math.ceil(fileBuffer.length / slice_size);\r\n      console.log(total_count);\r\n      for (let i = 0; i < total_count; i++) {\r\n        await this.sleep(10);\r\n        // setTimeout(() => {\r\n        // console.log("流上传:", i);\r\n        const buffer = fileBuffer.splice(0, slice_size);\r\n        this.s(buffer);\r\n        // }, 50);\r\n      }\r\n    },\r\n    s(buffer) {\r\n      const message = {\r\n        data: buffer,\r\n        type: 2318\r\n      };\r\n      this.mqtt_publish(message);\r\n    },\r\n    async mqtt_publish(message) {\r\n      if (this.PoliceKey()) {\r\n        const key = await this.PoliceKey();\r\n\r\n        this.PagerP1.mqtt.client.publish(\r\n          `SPEAK/OBTAIN/${key}-01`,\r\n          new TextEncoder().encode(JSON.stringify(message)),\r\n          {\r\n            qos: 0\r\n          },\r\n          (e) => {\r\n            console.log(\'发送成功\', message);\r\n          }\r\n        );\r\n        this.PagerP1.mqtt.client.on(\'message\', (topic, payload, packet) => {\r\n          const data = JSON.parse(packet.payload.toString());\r\n          this.PagerP1.recodeState = data.recodeState;\r\n          this.action = data.action;\r\n          this.result = data.result;\r\n          this.types = data.type;\r\n        });\r\n      }\r\n    },\r\n\r\n    async blob2arraybuffer(blob) {\r\n      if (!blob) {\r\n        return Promise.reject(blob);\r\n      }\r\n      return new Promise((resolve, reject) => {\r\n        const fileReader = new FileReader();\r\n        fileReader.onload = () => resolve(fileReader.result);\r\n        fileReader.onerror = (e) => reject(e);\r\n        fileReader.readAsArrayBuffer(blob);\r\n      });\r\n    }\r\n  },\r\n  inject: [\'PagerP1\', \'PoliceKey\']\r\n};\r\n<\/script>\r\n\r\n<style lang="scss" scoped>\r\n.itemCMaxBox {\r\n  padding: 0 8px;\r\n  border: 1px solid #315ec7;\r\n  input[type=\'file\'] {\r\n    color: transparent;\r\n    opacity: 0;\r\n    top: 0px;\r\n    left: -7px;\r\n    width: 20px;\r\n    cursor: pointer !important;\r\n    text-decoration: none;\r\n  }\r\n  .itemCList {\r\n    border: 1px solid #3360a6;\r\n    overflow-y: auto;\r\n    border-radius: 10px;\r\n    .List {\r\n      width: 360px;\r\n      overflow: hidden;\r\n      white-space: nowrap;\r\n      text-overflow: ellipsis;\r\n    }\r\n  }\r\n  .bottomBtnBox {\r\n    .btnStyle {\r\n      border-radius: 50%;\r\n\r\n      background: #9bacbe;\r\n      color: #3e495b;\r\n      border: 10px solid #000;\r\n      .bf {\r\n        transform: rotate(90deg);\r\n      }\r\n    }\r\n    .btnStyle:hover {\r\n      color: #43deff;\r\n    }\r\n  }\r\n}\r\n::v-deep el-select {\r\n  .el-input--mini {\r\n    background: #3768b3;\r\n  }\r\n}\r\n.c40d {\r\n  color: #40d4f5;\r\n}\r\n.bg148 {\r\n  opacity: 1;\r\n  background: #315ec7;\r\n  color: #ffffff;\r\n  border-radius: 2px;\r\n  border-radius: 5px;\r\n}\r\n.bg149 {\r\n  opacity: 0.5;\r\n}\r\n.pointerEvents {\r\n  pointer-events: none;\r\n}\r\n::v-deep .el-select {\r\n  .el-input__inner {\r\n    border: 1px solid #3768b3;\r\n    background: #132550;\r\n    border-radius: 4px 4px 0 0;\r\n    color: #fff;\r\n  }\r\n}\r\n</style>\r\n', ".itemCMaxBox {\n  padding: 0 8px;\n  border: 1px solid #315ec7;\n}\n.itemCMaxBox input[type=file] {\n  color: transparent;\n  opacity: 0;\n  top: 0px;\n  left: -7px;\n  width: 20px;\n  cursor: pointer !important;\n  text-decoration: none;\n}\n.itemCMaxBox .itemCList {\n  border: 1px solid #3360a6;\n  overflow-y: auto;\n  border-radius: 10px;\n}\n.itemCMaxBox .itemCList .List {\n  width: 360px;\n  overflow: hidden;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n}\n.itemCMaxBox .bottomBtnBox .btnStyle {\n  border-radius: 50%;\n  background: #9bacbe;\n  color: #3e495b;\n  border: 10px solid #000;\n}\n.itemCMaxBox .bottomBtnBox .btnStyle .bf {\n  transform: rotate(90deg);\n}\n.itemCMaxBox .bottomBtnBox .btnStyle:hover {\n  color: #43deff;\n}\n\n::v-deep el-select .el-input--mini {\n  background: #3768b3;\n}\n\n.c40d {\n  color: #40d4f5;\n}\n\n.bg148 {\n  opacity: 1;\n  background: #315ec7;\n  color: #ffffff;\n  border-radius: 2px;\n  border-radius: 5px;\n}\n\n.bg149 {\n  opacity: 0.5;\n}\n\n.pointerEvents {\n  pointer-events: none;\n}\n\n::v-deep .el-select .el-input__inner {\n  border: 1px solid #3768b3;\n  background: #132550;\n  border-radius: 4px 4px 0 0;\n  color: #fff;\n}\n\n/*# sourceMappingURL=itemC.vue.map */"]
      },
      media: void 0
    });
  }, C, "data-v-13499aa8", false, undefined, !1, e),
  _ = process.env.VUE_APP_FCMQTT_URL;
var w = {
  components: {
    AngleControl: m,
    ItemA: f,
    ItemB: x,
    ItemC: B
  },
  props: {
    title: {
      "default": "喊话器",
      type: String
    },
    exit: {
      "default": "关闭",
      type: String
    },
    PoliceKeyCode: {
      "default": "MMC301R22205057",
      type: String
    }
  },
  data: function data() {
    return {
      type: "ItemA",
      music: {
        list: []
      },
      key: "PoliceF737",
      ItemList: [{
        id: 1,
        name: "ItemA",
        title: "文字转语音"
      }, {
        id: 2,
        name: "ItemB",
        title: "语音广播"
      }, {
        id: 3,
        name: "ItemC",
        title: "音频文件"
      }],
      mqtt: {
        client: null,
        decoder: null,
        encoder: new TextEncoder()
      },
      ttsState: null,
      recodeState: null,
      volume: 0,
      angle: null,
      ttsCycle: null,
      recodeCycle: null
    };
  },
  provide: function provide() {
    var _this13 = this;
    return {
      PagerP1: this,
      PoliceKey: function PoliceKey() {
        return _this13.PoliceKeyCode;
      }
    };
  },
  computed: _objectSpread({}, i(["user_info"])),
  mounted: function mounted() {
    this.init();
  },
  methods: {
    playAudio: function playAudio(n) {
      this.$emit("playAudio", n);
    },
    init: function init() {
      var _this14 = this;
      var n = _;
      console.log("测试开始连接"), this.mqtt.client = a.connect(n, {
        protocol: "mqtt",
        clientId: 3587
      }), this.mqtt.client.on("connect", function () {
        console.log("mqtt is connected");
      }), this.mqtt.client.on("reconnect", function (n) {
        console.log(n, "reconnect");
      });
      var r = this.PoliceKeyCode,
        e = "SPEAK/RECEIVE/${key}-01";
      console.log(e, "链接主题"), this.subscribe("SPEAK/RECEIVE/".concat(r, "-01"), function () {
        console.log("\u8BA2\u9605\u65E0\u4EBA\u673A\u6570\u636E\uFF1Atopic:".concat(e));
      }), this.mqtt.client.on("message", function (n, r, e) {
        var t = JSON.parse(e.payload.toString());
        console.log(t, "musicdata"), _this14.music.list = t.musicList, _this14.ttsState = t.ttsState, _this14.recodeState = t.recodeState, _this14.volume = t.status_info.volume || 0, _this14.angle = t.angle, _this14.ttsCycle = t.ttsCycle, _this14.recodeCycle = t.recodeCycle;
      });
    },
    subscribe: function subscribe(n, r) {
      if (!n) return n;
      var e = this.mqtt.client;
      e && (console.log("订阅数据a", n), e.subscribe(n, r));
    },
    close: function close() {
      this.$emit("close"), this.mqtt.client.end(), this.mqtt.client = null;
    }
  }
};
var P = function P() {
  var n = this,
    r = n.$createElement,
    e = n._self._c || r;
  return e("div", {
    staticClass: "PagerP1Box",
    staticStyle: {
      "pointer-events": "auto"
    }
  }, [e("div", {
    directives: [{
      name: "interact",
      rawName: "v-interact"
    }],
    staticClass: "PagerP1TitleBox jcsb"
  }, [e("div", {
    staticClass: "left ml8"
  }, [e("img", {
    attrs: {
      src: s
    }
  }), n._v(" "), e("div", {
    staticClass: "cp"
  }, [n._v(n._s(n.title))])]), n._v(" "), e("div", {
    staticClass: "cp close mr16",
    on: {
      click: n.close
    }
  }, [n._v(n._s(n.exit))])]), n._v(" "), e("div", {
    staticClass: "PagerP1AreaBox"
  }, [e("div", {
    staticClass: "leftArea"
  }, [e("AngleControl", {
    attrs: {
      volume: n.volume,
      rotate: n.angle
    }
  })], 1), n._v(" "), e("div", {
    staticClass: "rightArea"
  }, [e("div", {
    staticClass: "w329 h231 mt17 rightAreaBox"
  }, [e("div", {
    staticClass: "jcsb h24 tc lh24"
  }, n._l(n.ItemList, function (r) {
    return e("div", {
      key: r.id,
      staticClass: "w160",
      "class": n.type == r.name ? "active" : "rightAreaNav",
      on: {
        click: function click(e) {
          n.type = r.name;
        }
      }
    }, [n._v("\n            " + n._s(r.title) + "\n          ")]);
  }), 0), n._v(" "), e("div", [e(n.type, {
    tag: "component",
    on: {
      playAudio: n.playAudio
    }
  })], 1)])])])]);
};
P._withStripped = !0;
var S = r({
  render: P,
  staticRenderFns: []
}, function (n) {
  n && n("data-v-57f3bb9e_0", {
    source: ".PagerP1Box[data-v-57f3bb9e] {\n  position: fixed;\n  top: 300px;\n  right: 70px;\n  box-sizing: border-box;\n  padding: 10px 20px;\n  width: 510px;\n  min-height: 296px;\n}\n.PagerP1Box .PagerP1TitleBox[data-v-57f3bb9e] {\n  height: 32px;\n  line-height: 32px;\n  background: linear-gradient(180deg, #9198ff 0%, rgba(45, 81, 153, 0.45) 40%, #05091a 100%);\n  box-shadow: inset 0px 0px 10px 2px #3f9dff;\n  border-radius: 10px 10px 0px 0px;\n  border: 1px solid #427dff;\n}\n.PagerP1Box .PagerP1TitleBox .left[data-v-57f3bb9e] {\n  display: flex;\n}\n.PagerP1Box .PagerP1TitleBox .left .cp[data-v-57f3bb9e] {\n  font-size: 20px;\n  font-family: YouSheBiaoTiHei;\n  color: #14faff;\n  line-height: 26px;\n  text-shadow: 0px 1px 1px rgba(2, 32, 56, 0.2);\n  background: linear-gradient(135deg, #e3aa77 0%, #f5cda9 38%, #f9ecd3 58%, #fcdbb1 79%, #edb07a 100%);\n  -webkit-background-clip: text;\n  -webkit-text-fill-color: transparent;\n}\n.PagerP1Box .PagerP1TitleBox .close[data-v-57f3bb9e] {\n  font-size: 14px;\n  font-family: MicrosoftYaHei;\n  color: #d2dfff;\n}\n.PagerP1Box .PagerP1AreaBox[data-v-57f3bb9e] {\n  display: flex;\n  height: 292px;\n  background: rgba(24, 39, 76, 0.7);\n}\n.PagerP1Box .PagerP1AreaBox .rightArea .rightAreaBox .rightAreaNav[data-v-57f3bb9e] {\n  border: 1px solid #3768b3;\n  background: rgba(23, 70, 216, 0.3);\n  border: 1px solid;\n  border-image: linear-gradient(180deg, rgb(138, 218, 255), rgba(82, 179, 255, 0)) 1 1;\n  font-size: 12px;\n  font-family: MicrosoftYaHei;\n  color: #44c5fd;\n}\n.PagerP1Box .PagerP1AreaBox .rightArea .rightAreaBox .active[data-v-57f3bb9e] {\n  background: #2647ee;\n  box-shadow: 0 2px 4px 0 rgba(23, 33, 60, 0.5), inset 0 0 4px 0 #00a7ff, inset 0 0 16px 0 rgba(33, 137, 255, 0.4);\n  cursor: pointer;\n  font-size: 12px;\n  font-family: MicrosoftYaHei;\n  color: #ffffff;\n}\n\n/*# sourceMappingURL=index.vue.map */",
    map: {
      version: 3,
      sources: ["E:\\work\\standardization\\mmc-stl-module\\src\\components\\MMCFlightControlCenter\\components\\mount\\PagerP1_New\\index.vue", "index.vue"],
      names: [],
      mappings: "AA8LA;EACA,eAAA;EAEA,UAAA;EACA,WAAA;EACA,sBAAA;EACA,kBAAA;EACA,YAAA;EACA,iBAAA;AC9LA;AD+LA;EACA,YAAA;EACA,iBAAA;EACA,0FAAA;EACA,0CAAA;EACA,gCAAA;EACA,yBAAA;AC7LA;AD8LA;EACA,aAAA;AC5LA;AD6LA;EACA,eAAA;EACA,4BAAA;EACA,cAAA;EACA,iBAAA;EACA,6CAAA;EACA,oGAAA;EAQA,6BAAA;EACA,oCAAA;AClMA;ADqMA;EACA,eAAA;EACA,2BAAA;EACA,cAAA;ACnMA;ADsMA;EACA,aAAA;EAEA,aAAA;EACA,iCAAA;ACrMA;AD8MA;EACA,yBAAA;EACA,kCAAA;EAIA,iBAAA;EACA,oFAAA;EACA,eAAA;EACA,2BAAA;EACA,cAAA;AC/MA;ADiNA;EACA,mBAAA;EACA,gHAAA;EAEA,eAAA;EACA,eAAA;EACA,2BAAA;EACA,cAAA;AChNA;;AAEA,oCAAoC",
      file: "index.vue",
      sourcesContent: ["<template>\r\n  <div class=\"PagerP1Box\" style=\"pointer-events: auto\">\r\n    <div v-interact class=\"PagerP1TitleBox jcsb\">\r\n      <div class=\"left ml8\">\r\n        <img src=\"../assets/images/mount/mount_head.png\" />\r\n        <div class=\"cp\">{{ title }}</div>\r\n      </div>\r\n      <div class=\"cp close mr16\" @click=\"close\">{{ exit }}</div>\r\n    </div>\r\n    <div class=\"PagerP1AreaBox\">\r\n      <div class=\"leftArea\">\r\n        <AngleControl :volume=\"volume\" :rotate=\"angle\" />\r\n      </div>\r\n      <div class=\"rightArea\">\r\n        <div class=\"w329 h231 mt17 rightAreaBox\">\r\n          <div class=\"jcsb h24 tc lh24\">\r\n            <div\r\n              v-for=\"item in ItemList\"\r\n              :key=\"item.id\"\r\n              class=\"w160\"\r\n              :class=\"type == item.name ? 'active' : 'rightAreaNav'\"\r\n              @click=\"type = item.name\"\r\n            >\r\n              {{ item.title }}\r\n            </div>\r\n          </div>\r\n          <div>\r\n            <component :is=\"type\" @playAudio=\"playAudio\" />\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </div>\r\n  </div>\r\n</template>\r\n\r\n<script>\r\nimport MavLink20Processor from './utils/mavlink20_processor';\r\nimport AngleControl from './components/angleControl'; // p1喊话器\r\nimport ItemA from './components/itemA'; // 文字转语音\r\nimport ItemB from './components/itemB'; // 语音广播\r\nimport ItemC from './components/itemC'; // 音频文件\r\n\r\n// 必须引入的核心，换成require也是一样的。注意：recorder-core会自动往window下挂载名称为Recorder对象，全局可调用window.Recorder，也许可自行调整相关源码清除全局污染\r\nimport Recorder from 'recorder-core';\r\nimport { mapGetters } from 'vuex';\r\nconst { VUE_APP_FCMQTT_URL } = process.env;\r\n// 需要使用到的音频格式编码引擎的js文件统统加载进来\r\nimport 'recorder-core/src/engine/mp3';\r\nimport 'recorder-core/src/engine/mp3-engine';\r\nimport 'recorder-core/src/engine/pcm';\r\nimport mqtt from 'mqtt';\r\nexport default {\r\n  // watch: {\r\n  //   'PoliceKeyCode': {\r\n  //     handler(value) {\r\n  //       if(value){\r\n  //         this.key = value;\r\n  //       }\r\n  //       this.init();\r\n  //     },\r\n  //     deep: true,\r\n  //     immediate:true\r\n  //   },\r\n  // },\r\n  components: {\r\n    AngleControl,\r\n    ItemA,\r\n    ItemB,\r\n    ItemC\r\n  },\r\n  props: {\r\n    title: {\r\n      default: '喊话器',\r\n      type: String\r\n    },\r\n    exit: {\r\n      default: '关闭',\r\n      type: String\r\n    },\r\n    PoliceKeyCode: {\r\n      default: 'MMC301R22205057',\r\n      type: String\r\n    }\r\n  },\r\n  data() {\r\n    return {\r\n      type: 'ItemA',\r\n      music: {\r\n        list: []\r\n      },\r\n      // ttsState: null,\r\n      key: 'PoliceF737',\r\n      ItemList: [\r\n        {\r\n          id: 1,\r\n          name: 'ItemA',\r\n          title: '文字转语音'\r\n        },\r\n        {\r\n          id: 2,\r\n          name: 'ItemB',\r\n          title: '语音广播'\r\n        },\r\n        {\r\n          id: 3,\r\n          name: 'ItemC',\r\n          title: '音频文件'\r\n        }\r\n      ],\r\n      mqtt: {\r\n        client: null,\r\n        decoder: null,\r\n        encoder: new TextEncoder()\r\n      },\r\n      ttsState: null,\r\n      recodeState: null,\r\n      volume: 0,\r\n      angle: null,\r\n      ttsCycle: null,\r\n      recodeCycle: null\r\n    };\r\n  },\r\n  provide() {\r\n    return {\r\n      PagerP1: this,\r\n      PoliceKey: () => this.PoliceKeyCode\r\n    };\r\n  },\r\n  computed: {\r\n    ...mapGetters(['user_info'])\r\n  },\r\n  mounted() {\r\n    this.init();\r\n  },\r\n  methods: {\r\n    playAudio(val) {\r\n      this.$emit('playAudio', val);\r\n    },\r\n    init() {\r\n      const url = VUE_APP_FCMQTT_URL;\r\n      // let url = 'ws://200.10.1.245:8883/mqtt'\r\n      console.log('测试开始连接');\r\n      this.mqtt.client = mqtt.connect(url, {\r\n        protocol: 'mqtt',\r\n        clientId: 3587\r\n      });\r\n      this.mqtt.client.on('connect', () => {\r\n        console.log('mqtt is connected');\r\n      });\r\n      this.mqtt.client.on('reconnect', function (reconnect) {\r\n        console.log(reconnect, 'reconnect');\r\n      });\r\n      const key = this.PoliceKeyCode;\r\n      const topic = 'SPEAK/RECEIVE/${key}-01';\r\n      console.log(topic, '链接主题');\r\n      this.subscribe(`SPEAK/RECEIVE/${key}-01`, () => {\r\n        console.log(`订阅无人机数据：topic:${topic}`);\r\n      });\r\n      const music_list = [];\r\n      this.mqtt.client.on('message', (topic, payload, packet) => {\r\n        const data = JSON.parse(packet.payload.toString());\r\n        console.log(data, 'musicdata');\r\n        this.music.list = data.musicList;\r\n        this.ttsState = data.ttsState;\r\n        this.recodeState = data.recodeState;\r\n        this.volume = data.status_info.volume || 0;\r\n        this.angle = data.angle;\r\n        this.ttsCycle = data.ttsCycle;\r\n        this.recodeCycle = data.recodeCycle;\r\n      });\r\n    },\r\n    subscribe(topic, callback) {\r\n      if (!topic) {\r\n        return topic;\r\n      }\r\n      const { client } = this.mqtt;\r\n      if (client) {\r\n        console.log('订阅数据a', topic);\r\n        client.subscribe(topic, callback);\r\n      }\r\n    },\r\n    close() {\r\n      this.$emit('close');\r\n      this.mqtt.client.end();\r\n      this.mqtt.client = null;\r\n    }\r\n  }\r\n};\r\n<\/script>\r\n<style lang=\"scss\" scoped>\r\n.PagerP1Box {\r\n  position: fixed;\r\n  // top: 70px;\r\n  top: 300px;\r\n  right: 70px;\r\n  box-sizing: border-box;\r\n  padding: 10px 20px;\r\n  width: 510px;\r\n  min-height: 296px;\r\n  .PagerP1TitleBox {\r\n    height: 32px;\r\n    line-height: 32px;\r\n    background: linear-gradient(180deg, #9198ff 0%, rgba(45, 81, 153, 0.45) 40%, #05091a 100%);\r\n    box-shadow: inset 0px 0px 10px 2px #3f9dff;\r\n    border-radius: 10px 10px 0px 0px;\r\n    border: 1px solid #427dff;\r\n    .left {\r\n      display: flex;\r\n      .cp {\r\n        font-size: 20px;\r\n        font-family: YouSheBiaoTiHei;\r\n        color: #14faff;\r\n        line-height: 26px;\r\n        text-shadow: 0px 1px 1px rgba(2, 32, 56, 0.2);\r\n        background: linear-gradient(\r\n          135deg,\r\n          #e3aa77 0%,\r\n          #f5cda9 38%,\r\n          #f9ecd3 58%,\r\n          #fcdbb1 79%,\r\n          #edb07a 100%\r\n        );\r\n        -webkit-background-clip: text;\r\n        -webkit-text-fill-color: transparent;\r\n      }\r\n    }\r\n    .close {\r\n      font-size: 14px;\r\n      font-family: MicrosoftYaHei;\r\n      color: #d2dfff;\r\n    }\r\n  }\r\n  .PagerP1AreaBox {\r\n    display: flex;\r\n    // justify-content: space-around;\r\n    height: 292px;\r\n    background: rgba(24, 39, 76, 0.7);\r\n    .leftArea {\r\n      // width: 204px;\r\n    }\r\n    .rightArea {\r\n      // width: calc(100% - 204px);\r\n      // background-color:aquamarine\r\n      .rightAreaBox {\r\n        // border-radius: 4px 4px 0 0;\r\n        .rightAreaNav {\r\n          border: 1px solid #3768b3;\r\n          background: rgba(23, 70, 216, 0.3);\r\n          // box-shadow: 0px 1px 3px 0px rgba(23, 33, 60, 0.5),\r\n          //   inset 0px 0px 10px 0px rgba(33, 137, 255, 0.4),\r\n          //   inset 0px 0px 3px 0px #00a7ff;\r\n          border: 1px solid;\r\n          border-image: linear-gradient(180deg, rgba(138, 218, 255, 1), rgba(82, 179, 255, 0)) 1 1;\r\n          font-size: 12px;\r\n          font-family: MicrosoftYaHei;\r\n          color: #44c5fd;\r\n        }\r\n        .active {\r\n          background: #2647ee;\r\n          box-shadow: 0 2px 4px 0 rgba(23, 33, 60, 0.5), inset 0 0 4px 0 #00a7ff,\r\n            inset 0 0 16px 0 rgba(33, 137, 255, 0.4);\r\n          cursor: pointer;\r\n          font-size: 12px;\r\n          font-family: MicrosoftYaHei;\r\n          color: #ffffff;\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n</style>\r\n", ".PagerP1Box {\n  position: fixed;\n  top: 300px;\n  right: 70px;\n  box-sizing: border-box;\n  padding: 10px 20px;\n  width: 510px;\n  min-height: 296px;\n}\n.PagerP1Box .PagerP1TitleBox {\n  height: 32px;\n  line-height: 32px;\n  background: linear-gradient(180deg, #9198ff 0%, rgba(45, 81, 153, 0.45) 40%, #05091a 100%);\n  box-shadow: inset 0px 0px 10px 2px #3f9dff;\n  border-radius: 10px 10px 0px 0px;\n  border: 1px solid #427dff;\n}\n.PagerP1Box .PagerP1TitleBox .left {\n  display: flex;\n}\n.PagerP1Box .PagerP1TitleBox .left .cp {\n  font-size: 20px;\n  font-family: YouSheBiaoTiHei;\n  color: #14faff;\n  line-height: 26px;\n  text-shadow: 0px 1px 1px rgba(2, 32, 56, 0.2);\n  background: linear-gradient(135deg, #e3aa77 0%, #f5cda9 38%, #f9ecd3 58%, #fcdbb1 79%, #edb07a 100%);\n  -webkit-background-clip: text;\n  -webkit-text-fill-color: transparent;\n}\n.PagerP1Box .PagerP1TitleBox .close {\n  font-size: 14px;\n  font-family: MicrosoftYaHei;\n  color: #d2dfff;\n}\n.PagerP1Box .PagerP1AreaBox {\n  display: flex;\n  height: 292px;\n  background: rgba(24, 39, 76, 0.7);\n}\n.PagerP1Box .PagerP1AreaBox .rightArea .rightAreaBox .rightAreaNav {\n  border: 1px solid #3768b3;\n  background: rgba(23, 70, 216, 0.3);\n  border: 1px solid;\n  border-image: linear-gradient(180deg, rgb(138, 218, 255), rgba(82, 179, 255, 0)) 1 1;\n  font-size: 12px;\n  font-family: MicrosoftYaHei;\n  color: #44c5fd;\n}\n.PagerP1Box .PagerP1AreaBox .rightArea .rightAreaBox .active {\n  background: #2647ee;\n  box-shadow: 0 2px 4px 0 rgba(23, 33, 60, 0.5), inset 0 0 4px 0 #00a7ff, inset 0 0 16px 0 rgba(33, 137, 255, 0.4);\n  cursor: pointer;\n  font-size: 12px;\n  font-family: MicrosoftYaHei;\n  color: #ffffff;\n}\n\n/*# sourceMappingURL=index.vue.map */"]
    },
    media: void 0
  });
}, w, "data-v-57f3bb9e", false, undefined, !1, e);
export { S as default };
