Greasy Fork

Greasy Fork is available in English.

SZU mailbox

在深圳大学校务信箱中添加了评论和回复以及一些辅助的功能

当前为 2021-06-30 提交的版本,查看 最新版本

// ==UserScript==
// @name         SZU mailbox
// @namespace    http://tampermonkey.net/
// @version      1.1.4
// @description  在深圳大学校务信箱中添加了评论和回复以及一些辅助的功能
// @author       nut
// @match        https://www1.szu.edu.cn/mailbox/view.asp*
// @match        https://www1.szu.edu.cn/mailbox/list.asp*
// @match        https://www1.szu.edu.cn/
// @match        https://www1.szu.edu.cn/mailbox/
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js
// @require      https://cdn.jsdelivr.net/npm/[email protected]/lib/index.js
// @run-at       document-body
// ==/UserScript==
! function (t) {
  var e = {};

  function n(i) {
    if (e[i]) return e[i].exports;
    var o = e[i] = {
      i: i,
      l: !1,
      exports: {}
    };
    return t[i].call(o.exports, o, o.exports, n), o.l = !0, o.exports
  }
  n.m = t, n.c = e, n.d = function (t, e, i) {
    n.o(t, e) || Object.defineProperty(t, e, {
      enumerable: !0,
      get: i
    })
  }, n.r = function (t) {
    "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {
      value: "Module"
    }), Object.defineProperty(t, "__esModule", {
      value: !0
    })
  }, n.t = function (t, e) {
    if (1 & e && (t = n(t)), 8 & e) return t;
    if (4 & e && "object" == typeof t && t && t.__esModule) return t;
    var i = Object.create(null);
    if (n.r(i), Object.defineProperty(i, "default", {
        enumerable: !0,
        value: t
      }), 2 & e && "string" != typeof t)
      for (var o in t) n.d(i, o, function (e) {
        return t[e]
      }.bind(null, o));
    return i
  }, n.n = function (t) {
    var e = t && t.__esModule ? function () {
      return t.default
    } : function () {
      return t
    };
    return n.d(e, "a", e), e
  }, n.o = function (t, e) {
    return Object.prototype.hasOwnProperty.call(t, e)
  }, n.p = "", n(n.s = 9)
}([function (t, e, n) {
  "use strict";
  var i, o = function () {
      return void 0 === i && (i = Boolean(window && document && document.all && !window.atob)), i
    },
    s = function () {
      var t = {};
      return function (e) {
        if (void 0 === t[e]) {
          var n = document.querySelector(e);
          if (window.HTMLIFrameElement && n instanceof window.HTMLIFrameElement) try {
            n = n.contentDocument.head
          } catch (t) {
            n = null
          }
          t[e] = n
        }
        return t[e]
      }
    }(),
    r = [];

  function a(t) {
    for (var e = -1, n = 0; n < r.length; n++)
      if (r[n].identifier === t) {
        e = n;
        break
      } return e
  }

  function l(t, e) {
    for (var n = {}, i = [], o = 0; o < t.length; o++) {
      var s = t[o],
        l = e.base ? s[0] + e.base : s[0],
        c = n[l] || 0,
        d = "".concat(l, " ").concat(c);
      n[l] = c + 1;
      var h = a(d),
        p = {
          css: s[1],
          media: s[2],
          sourceMap: s[3]
        }; - 1 !== h ? (r[h].references++, r[h].updater(p)) : r.push({
        identifier: d,
        updater: f(p, e),
        references: 1
      }), i.push(d)
    }
    return i
  }

  function c(t) {
    var e = document.createElement("style"),
      i = t.attributes || {};
    if (void 0 === i.nonce) {
      var o = n.nc;
      o && (i.nonce = o)
    }
    if (Object.keys(i).forEach((function (t) {
        e.setAttribute(t, i[t])
      })), "function" == typeof t.insert) t.insert(e);
    else {
      var r = s(t.insert || "head");
      if (!r) throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
      r.appendChild(e)
    }
    return e
  }
  var d, h = (d = [], function (t, e) {
    return d[t] = e, d.filter(Boolean).join("\n")
  });

  function p(t, e, n, i) {
    var o = n ? "" : i.media ? "@media ".concat(i.media, " {").concat(i.css, "}") : i.css;
    if (t.styleSheet) t.styleSheet.cssText = h(e, o);
    else {
      var s = document.createTextNode(o),
        r = t.childNodes;
      r[e] && t.removeChild(r[e]), r.length ? t.insertBefore(s, r[e]) : t.appendChild(s)
    }
  }

  function u(t, e, n) {
    var i = n.css,
      o = n.media,
      s = n.sourceMap;
    if (o ? t.setAttribute("media", o) : t.removeAttribute("media"), s && "undefined" != typeof btoa && (i += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s)))), " */")), t.styleSheet) t.styleSheet.cssText = i;
    else {
      for (; t.firstChild;) t.removeChild(t.firstChild);
      t.appendChild(document.createTextNode(i))
    }
  }
  var m = null,
    g = 0;

  function f(t, e) {
    var n, i, o;
    if (e.singleton) {
      var s = g++;
      n = m || (m = c(e)), i = p.bind(null, n, s, !1), o = p.bind(null, n, s, !0)
    } else n = c(e), i = u.bind(null, n, e), o = function () {
      ! function (t) {
        if (null === t.parentNode) return !1;
        t.parentNode.removeChild(t)
      }(n)
    };
    return i(t),
      function (e) {
        if (e) {
          if (e.css === t.css && e.media === t.media && e.sourceMap === t.sourceMap) return;
          i(t = e)
        } else o()
      }
  }
  t.exports = function (t, e) {
    (e = e || {}).singleton || "boolean" == typeof e.singleton || (e.singleton = o());
    var n = l(t = t || [], e);
    return function (t) {
      if (t = t || [], "[object Array]" === Object.prototype.toString.call(t)) {
        for (var i = 0; i < n.length; i++) {
          var o = a(n[i]);
          r[o].references--
        }
        for (var s = l(t, e), c = 0; c < n.length; c++) {
          var d = a(n[c]);
          0 === r[d].references && (r[d].updater(), r.splice(d, 1))
        }
        n = s
      }
    }
  }
}, function (t, e, n) {
  "use strict";
  t.exports = function (t) {
    var e = [];
    return e.toString = function () {
      return this.map((function (e) {
        var n = t(e);
        return e[2] ? "@media ".concat(e[2], " {").concat(n, "}") : n
      })).join("")
    }, e.i = function (t, n, i) {
      "string" == typeof t && (t = [
        [null, t, ""]
      ]);
      var o = {};
      if (i)
        for (var s = 0; s < this.length; s++) {
          var r = this[s][0];
          null != r && (o[r] = !0)
        }
      for (var a = 0; a < t.length; a++) {
        var l = [].concat(t[a]);
        i && o[l[0]] || (n && (l[2] ? l[2] = "".concat(n, " and ").concat(l[2]) : l[2] = n), e.push(l))
      }
    }, e
  }
}, function (t, e, n) {
  "use strict";
  var i = n(1),
    o = n.n(i)()((function (t) {
      return t[1]
    }));
  o.push([t.i, "\n.avatar[data-v-2248e212] {\n  margin-top: 5px;\n  width: 32px;\n  height: 32px;\n}\n.iconfont-hover[data-v-2248e212] {\n  color: #95adc5;\n}\n.iconfont-hover[data-v-2248e212]:hover {\n  color: #409EFF;\n}\n.iconfont-after[data-v-2248e212] {\n  color: #409EFF;\n}\n.reply-delete>div[data-v-2248e212]:nth-of-type(2) {\n  visibility: hidden;\n}\n.reply-delete:hover>div[data-v-2248e212]:nth-of-type(2) {\n  visibility: visible;\n}\n", ""]), e.a = o
}, function (t, e, n) {
  "use strict";
  var i = n(1),
    o = n.n(i)()((function (t) {
      return t[1]
    }));
  o.push([t.i, "\n.userName[data-v-7b21d707] {\n  position: relative;\n  right: 4px;\n  width: 84px;\n  font-size: 12px;\n  color: #0b66c0;\n  margin: 7px 0 9px 0;\n}\n.avatar[data-v-7b21d707] {\n  margin-top: 12px;\n  width: 76px;\n  height: 76px;\n}\n.commentContent[data-v-7b21d707] {\n  min-height: 97px;\n}\n.iconfont-hover[data-v-7b21d707] {\n  color: #95adc5;\n}\n.iconfont-hover[data-v-7b21d707]:hover {\n  color: #409EFF;\n}\n.iconfont-after[data-v-7b21d707] {\n  color: #409EFF;\n}\n.comment-delete>div[data-v-7b21d707]:nth-of-type(3) {\n  visibility: hidden;\n}\n.comment-delete:hover>div[data-v-7b21d707]:nth-of-type(3) {\n  visibility: visible;\n}\n", ""]), e.a = o
}, function (t, e, n) {
  "use strict";
  var i = n(1),
    o = n.n(i)()((function (t) {
      return t[1]
    }));
  o.push([t.i, "\n.point-lt[data-v-60235313] {\n  top: -10px;\n  left: -10px;\n  cursor: nw-resize;\n}\n.point-lb[data-v-60235313] {\n  bottom: -10px;\n  left: -10px;\n  cursor: sw-resize;\n}\n.point-rt[data-v-60235313] {\n  top: -10px;\n  right: -10px;\n  cursor: ne-resize;\n}\n.point-rb[data-v-60235313] {\n  bottom: -10px;\n  right: -10px;\n  cursor: se-resize;\n}\n.drag-point[data-v-60235313] {\n  display: inline-block;\n  width: 10px;\n  height: 10px;\n  background-color: #409eff;\n  /* border: 1px solid rgb(0, 17, 255); */\n  position: absolute;\n  -webkit-box-sizing: border-box;\n  box-sizing: border-box;\n}\n.anti-shadow-move[data-v-60235313] {\n  position: absolute;\n  cursor: move;\n}\n.anti-shadow-img[data-v-60235313] {\n  position: absolute;\n}\n.anti-shadow-pic[data-v-60235313] {\n  position: absolute;\n  overflow: hidden;\n}\n.anti-shadow[data-v-60235313] {\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n  position: absolute;\n  z-index: 10;\n  cursor: crosshair;\n}\n.shadow-pic[data-v-60235313] {\n  position: absolute;\n  width: 240px;\n  height: 240px;\n  background-color: rgba(0, 0, 0, .5);\n}\n.view-img[data-v-60235313] {\n  position: absolute;\n}\n.view-pic[data-v-60235313] {\n  width: 190px;\n  height: 190px;\n  position: absolute;\n  overflow: hidden;\n}\n.picView[data-v-60235313] {\n  display: inline-flex;\n  width: 200px;\n  height: 200px;\n  border-radius: 5px;\n  border: 2px solid #c4c4c4;\n  text-align: center;\n  justify-content: center;\n  align-items: center;\n}\n.picBox[data-v-60235313] {\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n  display: inline-flex;\n  width: 250px;\n  height: 250px;\n  border-radius: 5px;\n  border: 2px solid #c4c4c4;\n  text-align: center;\n  justify-content: center;\n  align-items: center;\n  cursor: pointer;\n}\n.picBox[data-v-60235313]:hover,\n.picView[data-v-60235313]:hover {\n  border: 2px solid #409eff;\n}\n", ""]), e.a = o
}, function (t, e, n) {
  "use strict";
  var i = n(1),
    o = n.n(i)()((function (t) {
      return t[1]
    }));
  o.push([t.i, "\n.msgBox[data-v-527e7582] {\n  height: 335px;\n  width: 310px;\n}\n.scrollBox[data-v-527e7582] {\n  height: 260px;\n  overflow: scroll;\n}\n.avatar[data-v-527e7582] {\n  width: 32px;\n  height: 32px;\n}\n.scrollBox[data-v-527e7582]::-webkit-scrollbar {\n  /*滚动条整体样式*/\n  width: 5px;\n  /*高宽分别对应横竖滚动条的尺寸*/\n  height: 1px;\n}\n.scrollBox[data-v-527e7582]::-webkit-scrollbar-thumb {\n  /*滚动条里面小方块*/\n  border-radius: 10px;\n  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);\n  background: #bebebe;\n}\n.scrollBox[data-v-527e7582]::-webkit-scrollbar-track {\n  /*滚动条里面轨道*/\n  box-shadow: inset 0 0 5px rgba(175, 175, 175, 0.534);\n  border-radius: 10px;\n  background: #ffffff;\n}\n.msg-loging[data-v-527e7582] {\n  text-align: center;\n  font-size: 14px;\n  color: #868686;\n}\n.msgfade-enter-active[data-v-527e7582],\n.msgfade-leave-active[data-v-527e7582] {\n  transition: opacity .2s;\n}\n.msgfade-enter[data-v-527e7582],\n.msgfade-leave-to[data-v-527e7582] {\n  opacity: 0;\n}\n", ""]), e.a = o
}, function (t, e, n) {
  "use strict";
  var i = n(1),
    o = n.n(i)()((function (t) {
      return t[1]
    }));
  o.push([t.i, "\n.sidebar[data-v-12898b5e] {\n  top: 225px;\n  left: 0;\n  position: fixed;\n  /* z-index: 2022; */\n  z-index: 2000;\n}\n.sidebar[data-v-12898b5e] .el-tooltip {\n  line-height: 24px;\n}\n", ""]), e.a = o
}, function (t, e, n) {
  "use strict";
  var i = n(1),
    o = n.n(i)()((function (t) {
      return t[1]
    }));
  o.push([t.i, "\nbody {\n  overflow-y: scroll;\n}\n.el-tooltip__popper span {\n  color: #ffffff;\n  font-size: 12px;\n  line-height: 100%;\n}\n.el-message-box__btns span {\n  color: #000000;\n  font-size: 12px;\n  line-height: 100%;\n}\n.buttonSelect span {\n  color: #fff;\n  font-family: 微软雅黑;\n  font-size: 14px;\n  line-height: 100%;\n}\n.text-buttonSelect span {\n  color: #409eff;\n  font-family: 微软雅黑;\n  font-size: 14px;\n  line-height: 100%;\n}\n.text-buttonSelect:hover span {\n  color: #7cbbff;\n}\n.text-buttonSelect:active span {\n  color: #006dda;\n}\n.text-dangerous-buttonSelect span {\n  color: #f56c6c;\n  font-family: 微软雅黑;\n  font-size: 14px;\n  line-height: 100%;\n}\n.text-dangerous-buttonSelect:active span {\n  color: #d33d3d;\n}\n.text-buttonSelect-mini span {\n  color: #409eff;\n  font-family: 微软雅黑;\n  font-size: 12px;\n  line-height: 100%;\n}\n.text-buttonSelect-mini span:hover {\n  color: #7cbbff;\n}\n.text-buttonSelect-mini:active span {\n  color: #006dda;\n}\n.text-link>a:hover {\n  text-decoration: none;\n}\n.text-link span {\n  color: #409eff;\n  font-family: 微软雅黑;\n  font-size: 14px;\n  line-height: 1.4;\n}\n.text-link span:hover {\n  color: #7cbbff;\n}\n.navfade-enter-active,\n.navfade-leave-active {\n  transition: opacity 0.8s;\n}\n.navfade-enter,\n.navfade-leave-to {\n  opacity: 0;\n}\n", ""]), e.a = o
}, function (t, e) {
  t.exports = Vue
}, function (t, e, n) {
  "use strict";
  n.r(e);
  var i = {
      getQueryVariable(t) {
        const e = window.location.search.substring(1).split("&");
        for (let n = 0; n < e.length; n++) {
          const i = e[n].split("=");
          if (i[0] == t) return i[1]
        }
        return !1
      },
      getPostID() {
        const t = document.querySelector("body > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(3) > td > table > tbody > tr:nth-child(1) > td > table > tbody > tr > td:nth-child(1) > a:nth-child(2)").search.substring(1).split("&");
        for (let e = 0; e < t.length; e++) {
          const n = t[e].split("=");
          if ("id" == n[0]) return n[1]
        }
        return !1
      },
      loadInit() {
        const t = document.createElement("link");
        t.rel = "stylesheet", t.type = "text/css", t.href = "https://cdn.jsdelivr.net/npm/[email protected]/lib/theme-chalk/index.min.css", t.media = "all", document.head.appendChild(t);
        const e = document.createElement("meta");
        e.content = "no-referrer", e.name = "referrer", document.head.appendChild(e);
        let n = document.getElementById("testVueToTamper") || document.querySelector("body > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(3) > td > table > tbody > tr:nth-child(2) > td");
        this.getQueryVariable("id") || (n = document.body);
        const i = document.createElement("div");
        i.id = "app", n.append(i)
      },
      getLength(t) {
        const e = document.getElementById("textLength");
        e.textContent = t;
        const n = e.clientWidth;
        return e.textContent = "", 23 * Math.ceil(n / 664)
      },
      getLength14Size(t) {
        const e = document.getElementById("textLength");
        e.textContent = t;
        const n = e.clientWidth;
        return e.textContent = "", n
      },
      getASPSESSION() {
        let t = document.cookie.split("; "),
          e = "null",
          n = !0;
        for (let i = 0; i < t.length; i++) - 1 !== t[i].indexOf("ASPSESSION") && (n ? (e = t[i], n = !1) : e += "---" + t[i]);
        return e
      },
      async httpJsonMethod(t, e, n) {
        e = "https://mailbox.nutvii.top/" + e;
        const i = new XMLHttpRequest;
        i.withCredentials = !0;
        let o = "",
          s = !0;
        for (const e in n) s ? (s = !1, "GET" != t && "DELETE" != t || (o += "?"), o += e + "=" + n[e]) : o += "&" + e + "=" + n[e];
        return "GET" == t || "DELETE" == t ? (i.open(t, e + o), i.send(null)) : "POST" == t && (i.open(t, e), i.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), i.send(o)), new Promise((t, e) => {
          i.onload = () => {
            200 == i.status ? t(JSON.parse(i.responseText)) : e(i.responseText)
          }
        })
      },
      async httpHtmlMethod(t, e, n, i) {
        const o = new XMLHttpRequest;
        o.withCredentials = !0;
        let s = "",
          r = !0;
        for (const e in n) r ? (r = !1, "GET" != t && "DELETE" != t || (s += "?"), s += e + "=" + n[e]) : s += "&" + e + "=" + n[e];
        return "GET" == t || "DELETE" == t ? (o.open(t, e + s), null != i && o.overrideMimeType("text/html;charset=" + i), o.send(null)) : "POST" == t && (o.open(t, e), o.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), o.send(s)), new Promise((t, e) => {
          o.onload = () => {
            200 == o.status ? t(o.responseText) : e(o.responseText)
          }
        })
      }
    },
    o = n(8),
    s = n.n(o),
    r = function () {
      var t = this.$createElement,
        e = this._self._c || t;
      return e("div", {
        staticStyle: {
          width: "960px",
          margin: "0 auto"
        }
      }, [e("transition", {
        attrs: {
          name: "navfade"
        }
      }, [e("SideBar", {
        directives: [{
          name: "show",
          rawName: "v-show",
          value: this.navOut,
          expression: "navOut"
        }]
      })], 1), this._v(" "), 1 == this.showURL ? e("Comment") : this._e(), this._v(" "), e("div", {
        staticStyle: {
          "font-family": "Microsoft Yahei",
          "white-space": "normal",
          position: "fixed",
          "z-index": "-1",
          bottom: "0",
          opacity: "0",
          height: "0",
          "font-size": "14px"
        },
        attrs: {
          id: "textLength"
        }
      })], 1)
    };
  r._withStripped = !0;
  var a = function () {
    var t = this,
      e = t.$createElement,
      n = t._self._c || e;
    return n("div", {
      staticStyle: {
        width: "960px"
      }
    }, [0 != t.$root.POSTID ? n("el-main", {
      staticClass: "my_table",
      staticStyle: {
        width: "90%",
        padding: "0"
      }
    }, [n("el-table", {
      directives: [{
        name: "loading",
        rawName: "v-loading",
        value: t.loading,
        expression: "loading"
      }],
      attrs: {
        "header-cell-style": t.headerStyle,
        stripe: !1,
        data: t.comment,
        "cell-style": t.columnStyle
      }
    }, [n("el-table-column", {
      attrs: {
        align: "center",
        label: "评论:" + t.total,
        width: "96"
      },
      scopedSlots: t._u([{
        key: "default",
        fn: function (e) {
          return [n("el-col", [n("el-image", {
            staticClass: "avatar",
            attrs: {
              src: e.row.creator.avatar || t.$root.NULLAVATAR,
              fit: "cover",
              lazy: ""
            }
          })], 1), t._v(" "), n("el-col", {
            staticClass: "userName"
          }, [t._v(t._s(e.row.creator.user))])]
        }
      }], null, !1, 2774389383)
    }), t._v(" "), n("el-table-column", {
      attrs: {
        label: "content"
      },
      scopedSlots: t._u([{
        key: "header",
        fn: function (e) {
          return [n("el-row", {
            attrs: {
              type: "flex",
              align: "middle"
            }
          }, [n("el-col", {
            attrs: {
              span: 18
            }
          }), t._v(" "), n("el-col", {
            attrs: {
              span: 3
            }
          }, [n("el-button", {
            staticClass: "buttonSelect",
            attrs: {
              size: "small",
              type: "primary"
            },
            on: {
              click: function (e) {
                return t.postComment()
              }
            }
          }, [t._v("评论")])], 1), t._v(" "), n("el-col", {
            attrs: {
              span: 3
            }
          }, [n("el-button", {
            staticClass: "buttonSelect",
            attrs: {
              size: "small",
              type: "primary"
            },
            on: {
              click: function (e) {
                return t.getComment()
              }
            }
          }, [t._v("刷新")])], 1), t._v(" "), n("el-col", {
            attrs: {
              span: 3
            }
          }, [n("el-button", {
            staticClass: "buttonSelect",
            attrs: {
              size: "small",
              disabled: !0,
              type: "primary"
            },
            on: {
              click: function (n) {
                return t.sortComment(e.$index, e.row)
              }
            }
          }, [t._v("\n                按时间:\n                " + t._s("id" == t.sort ? "旧" : "新"))])], 1)], 1)]
        }
      }, {
        key: "default",
        fn: function (e) {
          return [n("div", {
            staticClass: "commentContent"
          }, [t._v(t._s(e.row.content))]), t._v(" "), n("el-row", {
            staticClass: "comment-delete",
            attrs: {
              type: "flex",
              align: "middle"
            }
          }, [n("el-col", {
            attrs: {
              span: 2
            }
          }, [n("div", {
            staticStyle: {
              "min-width": "27px"
            }
          }, [t._v("\n                " + t._s(e.row.level + "楼") + "\n              ")])]), t._v(" "), n("el-col", {
            attrs: {
              span: 17
            }
          }, [t._v("\n              " + t._s(e.row.time.substring(0, 10)) + "\n              " + t._s(e.row.time.substring(11, 16)) + "\n            ")]), t._v(" "), n("el-col", {
            attrs: {
              span: 2
            }
          }, [n("el-row", {
            attrs: {
              type: "flex",
              justify: "center",
              align: "middle"
            }
          }, [t.$root.UUID == e.row.creator.uuid ? n("el-button", {
            staticClass: "text-dangerous-buttonSelect",
            attrs: {
              size: "mini",
              type: "text"
            },
            on: {
              click: function (n) {
                return t.deleteComment(e.row.id, e.$index)
              }
            }
          }, [t._v("\n                  删除\n                ")]) : t._e()], 1)], 1), t._v(" "), n("el-col", {
            attrs: {
              span: 2
            }
          }, [n("el-button", {
            staticStyle: {
              padding: "0"
            },
            attrs: {
              size: "mini",
              type: "text"
            },
            on: {
              click: function (n) {
                return t.likeIt(e.row.id, e.$index)
              }
            }
          }, [e.row.isLike ? n("i", {
            staticClass: "iconfont icon0_like2 iconfont-after",
            staticStyle: {
              "font-size": "22px"
            }
          }) : n("i", {
            staticClass: "iconfont icon0_like1 iconfont-hover",
            staticStyle: {
              "font-size": "22px"
            }
          }), t._v(" "), n("font", {
            staticStyle: {
              "font-size": "12px",
              position: "relative",
              top: "-2px",
              color: "#aaaaaa"
            }
          }, [t._v(t._s(e.row.like))])], 1)], 1), t._v(" "), n("el-col", {
            attrs: {
              span: 3
            }
          }, [n("el-badge", {
            attrs: {
              hidden: !e.row.replies.total,
              value: e.row.replies.total,
              type: "primary"
            }
          }, [n("el-button", {
            staticClass: "buttonSelect",
            attrs: {
              size: "mini",
              type: "primary"
            },
            on: {
              click: function (n) {
                return t.popReply(e.$index)
              }
            }
          }, [t._v("回复\n                ")])], 1)], 1)], 1), t._v(" "), n("el-row", [n("Reply", {
            attrs: {
              limit: t.limit,
              commentObj: e.row
            }
          })], 1)]
        }
      }], null, !1, 2835275137)
    })], 1), t._v(" "), n("el-pagination", {
      staticStyle: {
        "text-align": "center",
        margin: "10px 0 10px 0"
      },
      attrs: {
        background: "",
        layout: "prev, pager, next",
        total: t.total,
        "current-page": t.currentPage,
        "page-size": t.limit
      },
      on: {
        "update:currentPage": function (e) {
          t.currentPage = e
        },
        "update:current-page": function (e) {
          t.currentPage = e
        },
        "current-change": function (e) {
          return t.getComment()
        }
      }
    }), t._v(" "), n("el-card", [n("el-row", {
      staticStyle: {
        "margin-bottom": "10px"
      }
    }, [n("el-input", {
      attrs: {
        type: "textarea",
        autosize: {
          minRows: 3
        },
        placeholder: "请写下你的评论"
      },
      model: {
        value: t.content,
        callback: function (e) {
          t.content = e
        },
        expression: "content"
      }
    })], 1), t._v(" "), n("el-row", {
      attrs: {
        type: "flex",
        align: "middle"
      }
    }, [n("el-col", {
      attrs: {
        span: 2,
        offset: 20
      }
    }, [n("el-checkbox", {
      model: {
        value: t.isAnonymous,
        callback: function (e) {
          t.isAnonymous = e
        },
        expression: "isAnonymous"
      }
    }, [t._v("匿名")])], 1), t._v(" "), n("el-col", {
      attrs: {
        span: 2
      }
    }, [n("el-button", {
      staticClass: "buttonSelect",
      attrs: {
        size: "mini",
        type: "primary"
      },
      on: {
        click: function (e) {
          return t.commentSubmit()
        }
      }
    }, [t._v("发送")])], 1)], 1), t._v(" "), n("div", {
      staticStyle: {
        position: "relative",
        top: "76px"
      },
      attrs: {
        id: "commentEdit"
      }
    })], 1)], 1) : t._e()], 1)
  };
  a._withStripped = !0;
  var l = function () {
    var t = this,
      e = t.$createElement,
      n = t._self._c || e;
    return n("el-collapse-transition", [n("div", {
      directives: [{
        name: "show",
        rawName: "v-show",
        value: t.commentObj.reply.showReply,
        expression: "commentObj.reply.showReply"
      }],
      staticStyle: {
        "margin-top": "10px"
      }
    }, [n("el-table", {
      directives: [{
        name: "loading",
        rawName: "v-loading",
        value: t.commentObj.reply.loading,
        expression: "commentObj.reply.loading"
      }],
      attrs: {
        data: t.commentObj.replies.replies,
        "show-header": !1,
        "cell-style": t.replycolumnStyle
      }
    }, [n("el-table-column", {
      attrs: {
        align: "center",
        width: "52",
        label: "head"
      },
      scopedSlots: t._u([{
        key: "default",
        fn: function (e) {
          return [n("el-image", {
            staticClass: "avatar",
            attrs: {
              src: e.row.creator.avatar || t.$root.NULLAVATAR,
              fit: "cover",
              lazy: ""
            }
          })]
        }
      }])
    }), t._v(" "), n("el-table-column", {
      attrs: {
        label: "content"
      },
      scopedSlots: t._u([{
        key: "default",
        fn: function (e) {
          return [n("el-row", {
            style: "height:" + e.row.height + "px"
          }, [n("font", {
            staticStyle: {
              color: "#0b66c0"
            }
          }, [t._v(t._s(e.row.creator.user))]), t._v(t._s(": ") + "\n            "), e.row.replied ? n("font", [t._v("\n              @"), n("font", {
            staticStyle: {
              color: "#0b66c0"
            }
          }, [t._v(t._s(e.row.replied.user))]), t._v(t._s(": ") + "\n            ")], 1) : t._e(), t._v("\n            " + t._s(e.row.content) + "\n          ")], 1), t._v(" "), n("el-row", {
            staticClass: "reply-delete",
            staticStyle: {
              height: "23px"
            },
            attrs: {
              type: "flex",
              align: "middle",
              justify: "end"
            }
          }, [n("el-col", {
            attrs: {
              span: 16
            }
          }, [n("div", {
            staticStyle: {
              "min-width": "27px"
            }
          }, [t._v("\n                " + t._s(e.row.level + "层") + "\n              ")])]), t._v(" "), n("el-col", {
            attrs: {
              span: 1
            }
          }, [n("el-row", {
            staticStyle: {
              position: "relation",
              left: "10px"
            },
            attrs: {
              type: "flex",
              justify: "center",
              align: "middle"
            }
          }, [t.$root.UUID == e.row.creator.uuid ? n("el-button", {
            staticClass: "text-dangerous-buttonSelect",
            staticStyle: {
              padding: "0",
              "margin-bottom": "2px"
            },
            attrs: {
              type: "text"
            },
            on: {
              click: function (n) {
                return t.deleteReply(e.row.id, e.$index)
              }
            }
          }, [t._v(" 删除\n                ")]) : t._e()], 1)], 1), t._v(" "), n("el-col", {
            staticStyle: {
              "font-family": "Avenir, Helvetica, Arial, sans-serif"
            },
            attrs: {
              span: 6
            }
          }, [n("el-row", {
            attrs: {
              type: "flex",
              justify: "center",
              align: "middle"
            }
          }, [n("div", {
            staticStyle: {
              "margin-left": "10px"
            }
          }, [t._v("\n                  " + t._s(e.row.time.substring(0, 10)) + "\n                  " + t._s(e.row.time.substring(11, 16)) + "\n                ")])])], 1), t._v(" "), n("el-col", {
            attrs: {
              span: 2
            }
          }, [n("el-button", {
            staticStyle: {
              padding: "0"
            },
            attrs: {
              size: "mini",
              type: "text"
            },
            on: {
              click: function (n) {
                return t.likeIt(e.row.id, e.$index)
              }
            }
          }, [e.row.isLike ? n("i", {
            staticClass: "iconfont icon0_like2 iconfont-after",
            staticStyle: {
              "font-size": "16px"
            }
          }) : n("i", {
            staticClass: "iconfont icon0_like1 iconfont-hover",
            staticStyle: {
              "font-size": "16px"
            }
          }), t._v(" "), n("font", {
            staticStyle: {
              "font-size": "12px",
              position: "relative",
              top: "-1px",
              color: "#aaaaaa"
            }
          }, [t._v(t._s(e.row.like))])], 1)], 1), t._v(" "), n("el-col", {
            attrs: {
              span: 2
            }
          }, [n("el-button", {
            staticClass: "text-buttonSelect",
            staticStyle: {
              padding: "0",
              "margin-bottom": "2px"
            },
            attrs: {
              type: "text"
            },
            on: {
              click: function (n) {
                return t.postReply(e.row.level, e.row.creator.user, e.row.id)
              }
            }
          }, [t._v("回复\n              ")])], 1)], 1)]
        }
      }])
    })], 1), t._v(" "), n("el-row", {
      attrs: {
        type: "flex",
        align: "middle",
        justify: "end"
      }
    }, [n("el-col", [0 != t.commentObj.replies.total ? n("el-pagination", {
      attrs: {
        small: "",
        layout: "prev, pager, next",
        total: t.commentObj.replies.total,
        "current-page": t.commentObj.reply.currentPage,
        "page-size": t.limit
      },
      on: {
        "update:currentPage": function (e) {
          return t.$set(t.commentObj.reply, "currentPage", e)
        },
        "update:current-page": function (e) {
          return t.$set(t.commentObj.reply, "currentPage", e)
        },
        "current-change": function (e) {
          return t.getReply()
        }
      }
    }) : t._e()], 1), t._v(" "), n("el-col", {
      attrs: {
        span: 3
      }
    }, [n("el-button", {
      staticClass: "text-buttonSelect",
      staticStyle: {
        padding: "0"
      },
      attrs: {
        type: "text"
      },
      on: {
        click: function (e) {
          return t.postReply(0, t.commentObj.creator.user, t.commentObj.id)
        }
      }
    }, [t._v("\n          回复楼主\n        ")])], 1)], 1), t._v(" "), n("el-collapse-transition", [n("el-card", {
      directives: [{
        name: "show",
        rawName: "v-show",
        value: t.commentObj.reply.showInput,
        expression: "commentObj.reply.showInput"
      }]
    }, [n("el-row", {
      staticStyle: {
        "margin-bottom": "10px"
      }
    }, [n("el-input", {
      attrs: {
        placeholder: "请写下你的回复"
      },
      model: {
        value: t.commentObj.reply.content,
        callback: function (e) {
          t.$set(t.commentObj.reply, "content", e)
        },
        expression: "commentObj.reply.content"
      }
    }, [t.commentObj.reply.number ? n("template", {
      slot: "prepend"
    }, [t._v(t._s("@" + t.commentObj.reply.repliedUser))]) : t._e()], 2)], 1), t._v(" "), n("el-row", {
      attrs: {
        type: "flex",
        align: "middle"
      }
    }, [n("el-col", {
      attrs: {
        span: 3,
        offset: 18
      }
    }, [n("el-checkbox", {
      model: {
        value: t.commentObj.reply.isAnonymous,
        callback: function (e) {
          t.$set(t.commentObj.reply, "isAnonymous", e)
        },
        expression: "commentObj.reply.isAnonymous"
      }
    }, [t._v("匿名")])], 1), t._v(" "), n("el-col", {
      attrs: {
        span: 2
      }
    }, [n("el-button", {
      staticClass: "buttonSelect",
      attrs: {
        size: "mini",
        type: "primary"
      },
      on: {
        click: function (e) {
          return t.replySubmit()
        }
      }
    }, [t._v("\n              发送\n            ")])], 1)], 1)], 1)], 1)], 1)])
  };
  l._withStripped = !0;
  var c = {
      props: {
        limit: Number,
        commentObj: Object
      },
      mounted() {
        let t = setInterval(() => {
          -1 != this.$root.UUID && clearInterval(t)
        }, 250)
      },
      methods: {
        likeIt(t, e) {
          let n = this.commentObj.replies.replies[e].isLike;
          n ? i.httpJsonMethod("POST", "cancelike/", {
            id: t,
            type: "reply"
          }).then(() => {
            this.commentObj.replies.replies[e].like--, this.commentObj.replies.replies[e].isLike = !n
          }).catch(t => {
            this.$message.error(t)
          }) : i.httpJsonMethod("POST", "addlike/", {
            id: t,
            type: "reply"
          }).then(() => {
            this.commentObj.replies.replies[e].like++, this.commentObj.replies.replies[e].isLike = !n
          }).catch(t => {
            this.$message.error(t)
          })
        },
        getReply() {
          this.commentObj.reply.loading = !0, i.httpJsonMethod("GET", "reply/", {
            commentId: this.commentObj.id,
            limit: this.limit,
            offset: this.commentObj.reply.currentPage
          }).then(t => {
            for (let e = 0; e < t.length; e++) {
              if ("replies" == e)
                for (let n = 0; n < t[e].length; n++) {
                  let o = t[e][n].creator.user + " :  ";
                  o += (t[e][n].replied ? "@" + t[e][n].replied.user + " : " : "") + t[e][n].content, this.$set(t[e][n], "height", i.getLength(o))
                }
              this.commentObj.replies[e] = t[e]
            }
            this.commentObj.reply.loading = !1
          }).catch(t => {
            this.$message.error(t)
          })
        },
        postReply(t, e, n) {
          this.commentObj.reply.showInput && t == this.commentObj.reply.number ? this.commentObj.reply.showInput = !1 : this.commentObj.reply.showInput = !0, this.commentObj.reply.number = t, this.commentObj.reply.repliedUser = e, this.commentObj.reply.repliedId = n
        },
        replySubmit() {
          if (this.commentObj.reply.content.length >= 2) {
            let t = {
              content: this.commentObj.reply.content,
              isAnonymous: this.commentObj.reply.isAnonymous ? 1 : 0
            };
            0 == this.commentObj.reply.number ? t.commentId = this.commentObj.reply.commentId : t.repliedId = this.commentObj.reply.repliedId, i.httpJsonMethod("POST", "reply/", t).then(t => {
              if (this.$message.success("回复成功"), this.commentObj.replies.total++, Math.ceil(this.commentObj.replies.total / 10) > this.commentObj.reply.currentPage) this.commentObj.reply.currentPage = Math.ceil(this.commentObj.replies.total / 10), this.getReply();
              else {
                let e = t.creator.user + " :  ";
                e += (t.replied ? "@" + t.replied.user + " : " : "") + t.content, this.$set(t, "height", i.getLength(e)), this.commentObj.replies.replies.push(t)
              }
              this.commentObj.reply.content = "", this.content = ""
            }).catch(t => {
              this.$message.error(t)
            })
          } else this.$message.error("字数少于2")
        },
        deleteReply(t, e) {
          this.$confirm("确认删除?", "提示", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          }).then(() => {
            i.httpJsonMethod("DELETE", "reply/", {
              id: t
            }).then(t => {
              this.$message.success("删除成功"), this.commentObj.replies.replies.splice(e, 1), this.commentObj.replies.total--
            }).catch(t => {
              this.$message.error(t)
            })
          })
        },
        replycolumnStyle: () => "background:#f5f6f7;vertical-align:top;padding:5px;"
      }
    },
    d = n(0),
    h = n.n(d),
    p = n(2),
    u = {
      insert: "head",
      singleton: !1
    };
  h()(p.a, u), p.a.locals;

  function m(t, e, n, i, o, s, r, a) {
    var l, c = "function" == typeof t ? t.options : t;
    if (e && (c.render = e, c.staticRenderFns = n, c._compiled = !0), i && (c.functional = !0), s && (c._scopeId = "data-v-" + s), r ? (l = function (t) {
        (t = t || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) || "undefined" == typeof __VUE_SSR_CONTEXT__ || (t = __VUE_SSR_CONTEXT__), o && o.call(this, t), t && t._registeredComponents && t._registeredComponents.add(r)
      }, c._ssrRegister = l) : o && (l = a ? function () {
        o.call(this, (c.functional ? this.parent : this).$root.$options.shadowRoot)
      } : o), l)
      if (c.functional) {
        c._injectStyles = l;
        var d = c.render;
        c.render = function (t, e) {
          return l.call(e), d(t, e)
        }
      } else {
        var h = c.beforeCreate;
        c.beforeCreate = h ? [].concat(h, l) : [l]
      } return {
      exports: t,
      options: c
    }
  }
  var g = m(c, l, [], !1, null, "2248e212", null);
  g.options.__file = "src/views/Forum/Reply.vue";
  var f = {
      components: {
        Reply: g.exports
      },
      data: () => ({
        loading: !0,
        currentPage: 1,
        total: 0,
        limit: 10,
        comment: [],
        sort: "id",
        input: "",
        content: "",
        isAnonymous: 0
      }),
      mounted() {
        let t = setInterval(() => {
          -1 != this.$root.UUID && (clearInterval(t), this.getComment())
        }, 250)
      },
      methods: {
        likeIt(t, e) {
          let n = this.comment[e].isLike;
          n ? i.httpJsonMethod("POST", "cancelike/", {
            id: t,
            type: "comment"
          }).then(() => {
            this.comment[e].like--, this.comment[e].isLike = !n
          }).catch(t => {
            this.$message.error(t)
          }) : i.httpJsonMethod("POST", "addlike/", {
            id: t,
            type: "comment"
          }).then(() => {
            this.comment[e].like++, this.comment[e].isLike = !n
          }).catch(t => {
            this.$message.error(t)
          })
        },
        getComment() {
          this.loading = !0, i.httpJsonMethod("GET", "comment/", {
            postId: this.$root.POSTID,
            limit: this.limit,
            offset: this.currentPage
          }).then(t => {
            this.comment = t.comments;
            for (let t = 0; t < this.comment.length; t++) {
              this.$set(this.comment[t], "reply", {
                commentId: this.comment[t].id,
                content: "",
                number: 0,
                repliedId: this.comment[t].id,
                isAnonymous: 0,
                repliedUser: "",
                showReply: !1,
                showInput: !1,
                loading: !1,
                currentPage: 1
              });
              const e = this.comment[t].replies.replies;
              for (let t = 0; t < e.length; t++) {
                let n = e[t].creator.user + " :  ";
                n += (e[t].replied ? "@" + e[t].replied.user + " : " : "") + e[t].content, this.$set(e[t], "height", i.getLength(n))
              }
              this.comment[t].reply.showReply = 0 != this.comment[t].replies.total
            }
            this.total = t.total, this.loading = !1
          }).catch(t => {
            this.$message.error(t)
          })
        },
        postComment() {
          document.getElementById("commentEdit").scrollIntoView({
            block: "end",
            behavior: "smooth"
          })
        },
        commentSubmit() {
          this.content.length >= 2 ? i.httpJsonMethod("POST", "comment/", {
            postId: this.$root.POSTID,
            content: this.content,
            isAnonymous: this.isAnonymous ? 1 : 0
          }).then(t => {
            this.$message.success("评论成功"), this.total++, Math.ceil(this.total / 10) > this.currentPage ? (this.currentPage = Math.ceil(this.total / 10), this.getComment()) : (this.$set(t, "reply", {
              commentId: t.id,
              content: "",
              number: 0,
              repliedId: t.id,
              isAnonymous: 0,
              repliedUser: "",
              showReply: !1,
              showInput: !1,
              loading: !1,
              currentPage: 1
            }), this.comment.push(t)), this.content = ""
          }).catch(t => {
            this.$message.error(t)
          }) : this.$message.error("字数少于2")
        },
        deleteComment(t, e) {
          this.$confirm("确认删除?", "提示", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          }).then(() => {
            i.httpJsonMethod("DELETE", "comment/", {
              id: t
            }).then(t => {
              this.$message.success("删除成功"), this.comment.splice(e, 1), this.total--
            }).catch(t => {
              this.$message.error(t)
            })
          })
        },
        popReply(t) {
          this.comment[t].reply.showReply = !this.comment[t].reply.showReply
        },
        sortComment(t, e) {
          this.sort = "id" == this.sort ? "-id" : "id", this.$set(this.comment, t, e), this.getComment()
        },
        columnStyle: ({
          columnIndex: t
        }) => 0 == t ? "background:#cddade;vertical-align:top;" : "background:#fff;vertical-align:top;",
        headerStyle({
          columnIndex: t
        }) {
          if (0 == t) return "background:#ebeef5;font-size: 14px;"
        }
      }
    },
    v = n(3),
    b = {
      insert: "head",
      singleton: !1
    },
    y = (h()(v.a, b), v.a.locals, m(f, a, [], !1, null, "7b21d707", null));
  y.options.__file = "src/views/Forum/Comment.vue";
  var x = y.exports,
    w = function () {
      var t = this,
        e = t.$createElement,
        n = t._self._c || e;
      return n("div", [n("div", {
        staticClass: "sidebar"
      }, [n("el-menu", {
        attrs: {
          "default-active": t.active,
          collapse: !0
        },
        on: {
          select: t.selectIcon
        }
      }, [n("el-popover", {
        attrs: {
          placement: "right-start"
        }
      }, [t.popoverVisible && t.$root.UUID ? n("MessageBox") : t._e(), t._v(" "), n("el-menu-item", {
        attrs: {
          slot: "reference",
          index: "1"
        },
        slot: "reference"
      }, [n("el-badge", {
        staticStyle: {
          top: "16px"
        },
        attrs: {
          hidden: !(t.$root.MESSAGE + t.$root.LIKE),
          value: t.$root.MESSAGE + t.$root.LIKE,
          max: 99
        }
      }, [n("el-image", {
        staticStyle: {
          width: "24px",
          height: "24px"
        },
        attrs: {
          src: t.$root.AVATAR || t.$root.NULLAVATAR
        }
      })], 1), t._v(" "), n("span", {
        attrs: {
          slot: "title"
        },
        slot: "title"
      }, [t._v(t._s(t.$root.NICKNAME))])], 1)], 1), t._v(" "), n("el-menu-item", {
        attrs: {
          index: "2"
        }
      }, [n("i", {
        staticClass: "el-icon-edit-outline",
        staticStyle: {
          position: "relative",
          top: "16px"
        }
      }), t._v(" "), n("span", {
        attrs: {
          slot: "title"
        },
        slot: "title"
      }, [t._v("修改昵称")])]), t._v(" "), n("el-menu-item", {
        attrs: {
          index: "3"
        }
      }, [n("i", {
        staticClass: "el-icon-picture-outline",
        staticStyle: {
          position: "relative",
          top: "16px"
        }
      }), t._v(" "), n("span", {
        attrs: {
          slot: "title"
        },
        slot: "title"
      }, [t._v("修改头像")])]), t._v(" "), n("el-menu-item", {
        attrs: {
          index: "4"
        }
      }, [n("i", {
        staticClass: "el-icon-warning-outline",
        staticStyle: {
          position: "relative",
          top: "16px"
        }
      }), t._v(" "), n("span", {
        attrs: {
          slot: "title"
        },
        slot: "title"
      }, [t._v("提交反馈")])])], 1)], 1), t._v(" "), n("el-dialog", {
        attrs: {
          align: "left",
          title: "选择头像(不要涩图)",
          visible: t.dialogVisible,
          width: "590px",
          "close-on-click-modal": !1
        },
        on: {
          "update:visible": function (e) {
            t.dialogVisible = e
          }
        }
      }, [n("Picture"), t._v(" "), n("span", {
        staticClass: "dialog-footer",
        attrs: {
          slot: "footer"
        },
        slot: "footer"
      }, [n("el-button", {
        on: {
          click: function (e) {
            t.dialogVisible = !1
          }
        }
      }, [t._v("关闭")])], 1)], 1)], 1)
    };
  w._withStripped = !0;
  var _ = function () {
    var t = this,
      e = t.$createElement,
      n = t._self._c || e;
    return n("div", [n("el-row", [n("el-col", {
      attrs: {
        span: 12
      }
    }, [t.showPic ? n("div", {
      staticClass: "picBox"
    }, [n("img", {
      style: "height:" + 240 * t.imgHRate + "px;width:" + 240 * t.imgWRate + "px",
      attrs: {
        src: t.img64
      }
    }), t._v(" "), n("div", {
      staticClass: "shadow-pic"
    }), t._v(" "), n("div", {
      staticClass: "anti-shadow",
      style: t.theWidthMove
    }, [n("div", {
      staticClass: "anti-shadow-pic",
      style: t.shadowWH
    }, [n("img", {
      staticClass: "anti-shadow-img",
      style: "height:" + 240 * t.imgHRate + "px;width:" + 240 * t.imgWRate + "px;top:" + -t.cutTop + "px;left:" + -t.cutLeft + "px;",
      attrs: {
        src: t.img64
      }
    })]), t._v(" "), n("div", {
      staticClass: "anti-shadow-move",
      style: t.shadowWH,
      on: {
        mousedown: t.clickBox
      }
    }, [n("span", {
      staticClass: "drag-point point-lt",
      on: {
        mousedown: function (e) {
          t.dragBox(e, 1)
        }
      }
    }), t._v(" "), n("span", {
      staticClass: "drag-point point-rb",
      on: {
        mousedown: function (e) {
          t.dragBox(e, 4)
        }
      }
    })])])]) : n("div", {
      staticClass: "picBox",
      on: {
        click: t.inputFile
      }
    }, [n("i", {
      staticClass: "el-icon-plus",
      staticStyle: {
        "font-size": "28px"
      }
    })]), t._v(" "), n("el-row", [t.showPic ? n("el-button", {
      staticClass: "buttonSelect",
      staticStyle: {
        margin: "5px 30%"
      },
      attrs: {
        size: "small",
        type: "primary"
      },
      on: {
        click: t.inputFile
      }
    }, [t._v("重新选择")]) : t._e()], 1), t._v(" "), n("input", {
      ref: "file_input",
      staticStyle: {
        display: "none"
      },
      attrs: {
        type: "file",
        name: "image",
        accept: "image/png,image/jpg,image/jpeg"
      },
      on: {
        change: t.getFile
      }
    })], 1), t._v(" "), n("el-col", {
      attrs: {
        type: "flex",
        justify: "center",
        align: "middle",
        span: 12
      }
    }, [n("el-row", [t._v("头像预览")]), t._v(" "), n("el-row", [n("div", {
      staticClass: "picView"
    }, [n("div", {
      staticClass: "view-pic"
    }, [n("img", {
      staticClass: "view-img",
      style: t.viewpic,
      attrs: {
        src: t.img64
      }
    })])])]), t._v(" "), n("el-row", [n("el-button", {
      staticClass: "buttonSelect",
      attrs: {
        size: "small",
        type: "primary"
      },
      on: {
        click: t.submitPic
      }
    }, [t._v("提交")])], 1)], 1)], 1)], 1)
  };
  _._withStripped = !0;
  var S = {
      data: () => ({
        imgObj: null,
        img64: "",
        imgWRate: 1,
        imgHRate: 1,
        showPic: !1,
        cutHeight: 50,
        cutWidth: 50,
        cutTop: 50,
        cutLeft: 50
      }),
      methods: {
        inputFile() {
          this.$refs.file_input.dispatchEvent(new MouseEvent("click"))
        },
        getFile() {
          const t = this.$refs.file_input.files[0];
          if (t)
            if ("image/jpeg" === t.type || "image/png" === t.type || "image/gif" === t.type) {
              var e = new FileReader;
              e.that = this, e.onload = function () {
                e.that.img64 = e.result;
                let t = new Image;
                t.onload = function () {
                  e.that.imgObj = t, this.width / this.height <= 1 ? e.that.imgWRate = this.width / this.height : e.that.imgHRate = this.height / this.width
                }, t.src = e.result, e.that.imgWRate = 1, e.that.imgHRate = 1, e.that.cutHeight = 50, e.that.cutWidth = 50, e.that.cutTop = 50, e.that.cutLeft = 50, e.that.showPic = !0, e.that.imgObj = null
              }, e.readAsDataURL(t)
            } else this.$message.error("不是有效的图片文件!")
        },
        submitPic() {
          if (this.imgObj) {
            var t = document.createElement("canvas"),
              e = t.getContext("2d"),
              n = this.cutLeft / 240 * this.imgObj.width,
              o = this.cutTop / 240 * this.imgObj.height,
              s = this.cutWidth / (240 * this.imgWRate) * this.imgObj.width,
              r = this.cutHeight / (240 * this.imgHRate) * this.imgObj.height;
            t.width = s, t.height = r, e.drawImage(this.imgObj, n, o, s, r, 0, 0, s, r);
            var a = t.toDataURL((/data:(.*?);/g.exec(this.img64) || ["", "image/jpeg"])[1]);
            i.httpJsonMethod("POST", "media/setavatar/", {
              base64: encodeURIComponent(a)
            }).then(t => {
              let e = this;
              setTimeout(() => {
                e.$root.AVATAR = t.url
              }, 200), this.$message.success("更换头像成功")
            }).catch(t => {
              this.$message.error(t)
            })
          }
        },
        clickBox(t) {
          let e = this,
            n = e.cutTop - t.clientY,
            i = e.cutLeft - t.clientX;
          document.onmousemove = t => {
            let o = n + t.clientY,
              s = i + t.clientX;
            o < 0 ? e.cutTop = 0 : 240 * e.imgHRate - e.cutHeight < o ? e.cutTop = 240 * e.imgHRate - e.cutHeight : e.cutTop = o, s < 0 ? e.cutLeft = 0 : 240 * e.imgWRate - e.cutHeight < s ? e.cutLeft = 240 * e.imgWRate - e.cutHeight : e.cutLeft = s
          }, document.onmouseup = t => {
            document.onmousemove = null, document.onmouseup = null
          }
        },
        dragBox(t, e) {
          if (t.stopPropagation(), 1 == e) {
            let e = this,
              n = t.clientX + e.cutWidth;
            document.onmousemove = t => {
              let i = n - t.clientX,
                o = e.cutWidth;
              i < 8 ? e.cutHeight = e.cutWidth = 8 : 0 !== e.cutTop && e.cutLeft < i - o ? e.cutHeight = e.cutWidth = o + e.cutLeft : e.cutTop < i - e.cutHeight ? e.cutHeight = e.cutWidth = e.cutHeight + e.cutTop : e.cutHeight = e.cutWidth = i, e.cutLeft += o - e.cutWidth, e.cutTop += o - e.cutWidth
            }
          } else if (4 == e) {
            let e = this,
              n = t.clientX - e.cutWidth;
            document.onmousemove = t => {
              let i = t.clientX - n;
              i < 8 ? e.cutHeight = e.cutWidth = 8 : Math.abs(e.cutWidth + e.cutTop - 240 * e.imgHRate) > .01 && 240 * e.imgWRate - e.cutLeft < i ? e.cutHeight = e.cutWidth = 240 * e.imgWRate - e.cutLeft : 240 * e.imgHRate - e.cutTop < i ? e.cutHeight = e.cutWidth = 240 * e.imgHRate - e.cutTop : e.cutHeight = e.cutWidth = i
            }
          }
          document.onmouseup = t => {
            document.onmousemove = null, document.onmouseup = null
          }
        }
      },
      computed: {
        shadowWH() {
          let t = "";
          return t += "height:" + this.cutHeight + "px;", t += "width:" + this.cutWidth + "px;", t += "top:" + this.cutTop + "px;", t += "left:" + this.cutLeft + "px;", t
        },
        viewpic() {
          let t = {
            width: 0,
            height: 0,
            top: 0,
            left: 0
          };
          t.height = 240 / this.cutHeight * 190 * this.imgHRate, t.width = 240 / this.cutWidth * 190 * this.imgWRate, t.top = -t.height * this.cutTop / 240, t.left = -t.width * this.cutLeft / 240;
          let e = "";
          for (const n in t) e += n + ":" + t[n] + "px;";
          return e
        },
        theWidthMove() {
          let t = {
            width: 0,
            height: 0,
            top: 0,
            left: 0
          };
          t.left = 120 * (1 - this.imgWRate) + 7, t.top = 120 * (1 - this.imgHRate) + 7, t.width = 240 * this.imgWRate, t.height = 240 * this.imgHRate;
          let e = "";
          for (const n in t) e += n + ":" + t[n] + "px;";
          return e
        }
      }
    },
    O = n(4),
    k = {
      insert: "head",
      singleton: !1
    },
    C = (h()(O.a, k), O.a.locals, m(S, _, [], !1, null, "60235313", null));
  C.options.__file = "src/views/layout/Picture.vue";
  var $ = C.exports,
    T = function () {
      var t = this,
        e = t.$createElement,
        n = t._self._c || e;
      return n("div", {
        staticClass: "msgBox"
      }, [n("el-row", {
        staticStyle: {
          "margin-bottom": "10px"
        },
        attrs: {
          type: "flex",
          justify: "center",
          align: "middle"
        }
      }, [n("el-col", {
        attrs: {
          span: 9
        }
      }, [n("el-row", [n("el-radio-group", {
        attrs: {
          size: "small"
        },
        model: {
          value: t.radio,
          callback: function (e) {
            t.radio = e
          },
          expression: "radio"
        }
      }, [n("el-badge", {
        staticStyle: {
          "z-index": "3100"
        },
        attrs: {
          hidden: !t.$root.MESSAGE,
          value: t.$root.MESSAGE,
          max: 99
        }
      }, [n("el-radio-button", {
        attrs: {
          label: "1"
        }
      }, [t._v("回复")])], 1), t._v(" "), n("el-badge", {
        attrs: {
          hidden: !t.$root.LIKE,
          value: t.$root.LIKE,
          max: 99
        }
      }, [n("el-radio-button", {
        attrs: {
          label: "2"
        }
      }, [t._v("点赞")])], 1)], 1)], 1)], 1)], 1), t._v(" "), n("el-row", {
        staticClass: "scrollBox"
      }, [n("transition", {
        attrs: {
          name: "msgfade"
        }
      }, [n("div", {
        directives: [{
          name: "show",
          rawName: "v-show",
          value: 1 == t.radio,
          expression: "radio==1"
        }, {
          name: "infinite-scroll",
          rawName: "v-infinite-scroll",
          value: t.load,
          expression: "load"
        }],
        staticStyle: {
          overflow: "visible"
        },
        attrs: {
          "infinite-scroll-delay": "350"
        }
      }, [t._l(t.replyMsg.arr, (function (e, i) {
        return n("div", {
          key: i
        }, [n("el-card", [n("el-row", [n("el-col", {
          attrs: {
            span: 4
          }
        }, [n("el-badge", {
          attrs: {
            "is-dot": "",
            hidden: e.isread
          }
        }, [n("el-image", {
          staticClass: "avatar",
          attrs: {
            src: e.creator.avatar || t.$root.NULLAVATAR,
            fit: "cover",
            lazy: ""
          }
        })], 1)], 1), t._v(" "), n("el-col", {
          attrs: {
            span: 20
          }
        }, [n("el-row", [n("strong", [t._v(t._s(e.creator.user))]), t._v(t._s(" 回复了你") + "\n                ")]), t._v(" "), n("el-row", {
          staticStyle: {
            "font-size": "12px"
          }
        }, [t._v("\n                  " + t._s(e.time.substring(5, 10) + " " + e.time.substring(11, 16)) + "\n                ")])], 1)], 1), t._v(" "), n("el-row", [t._v("\n              " + t._s(e.reply.content) + "\n            ")]), t._v(" "), n("el-row", {
          staticClass: "text-link"
        }, [n("el-link", {
          attrs: {
            type: "primary",
            href: "https://www1.szu.edu.cn/mailbox/view.asp?id=" + e.reply.post_id,
            target: "_blank"
          },
          nativeOn: {
            click: function (n) {
              return t.readReply(e.id, i)
            }
          }
        }, [t._v("\n                " + t._s(e.reply.post))])], 1)], 1)], 1)
      })), t._v(" "), t.replyMsg.loging ? n("el-card", {
        directives: [{
          name: "loading",
          rawName: "v-loading",
          value: t.replyMsg.loging,
          expression: "replyMsg.loging"
        }]
      }, [n("div", {
        staticClass: "msg-loging"
      }, [t._v("获取中")])]) : n("el-card", [n("div", {
        staticClass: "msg-loging"
      }, [t._v("到底了")])])], 2)]), t._v(" "), n("transition", {
        attrs: {
          name: "msgfade"
        }
      }, [n("div", {
        directives: [{
          name: "show",
          rawName: "v-show",
          value: 2 == t.radio,
          expression: "radio==2"
        }]
      }, [n("el-card", [t._v("\n          开发中\n        ")])], 1)])], 1), t._v(" "), n("el-row", {
        staticStyle: {
          "margin-top": "10px"
        },
        attrs: {
          type: "flex",
          align: "middle",
          justify: "end"
        }
      }, [n("el-col", {
        attrs: {
          span: 6
        }
      }, [n("el-button", {
        staticClass: "text-buttonSelect-mini",
        attrs: {
          type: "text",
          size: "mini"
        },
        on: {
          click: function (e) {
            return t.readReply()
          }
        }
      }, [t._v("全部收取")])], 1)], 1)], 1)
    };
  T._withStripped = !0;
  var j = {
      data: () => ({
        radio: "1",
        replyMsg: {
          currentPage: 1,
          total: -1,
          limit: 4,
          cache: 0,
          loging: !0,
          arr: []
        }
      }),
      mounted() {
        this.getReplyMsg()
      },
      methods: {
        load() {
          this.replyMsg.arr.length >= this.replyMsg.total ? this.replyMsg.loging = !1 : this.getReplyMsg()
        },
        getReplyMsg() {
          i.httpJsonMethod("GET", "msg/bereply/", {
            limit: this.replyMsg.limit,
            offset: this.replyMsg.currentPage
          }).then(t => {
            this.replyMsg.total = t.total, this.replyMsg.currentPage++;
            for (let e = 0; e < t.msg.length; e++) {
              let n = localStorage.getItem(t.msg[e].reply.post_id);
              if ("wait" == n) {
                let i = setInterval(() => {
                  n = localStorage.getItem(t.msg[e].reply.post_id), "wait" != n && (this.replyMsg.arr.push(t.msg[e]), this.$set(t.msg[e].reply, "post", n), clearInterval(i))
                }, 50)
              } else n ? (this.replyMsg.arr.push(t.msg[e]), this.$set(t.msg[e].reply, "post", n)) : (localStorage.setItem(t.msg[e].reply.post_id, "wait"), i.httpHtmlMethod("GET", "/mailbox/view.asp", {
                id: t.msg[e].reply.post_id
              }, "gb2312").then(i => {
                this.replyMsg.arr.push(t.msg[e]), n = this.getStr(n, i), localStorage.setItem(t.msg[e].reply.post_id, n), this.$set(t.msg[e].reply, "post", n)
              }))
            }
          })
        },
        readReply(t, e) {
          let n = {
            all: 1
          };
          if (t) {
            if (this.replyMsg.arr[e].isread) return;
            n = {
              id: t
            }
          }
          i.httpJsonMethod("POST", "msg/bereply/", n).then(t => {
            if (n.all) {
              this.$message.success(t.result);
              for (let t = 0; t < this.replyMsg.arr.length; t++) this.replyMsg.arr[t].isread || (this.replyMsg.arr[t].isread = !0, this.$root.MESSAGE--)
            } else this.replyMsg.arr[e].isread || (this.replyMsg.arr[e].isread = !0, this.$root.MESSAGE--)
          }).catch(t => {
            this.$message.error(t)
          })
        },
        getStr(t, e) {
          t = "详情页: " + e.match(/(<title>=?)(.*?)(?=<\/title>)/)[2].slice(0, -8);
          let n = i.getLength14Size(t);
          if (n > 263) {
            for (t = t.substring(0, Math.floor(252.87 * t.length / n)), n = i.getLength14Size(t); n > 252.87;) t = t.substring(0, t.length - 1), n = i.getLength14Size(t);
            t += "..."
          }
          return t
        }
      }
    },
    E = n(5),
    M = {
      insert: "head",
      singleton: !1
    },
    I = (h()(E.a, M), E.a.locals, m(j, T, [], !1, null, "527e7582", null));
  I.options.__file = "src/views/layout/MessageBox.vue";
  var R = {
      components: {
        Picture: $,
        MessageBox: I.exports
      },
      data: () => ({
        active: "1",
        dialogVisible: !1,
        popoverVisible: !1
      }),
      methods: {
        selectIcon(t) {
          this.active = t, 1 == t ? this.popoverVisible = !0 : 2 == t ? this.setNickname() : 3 == t ? this.dialogVisible = !0 : 4 == t && this.debug()
        },
        setNickname() {
          this.$prompt("请输入要修改的昵称", "注意长度", {
            closeOnClickModal: !1,
            distinguishCancelAndClose: !0,
            confirmButtonText: "确定修改",
            cancelButtonText: "清空已存在昵称",
            inputValidator: t => !(t.length > 12),
            inputErrorMessage: "长度过长"
          }).then(({
            value: t
          }) => {
            i.httpJsonMethod("POST", "setnickname/", {
              nickname: t
            }).then(t => {
              this.$root.NICKNAME = t.nickname, this.$message({
                type: "success",
                message: "修改成功 " + t.nickname
              })
            }).catch(t => {
              this.$message.error(t)
            })
          }).catch(t => {
            "cancel" === t && i.httpJsonMethod("POST", "setnickname/", {
              empty: "empty"
            }).then(t => {
              this.$root.NICKNAME = t.user, this.$message({
                type: "success",
                message: "清空昵称成功"
              })
            })
          })
        },
        debug() {
          this.$alert("发送到邮箱[email protected]", "问题反馈", {
            confirmButtonText: "确定"
          })
        }
      }
    },
    L = n(6),
    P = {
      insert: "head",
      singleton: !1
    },
    A = (h()(L.a, P), L.a.locals, m(R, w, [], !1, null, "12898b5e", null));
  A.options.__file = "src/views/layout/SideBar.vue";
  var z = A.exports,
    H = {
      changePrePage(t, e) {
        let n, o;
        t.POSTID = i.getPostID(), n = document.getElementById("prePage") || document.querySelector("body > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(3) > td > table > tbody > tr:nth-child(1) > td > table > tbody > tr > td:nth-child(1) > a:nth-child(1)"), o = document.getElementById("nextPage") || document.querySelector("body > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(3) > td > table > tbody > tr:nth-child(1) > td > table > tbody > tr > td:nth-child(1) > a:nth-child(2)"), this.hotLoad(n, o, t, e)
      },
      hotLoad(t, e, n, i) {
        this.changeInter(t, e, n, t, i), this.changeInter(t, e, n, e, i)
      },
      changeInter(t, e, n, o, s) {
        let r = o.search,
          a = o.href;
        o.href = "javascript:void(0);", o.onclick = () => {
          i.httpHtmlMethod("GET", a, {}, "gb2312").then(o => {
            s.showURL = 0;
            let a = o.match(/width="90%" bgcolor="#FFFFFF">([\s\S]*?)<\/table>/)[1],
              l = o.matchAll(/\[<a href="(.*?)"/g);
            t.href = l.next().value[1], e.href = l.next().value[1], n.POSTID = i.getPostID(), window.history.pushState({
              table: a,
              prePage: t.href,
              nextPage: e.href,
              postid: n.POSTID
            }, document.title, r), document.title = o.match(/(<title>=?)(.*?)(?=<\/title>)/)[2];
            let c = document.querySelector("body > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(3) > td > table > tbody > tr:nth-child(2) > td > table");
            c && (c.innerHTML = a), s.$nextTick((function () {
              s.showURL = 1
            })), this.hotLoad(t, e, n, s)
          })
        }
      },
      popstateListen(t, e, n) {
        let i, o;
        e.POSTID = t.state.postid, i = document.getElementById("prePage") || document.querySelector("body > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(3) > td > table > tbody > tr:nth-child(1) > td > table > tbody > tr > td:nth-child(1) > a:nth-child(1)"), o = document.getElementById("nextPage") || document.querySelector("body > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(3) > td > table > tbody > tr:nth-child(1) > td > table > tbody > tr > td:nth-child(1) > a:nth-child(2)"), i.href = t.state.prePage, o.href = t.state.nextPage;
        let s = document.querySelector("body > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(3) > td > table > tbody > tr:nth-child(2) > td > table");
        s && (s.innerHTML = t.state.table), this.hotLoad(i, o, e, n)
      }
    },
    N = {
      name: "App",
      components: {
        Comment: x,
        SideBar: z
      },
      data: () => ({
        showURL: 0,
        navOut: !1
      }),
      beforeMount() {
        setTimeout(() => {
          this.navOut = !0
        }, 0);
        let t = document.createElement("link");
        t.setAttribute("rel", "stylesheet"), t.setAttribute("type", "text/css"), t.setAttribute("href", "https://at.alicdn.com/t/font_2377626_16z07jla638g.css"), document.head.appendChild(t);
        let e = document.querySelector("body > table > tbody > tr:nth-child(1) > td > table > tbody > tr:nth-child(3) > td:nth-child(1) > table > tbody > tr:nth-child(1) > td > a:nth-child(3)");
        e && (e.onclick = () => {
          i.httpJsonMethod("GET", "logout/", {})
        }), i.httpHtmlMethod("GET", "https://www1.szu.edu.cn/baoxiu/111.asp", {}, "gb2312").then(t => {
          t.match(/(学工号(.*?))<\/b>/g) ? this.getMsg() : this.$root.UUID = 0
        }), i.getQueryVariable("id") && (this.showURL = 1, H.changePrePage(this.$root, this), window.onpopstate = t => {
          this.showURL = 0, H.popstateListen(t, this.$root, this), this.$nextTick((function () {
            this.showURL = 1
          }))
        })
      },
      methods: {
        getMsg() {
          i.httpJsonMethod("POST", "login/", {
            ASP: i.getASPSESSION()
          }).then(t => {
            this.$root.AVATAR = t.avatar, this.$root.UUID = t.uuid, this.$root.NICKNAME = t.nickname, this.$root.MESSAGE = t.reply, this.$root.LIKE = 0
          }).catch(t => {
            this.$root.UUID = 0, this.$message.error(t)
          })
        }
      }
    },
    U = n(7),
    B = {
      insert: "head",
      singleton: !1
    },
    W = (h()(U.a, B), U.a.locals, m(N, r, [], !1, null, null, null));
  W.options.__file = "src/App.vue";
  var D = W.exports;
  i.loadInit(), new s.a({
    render: t => t(D),
    data: () => ({
      UUID: -1,
      AVATAR: null,
      NICKNAME: "未登录",
      MESSAGE: 0,
      LIKE: 0,
      NULLAVATAR: "https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png",
      POSTID: 0
    })
  }).$mount("#app")
}]);