@kengic/uni 0.6.3-beta.0 → 0.6.3-beta.2

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 (36) hide show
  1. package/dist/api/WMS/Controllers/CommonController/GetLatestApkVersion.ts +21 -28
  2. package/dist/api/WMS/Controllers/CommonController/index.ts +1 -1
  3. package/dist/api/WMS/Controllers/LoginController/GetUserInfo.ts +21 -0
  4. package/dist/api/WMS/Controllers/LoginController/Logout.ts +21 -28
  5. package/dist/api/WMS/Controllers/LoginController/index.ts +2 -1
  6. package/dist/api/WMS/Controllers/WhController/ListVO.ts +88 -92
  7. package/dist/api/WMS/Controllers/WhController/index.ts +1 -1
  8. package/dist/api/WMS/Controllers/WorkstationController/List.ts +45 -0
  9. package/dist/api/WMS/Controllers/WorkstationController/index.ts +1 -0
  10. package/dist/api/WMS/Controllers/index.ts +4 -3
  11. package/dist/api/WMS/index.ts +2 -2
  12. package/dist/api/WMS/models.ts +318 -192
  13. package/dist/api/api.ts +1 -1
  14. package/dist/api/def.ts +1 -1
  15. package/dist/api/index.ts +2 -2
  16. package/dist/component/KgStation/KgStation.vue +176 -0
  17. package/dist/component/KgStation/index.hooks.ts +62 -0
  18. package/dist/component/KgStation/index.store.ts +76 -0
  19. package/dist/component/KgStation/index.ts +4 -0
  20. package/dist/component/KgTabBar/KgTabBar.vue +2 -2
  21. package/dist/component/KgWarehouse/KgWarehouse.vue +47 -30
  22. package/dist/component/KgWarehouse/index.hooks.ts +24 -1
  23. package/dist/component/KgWarehouse/index.store.ts +8 -8
  24. package/dist/component/index.ts +1 -0
  25. package/dist/index.css +5 -0
  26. package/dist/service/http-client.ts +9 -2
  27. package/dist/store/app.store.ts +68 -49
  28. package/dist/uni/uni-ui/uni-data-select/uni-data-select.vue +18 -13
  29. package/dist/uni/uni-ui/uni-icons/uniicons_file.ts +646 -646
  30. package/dist/uni/uni-ui/uni-icons/uniicons_file_vue.js +646 -646
  31. package/dist/uni/uni-ui/uni-list-item/uni-list-item.vue +507 -503
  32. package/dist/uni/uni-ui/uni-popup-dialog/keypress.js +42 -42
  33. package/dist/uni/uni-ui/uni-popup-dialog/uni-popup-dialog.vue +12 -7
  34. package/dist/uni/uni-ui/uni-rate/uni-rate.vue +1 -2
  35. package/dist/util/kg.ts +33 -7
  36. package/package.json +2 -2
@@ -1,45 +1,45 @@
1
1
  // #ifdef H5
