@skyfox2000/webui 1.4.14 → 1.4.16

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.
Files changed (30) hide show
  1. package/lib/assets/modules/{baseLayout-BtJNPMBy.js → baseLayout-DQQ-vZCD.js} +3 -3
  2. package/lib/assets/modules/{file-upload-CYNi1NsW.js → file-upload-Dc61Tbof.js} +1 -1
  3. package/lib/assets/modules/{index-BOOirPG2.js → index-CX7vtghj.js} +1 -1
  4. package/lib/assets/modules/{index-DWnhNqJu.js → index-DrGkF0qX.js} +2 -2
  5. package/lib/assets/modules/{index-Cj6QnoC7.js → index-Dz624mC-.js} +2 -2
  6. package/lib/assets/modules/{menuTabs-DDGkYuvg.js → menuTabs-BwAVx2tx.js} +2 -2
  7. package/lib/assets/modules/{toolIcon-DXQt60Ya.js → toolIcon-B2btIpdL.js} +1 -1
  8. package/lib/assets/modules/{upload-template-CaeUt6VI.js → upload-template-BqG06zPn.js} +318 -310
  9. package/lib/assets/modules/{uploadList-D0jw6jNr.js → uploadList-DlbvQOtR.js} +4 -4
  10. package/lib/components/content/search/index.vue.d.ts +5 -3
  11. package/lib/es/AceEditor/index.js +3 -3
  12. package/lib/es/BasicLayout/index.js +2 -2
  13. package/lib/es/Error403/index.js +1 -1
  14. package/lib/es/Error404/index.js +1 -1
  15. package/lib/es/ExcelForm/index.js +5 -5
  16. package/lib/es/MenuLayout/index.js +2 -2
  17. package/lib/es/TemplateFile/index.js +4 -4
  18. package/lib/es/UploadForm/index.js +4 -4
  19. package/lib/webui.css +1 -1
  20. package/lib/webui.es.js +693 -683
  21. package/package.json +1 -1
  22. package/src/components/content/search/index.vue +30 -24
  23. package/src/components/content/table/index.vue +1 -1
  24. package/src/components/form/autoComplete/index.vue +5 -1
  25. package/src/components/form/cascader/index.vue +8 -10
  26. package/src/components/form/checkbox/index.vue +8 -11
  27. package/src/components/form/radio/index.vue +9 -14
  28. package/src/components/form/select/index.vue +4 -1
  29. package/src/components/form/treeSelect/index.vue +5 -1
  30. package/src/utils/export-table.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyfox2000/webui",
