| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525 |
- import { d as S, a as A, e as P, i as V, b as B, p as I } from "./workbench2.js";
- import { h as U, resolveComponent as g, resolveDirective as T, openBlock as u, createBlock as h, createSlots as D, withCtx as a, createVNode as o, createTextVNode as d, createElementBlock as m, Fragment as C, renderList as b, toDisplayString as c, createElementVNode as L, withDirectives as y } from "vue";
- import { l as R, U as N, bv as O, aC as z, aD as H, cf as F } from "./index2.js";
- const M = {
- name: "WorkBench",
- data() {
- return {
- isPermission: !1,
- formVisibleView: !1,
- params: {
- quoted: 0,
- lookupType: {}
- },
- quoted: [
- { name: "全部", code: 0 },
- { name: "是", code: 1 },
- { name: "否", code: 2 }
- ],
- columns: [
- {
- title: "码表名称",
- dataIndex: "name",
- ellipsis: !0,
- width: "20%",
- isClick: !0
- },
- {
- title: "码表编码",
- dataIndex: "code",
- ellipsis: !0,
- template: !0,
- width: "20%"
- },
- {
- title: "码值数",
- dataIndex: "valueNums",
- ellipsis: !0,
- width: "10%"
- },
- {
- title: "被引用",
- dataIndex: "sort",
- ellipsis: !0,
- width: "10%"
- },
- {
- title: "描述",
- dataIndex: "remarks",
- ellipsis: !0,
- width: "20%"
- },
- {
- title: "最近更新人",
- dataIndex: "updateBy",
- ellipsis: !0,
- width: "20%",
- customRender: (t) => t.text.name + "(" + t.text.no + ")"
- },
- {
- title: "最近更新时间",
- dataIndex: "updateDate",
- ellipsis: !0,
- width: "20%"
- },
- {
- title: "操作",
- dataIndex: "action",
- width: "10%",
- align: "center"
- // scopedSlots: { customRender: 'action' }
- }
- ],
- buttons: [
- {
- name: "添加",
- key: "add",
- show: !0,
- disabled: !1,
- type: "primary",
- icon: !0,
- api: null
- },
- {
- name: "批量删除",
- key: "delete",
- action: "remove",
- show: !0,
- disabled: !1,
- icon: !0,
- confirm: !0,
- api: this.deletesApi
- },
- {
- name: "同步",
- // 按钮名称
- key: "synchronize"
- // 按钮key 可替代action按钮权限字段
- // show: true, // 是否显示
- // disabled: false, // 是否禁用 可不设置
- // action: 'synchronize', // 按钮权限 不传则按照 key 渲染
- // icon: 'sync', // 可选值:空字符串 '':不需要icon, true:需要icon 组件自从设定的iconMap中查找, 'add' 非空串:使用的icon
- // confirm: false, // 是否需要确认框
- // selection: false, // 是否需要表格批量选择的数据
- // api: null // 按钮对应接口api
- },
- {
- name: "导入",
- key: "import",
- show: !0,
- disabled: !1,
- icon: !0,
- api: this.importApi,
- templateApi: this.templateApi
- },
- {
- name: "导出",
- key: "export",
- show: !0,
- disabled: !1,
- icon: !0,
- api: null
- }
- ],
- treeData: []
- };
- },
- mounted() {
- },
- methods: {
- addTree(t) {
- console.log(t);
- },
- editTree(t) {
- console.log(t);
- },
- deleteTree(t) {
- console.log(t);
- },
- selectTree(t) {
- this.params.lookupType.id = t.nodeId, this.$refs.layout.reload();
- },
- // tree回调方法结束
- handRowAction(t, l) {
- l === 1 ? this.edit(t) : this.deleteApi(t);
- },
- btnCallback(t) {
- console.log("按钮事件回调:btnCallback =>", t), t === "add" && this.add();
- },
- deleteApi(t) {
- this.$confirm({
- title: "确认删除",
- content: () => U("div", { style: "color:red" }, "确认要删除该数据吗?"),
- onOk: () => {
- S(t.id).then(() => {
- this.$notification.success({
- key: "only-you",
- message: "操作成功",
- description: "删除成功"
- }), this.$refs.layout.reload();
- });
- }
- });
- },
- deletesApi(t) {
- return A(t);
- },
- exportApi() {
- return P(this.params);
- },
- importApi() {
- return V();
- },
- templateApi() {
- return B();
- },
- reset() {
- this.$refs.layout.reload();
- },
- page(t = {}) {
- return I(this.params, t).then((l) => l);
- },
- // ⬆️ 新组建方法使用
- paramChange() {
- this.$refs.layout.reload();
- },
- quotedChange() {
- this.$refs.layout.reload();
- },
- add() {
- this.$refs.layout.setStateBtn("synchronize", { disabled: !0, icon: "plus-circle" }), this.$emit("listCallback", "add");
- },
- edit(t = {}) {
- const l = {
- id: t.id
- };
- this.$open("add", l);
- },
- view(t, l) {
- this.formVisibleView = !0, this.$nextTick(() => {
- this.$refs.dataStandardLookupView.view(t);
- });
- },
- handApprove(t) {
- console.log(t);
- }
- // ⬆️ slot业务页面使用方法
- }
- }, W = ["onClick"], j = ["onClick"];
- function G(t, l, J, K, n, r) {
- const k = g("HighlightOutlined"), x = N, p = O, i = g("s-filter-item"), f = z, v = H, w = g("s-filter-wrap"), q = F, E = g("s-list-layout"), _ = T("action");
- return u(), h(E, {
- id: "layout",
- ref: "layout",
- buttons: n.buttons,
- onReset: r.reset,
- onBtnCallback: r.btnCallback,
- onTableColCallback: r.view,
- columns: n.columns,
- loadData: r.page,
- title: "基础列表示例"
- }, D({
- otherBtns: a((e) => [
- o(x, {
- class: "btn",
- type: "primary",
- onClick: (s) => r.handApprove(e)
- }, {
- default: a(() => [
- o(k),
- l[11] || (l[11] = d(" 提交审核 "))
- ]),
- _: 2
- }, 1032, ["onClick"])
- ]),
- filter: a(() => [
- o(w, null, {
- default: a(() => [
- o(i, {
- label: t.$l("添加")
- }, {
- default: a(() => [
- o(p, {
- maxLength: 50,
- onPressEnter: r.paramChange,
- value: n.params.name,
- "onUpdate:value": l[0] || (l[0] = (e) => n.params.name = e),
- allowClear: !0,
- placeholder: "请输入名称或编码"
- }, null, 8, ["onPressEnter", "value"])
- ]),
- _: 1
- }, 8, ["label"]),
- o(i, { label: "被引用" }, {
- default: a(() => [
- o(v, {
- showSearch: "",
- allowClear: "",
- autoClearSearchValue: "",
- placeholder: "请选择",
- onChange: r.quotedChange,
- value: n.params.quoted,
- "onUpdate:value": l[1] || (l[1] = (e) => n.params.quoted = e)
- }, {
- default: a(() => [
- (u(!0), m(C, null, b(n.quoted, (e, s) => (u(), h(f, {
- value: e.code,
- key: s
- }, {
- default: a(() => [
- d(c(e.name), 1)
- ]),
- _: 2
- }, 1032, ["value"]))), 128))
- ]),
- _: 1
- }, 8, ["onChange", "value"])
- ]),
- _: 1
- }),
- o(i, { label: "关键字" }, {
- default: a(() => [
- o(p, {
- maxLength: 50,
- onPressEnter: r.paramChange,
- value: n.params.name,
- "onUpdate:value": l[2] || (l[2] = (e) => n.params.name = e),
- allowClear: !0,
- placeholder: "请输入名称或编码"
- }, null, 8, ["onPressEnter", "value"])
- ]),
- _: 1
- })
- ]),
- _: 1
- })
- ]),
- filterMore: a(() => [
- o(w, { type: "filter-more" }, {
- default: a(() => [
- o(i, {
- mb: 10,
- label: "更多条件一"
- }, {
- default: a(() => [
- o(p, {
- maxLength: 50,
- onPressEnter: r.paramChange,
- value: n.params.name,
- "onUpdate:value": l[3] || (l[3] = (e) => n.params.name = e),
- allowClear: !0,
- placeholder: "请输入名称或编码"
- }, null, 8, ["onPressEnter", "value"])
- ]),
- _: 1
- }),
- o(i, {
- mb: 10,
- label: "更多条件二"
- }, {
- default: a(() => [
- o(v, {
- showSearch: "",
- allowClear: "",
- autoClearSearchValue: "",
- placeholder: "请选择",
- onChange: r.quotedChange,
- value: n.params.quoted,
- "onUpdate:value": l[4] || (l[4] = (e) => n.params.quoted = e)
- }, {
- default: a(() => [
- (u(!0), m(C, null, b(n.quoted, (e, s) => (u(), h(f, {
- value: e.code,
- key: s
- }, {
- default: a(() => [
- d(c(e.name), 1)
- ]),
- _: 2
- }, 1032, ["value"]))), 128))
- ]),
- _: 1
- }, 8, ["onChange", "value"])
- ]),
- _: 1
- }),
- o(i, {
- mb: 10,
- label: "更多条件一"
- }, {
- default: a(() => [
- o(p, {
- maxLength: 50,
- onPressEnter: r.paramChange,
- value: n.params.name,
- "onUpdate:value": l[5] || (l[5] = (e) => n.params.name = e),
- allowClear: !0,
- placeholder: "请输入名称或编码"
- }, null, 8, ["onPressEnter", "value"])
- ]),
- _: 1
- }),
- o(i, {
- mb: 10,
- label: "更多条件二"
- }, {
- default: a(() => [
- o(v, {
- showSearch: "",
- allowClear: "",
- autoClearSearchValue: "",
- placeholder: "请选择",
- onChange: r.quotedChange,
- value: n.params.quoted,
- "onUpdate:value": l[6] || (l[6] = (e) => n.params.quoted = e)
- }, {
- default: a(() => [
- (u(!0), m(C, null, b(n.quoted, (e, s) => (u(), h(f, {
- value: e.code,
- key: s
- }, {
- default: a(() => [
- d(c(e.name), 1)
- ]),
- _: 2
- }, 1032, ["value"]))), 128))
- ]),
- _: 1
- }, 8, ["onChange", "value"])
- ]),
- _: 1
- }),
- o(i, {
- mb: 10,
- label: "更多条件一"
- }, {
- default: a(() => [
- o(p, {
- maxLength: 50,
- onPressEnter: r.paramChange,
- value: n.params.name,
- "onUpdate:value": l[7] || (l[7] = (e) => n.params.name = e),
- allowClear: !0,
- placeholder: "请输入名称或编码"
- }, null, 8, ["onPressEnter", "value"])
- ]),
- _: 1
- }),
- o(i, {
- mb: 10,
- label: "更多条件二"
- }, {
- default: a(() => [
- o(v, {
- showSearch: "",
- allowClear: "",
- autoClearSearchValue: "",
- placeholder: "请选择",
- onChange: r.quotedChange,
- value: n.params.quoted,
- "onUpdate:value": l[8] || (l[8] = (e) => n.params.quoted = e)
- }, {
- default: a(() => [
- (u(!0), m(C, null, b(n.quoted, (e, s) => (u(), h(f, {
- value: e.code,
- key: s
- }, {
- default: a(() => [
- d(c(e.name), 1)
- ]),
- _: 2
- }, 1032, ["value"]))), 128))
- ]),
- _: 1
- }, 8, ["onChange", "value"])
- ]),
- _: 1
- }),
- o(i, {
- mb: 10,
- label: "更多条件一"
- }, {
- default: a(() => [
- o(p, {
- maxLength: 50,
- onPressEnter: r.paramChange,
- value: n.params.name,
- "onUpdate:value": l[9] || (l[9] = (e) => n.params.name = e),
- allowClear: !0,
- placeholder: "请输入名称或编码"
- }, null, 8, ["onPressEnter", "value"])
- ]),
- _: 1
- }),
- o(i, {
- mb: 10,
- label: "更多条件二"
- }, {
- default: a(() => [
- o(v, {
- showSearch: "",
- allowClear: "",
- autoClearSearchValue: "",
- placeholder: "请选择",
- onChange: r.quotedChange,
- value: n.params.quoted,
- "onUpdate:value": l[10] || (l[10] = (e) => n.params.quoted = e)
- }, {
- default: a(() => [
- (u(!0), m(C, null, b(n.quoted, (e, s) => (u(), h(f, {
- value: e.code,
- key: s
- }, {
- default: a(() => [
- d(c(e.name), 1)
- ]),
- _: 2
- }, 1032, ["value"]))), 128))
- ]),
- _: 1
- }, 8, ["onChange", "value"])
- ]),
- _: 1
- })
- ]),
- _: 1
- })
- ]),
- code: a(({ text: e }) => [
- L("div", null, c(e), 1)
- ]),
- action: a(({ record: e }) => [
- y((u(), m("a", {
- onClick: (s) => r.handRowAction(e, 1)
- }, l[12] || (l[12] = [
- d("修改")
- ]), 8, W)), [
- [_, "edit"]
- ]),
- y(o(q, { type: "vertical" }, null, 512), [
- [_, "remove"]
- ]),
- y((u(), m("a", {
- onClick: (s) => r.handRowAction(e, 2)
- }, l[13] || (l[13] = [
- d("删除")
- ]), 8, j)), [
- [_, "remove"]
- ])
- ]),
- other: a(() => []),
- _: 2
- }, [
- n.isPermission ? {
- name: "empty",
- fn: a(() => [
- l[14] || (l[14] = d("抱歉 没有访问权限"))
- ]),
- key: "0"
- } : void 0
- ]), 1032, ["buttons", "onReset", "onBtnCallback", "onTableColCallback", "columns", "loadData"]);
- }
- const Z = /* @__PURE__ */ R(M, [["render", G]]);
- export {
- Z as default
- };
|