"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
;/* empty css                                               */
;/* empty css                                                 */
;/* empty css                                                */
;/* empty css                                               */
;/* empty css                                                */
;/* empty css                                                     */
;/* empty css                                              */
;/* empty css                                               */
;/* empty css                                                  */
;/* empty css                                                 */
const Vue = require("vue");
;/* empty css                   */
const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.js");
const index = require("../../../../node_modules/vant/es/tabs/index.js");
const index$1 = require("../../../../node_modules/vant/es/tab/index.js");
const index$2 = require("../../../../node_modules/vant/es/icon/index.js");
const index$3 = require("../../../../node_modules/vant/es/button/index.js");
const _hoisted_1 = { class: "fec-mobile-approval-list" };
const _hoisted_2 = { class: "fec-tab-content" };
const _hoisted_3 = { class: "fec-list" };
const _hoisted_4 = { class: "fec-card-header" };
const _hoisted_5 = { class: "fec-card-title" };
const _hoisted_6 = { class: "fec-card-body" };
const _hoisted_7 = { class: "fec-card-message" };
const _hoisted_8 = { class: "fec-card-sn" };
const _hoisted_9 = { class: "fec-card-value" };
const _hoisted_10 = { class: "fec-card-footer" };
const _hoisted_11 = { class: "fec-card-time" };
const _hoisted_12 = { class: "fec-card-actions" };
const _hoisted_13 = { class: "fec-tab-content" };
const _hoisted_14 = { class: "fec-list" };
const _hoisted_15 = { class: "fec-card-header" };
const _hoisted_16 = { class: "fec-card-title" };
const _hoisted_17 = { class: "fec-card-body" };
const _hoisted_18 = { class: "fec-card-message" };
const _hoisted_19 = { class: "fec-card-sn" };
const _hoisted_20 = { class: "fec-card-value" };
const _hoisted_21 = { class: "fec-card-footer" };
const _hoisted_22 = { class: "fec-card-time" };
const _hoisted_23 = { class: "fec-card-actions" };
const _hoisted_24 = { class: "fec-tab-content" };
const _hoisted_25 = { class: "fec-list" };
const _hoisted_26 = { class: "fec-card-header" };
const _hoisted_27 = { class: "fec-card-title" };
const _hoisted_28 = { class: "fec-card-body" };
const _hoisted_29 = { class: "fec-card-message" };
const _hoisted_30 = { class: "fec-card-sn" };
const _hoisted_31 = { class: "fec-card-value" };
const _hoisted_32 = { class: "fec-card-footer" };
const _hoisted_33 = { class: "fec-card-time" };
const _hoisted_34 = { class: "fec-card-actions" };
const _sfc_main = {
  __name: "ApprovalList",
  props: {},
  setup(__props) {
    const currentInstance = Vue.getCurrentInstance();
    const ctx = currentInstance.proxy;
    ctx.route;
    const activeName = Vue.ref("todo");
    const todoList = [
      {
        id: 1,
        title: "项目立项申请",
        message: "客户李四提交了一笔新办公设备采购项目立项，请您审批。",
        sn: "1100202406150001",
        arriveTime: "30分钟前",
        statusText: "待处理",
        statusColor: "#fa8c16",
        statusIcon: "clock-o",
        actionText: "同意",
        actionColor: "#52c41a"
      },
      {
        id: 2,
        title: "合同审批",
        message: "客户王五提交了一份销售合同，请您审批。",
        sn: "1100202406150002",
        arriveTime: "2小时前",
        statusText: "已打回",
        statusColor: "#722ed1",
        statusIcon: "close",
        actionText: "同意",
        actionColor: "#52c41a"
      },
      {
        id: 3,
        title: "付款申请",
        message: "客户赵六提交了一笔供应商付款申请，请您审批。",
        sn: "1100202406150003",
        arriveTime: "2026-06-07 09:30:00",
        statusText: "待处理",
        statusColor: "#fa8c16",
        statusIcon: "clock-o",
        actionText: "同意",
        actionColor: "#52c41a"
      }
    ];
    const doneList = [
      {
        id: 4,
        title: "采购申请",
        message: "客户孙七提交了一笔办公用品采购申请，处理中。",
        sn: "1100202406140004",
        arriveTime: "2026-06-06 14:30:00",
        statusText: "处理中",
        statusColor: "#1890ff",
        statusIcon: "edit"
      },
      {
        id: 5,
        title: "用车申请",
        message: "客户周八提交了一笔商务用车申请，已完成。",
        sn: "1100202406130005",
        arriveTime: "2026-06-05 10:15:00",
        statusText: "已完成",
        statusColor: "#52c41a",
        statusIcon: "checked"
      }
    ];
    const ccList = [
      {
        id: 6,
        title: "会议通知",
        message: "客户吴九提交了周一例会，请您知悉。",
        sn: "1100202406150006",
        arriveTime: "1小时前",
        statusText: "处理中",
        statusColor: "#1890ff",
        statusIcon: "edit"
      },
      {
        id: 7,
        title: "制度变更",
        message: "客户郑十提交了新的考勤制度变更，请您知悉。",
        sn: "1100202406140007",
        arriveTime: "2026-06-07 16:45:00",
        statusText: "已完成",
        statusColor: "#52c41a",
        statusIcon: "checked"
      }
    ];
    function formatTime(timeStr) {
      if (!timeStr) return "";
      if (timeStr.includes(":")) {
        const time = new Date(timeStr.replace(/\-/g, "/"));
        const now = /* @__PURE__ */ new Date();
        const diff = now - time;
        const oneDay = 24 * 60 * 60 * 1e3;
        if (diff > oneDay) {
          return timeStr;
        }
        const hours = Math.floor(diff / (60 * 60 * 1e3));
        if (hours >= 1) {
          return `${hours}小时前`;
        }
        const minutes = Math.floor(diff / (60 * 1e3));
        return `${minutes}分钟前`;
      }
      return timeStr;
    }
    function onView(item) {
      console.log("查看:", item);
    }
    function onApprove(item) {
      console.log("同意:", item);
    }
    function onRevoke(item) {
      console.log("撤销:", item);
    }
    return (_ctx, _cache) => {
      const _component_van_icon = index$2.Icon;
      const _component_van_button = index$3.Button;
      const _component_van_tab = index$1.Tab;
      const _component_van_tabs = index.Tabs;
      return Vue.openBlock(), Vue.createElementBlock("div", _hoisted_1, [
        Vue.createVNode(_component_van_tabs, {
          sticky: "",
          class: "fec-tabs",
          active: Vue.unref(activeName),
          "onUpdate:active": _cache[0] || (_cache[0] = ($event) => Vue.isRef(activeName) ? activeName.value = $event : null),
          swipeable: "",
          "lazy-render": ""
        }, {
          default: Vue.withCtx(() => [
            Vue.createVNode(_component_van_tab, {
              title: "待办",
              name: "todo",
              replace: "",
              "show-zero-badge": false
            }, {
              default: Vue.withCtx(() => [
                Vue.createElementVNode("div", _hoisted_2, [
                  Vue.createElementVNode("div", _hoisted_3, [
                    (Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(todoList, (item) => {
                      return Vue.createElementVNode("div", {
                        key: item.id,
                        class: "fec-card"
                      }, [
                        Vue.createElementVNode("div", _hoisted_4, [
                          Vue.createElementVNode("span", _hoisted_5, Vue.toDisplayString(item.title), 1),
                          Vue.createElementVNode("span", {
                            class: "fec-card-status",
                            style: Vue.normalizeStyle({ background: item.statusColor })
                          }, [
                            Vue.createVNode(_component_van_icon, {
                              name: item.statusIcon,
                              size: "12"
                            }, null, 8, ["name"]),
                            Vue.createTextVNode(" " + Vue.toDisplayString(item.statusText), 1)
                          ], 4)
                        ]),
                        Vue.createElementVNode("div", _hoisted_6, [
                          Vue.createElementVNode("div", _hoisted_7, Vue.toDisplayString(item.message), 1),
                          Vue.createElementVNode("div", _hoisted_8, [
                            _cache[1] || (_cache[1] = Vue.createElementVNode("span", { class: "fec-card-label" }, "业务流水号：", -1)),
                            Vue.createElementVNode("span", _hoisted_9, Vue.toDisplayString(item.sn), 1)
                          ])
                        ]),
                        Vue.createElementVNode("div", _hoisted_10, [
                          Vue.createElementVNode("span", _hoisted_11, Vue.toDisplayString(formatTime(item.arriveTime)), 1),
                          Vue.createElementVNode("div", _hoisted_12, [
                            Vue.createVNode(_component_van_button, {
                              plain: "",
                              hairline: "",
                              round: "",
                              size: "small",
                              onClick: ($event) => onView(item)
                            }, {
                              default: Vue.withCtx(() => _cache[2] || (_cache[2] = [
                                Vue.createTextVNode(" 查看 ")
                              ])),
                              _: 2
                            }, 1032, ["onClick"]),
                            Vue.createVNode(_component_van_button, {
                              type: "primary",
                              round: "",
                              size: "small",
                              onClick: ($event) => onApprove(item)
                            }, {
                              default: Vue.withCtx(() => [
                                Vue.createTextVNode(Vue.toDisplayString(item.actionText || "同意"), 1)
                              ]),
                              _: 2
                            }, 1032, ["onClick"])
                          ])
                        ])
                      ]);
                    }), 64))
                  ])
                ])
              ]),
              _: 1
            }),
            Vue.createVNode(_component_van_tab, {
              title: "已办",
              name: "done",
              replace: "",
              "show-zero-badge": false
            }, {
              default: Vue.withCtx(() => [
                Vue.createElementVNode("div", _hoisted_13, [
                  Vue.createElementVNode("div", _hoisted_14, [
                    (Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(doneList, (item) => {
                      return Vue.createElementVNode("div", {
                        key: item.id,
                        class: "fec-card"
                      }, [
                        Vue.createElementVNode("div", _hoisted_15, [
                          Vue.createElementVNode("span", _hoisted_16, Vue.toDisplayString(item.title), 1),
                          Vue.createElementVNode("span", {
                            class: "fec-card-status",
                            style: Vue.normalizeStyle({ background: item.statusColor })
                          }, [
                            Vue.createVNode(_component_van_icon, {
                              name: item.statusIcon,
                              size: "12"
                            }, null, 8, ["name"]),
                            Vue.createTextVNode(" " + Vue.toDisplayString(item.statusText), 1)
                          ], 4)
                        ]),
                        Vue.createElementVNode("div", _hoisted_17, [
                          Vue.createElementVNode("div", _hoisted_18, Vue.toDisplayString(item.message), 1),
                          Vue.createElementVNode("div", _hoisted_19, [
                            _cache[3] || (_cache[3] = Vue.createElementVNode("span", { class: "fec-card-label" }, "业务流水号：", -1)),
                            Vue.createElementVNode("span", _hoisted_20, Vue.toDisplayString(item.sn), 1)
                          ])
                        ]),
                        Vue.createElementVNode("div", _hoisted_21, [
                          Vue.createElementVNode("span", _hoisted_22, Vue.toDisplayString(formatTime(item.arriveTime)), 1),
                          Vue.createElementVNode("div", _hoisted_23, [
                            Vue.createVNode(_component_van_button, {
                              plain: "",
                              hairline: "",
                              round: "",
                              size: "small",
                              onClick: ($event) => onView(item)
                            }, {
                              default: Vue.withCtx(() => _cache[4] || (_cache[4] = [
                                Vue.createTextVNode(" 查看 ")
                              ])),
                              _: 2
                            }, 1032, ["onClick"]),
                            Vue.createVNode(_component_van_button, {
                              type: "warning",
                              round: "",
                              size: "small",
                              onClick: ($event) => onRevoke(item)
                            }, {
                              default: Vue.withCtx(() => _cache[5] || (_cache[5] = [
                                Vue.createTextVNode(" 撤销 ")
                              ])),
                              _: 2
                            }, 1032, ["onClick"])
                          ])
                        ])
                      ]);
                    }), 64))
                  ])
                ])
              ]),
              _: 1
            }),
            Vue.createVNode(_component_van_tab, {
              title: "抄送",
              name: "cc",
              replace: "",
              "show-zero-badge": false
            }, {
              default: Vue.withCtx(() => [
                Vue.createElementVNode("div", _hoisted_24, [
                  Vue.createElementVNode("div", _hoisted_25, [
                    (Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(ccList, (item) => {
                      return Vue.createElementVNode("div", {
                        key: item.id,
                        class: "fec-card"
                      }, [
                        Vue.createElementVNode("div", _hoisted_26, [
                          Vue.createElementVNode("span", _hoisted_27, Vue.toDisplayString(item.title), 1),
                          Vue.createElementVNode("span", {
                            class: "fec-card-status",
                            style: Vue.normalizeStyle({ background: item.statusColor })
                          }, [
                            Vue.createVNode(_component_van_icon, {
                              name: item.statusIcon,
                              size: "12"
                            }, null, 8, ["name"]),
                            Vue.createTextVNode(" " + Vue.toDisplayString(item.statusText), 1)
                          ], 4)
                        ]),
                        Vue.createElementVNode("div", _hoisted_28, [
                          Vue.createElementVNode("div", _hoisted_29, Vue.toDisplayString(item.message), 1),
                          Vue.createElementVNode("div", _hoisted_30, [
                            _cache[6] || (_cache[6] = Vue.createElementVNode("span", { class: "fec-card-label" }, "业务流水号：", -1)),
                            Vue.createElementVNode("span", _hoisted_31, Vue.toDisplayString(item.sn), 1)
                          ])
                        ]),
                        Vue.createElementVNode("div", _hoisted_32, [
                          Vue.createElementVNode("span", _hoisted_33, Vue.toDisplayString(formatTime(item.arriveTime)), 1),
                          Vue.createElementVNode("div", _hoisted_34, [
                            Vue.createVNode(_component_van_button, {
                              plain: "",
                              hairline: "",
                              round: "",
                              size: "small",
                              onClick: ($event) => onView(item)
                            }, {
                              default: Vue.withCtx(() => _cache[7] || (_cache[7] = [
                                Vue.createTextVNode(" 查看 ")
                              ])),
                              _: 2
                            }, 1032, ["onClick"])
                          ])
                        ])
                      ]);
                    }), 64))
                  ])
                ])
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["active"])
      ]);
    };
  }
};
const _ApprovalList = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-5cd7ed05"]]);
exports.default = _ApprovalList;
