@kengic/uni 0.6.2-beta.0 → 0.6.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.
- package/dist/service/http-client.ts +9 -1
- package/dist/util/kg.ts +9 -5
- package/package.json +6 -6
|
@@ -53,7 +53,14 @@ type IHttpClient = {
|
|
|
53
53
|
/** 请求配置. */
|
|
54
54
|
type IRequestOptions = Omit<UniApp.RequestOptions, 'url'> & {
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* 不放入 WHERE SQL 中的参数.
|
|
57
|
+
*/
|
|
58
|
+
dynamicQueryExcludeProperties?: Array<string>;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* <p>各个请求参数的高级查询操作符.</p>
|
|
62
|
+
* <p>如果该参数不为空, 表示该请求启用了高级查询.</p>
|
|
63
|
+
* <p>其中的 key 表示参数名, 对应的 value 表示该参数的高级查询操作符(>,=,<...).</p>
|
|
57
64
|
*/
|
|
58
65
|
dynamicQueryOperatorModel?: Record<string, KG_DYNAMIC_QUERY_OPERATOR>;
|
|
59
66
|
|
|
@@ -179,6 +186,7 @@ const _httpClient: IHttpClient = {
|
|
|
179
186
|
}
|
|
180
187
|
|
|
181
188
|
const { sql, whereSql, orderBySql, offsetSql, operatorJSON } = Kg.getQueryHeaders({
|
|
189
|
+
dynamicQueryExcludeProperties: options?.dynamicQueryExcludeProperties,
|
|
182
190
|
dynamicQueryOperatorModel: options?.dynamicQueryOperatorModel,
|
|
183
191
|
params: params,
|
|
184
192
|
});
|
package/dist/util/kg.ts
CHANGED
|
@@ -164,17 +164,16 @@ export class Kg {
|
|
|
164
164
|
/**
|
|
165
165
|
* <p>获取根据查询条件拼接后的 SQL 语句片段.</p>
|
|
166
166
|
*
|
|
167
|
-
* @param param
|
|
168
|
-
* @param param.
|
|
169
|
-
* @param param.formID 界面标识.
|
|
170
|
-
* @param param.kgSearchFormID 查询条件的界面标识.
|
|
167
|
+
* @param param.dynamicQueryExcludeProperties 各个字段的高级查询操作符.
|
|
168
|
+
* @param param.dynamicQueryOperatorModel 各个字段的高级查询操作符.
|
|
171
169
|
* @param param.params 请求参数.
|
|
172
170
|
*/
|
|
173
171
|
public static getQueryHeaders(param: {
|
|
172
|
+
dynamicQueryExcludeProperties: Array<string> | null | undefined;
|
|
174
173
|
dynamicQueryOperatorModel: Record<string, any> | null | undefined;
|
|
175
174
|
params: Record<string, any> | null | undefined;
|
|
176
175
|
}) {
|
|
177
|
-
const { params, dynamicQueryOperatorModel } = param ?? {};
|
|
176
|
+
const { params, dynamicQueryExcludeProperties, dynamicQueryOperatorModel } = param ?? {};
|
|
178
177
|
|
|
179
178
|
let _params = cloneDeep(toRaw(unref(params ?? {})));
|
|
180
179
|
|
|
@@ -195,6 +194,11 @@ export class Kg {
|
|
|
195
194
|
return;
|
|
196
195
|
}
|
|
197
196
|
|
|
197
|
+
// 要排除的字段, 不放进 WHERE SQL 中
|
|
198
|
+
if (dynamicQueryExcludeProperties?.includes(key)) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
|
|
198
202
|
// 辅助属性, 用于业务逻辑, 不放进 WHERE SQL 中,
|
|
199
203
|
if (key.endsWith('_obj')) {
|
|
200
204
|
return;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kengic/uni",
|
|
3
|
-
"version": "0.6.2
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "npm run switch-node-version && rimraf dist && vue-tsc && vite build",
|
|
6
6
|
"------ -------------------------------------------": "",
|
|
7
|
-
"publish:all:beta": "npm run bump-version:beta && npm run publish:all",
|
|
8
|
-
"publish:all:patch": "npm run bump-version:patch && npm run publish:all",
|
|
9
|
-
"publish:all:minor": "npm run bump-version:minor && npm run publish:all",
|
|
10
7
|
"publish:all:major": "npm run bump-version:major && npm run publish:all",
|
|
8
|
+
"publish:all:minor": "npm run bump-version:minor && npm run publish:all",
|
|
9
|
+
"publish:all:patch": "npm run bump-version:patch && npm run publish:all",
|
|
10
|
+
"publish:all:beta": "npm run bump-version:beta && npm run publish:all",
|
|
11
11
|
"--------------------------------------------------": "",
|
|
12
12
|
"gen:apis:WMS": "npm run switch-node-version && kengic-pont generate-apis --config kg.config.ts --origin WMS",
|
|
13
13
|
"- ------------------------------------------------": "",
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
"bump-to:luotao.wms-pda--dev-1.0": "npm run switch-node-version && node scripts/bump-to.luotao.wms-pda--dev-1.0.mjs --experimental-default-type=module",
|
|
17
17
|
"bump-to:luotao.wms-pda--focus": "npm run switch-node-version && node scripts/bump-to.luotao.wms-pda--focus.mjs --experimental-default-type=module",
|
|
18
18
|
"-- -----------------------------------------------": "",
|
|
19
|
-
"cnpm:sync": "cnpm sync @kengic/uni",
|
|
19
|
+
"cnpm:sync": "npx cnpm --yes sync @kengic/uni",
|
|
20
20
|
"--- ----------------------------------------------": "",
|
|
21
21
|
"switch-node-version": "nvm use 20.11.0 && corepack enable && corepack prepare pnpm@7.30.5 --activate",
|
|
22
22
|
"---- ---------------------------------------------": "",
|
|
23
|
-
"bump-version:beta": "npm run switch-node-version && node scripts/bump.mjs beta --experimental-default-type=module",
|
|
24
23
|
"bump-version:major": "npm run switch-node-version && node scripts/bump.mjs major --experimental-default-type=module",
|
|
25
24
|
"bump-version:minor": "npm run switch-node-version && node scripts/bump.mjs minor --experimental-default-type=module",
|
|
26
25
|
"bump-version:patch": "npm run switch-node-version && node scripts/bump.mjs patch --experimental-default-type=module",
|
|
26
|
+
"bump-version:beta": "npm run switch-node-version && node scripts/bump.mjs beta --experimental-default-type=module",
|
|
27
27
|
"----- --------------------------------------------": "",
|
|
28
28
|
"publish:all": "npm run switch-node-version && node scripts/publish.mjs --experimental-default-type=module",
|
|
29
29
|
"publish:npm": "npm run switch-node-version && npmrc kengic && npm publish ./ --registry https://registry.npmjs.org/ --access public"
|