sun-biz 0.0.2-beta.2 → 0.0.2-beta.3

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.
@@ -15,6 +15,9 @@ export declare const COMPONENT_MAP: {
15
15
  "11": string;
16
16
  "6": string;
17
17
  "1": string;
18
+ "8": string;
19
+ "9": string;
20
+ "10": string;
18
21
  };
19
22
  /**
20
23
  * 分组展开 集合展示
@@ -206,13 +206,19 @@ const TableColumn = (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
206
206
  header: (scope)=>{
207
207
  if (column.headerRender) return column.headerRender(scope);
208
208
  if (column.prop && slots[`${handleProp(column.prop)}Header`]) return slots[`${handleProp(column.prop)}Header`](scope);
209
- return [
210
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)("span", {
211
- class: column.columnClass
209
+ return (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)("span", {
210
+ class: column.columnClass
211
+ }, [
212
+ column.required && (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)("span", {
213
+ class: "mr-2",
214
+ style: {
215
+ color: '#f56c6c'
216
+ }
212
217
  }, [
213
- column.label
214
- ], 2)
215
- ];
218
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)("*")
219
+ ]),
220
+ column.label
221
+ ], 2);
216
222
  },
217
223
  _: 1
218
224
  }, 16, [
@@ -2167,9 +2173,12 @@ const PatientInfo_exports_ = PatientInfovue_type_script_setup_true_lang_ts;
2167
2173
  const emit = __emit;
2168
2174
  const loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(true);
2169
2175
  const props = __props;
2170
- const tableData = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([]);
2171
- const rowKey = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)('id');
2172
- const rowName = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)('name');
2176
+ const tableData = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([
2177
+ {
2178
+ value: props.defaultValue,
2179
+ label: props.defaultValueName
2180
+ }
2181
+ ]);
2173
2182
  let inputChange = debounce(fetchData, 800);
2174
2183
  async function fetchData(value) {
2175
2184
  loading.value = true;
@@ -2183,28 +2192,17 @@ const PatientInfo_exports_ = PatientInfovue_type_script_setup_true_lang_ts;
2183
2192
  loading.value = false;
2184
2193
  if (result?.success) {
2185
2194
  let { primaryKey, displayKey, data } = result.data;
2186
- rowKey.value = primaryKey;
2187
- rowName.value = displayKey;
2188
- tableData.value = data.data || [];
2195
+ tableData.value = data.data.map((item)=>({
2196
+ value: item[primaryKey],
2197
+ label: item[displayKey]
2198
+ })) || [];
2189
2199
  }
2190
2200
  }
2191
- const options = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>{
2192
- if (!props.defaultValueName) return tableData.value;
2193
- let findObj = tableData.value.find((item)=>item[rowName.value] === props.defaultValueName);
2194
- if (!findObj) return [
2195
- ...tableData.value,
2196
- {
2197
- [rowKey.value]: props.defaultValue,
2198
- [rowName.value]: props.defaultValueName
2199
- }
2200
- ];
2201
- return tableData.value;
2202
- });
2203
2201
  /**
2204
- *
2205
- * @param value 下拉框选择
2206
- */ function change(value) {
2207
- let name = (options.value.find((item)=>item[rowKey.value] === value) || {})[rowName.value];
2202
+ *
2203
+ * @param value 下拉框选择
2204
+ */ function change(value) {
2205
+ let name = (tableData.value.find((item)=>item.value === value) || {})['label'];
2208
2206
  emit('change', value, name);
2209
2207
  }
2210
2208
  return (_ctx, _cache)=>{
@@ -2215,16 +2213,17 @@ const PatientInfo_exports_ = PatientInfovue_type_script_setup_true_lang_ts;
2215
2213
  loading: loading.value && !tableData.value.length,
2216
2214
  disabled: props.disabled,
2217
2215
  remote: true,
2216
+ filterable: true,
2218
2217
  onChange: change,
2219
2218
  "remote-method": (value)=>{
2220
2219
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(inputChange)(value);
2221
2220
  }
2222
2221
  }, {
2223
2222
  default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
2224
- ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(true), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderList)(options.value, (item)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(_component_el_option, {
2225
- key: item[rowKey.value],
2226
- label: item[rowName.value],
2227
- value: item[rowKey.value]
2223
+ ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(true), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderList)(tableData.value, (item)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(_component_el_option, {
2224
+ key: item.value,
2225
+ label: item.label,
2226
+ value: item.value
2228
2227
  }, null, 8, [
2229
2228
  "label",
2230
2229
  "value"
@@ -2243,7 +2242,7 @@ const PatientInfo_exports_ = PatientInfovue_type_script_setup_true_lang_ts;
2243
2242
  const dict_select_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(dict_selectvue_type_script_setup_true_lang_ts, [
2244
2243
  [
2245
2244
  '__scopeId',
2246
- "data-v-7fb4894b"
2245
+ "data-v-54541b2c"
2247
2246
  ]
2248
2247
  ]);
2249
2248
  /* ESM default export */ const dict_select = dict_select_exports_;
@@ -2659,38 +2658,11 @@ const FormUnitvue_type_script_setup_true_lang_ts_name_formUnit_hoisted_1 = {
2659
2658
  const FormUnitvue_type_script_setup_true_lang_ts_name_formUnit_hoisted_2 = {
2660
2659
  key: 1
2661
2660
  };
2662
- const FormUnitvue_type_script_setup_true_lang_ts_name_formUnit_hoisted_3 = {
2663
- class: "flex items-center justify-center border-2 p-12"
2664
- };
2665
2661
  const DICT_SELECT = 'dictSelect';
2666
- /**
2667
- * upload上传前操作
2668
- */ /* ESM default export */ const FormUnitvue_type_script_setup_true_lang_ts_name_formUnit = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
2662
+ /* ESM default export */ const FormUnitvue_type_script_setup_true_lang_ts_name_formUnit = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
2669
2663
  __name: 'FormUnit',
2670
2664
  setup (__props, { expose: __expose }) {
2671
2665
  const componentRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
2672
- const beforeUpload = (file)=>{
2673
- const isJsp = 'application/javascript' === file.type || file.name.endsWith('.jsp');
2674
- const isSvg = 'image/svg+xml' === file.type || file.name.endsWith('.svg');
2675
- const isPng = 'image/png' === file.type || file.name.endsWith('.png');
2676
- const isValidType = isJsp || isSvg || isPng;
2677
- const isValidSize = file.size / 1024 < 1000; // 转换为KB
2678
- if (!isValidType) __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error('只支持上传 .jsp、.svg 或 .png 文件!');
2679
- if (!isValidSize) __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error('文件大小不能超过 1000KB!');
2680
- return isValidType && isValidSize;
2681
- };
2682
- /**
2683
- * 选取文件
2684
- */ const handleChange = (file)=>{
2685
- const reader = new FileReader();
2686
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2687
- //@ts-expect-error
2688
- reader.readAsDataURL(file.raw);
2689
- reader.onload = ()=>{
2690
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2691
- attrs['onUpdate:modelValue'](reader.result);
2692
- };
2693
- };
2694
2666
  const attrs = (0, __WEBPACK_EXTERNAL_MODULE_vue__.useAttrs)();
2695
2667
  __expose(new Proxy({}, {
2696
2668
  get (_target, prop) {
@@ -2703,8 +2675,6 @@ const DICT_SELECT = 'dictSelect';
2703
2675
  }));
2704
2676
  return (_ctx, _cache)=>{
2705
2677
  const _component_el_option = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-option");
2706
- const _component_el_icon = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-icon");
2707
- const _component_el_button = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-button");
2708
2678
  return 'select' === (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveDynamicComponent)(`el-${(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component}`), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
2709
2679
  key: 0,
2710
2680
  filterable: !!(__WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.filterable || __WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.options?.length && __WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.options?.length > 5) || false
@@ -2745,42 +2715,8 @@ const DICT_SELECT = 'dictSelect';
2745
2715
  clearable: ""
2746
2716
  }, {
2747
2717
  ...(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs)
2748
- }), null, 16)) : 'upload' === (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveDynamicComponent)(`el-${(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component}`), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
2718
+ }), null, 16)) : ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveDynamicComponent)(`el-${(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component}`), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
2749
2719
  key: 5,
2750
- "before-upload": beforeUpload,
2751
- "on-change": handleChange,
2752
- "auto-upload": false
2753
- }, {
2754
- ...(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs)
2755
- }), {
2756
- trigger: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
2757
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", FormUnitvue_type_script_setup_true_lang_ts_name_formUnit_hoisted_3, [
2758
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(_component_el_icon, null, {
2759
- default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
2760
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE__element_sun_icons_vue__.Plus))
2761
- ]),
2762
- _: 1
2763
- })
2764
- ])
2765
- ]),
2766
- upload: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
2767
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(_component_el_button, {
2768
- type: "primary"
2769
- }, {
2770
- default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>_cache[0] || (_cache[0] = [
2771
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)("上传")
2772
- ])),
2773
- _: 1
2774
- })
2775
- ]),
2776
- tip: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>_cache[1] || (_cache[1] = [
2777
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", {
2778
- class: "el-upload__tip"
2779
- }, "只能上传jpg/png/svg文件,且不超过1000kb", -1)
2780
- ])),
2781
- _: 1
2782
- }, 16)) : ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveDynamicComponent)(`el-${(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component}`), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
2783
- key: 6,
2784
2720
  ref_key: "componentRef",
