index7.js 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. import { d as v, a as b, e as g, i as T, b as _, p as x } from "./workbench2.js";
  2. import { l as w, cq as c, aM as A, aN as I, U as E, cf as B } from "./index2.js";
  3. import { h as D, resolveComponent as m, resolveDirective as S, openBlock as r, createBlock as V, createSlots as $, withCtx as a, createVNode as d, createTextVNode as n, createElementVNode as L, toDisplayString as N, withDirectives as u, createElementBlock as f } from "vue";
  4. const O = {
  5. name: "SHigherDemo",
  6. components: {},
  7. data() {
  8. return {
  9. isPermission: !1,
  10. formVisibleView: !1,
  11. params: {
  12. quoted: 0,
  13. lookupType: {}
  14. },
  15. quoted: [
  16. { name: "全部", code: 0 },
  17. { name: "是", code: 1 },
  18. { name: "否", code: 2 }
  19. ],
  20. columns: [],
  21. buttons: [
  22. {
  23. name: "添加",
  24. key: "add",
  25. show: !0,
  26. disabled: !1,
  27. type: "primary",
  28. icon: !0,
  29. api: null
  30. },
  31. {
  32. name: "批量删除",
  33. key: "delete",
  34. action: "remove",
  35. show: !0,
  36. disabled: !1,
  37. icon: !0,
  38. confirm: !0,
  39. api: this.deletesApi
  40. },
  41. {
  42. name: "同步",
  43. // 按钮名称
  44. key: "synchronize"
  45. // 按钮key 可替代action按钮权限字段
  46. // show: true, // 是否显示
  47. // disabled: false, // 是否禁用 可不设置
  48. // action: 'synchronize', // 按钮权限 不传则按照 key 渲染
  49. // icon: 'sync', // 可选值:空字符串 '':不需要icon, true:需要icon 组件自从设定的iconMap中查找, 'add' 非空串:使用的icon
  50. // confirm: false, // 是否需要确认框
  51. // selection: false, // 是否需要表格批量选择的数据
  52. // api: null // 按钮对应接口api
  53. },
  54. {
  55. name: "导入",
  56. key: "import",
  57. show: !0,
  58. disabled: !1,
  59. icon: !0,
  60. api: this.importApi,
  61. templateApi: this.templateApi
  62. },
  63. {
  64. name: "导出",
  65. key: "export",
  66. show: !0,
  67. disabled: !1,
  68. icon: !0,
  69. api: null
  70. }
  71. ]
  72. };
  73. },
  74. mounted() {
  75. this.columns = [
  76. {
  77. title: "码表名称",
  78. dataIndex: "name",
  79. ellipsis: !0,
  80. isClick: !0,
  81. width: 300,
  82. filterConfig: {
  83. filterType: "INPUT"
  84. }
  85. },
  86. {
  87. title: "码表编码",
  88. dataIndex: "code",
  89. ellipsis: !0,
  90. template: !0,
  91. width: 300,
  92. filterConfig: {
  93. filterType: "SINGLE_SELECT",
  94. filterApi: c,
  95. props: {
  96. key: "label",
  97. value: "value"
  98. }
  99. }
  100. },
  101. {
  102. title: "码值数",
  103. dataIndex: "valueNums",
  104. ellipsis: !0,
  105. width: 300,
  106. filterConfig: {
  107. filterType: "MULTIPLE_SELECT",
  108. filterData: [
  109. {
  110. name: "是",
  111. value: 1
  112. },
  113. {
  114. name: "否",
  115. value: 0
  116. }
  117. ]
  118. }
  119. },
  120. {
  121. title: "被引用",
  122. dataIndex: "sort",
  123. ellipsis: !0,
  124. width: 300,
  125. filterConfig: {
  126. filterType: "DATETIME",
  127. filterApi: null,
  128. filterData: [
  129. {
  130. name: "男",
  131. value: 1
  132. },
  133. {
  134. name: "女",
  135. value: 0
  136. }
  137. ]
  138. }
  139. },
  140. {
  141. title: "描述",
  142. dataIndex: "remarks",
  143. ellipsis: !0,
  144. width: 300,
  145. filterConfig: {
  146. filterType: "FLOAT",
  147. precision: 4,
  148. step: 1e-4,
  149. minValue: 1e-4,
  150. maxValue: 9999,
  151. filterData: [
  152. {
  153. name: "是",
  154. value: 1
  155. },
  156. {
  157. name: "否",
  158. value: 0
  159. }
  160. ]
  161. }
  162. },
  163. {
  164. title: "最近更新人",
  165. dataIndex: "updateBy",
  166. ellipsis: !0,
  167. width: 300,
  168. customRender: (e) => e.text.name + "(" + e.text.no + ")",
  169. filterConfig: {
  170. filterType: "USER"
  171. }
  172. },
  173. {
  174. title: "最近更新时间",
  175. dataIndex: "updateDate",
  176. ellipsis: !0,
  177. width: 300,
  178. filterConfig: {
  179. filterType: "OFFICE"
  180. }
  181. },
  182. {
  183. title: "操作",
  184. dataIndex: "action",
  185. align: "center",
  186. fixed: "right",
  187. width: 100
  188. // scopedSlots: { customRender: 'action' }
  189. }
  190. ];
  191. },
  192. methods: {
  193. demoSelectApi() {
  194. return c();
  195. },
  196. levelOneChildren(e) {
  197. return A(e);
  198. },
  199. levelTwoChildren(e) {
  200. return I(e);
  201. },
  202. // tree 事件回调
  203. treeCallback(e, t) {
  204. this[e + "Tree"](t);
  205. },
  206. addTree(e) {
  207. console.log(e);
  208. },
  209. editTree(e) {
  210. console.log(e);
  211. },
  212. deleteTree(e) {
  213. console.log(e);
  214. },
  215. selectTree(e) {
  216. this.params.lookupType.id = e.nodeId, this.$refs.layout.reload();
  217. },
  218. // tree回调方法结束
  219. handRowAction(e, t) {
  220. t === 1 ? this.edit(e) : this.deleteApi(e);
  221. },
  222. btnCallback(e) {
  223. console.log("按钮事件回调:btnCallback =>", e), e === "add" && this.add();
  224. },
  225. deleteApi(e) {
  226. this.$confirm({
  227. title: "确认删除",
  228. content: () => D("div", { style: "color:red" }, "确认要删除该数据吗?"),
  229. onOk: () => {
  230. v(e.id).then(() => {
  231. this.$notification.success({
  232. key: "only-you",
  233. message: "操作成功",
  234. description: "删除成功"
  235. }), this.$refs.layout.reload();
  236. });
  237. }
  238. });
  239. },
  240. deletesApi(e) {
  241. return b(e);
  242. },
  243. exportApi() {
  244. return g(this.params);
  245. },
  246. importApi() {
  247. return T();
  248. },
  249. templateApi() {
  250. return _();
  251. },
  252. reset() {
  253. this.$refs.layout.reload();
  254. },
  255. page(e = {}) {
  256. return x(this.params, e).then((t) => t);
  257. },
  258. // ⬆️ 新组建方法使用
  259. paramChange() {
  260. this.$refs.layout.reload();
  261. },
  262. quotedChange() {
  263. this.$refs.layout.reload();
  264. },
  265. add() {
  266. this.$refs.layout.setStateBtn("synchronize", { disabled: !0, icon: "plus-circle" }), this.$emit("listCallback", "add");
  267. },
  268. edit(e = {}) {
  269. const t = {
  270. id: e.id
  271. };
  272. this.$open("add", t);
  273. },
  274. view(e, t) {
  275. console.log("field:", t), this.formVisibleView = !0, this.$nextTick(() => {
  276. this.$refs.dataStandardLookupView.view(e);
  277. });
  278. },
  279. handApprove(e) {
  280. console.log(e);
  281. }
  282. // ⬆️ slot业务页面使用方法
  283. }
  284. }, R = ["onClick"], q = ["onClick"];
  285. function P(e, t, U, F, o, i) {
  286. const h = m("HighlightOutlined"), y = E, C = B, k = m("s-super-list-layout"), s = S("action");
  287. return r(), V(k, {
  288. id: "layout",
  289. ref: "layout",
  290. buttons: o.buttons,
  291. onReset: i.reset,
  292. onBtnCallback: i.btnCallback,
  293. onTableColCallback: i.view,
  294. columns: o.columns,
  295. loadData: i.page,
  296. title: "基础列表示例"
  297. }, $({
  298. otherBtns: a((l) => [
  299. d(y, {
  300. class: "btn",
  301. type: "primary",
  302. onClick: (p) => i.handApprove(l)
  303. }, {
  304. default: a(() => [
  305. d(h),
  306. t[0] || (t[0] = n(" 提交审核 "))
  307. ]),
  308. _: 2
  309. }, 1032, ["onClick"])
  310. ]),
  311. code: a(({ text: l }) => [
  312. L("div", null, N(l), 1)
  313. ]),
  314. action: a(({ record: l }) => [
  315. u((r(), f("a", {
  316. onClick: (p) => i.handRowAction(l, 1)
  317. }, t[1] || (t[1] = [
  318. n("修改")
  319. ]), 8, R)), [
  320. [s, "edit"]
  321. ]),
  322. u(d(C, { type: "vertical" }, null, 512), [
  323. [s, "remove"]
  324. ]),
  325. u((r(), f("a", {
  326. onClick: (p) => i.handRowAction(l, 2)
  327. }, t[2] || (t[2] = [
  328. n("删除")
  329. ]), 8, q)), [
  330. [s, "remove"]
  331. ])
  332. ]),
  333. other: a(() => []),
  334. _: 2
  335. }, [
  336. o.isPermission ? {
  337. name: "empty",
  338. fn: a(() => [
  339. t[3] || (t[3] = n("抱歉 没有访问权限"))
  340. ]),
  341. key: "0"
  342. } : void 0
  343. ]), 1032, ["buttons", "onReset", "onBtnCallback", "onTableColCallback", "columns", "loadData"]);
  344. }
  345. const G = /* @__PURE__ */ w(O, [["render", P]]);
  346. export {
  347. G as default
  348. };