@cdwx/system
Version:
成都文宣业务类服务模块组件库
192 lines (191 loc) • 8.52 kB
JavaScript
/* empty css */
/* empty css */
/* empty css */
import "../../workspace/code/cloud-frontend/node_modules/.pnpm/element-plus@2.9.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/theme-chalk/el-tooltip.css.js";
/* empty css */
/* empty css */
/* empty css */
/* empty css */
/* empty css */
import "../../workspace/code/cloud-frontend/node_modules/.pnpm/element-plus@2.9.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/theme-chalk/el-form-item.css.js";
/* empty css */
/* empty css */
/* empty css */
import { defineComponent as M, ref as k, useModel as U, computed as S, onMounted as j, reactive as F, openBlock as l, createBlock as u, withCtx as a, createVNode as d, unref as r, createElementBlock as w, Fragment as C, renderList as E, createCommentVNode as _ } from "vue";
import { Minus as J, Plus as N } from "../../workspace/code/cloud-frontend/node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.5.13_typescript@5.5.4_/node_modules/@element-plus/icons-vue/dist/index.js";
import { useRoute as T } from "vue-router";
import { getAll as $ } from "../../workspace/code/cloud-frontend/service-modules/system/src/api/api-department.js";
import { getAllData as z } from "../../workspace/code/cloud-frontend/service-modules/system/src/api/api-job.js";
import { ElOption as O, ElSelect as P } from "../../workspace/code/cloud-frontend/node_modules/.pnpm/element-plus@2.9.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/select/index.js";
import { ElFormItem as R } from "../../workspace/code/cloud-frontend/node_modules/.pnpm/element-plus@2.9.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/form/index.js";
import { ElTableColumn as G, ElTable as H } from "../../workspace/code/cloud-frontend/node_modules/.pnpm/element-plus@2.9.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/table/index.js";
import { ElButton as K } from "../../workspace/code/cloud-frontend/node_modules/.pnpm/element-plus@2.9.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/button/index.js";
const ve = /* @__PURE__ */ M({
name: "JobList",
__name: "job",
props: {
modelValue: { required: !0 },
modelModifiers: {}
},
emits: ["update:modelValue"],
setup(q) {
const s = T(), f = k([]), b = k([]);
async function D() {
try {
const { data: e } = await $();
f.value = e;
} catch (e) {
console.log(e);
}
}
async function L() {
try {
const { data: e } = await z();
b.value = e;
} catch (e) {
console.log(e);
}
}
const g = {
id: void 0,
departmentId: void 0,
stationId: void 0
}, m = U(q, "modelValue"), n = S({
get() {
return m.value;
},
set(e) {
m.value = e;
}
});
j(async () => {
await D(), await L(), m.value.length === 0 && n.value.push({ ...g });
});
function x() {
n.value.push({
...g
});
}
function A(e) {
n.value.splice(e, 1);
}
const v = F({
departmentId: [
{
required: !0,
message: "请选择部门",
trigger: ["blur", "change"]
}
],
stationId: [
{
required: !0,
message: "请选择岗位",
trigger: ["blur", "change"]
}
]
});
return (e, Q) => {
const h = O, y = P, I = R, p = G, V = K, B = H;
return l(), u(B, {
style: { "z-index": "0", width: "800px" },
data: n.value,
"header-cell-class-name": "spec-header",
border: !0
}, {
default: a(() => [
d(p, {
prop: "departmentId",
label: "所属部门"
}, {
default: a(({ row: o, $index: i }) => [
d(I, {
prop: `deptStationDtoList.${i}.departmentId`,
rules: v.departmentId,
"inline-message": "true"
}, {
default: a(() => [
d(y, {
modelValue: o.departmentId,
"onUpdate:modelValue": (t) => o.departmentId = t,
placeholder: "请选择",
disabled: r(s).query.type === "show"
}, {
default: a(() => [
(l(!0), w(C, null, E(r(f), (t, c) => (l(), u(h, {
key: c,
label: t.name,
value: t.id
}, null, 8, ["label", "value"]))), 128))
]),
_: 2
}, 1032, ["modelValue", "onUpdate:modelValue", "disabled"])
]),
_: 2
}, 1032, ["prop", "rules"])
]),
_: 1
}),
d(p, {
prop: "stationId",
label: "所属岗位"
}, {
default: a(({ row: o, $index: i }) => [
d(I, {
prop: `deptStationDtoList.${i}.stationId`,
rules: v.stationId,
"inline-message": "true"
}, {
default: a(() => [
d(y, {
modelValue: o.stationId,
"onUpdate:modelValue": (t) => o.stationId = t,
placeholder: "请选择",
disabled: r(s).query.type === "show"
}, {
default: a(() => [
(l(!0), w(C, null, E(r(b), (t, c) => (l(), u(h, {
key: c,
label: t.name,
value: t.id
}, null, 8, ["label", "value"]))), 128))
]),
_: 2
}, 1032, ["modelValue", "onUpdate:modelValue", "disabled"])
]),
_: 2
}, 1032, ["prop", "rules"])
]),
_: 1
}),
r(s).query.type !== "show" ? (l(), u(p, {
key: 0,
prop: "address",
label: "操作",
width: "176"
}, {
default: a(({ $index: o }) => [
n.value.length > 1 ? (l(), u(V, {
key: 0,
icon: r(J),
class: "spec-btn",
onClick: (i) => A(o)
}, null, 8, ["icon", "onClick"])) : _("", !0),
o === n.value.length - 1 && n.value.length < 50 ? (l(), u(V, {
key: 1,
icon: r(N),
class: "spec-btn",
onClick: x
}, null, 8, ["icon"])) : _("", !0)
]),
_: 1
})) : _("", !0)
]),
_: 1
}, 8, ["data"]);
};
}
});
export {
ve as default
};