2785
2721
  ref: componentRef,
2786
2722
  clearable: ""
@@ -2983,7 +2919,10 @@ const COMPONENT_MAP = {
2983
2919
  [__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.CONTROL_TYPE_CODE.DATEPICKER]: 'date-picker',
2984
2920
  [__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.CONTROL_TYPE_CODE.GROUP]: 'group',
2985
2921
  [__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.CONTROL_TYPE_CODE.TEXTAREA]: 'textarea',
2986
- [__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.CONTROL_TYPE_CODE.TEXT]: 'text'
2922
+ [__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.CONTROL_TYPE_CODE.TEXT]: 'text',
2923
+ [__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.CONTROL_TYPE_CODE.SWITCH]: 'switch',
2924
+ [__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.CONTROL_TYPE_CODE.CHECKBOX]: 'checkbox',
2925
+ [__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.CONTROL_TYPE_CODE.DIVIDER]: 'divider'
2987
2926
  };
2988
2927
  const COMMA = ',';
2989
2928
  /**
@@ -3047,7 +2986,7 @@ function getExtraProps(item, dataValueNames, modelValue) {
3047
2986
  initObj.defaultValueName = findObj.defaultValueName;
3048
2987
  }
3049
2988
  }
3050
- const resultObj = {
2989
+ let resultObj = {
3051
2990
  style: {
3052
2991
  width: '100%'
3053
2992
  },
@@ -3065,6 +3004,12 @@ function getExtraProps(item, dataValueNames, modelValue) {
3065
3004
  resultObj.valueFormat = 'YYYY-MM-DD HH:mm:ss';
3066
3005
  resultObj.defaultValue = void 0;
3067
3006
  }
3007
+ if (item.controlTypeCode === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.CONTROL_TYPE_CODE.SWITCH) resultObj = {
3008
+ ...resultObj,
3009
+ 'inline-prompt': true,
3010
+ 'active-value': __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.YES,
3011
+ 'inactive-value': __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.NO
3012
+ };
3068
3013
  return resultObj;
3069
3014
  }
3070
3015
  function useGetFromConfigData(result, layoutTypeCode) {
@@ -35,6 +35,7 @@ export type HeaderRenderScope<T> = {
35
35
  [key: string]: any;
36
36
  };
37
37
  export interface ColumnProps<T = any> extends Partial<Omit<TableColumnCtx<T>, 'type' | 'children' | 'renderCell' | 'renderHeader'>> {
38
+ required?: boolean | undefined;
38
39
  columnClass?: string;
39
40
  isHidden?: boolean;
40
41
  supportTextCopy?: boolean | undefined;
package/dist/index.js CHANGED
@@ -174,13 +174,19 @@ const TableColumn = (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
174
174
  header: (scope)=>{
175
175
  if (column.headerRender) return column.headerRender(scope);
176
176
  if (column.prop && slots[`${handleProp(column.prop)}Header`]) return slots[`${handleProp(column.prop)}Header`](scope);
177
- return [
178
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)("span", {
179
- class: column.columnClass
177
+ return (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)("span", {
178
+ class: column.columnClass
179
+ }, [
180
+ column.required && (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)("span", {
181
+ class: "mr-2",
182
+ style: {
183
+ color: '#f56c6c'
184
+ }
180
185
  }, [
181
- column.label
182
- ], 2)
183
- ];
186
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)("*")
187
+ ]),
188
+ column.label
189
+ ], 2);
184
190
  },
185
191
  _: 1
186
192
  }, 16, [
@@ -2472,9 +2478,12 @@ const PatientInfo_exports_ = PatientInfovue_type_script_setup_true_lang_ts;
2472
2478
  const emit = __emit;
2473
2479
  const loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(true);
2474
2480
  const props = __props;
2475
- const tableData = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([]);
2476
- const rowKey = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)('id');
2477
- const rowName = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)('name');
2481
+ const tableData = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([
2482
+ {
2483
+ value: props.defaultValue,
2484
+ label: props.defaultValueName
2485
+ }
2486
+ ]);
2478
2487
  let inputChange = debounce(fetchData, 800);
2479
2488
  async function fetchData(value) {
2480
2489
  loading.value = true;
@@ -2488,28 +2497,17 @@ const PatientInfo_exports_ = PatientInfovue_type_script_setup_true_lang_ts;
2488
2497
  loading.value = false;
2489
2498
  if (result?.success) {
2490
2499
  let { primaryKey, displayKey, data } = result.data;
2491
- rowKey.value = primaryKey;
2492
- rowName.value = displayKey;
2493
- tableData.value = data.data || [];
2500
+ tableData.value = data.data.map((item)=>({
2501
+ value: item[primaryKey],
2502
+ label: item[displayKey]
2503
+ })) || [];
2494
2504
  }
2495
2505
  }
2496
- const options = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>{
2497
- if (!props.defaultValueName) return tableData.value;
2498
- let findObj = tableData.value.find((item)=>item[rowName.value] === props.defaultValueName);
2499
- if (!findObj) return [
2500
- ...tableData.value,
2501
- {
2502
- [rowKey.value]: props.defaultValue,
2503
- [rowName.value]: props.defaultValueName
2504
- }
2505
- ];
2506
- return tableData.value;
2507
- });
2508
2506
  /**
2509
- *
2510
- * @param value 下拉框选择
2511
- */ function change(value) {
2512
- let name = (options.value.find((item)=>item[rowKey.value] === value) || {})[rowName.value];
2507
+ *
2508
+ * @param value 下拉框选择
2509
+ */ function change(value) {
2510
+ let name = (tableData.value.find((item)=>item.value === value) || {})['label'];
2513
2511
  emit('change', value, name);
2514
2512
  }
2515
2513
  return (_ctx, _cache)=>{
@@ -2520,16 +2518,17 @@ const PatientInfo_exports_ = PatientInfovue_type_script_setup_true_lang_ts;
2520
2518
  loading: loading.value && !tableData.value.length,
2521
2519
  disabled: props.disabled,
2522
2520
  remote: true,
2521
+ filterable: true,
2523
2522
  onChange: change,
2524
2523
  "remote-method": (value)=>{
2525
2524
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(inputChange)(value);
2526
2525
  }
2527
2526
  }, {
2528
2527
  default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
2529
- ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(true), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderList)(options.value, (item)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(_component_el_option, {
2530
- key: item[rowKey.value],
2531
- label: item[rowName.value],
2532
- value: item[rowKey.value]
2528
+ ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(true), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderList)(tableData.value, (item)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(_component_el_option, {
2529
+ key: item.value,
2530
+ label: item.label,
2531
+ value: item.value
2533
2532
  }, null, 8, [
2534
2533
  "label",
2535
2534
  "value"
@@ -2548,7 +2547,7 @@ const PatientInfo_exports_ = PatientInfovue_type_script_setup_true_lang_ts;
2548
2547
  const dict_select_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(dict_selectvue_type_script_setup_true_lang_ts, [
2549
2548
  [
2550
2549
  '__scopeId',
2551
- "data-v-7fb4894b"
2550
+ "data-v-54541b2c"
2552
2551
  ]
2553
2552
  ]);
2554
2553
  /* ESM default export */ const dict_select = dict_select_exports_;
@@ -2964,38 +2963,11 @@ const FormUnitvue_type_script_setup_true_lang_ts_name_formUnit_hoisted_1 = {
2964
2963
  const FormUnitvue_type_script_setup_true_lang_ts_name_formUnit_hoisted_2 = {
2965
2964
  key: 1
2966
2965
  };
2967
- const FormUnitvue_type_script_setup_true_lang_ts_name_formUnit_hoisted_3 = {
2968
- class: "flex items-center justify-center border-2 p-12"
2969
- };
2970
2966
  const DICT_SELECT = 'dictSelect';
2971
- /**
2972
- * upload上传前操作
2973
- */ /* ESM default export */ const FormUnitvue_type_script_setup_true_lang_ts_name_formUnit = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
2967
+ /* ESM default export */ const FormUnitvue_type_script_setup_true_lang_ts_name_formUnit = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
2974
2968
  __name: 'FormUnit',
2975
2969
  setup (__props, { expose: __expose }) {
2976
2970
  const componentRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
2977
- const beforeUpload = (file)=>{
2978
- const isJsp = 'application/javascript' === file.type || file.name.endsWith('.jsp');
2979
- const isSvg = 'image/svg+xml' === file.type || file.name.endsWith('.svg');
2980
- const isPng = 'image/png' === file.type || file.name.endsWith('.png');
2981
- const isValidType = isJsp || isSvg || isPng;
2982
- const isValidSize = file.size / 1024 < 1000; // 转换为KB
2983
- if (!isValidType) __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error('只支持上传 .jsp、.svg 或 .png 文件!');
2984
- if (!isValidSize) __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error('文件大小不能超过 1000KB!');
2985
- return isValidType && isValidSize;
2986
- };
2987
- /**
2988
- * 选取文件
2989
- */ const handleChange = (file)=>{
2990
- const reader = new FileReader();
2991
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2992
- //@ts-expect-error
2993
- reader.readAsDataURL(file.raw);
2994
- reader.onload = ()=>{
2995
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2996
- attrs['onUpdate:modelValue'](reader.result);
2997
- };
2998
- };
2999
2971
  const attrs = (0, __WEBPACK_EXTERNAL_MODULE_vue__.useAttrs)();
3000
2972
  __expose(new Proxy({}, {
3001
2973
  get (_target, prop) {
@@ -3008,8 +2980,6 @@ const DICT_SELECT = 'dictSelect';
3008
2980
  }));
3009
2981
  return (_ctx, _cache)=>{
3010
2982
  const _component_el_option = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-option");
3011
- const _component_el_icon = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-icon");
3012
- const _component_el_button = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-button");
3013
2983
  return 'select' === (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveDynamicComponent)(`el-${(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component}`), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
3014
2984
  key: 0,
3015
2985
  filterable: !!(__WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.filterable || __WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.options?.length && __WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.options?.length > 5) || false
@@ -3050,42 +3020,8 @@ const DICT_SELECT = 'dictSelect';
3050
3020
  clearable: ""
3051
3021
  }, {
3052
3022
  ...(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs)
3053
- }), null, 16)) : 'upload' === (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveDynamicComponent)(`el-${(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component}`), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
3023
+ }), null, 16)) : ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveDynamicComponent)(`el-${(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component}`), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
3054
3024
  key: 5,
3055
- "before-upload": beforeUpload,
3056
- "on-change": handleChange,
3057
- "auto-upload": false
3058
- }, {
3059
- ...(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs)
3060
- }), {
3061
- trigger: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
3062
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", FormUnitvue_type_script_setup_true_lang_ts_name_formUnit_hoisted_3, [
3063
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(_component_el_icon, null, {
3064
- default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
3065
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE__element_sun_icons_vue__.Plus))
3066
- ]),
3067
- _: 1
3068
- })
3069
- ])
3070
- ]),
3071
- upload: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
3072
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(_component_el_button, {
3073
- type: "primary"
3074
- }, {
3075
- default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>_cache[0] || (_cache[0] = [
3076
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)("上传")
3077
- ])),
3078
- _: 1
3079
- })
3080
- ]),
3081
- tip: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>_cache[1] || (_cache[1] = [
3082
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", {
3083
- class: "el-upload__tip"
3084
- }, "只能上传jpg/png/svg文件,且不超过1000kb", -1)
3085
- ])),
3086
- _: 1
3087
- }, 16)) : ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveDynamicComponent)(`el-${(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component}`), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
3088
- key: 6,
3089
3025
  ref_key: "componentRef",
