@skyfox2000/webui 1.3.13 → 1.3.14

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.14",
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
+ }
@@ -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
  }