'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
require('../../../../../api/index.js');
var commonFunction = require('../../../../../hooks/commonFunction.js');
var index = require('../../../../../api/base/index.js');

const _hoisted_1 = { class: "user-news-container" };
const _hoisted_2 = { style: { "margin-left": "5px" } };
const _hoisted_3 = { class: "notice-box" };
const _hoisted_4 = ["onClick"];
const _hoisted_5 = { class: "notice-item-icon" };
const _hoisted_6 = { class: "notice-title" };
const _hoisted_7 = { class: "notice-content" };
const _hoisted_8 = { class: "notice-time" };
const _hoisted_9 = { style: { "margin-left": "5px" } };
const _hoisted_10 = {
  class: "notice-box",
  style: { "height": "435px" }
};
const _hoisted_11 = { style: { "color": "#fff" } };
const _hoisted_12 = { class: "w-e-text-container" };
const _hoisted_13 = ["innerHTML"];
const _hoisted_14 = { class: "dialog-footer" };
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
  __name: "userNews",
  props: {
    noticeList: Array
  },
  setup(__props) {
    const { proxy } = vue.getCurrentInstance();
    const { removeHtmlSub } = commonFunction.default();
    const state = vue.reactive({
      dialogVisible: false,
      content: ""
    });
    const goToNotice = () => {
      const router = proxy.$mycurRouter;
      router.push("/dashboard/notice");
    };
    const viewNoticeDetail = async (notice) => {
      state.content = notice.content;
      state.dialogVisible = true;
      notice.readStatus = 1;
      await index.useBaseApi("sysNotice").post({ id: notice.id }, "setRead");
    };
    return (_ctx, _cache) => {
      const _component_ele_Bell = vue.resolveComponent("ele-Bell");
      const _component_el_icon = vue.resolveComponent("el-icon");
      const _component_ele_Notification = vue.resolveComponent("ele-Notification");
      const _component_ele_Message = vue.resolveComponent("ele-Message");
      const _component_el_empty = vue.resolveComponent("el-empty");
      const _component_el_tab_pane = vue.resolveComponent("el-tab-pane");
      const _component_ele_Position = vue.resolveComponent("ele-Position");
      const _component_el_tabs = vue.resolveComponent("el-tabs");
      const _component_el_button = vue.resolveComponent("el-button");
      const _component_el_dialog = vue.resolveComponent("el-dialog");
      return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
        vue.createVNode(_component_el_tabs, {
          stretch: "",
          class: "content-box"
        }, {
          default: vue.withCtx(() => [
            vue.createVNode(_component_el_tab_pane, {
              label: _ctx.$t("message.list.messageInbox")
            }, {
              label: vue.withCtx(() => [
                vue.createVNode(_component_el_icon, null, {
                  default: vue.withCtx(() => [
                    vue.createVNode(_component_ele_Bell)
                  ]),
                  _: 1
                  /* STABLE */
                }),
                vue.createElementVNode(
                  "span",
                  _hoisted_2,
                  vue.toDisplayString(_ctx.$t("message.list.messageInbox")),
                  1
                  /* TEXT */
                )
              ]),
              default: vue.withCtx(() => [
                vue.createElementVNode("div", _hoisted_3, [
                  __props.noticeList.length > 0 ? (vue.openBlock(true), vue.createElementBlock(
                    vue.Fragment,
                    { key: 0 },
                    vue.renderList(__props.noticeList, (v, k) => {
                      return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
                        class: "notice-item",
                        key: k,
                        onClick: ($event) => viewNoticeDetail(v)
                      }, [
                        vue.createElementVNode("div", _hoisted_5, [
                          vue.createVNode(
                            _component_el_icon,
                            {
                              size: "24",
                              color: "var(--el-color-primary)"
                            },
                            {
                              default: vue.withCtx(() => [
                                v.type == 1 ? (vue.openBlock(), vue.createBlock(_component_ele_Notification, { key: 0 })) : (vue.openBlock(), vue.createBlock(_component_ele_Message, { key: 1 }))
                              ]),
                              _: 2
                              /* DYNAMIC */
                            },
                            1024
                            /* DYNAMIC_SLOTS */
                          )
                        ]),
                        vue.createElementVNode("div", null, [
                          vue.createElementVNode(
                            "div",
                            _hoisted_6,
                            vue.toDisplayString(v.title),
                            1
                            /* TEXT */
                          ),
                          vue.createElementVNode(
                            "div",
                            _hoisted_7,
                            vue.toDisplayString(vue.unref(removeHtmlSub)(v.content)),
                            1
                            /* TEXT */
                          ),
                          vue.createElementVNode(
                            "div",
                            _hoisted_8,
                            vue.toDisplayString(v.publicTime),
                            1
                            /* TEXT */
                          )
                        ])
                      ], 8, _hoisted_4)), [
                        [vue.vShow, v.readStatus == 1 ? false : true]
                      ]);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  )) : (vue.openBlock(), vue.createBlock(_component_el_empty, {
                    key: 1,
                    description: _ctx.$t("message.list.empty"),
                    style: { "height": "85%" }
                  }, null, 8, ["description"]))
                ]),
                __props.noticeList.length > 0 ? (vue.openBlock(), vue.createElementBlock(
                  "div",
                  {
                    key: 0,
                    class: "notice-foot",
                    onClick: goToNotice
                  },
                  vue.toDisplayString(_ctx.$t("message.list.goToNotice")),
                  1
                  /* TEXT */
                )) : vue.createCommentVNode("v-if", true)
              ]),
              _: 1
              /* STABLE */
            }, 8, ["label"]),
            vue.createVNode(_component_el_tab_pane, {
              label: _ctx.$t("message.list.my")
            }, {
              label: vue.withCtx(() => [
                vue.createVNode(_component_el_icon, null, {
                  default: vue.withCtx(() => [
                    vue.createVNode(_component_ele_Position)
                  ]),
                  _: 1
                  /* STABLE */
                }),
                vue.createElementVNode(
                  "span",
                  _hoisted_9,
                  vue.toDisplayString(_ctx.$t("message.list.my")),
                  1
                  /* TEXT */
                )
              ]),
              default: vue.withCtx(() => [
                vue.createElementVNode("div", _hoisted_10, [
                  vue.createVNode(_component_el_empty, {
                    description: _ctx.$t("message.list.empty"),
                    style: { "height": "85%" }
                  }, null, 8, ["description"])
                ])
              ]),
              _: 1
              /* STABLE */
            }, 8, ["label"])
          ]),
          _: 1
          /* STABLE */
        }),
        vue.createVNode(_component_el_dialog, {
          modelValue: state.dialogVisible,
          "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => state.dialogVisible = $event),
          draggable: "",
          width: "769px"
        }, {
          header: vue.withCtx(() => [
            vue.createElementVNode("div", _hoisted_11, [
              vue.createVNode(_component_el_icon, {
                size: "16",
                style: { "margin-right": "3px", "display": "inline", "vertical-align": "middle" }
              }, {
                default: vue.withCtx(() => [
                  vue.createVNode(_component_ele_Bell)
                ]),
                _: 1
                /* STABLE */
              }),
              vue.createElementVNode(
                "span",
                null,
                vue.toDisplayString(_ctx.$t("message.list.messageDetail")),
                1
                /* TEXT */
              )
            ])
          ]),
          footer: vue.withCtx(() => [
            vue.createElementVNode("span", _hoisted_14, [
              vue.createVNode(_component_el_button, {
                type: "primary",
                onClick: _cache[0] || (_cache[0] = ($event) => state.dialogVisible = false)
              }, {
                default: vue.withCtx(() => [
                  vue.createTextVNode(
                    vue.toDisplayString(_ctx.$t("message.list.confirm")),
                    1
                    /* TEXT */
                  )
                ]),
                _: 1
                /* STABLE */
              })
            ])
          ]),
          default: vue.withCtx(() => [
            vue.createElementVNode("div", _hoisted_12, [
              vue.createElementVNode("div", {
                innerHTML: state.content,
                "data-slate-editor": ""
              }, null, 8, _hoisted_13)
            ])
          ]),
          _: 1
          /* STABLE */
        }, 8, ["modelValue"])
      ]);
    };
  }
});

exports.default = _sfc_main;