3
- "version": "1.4.14",
3
+ "version": "1.4.16",
4
4
  "description": "后台前端通用组件定义",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -28,7 +28,7 @@ const props = defineProps<{
28
28
  /**
29
29
  * 表格控制对象
30
30
  */
31
- gridCtrl: GridControl<AnyData>;
31
+ gridCtrl?: GridControl<AnyData>;
32
32
  /**
33
33
  * 模糊查询字段
34
34
  */
@@ -39,7 +39,8 @@ const props = defineProps<{
39
39
 
40
40
  const emits = defineEmits<{
41
41
  (e: 'update:search', val: Record<string, any>): void;
42
- (e: 'reset'): void;
42
+ (e: 'onsearch', val: Record<string, any>): void;
43
+ (e: 'onreset'): void;
43
44
  }>();
44
45
 
45
46
  /**
@@ -60,13 +61,13 @@ const updateHolderSize = () => {
60
61
  defaultSlots.value = 0;
61
62
  controlSlots.value = 0;
62
63
  if (slots.default) defaultSlots.value = getSlotLen(slots.default({}));
63
- if (props.gridCtrl.searchBar && slots.control) controlSlots.value = getSlotLen(slots.control({}));
64
+ if (props.gridCtrl && props.gridCtrl.searchBar && slots.control) controlSlots.value = getSlotLen(slots.control({}));
64
65
 
65
66
  holderSize.value = 2 - ((defaultSlots.value + controlSlots.value) % 3);
66
67
  };
67
68
 
68
69
  watch(
69
- () => props.gridCtrl.searchBar,
70
+ () => props.gridCtrl?.searchBar,
70
71
  () => {
71
72
  updateHolderSize();
72
73
  },
@@ -77,13 +78,15 @@ const defaultData: Record<string, any> = JSON.parse(JSON.stringify(props.search)
77
78
  onMounted(() => {
78
79
  updateHolderSize();
79
80
  let search = { ...props.search };
80
- props.gridCtrl.gridQuery = {
81
- ...props.gridCtrl.gridQuery,
82
- Query: {
83
- ...props.gridCtrl.gridQuery?.Query,
84
- ...search,
85
- },
86
- };
81
+ if (props.gridCtrl) {
82
+ props.gridCtrl.gridQuery = {
83
+ ...props.gridCtrl.gridQuery,
84
+ Query: {
85
+ ...props.gridCtrl.gridQuery?.Query,
86
+ ...search,
87
+ },
88
+ };
89
+ }
87
90
  });
88
91
 
89
92
  const onSearch = () => {
@@ -96,18 +99,21 @@ const onSearch = () => {
96
99
  }
97
100
  }
98
101
 
99
- props.gridCtrl.gridQuery = {
100
- ...props.gridCtrl.gridQuery,
101
- Query: {
102
- ...props.gridCtrl.gridQuery?.Query,
103
- ...search,
104
- },
105
- };
102
+ if (props.gridCtrl) {
103
+ props.gridCtrl.gridQuery = {
104
+ ...props.gridCtrl.gridQuery,
105
+ Query: {
106
+ ...props.gridCtrl.gridQuery?.Query,
107
+ ...search,
108
+ },
109
+ };
106
110
 
107
- // 包含分页,需要重新设置
108
- props.gridCtrl.pageNo.value = 1;
111
+ // 包含分页,需要重新设置
112
+ props.gridCtrl.pageNo.value = 1;
109
113
 
110
- props.gridCtrl.reload.value = true;
114
+ props.gridCtrl.reload.value = true;
115
+ }
116
+ emits('onsearch', search);
111
117
  };
112
118
 
113
119
  const onReset = () => {
@@ -119,7 +125,7 @@ const onReset = () => {
119
125
  }
120
126
  emits('update:search', data);
121
127
 
122
- emits('reset');
128
+ emits('onreset');
123
129
  };
124
130
  </script>
125
131
  <template>
@@ -130,11 +136,11 @@ const onReset = () => {
130
136
  <!-- 默认插槽 -->
131
137
  <slot></slot>
132
138
  <!-- 受控插槽 -->
133
- <slot name="control" v-if="gridCtrl.searchBar"></slot>
139
+ <slot name="control" v-if="gridCtrl?.searchBar"></slot>
134
140
  <!-- 表单操作按钮 占位数量 -->
135
141
  <SearchItem class="w-1/3" v-if="holderSize >= 1"> </SearchItem>
136
142
  <SearchItem class="w-1/3" v-if="holderSize >= 2"> </SearchItem>
137
- <SearchItem v-if="defaultSlots || gridCtrl.searchBar" class="w-1/3 flex justify-end text-right pr-5"
143
+ <SearchItem v-if="defaultSlots || gridCtrl?.searchBar" class="w-1/3 flex justify-end text-right pr-5"
138
144
  :wrapper-col="{ flex: 'auto' }">
139
145
  <Space>
140
146
  <Button type="primary" @click="onSearch" icon="icon-search">搜索</Button>
@@ -167,7 +167,7 @@ watch(
167
167
 
168
168
  const visible = ref(false);
169
169
  onActivated(() => {
170
- if (visible.value && gridCtrl) gridCtrl.reload.value = true;
170
+ if (visible.value && gridCtrl && gridCtrl.autoload) gridCtrl.reload.value = true;
171
171
  });
172
172
 
173
173
  onMounted(async () => {
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { ref, onUnmounted, useAttrs, watch, shallowRef, PropType } from 'vue';
2
+ import { ref, onUnmounted, useAttrs, watch, shallowRef, PropType, onActivated } from 'vue';
3
3
  import { AutoComplete, Input } from 'ant-design-vue';
4
4
  import {
5
5
  useInputFactory,
@@ -130,6 +130,10 @@ const onSelected = (value: any) => {
130
130
  }
131
131
  };
132
132
 
133
+ onActivated(() => {
134
+ if (optionCtrl && optionCtrl.autoload) optionCtrl.reload.value = true;
135
+ });
136
+
133
137
  onUnmounted(() => {
134
138
  if (optionCtrl) unloadOption(optionCtrl, props);
135
139
  });
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { ref, onMounted, onUnmounted, useAttrs, watch, shallowRef } from 'vue';
2
+ import { ref, onMounted, onUnmounted, useAttrs, watch, shallowRef, onActivated } from 'vue';
3
3
  import {
4
4
  circleLoading,
5
5
  useInputFactory,
@@ -79,13 +79,17 @@ const onChanged = (_: ValueType, selected: DefaultOptionType[]) => {
79
79
  const labels: string[] = getSelectedLabels(selectedOptions);
80
80
 
81
81
  emit('update:labels', labels);
82
- emit('update:value', values);
82
+ emit('update:value', values);
83
83
  if (errInfo?.value.errClass && editorCtrl) {
84
84
  /// 重新开始验证
85
85
  formValidate(editorCtrl);
86
86
  }
87
87
  };
88
88
 
89
+ onActivated(() => {
90
+ if (optionCtrl && optionCtrl.autoload) optionCtrl.reload.value = true;
91
+ });
92
+
89
93
  onMounted(() => {
90
94
  if (url.value && !url.value.fieldMap) {
91
95
  url.value.fieldMap = {
@@ -108,14 +112,8 @@ onUnmounted(() => {
108
112
  <circleLoading class="text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" />
109
113
  <span>数据加载中...</span>
110
114
  </div>
111
- <Cascader
112
- :options="selectOptions"
113
- :class="[errInfo?.errClass]"
114
- :allow-clear="true"
115
- :placeholder="selectOptions.length > 0 ? '请选择' + labelText : ''"
116
- @change="onChanged"
117
- v-bind="attrs"
118
- />
115
+ <Cascader :options="selectOptions" :class="[errInfo?.errClass]" :allow-clear="true"
116
+ :placeholder="selectOptions.length > 0 ? '请选择' + labelText : ''" @change="onChanged" v-bind="attrs" />
119
117
  </div>
120
118
  </template>
121
119
 
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { ref, onMounted, onUnmounted, useAttrs, watch, shallowRef } from 'vue';
2
+ import { ref, onMounted, onUnmounted, useAttrs, watch, shallowRef, onActivated } from 'vue';
3
3
  import { Checkbox, CheckboxGroup } from 'ant-design-vue';
4
4
  import {
5
5
  // circleLoading,
@@ -75,6 +75,10 @@ const onChanged = (e: CheckboxValueType[]) => {
75
75
  emit('update:labels', labels);
76
76
  };
77
77
 
78
+ onActivated(() => {
79
+ if (optionCtrl && optionCtrl.autoload) optionCtrl.reload.value = true;
80
+ });
81
+
78
82
  onMounted(() => {
79
83
  if (url.value && !url.value.fieldMap) {
80
84
  url.value.fieldMap = {
@@ -99,20 +103,13 @@ onUnmounted(() => {
99
103
  </div> -->
100
104
  <CheckboxGroup @change="onChanged" class="w-full mb-[-3px]" v-bind="attrs">
101
105
  <template v-if="checkboxOptions.length > 0">
102
- <Checkbox
103
- v-for="item in checkboxOptions"
104
- :key="item.value"
105
- :value="item.value"
106
- :disabled="
107
- item.disabled || (item.value && disabledItems && disabledItems.indexOf(item.value.toString()) > -1)
108
- "
109
- :class="[
106
+ <Checkbox v-for="item in checkboxOptions" :key="item.value" :value="item.value" :disabled="item.disabled || (item.value && disabledItems && disabledItems.indexOf(item.value.toString()) > -1)
107
+ " :class="[
110
108
  errInfo?.errClass === 'error' ? 'error !text-red-400' : '',
111
109
  'text-nowrap',
112
110
  'pb-1',
113
111
  wrap ? `w-1/${props.wrap}` : '',
114
- ]"
115
- >
112
+ ]">
116
113
  {{ item.label }}
117
114
  </Checkbox>
118
115
  </template>
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { ref, onMounted, onUnmounted, watch, useAttrs, shallowRef } from 'vue';
2
+ import { ref, onMounted, onUnmounted, watch, useAttrs, shallowRef, onActivated } from 'vue';
3
3
  import { Radio, RadioChangeEvent, RadioGroup } from 'ant-design-vue';
4
4
  import {
5
5
  OptionCommProps,
@@ -102,6 +102,10 @@ const onChanged = (e: RadioChangeEvent) => {
102
102
  emit('update:labels', labels);
103
103
  };
104
104
 
105
+ onActivated(() => {
106
+ if (optionCtrl && optionCtrl.autoload) optionCtrl.reload.value = true;
107
+ });
108
+
105
109
  onMounted(() => {
106
110
  if (url.value && !url.value.fieldMap) {
107
111
  url.value.fieldMap = {
@@ -118,26 +122,17 @@ onUnmounted(() => {
118
122
  </script>
119
123
  <template>
120
124
  <div class="min-h-[32px] pt-1">
121
- <RadioGroup
122
- v-model:value="innerValue"
123
- :autocheck="false"
124
- @change="onChanged"
125
- class="w-full flex align-items flex-wrap mb-[-3px]"
126
- v-bind="attrs"
127
- >
125
+ <RadioGroup v-model:value="innerValue" :autocheck="false" @change="onChanged"
126
+ class="w-full flex align-items flex-wrap mb-[-3px]" v-bind="attrs">
128
127
  <template v-if="radioOptions.length > 0">
129
128
  <template v-for="item in radioOptions" :key="item.value">
130
- <Radio
131
- :checked="isValueEqual(item.value, props.value)"
132
- v-if="item.visible !== false"
133
- :value="item.value"
129
+ <Radio :checked="isValueEqual(item.value, props.value)" v-if="item.visible !== false" :value="item.value"
134
130
  :class="[
135
131
  errInfo?.errClass === 'error' ? 'error !text-red-400' : '',
136
132
  'text-nowrap',
137
133
  'pb-1',
138
134
  wrap ? `w-1/${props.wrap}` : '',
139
- ]"
140
- >
135
+ ]">
141
136
  {{ item.label }}
142
137
  </Radio>
143
138
  </template>
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { ref, onMounted, onUnmounted, watch, PropType, useAttrs, shallowRef } from 'vue';
2
+ import { ref, onMounted, onUnmounted, watch, PropType, useAttrs, shallowRef, onActivated } from 'vue';
3
3
  import { Select, SelectOption } from 'ant-design-vue';
4
4
  import {
5
5
  circleLoading,
@@ -172,6 +172,9 @@ watch(
172
172
  },
173
173
  );
174
174
 
175
+ onActivated(() => {
176
+ if (optionCtrl && optionCtrl.autoload) optionCtrl.reload.value = true;
177
+ });
175
178
 
176
179
  onMounted(() => {
177
180
  if (url.value && !url.value.fieldMap) {
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { ref, watch, onMounted, PropType } from 'vue';
2
+ import { ref, watch, onMounted, PropType, onActivated } from 'vue';
3
3
  import { TreeSelect } from 'ant-design-vue';
4
4
  import type { SelectValue, TreeControl, TreeNode } from '@/index';
5
5
  import { queryTree, useInputFactory } from '@/index';
@@ -87,6 +87,10 @@ const handleChange = (value: SelectValue) => {
87
87
  emit('change', currentValue.value);
88
88
  };
89
89
 
90
+ onActivated(() => {
91
+ if (props.treeCtrl && props.treeCtrl.autoload) props.treeCtrl.reload.value = true;
92
+ });
93
+
90
94
  // 组件挂载时加载数据
91
95
  onMounted(() => {
92
96
  if (!treeCtrl.fieldMap) {
@@ -81,9 +81,9 @@ const formatFileName = (fileName: string) => {
81
81
  return dayjs().format(formatStr);
82
82
  });
83
83
  };
84
+
84
85
  // 下载当前条件全部数据
85
86
  // 表头相同
86
-
87
87
  export const exportResults = async <T extends Record<string, any>>(
88
88
  fileName: string,
89
89
  columns: TableColumn[],