@yugu-ui/flow-ui 0.1.10 → 0.1.11

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.
@@ -4,8 +4,8 @@ type __VLS_Props = {
4
4
  data?: Record<string, any> | null;
5
5
  publishing?: boolean;
6
6
  isExternal?: number;
7
- /** 是否隐藏「字段配置」页签(true=不渲染该 tab,fields 数据仍随 publish 输出) */
8
- hideFields?: boolean;
7
+ /** 本地开发模式(true=展示字段配置页签与更多设置预留字段;false=打包后行为,两者隐藏,数据仍随 publish 输出) */
8
+ devMode?: boolean;
9
9
  };
10
10
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
11
  formChange: (data: any) => any;
@@ -31,7 +31,7 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {
31
31
  flowName: string;
32
32
  activeTab: "form" | "flow" | "more";
33
33
  publishing: boolean;
34
- hideFields: boolean;
34
+ devMode: boolean;
35
35
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
36
36
  declare const _default: typeof __VLS_export;
37
37
  export default _default;
@@ -1,5 +1,7 @@
1
1
  type __VLS_Props = {
2
2
  data?: Record<string, any>;
3
+ /** 是否展示预留配置项(撤回/转办/加签/催办/审批超时/超时自动通过/通知方式);隐藏时字段仍按默认值/回显值随 change 输出 */
4
+ showReserved?: boolean;
3
5
  };
4
6
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {
5
7
  validate: () => Promise<string[]>;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { NAvatar, NButton, NCard, NCheckbox, NCollapse, NCollapseItem, NDrawer, NDrawerContent, NEl, NEllipsis, NEmpty, NForm, NFormItem, NImage, NInput, NInputGroup, NInputGroupLabel, NInputNumber, NModal, NPopover, NRadio, NRadioButton, NRadioGroup, NSelect, NSpace, NSpin, NSwitch, NTab, NTabs, NTag, NTooltip, useThemeVars } from "naive-ui";
1
+ import { NAvatar, NButton, NCard, NCheckbox, NCheckboxGroup, NCollapse, NCollapseItem, NDrawer, NDrawerContent, NEl, NEllipsis, NEmpty, NForm, NFormItem, NImage, NInput, NInputGroup, NInputGroupLabel, NInputNumber, NModal, NPopover, NRadio, NRadioButton, NRadioGroup, NSelect, NSpace, NSpin, NSwitch, NTab, NTabs, NTag, NTooltip, useThemeVars } from "naive-ui";
2
2
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, inject, markRaw, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, openBlock, provide, reactive, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toRef, unref, useModel, useSlots, vModelText, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
3
3
  import { Graph } from "@antv/x6";
4
4
  import { VueShapeView, getTeleport, register } from "@antv/x6-vue-shape";
@@ -2196,7 +2196,7 @@ var initGraph = (container, options = {}) => {
2196
2196
  },
2197
2197
  panning: {
2198
2198
  enabled: true,
2199
- eventTypes: ["rightMouseDown"]
2199
+ eventTypes: ["leftMouseDown"]
2200
2200
  },
2201
2201
  connecting: { enabled: false },
2202
2202
  interacting: {
@@ -4659,7 +4659,10 @@ var _hoisted_1$11 = { class: "flow-config-more" };
4659
4659
  var FlowConfigMore_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
4660
4660
  name: "FlowConfigMore",
4661
4661
  __name: "FlowConfigMore",
4662
- props: { data: {} },
4662
+ props: {
4663
+ data: {},
4664
+ showReserved: { type: Boolean }
4665
+ },
4663
4666
  emits: ["change"],
4664
4667
  setup(__props, { expose: __expose, emit: __emit }) {
4665
4668
  const props = __props;
@@ -4671,6 +4674,7 @@ var FlowConfigMore_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/
4671
4674
  allowTransfer: false,
4672
4675
  allowAddSign: false,
4673
4676
  allowUrge: true,
4677
+ allowRevokeAfterPass: false,
4674
4678
  timeout: 24,
4675
4679
  autoPass: false,
4676
4680
  notifyMethods: ["system"],
@@ -4708,6 +4712,9 @@ var FlowConfigMore_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/
4708
4712
  return (_ctx, _cache) => {
4709
4713
  const _component_NFormItem = NFormItem;
4710
4714
  const _component_NInputNumber = NInputNumber;
4715
+ const _component_NSwitch = NSwitch;
4716
+ const _component_NCheckbox = NCheckbox;
4717
+ const _component_NCheckboxGroup = NCheckboxGroup;
4711
4718
  const _component_NInput = NInput;
4712
4719
  const _component_NForm = NForm;
4713
4720
  return openBlock(), createElementBlock("div", _hoisted_1$11, [createVNode(_component_NForm, {
@@ -4739,10 +4746,86 @@ var FlowConfigMore_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/
4739
4746
  }, null, 8, ["value"])]),
4740
4747
  _: 1
4741
4748
  }),
4749
+ __props.showReserved ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
4750
+ createVNode(_component_NFormItem, { label: "允许撤回" }, {
4751
+ default: withCtx(() => [createVNode(_component_NSwitch, {
4752
+ value: settings.value.allowWithdraw,
4753
+ "onUpdate:value": _cache[2] || (_cache[2] = ($event) => settings.value.allowWithdraw = $event)
4754
+ }, null, 8, ["value"])]),
4755
+ _: 1
4756
+ }),
4757
+ createVNode(_component_NFormItem, { label: "允许转办" }, {
4758
+ default: withCtx(() => [createVNode(_component_NSwitch, {
4759
+ value: settings.value.allowTransfer,
4760
+ "onUpdate:value": _cache[3] || (_cache[3] = ($event) => settings.value.allowTransfer = $event)
4761
+ }, null, 8, ["value"])]),
4762
+ _: 1
4763
+ }),
4764
+ createVNode(_component_NFormItem, { label: "允许加签" }, {
4765
+ default: withCtx(() => [createVNode(_component_NSwitch, {
4766
+ value: settings.value.allowAddSign,
4767
+ "onUpdate:value": _cache[4] || (_cache[4] = ($event) => settings.value.allowAddSign = $event)
4768
+ }, null, 8, ["value"])]),
4769
+ _: 1
4770
+ }),
4771
+ createVNode(_component_NFormItem, { label: "允许催办" }, {
4772
+ default: withCtx(() => [createVNode(_component_NSwitch, {
4773
+ value: settings.value.allowUrge,
4774
+ "onUpdate:value": _cache[5] || (_cache[5] = ($event) => settings.value.allowUrge = $event)
4775
+ }, null, 8, ["value"])]),
4776
+ _: 1
4777
+ }),
4778
+ createVNode(_component_NFormItem, { label: "审批超时(小时)" }, {
4779
+ default: withCtx(() => [createVNode(_component_NInputNumber, {
4780
+ value: settings.value.timeout,
4781
+ "onUpdate:value": _cache[6] || (_cache[6] = ($event) => settings.value.timeout = $event),
4782
+ min: 0,
4783
+ placeholder: "0为不限制"
4784
+ }, null, 8, ["value"])]),
4785
+ _: 1
4786
+ }),
4787
+ createVNode(_component_NFormItem, { label: "超时自动通过" }, {
4788
+ default: withCtx(() => [createVNode(_component_NSwitch, {
4789
+ value: settings.value.autoPass,
4790
+ "onUpdate:value": _cache[7] || (_cache[7] = ($event) => settings.value.autoPass = $event)
4791
+ }, null, 8, ["value"])]),
4792
+ _: 1
4793
+ }),
4794
+ createVNode(_component_NFormItem, { label: "通知方式" }, {
4795
+ default: withCtx(() => [createVNode(_component_NCheckboxGroup, {
4796
+ value: settings.value.notifyMethods,
4797
+ "onUpdate:value": _cache[8] || (_cache[8] = ($event) => settings.value.notifyMethods = $event)
4798
+ }, {
4799
+ default: withCtx(() => [
4800
+ createVNode(_component_NCheckbox, { value: "system" }, {
4801
+ default: withCtx(() => [..._cache[11] || (_cache[11] = [createTextVNode("系统通知", -1)])]),
4802
+ _: 1
4803
+ }),
4804
+ createVNode(_component_NCheckbox, { value: "email" }, {
4805
+ default: withCtx(() => [..._cache[12] || (_cache[12] = [createTextVNode("邮件", -1)])]),
4806
+ _: 1
4807
+ }),
4808
+ createVNode(_component_NCheckbox, { value: "sms" }, {
4809
+ default: withCtx(() => [..._cache[13] || (_cache[13] = [createTextVNode("短信", -1)])]),
4810
+ _: 1
4811
+ })
4812
+ ]),
4813
+ _: 1
4814
+ }, 8, ["value"])]),
4815
+ _: 1
4816
+ })
4817
+ ], 64)) : createCommentVNode("", true),
4818
+ createVNode(_component_NFormItem, { label: "通过后撤销" }, {
4819
+ default: withCtx(() => [createVNode(_component_NSwitch, {
4820
+ value: settings.value.allowRevokeAfterPass,
4821
+ "onUpdate:value": _cache[9] || (_cache[9] = ($event) => settings.value.allowRevokeAfterPass = $event)
4822
+ }, null, 8, ["value"])]),
4823
+ _: 1
4824
+ }),
4742
4825
  createVNode(_component_NFormItem, { label: "备注" }, {
4743
4826
  default: withCtx(() => [createVNode(_component_NInput, {
4744
4827
  value: settings.value.remark,
4745
- "onUpdate:value": _cache[2] || (_cache[2] = ($event) => settings.value.remark = $event),
4828
+ "onUpdate:value": _cache[10] || (_cache[10] = ($event) => settings.value.remark = $event),
4746
4829
  type: "textarea",
4747
4830
  placeholder: "请输入备注信息",
4748
4831
  autosize: {
@@ -4757,7 +4840,7 @@ var FlowConfigMore_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/
4757
4840
  }, 8, ["model"])]);
4758
4841
  };
4759
4842
  }
4760
- }), [["__scopeId", "data-v-b4e7caf8"]]);
4843
+ }), [["__scopeId", "data-v-fb67635a"]]);
4761
4844
  //#endregion
