@yugu-ui/flow-ui 0.1.8 → 0.1.9

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,6 +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
9
  };
8
10
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
11
  formChange: (data: any) => any;
@@ -29,6 +31,7 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {
29
31
  flowName: string;
30
32
  activeTab: "form" | "flow" | "more";
31
33
  publishing: boolean;
34
+ hideFields: boolean;
32
35
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
33
36
  declare const _default: typeof __VLS_export;
34
37
  export default _default;
package/dist/index.js CHANGED
@@ -4708,7 +4708,6 @@ var FlowConfigMore_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/
4708
4708
  return (_ctx, _cache) => {
4709
4709
  const _component_NFormItem = NFormItem;
4710
4710
  const _component_NInputNumber = NInputNumber;
4711
- const _component_NSwitch = NSwitch;
4712
4711
  const _component_NInput = NInput;
4713
4712
  const _component_NForm = NForm;
4714
4713
  return openBlock(), createElementBlock("div", _hoisted_1$11, [createVNode(_component_NForm, {
@@ -4740,40 +4739,10 @@ var FlowConfigMore_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/
4740
4739
  }, null, 8, ["value"])]),
4741
4740
  _: 1
4742
4741
  }),
4743
- createVNode(_component_NFormItem, { label: "允许撤回" }, {
4744
- default: withCtx(() => [createVNode(_component_NSwitch, {
4745
- value: settings.value.allowWithdraw,
4746
- "onUpdate:value": _cache[2] || (_cache[2] = ($event) => settings.value.allowWithdraw = $event)
4747
- }, null, 8, ["value"])]),
4748
- _: 1
4749
- }),
4750
- createVNode(_component_NFormItem, { label: "允许催办" }, {
4751
- default: withCtx(() => [createVNode(_component_NSwitch, {
4752
- value: settings.value.allowUrge,
4753
- "onUpdate:value": _cache[3] || (_cache[3] = ($event) => settings.value.allowUrge = $event)
4754
- }, null, 8, ["value"])]),
4755
- _: 1
4756
- }),
4757
- createVNode(_component_NFormItem, { label: "审批超时(小时)" }, {
4758
- default: withCtx(() => [createVNode(_component_NInputNumber, {
4759
- value: settings.value.timeout,
4760
- "onUpdate:value": _cache[4] || (_cache[4] = ($event) => settings.value.timeout = $event),
4761
- min: 0,
4762
- placeholder: "0为不限制"
4763
- }, null, 8, ["value"])]),
4764
- _: 1
4765
- }),
4766
- createVNode(_component_NFormItem, { label: "超时自动通过" }, {
4767
- default: withCtx(() => [createVNode(_component_NSwitch, {
4768
- value: settings.value.autoPass,
4769
- "onUpdate:value": _cache[5] || (_cache[5] = ($event) => settings.value.autoPass = $event)
4770
- }, null, 8, ["value"])]),
4771
- _: 1
4772
- }),
4773
4742
  createVNode(_component_NFormItem, { label: "备注" }, {
4774
4743
  default: withCtx(() => [createVNode(_component_NInput, {
4775
4744
  value: settings.value.remark,
4776
- "onUpdate:value": _cache[6] || (_cache[6] = ($event) => settings.value.remark = $event),
4745
+ "onUpdate:value": _cache[2] || (_cache[2] = ($event) => settings.value.remark = $event),
4777
4746
  type: "textarea",
4778
4747
  placeholder: "请输入备注信息",
4779
4748
  autosize: {
@@ -4788,7 +4757,7 @@ var FlowConfigMore_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/
4788
4757
  }, 8, ["model"])]);
4789
4758
  };
4790
4759
  }
4791
- }), [["__scopeId", "data-v-7ba16bba"]]);
4760
+ }), [["__scopeId", "data-v-b4e7caf8"]]);
4792
4761
  //#endregion
4793
4762
  //#region src/config/FlowConfig.vue?vue&type=script&setup=true&lang.ts
4794
4763
  var _hoisted_1$10 = { class: "flow-config__header" };
@@ -4807,7 +4776,11 @@ var FlowConfig_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @_
4807
4776
  type: Boolean,
4808
4777
  default: false
4809
4778
  },
4810
- isExternal: { default: 0 }
4779
+ isExternal: { default: 0 },
4780
+ hideFields: {
4781
+ type: Boolean,
4782
+ default: false
4783
+ }
4811
4784
  },
