UNPKG

dldiscuss

Version:

#### 介绍 {**以下是 Gitee 平台说明,您可以替换此简介** Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}

408 lines (407 loc) 13.7 kB
import { reactive as te, ref as w, defineComponent as ae, computed as oe, onActivated as le, onMounted as ne, watch as $, resolveComponent as u, openBlock as g, createElementBlock as U, createElementVNode as c, normalizeClass as L, createVNode as e, withCtx as l, createBlock as k, createCommentVNode as N, createTextVNode as _, unref as d, toDisplayString as z, pushScopeId as se, popScopeId as ie } from "vue"; import { ElMessageBox as A, ElMessage as O } from "element-plus"; import { V as re, a as de, b as q, p as ce, _ as ue } from "./discussCom-BiaeqCV0.mjs"; import { useRouter as pe } from "vue-router"; import { useStore as me } from "vuex"; const he = ({ deleteById: i }) => { const n = te({ editShow: !1, objId: "", detailShow: !1, sortShow: !1 }), D = () => { n.editShow = !0, n.objId = ""; }, p = (s) => { n.editShow = !0, n.objId = s[0].id; }, B = (s) => { let P = s.map((T) => T.id); A.confirm("确定删除当前选中的行?", "消息", { confirmButtonText: "确认", cancelButtonText: "取消", type: "warning" }).then(() => { i(P).then(() => { O.success("删除成功"), f(); }); }).catch(() => { }); }, j = (s) => { s && (s.stopPropagation && s.stopPropagation(), s.cancelBubble = !0), n.objId = s.target.id, n.detailShow = !0; }, C = () => { n.sortShow = !0; }, x = () => { R(), f(); }, R = (s) => { n.editShow = !1, n.objId = "", n.detailShow = !1, n.sortShow = !1, s === !0 && f(); }; let I = w(); const f = () => { I.value.initData(); }; return { state: n, add: D, edit: p, del: B, detail: j, sort: C, saved: x, canceled: R, viewTable: I, refreshData: f }; }, F = (i) => (se("data-v-e3fbbb89"), i = i(), ie(), i), ge = { class: "discuss-page" }, fe = /* @__PURE__ */ F(() => /* @__PURE__ */ c("span", { class: "title" }, "合议列表", -1)), _e = /* @__PURE__ */ F(() => /* @__PURE__ */ c("span", { class: "title" }, "合议事项", -1)), be = { class: "right" }, we = { class: "filter" }, ve = { class: "f-item f-item-100" }, Se = { class: "f-item f-item-100" }, ye = { key: 0, class: "btns" }, ke = ["id"], Ne = { key: 0, class: "is-new" }, Ce = { class: "remark" }, xe = { class: "bottom" }, Ie = /* @__PURE__ */ ae({ __name: "index", props: { pageName: { type: String, default: "discussion" } }, setup(i) { const n = me(), D = oe(() => { var o; return (o = n.state.userInfo) == null ? void 0 : o.id; }), { state: p, add: B, edit: j, detail: C, canceled: x, refreshData: R } = he({ deleteById: q }), I = pe(), f = i, s = (o) => o.createUser === D.value, P = async (o) => { I.push({ path: `/discussprogress/${o.id}`, query: { tagName: `${o.idsName}` } }); }, T = w(), E = w([]), m = w({ pageNum: 1, limit: 10, dataTotal: 0 }), v = w({ filterStatus: "", idsName: "", searchMap: {} }), S = w([]), h = async () => { let o = { ...v.value, ...m.value, status: f.pageName === "home" ? 0 : "" }; const a = await ce(o); E.value = a.rows, m.value.dataTotal = a.total; }, G = (o) => { S.value = o; }, H = (o, a, b) => { T.value.toggleRowSelection(o); }, J = () => { p.editShow = !1, h(); }, K = (o) => { let a = o.map((b) => b.id); A.confirm("确定删除当前选中的行?", "消息", { confirmButtonText: "确认", cancelButtonText: "取消", type: "warning" }).then(() => { q(a).then(() => { O.success("删除成功"), h(); }); }).catch(() => { }); }; return le(() => { h(); }), ne(() => { h(); }), $( [() => m.value.pageNum, () => m.value.limit], () => { h(); }, { deep: !0 } ), $( () => p.detailShow, () => { h(); }, { deep: !0 } ), (o, a) => { const b = u("el-col"), V = u("el-option"), Q = u("el-select"), W = u("el-input"), y = u("el-button"), X = u("el-row"), r = u("el-table-column"), Y = u("el-tooltip"), Z = u("el-table"), ee = u("el-pagination"); return g(), U("div", ge, [ c("div", { class: L(["discuss-page-header", i.pageName !== "home" ? "view-header" : "home-table-header"]) }, [ e(X, { class: "el-row" }, { default: l(() => [ i.pageName !== "home" ? (g(), k(b, { key: 0, span: 4 }, { default: l(() => [ fe ]), _: 1 })) : (g(), k(b, { key: 1, span: 4 }, { default: l(() => [ _e ]), _: 1 })), e(b, { span: 20 }, { default: l(() => [ c("div", be, [ c("div", we, [ c("div", ve, [ e(Q, { modelValue: v.value.filterStatus, "onUpdate:modelValue": a[0] || (a[0] = (t) => v.value.filterStatus = t), clearable: "", placeholder: "请选择合议状态", onChange: h }, { default: l(() => [ e(V, { label: "新合议", value: 0 }), e(V, { label: "合议中", value: 1 }), e(V, { label: "已超时", value: 2 }), f.pageName !== "home" ? (g(), k(V, { key: 0, label: "已完成", value: 3 })) : N("", !0) ]), _: 1 }, 8, ["modelValue"]) ]), c("div", Se, [ e(W, { modelValue: v.value.idsName, "onUpdate:modelValue": a[1] || (a[1] = (t) => v.value.idsName = t), placeholder: "合议名称", clearable: "", onChange: h }, null, 8, ["modelValue"]) ]) ]), i.pageName !== "home" ? (g(), U("div", ye, [ e(y, { type: "primary", icon: "Search", onClick: h }, { default: l(() => [ _("查询") ]), _: 1 }), e(y, { type: "primary", icon: "Plus", onClick: d(B) }, { default: l(() => [ _("新建") ]), _: 1 }, 8, ["onClick"]), e(y, { type: "primary", icon: "Edit", disabled: S.value.length !== 1, onClick: a[2] || (a[2] = () => d(j)(S.value)) }, { default: l(() => [ _("编辑") ]), _: 1 }, 8, ["disabled"]), e(y, { type: "danger", icon: "Delete", disabled: S.value.length < 0, onClick: a[3] || (a[3] = () => K(S.value)) }, { default: l(() => [ _("删除") ]), _: 1 }, 8, ["disabled"]) ])) : N("", !0) ]) ]), _: 1 }) ]), _: 1 }) ], 2), c("div", { class: L(["table-box", i.pageName === "home" ? "" : "table-height"]) }, [ e(Z, { ref_key: "multipleTableRef", ref: T, border: "", data: E.value, "highlight-current-row": !0, class: "view-table-container-table", "header-row-class-name": "header-row-class", "empty-text": "暂无数据", style: { width: "100%" }, height: "100%", onSelectionChange: G, onRowClick: H }, { default: l(() => [ i.pageName !== "home" ? (g(), k(r, { key: 0, type: "selection", width: "50", align: "center", selectable: s })) : N("", !0), e(r, { prop: "idsName", label: "合议名称", align: "center" }, { default: l((t) => [ c("div", { id: t.row.id, class: "table-cell-mouse-on", onClick: a[4] || (a[4] = //@ts-ignore (...M) => d(C) && d(C)(...M)) }, [ _(z(t.row.idsName) + " ", 1), t.row.isNew ? (g(), U("span", Ne, "new")) : N("", !0) ], 8, ke) ]), _: 1 }), e(r, { prop: "remark", label: "合议描述", width: "300", align: "center" }, { default: l((t) => [ e(Y, { class: "item", effect: "dark", content: t.row.remark, placement: "top" }, { default: l(() => [ c("div", Ce, z(t.row.remark), 1) ]), _: 2 }, 1032, ["content"]) ]), _: 1 }), e(r, { prop: "createUserName", label: "发起人", align: "center" }), e(r, { prop: "userCount", label: "合议人数", align: "center" }), e(r, { prop: "sourceName", label: "来源应用", align: "center" }), e(r, { prop: "sourceModuleName", label: "模块", align: "center" }), e(r, { prop: "startDate", label: "开始时间", align: "center" }), e(r, { prop: "endDate", label: "结束时间", align: "center" }), e(r, { prop: "newStatus", label: "状态", align: "center" }, { default: l((t) => [ _(z(t.row.status === 1 ? "已完成" : t.row.newStatus === 0 ? "新合议" : t.row.newStatus === 1 ? "合议中" : t.row.newStatus === 2 ? "已超时" : "-"), 1) ]), _: 1 }), e(r, { label: "操作", align: "center" }, { default: l((t) => [ e(y, { link: "", type: "primary", onClick: (M) => P(t.row) }, { default: l(() => [ _("进入合议") ]), _: 2 }, 1032, ["onClick"]) ]), _: 1 }) ]), _: 1 }, 8, ["data"]), c("div", xe, [ e(ee, { currentPage: m.value.pageNum, "onUpdate:currentPage": a[5] || (a[5] = (t) => m.value.pageNum = t), "page-size": m.value.limit, "onUpdate:pageSize": a[6] || (a[6] = (t) => m.value.limit = t), background: !0, layout: "sizes, prev, pager, next, total", total: m.value.dataTotal }, null, 8, ["currentPage", "page-size", "total"]) ]), d(p).detailShow ? (g(), k(re, { key: 0, id: d(p).objId, show: d(p).detailShow, onCanceled: d(x) }, null, 8, ["id", "show", "onCanceled"])) : N("", !0), e(de, { id: d(p).objId, show: d(p).editShow, onSaved: J, onCanceled: d(x) }, null, 8, ["id", "show", "onCanceled"]) ], 2) ]); }; } }), Re = /* @__PURE__ */ ue(Ie, [["__scopeId", "data-v-e3fbbb89"]]); export { Re as default };