3090
3026
  ref: componentRef,
3091
3027
  clearable: ""
@@ -3288,7 +3224,10 @@ const COMPONENT_MAP = {
3288
3224
  [__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.CONTROL_TYPE_CODE.DATEPICKER]: 'date-picker',
3289
3225
  [__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.CONTROL_TYPE_CODE.GROUP]: 'group',
3290
3226
  [__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.CONTROL_TYPE_CODE.TEXTAREA]: 'textarea',
3291
- [__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.CONTROL_TYPE_CODE.TEXT]: 'text'
3227
+ [__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.CONTROL_TYPE_CODE.TEXT]: 'text',
3228
+ [__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.CONTROL_TYPE_CODE.SWITCH]: 'switch',
3229
+ [__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.CONTROL_TYPE_CODE.CHECKBOX]: 'checkbox',
3230
+ [__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.CONTROL_TYPE_CODE.DIVIDER]: 'divider'
3292
3231
  };
3293
3232
  const COMMA = ',';
3294
3233
  /**
@@ -3352,7 +3291,7 @@ function getExtraProps(item, dataValueNames, modelValue) {
3352
3291
  initObj.defaultValueName = findObj.defaultValueName;
3353
3292
  }
3354
3293
  }
3355
- const resultObj = {
3294
+ let resultObj = {
3356
3295
  style: {
3357
3296
  width: '100%'
3358
3297
  },
@@ -3370,6 +3309,12 @@ function getExtraProps(item, dataValueNames, modelValue) {
3370
3309
  resultObj.valueFormat = 'YYYY-MM-DD HH:mm:ss';
3371
3310
  resultObj.defaultValue = void 0;
3372
3311
  }
3312
+ if (item.controlTypeCode === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.CONTROL_TYPE_CODE.SWITCH) resultObj = {
3313
+ ...resultObj,
3314
+ 'inline-prompt': true,
3315
+ 'active-value': __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.YES,
3316
+ 'inactive-value': __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.NO
3317
+ };
3373
3318
  return resultObj;
3374
3319
  }
3375
3320
  function useGetFromConfigData(result, layoutTypeCode) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sun-biz",
3
- "version": "0.0.2-beta.2",
3
+ "version": "0.0.2-beta.3",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {