menu.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. import { d as S, a as A, e as P, i as V, b as B, p as I } from "./workbench2.js";
  2. 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";
  3. import { l as R, U as N, bv as O, aC as z, aD as H, cf as F } from "./index2.js";
  4. const M = {
  5. name: "WorkBench",
  6. data() {
  7. return {
  8. isPermission: !1,
  9. formVisibleView: !1,
  10. params: {
  11. quoted: 0,
  12. lookupType: {}
  13. },
  14. quoted: [
  15. { name: "全部", code: 0 },
  16. { name: "是", code: 1 },
  17. { name: "否", code: 2 }
  18. ],
  19. columns: [
  20. {
  21. title: "码表名称",
  22. dataIndex: "name",
  23. ellipsis: !0,
  24. width: "20%",
  25. isClick: !0
  26. },
  27. {
  28. title: "码表编码",
  29. dataIndex: "code",
  30. ellipsis: !0,
  31. template: !0,
  32. width: "20%"
  33. },
  34. {
  35. title: "码值数",
  36. dataIndex: "valueNums",
  37. ellipsis: !0,
  38. width: "10%"
  39. },
  40. {
  41. title: "被引用",
  42. dataIndex: "sort",
  43. ellipsis: !0,
  44. width: "10%"
  45. },
  46. {
  47. title: "描述",
  48. dataIndex: "remarks",
  49. ellipsis: !0,
  50. width: "20%"
  51. },
  52. {
  53. title: "最近更新人",
  54. dataIndex: "updateBy",
  55. ellipsis: !0,
  56. width: "20%",
  57. customRender: (t) => t.text.name + "(" + t.text.no + ")"
  58. },
  59. {
  60. title: "最近更新时间",
  61. dataIndex: "updateDate",
  62. ellipsis: !0,
  63. width: "20%"
  64. },
  65. {
  66. title: "操作",
  67. dataIndex: "action",
  68. width: "10%",
  69. align: "center"
  70. // scopedSlots: { customRender: 'action' }
  71. }
  72. ],
  73. buttons: [
  74. {
  75. name: "添加",
  76. key: "add",
  77. show: !0,
  78. disabled: !1,
  79. type: "primary",
  80. icon: !0,
  81. api: null
  82. },
  83. {
  84. name: "批量删除",
  85. key: "delete",
  86. action: "remove",
  87. show: !0,
  88. disabled: !1,
  89. icon: !0,
  90. confirm: !0,
  91. api: this.deletesApi
  92. },
  93. {
  94. name: "同步",
  95. // 按钮名称
  96. key: "synchronize"
  97. // 按钮key 可替代action按钮权限字段
  98. // show: true, // 是否显示
  99. // disabled: false, // 是否禁用 可不设置
  100. // action: 'synchronize', // 按钮权限 不传则按照 key 渲染
  101. // icon: 'sync', // 可选值:空字符串 '':不需要icon, true:需要icon 组件自从设定的iconMap中查找, 'add' 非空串:使用的icon
  102. // confirm: false, // 是否需要确认框
  103. // selection: false, // 是否需要表格批量选择的数据
  104. // api: null // 按钮对应接口api
  105. },
  106. {
  107. name: "导入",
  108. key: "import",
  109. show: !0,
  110. disabled: !1,
  111. icon: !0,
  112. api: this.importApi,
  113. templateApi: this.templateApi
  114. },
  115. {
  116. name: "导出",
  117. key: "export",
  118. show: !0,
  119. disabled: !1,
  120. icon: !0,
  121. api: null
  122. }
  123. ],
  124. treeData: []
  125. };
  126. },
  127. mounted() {
  128. },
  129. methods: {
  130. addTree(t) {
  131. console.log(t);
  132. },
  133. editTree(t) {
  134. console.log(t);
  135. },
  136. deleteTree(t) {
  137. console.log(t);
  138. },
  139. selectTree(t) {
  140. this.params.lookupType.id = t.nodeId, this.$refs.layout.reload();
  141. },
  142. // tree回调方法结束
  143. handRowAction(t, l) {
  144. l === 1 ? this.edit(t) : this.deleteApi(t);
  145. },
  146. btnCallback(t) {
  147. console.log("按钮事件回调:btnCallback =>", t), t === "add" && this.add();
  148. },
  149. deleteApi(t) {
  150. this.$confirm({
  151. title: "确认删除",
  152. content: () => U("div", { style: "color:red" }, "确认要删除该数据吗?"),
  153. onOk: () => {
  154. S(t.id).then(() => {
  155. this.$notification.success({
  156. key: "only-you",
  157. message: "操作成功",
  158. description: "删除成功"
  159. }), this.$refs.layout.reload();
  160. });
  161. }
  162. });
  163. },
  164. deletesApi(t) {
  165. return A(t);
  166. },
  167. exportApi() {
  168. return P(this.params);
  169. },
  170. importApi() {
  171. return V();
  172. },
  173. templateApi() {
  174. return B();
  175. },
  176. reset() {
  177. this.$refs.layout.reload();
  178. },
  179. page(t = {}) {
  180. return I(this.params, t).then((l) => l);
  181. },
  182. // ⬆️ 新组建方法使用
  183. paramChange() {
  184. this.$refs.layout.reload();
  185. },
  186. quotedChange() {
  187. this.$refs.layout.reload();
  188. },
  189. add() {
  190. this.$refs.layout.setStateBtn("synchronize", { disabled: !0, icon: "plus-circle" }), this.$emit("listCallback", "add");
  191. },
  192. edit(t = {}) {
  193. const l = {
  194. id: t.id
  195. };
  196. this.$open("add", l);
  197. },
  198. view(t, l) {
  199. this.formVisibleView = !0, this.$nextTick(() => {
  200. this.$refs.dataStandardLookupView.view(t);
  201. });
  202. },
  203. handApprove(t) {
  204. console.log(t);
  205. }
  206. // ⬆️ slot业务页面使用方法
  207. }
  208. }, W = ["onClick"], j = ["onClick"];
  209. function G(t, l, J, K, n, r) {
  210. 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");
  211. return u(), h(E, {
  212. id: "layout",
  213. ref: "layout",
  214. buttons: n.buttons,
  215. onReset: r.reset,
  216. onBtnCallback: r.btnCallback,
  217. onTableColCallback: r.view,
  218. columns: n.columns,
  219. loadData: r.page,
  220. title: "基础列表示例"
  221. }, D({
  222. otherBtns: a((e) => [
  223. o(x, {
  224. class: "btn",
  225. type: "primary",
  226. onClick: (s) => r.handApprove(e)
  227. }, {
  228. default: a(() => [
  229. o(k),
  230. l[11] || (l[11] = d(" 提交审核 "))
  231. ]),
  232. _: 2
  233. }, 1032, ["onClick"])
  234. ]),
  235. filter: a(() => [
  236. o(w, null, {
  237. default: a(() => [
  238. o(i, {
  239. label: t.$l("添加")
  240. }, {
  241. default: a(() => [
  242. o(p, {
  243. maxLength: 50,
  244. onPressEnter: r.paramChange,
  245. value: n.params.name,
  246. "onUpdate:value": l[0] || (l[0] = (e) => n.params.name = e),
  247. allowClear: !0,
  248. placeholder: "请输入名称或编码"
  249. }, null, 8, ["onPressEnter", "value"])
  250. ]),
  251. _: 1
  252. }, 8, ["label"]),
  253. o(i, { label: "被引用" }, {
  254. default: a(() => [
  255. o(v, {
  256. showSearch: "",
  257. allowClear: "",
  258. autoClearSearchValue: "",
  259. placeholder: "请选择",
  260. onChange: r.quotedChange,
  261. value: n.params.quoted,
  262. "onUpdate:value": l[1] || (l[1] = (e) => n.params.quoted = e)
  263. }, {
  264. default: a(() => [
  265. (u(!0), m(C, null, b(n.quoted, (e, s) => (u(), h(f, {
  266. value: e.code,
  267. key: s
  268. }, {
  269. default: a(() => [
  270. d(c(e.name), 1)
  271. ]),
  272. _: 2
  273. }, 1032, ["value"]))), 128))
  274. ]),
  275. _: 1
  276. }, 8, ["onChange", "value"])
  277. ]),
  278. _: 1
  279. }),
  280. o(i, { label: "关键字" }, {
  281. default: a(() => [
  282. o(p, {
  283. maxLength: 50,
  284. onPressEnter: r.paramChange,
  285. value: n.params.name,
  286. "onUpdate:value": l[2] || (l[2] = (e) => n.params.name = e),
  287. allowClear: !0,
  288. placeholder: "请输入名称或编码"
  289. }, null, 8, ["onPressEnter", "value"])
  290. ]),
  291. _: 1
  292. })
  293. ]),
  294. _: 1
  295. })
  296. ]),
  297. filterMore: a(() => [
  298. o(w, { type: "filter-more" }, {
  299. default: a(() => [
  300. o(i, {
  301. mb: 10,
  302. label: "更多条件一"
  303. }, {
  304. default: a(() => [
  305. o(p, {
  306. maxLength: 50,
  307. onPressEnter: r.paramChange,
  308. value: n.params.name,
  309. "onUpdate:value": l[3] || (l[3] = (e) => n.params.name = e),
  310. allowClear: !0,
  311. placeholder: "请输入名称或编码"
  312. }, null, 8, ["onPressEnter", "value"])
  313. ]),
  314. _: 1
  315. }),
  316. o(i, {
  317. mb: 10,
  318. label: "更多条件二"
  319. }, {
  320. default: a(() => [
  321. o(v, {
  322. showSearch: "",
  323. allowClear: "",
  324. autoClearSearchValue: "",
  325. placeholder: "请选择",
  326. onChange: r.quotedChange,
  327. value: n.params.quoted,
  328. "onUpdate:value": l[4] || (l[4] = (e) => n.params.quoted = e)
  329. }, {
  330. default: a(() => [
  331. (u(!0), m(C, null, b(n.quoted, (e, s) => (u(), h(f, {
  332. value: e.code,
  333. key: s
  334. }, {
  335. default: a(() => [
  336. d(c(e.name), 1)
  337. ]),
  338. _: 2
  339. }, 1032, ["value"]))), 128))
  340. ]),
  341. _: 1
  342. }, 8, ["onChange", "value"])
  343. ]),
  344. _: 1
  345. }),
  346. o(i, {
  347. mb: 10,
  348. label: "更多条件一"
  349. }, {
  350. default: a(() => [
  351. o(p, {
  352. maxLength: 50,
  353. onPressEnter: r.paramChange,
  354. value: n.params.name,
  355. "onUpdate:value": l[5] || (l[5] = (e) => n.params.name = e),
  356. allowClear: !0,
  357. placeholder: "请输入名称或编码"
  358. }, null, 8, ["onPressEnter", "value"])
  359. ]),
  360. _: 1
  361. }),
  362. o(i, {
  363. mb: 10,
  364. label: "更多条件二"
  365. }, {
  366. default: a(() => [
  367. o(v, {
  368. showSearch: "",
  369. allowClear: "",
  370. autoClearSearchValue: "",
  371. placeholder: "请选择",
  372. onChange: r.quotedChange,
  373. value: n.params.quoted,
  374. "onUpdate:value": l[6] || (l[6] = (e) => n.params.quoted = e)
  375. }, {
  376. default: a(() => [
  377. (u(!0), m(C, null, b(n.quoted, (e, s) => (u(), h(f, {
  378. value: e.code,
  379. key: s
  380. }, {
  381. default: a(() => [
  382. d(c(e.name), 1)
  383. ]),
  384. _: 2
  385. }, 1032, ["value"]))), 128))
  386. ]),
  387. _: 1
  388. }, 8, ["onChange", "value"])
  389. ]),
  390. _: 1
  391. }),
  392. o(i, {
  393. mb: 10,
  394. label: "更多条件一"
  395. }, {
  396. default: a(() => [
  397. o(p, {
  398. maxLength: 50,
  399. onPressEnter: r.paramChange,
  400. value: n.params.name,
  401. "onUpdate:value": l[7] || (l[7] = (e) => n.params.name = e),
  402. allowClear: !0,
  403. placeholder: "请输入名称或编码"
  404. }, null, 8, ["onPressEnter", "value"])
  405. ]),
  406. _: 1
  407. }),
  408. o(i, {
  409. mb: 10,
  410. label: "更多条件二"
  411. }, {
  412. default: a(() => [
  413. o(v, {
  414. showSearch: "",
  415. allowClear: "",
  416. autoClearSearchValue: "",
  417. placeholder: "请选择",
  418. onChange: r.quotedChange,
  419. value: n.params.quoted,
  420. "onUpdate:value": l[8] || (l[8] = (e) => n.params.quoted = e)
  421. }, {
  422. default: a(() => [
  423. (u(!0), m(C, null, b(n.quoted, (e, s) => (u(), h(f, {
  424. value: e.code,
  425. key: s
  426. }, {
  427. default: a(() => [
  428. d(c(e.name), 1)
  429. ]),
  430. _: 2
  431. }, 1032, ["value"]))), 128))
  432. ]),
  433. _: 1
  434. }, 8, ["onChange", "value"])
  435. ]),
  436. _: 1
  437. }),
  438. o(i, {
  439. mb: 10,
  440. label: "更多条件一"
  441. }, {
  442. default: a(() => [
  443. o(p, {
  444. maxLength: 50,
  445. onPressEnter: r.paramChange,
  446. value: n.params.name,
  447. "onUpdate:value": l[9] || (l[9] = (e) => n.params.name = e),
  448. allowClear: !0,
  449. placeholder: "请输入名称或编码"
  450. }, null, 8, ["onPressEnter", "value"])
  451. ]),
  452. _: 1
  453. }),
  454. o(i, {
  455. mb: 10,
  456. label: "更多条件二"
  457. }, {
  458. default: a(() => [
  459. o(v, {
  460. showSearch: "",
  461. allowClear: "",
  462. autoClearSearchValue: "",
  463. placeholder: "请选择",
  464. onChange: r.quotedChange,
  465. value: n.params.quoted,
  466. "onUpdate:value": l[10] || (l[10] = (e) => n.params.quoted = e)
  467. }, {
  468. default: a(() => [
  469. (u(!0), m(C, null, b(n.quoted, (e, s) => (u(), h(f, {
  470. value: e.code,
  471. key: s
  472. }, {
  473. default: a(() => [
  474. d(c(e.name), 1)
  475. ]),
  476. _: 2
  477. }, 1032, ["value"]))), 128))
  478. ]),
  479. _: 1
  480. }, 8, ["onChange", "value"])
  481. ]),
  482. _: 1
  483. })
  484. ]),
  485. _: 1
  486. })
  487. ]),
  488. code: a(({ text: e }) => [
  489. L("div", null, c(e), 1)
  490. ]),
  491. action: a(({ record: e }) => [
  492. y((u(), m("a", {
  493. onClick: (s) => r.handRowAction(e, 1)
  494. }, l[12] || (l[12] = [
  495. d("修改")
  496. ]), 8, W)), [
  497. [_, "edit"]
  498. ]),
  499. y(o(q, { type: "vertical" }, null, 512), [
  500. [_, "remove"]
  501. ]),
  502. y((u(), m("a", {
  503. onClick: (s) => r.handRowAction(e, 2)
  504. }, l[13] || (l[13] = [
  505. d("删除")
  506. ]), 8, j)), [
  507. [_, "remove"]
  508. ])
  509. ]),
  510. other: a(() => []),
  511. _: 2
  512. }, [
  513. n.isPermission ? {
  514. name: "empty",
  515. fn: a(() => [
  516. l[14] || (l[14] = d("抱歉 没有访问权限"))
  517. ]),
  518. key: "0"
  519. } : void 0
  520. ]), 1032, ["buttons", "onReset", "onBtnCallback", "onTableColCallback", "columns", "loadData"]);
  521. }
  522. const Z = /* @__PURE__ */ R(M, [["render", G]]);
  523. export {
  524. Z as default
  525. };