@xjw_/vue3-npm-system 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import Cookies from "js-cookie";
2
2
  import axios from "axios";
3
- import { ElMessage, ElInput, ElOption, ElCascader, ElDatePicker, ElSelect } from "element-plus";
4
- import { defineComponent, computed, openBlock, createElementBlock, mergeProps, createElementVNode, ref, watch, resolveComponent, createBlock, provide, withCtx, createVNode, normalizeStyle, renderSlot, inject, normalizeClass, createCommentVNode, Fragment, renderList, createSlots, getCurrentInstance, toDisplayString, useSlots, onMounted, unref, withKeys, createTextVNode, withDirectives, resolveDynamicComponent, vShow, nextTick, normalizeProps, guardReactiveProps, reactive } from "vue";
3
+ import { ElMessage, ElInput, ElOption, ElCascader, ElDatePicker, ElSelect, ElMessageBox } from "element-plus";
4
+ import { defineComponent, computed, openBlock, createElementBlock, mergeProps, createElementVNode, ref, watch, resolveComponent, createBlock, provide, withCtx, createVNode, normalizeStyle, renderSlot, inject, normalizeClass, createCommentVNode, Fragment, renderList, createSlots, getCurrentInstance, toDisplayString, useSlots, onMounted, unref, withKeys, createTextVNode, withDirectives, resolveDynamicComponent, vShow, nextTick, normalizeProps, guardReactiveProps, reactive, withModifiers } from "vue";
5
5
  function debounce$1(func, wait) {
6
6
  let timeout = null;
7
7
  return function(...args) {
@@ -1301,25 +1301,25 @@ const _hoisted_5$3 = ["onClick"];
1301
1301
  const _hoisted_6$3 = { class: "report-text-primary" };
1302
1302
  const _hoisted_7$3 = { class: "report-text-primary" };
1303
1303
  const _hoisted_8$3 = { class: "report-text-primary" };
1304
- const _hoisted_9$1 = { class: "report-flex report-justify-between" };
1305
- const _hoisted_10$1 = { class: "" };
1306
- const _hoisted_11$1 = { class: "" };
1307
- const _hoisted_12$1 = { key: 0 };
1308
- const _hoisted_13$1 = { class: "" };
1309
- const _hoisted_14$1 = { class: "" };
1310
- const _hoisted_15$1 = { key: 1 };
1311
- const _hoisted_16$1 = { class: "" };
1312
- const _hoisted_17$1 = { class: "" };
1313
- const _hoisted_18 = { class: "" };
1314
- const _hoisted_19 = { class: "" };
1315
- const _hoisted_20 = { class: "report-body" };
1316
- const _hoisted_21 = { class: "report-flex report-justify-between" };
1317
- const _hoisted_22 = { class: "" };
1318
- const _hoisted_23 = { class: "" };
1319
- const _hoisted_24 = { key: 0 };
1320
- const _hoisted_25 = { class: "" };
1321
- const _hoisted_26 = { class: "" };
1322
- const _hoisted_27 = { class: "" };
1304
+ const _hoisted_9$2 = { class: "report-flex report-justify-between" };
1305
+ const _hoisted_10$2 = { class: "" };
1306
+ const _hoisted_11$2 = { class: "" };
1307
+ const _hoisted_12$2 = { key: 0 };
1308
+ const _hoisted_13$2 = { class: "" };
1309
+ const _hoisted_14$2 = { class: "" };
1310
+ const _hoisted_15$2 = { key: 1 };
1311
+ const _hoisted_16$2 = { class: "" };
1312
+ const _hoisted_17$2 = { class: "" };
1313
+ const _hoisted_18$1 = { class: "" };
1314
+ const _hoisted_19$1 = { class: "" };
1315
+ const _hoisted_20$1 = { class: "report-body" };
1316
+ const _hoisted_21$1 = { class: "report-flex report-justify-between" };
1317
+ const _hoisted_22$1 = { class: "" };
1318
+ const _hoisted_23$1 = { class: "" };
1319
+ const _hoisted_24$1 = { key: 0 };
1320
+ const _hoisted_25$1 = { class: "" };
1321
+ const _hoisted_26$1 = { class: "" };
1322
+ const _hoisted_27$1 = { class: "" };
1323
1323
  const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1324
1324
  __name: "XReportTable",
1325
1325
  props: {
@@ -1564,30 +1564,30 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1564
1564
  ref_key: "reportHeaderRef",
1565
1565
  ref: reportHeaderRef
1566
1566
  }, [
1567
- createElementVNode("div", _hoisted_9$1, [
1567
+ createElementVNode("div", _hoisted_9$2, [
1568
1568
  createElementVNode("div", null, [
1569
1569
  _cache[3] || (_cache[3] = createElementVNode("span", { class: "" }, "制表单位:", -1)),
1570
- createElementVNode("span", _hoisted_10$1, toDisplayString(organizationNameDisplay.value), 1)
1570
+ createElementVNode("span", _hoisted_10$2, toDisplayString(organizationNameDisplay.value), 1)
1571
1571
  ]),
1572
1572
  createElementVNode("div", null, [
1573
1573
  _cache[4] || (_cache[4] = createElementVNode("span", { class: "" }, "日期范围:", -1)),
1574
- createElementVNode("span", _hoisted_11$1, toDisplayString(dateRangeDisplay.value), 1)
1574
+ createElementVNode("span", _hoisted_11$2, toDisplayString(dateRangeDisplay.value), 1)
1575
1575
  ]),
1576
- __props.customHeader1Label ? (openBlock(), createElementBlock("div", _hoisted_12$1, [
1577
- createElementVNode("span", _hoisted_13$1, toDisplayString(__props.customHeader1Label) + ":", 1),
1578
- createElementVNode("span", _hoisted_14$1, toDisplayString(__props.customHeader1 || ""), 1)
1576
+ __props.customHeader1Label ? (openBlock(), createElementBlock("div", _hoisted_12$2, [
1577
+ createElementVNode("span", _hoisted_13$2, toDisplayString(__props.customHeader1Label) + ":", 1),
1578
+ createElementVNode("span", _hoisted_14$2, toDisplayString(__props.customHeader1 || ""), 1)
1579
1579
  ])) : createCommentVNode("", true),
1580
- __props.customHeader2Label ? (openBlock(), createElementBlock("div", _hoisted_15$1, [
1581
- createElementVNode("span", _hoisted_16$1, toDisplayString(__props.customHeader2Label) + ":", 1),
1582
- createElementVNode("span", _hoisted_17$1, toDisplayString(__props.customHeader2 || ""), 1)
1580
+ __props.customHeader2Label ? (openBlock(), createElementBlock("div", _hoisted_15$2, [
1581
+ createElementVNode("span", _hoisted_16$2, toDisplayString(__props.customHeader2Label) + ":", 1),
1582
+ createElementVNode("span", _hoisted_17$2, toDisplayString(__props.customHeader2 || ""), 1)
1583
1583
  ])) : createCommentVNode("", true),
1584
1584
  createElementVNode("div", null, [
1585
- createElementVNode("span", _hoisted_18, toDisplayString(__props.customHeader3Label) + toDisplayString(__props.customHeader3Label ? ":" : ""), 1),
1586
- createElementVNode("span", _hoisted_19, toDisplayString(__props.customHeader3 || ""), 1)
1585
+ createElementVNode("span", _hoisted_18$1, toDisplayString(__props.customHeader3Label) + toDisplayString(__props.customHeader3Label ? ":" : ""), 1),
1586
+ createElementVNode("span", _hoisted_19$1, toDisplayString(__props.customHeader3 || ""), 1)
1587
1587
  ])
1588
1588
  ])
1589
1589
  ], 512),
1590
- createElementVNode("div", _hoisted_20, [
1590
+ createElementVNode("div", _hoisted_20$1, [
1591
1591
  createVNode(XVxeTable, {
1592
1592
  ref_key: "repVxeTableRef",
1593
1593
  ref: repVxeTableRef,
@@ -1619,22 +1619,22 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1619
1619
  ref_key: "reportFooterRef",
1620
1620
  ref: reportFooterRef
1621
1621
  }, [
1622
- createElementVNode("div", _hoisted_21, [
1622
+ createElementVNode("div", _hoisted_21$1, [
1623
1623
  createElementVNode("div", null, [
1624
1624
  _cache[5] || (_cache[5] = createElementVNode("span", { class: "" }, "审核人员:", -1)),
1625
- createElementVNode("span", _hoisted_22, toDisplayString(__props.auditorName || ""), 1)
1625
+ createElementVNode("span", _hoisted_22$1, toDisplayString(__props.auditorName || ""), 1)
1626
1626
  ]),
1627
1627
  createElementVNode("div", null, [
1628
1628
  _cache[6] || (_cache[6] = createElementVNode("span", { class: "" }, "制表人员:", -1)),
1629
- createElementVNode("span", _hoisted_23, toDisplayString(creatorNameDisplay.value), 1)
1629
+ createElementVNode("span", _hoisted_23$1, toDisplayString(creatorNameDisplay.value), 1)
1630
1630
  ]),
1631
- __props.customFooterFieldLabel ? (openBlock(), createElementBlock("div", _hoisted_24, [
1632
- createElementVNode("span", _hoisted_25, toDisplayString(__props.customFooterFieldLabel) + ":", 1),
1633
- createElementVNode("span", _hoisted_26, toDisplayString(__props.customFooterField || ""), 1)
1631
+ __props.customFooterFieldLabel ? (openBlock(), createElementBlock("div", _hoisted_24$1, [
1632
+ createElementVNode("span", _hoisted_25$1, toDisplayString(__props.customFooterFieldLabel) + ":", 1),
1633
+ createElementVNode("span", _hoisted_26$1, toDisplayString(__props.customFooterField || ""), 1)
1634
1634
  ])) : createCommentVNode("", true),
1635
1635
  createElementVNode("div", null, [
1636
1636
  _cache[7] || (_cache[7] = createElementVNode("span", { class: "" }, "打印日期:", -1)),
1637
- createElementVNode("span", _hoisted_27, toDisplayString(formattedPrintDate.value), 1)
1637
+ createElementVNode("span", _hoisted_27$1, toDisplayString(formattedPrintDate.value), 1)
1638
1638
  ])
1639
1639
  ])
1640
1640
  ], 512)
@@ -1666,27 +1666,27 @@ const _hoisted_7$2 = {
1666
1666
  class: "search-top-extra-label"
1667
1667
  };
1668
1668
  const _hoisted_8$2 = { class: "search-top-extra-content" };
1669
- const _hoisted_9 = {
1669
+ const _hoisted_9$1 = {
1670
1670
  key: 1,
1671
1671
  class: "search-top-extra-item"
1672
1672
  };
1673
- const _hoisted_10 = {
1673
+ const _hoisted_10$1 = {
1674
1674
  key: 0,
1675
1675
  class: "search-top-extra-label"
1676
1676
  };
1677
- const _hoisted_11 = { class: "search-top-extra-content" };
1678
- const _hoisted_12 = {
1677
+ const _hoisted_11$1 = { class: "search-top-extra-content" };
1678
+ const _hoisted_12$1 = {
1679
1679
  key: 2,
1680
1680
  class: "search-top-extra-item"
1681
1681
  };
1682
- const _hoisted_13 = {
1682
+ const _hoisted_13$1 = {
1683
1683
  key: 0,
1684
1684
  class: "search-top-extra-label"
1685
1685
  };
1686
- const _hoisted_14 = { class: "search-top-extra-content" };
1687
- const _hoisted_15 = { class: "search-top__actions" };
1688
- const _hoisted_16 = { class: "search-form__buttons" };
1689
- const _hoisted_17 = { class: "search-form__buttons" };
1686
+ const _hoisted_14$1 = { class: "search-top-extra-content" };
1687
+ const _hoisted_15$1 = { class: "search-top__actions" };
1688
+ const _hoisted_16$1 = { class: "search-form__buttons" };
1689
+ const _hoisted_17$1 = { class: "search-form__buttons" };
1690
1690
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1691
1691
  __name: "XSearchBar",
1692
1692
  props: {
@@ -1984,21 +1984,21 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1984
1984
  renderSlot(_ctx.$slots, "text1", {}, void 0, true)
1985
1985
  ])
1986
1986
  ])) : createCommentVNode("", true),
1987
- unref(slots).text2 ? (openBlock(), createElementBlock("div", _hoisted_9, [
1988
- __props.text2 ? (openBlock(), createElementBlock("span", _hoisted_10, toDisplayString(__props.text2) + ":", 1)) : createCommentVNode("", true),
1989
- createElementVNode("div", _hoisted_11, [
1987
+ unref(slots).text2 ? (openBlock(), createElementBlock("div", _hoisted_9$1, [
1988
+ __props.text2 ? (openBlock(), createElementBlock("span", _hoisted_10$1, toDisplayString(__props.text2) + ":", 1)) : createCommentVNode("", true),
1989
+ createElementVNode("div", _hoisted_11$1, [
1990
1990
  renderSlot(_ctx.$slots, "text2", {}, void 0, true)
1991
1991
  ])
1992
1992
  ])) : createCommentVNode("", true),
1993
- unref(slots).text3 ? (openBlock(), createElementBlock("div", _hoisted_12, [
1994
- __props.text3 ? (openBlock(), createElementBlock("span", _hoisted_13, toDisplayString(__props.text3) + ":", 1)) : createCommentVNode("", true),
1995
- createElementVNode("div", _hoisted_14, [
1993
+ unref(slots).text3 ? (openBlock(), createElementBlock("div", _hoisted_12$1, [
1994
+ __props.text3 ? (openBlock(), createElementBlock("span", _hoisted_13$1, toDisplayString(__props.text3) + ":", 1)) : createCommentVNode("", true),
1995
+ createElementVNode("div", _hoisted_14$1, [
1996
1996
  renderSlot(_ctx.$slots, "text3", {}, void 0, true)
1997
1997
  ])
1998
1998
  ])) : createCommentVNode("", true)
1999
1999
  ], 2)
2000
2000
  ]),
2001
- createElementVNode("div", _hoisted_15, [
2001
+ createElementVNode("div", _hoisted_15$1, [
2002
2002
  createVNode(_component_el_button, {
2003
2003
  plain: "",
2004
2004
  onClick: reset
@@ -2046,7 +2046,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2046
2046
  span: buttonItemSpan.value
2047
2047
  }, {
2048
2048
  default: withCtx(() => [
2049
- createElementVNode("div", _hoisted_16, [
2049
+ createElementVNode("div", _hoisted_16$1, [
2050
2050
  createVNode(_component_el_button, {
2051
2051
  plain: "",
2052
2052
  onClick: reset
@@ -2120,7 +2120,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2120
2120
  span: buttonItemSpan.value
2121
2121
  }, {
2122
2122
  default: withCtx(() => [
2123
- createElementVNode("div", _hoisted_17, [
2123
+ createElementVNode("div", _hoisted_17$1, [
2124
2124
  createVNode(_component_el_button, {
2125
2125
  plain: "",
2126
2126
  onClick: reset
@@ -2553,44 +2553,94 @@ const XVxeColumn = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data
2553
2553
  function createSearchApi(serverBaseURL) {
2554
2554
  const request = createRequest({ baseURL: serverBaseURL });
2555
2555
  return {
2556
- // 获取设置的列表
2557
- listByCurrentUser(data) {
2558
- return request({
2559
- url: "/plugin/system/field/user/listByCurrentUser",
2560
- method: "post",
2561
- data: { systemId: "1233849248630274", systemName: "进销存", ...data }
2562
- });
2556
+ // 查询所有系统
2557
+ sysList(data) {
2558
+ return request({ url: "/plugin/system/list", method: "post", data });
2563
2559
  },
2564
2560
  // 新增系统
2565
2561
  sysSave(data) {
2566
2562
  return request({ url: "/plugin/system/save", method: "post", data });
2567
2563
  },
2568
- // 查询系统
2569
- sysList(data) {
2570
- return request({ url: "/plugin/system/list", method: "post", data });
2564
+ // 修改系统
2565
+ sysUpdate(data) {
2566
+ return request({ url: "/plugin/system/update", method: "post", data });
2571
2567
  },
2572
- // 新增模块、页面
2568
+ // 新增模块/页面
2573
2569
  moduleSave(data) {
2574
2570
  return request({ url: "/plugin/module/save", method: "post", data });
2575
2571
  },
2576
- // 获取模块、页面
2572
+ // 修改模块/页面
2573
+ moduleUpdate(data) {
2574
+ return request({ url: "/plugin/module/update", method: "post", data });
2575
+ },
2576
+ // 删除模块/页面
2577
+ moduleDelete(id) {
2578
+ return request({ url: `/plugin/module/delete/${id}`, method: "post" });
2579
+ },
2580
+ // 查询模块/页面列表
2577
2581
  moduleList(data) {
2578
2582
  return request({ url: "/plugin/module/list", method: "post", params: data });
2579
2583
  },
2580
- // 新增页面字段
2581
- saveOrUpdate(data) {
2584
+ // 新增或修改字段
2585
+ fieldSaveOrUpdate(data) {
2582
2586
  return request({ url: "/plugin/system/field/saveOrUpdate", method: "post", data });
2587
+ },
2588
+ // 字段分页查询
2589
+ fieldPageView(data) {
2590
+ return request({ url: "/plugin/system/field/pageView", method: "post", data });
2591
+ },
2592
+ // 获取用户字段列表(兼容旧接口)
2593
+ listByCurrentUser(data) {
2594
+ return request({
2595
+ url: "/plugin/system/field/user/listByCurrentUser",
2596
+ method: "post",
2597
+ data: { systemId: "1233849248630274", systemName: "进销存", ...data }
2598
+ });
2583
2599
  }
2584
2600
  };
2585
2601
  }
2586
- const _hoisted_1 = { class: "search-bar-config" };
2587
- const _hoisted_2 = { class: "section" };
2588
- const _hoisted_3 = { class: "section__body" };
2589
- const _hoisted_4 = { class: "section" };
2590
- const _hoisted_5 = { class: "section__body" };
2591
- const _hoisted_6 = { class: "section" };
2592
- const _hoisted_7 = { class: "section__body section__body--grid" };
2593
- const _hoisted_8 = { class: "section__body section__body--grid" };
2602
+ const _hoisted_1 = { class: "x-search-bar-config" };
2603
+ const _hoisted_2 = { class: "config-sidebar" };
2604
+ const _hoisted_3 = { class: "config-sidebar__header" };
2605
+ const _hoisted_4 = { class: "config-sidebar__list" };
2606
+ const _hoisted_5 = ["onClick"];
2607
+ const _hoisted_6 = { class: "config-sidebar__item-info" };
2608
+ const _hoisted_7 = { class: "config-sidebar__item-name" };
2609
+ const _hoisted_8 = { class: "config-sidebar__item-id" };
2610
+ const _hoisted_9 = {
2611
+ key: 0,
2612
+ class: "config-sidebar__empty"
2613
+ };
2614
+ const _hoisted_10 = {
2615
+ key: 0,
2616
+ class: "config-sidebar__modules"
2617
+ };
2618
+ const _hoisted_11 = { class: "config-sidebar__header" };
2619
+ const _hoisted_12 = { class: "config-sidebar__list" };
2620
+ const _hoisted_13 = ["onClick"];
2621
+ const _hoisted_14 = { class: "config-sidebar__item-info" };
2622
+ const _hoisted_15 = { class: "config-sidebar__item-name" };
2623
+ const _hoisted_16 = { class: "config-sidebar__item-id" };
2624
+ const _hoisted_17 = {
2625
+ key: 0,
2626
+ class: "config-sidebar__empty"
2627
+ };
2628
+ const _hoisted_18 = { class: "config-content" };
2629
+ const _hoisted_19 = { class: "config-section" };
2630
+ const _hoisted_20 = { class: "config-section__header" };
2631
+ const _hoisted_21 = { class: "config-section__title" };
2632
+ const _hoisted_22 = {
2633
+ key: 0,
2634
+ class: "config-section__actions"
2635
+ };
2636
+ const _hoisted_23 = { class: "config-form__grid" };
2637
+ const _hoisted_24 = { class: "config-form__grid config-form__grid--2col" };
2638
+ const _hoisted_25 = { class: "config-form__footer" };
2639
+ const _hoisted_26 = { class: "config-section" };
2640
+ const _hoisted_27 = {
2641
+ key: 1,
2642
+ class: "config-content__empty"
2643
+ };
2594
2644
  const _sfc_main = /* @__PURE__ */ defineComponent({
2595
2645
  __name: "SearchBar",
2596
2646
  props: {
@@ -2606,18 +2656,131 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2606
2656
  setup(__props) {
2607
2657
  const props = __props;
2608
2658
  const api = createSearchApi(props.serverBaseURL);
2609
- const formRef = ref();
2610
- const form1Ref = ref();
2611
- const form2Ref = ref();
2612
- const form = reactive({
2613
- systemName: "",
2614
- status: 1
2615
- });
2616
- const form1 = reactive({
2617
- moduleCode: "",
2618
- moduleName: "",
2619
- status: 1
2620
- });
2659
+ const systemList = ref([]);
2660
+ const currentSystemId = ref("");
2661
+ const currentSystemName = ref("");
2662
+ const systemDialogVisible = ref(false);
2663
+ const editingSystem = ref(null);
2664
+ const systemFormRef = ref();
2665
+ const systemForm = reactive({ systemName: "" });
2666
+ function getSystemList() {
2667
+ api.sysList().then((res) => {
2668
+ systemList.value = res.data || [];
2669
+ if (props.systemId && !currentSystemId.value) {
2670
+ const found = systemList.value.find((s) => s.id === props.systemId);
2671
+ if (found) {
2672
+ selectSystem(found);
2673
+ }
2674
+ }
2675
+ });
2676
+ }
2677
+ function selectSystem(sys) {
2678
+ currentSystemId.value = sys.id;
2679
+ currentSystemName.value = sys.systemName;
2680
+ getModuleList();
2681
+ getFieldList();
2682
+ }
2683
+ function handleAddSystem() {
2684
+ editingSystem.value = null;
2685
+ systemForm.systemName = "";
2686
+ systemDialogVisible.value = true;
2687
+ }
2688
+ function handleEditSystem(sys) {
2689
+ editingSystem.value = sys;
2690
+ systemForm.systemName = sys.systemName;
2691
+ systemDialogVisible.value = true;
2692
+ }
2693
+ function submitSystem() {
2694
+ var _a;
2695
+ (_a = systemFormRef.value) == null ? void 0 : _a.validate((valid) => {
2696
+ if (!valid) return;
2697
+ if (editingSystem.value) {
2698
+ api.sysUpdate({ id: editingSystem.value.id, systemName: systemForm.systemName, status: 1 }).then(() => {
2699
+ ElMessage.success("修改成功");
2700
+ systemDialogVisible.value = false;
2701
+ getSystemList();
2702
+ });
2703
+ } else {
2704
+ api.sysSave({ systemName: systemForm.systemName, status: 1 }).then(() => {
2705
+ ElMessage.success("新增成功");
2706
+ systemDialogVisible.value = false;
2707
+ getSystemList();
2708
+ });
2709
+ }
2710
+ });
2711
+ }
2712
+ const moduleList = ref([]);
2713
+ const currentModuleId = ref("");
2714
+ const moduleDialogVisible = ref(false);
2715
+ const editingModule = ref(null);
2716
+ const moduleFormRef = ref();
2717
+ const moduleForm = reactive({ moduleCode: "", moduleName: "" });
2718
+ function getModuleList() {
2719
+ if (!currentSystemId.value) return;
2720
+ api.moduleList({ systemId: currentSystemId.value }).then((res) => {
2721
+ moduleList.value = res.data || [];
2722
+ });
2723
+ }
2724
+ function selectModule(mod) {
2725
+ currentModuleId.value = mod.id;
2726
+ getFieldList();
2727
+ }
2728
+ function handleAddModule() {
2729
+ editingModule.value = null;
2730
+ moduleForm.moduleCode = "";
2731
+ moduleForm.moduleName = "";
2732
+ moduleDialogVisible.value = true;
2733
+ }
2734
+ function handleEditModule(mod) {
2735
+ editingModule.value = mod;
2736
+ moduleForm.moduleCode = mod.moduleCode;
2737
+ moduleForm.moduleName = mod.moduleName;
2738
+ moduleDialogVisible.value = true;
2739
+ }
2740
+ function handleDeleteModule(mod) {
2741
+ ElMessageBox.confirm(`确定删除模块「${mod.moduleName}」?`, "提示", { type: "warning" }).then(() => {
2742
+ api.moduleDelete(mod.id).then(() => {
2743
+ ElMessage.success("删除成功");
2744
+ if (currentModuleId.value === mod.id) {
2745
+ currentModuleId.value = "";
2746
+ }
2747
+ getModuleList();
2748
+ });
2749
+ }).catch(() => {
2750
+ });
2751
+ }
2752
+ function submitModule() {
2753
+ var _a;
2754
+ (_a = moduleFormRef.value) == null ? void 0 : _a.validate((valid) => {
2755
+ if (!valid) return;
2756
+ if (editingModule.value) {
2757
+ api.moduleUpdate({
2758
+ id: editingModule.value.id,
2759
+ moduleCode: moduleForm.moduleCode,
2760
+ moduleName: moduleForm.moduleName,
2761
+ systemId: currentSystemId.value,
2762
+ status: 1
2763
+ }).then(() => {
2764
+ ElMessage.success("修改成功");
2765
+ moduleDialogVisible.value = false;
2766
+ getModuleList();
2767
+ });
2768
+ } else {
2769
+ api.moduleSave({
2770
+ moduleCode: moduleForm.moduleCode,
2771
+ moduleName: moduleForm.moduleName,
2772
+ systemId: currentSystemId.value,
2773
+ status: 1
2774
+ }).then(() => {
2775
+ ElMessage.success("新增成功");
2776
+ moduleDialogVisible.value = false;
2777
+ getModuleList();
2778
+ });
2779
+ }
2780
+ });
2781
+ }
2782
+ const fieldFormRef = ref();
2783
+ const editingField = ref(null);
2621
2784
  const fieldTypeOptions = [
2622
2785
  { label: "文本框", value: "el-input" },
2623
2786
  { label: "下拉框", value: "el-select" },
@@ -2626,7 +2789,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2626
2789
  { label: "部门选择", value: "h-select-tree-dep" },
2627
2790
  { label: "所选组织名称", value: "h-select-org" }
2628
2791
  ];
2629
- const form2 = reactive({
2792
+ const fieldForm = reactive({
2793
+ id: "",
2630
2794
  attribute: "",
2631
2795
  fieldJavaName: "",
2632
2796
  fieldName: "",
@@ -2635,440 +2799,694 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2635
2799
  moduleId: "",
2636
2800
  dictKey: "",
2637
2801
  selType: "3",
2638
- status: 1,
2639
2802
  isCache: false
2640
2803
  });
2641
- const rules = reactive({});
2642
- const rules1 = reactive({});
2643
- const rules2 = reactive({});
2644
- const moduleList = ref([]);
2645
- watch(() => form2.fieldName, () => handleFieldChange(), { immediate: true });
2646
- watch(() => form2.fieldType, () => handleFieldChange(), { immediate: true });
2647
- watch(() => form2.selType, () => selTypeFieldChange(), { immediate: true });
2804
+ const fieldTableData = ref([]);
2805
+ const fieldPage = reactive({
2806
+ currentPage: 1,
2807
+ pageSize: 20,
2808
+ total: 0
2809
+ });
2810
+ watch(() => fieldForm.fieldName, () => handleFieldChange(), { immediate: false });
2811
+ watch(() => fieldForm.fieldType, () => handleFieldChange(), { immediate: false });
2812
+ watch(() => fieldForm.selType, () => selTypeFieldChange(), { immediate: false });
2648
2813
  function selTypeFieldChange() {
2649
- const newVal = form2.selType;
2650
- if (newVal === "1") {
2651
- form2.dictKey = JSON.stringify({ type: "dict", label: "dictLabel", value: "dictValue", key: "" }, null, 2);
2652
- } else if (newVal === "2") {
2653
- form2.dictKey = JSON.stringify({ type: "compound", label: "label", value: "value", url: "" }, null, 2);
2814
+ const val = fieldForm.selType;
2815
+ if (val === "1") {
2816
+ fieldForm.dictKey = JSON.stringify({ type: "dict", label: "dictLabel", value: "dictValue", key: "" }, null, 2);
2817
+ } else if (val === "2") {
2818
+ fieldForm.dictKey = JSON.stringify({ type: "compound", label: "label", value: "value", url: "" }, null, 2);
2654
2819
  } else {
2655
- form2.dictKey = JSON.stringify({ type: "normal", label: "label", value: "value", key: "" }, null, 2);
2820
+ fieldForm.dictKey = JSON.stringify({ type: "normal", label: "label", value: "value", key: "" }, null, 2);
2656
2821
  }
2657
2822
  }
2658
2823
  function handleFieldChange() {
2659
- const newVal = form2.fieldType;
2660
- if (newVal === "el-input") {
2661
- form2.attribute = JSON.stringify({ placeholder: "请输入" + form2.fieldName, clearable: true }, null, 2);
2662
- form2.dictKey = "{}";
2663
- } else if (newVal === "el-select") {
2664
- form2.attribute = JSON.stringify({ placeholder: "请选择" + form2.fieldName, filterable: true, clearable: true }, null, 2);
2665
- } else if (newVal === "el-date-picker") {
2666
- if (form2.fieldName.indexOf("日期") > -1) {
2667
- form2.attribute = JSON.stringify({ type: "date", placeholder: "请选择" + form2.fieldName, "value-format": "YYYY-MM-DD", clearable: true }, null, 2);
2824
+ const val = fieldForm.fieldType;
2825
+ if (val === "el-input") {
2826
+ fieldForm.attribute = JSON.stringify({ placeholder: "请输入" + fieldForm.fieldName, clearable: true }, null, 2);
2827
+ fieldForm.dictKey = "{}";
2828
+ } else if (val === "el-select") {
2829
+ fieldForm.attribute = JSON.stringify({ placeholder: "请选择" + fieldForm.fieldName, filterable: true, clearable: true }, null, 2);
2830
+ } else if (val === "el-date-picker") {
2831
+ if (fieldForm.fieldName.indexOf("日期") > -1) {
2832
+ fieldForm.attribute = JSON.stringify({ type: "date", placeholder: "请选择" + fieldForm.fieldName, "value-format": "YYYY-MM-DD", clearable: true }, null, 2);
2668
2833
  } else {
2669
- form2.attribute = JSON.stringify({ type: "date", placeholder: "请选择" + form2.fieldName, "value-format": "YYYY-MM-DD HH:mm:ss", clearable: true }, null, 2);
2834
+ fieldForm.attribute = JSON.stringify({ type: "date", placeholder: "请选择" + fieldForm.fieldName, "value-format": "YYYY-MM-DD HH:mm:ss", clearable: true }, null, 2);
2670
2835
  }
2671
- } else if (newVal === "h-select-org") {
2672
- form2.fieldName = "所选组织名称";
2673
- form2.fieldJavaName = "orgIds";
2674
- form2.attribute = JSON.stringify({ placeholder: "请选择" + form2.fieldName, filterable: true, multiple: true, disabled: false, clearable: false }, null, 2);
2836
+ } else if (val === "h-select-org") {
2837
+ fieldForm.fieldName = "所选组织名称";
2838
+ fieldForm.fieldJavaName = "orgIds";
2839
+ fieldForm.attribute = JSON.stringify({ placeholder: "请选择" + fieldForm.fieldName, filterable: true, multiple: true, disabled: false, clearable: false }, null, 2);
2675
2840
  } else {
2676
- form2.attribute = "{}";
2841
+ fieldForm.attribute = "{}";
2677
2842
  }
2678
2843
  }
2679
- function getModuleList() {
2680
- api.moduleList({ systemId: props.systemId }).then((res) => {
2681
- moduleList.value = res.data;
2682
- if (moduleList.value.length > 0) {
2683
- form2.moduleId = moduleList.value[moduleList.value.length - 1].id;
2684
- }
2685
- });
2686
- }
2687
- function subSys() {
2688
- var _a;
2689
- (_a = formRef.value) == null ? void 0 : _a.validate((valid) => {
2690
- if (valid) {
2691
- api.sysSave(form).then(() => {
2692
- ElMessage.success("保存成功");
2693
- });
2694
- }
2695
- });
2696
- }
2697
- function subSys1() {
2698
- var _a;
2699
- (_a = form1Ref.value) == null ? void 0 : _a.validate((valid) => {
2700
- if (valid) {
2701
- form1.systemId = props.systemId;
2702
- api.moduleSave(form1).then(() => {
2703
- ElMessage.success("保存成功");
2704
- getModuleList();
2705
- });
2706
- }
2844
+ function getFieldList() {
2845
+ if (!currentSystemId.value) return;
2846
+ const params = {
2847
+ systemId: currentSystemId.value,
2848
+ currentPage: fieldPage.currentPage,
2849
+ pageSize: fieldPage.pageSize
2850
+ };
2851
+ if (currentModuleId.value) {
2852
+ params.moduleId = currentModuleId.value;
2853
+ }
2854
+ api.fieldPageView(params).then((res) => {
2855
+ const data = res.data || {};
2856
+ fieldTableData.value = data.records || data.list || [];
2857
+ fieldPage.total = data.total || 0;
2707
2858
  });
2708
2859
  }
2709
- function subSys2() {
2860
+ function handleFieldPageChange(page, pageSize) {
2861
+ fieldPage.currentPage = page;
2862
+ fieldPage.pageSize = pageSize;
2863
+ getFieldList();
2864
+ }
2865
+ function handleEditField(row) {
2866
+ editingField.value = row;
2867
+ fieldForm.id = row.id || "";
2868
+ fieldForm.fieldName = row.fieldName || "";
2869
+ fieldForm.fieldJavaName = row.fieldJavaName || "";
2870
+ fieldForm.fieldType = row.fieldType || "el-input";
2871
+ fieldForm.isRequire = row.isRequire || "0";
2872
+ fieldForm.moduleId = row.moduleId || "";
2873
+ fieldForm.attribute = row.attribute || "";
2874
+ fieldForm.dictKey = row.dictKey || "";
2875
+ fieldForm.isCache = row.isCache || false;
2876
+ fieldForm.selType = "3";
2877
+ }
2878
+ function cancelEditField() {
2879
+ editingField.value = null;
2880
+ resetFieldForm();
2881
+ }
2882
+ function resetFieldForm() {
2883
+ fieldForm.id = "";
2884
+ fieldForm.fieldName = "";
2885
+ fieldForm.fieldJavaName = "";
2886
+ fieldForm.fieldType = "el-input";
2887
+ fieldForm.isRequire = "0";
2888
+ fieldForm.moduleId = currentModuleId.value || "";
2889
+ fieldForm.attribute = "";
2890
+ fieldForm.dictKey = "";
2891
+ fieldForm.selType = "3";
2892
+ fieldForm.isCache = false;
2893
+ editingField.value = null;
2894
+ }
2895
+ function submitField() {
2710
2896
  var _a;
2711
- (_a = form2Ref.value) == null ? void 0 : _a.validate((valid) => {
2712
- if (valid) {
2713
- const data = JSON.parse(JSON.stringify(form2));
2714
- data.systemId = props.systemId;
2715
- api.saveOrUpdate({ fieldList: [data] }).then(() => {
2716
- ElMessage.success("保存成功");
2717
- form2.fieldJavaName = "";
2718
- if (!form2.isCache) {
2719
- form2.fieldName = "";
2720
- }
2721
- });
2897
+ (_a = fieldFormRef.value) == null ? void 0 : _a.validate((valid) => {
2898
+ if (!valid) return;
2899
+ const data = {
2900
+ ...JSON.parse(JSON.stringify(fieldForm)),
2901
+ systemId: currentSystemId.value,
2902
+ status: 1
2903
+ };
2904
+ if (editingField.value) {
2905
+ data.id = editingField.value.id;
2722
2906
  }
2907
+ api.fieldSaveOrUpdate({ fieldList: [data] }).then(() => {
2908
+ ElMessage.success(editingField.value ? "修改成功" : "新增成功");
2909
+ if (!fieldForm.isCache) {
2910
+ resetFieldForm();
2911
+ }
2912
+ getFieldList();
2913
+ });
2723
2914
  });
2724
2915
  }
2725
2916
  onMounted(() => {
2726
- getModuleList();
2917
+ getSystemList();
2727
2918
  });
2728
2919
  return (_ctx, _cache) => {
2729
- const _component_el_input = resolveComponent("el-input");
2730
- const _component_el_form_item = resolveComponent("el-form-item");
2731
2920
  const _component_el_button = resolveComponent("el-button");
2732
- const _component_el_form = resolveComponent("el-form");
2733
2921
  const _component_el_option = resolveComponent("el-option");
2734
2922
  const _component_el_select = resolveComponent("el-select");
2923
+ const _component_el_form_item = resolveComponent("el-form-item");
2924
+ const _component_el_input = resolveComponent("el-input");
2735
2925
  const _component_el_checkbox = resolveComponent("el-checkbox");
2926
+ const _component_el_form = resolveComponent("el-form");
2927
+ const _component_el_tag = resolveComponent("el-tag");
2928
+ const _component_el_empty = resolveComponent("el-empty");
2929
+ const _component_el_dialog = resolveComponent("el-dialog");
2736
2930
  return openBlock(), createElementBlock("div", _hoisted_1, [
2737
- createVNode(_component_el_form, {
2738
- rules,
2739
- model: form,
2740
- ref_key: "formRef",
2741
- ref: formRef,
2742
- "label-suffix": "",
2743
- "hide-required-asterisk": "",
2744
- "show-message": ""
2745
- }, {
2746
- default: withCtx(() => [
2747
- createElementVNode("div", _hoisted_2, [
2748
- _cache[13] || (_cache[13] = createElementVNode("div", { class: "section__title" }, "系统配置", -1)),
2749
- createElementVNode("div", _hoisted_3, [
2750
- createVNode(_component_el_form_item, {
2751
- label: "系统名称",
2752
- prop: "systemName",
2753
- class: "form-item--auto"
2754
- }, {
2755
- default: withCtx(() => [
2756
- createVNode(_component_el_input, {
2757
- modelValue: form.systemName,
2758
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => form.systemName = $event),
2759
- placeholder: "请输入系统名称"
2760
- }, null, 8, ["modelValue"])
2931
+ createElementVNode("div", _hoisted_2, [
2932
+ createElementVNode("div", _hoisted_3, [
2933
+ _cache[19] || (_cache[19] = createElementVNode("span", { class: "config-sidebar__title" }, "系统列表", -1)),
2934
+ createVNode(_component_el_button, {
2935
+ type: "primary",
2936
+ size: "small",
2937
+ onClick: handleAddSystem
2938
+ }, {
2939
+ default: withCtx(() => _cache[18] || (_cache[18] = [
2940
+ createTextVNode("新增")
2941
+ ])),
2942
+ _: 1,
2943
+ __: [18]
2944
+ })
2945
+ ]),
2946
+ createElementVNode("div", _hoisted_4, [
2947
+ (openBlock(true), createElementBlock(Fragment, null, renderList(systemList.value, (sys) => {
2948
+ return openBlock(), createElementBlock("div", {
2949
+ key: sys.id,
2950
+ class: normalizeClass(["config-sidebar__item", { "is-active": currentSystemId.value === sys.id }]),
2951
+ onClick: ($event) => selectSystem(sys)
2952
+ }, [
2953
+ createElementVNode("div", _hoisted_6, [
2954
+ createElementVNode("span", _hoisted_7, toDisplayString(sys.systemName), 1),
2955
+ createElementVNode("span", _hoisted_8, "ID: " + toDisplayString(sys.id), 1)
2956
+ ]),
2957
+ createElementVNode("div", {
2958
+ class: "config-sidebar__item-actions",
2959
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {
2960
+ }, ["stop"]))
2961
+ }, [
2962
+ createVNode(_component_el_button, {
2963
+ type: "primary",
2964
+ link: "",
2965
+ size: "small",
2966
+ onClick: ($event) => handleEditSystem(sys)
2967
+ }, {
2968
+ default: withCtx(() => _cache[20] || (_cache[20] = [
2969
+ createTextVNode("编辑")
2970
+ ])),
2971
+ _: 2,
2972
+ __: [20]
2973
+ }, 1032, ["onClick"])
2974
+ ])
2975
+ ], 10, _hoisted_5);
2976
+ }), 128)),
2977
+ systemList.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_9, "暂无系统")) : createCommentVNode("", true)
2978
+ ]),
2979
+ currentSystemId.value ? (openBlock(), createElementBlock("div", _hoisted_10, [
2980
+ createElementVNode("div", _hoisted_11, [
2981
+ _cache[22] || (_cache[22] = createElementVNode("span", { class: "config-sidebar__title" }, "模块列表", -1)),
2982
+ createVNode(_component_el_button, {
2983
+ type: "primary",
2984
+ size: "small",
2985
+ onClick: handleAddModule
2986
+ }, {
2987
+ default: withCtx(() => _cache[21] || (_cache[21] = [
2988
+ createTextVNode("新增")
2989
+ ])),
2990
+ _: 1,
2991
+ __: [21]
2992
+ })
2993
+ ]),
2994
+ createElementVNode("div", _hoisted_12, [
2995
+ (openBlock(true), createElementBlock(Fragment, null, renderList(moduleList.value, (mod) => {
2996
+ return openBlock(), createElementBlock("div", {
2997
+ key: mod.id,
2998
+ class: normalizeClass(["config-sidebar__item", { "is-active": currentModuleId.value === mod.id }]),
2999
+ onClick: ($event) => selectModule(mod)
3000
+ }, [
3001
+ createElementVNode("div", _hoisted_14, [
3002
+ createElementVNode("span", _hoisted_15, toDisplayString(mod.moduleName), 1),
3003
+ createElementVNode("span", _hoisted_16, toDisplayString(mod.moduleCode), 1)
2761
3004
  ]),
2762
- _: 1
2763
- }),
2764
- createVNode(_component_el_form_item, { class: "form-item--btn" }, {
2765
- default: withCtx(() => [
3005
+ createElementVNode("div", {
3006
+ class: "config-sidebar__item-actions",
3007
+ onClick: _cache[1] || (_cache[1] = withModifiers(() => {
3008
+ }, ["stop"]))
3009
+ }, [
2766
3010
  createVNode(_component_el_button, {
2767
3011
  type: "primary",
2768
- onClick: subSys
3012
+ link: "",
3013
+ size: "small",
3014
+ onClick: ($event) => handleEditModule(mod)
2769
3015
  }, {
2770
- default: withCtx(() => _cache[12] || (_cache[12] = [
2771
- createTextVNode("提交")
3016
+ default: withCtx(() => _cache[23] || (_cache[23] = [
3017
+ createTextVNode("编辑")
2772
3018
  ])),
2773
- _: 1,
2774
- __: [12]
2775
- })
2776
- ]),
2777
- _: 1
2778
- })
2779
- ])
2780
- ])
2781
- ]),
2782
- _: 1
2783
- }, 8, ["rules", "model"]),
2784
- createVNode(_component_el_form, {
2785
- rules: rules1,
2786
- model: form1,
2787
- ref_key: "form1Ref",
2788
- ref: form1Ref,
2789
- "label-suffix": ":",
2790
- "hide-required-asterisk": "",
2791
- "show-message": ""
2792
- }, {
2793
- default: withCtx(() => [
2794
- createElementVNode("div", _hoisted_4, [
2795
- _cache[15] || (_cache[15] = createElementVNode("div", { class: "section__title" }, "模块/页面配置", -1)),
2796
- createElementVNode("div", _hoisted_5, [
2797
- createVNode(_component_el_form_item, {
2798
- label: "模块/页面code",
2799
- prop: "moduleCode",
2800
- class: "form-item--auto"
2801
- }, {
2802
- default: withCtx(() => [
2803
- createVNode(_component_el_input, {
2804
- modelValue: form1.moduleCode,
2805
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => form1.moduleCode = $event),
2806
- placeholder: "请输入"
2807
- }, null, 8, ["modelValue"])
2808
- ]),
2809
- _: 1
2810
- }),
2811
- createVNode(_component_el_form_item, {
2812
- label: "模块/页面名称",
2813
- prop: "moduleName",
2814
- class: "form-item--auto"
2815
- }, {
2816
- default: withCtx(() => [
2817
- createVNode(_component_el_input, {
2818
- modelValue: form1.moduleName,
2819
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => form1.moduleName = $event),
2820
- placeholder: "请输入"
2821
- }, null, 8, ["modelValue"])
2822
- ]),
2823
- _: 1
2824
- }),
2825
- createVNode(_component_el_form_item, { class: "form-item--btn" }, {
2826
- default: withCtx(() => [
3019
+ _: 2,
3020
+ __: [23]
3021
+ }, 1032, ["onClick"]),
2827
3022
  createVNode(_component_el_button, {
2828
- type: "primary",
2829
- onClick: subSys1
3023
+ type: "danger",
3024
+ link: "",
3025
+ size: "small",
3026
+ onClick: ($event) => handleDeleteModule(mod)
2830
3027
  }, {
2831
- default: withCtx(() => _cache[14] || (_cache[14] = [
2832
- createTextVNode("提交")
3028
+ default: withCtx(() => _cache[24] || (_cache[24] = [
3029
+ createTextVNode("删除")
2833
3030
  ])),
2834
- _: 1,
2835
- __: [14]
2836
- })
2837
- ]),
2838
- _: 1
2839
- })
2840
- ])
3031
+ _: 2,
3032
+ __: [24]
3033
+ }, 1032, ["onClick"])
3034
+ ])
3035
+ ], 10, _hoisted_13);
3036
+ }), 128)),
3037
+ moduleList.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_17, "暂无模块")) : createCommentVNode("", true)
2841
3038
  ])
2842
- ]),
2843
- _: 1
2844
- }, 8, ["rules", "model"]),
2845
- createVNode(_component_el_form, {
2846
- rules: rules2,
2847
- model: form2,
2848
- ref_key: "form2Ref",
2849
- ref: form2Ref,
2850
- "label-suffix": ":",
2851
- "hide-required-asterisk": "",
2852
- "show-message": ""
2853
- }, {
2854
- default: withCtx(() => [
2855
- createElementVNode("div", _hoisted_6, [
2856
- _cache[18] || (_cache[18] = createElementVNode("div", { class: "section__title" }, "字段配置", -1)),
2857
- createElementVNode("div", _hoisted_7, [
2858
- createVNode(_component_el_form_item, {
2859
- label: "模块/页面",
2860
- prop: "moduleId"
2861
- }, {
2862
- default: withCtx(() => [
2863
- createVNode(_component_el_select, {
2864
- clearable: "",
2865
- filterable: "",
2866
- modelValue: form2.moduleId,
2867
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => form2.moduleId = $event),
2868
- placeholder: "请选择"
3039
+ ])) : createCommentVNode("", true)
3040
+ ]),
3041
+ createElementVNode("div", _hoisted_18, [
3042
+ currentSystemId.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3043
+ createElementVNode("div", _hoisted_19, [
3044
+ createElementVNode("div", _hoisted_20, [
3045
+ createElementVNode("span", _hoisted_21, toDisplayString(editingField.value ? "编辑字段" : "新增字段"), 1),
3046
+ editingField.value ? (openBlock(), createElementBlock("div", _hoisted_22, [
3047
+ createVNode(_component_el_button, {
3048
+ size: "small",
3049
+ onClick: cancelEditField
3050
+ }, {
3051
+ default: withCtx(() => _cache[25] || (_cache[25] = [
3052
+ createTextVNode("取消编辑")
3053
+ ])),
3054
+ _: 1,
3055
+ __: [25]
3056
+ })
3057
+ ])) : createCommentVNode("", true)
3058
+ ]),
3059
+ createVNode(_component_el_form, {
3060
+ model: fieldForm,
3061
+ ref_key: "fieldFormRef",
3062
+ ref: fieldFormRef,
3063
+ "label-suffix": ":",
3064
+ "label-width": "110px",
3065
+ "hide-required-asterisk": "",
3066
+ "show-message": "",
3067
+ class: "config-form"
3068
+ }, {
3069
+ default: withCtx(() => [
3070
+ createElementVNode("div", _hoisted_23, [
3071
+ createVNode(_component_el_form_item, {
3072
+ label: "模块/页面",
3073
+ prop: "moduleId"
2869
3074
  }, {
2870
3075
  default: withCtx(() => [
2871
- (openBlock(true), createElementBlock(Fragment, null, renderList(moduleList.value, (item, index2) => {
2872
- return openBlock(), createBlock(_component_el_option, {
2873
- key: index2,
2874
- label: item.moduleName,
2875
- value: item.id
2876
- }, null, 8, ["label", "value"]);
2877
- }), 128))
3076
+ createVNode(_component_el_select, {
3077
+ clearable: "",
3078
+ filterable: "",
3079
+ modelValue: fieldForm.moduleId,
3080
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => fieldForm.moduleId = $event),
3081
+ placeholder: "请选择"
3082
+ }, {
3083
+ default: withCtx(() => [
3084
+ (openBlock(true), createElementBlock(Fragment, null, renderList(moduleList.value, (item) => {
3085
+ return openBlock(), createBlock(_component_el_option, {
3086
+ key: item.id,
3087
+ label: item.moduleName,
3088
+ value: item.id
3089
+ }, null, 8, ["label", "value"]);
3090
+ }), 128))
3091
+ ]),
3092
+ _: 1
3093
+ }, 8, ["modelValue"])
2878
3094
  ]),
2879
3095
  _: 1
2880
- }, 8, ["modelValue"])
2881
- ]),
2882
- _: 1
2883
- }),
2884
- createVNode(_component_el_form_item, {
2885
- label: "字段名称",
2886
- prop: "fieldName"
2887
- }, {
2888
- default: withCtx(() => [
2889
- createVNode(_component_el_input, {
2890
- modelValue: form2.fieldName,
2891
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => form2.fieldName = $event),
2892
- placeholder: "请输入"
2893
- }, null, 8, ["modelValue"])
2894
- ]),
2895
- _: 1
2896
- }),
2897
- createVNode(_component_el_form_item, {
2898
- label: "字段Java名称",
2899
- prop: "fieldJavaName"
2900
- }, {
2901
- default: withCtx(() => [
2902
- createVNode(_component_el_input, {
2903
- modelValue: form2.fieldJavaName,
2904
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => form2.fieldJavaName = $event),
2905
- placeholder: "请输入"
2906
- }, null, 8, ["modelValue"])
2907
- ]),
2908
- _: 1
2909
- }),
2910
- createVNode(_component_el_form_item, {
2911
- label: "字段类型",
2912
- prop: "fieldType"
2913
- }, {
2914
- default: withCtx(() => [
2915
- createVNode(_component_el_select, {
2916
- clearable: "",
2917
- filterable: "",
2918
- modelValue: form2.fieldType,
2919
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => form2.fieldType = $event),
2920
- placeholder: "请选择"
3096
+ }),
3097
+ createVNode(_component_el_form_item, {
3098
+ label: "字段名称",
3099
+ prop: "fieldName"
2921
3100
  }, {
2922
3101
  default: withCtx(() => [
2923
- (openBlock(), createElementBlock(Fragment, null, renderList(fieldTypeOptions, (item, index2) => {
2924
- return createVNode(_component_el_option, {
2925
- key: index2,
2926
- label: item.label,
2927
- value: item.value
2928
- }, null, 8, ["label", "value"]);
2929
- }), 64))
3102
+ createVNode(_component_el_input, {
3103
+ modelValue: fieldForm.fieldName,
3104
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => fieldForm.fieldName = $event),
3105
+ placeholder: "请输入"
3106
+ }, null, 8, ["modelValue"])
2930
3107
  ]),
2931
3108
  _: 1
2932
- }, 8, ["modelValue"])
2933
- ]),
2934
- _: 1
2935
- }),
2936
- ["el-cascader", "el-select"].includes(form2.fieldType) ? (openBlock(), createBlock(_component_el_form_item, {
2937
- key: 0,
2938
- label: "下拉框类别",
2939
- prop: "selType"
2940
- }, {
2941
- default: withCtx(() => [
2942
- createVNode(_component_el_select, {
2943
- clearable: "",
2944
- filterable: "",
2945
- modelValue: form2.selType,
2946
- "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => form2.selType = $event),
2947
- placeholder: "请选择"
3109
+ }),
3110
+ createVNode(_component_el_form_item, {
3111
+ label: "字段Java名称",
3112
+ prop: "fieldJavaName"
3113
+ }, {
3114
+ default: withCtx(() => [
3115
+ createVNode(_component_el_input, {
3116
+ modelValue: fieldForm.fieldJavaName,
3117
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => fieldForm.fieldJavaName = $event),
3118
+ placeholder: "请输入"
3119
+ }, null, 8, ["modelValue"])
3120
+ ]),
3121
+ _: 1
3122
+ }),
3123
+ createVNode(_component_el_form_item, {
3124
+ label: "字段类型",
3125
+ prop: "fieldType"
3126
+ }, {
3127
+ default: withCtx(() => [
3128
+ createVNode(_component_el_select, {
3129
+ clearable: "",
3130
+ filterable: "",
3131
+ modelValue: fieldForm.fieldType,
3132
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => fieldForm.fieldType = $event),
3133
+ placeholder: "请选择"
3134
+ }, {
3135
+ default: withCtx(() => [
3136
+ (openBlock(), createElementBlock(Fragment, null, renderList(fieldTypeOptions, (item) => {
3137
+ return createVNode(_component_el_option, {
3138
+ key: item.value,
3139
+ label: item.label,
3140
+ value: item.value
3141
+ }, null, 8, ["label", "value"]);
3142
+ }), 64))
3143
+ ]),
3144
+ _: 1
3145
+ }, 8, ["modelValue"])
3146
+ ]),
3147
+ _: 1
3148
+ }),
3149
+ ["el-cascader", "el-select"].includes(fieldForm.fieldType) ? (openBlock(), createBlock(_component_el_form_item, {
3150
+ key: 0,
3151
+ label: "下拉框类别",
3152
+ prop: "selType"
3153
+ }, {
3154
+ default: withCtx(() => [
3155
+ createVNode(_component_el_select, {
3156
+ clearable: "",
3157
+ filterable: "",
3158
+ modelValue: fieldForm.selType,
3159
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => fieldForm.selType = $event),
3160
+ placeholder: "请选择"
3161
+ }, {
3162
+ default: withCtx(() => [
3163
+ createVNode(_component_el_option, {
3164
+ label: "字典下拉框",
3165
+ value: "1"
3166
+ }),
3167
+ createVNode(_component_el_option, {
3168
+ label: "复合型下拉框",
3169
+ value: "2"
3170
+ }),
3171
+ createVNode(_component_el_option, {
3172
+ label: "普通下拉框",
3173
+ value: "3"
3174
+ })
3175
+ ]),
3176
+ _: 1
3177
+ }, 8, ["modelValue"])
3178
+ ]),
3179
+ _: 1
3180
+ })) : createCommentVNode("", true),
3181
+ createVNode(_component_el_form_item, {
3182
+ label: "是否必填",
3183
+ prop: "isRequire"
3184
+ }, {
3185
+ default: withCtx(() => [
3186
+ createVNode(_component_el_select, {
3187
+ clearable: "",
3188
+ modelValue: fieldForm.isRequire,
3189
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => fieldForm.isRequire = $event),
3190
+ placeholder: "请选择"
3191
+ }, {
3192
+ default: withCtx(() => [
3193
+ createVNode(_component_el_option, {
3194
+ label: "是",
3195
+ value: "1"
3196
+ }),
3197
+ createVNode(_component_el_option, {
3198
+ label: "否",
3199
+ value: "0"
3200
+ })
3201
+ ]),
3202
+ _: 1
3203
+ }, 8, ["modelValue"])
3204
+ ]),
3205
+ _: 1
3206
+ }),
3207
+ createVNode(_component_el_form_item, {
3208
+ label: "是否缓存",
3209
+ prop: "isCache"
2948
3210
  }, {
2949
3211
  default: withCtx(() => [
2950
- createVNode(_component_el_option, {
2951
- label: "字典下拉框",
2952
- value: "1"
2953
- }),
2954
- createVNode(_component_el_option, {
2955
- label: "复合型下拉框",
2956
- value: "2"
2957
- }),
2958
- createVNode(_component_el_option, {
2959
- label: "普通下拉框",
2960
- value: "3"
2961
- })
3212
+ createVNode(_component_el_checkbox, {
3213
+ modelValue: fieldForm.isCache,
3214
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => fieldForm.isCache = $event)
3215
+ }, {
3216
+ default: withCtx(() => _cache[26] || (_cache[26] = [
3217
+ createTextVNode("缓存")
3218
+ ])),
3219
+ _: 1,
3220
+ __: [26]
3221
+ }, 8, ["modelValue"])
2962
3222
  ]),
2963
3223
  _: 1
2964
- }, 8, ["modelValue"])
3224
+ })
2965
3225
  ]),
2966
- _: 1
2967
- })) : createCommentVNode("", true),
2968
- createVNode(_component_el_form_item, {
2969
- label: "是否必填",
2970
- prop: "isRequire"
2971
- }, {
2972
- default: withCtx(() => [
2973
- createVNode(_component_el_select, {
2974
- clearable: "",
2975
- filterable: "",
2976
- modelValue: form2.isRequire,
2977
- "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => form2.isRequire = $event),
2978
- placeholder: "请选择"
3226
+ createElementVNode("div", _hoisted_24, [
3227
+ createVNode(_component_el_form_item, {
3228
+ label: "字段属性",
3229
+ prop: "attribute"
3230
+ }, {
3231
+ default: withCtx(() => [
3232
+ createVNode(_component_el_input, {
3233
+ modelValue: fieldForm.attribute,
3234
+ "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => fieldForm.attribute = $event),
3235
+ type: "textarea",
3236
+ rows: 8,
3237
+ placeholder: "JSON 格式"
3238
+ }, null, 8, ["modelValue"])
3239
+ ]),
3240
+ _: 1
3241
+ }),
3242
+ createVNode(_component_el_form_item, {
3243
+ label: "额外属性",
3244
+ prop: "dictKey"
2979
3245
  }, {
2980
3246
  default: withCtx(() => [
2981
- createVNode(_component_el_option, {
2982
- label: "是",
2983
- value: "1"
2984
- }),
2985
- createVNode(_component_el_option, {
2986
- label: "",
2987
- value: "0"
2988
- })
3247
+ createVNode(_component_el_input, {
3248
+ modelValue: fieldForm.dictKey,
3249
+ "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => fieldForm.dictKey = $event),
3250
+ type: "textarea",
3251
+ rows: 8,
3252
+ placeholder: "JSON 格式"
3253
+ }, null, 8, ["modelValue"])
2989
3254
  ]),
2990
3255
  _: 1
2991
- }, 8, ["modelValue"])
3256
+ })
2992
3257
  ]),
2993
- _: 1
2994
- }),
3258
+ createElementVNode("div", _hoisted_25, [
3259
+ createVNode(_component_el_button, { onClick: resetFieldForm }, {
3260
+ default: withCtx(() => _cache[27] || (_cache[27] = [
3261
+ createTextVNode("重置")
3262
+ ])),
3263
+ _: 1,
3264
+ __: [27]
3265
+ }),
3266
+ createVNode(_component_el_button, {
3267
+ type: "primary",
3268
+ onClick: submitField
3269
+ }, {
3270
+ default: withCtx(() => [
3271
+ createTextVNode(toDisplayString(editingField.value ? "更新" : "提交"), 1)
3272
+ ]),
3273
+ _: 1
3274
+ })
3275
+ ])
3276
+ ]),
3277
+ _: 1
3278
+ }, 8, ["model"])
3279
+ ]),
3280
+ createElementVNode("div", _hoisted_26, [
3281
+ _cache[29] || (_cache[29] = createElementVNode("div", { class: "config-section__header" }, [
3282
+ createElementVNode("span", { class: "config-section__title" }, "字段列表")
3283
+ ], -1)),
3284
+ createVNode(XVxeTable, {
3285
+ "table-data": fieldTableData.value,
3286
+ "sub-height": "280px",
3287
+ "show-pagination": true,
3288
+ "page-size": fieldPage.pageSize,
3289
+ "current-page": fieldPage.currentPage,
3290
+ total: fieldPage.total,
3291
+ "show-toolbar": false,
3292
+ onChangePage: handleFieldPageChange
3293
+ }, {
3294
+ default: withCtx(() => [
3295
+ createVNode(XVxeColumn, {
3296
+ title: "字段名称",
3297
+ field: "fieldName",
3298
+ "min-width": "120"
3299
+ }),
3300
+ createVNode(XVxeColumn, {
3301
+ title: "Java名称",
3302
+ field: "fieldJavaName",
3303
+ "min-width": "120"
3304
+ }),
3305
+ createVNode(XVxeColumn, {
3306
+ title: "字段类型",
3307
+ field: "fieldType",
3308
+ "min-width": "120"
3309
+ }),
3310
+ createVNode(XVxeColumn, {
3311
+ title: "是否必填",
3312
+ field: "isRequire",
3313
+ width: "90"
3314
+ }, {
3315
+ default: withCtx(({ row }) => [
3316
+ createVNode(_component_el_tag, {
3317
+ type: row.isRequire === "1" ? "danger" : "info",
3318
+ size: "small"
3319
+ }, {
3320
+ default: withCtx(() => [
3321
+ createTextVNode(toDisplayString(row.isRequire === "1" ? "必填" : "非必填"), 1)
3322
+ ]),
3323
+ _: 2
3324
+ }, 1032, ["type"])
3325
+ ]),
3326
+ _: 1
3327
+ }),
3328
+ createVNode(XVxeColumn, {
3329
+ title: "操作",
3330
+ width: "100",
3331
+ fixed: "right"
3332
+ }, {
3333
+ default: withCtx(({ row }) => [
3334
+ createVNode(_component_el_button, {
3335
+ type: "primary",
3336
+ link: "",
3337
+ size: "small",
3338
+ onClick: ($event) => handleEditField(row)
3339
+ }, {
3340
+ default: withCtx(() => _cache[28] || (_cache[28] = [
3341
+ createTextVNode("编辑")
3342
+ ])),
3343
+ _: 2,
3344
+ __: [28]
3345
+ }, 1032, ["onClick"])
3346
+ ]),
3347
+ _: 1
3348
+ })
3349
+ ]),
3350
+ _: 1
3351
+ }, 8, ["table-data", "page-size", "current-page", "total"])
3352
+ ])
3353
+ ], 64)) : (openBlock(), createElementBlock("div", _hoisted_27, [
3354
+ createVNode(_component_el_empty, { description: "请先在左侧选择一个系统" })
3355
+ ]))
3356
+ ]),
3357
+ createVNode(_component_el_dialog, {
3358
+ modelValue: systemDialogVisible.value,
3359
+ "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => systemDialogVisible.value = $event),
3360
+ title: editingSystem.value ? "编辑系统" : "新增系统",
3361
+ width: "460px",
3362
+ "destroy-on-close": ""
3363
+ }, {
3364
+ footer: withCtx(() => [
3365
+ createVNode(_component_el_button, {
3366
+ onClick: _cache[12] || (_cache[12] = ($event) => systemDialogVisible.value = false)
3367
+ }, {
3368
+ default: withCtx(() => _cache[30] || (_cache[30] = [
3369
+ createTextVNode("取消")
3370
+ ])),
3371
+ _: 1,
3372
+ __: [30]
3373
+ }),
3374
+ createVNode(_component_el_button, {
3375
+ type: "primary",
3376
+ onClick: submitSystem
3377
+ }, {
3378
+ default: withCtx(() => _cache[31] || (_cache[31] = [
3379
+ createTextVNode("确定")
3380
+ ])),
3381
+ _: 1,
3382
+ __: [31]
3383
+ })
3384
+ ]),
3385
+ default: withCtx(() => [
3386
+ createVNode(_component_el_form, {
3387
+ model: systemForm,
3388
+ ref_key: "systemFormRef",
3389
+ ref: systemFormRef,
3390
+ "label-suffix": ":",
3391
+ "label-width": "90px"
3392
+ }, {
3393
+ default: withCtx(() => [
2995
3394
  createVNode(_component_el_form_item, {
2996
- label: "是否缓存",
2997
- prop: "isCache"
3395
+ label: "系统名称",
3396
+ prop: "systemName",
3397
+ rules: [{ required: true, message: "请输入系统名称" }]
2998
3398
  }, {
2999
3399
  default: withCtx(() => [
3000
- createVNode(_component_el_checkbox, {
3001
- modelValue: form2.isCache,
3002
- "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => form2.isCache = $event)
3003
- }, {
3004
- default: withCtx(() => _cache[16] || (_cache[16] = [
3005
- createTextVNode("缓存")
3006
- ])),
3007
- _: 1,
3008
- __: [16]
3009
- }, 8, ["modelValue"])
3400
+ createVNode(_component_el_input, {
3401
+ modelValue: systemForm.systemName,
3402
+ "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => systemForm.systemName = $event),
3403
+ placeholder: "请输入系统名称"
3404
+ }, null, 8, ["modelValue"])
3010
3405
  ]),
3011
3406
  _: 1
3012
3407
  })
3013
3408
  ]),
3014
- createElementVNode("div", _hoisted_8, [
3409
+ _: 1
3410
+ }, 8, ["model"])
3411
+ ]),
3412
+ _: 1
3413
+ }, 8, ["modelValue", "title"]),
3414
+ createVNode(_component_el_dialog, {
3415
+ modelValue: moduleDialogVisible.value,
3416
+ "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => moduleDialogVisible.value = $event),
3417
+ title: editingModule.value ? "编辑模块" : "新增模块",
3418
+ width: "460px",
3419
+ "destroy-on-close": ""
3420
+ }, {
3421
+ footer: withCtx(() => [
3422
+ createVNode(_component_el_button, {
3423
+ onClick: _cache[16] || (_cache[16] = ($event) => moduleDialogVisible.value = false)
3424
+ }, {
3425
+ default: withCtx(() => _cache[32] || (_cache[32] = [
3426
+ createTextVNode("取消")
3427
+ ])),
3428
+ _: 1,
3429
+ __: [32]
3430
+ }),
3431
+ createVNode(_component_el_button, {
3432
+ type: "primary",
3433
+ onClick: submitModule
3434
+ }, {
3435
+ default: withCtx(() => _cache[33] || (_cache[33] = [
3436
+ createTextVNode("确定")
3437
+ ])),
3438
+ _: 1,
3439
+ __: [33]
3440
+ })
3441
+ ]),
3442
+ default: withCtx(() => [
3443
+ createVNode(_component_el_form, {
3444
+ model: moduleForm,
3445
+ ref_key: "moduleFormRef",
3446
+ ref: moduleFormRef,
3447
+ "label-suffix": ":",
3448
+ "label-width": "110px"
3449
+ }, {
3450
+ default: withCtx(() => [
3015
3451
  createVNode(_component_el_form_item, {
3016
- label: "字段属性",
3017
- prop: "attribute",
3018
- class: "form-item--span2"
3452
+ label: "模块/页面code",
3453
+ prop: "moduleCode",
3454
+ rules: [{ required: true, message: "请输入" }]
3019
3455
  }, {
3020
3456
  default: withCtx(() => [
3021
3457
  createVNode(_component_el_input, {
3022
- modelValue: form2.attribute,
3023
- "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => form2.attribute = $event),
3024
- placeholder: "请输入",
3025
- type: "textarea",
3026
- rows: 3
3458
+ modelValue: moduleForm.moduleCode,
3459
+ "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => moduleForm.moduleCode = $event),
3460
+ placeholder: "请输入"
3027
3461
  }, null, 8, ["modelValue"])
3028
3462
  ]),
3029
3463
  _: 1
3030
3464
  }),
3031
3465
  createVNode(_component_el_form_item, {
3032
- label: "额外属性",
3033
- prop: "dictKey",
3034
- class: "form-item--span2"
3466
+ label: "模块/页面名称",
3467
+ prop: "moduleName",
3468
+ rules: [{ required: true, message: "请输入" }]
3035
3469
  }, {
3036
3470
  default: withCtx(() => [
3037
3471
  createVNode(_component_el_input, {
3038
- modelValue: form2.dictKey,
3039
- "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => form2.dictKey = $event),
3040
- placeholder: "请输入",
3041
- type: "textarea",
3042
- rows: 3
3472
+ modelValue: moduleForm.moduleName,
3473
+ "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => moduleForm.moduleName = $event),
3474
+ placeholder: "请输入"
3043
3475
  }, null, 8, ["modelValue"])
3044
3476
  ]),
3045
3477
  _: 1
3046
- }),
3047
- createVNode(_component_el_form_item, { class: "form-item--btn" }, {
3048
- default: withCtx(() => [
3049
- createVNode(_component_el_button, {
3050
- type: "primary",
3051
- onClick: subSys2
3052
- }, {
3053
- default: withCtx(() => _cache[17] || (_cache[17] = [
3054
- createTextVNode("提交")
3055
- ])),
3056
- _: 1,
3057
- __: [17]
3058
- })
3059
- ]),
3060
- _: 1
3061
3478
  })
3062
- ])
3063
- ])
3479
+ ]),
3480
+ _: 1
3481
+ }, 8, ["model"])
3064
3482
  ]),
3065
3483
  _: 1
3066
- }, 8, ["rules", "model"])
3484
+ }, 8, ["modelValue", "title"])
3067
3485
  ]);
3068
3486
  };
3069
3487
  }
3070
3488
  });
3071
- const XSearchBarConfig = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e465bd38"]]);
3489
+ const XSearchBarConfig = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0f4e9ec9"]]);
3072
3490
  const components = {
3073
3491
  XDatePicker,
3074
3492
  XElForm,