@skyfox2000/webui 1.3.13 → 1.3.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyfox2000/webui",
3
- "version": "1.3.13",
3
+ "version": "1.3.15",
4
4
  "description": "后台前端通用组件定义",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -66,4 +66,4 @@
66
66
  "vite-plugin-dts": "^4.5.4",
67
67
  "vue-tsc": "^2.2.0"
68
68
  }
69
- }
69
+ }
@@ -39,6 +39,7 @@ 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
43
  }>();
43
44
 
44
45
  /**
@@ -117,19 +118,15 @@ const onReset = () => {
117
118
  }
118
119
  }
119
120
  emits('update:search', data);
121
+
122
+ emits('reset');
120
123
  };
121
124
  </script>
122
125
  <template>
123
- <Form
124
- v-if="defaultSlots + controlSlots > 0"
125
- :label-col="{ flex: '60px' }"
126
- :style="{
127
- flexWrap: 'wrap',
128
- borderBottom: '1px solid #e9e9e9',
129
- }"
130
- class="flex mb-[10px]"
131
- v-submit="onSearch"
132
- >
126
+ <Form v-if="defaultSlots + controlSlots > 0" :label-col="{ flex: '60px' }" :style="{
127
+ flexWrap: 'wrap',
128
+ borderBottom: '1px solid #e9e9e9',
129
+ }" class="flex mb-[10px]" v-submit="onSearch">
133
130
  <!-- 默认插槽 -->
134
131
  <slot></slot>
135
132
  <!-- 受控插槽 -->
@@ -137,11 +134,8 @@ const onReset = () => {
137
134
  <!-- 表单操作按钮 占位数量 -->
138
135
  <SearchItem class="w-1/3" v-if="holderSize >= 1"> </SearchItem>
139
136
  <SearchItem class="w-1/3" v-if="holderSize >= 2"> </SearchItem>
140
- <SearchItem
141
- v-if="defaultSlots || gridCtrl.searchBar"
142
- class="w-1/3 flex justify-end text-right pr-5"
143
- :wrapper-col="{ flex: 'auto' }"
144
- >
137
+ <SearchItem v-if="defaultSlots || gridCtrl.searchBar" class="w-1/3 flex justify-end text-right pr-5"
138
+ :wrapper-col="{ flex: 'auto' }">
145
139
  <Space>
146
140
  <Button type="primary" @click="onSearch" icon="icon-search">搜索</Button>
147
141
  <Button @click="onReset" icon="icon-reset">重置</Button>
@@ -43,6 +43,9 @@ export { Switch };
43
43
  import Textarea from './textarea/index.vue';
44
44
  export { Textarea };
45
45
 
46
+ import TimePicker from './timePicker/index.vue';
47
+ export { TimePicker };
48
+
46
49
  import Transfer from './transfer/index.vue';
47
50
  export { Transfer };
48
51
  import TransferTable from './transfer/transferTable.vue';
@@ -0,0 +1,24 @@
1
+ <script setup lang="ts">
2
+ import { ref } from 'vue';
3
+ import { TimePicker } from 'ant-design-vue';
4
+ import locale from 'ant-design-vue/es/date-picker/locale/zh_CN';
5
+ import { formValidate, useInputFactory } from '@/index';
6
+ const props = defineProps<{
7
+ valueFormat?: string;
8
+ }>();
9
+
10
+ const { editorCtrl, labelText, errInfo } = useInputFactory();
11
+ const onBlur = () => {
12
+ if (errInfo?.value.errClass && editorCtrl) {
13
+ /// 重新开始验证
14
+ formValidate(editorCtrl);
15
+ }
16
+ };
17
+
18
+ const timeFormat = ref<string>(props.valueFormat ?? 'HH:mm');
19
+ </script>
20
+ <template>
21
+ <TimePicker class="w-full"
22
+ :class="[errInfo?.errClass === 'error' ? 'error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]' : '']"
23
+ :placeholder="'请选择' + labelText" :locale="locale" :valueFormat="timeFormat" @blur="onBlur" />
24
+ </template>
@@ -46,6 +46,7 @@ export {
46
46
  Select,
47
47
  Switch,
48
48
  Textarea,
49
+ TimePicker,
49
50
  Transfer,
50
51
  TransferTable,
51
52
  TreeSelect,
package/src/index.ts CHANGED
@@ -266,6 +266,7 @@ export {
266
266
  Select,
267
267
  Switch,
268
268
  Textarea,
269
+ TimePicker,
269
270
  Transfer,
270
271
  TransferTable,
271
272
  TreeSelect,
package/src/utils/page.ts CHANGED
@@ -90,7 +90,7 @@ const initUrls = (apiUrls: ApiUrls) => {
90
90
  if (!apiUrls.urls[urlKey]!.api) {
91
91
  apiUrls.urls[urlKey]!.api = apiUrls.api;
92
92
  }
93
- if (!apiUrls.urls[urlKey]!.authorize) {
93
+ if (apiUrls.urls[urlKey]!.authorize === undefined) {
94
94
  apiUrls.urls[urlKey]!.authorize = apiUrls.authorize;
95
95
  }
96
96
  }