2
2
  export default {
3
- name: 'Keypress',
4
- props: {
5
- disable: {
6
- type: Boolean,
7
- default: false
8
- }
9
- },
10
- mounted () {
11
- const keyNames = {
12
- esc: ['Esc', 'Escape'],
13
- tab: 'Tab',
14
- enter: 'Enter',
15
- space: [' ', 'Spacebar'],
16
- up: ['Up', 'ArrowUp'],
17
- left: ['Left', 'ArrowLeft'],
18
- right: ['Right', 'ArrowRight'],
19
- down: ['Down', 'ArrowDown'],
20
- delete: ['Backspace', 'Delete', 'Del']
21
- }
22
- const listener = ($event) => {
23
- if (this.disable) {
24
- return
25
- }
26
- const keyName = Object.keys(keyNames).find(key => {
27
- const keyName = $event.key
28
- const value = keyNames[key]
29
- return value === keyName || (Array.isArray(value) && value.includes(keyName))
30
- })
31
- if (keyName) {
32
- // 避免和其他按键事件冲突
33
- setTimeout(() => {
34
- this.$emit(keyName, {})
35
- }, 0)
36
- }
37
- }
38
- document.addEventListener('keyup', listener)
39
- this.$once('hook:beforeDestroy', () => {
40
- document.removeEventListener('keyup', listener)
41
- })
42
- },
43
- render: () => {}
44
- }
3
+ name: 'Keypress',
4
+ props: {
5
+ disable: {
6
+ type: Boolean,
7
+ default: false,
8
+ },
9
+ },
10
+ mounted() {
11
+ const keyNames = {
12
+ esc: ['Esc', 'Escape'],
13
+ tab: 'Tab',
14
+ enter: 'Enter',
15
+ space: [' ', 'Spacebar'],
16
+ up: ['Up', 'ArrowUp'],
17
+ left: ['Left', 'ArrowLeft'],
18
+ right: ['Right', 'ArrowRight'],
19
+ down: ['Down', 'ArrowDown'],
20
+ delete: ['Backspace', 'Delete', 'Del'],
21
+ };
22
+ const listener = ($event) => {
23
+ if (this.disable) {
24
+ return;
25
+ }
26
+ const keyName = Object.keys(keyNames).find((key) => {
27
+ const keyName = $event.key;
28
+ const value = keyNames[key];
29
+ return value === keyName || (Array.isArray(value) && value.includes(keyName));
30
+ });
31
+ if (keyName) {
32
+ // 避免和其他按键事件冲突
33
+ setTimeout(() => {
34
+ this.$emit(keyName, {});
35
+ }, 0);
36
+ }
37
+ };
38
+ document.addEventListener('keyup', listener);
39
+ this.$once('hook:beforeDestroy', () => {
40
+ document.removeEventListener('keyup', listener);
41
+ });
42
+ },
43
+ render: () => {},
44
+ };
45
45
  // #endif
@@ -28,6 +28,7 @@
28
28
  import popup from '../uni-popup/popup.js';
29
29
  import { initVueI18n } from '@dcloudio/uni-i18n';
30
30
  import messages from '../uni-popup/i18n';
31
+
31
32
  const { t } = initVueI18n(messages);
32
33
  /**
33
34
  * PopUp 弹出层-对话框样式
@@ -37,12 +38,12 @@
37
38
  * @property {String} placeholder input 模式下输入提示
38
39
  * @property {String} type = [success|warning|info|error] 主题样式
39
40
  * @value success 成功
40
- * @value warning 提示
41
- * @value info 消息
42
- * @value error 错误
41
+ * @value warning 提示
42
+ * @value info 消息
43
+ * @value error 错误
43
44
  * @property {String} mode = [base|input] 模式、
44
- * @value base 基础对话框
45
- * @value input 可输入对话框
45
+ * @value base 基础对话框
46
+ * @value input 可输入对话框
46
47
  * @property {String} content 对话框内容
47
48
  * @property {Boolean} beforeClose 是否拦截取消事件
48
49
  * @event {Function} confirm 点击确认按钮触发
@@ -174,7 +175,7 @@
174
175
  <style lang="scss">
175
176
  .uni-popup-dialog {
176
177
  width: 300px;
177
- border-radius: 11px;
178
+ border-radius: 4px;
178
179
  background-color: #fff;
179
180
  }
180
181
 
@@ -185,6 +186,10 @@
185
186
  flex-direction: row;
186
187
  justify-content: center;
187
188
  padding-top: 25px;
189
+ border-bottom: 1px solid #e5e5e5;
190
+ height: 40px;
191
+ line-height: 40px;
192
+ padding: 0;
188
193
  }
189
194
 
190
195
  .uni-dialog-title-text {
@@ -199,7 +204,7 @@
199
204
  flex-direction: row;
200
205
  justify-content: center;
201
206
  align-items: center;
202
- padding: 20px;
207
+ padding: 6px;
203
208
  }
204
209
 
205
210
  .uni-dialog-content-text {
@@ -217,7 +217,6 @@
217
217
  if (!this.IsPC()) return
218
218
  if (this.userRated) return
219
219
  if (this.userMouseFristMove) {
220
- console.log('---mousemove----', this.valueSync);
221
220
  this.userLastRate = this.valueSync
222
221
  this.userMouseFristMove = false
223
222
  }
@@ -281,7 +280,7 @@
281
280
  } else {
282
281
  value = index + 1
283
282
  }
284
-
283
+
285
284
  value = Math.max(0.5, Math.min(value, _this.max))
286
285
  _this.valueSync = value
287
286
  _this._onChange()
package/dist/util/kg.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { cloneDeep, isArray, isNil, isObjectLike, reduce } from 'lodash-es';
2
2
  import { toRaw, unref } from 'vue';
3
3
  import { API } from '../api';
4
- import { useKgWarehouse } from '../component';
4
+ import { useKgStation, useKgWarehouse } from '../component';
5
5
  import { useAppStore } from '../store/app.store';
6
6
  import { KG_DYNAMIC_QUERY_OPERATOR } from '../const';
7
7
 
@@ -10,9 +10,31 @@ import { KG_DYNAMIC_QUERY_OPERATOR } from '../const';
10
10
  */