4812
4785
  emits: [
4813
4786
  "formChange",
@@ -4819,13 +4792,14 @@ var FlowConfig_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @_
4819
4792
  const props = __props;
4820
4793
  const emit = __emit;
4821
4794
  const cssVars = useFcCssVars();
4822
- const currentStep = ref({
4795
+ const tabToStep = {
4823
4796
  form: 1,
4824
4797
  flow: 2,
4825
4798
  more: 3
4826
- }[props.activeTab] ?? 1);
4799
+ };
4800
+ const currentStep = ref(props.hideFields && (tabToStep[props.activeTab] ?? 1) === 1 ? 2 : tabToStep[props.activeTab] ?? 1);
4827
4801
  /** tab 配置(v-for 渲染,value 即步骤序号) */
4828
- const steps = [
4802
+ const steps = computed(() => [
4829
4803
  {
4830
4804
  value: 1,
4831
4805
  label: "字段配置"
@@ -4838,7 +4812,10 @@ var FlowConfig_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @_
4838
4812
  value: 3,
4839
4813
  label: "更多设置"
4840
4814
  }
4841
- ];
4815
+ ].filter((step) => !(props.hideFields && step.value === 1)));
4816
+ watch(() => props.hideFields, (v) => {
4817
+ if (v && currentStep.value === 1) currentStep.value = 2;
4818
+ });
4842
4819
  const formData = ref({});
4843
4820
  const fieldData = ref({});
4844
4821
  const flowData = ref({});
@@ -4881,11 +4858,11 @@ var FlowConfig_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @_
4881
4858
  validating.value = true;
4882
4859
  try {
4883
4860
  const failed = [
4884
- {
4861
+ ...props.hideFields ? [] : [{
4885
4862
  step: 1,
4886
4863
  tip: "【字段配置】存在未填写项",
4887
4864
  errors: fieldRef.value?.validate?.() || []
4888
- },
4865
+ }],
4889
4866
  {
4890
4867
  step: 2,
4891
4868
  tip: "【流程设计】条件未配置完整",
@@ -4936,15 +4913,15 @@ var FlowConfig_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @_
4936
4913
  type: "segment",
4937
4914
  class: "flow-config__tabs"
4938
4915
  }, {
4939
- default: withCtx(() => [(openBlock(), createElementBlock(Fragment, null, renderList(steps, (step) => {
4940
- return createVNode(_component_NTab, {
4916
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(steps.value, (step) => {
4917
+ return openBlock(), createBlock(_component_NTab, {
4941
4918
  key: step.value,
4942
4919
  name: step.value
4943
4920
  }, {
4944
4921
  default: withCtx(() => [createTextVNode(toDisplayString(step.label), 1)]),
4945
4922
  _: 2
4946
4923
  }, 1032, ["name"]);
4947
- }), 64))]),
4924
+ }), 128))]),
4948
4925
  _: 1
4949
4926
  }, 8, ["value"]),
4950
4927
  createVNode(_component_NButton, {
@@ -4992,7 +4969,7 @@ var FlowConfig_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @_
4992
4969
  }, 8, ["style"]);
4993
4970
  };
4994
4971
  }
4995
- }), [["__scopeId", "data-v-487f26ff"]]);
4972
+ }), [["__scopeId", "data-v-86b98e2f"]]);
4996
4973
  //#endregion
4997
4974
  //#region src/utils/common.ts
4998
4975
  /** 判断是否为空(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-7ba16bba] {
1541
+ .flow-config-more[data-v-b4e7caf8] {
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-487f26ff] {
1553
+ .flow-config[data-v-86b98e2f] {
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-487f26ff] {
1560
+ .flow-config__header[data-v-86b98e2f] {
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-487f26ff] {
1571
+ .flow-config__title[data-v-86b98e2f] {
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-487f26ff] {
1582
+ .flow-config__publish[data-v-86b98e2f] {
1583
1583
  position: absolute;
1584
1584
  right: 20px;
1585
1585
  }
1586
- .flow-config[data-v-487f26ff] {
1586
+ .flow-config[data-v-86b98e2f] {
1587
1587
  /* Developed collaboratively with vscode - 改动代码行数: 7行(NTabs segment 收缩为内容宽度;segment 模式 rail 均分容器宽度,fit-content 下富余为零导致标签文字紧连,补 label 水平内边距还原分段控件观感) */
1588
1588
  }
1589
- .flow-config__tabs[data-v-487f26ff] {
1589
+ .flow-config__tabs[data-v-86b98e2f] {
1590
1590
  width: fit-content;
1591
1591
  }
1592
- .flow-config__tabs[data-v-487f26ff] .n-tabs-tab__label {
1592
+ .flow-config__tabs[data-v-86b98e2f] .n-tabs-tab__label {
1593
1593
  padding: 0 12px;
1594
1594
  }
1595
- .flow-config[data-v-487f26ff] {
1595
+ .flow-config[data-v-86b98e2f] {
1596
1596
  /* Developed collaboratively with vscode - 改动代码行数: 9行(内容区 loading:NSpin 链式撑满替代原 body 的 flex 布局职责) */
1597
1597
  /* NSpin 承载内容区 flex 布局职责,内部容器链式撑满,保证 body 滚动与遮罩覆盖正确 */
1598
1598
  }
1599
- .flow-config__spin[data-v-487f26ff] {
1599
+ .flow-config__spin[data-v-86b98e2f] {
1600
1600
  flex: 1;
1601
1601
  min-height: 0;
1602
1602
  }
1603
- .flow-config__spin[data-v-487f26ff] .n-spin-container,
1604
- .flow-config__spin[data-v-487f26ff] .n-spin-content {
1603
+ .flow-config__spin[data-v-86b98e2f] .n-spin-container,
1604
+ .flow-config__spin[data-v-86b98e2f] .n-spin-content {
1605
1605
  height: 100%;
1606
1606
  }
1607
- .flow-config__body[data-v-487f26ff] {
1607
+ .flow-config__body[data-v-86b98e2f] {
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-487f26ff] > * {
1613
+ .flow-config__body[data-v-86b98e2f] > * {
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.8",
3
+ "version": "0.1.9",
4
4
  "description": "堉古商城流程组件库:流程设计器(config)/ 审批时间线(timeline)/ 流程列表(FlowList)",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",