@kengic/uni 0.6.3-beta.3 → 0.6.3-beta.30
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/dist/api/WMS/Controllers/CommonController/GetLatestApkVersion.ts +21 -21
- package/dist/api/WMS/Controllers/LoginController/GetUserInfo.ts +21 -21
- package/dist/api/WMS/Controllers/LoginController/Logout.ts +21 -21
- package/dist/api/WMS/Controllers/LoginController/index.ts +2 -2
- package/dist/api/WMS/Controllers/WhController/ListVO.ts +88 -88
- package/dist/api/WMS/Controllers/WorkstationController/List.ts +45 -45
- package/dist/api/WMS/Controllers/WorkstationController/index.ts +1 -1
- package/dist/api/WMS/Controllers/index.ts +4 -4
- package/dist/api/WMS/models.ts +342 -318
- package/dist/component/KgStation/KgStation.vue +120 -9
- package/dist/const/index.vm.ts +10 -0
- package/dist/index.css +21 -2
- package/dist/service/http-client.ts +106 -62
- package/dist/uni/uni-ui/uni-data-select/uni-data-select.vue +5 -4
- package/dist/uni/uni-ui/uni-datetime-picker/uni-datetime-picker.vue +4 -4
- package/dist/uni/uni-ui/uni-easyinput/common.js +1 -0
- package/dist/uni/uni-ui/uni-easyinput/uni-easyinput.vue +23 -70
- package/dist/uni/uni-ui/uni-pagination/uni-pagination.vue +8 -4
- package/dist/uni/uni-ui/uni-segmented-control/uni-segmented-control.vue +4 -4
- package/dist/util/kg.ts +66 -14
- package/package.json +22 -22
- package/script/bump-to.luotao.smartfactory.product.wms.wms--dev-3.2.ts +3 -0
- package/script/bump-to.luotao.smartfactory.product.wms.wms--project-kengic-factory.ts +3 -0
- package/script/bump-to.ts +38 -0
- package/script/bump.ts +35 -0
- package/script/copy-to.luotao.smartfactory.product.wms.wms--dev-3.2.ts +3 -0
- package/script/copy-to.luotao.smartfactory.product.wms.wms--project-kengic-factory.ts +3 -0
- package/script/copy-to.ts +23 -0
- package/script/publish.ts +20 -0
- package/dist/src/index.d.ts +0 -1
- package/dist/uni/uni-ui/README.md +0 -1
- package/dist/uni/uni-ui/uni-scss/readme.md +0 -4
|
@@ -3,7 +3,17 @@
|
|
|
3
3
|
<UniPopupDialog :before-close="true" title="选择工作站" @close="onClose" @confirm="onOk">
|
|
4
4
|
<div class="row">
|
|
5
5
|
<div class="label">工作站:</div>
|
|
6
|
-
<div class="value">
|
|
6
|
+
<div class="value devcod">
|
|
7
|
+
<UniEasyinput
|
|
8
|
+
v-model="devcodInputValue"
|
|
9
|
+
:focus="isFocusMap.devcodInputValue"
|
|
10
|
+
:placeholder="currentDevcodDsc"
|
|
11
|
+
:placeholder-style="devcodPlaceholderStyle"
|
|
12
|
+
trim
|
|
13
|
+
@blur="onDevcodInputValueBlur"
|
|
14
|
+
@focus="onDevcodInputValueFocus"
|
|
15
|
+
@confirm="findDevmstByInputValue"
|
|
16
|
+
/>
|
|
7
17
|
<UniDataSelect :localdata="stationDatas" v-model="currentDevcod" :clear="true" />
|
|
8
18
|
</div>
|
|
9
19
|
</div>
|
|
@@ -18,8 +28,8 @@
|
|
|
18
28
|
</template>
|
|
19
29
|
|
|
20
30
|
<script lang="ts" setup>
|
|
21
|
-
import { UniDataSelect, UniPopup, UniPopupDialog } from '../../uni';
|
|
22
|
-
import { computed, ref, watch } from 'vue';
|
|
31
|
+
import { UniDataSelect, UniEasyinput, UniPopup, UniPopupDialog } from '../../uni';
|
|
32
|
+
import { computed, nextTick, ref, watch } from 'vue';
|
|
23
33
|
import { useKgStation } from './index.hooks';
|
|
24
34
|
import { WorkstationDTO } from '../../api/WMS/models';
|
|
25
35
|
import { API } from '../../api';
|
|
@@ -41,24 +51,46 @@
|
|
|
41
51
|
/** 所有工作站. */
|
|
42
52
|
const stations = ref<Array<WorkstationDTO>>([]);
|
|
43
53
|
|
|
54
|
+
/**
|
|
55
|
+
* 工作站的输入框输入的值, 当输入框失去焦点或者回车时, 会根据这个值去匹配工作站编号, 如果匹配成功, 则选中该匹配的工作站, 否则清空该值并提升工作站不存在.
|
|
56
|
+
*/
|
|
57
|
+
const devcodInputValue = ref('');
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 工作站的输入框的占位符字符的样式.
|
|
61
|
+
*/
|
|
62
|
+
const devcodPlaceholderStyle = ref('color: #3ee');
|
|
63
|
+
|
|
44
64
|
/**
|
|
45
65
|
* 工作站下拉列表.
|
|
46
66
|
*/
|
|
47
|
-
const stationDatas = computed<Array<{
|
|
67
|
+
const stationDatas = computed<Array<{ text: string; value: string }>>(() =>
|
|
68
|
+
stations.value.map((i) => ({ text: i.devcodDsc ?? i.devcod ?? '', value: i.devcod ?? '' })),
|
|
69
|
+
);
|
|
48
70
|
|
|
49
71
|
/**
|
|
50
72
|
* 工作区下拉列表.
|
|
51
73
|
*/
|
|
52
|
-
const areaDatas = computed<Array<{
|
|
74
|
+
const areaDatas = computed<Array<{ text: string; value: string }>>(
|
|
53
75
|
() =>
|
|
54
76
|
stations.value
|
|
55
77
|
.find((i) => i.devcod === currentDevcod.value)
|
|
56
|
-
?.
|
|
78
|
+
?.workstationAndAreaRelationshipDTOList?.map((i) => ({
|
|
57
79
|
text: i.wrkareDsc ?? i.wrkare ?? '',
|
|
58
80
|
value: i.wrkare ?? '',
|
|
59
81
|
})) ?? [],
|
|
60
82
|
);
|
|
61
83
|
|
|
84
|
+
/**
|
|
85
|
+
* 当前选择的工作站编号的描述.
|
|
86
|
+
*/
|
|
87
|
+
const currentDevcodDsc = computed(() => stationDatas.value.find((i) => i.value === currentDevcod.value)?.text ?? '');
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* <p>是否聚焦.</p>
|
|
91
|
+
* <p>每个 key 对应一个输入框, 每个 value 表示该输入框当前是否聚焦.</p>
|
|
92
|
+
*/
|
|
93
|
+
const isFocusMap = ref({ devcodInputValue: true });
|
|
62
94
|
// ----------------------------------------------------------------------------------------------------
|
|
63
95
|
//endregion
|
|
64
96
|
|
|
@@ -69,12 +101,10 @@
|
|
|
69
101
|
if (!value) {
|
|
70
102
|
currentHmewrkare.value = '';
|
|
71
103
|
} else {
|
|
72
|
-
console.log('11', value, currentDevcod.value);
|
|
73
104
|
// 当「当前选择的工作站编号」变更时, 选择它的默认的工作区,
|
|
74
105
|
const currentStation = stations.value.find((i) => i.devcod === currentDevcod.value);
|
|
75
106
|
if (currentStation) {
|
|
76
107
|
currentHmewrkare.value = currentStation.hmewrkare ?? '';
|
|
77
|
-
console.log('22', currentHmewrkare.value);
|
|
78
108
|
}
|
|
79
109
|
}
|
|
80
110
|
});
|
|
@@ -83,6 +113,57 @@
|
|
|
83
113
|
|
|
84
114
|
//region FUNCTION
|
|
85
115
|
// ----------------------------------------------------------------------------------------------------
|
|
116
|
+
/**
|
|
117
|
+
* 设置聚焦.
|
|
118
|
+
*
|
|
119
|
+
* @param key 要聚焦哪个输入框.
|
|
120
|
+
*/
|
|
121
|
+
function setFocus(key: string) {
|
|
122
|
+
// 错误的输入框,
|
|
123
|
+
if (!key || !(key in isFocusMap.value)) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
Object.keys(isFocusMap.value).forEach((key) => (isFocusMap.value[key] = false));
|
|
128
|
+
nextTick().then(() => (isFocusMap.value[key] = true));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* 工作站的输入框失去焦点.
|
|
133
|
+
*/
|
|
134
|
+
async function onDevcodInputValueBlur() {
|
|
135
|
+
devcodPlaceholderStyle.value = 'color: #333';
|
|
136
|
+
|
|
137
|
+
await nextTick();
|
|
138
|
+
await findDevmstByInputValue();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* 工作站的输入框聚焦.
|
|
143
|
+
*/
|
|
144
|
+
function onDevcodInputValueFocus() {
|
|
145
|
+
devcodPlaceholderStyle.value = 'color: #999';
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* 根据输入的值(作为工作站编号), 查找工作站.
|
|
150
|
+
*/
|
|
151
|
+
async function findDevmstByInputValue() {
|
|
152
|
+
if (!devcodInputValue.value) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const station = stations.value.find((i) => i.devcod === devcodInputValue.value);
|
|
157
|
+
if (station) {
|
|
158
|
+
currentDevcod.value = devcodInputValue.value;
|
|
159
|
+
devcodInputValue.value = '';
|
|
160
|
+
} else {
|
|
161
|
+
devcodInputValue.value = '';
|
|
162
|
+
await uni.showToast({ icon: 'none', title: '工作站不存在' });
|
|
163
|
+
setFocus('devcodInputValue');
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
86
167
|
/**
|
|
87
168
|
* 取消.
|
|
88
169
|
*/
|
|
@@ -121,7 +202,15 @@
|
|
|
121
202
|
*/
|
|
122
203
|
async function requestStations(): Promise<void> {
|
|
123
204
|
try {
|
|
124
|
-
stations.value =
|
|
205
|
+
stations.value =
|
|
206
|
+
(
|
|
207
|
+
await API.WMS.WorkstationController.List({
|
|
208
|
+
params: {
|
|
209
|
+
pageNo: 1,
|
|
210
|
+
pageSize: 999,
|
|
211
|
+
},
|
|
212
|
+
})
|
|
213
|
+
)?.records ?? [];
|
|
125
214
|
} catch (e) {
|
|
126
215
|
console.error(e);
|
|
127
216
|
}
|
|
@@ -133,7 +222,12 @@
|
|
|
133
222
|
</script>
|
|
134
223
|
|
|
135
224
|
<style scoped>
|
|
225
|
+
:deep(.uni-popup__wrapper) {
|
|
226
|
+
width: calc(100% - 8px);
|
|
227
|
+
}
|
|
228
|
+
|
|
136
229
|
:deep(.uni-popup-dialog) {
|
|
230
|
+
width: 100%;
|
|
137
231
|
font-size: 13px;
|
|
138
232
|
}
|
|
139
233
|
|
|
@@ -173,4 +267,21 @@
|
|
|
173
267
|
flex: 1;
|
|
174
268
|
min-width: 0;
|
|
175
269
|
}
|
|
270
|
+
|
|
271
|
+
:deep(.uni-popup-dialog) .uni-dialog-content > .row > .value.devcod {
|
|
272
|
+
position: relative;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
:deep(.uni-popup-dialog) .uni-dialog-content > .row > .value.devcod > .uni-easyinput {
|
|
276
|
+
color: rgb(51, 51, 51);
|
|
277
|
+
position: absolute;
|
|
278
|
+
left: 0;
|
|
279
|
+
top: 0;
|
|
280
|
+
z-index: 2;
|
|
281
|
+
width: calc(100% - 26px);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
:deep(.uni-popup-dialog) .uni-dialog-content > .row > .value.devcod > .uni-easyinput > .uni-easyinput__content {
|
|
285
|
+
border-radius: 3px 0 0 3px;
|
|
286
|
+
}
|
|
176
287
|
</style>
|
package/dist/const/index.vm.ts
CHANGED
package/dist/index.css
CHANGED
|
@@ -2,13 +2,32 @@ uni-button {
|
|
|
2
2
|
border-radius: 3px !important;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
uni-button:after {
|
|
6
|
+
border-radius: 6px !important;
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
.kg-tab-bar-sibling {
|
|
6
10
|
padding-bottom: 50px !important;
|
|
7
11
|
}
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
:deep(uni-toast) {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:deep(uni-toast) .uni-sample-toast {
|
|
20
|
+
max-width: calc(100% - 6px);
|
|
21
|
+
position: relative;
|
|
22
|
+
top: initial;
|
|
23
|
+
left: initial;
|
|
24
|
+
transform: translate(0, 0);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:deep(uni-toast) .uni-sample-toast .uni-simple-toast__text {
|
|
28
|
+
padding: 7px 8px 9px 8px;
|
|
11
29
|
border-radius: 4px;
|
|
30
|
+
background-color: rgba(17, 17, 17, 0.9);
|
|
12
31
|
}
|
|
13
32
|
|
|
14
33
|
/* #ifdef H5 */
|
|
@@ -2,18 +2,23 @@ import { useAppStore } from '../store/app.store';
|
|
|
2
2
|
import { Kg } from '../util';
|
|
3
3
|
import { KG_DYNAMIC_QUERY_OPERATOR, KG_HTTP_HEADERS } from '../const';
|
|
4
4
|
import { useKgWarehouse } from '../component/KgWarehouse/index.hooks';
|
|
5
|
+
import { useKgStation } from '../component/KgStation';
|
|
6
|
+
import { isNil } from 'lodash-es';
|
|
7
|
+
import dayjs from 'dayjs';
|
|
5
8
|
|
|
6
9
|
/*
|
|
7
10
|
* 对请求做统一的拦截.
|
|
8
11
|
*/
|
|
9
12
|
uni.addInterceptor('request', {
|
|
10
13
|
invoke(args) {
|
|
11
|
-
|
|
14
|
+
if (args?.isShowLoading !== false) {
|
|
15
|
+
uni.showLoading({ mask: true });
|
|
16
|
+
}
|
|
12
17
|
|
|
13
18
|
const appStore = useAppStore();
|
|
14
19
|
|
|
15
20
|
args.header['Authorization'] = appStore.getToken;
|
|
16
|
-
// TODO 支持其他语言
|
|
21
|
+
// TODO LT 支持其他语言
|
|
17
22
|
args.header['Accept-Language'] = 'zh_CN'.replace('_', '-');
|
|
18
23
|
args.header['X-Access-Token'] = appStore.getToken;
|
|
19
24
|
|
|
@@ -29,7 +34,7 @@ uni.addInterceptor('request', {
|
|
|
29
34
|
args.data = keys.map((i) => args.data[i]);
|
|
30
35
|
}
|
|
31
36
|
|
|
32
|
-
args.data = Kg.parseParams(args.data);
|
|
37
|
+
args.data = Kg.parseParams(null, args.data);
|
|
33
38
|
},
|
|
34
39
|
success(args) {
|
|
35
40
|
uni.hideLoading();
|
|
@@ -56,6 +61,8 @@ type IHttpClient = {
|
|
|
56
61
|
|
|
57
62
|
/** 请求配置. */
|
|
58
63
|
type IRequestOptions = Omit<UniApp.RequestOptions, 'url'> & {
|
|
64
|
+
$dayjs?: typeof dayjs;
|
|
65
|
+
|
|
59
66
|
/**
|
|
60
67
|
* 不放入 WHERE SQL 中的参数.
|
|
61
68
|
*/
|
|
@@ -68,9 +75,27 @@ type IRequestOptions = Omit<UniApp.RequestOptions, 'url'> & {
|
|
|
68
75
|
*/
|
|
69
76
|
dynamicQueryOperatorModel?: Record<string, KG_DYNAMIC_QUERY_OPERATOR>;
|
|
70
77
|
|
|
71
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* 是否显示加载提示.
|
|
80
|
+
*
|
|
81
|
+
* @default true
|
|
82
|
+
*/
|
|
83
|
+
isShowLoading?: boolean;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* 是否不显示错误消息提示.
|
|
87
|
+
*
|
|
88
|
+
* @default false
|
|
89
|
+
*/
|
|
72
90
|
isSuppressError?: boolean;
|
|
73
91
|
|
|
92
|
+
/**
|
|
93
|
+
* 是否不显示成功消息提示.
|
|
94
|
+
*
|
|
95
|
+
* @default false
|
|
96
|
+
*/
|
|
97
|
+
isSuppressSuccess?: boolean;
|
|
98
|
+
|
|
74
99
|
/** 是否处理请求结果. */
|
|
75
100
|
isTransformResponse?: boolean;
|
|
76
101
|
|
|
@@ -100,6 +125,13 @@ function handleSuccess<T = any>(
|
|
|
100
125
|
reject: (reason?: any) => void,
|
|
101
126
|
options?: IRequestOptions,
|
|
102
127
|
) {
|
|
128
|
+
// 显示后端成功消息
|
|
129
|
+
if (!options?.isSuppressSuccess) {
|
|
130
|
+
if ((response.data as any).message) {
|
|
131
|
+
uni.showToast({ duration: 1000 * 3, icon: 'none', title: (response.data as any).message });
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
103
135
|
if (options?.isTransformResponse === false) {
|
|
104
136
|
resolve(response.data as any);
|
|
105
137
|
} else {
|
|
@@ -129,7 +161,7 @@ function handleError<T = any>(
|
|
|
129
161
|
if (!isSuppressError) {
|
|
130
162
|
// @ts-ignore
|
|
131
163
|
const message = (response.data as any)?.message || response?.errMsg || '请求出错';
|
|
132
|
-
uni.showToast({
|
|
164
|
+
uni.showToast({ duration: 3000, icon: 'none', title: message });
|
|
133
165
|
}
|
|
134
166
|
|
|
135
167
|
reject(response);
|
|
@@ -160,14 +192,15 @@ const _httpClient: IHttpClient = {
|
|
|
160
192
|
if (['POST', 'PUT', 'DELETE'].includes(method) && params) {
|
|
161
193
|
try {
|
|
162
194
|
const queryString = Object.keys(params)
|
|
163
|
-
//
|
|
164
|
-
.
|
|
195
|
+
// 值为 null/undefined 的参数, 不需要放到 query 参数中去,
|
|
196
|
+
.filter((i) => !isNil(params[i]))
|
|
197
|
+
.map((i) => i + '=' + params[i])
|
|
165
198
|
.join('&');
|
|
166
199
|
if (queryString) {
|
|
167
200
|
_url += '?' + queryString;
|
|
168
201
|
}
|
|
169
202
|
} catch (e) {
|
|
170
|
-
console.
|
|
203
|
+
console.error(e);
|
|
171
204
|
}
|
|
172
205
|
}
|
|
173
206
|
|
|
@@ -177,61 +210,66 @@ const _httpClient: IHttpClient = {
|
|
|
177
210
|
header = {};
|
|
178
211
|
}
|
|
179
212
|
|
|
180
|
-
const KG_IS_DYNAMIC_QUERY = KG_HTTP_HEADERS.KG_IS_DYNAMIC_QUERY;
|
|
181
|
-
const KG_QUERY_WHERE_SQL = KG_HTTP_HEADERS.KG_QUERY_WHERE_SQL;
|
|
182
|
-
const KG_QUERY_ORDER_BY_SQL = KG_HTTP_HEADERS.KG_QUERY_ORDER_BY_SQL;
|
|
183
|
-
const KG_QUERY_OFFSET_SQL = KG_HTTP_HEADERS.KG_QUERY_OFFSET_SQL;
|
|
184
|
-
const KG_QUERY_SQL = KG_HTTP_HEADERS.KG_QUERY_SQL;
|
|
185
|
-
const KG_QUERY_OPERATOR = KG_HTTP_HEADERS.KG_QUERY_OPERATOR;
|
|
186
|
-
|
|
187
213
|
// 启用高级查询
|
|
188
214
|
if (options?.dynamicQueryOperatorModel) {
|
|
189
215
|
let params: any = {};
|
|
190
216
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
217
|
+
switch (config.method) {
|
|
218
|
+
case 'GET': {
|
|
219
|
+
if (config.params) {
|
|
220
|
+
params = config.params;
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
if (config.data && !config.params) {
|
|
225
|
+
params = config.data;
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
case 'POST': {
|
|
233
|
+
if (config.data) {
|
|
234
|
+
params = config.data;
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (!config.data && config.params) {
|
|
239
|
+
params = config.params;
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
197
245
|
}
|
|
198
246
|
|
|
199
247
|
const { sql, whereSql, orderBySql, offsetSql, operatorJSON } = Kg.getQueryHeaders({
|
|
248
|
+
$dayjs: options?.$dayjs,
|
|
200
249
|
dynamicQueryExcludeProperties: options?.dynamicQueryExcludeProperties,
|
|
201
250
|
dynamicQueryOperatorModel: options?.dynamicQueryOperatorModel,
|
|
202
|
-
params: params,
|
|
251
|
+
params: Kg.parseParams(options?.$dayjs, params),
|
|
203
252
|
});
|
|
204
253
|
|
|
205
254
|
header = {
|
|
206
255
|
...(header ?? {}),
|
|
207
|
-
[KG_IS_DYNAMIC_QUERY]: true,
|
|
208
|
-
[KG_QUERY_OFFSET_SQL]: offsetSql,
|
|
209
|
-
[KG_QUERY_OPERATOR]: operatorJSON,
|
|
210
|
-
[KG_QUERY_ORDER_BY_SQL]: orderBySql,
|
|
211
|
-
[KG_QUERY_SQL]: sql,
|
|
212
|
-
[KG_QUERY_WHERE_SQL]: whereSql,
|
|
256
|
+
[KG_HTTP_HEADERS.KG_IS_DYNAMIC_QUERY]: true,
|
|
257
|
+
[KG_HTTP_HEADERS.KG_QUERY_OFFSET_SQL]: offsetSql,
|
|
258
|
+
[KG_HTTP_HEADERS.KG_QUERY_OPERATOR]: operatorJSON,
|
|
259
|
+
[KG_HTTP_HEADERS.KG_QUERY_ORDER_BY_SQL]: orderBySql,
|
|
260
|
+
[KG_HTTP_HEADERS.KG_QUERY_SQL]: sql,
|
|
261
|
+
[KG_HTTP_HEADERS.KG_QUERY_WHERE_SQL]: whereSql,
|
|
213
262
|
};
|
|
214
263
|
}
|
|
215
264
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
if (header[KG_QUERY_ORDER_BY_SQL]) {
|
|
221
|
-
header[KG_QUERY_ORDER_BY_SQL] = encodeURIComponent(decodeURIComponent(String(header[KG_QUERY_ORDER_BY_SQL])));
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
if (header[KG_QUERY_OFFSET_SQL]) {
|
|
225
|
-
header[KG_QUERY_OFFSET_SQL] = encodeURIComponent(decodeURIComponent(String(header[KG_QUERY_OFFSET_SQL])));
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
if (header[KG_QUERY_SQL]) {
|
|
229
|
-
header[KG_QUERY_SQL] = encodeURIComponent(decodeURIComponent(String(header[KG_QUERY_SQL])));
|
|
230
|
-
}
|
|
265
|
+
header[KG_HTTP_HEADERS.KG_QUERY_WHERE_SQL] = encodeURIComponent(decodeURIComponent(String(header[KG_HTTP_HEADERS.KG_QUERY_WHERE_SQL] ?? '')));
|
|
266
|
+
header[KG_HTTP_HEADERS.KG_QUERY_ORDER_BY_SQL] = encodeURIComponent(decodeURIComponent(String(header[KG_HTTP_HEADERS.KG_QUERY_ORDER_BY_SQL] ?? '')));
|
|
267
|
+
header[KG_HTTP_HEADERS.KG_QUERY_OFFSET_SQL] = encodeURIComponent(decodeURIComponent(String(header[KG_HTTP_HEADERS.KG_QUERY_OFFSET_SQL] ?? '')));
|
|
268
|
+
header[KG_HTTP_HEADERS.KG_QUERY_SQL] = encodeURIComponent(decodeURIComponent(String(header[KG_HTTP_HEADERS.KG_QUERY_SQL] ?? '')));
|
|
231
269
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
header[KG_HTTP_HEADERS.
|
|
270
|
+
header[KG_HTTP_HEADERS.KG_WAREHOUSE] = encodeURIComponent(useKgWarehouse().warehouse.value?.whId ?? '');
|
|
271
|
+
header[KG_HTTP_HEADERS.KG_WORK_STATION] = encodeURIComponent(useKgStation().station.value?.devcod ?? '');
|
|
272
|
+
header[KG_HTTP_HEADERS.KG_WORK_AREA] = encodeURIComponent(useKgStation().station.value?.hmewrkare ?? '');
|
|
235
273
|
|
|
236
274
|
uni.request({
|
|
237
275
|
...(options ?? {}),
|
|
@@ -239,31 +277,37 @@ const _httpClient: IHttpClient = {
|
|
|
239
277
|
url: _url,
|
|
240
278
|
header: header,
|
|
241
279
|
data: { ...(params ?? {}), ...(data ?? {}) },
|
|
280
|
+
// 超时时间, 单位毫秒, 默认 60 秒,
|
|
281
|
+
timeout: 1000 * 60 * 60,
|
|
242
282
|
success(response) {
|
|
243
283
|
switch (response.statusCode) {
|
|
244
284
|
case 200:
|
|
245
285
|
if (typeof response.data === 'string') {
|
|
246
286
|
// 接口返回的数据是 HTML, 退出登录
|
|
247
287
|
if (response.data.startsWith('<!DOCTYPE')) {
|
|
248
|
-
// store.dispatch('logout');
|
|
249
288
|
}
|
|
250
289
|
} else if (response.data instanceof ArrayBuffer) {
|
|
290
|
+
// 文件
|
|
251
291
|
} else {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
292
|
+
if (response.data.success === false) {
|
|
293
|
+
handleError<T>(response, resolve, reject, options?.isSuppressError ?? false);
|
|
294
|
+
} else {
|
|
295
|
+
// 处理自定义的错误码
|
|
296
|
+
switch (response.data.code) {
|
|
297
|
+
case 0:
|
|
298
|
+
case 200:
|
|
299
|
+
handleSuccess<T>(response as any, resolve, reject, options);
|
|
300
|
+
break;
|
|
301
|
+
|
|
302
|
+
case 405:
|
|
303
|
+
response.data.message = `${response.data.code}: ${response.data.message}`;
|
|
304
|
+
handleError<T>(response, resolve, reject, options?.isSuppressError ?? false);
|
|
305
|
+
break;
|
|
306
|
+
|
|
307
|
+
case 500:
|
|
308
|
+
handleError<T>(response, resolve, reject, options?.isSuppressError ?? false);
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
267
311
|
}
|
|
268
312
|
}
|
|
269
313
|
break;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<view v-if="current" class="uni-select__input-text">{{ textShow }}</view>
|
|
8
8
|
<view v-else class="uni-select__input-text uni-select__input-placeholder">{{ typePlaceholder }} </view>
|
|
9
9
|
<view v-if="current && clear && !disabled" @click.stop="clearVal">
|
|
10
|
-
<uni-icons type="clear" color="#c0c4cc" size="
|
|
10
|
+
<uni-icons type="clear" color="#c0c4cc" size="16" />
|
|
11
11
|
</view>
|
|
12
12
|
<view v-else style="display: flex; align-items: center; justify-content: center">
|
|
13
13
|
<view :class="showSelector ? 'ant-design--caret-up-filled' : 'ant-design--caret-down-filled'" />
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
textShow() {
|
|
141
141
|
// 长文本显示
|
|
142
142
|
let text = this.current;
|
|
143
|
-
if (text.length >
|
|
143
|
+
if (text.length > 999) {
|
|
144
144
|
return text.slice(0, 25) + '...';
|
|
145
145
|
}
|
|
146
146
|
return text;
|
|
@@ -148,9 +148,9 @@
|
|
|
148
148
|
getOffsetByPlacement() {
|
|
149
149
|
switch (this.placement) {
|
|
150
150
|
case 'top':
|
|
151
|
-
return 'bottom:calc(100% +
|
|
151
|
+
return 'bottom:calc(100% + 1px);box-shadow: 0 -3px 6px -4px rgba(0, 0, 0, 0.12), 0 -6px 16px 0 rgba(0, 0, 0, 0.08), 0 -9px 28px 8px rgba(0, 0, 0, 0.05);';
|
|
152
152
|
case 'bottom':
|
|
153
|
-
return 'top:calc(100% +
|
|
153
|
+
return 'top:calc(100% + 1px);box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);';
|
|
154
154
|
}
|
|
155
155
|
},
|
|
156
156
|
},
|
|
@@ -399,6 +399,7 @@
|
|
|
399
399
|
flex: 1;
|
|
400
400
|
flex-direction: row;
|
|
401
401
|
align-items: center;
|
|
402
|
+
overflow: hidden;
|
|
402
403
|
}
|
|
403
404
|
|
|
404
405
|
.uni-select__input {
|
|
@@ -817,7 +817,7 @@
|
|
|
817
817
|
flex-direction: row;
|
|
818
818
|
align-items: center;
|
|
819
819
|
justify-content: center;
|
|
820
|
-
border-radius:
|
|
820
|
+
border-radius: 3px;
|
|
821
821
|
background-color: #fff;
|
|
822
822
|
color: #666;
|
|
823
823
|
font-size: 14px;
|
|
@@ -837,7 +837,7 @@
|
|
|
837
837
|
|
|
838
838
|
.uni-date-x--border {
|
|
839
839
|
box-sizing: border-box;
|
|
840
|
-
border-radius:
|
|
840
|
+
border-radius: 3px;
|
|
841
841
|
border: 1px solid #e5e5e5;
|
|
842
842
|
}
|
|
843
843
|
|
|
@@ -907,7 +907,7 @@
|
|
|
907
907
|
z-index: 999;
|
|
908
908
|
border: 1px solid #EBEEF5;
|
|
909
909
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
910
|
-
border-radius:
|
|
910
|
+
border-radius: 3px;
|
|
911
911
|
}
|
|
912
912
|
|
|
913
913
|
.uni-date-range--x {
|
|
@@ -917,7 +917,7 @@
|
|
|
917
917
|
z-index: 999;
|
|
918
918
|
border: 1px solid #EBEEF5;
|
|
919
919
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
920
|
-
border-radius:
|
|
920
|
+
border-radius: 3px;
|
|
921
921
|
}
|
|
922
922
|
|
|
923
923
|
.uni-date-editor--x__disabled {
|