/* empty css                                               */
/* empty css                                                 */
/* empty css                                                */
/* empty css                                               */
/* empty css                                                */
/* empty css                                                     */
/* empty css                                              */
/* empty css                                               */
/* empty css                                                  */
/* empty css                                                 */
import { getCurrentInstance, ref, createElementBlock, openBlock, createVNode, unref, isRef, withCtx, createElementVNode, Fragment, renderList, toDisplayString, normalizeStyle, createTextVNode } from "vue";
/* empty css                   */
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
import { Tabs } from "../../../../node_modules/vant/es/tabs/index.mjs";
import { Tab } from "../../../../node_modules/vant/es/tab/index.mjs";
import { Icon } from "../../../../node_modules/vant/es/icon/index.mjs";
import { Button } from "../../../../node_modules/vant/es/button/index.mjs";
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 = getCurrentInstance();
    const ctx = currentInstance.proxy;
    ctx.route;
    const activeName = 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 = Icon;
      const _component_van_button = Button;
      const _component_van_tab = Tab;
      const _component_van_tabs = Tabs;
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createVNode(_component_van_tabs, {
          sticky: "",
          class: "fec-tabs",
          active: unref(activeName),
          "onUpdate:active": _cache[0] || (_cache[0] = ($event) => isRef(activeName) ? activeName.value = $event : null),
          swipeable: "",
          "lazy-render": ""
        }, {
          default: withCtx(() => [
            createVNode(_component_van_tab, {
              title: "待办",
              name: "todo",
              replace: "",
              "show-zero-badge": false
            }, {
              default: withCtx(() => [
                createElementVNode("div", _hoisted_2, [
                  createElementVNode("div", _hoisted_3, [
                    (openBlock(), createElementBlock(Fragment, null, renderList(todoList, (item) => {
                      return createElementVNode("div", {
                        key: item.id,
                        class: "fec-card"
                      }, [
                        createElementVNode("div", _hoisted_4, [
                          createElementVNode("span", _hoisted_5, toDisplayString(item.title), 1),
                          createElementVNode("span", {
                            class: "fec-card-status",
                            style: normalizeStyle({ background: item.statusColor })
                          }, [
                            createVNode(_component_van_icon, {
                              name: item.statusIcon,
                              size: "12"
                            }, null, 8, ["name"]),
                            createTextVNode(" " + toDisplayString(item.statusText), 1)
                          ], 4)
                        ]),
                        createElementVNode("div", _hoisted_6, [
                          createElementVNode("div", _hoisted_7, toDisplayString(item.message), 1),
                          createElementVNode("div", _hoisted_8, [
                            _cache[1] || (_cache[1] = createElementVNode("span", { class: "fec-card-label" }, "业务流水号：", -1)),
                            createElementVNode("span", _hoisted_9, toDisplayString(item.sn), 1)
                          ])
                        ]),
                        createElementVNode("div", _hoisted_10, [
                          createElementVNode("span", _hoisted_11, toDisplayString(formatTime(item.arriveTime)), 1),
                          createElementVNode("div", _hoisted_12, [
                            createVNode(_component_van_button, {
                              plain: "",
                              hairline: "",
                              round: "",
                              size: "small",
                              onClick: ($event) => onView(item)
                            }, {
                              default: withCtx(() => _cache[2] || (_cache[2] = [
                                createTextVNode(" 查看 ")
                              ])),
                              _: 2
                            }, 1032, ["onClick"]),
                            createVNode(_component_van_button, {
                              type: "primary",
                              round: "",
                              size: "small",
                              onClick: ($event) => onApprove(item)
                            }, {
                              default: withCtx(() => [
                                createTextVNode(toDisplayString(item.actionText || "同意"), 1)
                              ]),
                              _: 2
                            }, 1032, ["onClick"])
                          ])
                        ])
                      ]);
                    }), 64))
                  ])
                ])
              ]),
              _: 1
            }),
            createVNode(_component_van_tab, {
              title: "已办",
              name: "done",
              replace: "",
              "show-zero-badge": false
            }, {
              default: withCtx(() => [
                createElementVNode("div", _hoisted_13, [
                  createElementVNode("div", _hoisted_14, [
                    (openBlock(), createElementBlock(Fragment, null, renderList(doneList, (item) => {
                      return createElementVNode("div", {
                        key: item.id,
                        class: "fec-card"
                      }, [
                        createElementVNode("div", _hoisted_15, [
                          createElementVNode("span", _hoisted_16, toDisplayString(item.title), 1),
                          createElementVNode("span", {
                            class: "fec-card-status",
                            style: normalizeStyle({ background: item.statusColor })
                          }, [
                            createVNode(_component_van_icon, {
                              name: item.statusIcon,
                              size: "12"
                            }, null, 8, ["name"]),
                            createTextVNode(" " + toDisplayString(item.statusText), 1)
                          ], 4)
                        ]),
                        createElementVNode("div", _hoisted_17, [
                          createElementVNode("div", _hoisted_18, toDisplayString(item.message), 1),
                          createElementVNode("div", _hoisted_19, [
                            _cache[3] || (_cache[3] = createElementVNode("span", { class: "fec-card-label" }, "业务流水号：", -1)),
                            createElementVNode("span", _hoisted_20, toDisplayString(item.sn), 1)
                          ])
                        ]),
                        createElementVNode("div", _hoisted_21, [
                          createElementVNode("span", _hoisted_22, toDisplayString(formatTime(item.arriveTime)), 1),
                          createElementVNode("div", _hoisted_23, [
                            createVNode(_component_van_button, {
                              plain: "",
                              hairline: "",
                              round: "",
                              size: "small",
                              onClick: ($event) => onView(item)
                            }, {
                              default: withCtx(() => _cache[4] || (_cache[4] = [
                                createTextVNode(" 查看 ")
                              ])),
                              _: 2
                            }, 1032, ["onClick"]),
                            createVNode(_component_van_button, {
                              type: "warning",
                              round: "",
                              size: "small",
                              onClick: ($event) => onRevoke(item)
                            }, {
                              default: withCtx(() => _cache[5] || (_cache[5] = [
                                createTextVNode(" 撤销 ")
                              ])),
                              _: 2
                            }, 1032, ["onClick"])
                          ])
                        ])
                      ]);
                    }), 64))
                  ])
                ])
              ]),
              _: 1
            }),
            createVNode(_component_van_tab, {
              title: "抄送",
              name: "cc",
              replace: "",
              "show-zero-badge": false
            }, {
              default: withCtx(() => [
                createElementVNode("div", _hoisted_24, [
                  createElementVNode("div", _hoisted_25, [
                    (openBlock(), createElementBlock(Fragment, null, renderList(ccList, (item) => {
                      return createElementVNode("div", {
                        key: item.id,
                        class: "fec-card"
                      }, [
                        createElementVNode("div", _hoisted_26, [
                          createElementVNode("span", _hoisted_27, toDisplayString(item.title), 1),
                          createElementVNode("span", {
                            class: "fec-card-status",
                            style: normalizeStyle({ background: item.statusColor })
                          }, [
                            createVNode(_component_van_icon, {
                              name: item.statusIcon,
                              size: "12"
                            }, null, 8, ["name"]),
                            createTextVNode(" " + toDisplayString(item.statusText), 1)
                          ], 4)
                        ]),
                        createElementVNode("div", _hoisted_28, [
                          createElementVNode("div", _hoisted_29, toDisplayString(item.message), 1),
                          createElementVNode("div", _hoisted_30, [
                            _cache[6] || (_cache[6] = createElementVNode("span", { class: "fec-card-label" }, "业务流水号：", -1)),
                            createElementVNode("span", _hoisted_31, toDisplayString(item.sn), 1)
                          ])
                        ]),
                        createElementVNode("div", _hoisted_32, [
                          createElementVNode("span", _hoisted_33, toDisplayString(formatTime(item.arriveTime)), 1),
                          createElementVNode("div", _hoisted_34, [
                            createVNode(_component_van_button, {
                              plain: "",
                              hairline: "",
                              round: "",
                              size: "small",
                              onClick: ($event) => onView(item)
                            }, {
                              default: withCtx(() => _cache[7] || (_cache[7] = [
                                createTextVNode(" 查看 ")
                              ])),
                              _: 2
                            }, 1032, ["onClick"])
                          ])
                        ])
                      ]);
                    }), 64))
                  ])
                ])
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["active"])
      ]);
    };
  }
};
const _ApprovalList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5cd7ed05"]]);
export {
  _ApprovalList as default
};