4762
4845
  //#region src/config/FlowConfig.vue?vue&type=script&setup=true&lang.ts
4763
4846
  var _hoisted_1$10 = { class: "flow-config__header" };
@@ -4777,7 +4860,7 @@ var FlowConfig_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @_
4777
4860
  default: false
4778
4861
  },
4779
4862
  isExternal: { default: 0 },
4780
- hideFields: {
4863
+ devMode: {
4781
4864
  type: Boolean,
4782
4865
  default: false
4783
4866
  }
@@ -4797,7 +4880,7 @@ var FlowConfig_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @_
4797
4880
  flow: 2,
4798
4881
  more: 3
4799
4882
  };
4800
- const currentStep = ref(props.hideFields && (tabToStep[props.activeTab] ?? 1) === 1 ? 2 : tabToStep[props.activeTab] ?? 1);
4883
+ const currentStep = ref(!props.devMode && (tabToStep[props.activeTab] ?? 1) === 1 ? 2 : tabToStep[props.activeTab] ?? 1);
4801
4884
  /** tab 配置(v-for 渲染,value 即步骤序号) */
4802
4885
  const steps = computed(() => [
4803
4886
  {
@@ -4812,9 +4895,9 @@ var FlowConfig_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @_
4812
4895
  value: 3,
4813
4896
  label: "更多设置"
4814
4897
  }
4815
- ].filter((step) => !(props.hideFields && step.value === 1)));
4816
- watch(() => props.hideFields, (v) => {
4817
- if (v && currentStep.value === 1) currentStep.value = 2;
4898
+ ].filter((step) => props.devMode || step.value !== 1));
4899
+ watch(() => props.devMode, (v) => {
4900
+ if (!v && currentStep.value === 1) currentStep.value = 2;
4818
4901
  });