11
11
  export class Kg {
12
12
  /**
13
- * 处理请求参数.
14
- * 1. 填充通用参数的值
15
- * a. 仓库: '{WAREHOUSE}'
13
+ * 判断当前登录用户是否是管理员.
14
+ * @return {} 如果当前登录用户是管理员则返回 true, 否则返回 false.
15
+ */
16
+ public static isAdminUser(): boolean {
17
+ const appStore = useAppStore();
18
+
19
+ if (appStore.getUser?.username === 'admin') {
20
+ return true;
21
+ }
22
+
23
+ return false;
24
+ }
25
+
26
+ /**
27
+ * <p>处理请求参数.</p>
28
+ * <ol>
29
+ * <li>填充通用参数的值:
30
+ * <ul>
31
+ * <li>{WAREHOUSE}: 当前仓库编号</li>
32
+ * <li>{WORK_STATION}: 当前工作站</li>
33
+ * <li>{WORK_AREA}: 当前工作区</li>
34
+ * </ul>
35
+ * </li>
36
+ * </ol>
37
+ *
16
38
  * @param params 请求参数.
17
39
  */
18
40
  public static parseParams(params?: Record<string, any> | null): any {
@@ -144,12 +166,16 @@ export class Kg {
144
166
  // 若参数值包含变量, 填充这些变量
145
167
  if (result) {
146
168
  const placeholder = result[2];
147
- // 去掉首尾的 {}
148
- const key = result[2].slice(1, -1);
149
169
 
150
170
  switch (placeholder) {
151
171
  case '{WAREHOUSE}':
152
- return value.replace('{WAREHOUSE}', useKgWarehouse().warehouse.value?.whId ?? '');
172
+ return value.replace(placeholder, useKgWarehouse().warehouse.value?.whId ?? '');
173
+
174
+ case '{WORK_STATION}':
175
+ return value.replace(placeholder, useKgStation().station.value?.devcod ?? '');
176
+
177
+ case '{WORK_AREA}':
178
+ return value.replace(placeholder, useKgStation().station.value?.hmewrkare ?? '');
153
179
 
154
180
  default:
155
181
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/uni",
3
- "version": "0.6.3-beta.0",
3
+ "version": "0.6.3-beta.2",
4
4
  "scripts": {
5
5
  "build": "npm run switch-node-version && rimraf dist && vue-tsc && vite build",
6
6
  "------ -------------------------------------------": "",
@@ -32,7 +32,7 @@
32
32
  "dependencies": {
33
33
  "@dcloudio/types": "~3.3.3",
34
34
  "@dcloudio/uni-app": "3.0.0-alpha-3080220230428001",
35
- "@kengic/pont": "1.2.14",
35
+ "@kengic/pont": "1.2.15-beta.0",
36
36
  "@types/lodash-es": "4.17.7",
37
37
  "@types/node": "18.16.3",
38
38
  "@types/semver": "7.3.13",