4819
4902
  const formData = ref({});
4820
4903
  const fieldData = ref({});
@@ -4858,7 +4941,7 @@ var FlowConfig_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @_
4858
4941
  validating.value = true;
4859
4942
  try {
4860
4943
  const failed = [
4861
- ...props.hideFields ? [] : [{
4944
+ ...!props.devMode ? [] : [{
4862
4945
  step: 1,
4863
4946
  tip: "【字段配置】存在未填写项",
4864
4947
  errors: fieldRef.value?.validate?.() || []
@@ -4960,8 +5043,9 @@ var FlowConfig_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @_
4960
5043
  ref_key: "moreRef",
4961
5044
  ref: moreRef,
4962
5045
  data: moreData.value,
5046
+ "show-reserved": __props.devMode,
4963
5047
  onChange: handleMoreChange
4964
- }, null, 8, ["data"]), [[vShow, currentStep.value === 3]])
5048
+ }, null, 8, ["data", "show-reserved"]), [[vShow, currentStep.value === 3]])
4965
5049
  ])]),
4966
5050
  _: 1
4967
5051
  }, 8, ["show"])]),
@@ -4969,7 +5053,7 @@ var FlowConfig_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @_
4969
5053
  }, 8, ["style"]);
4970
5054
  };
4971
5055
  }
4972
- }), [["__scopeId", "data-v-86b98e2f"]]);
5056
+ }), [["__scopeId", "data-v-5e56d074"]]);
4973
5057
  //#endregion
4974
5058
  //#region src/utils/common.ts
4975
5059
  /** 判断是否为空(undefined/null/空字符串) */
package/dist/style.css CHANGED
@@ -1538,7 +1538,7 @@ to {
1538
1538
  }
1539
1539
  /* Developed collaboratively with vscode - 改动代码行数: 1行(style 块改用 scss) */
1540
1540
  /* Developed collaboratively with vscode - 改动代码行数: 6行 */
1541
- .flow-config-more[data-v-b4e7caf8] {
1541
+ .flow-config-more[data-v-fb67635a] {
1542
1542
  max-width: 600px;
1543
1543
  /* Developed collaboratively with vscode - 改动代码行数: 3行(白色背景 + 圆角 + 距外部 20px 边距) */
1544
1544
  margin: 20px auto;
@@ -1550,14 +1550,14 @@ to {
1550
1550
  }
1551
1551
  /* Developed collaboratively with vscode - 改动代码行数: 1行(style 块改用 scss 并做 BEM 嵌套整理) */
1552
1552
  /* Developed collaboratively with vscode - 改动代码行数: 14行 */
1553
- .flow-config[data-v-86b98e2f] {
1553
+ .flow-config[data-v-5e56d074] {
1554
1554
  /* .n-card 根元素自带 flex column 布局与 cardColor 背景,此处只补满高度;
1555
1555
  overflow: hidden 让底部圆角裁掉子组件直角背景的超出部分 */
1556
1556
  /* Developed collaboratively with vscode - 改动代码行数: 1行(根容器裁剪圆角外溢出) */
1557
1557
  height: 100%;
1558
1558
  overflow: hidden;
1559
1559
  }
1560
- .flow-config__header[data-v-86b98e2f] {
1560
+ .flow-config__header[data-v-5e56d074] {
1561
1561
  /* header 插槽行:占满卡片头部宽度并作为 title / publish 的 absolute 定位包含块;
1562
1562
  内容区自身滚动(overflow: auto),头部天然固定,无需 sticky */
1563
1563
  position: relative;
@@ -1568,7 +1568,7 @@ to {
1568
1568
  padding: 16px 20px;
1569
1569
  border-bottom: 1px solid var(--fc-border-color);
1570
1570
  }
1571
- .flow-config__title[data-v-86b98e2f] {
1571
+ .flow-config__title[data-v-5e56d074] {
1572
1572
  font-size: 15px;
1573
1573
  font-weight: 500;
1574
1574
  color: var(--fc-primary-color);
@@ -1579,38 +1579,38 @@ to {
1579
1579
  padding-left: 10px;
1580
1580
  border-left: 3px solid var(--fc-primary-color);
1581
1581
  }
1582
- .flow-config__publish[data-v-86b98e2f] {
1582
+ .flow-config__publish[data-v-5e56d074] {
1583
1583
  position: absolute;
1584
1584
  right: 20px;
1585
1585
  }
1586
- .flow-config[data-v-86b98e2f] {
1586
+ .flow-config[data-v-5e56d074] {
1587
1587
  /* Developed collaboratively with vscode - 改动代码行数: 7行(NTabs segment 收缩为内容宽度;segment 模式 rail 均分容器宽度,fit-content 下富余为零导致标签文字紧连,补 label 水平内边距还原分段控件观感) */
1588
1588
  }
1589
- .flow-config__tabs[data-v-86b98e2f] {
1589
+ .flow-config__tabs[data-v-5e56d074] {
1590
1590
  width: fit-content;
1591
1591
  }
1592
- .flow-config__tabs[data-v-86b98e2f] .n-tabs-tab__label {
1592
+ .flow-config__tabs[data-v-5e56d074] .n-tabs-tab__label {
1593
1593
  padding: 0 12px;
1594
1594
  }
1595
- .flow-config[data-v-86b98e2f] {
1595
+ .flow-config[data-v-5e56d074] {
1596
1596
  /* Developed collaboratively with vscode - 改动代码行数: 9行(内容区 loading:NSpin 链式撑满替代原 body 的 flex 布局职责) */
1597
1597
  /* NSpin 承载内容区 flex 布局职责,内部容器链式撑满,保证 body 滚动与遮罩覆盖正确 */
1598
1598
  }
1599
- .flow-config__spin[data-v-86b98e2f] {
1599
+ .flow-config__spin[data-v-5e56d074] {
1600
1600
  flex: 1;
1601
1601
  min-height: 0;
1602
1602
  }
1603
- .flow-config__spin[data-v-86b98e2f] .n-spin-container,
1604
- .flow-config__spin[data-v-86b98e2f] .n-spin-content {
1603
+ .flow-config__spin[data-v-5e56d074] .n-spin-container,
1604
+ .flow-config__spin[data-v-5e56d074] .n-spin-content {
1605
1605
  height: 100%;
1606
1606
  }
1607
- .flow-config__body[data-v-86b98e2f] {
1607
+ .flow-config__body[data-v-5e56d074] {
1608
1608
  height: 100%;
1609
1609
  overflow: auto;
1610
1610
  /* 内容区浅色背景,子组件以白色卡片浮于其上 */
1611
1611
  background: var(--fc-bg-color);
1612
1612
  }
1613
- .flow-config__body[data-v-86b98e2f] > * {
1613
+ .flow-config__body[data-v-5e56d074] > * {
1614
1614
  min-height: 100%;
1615
1615
  }
1616
1616
  /* Developed collaboratively with vscode - 改动代码行数: 39行 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yugu-ui/flow-ui",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "堉古商城流程组件库:流程设计器(config)/ 审批时间线(timeline)/ 流程列表(FlowList)",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",