@cloudbase/weda-ui-mp 3.14.2 → 3.15.0
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/components/chart/bar/index.js +4 -20
- package/components/chart/bar/index.wxml +1 -1
- package/components/chart/common/data-transform.js +6 -16
- package/components/chart/ec-canvas/ec-canvas.js +35 -37
- package/components/chart/ec-canvas/ec-canvas.wxml +1 -1
- package/components/chart/line/index.js +4 -20
- package/components/chart/line/index.wxml +1 -1
- package/components/chart/pie/index.js +4 -20
- package/components/chart/pie/index.wxml +1 -1
- package/components/form/form/wd-form.wxss +15 -0
- package/components/form/select/dropdown-select/index.js +41 -58
- package/components/form/select/dropdown-select/index.wxml +1 -1
- package/components/form/select/dropdown-select/index.wxss +1 -2
- package/components/form/select/index.js +1 -1
- package/components/form/selectMultiple/dropdown-select/index.js +10 -20
- package/components/form/selectMultiple/dropdown-select/index.wxss +2 -6
- package/components/form/selectMultiple/index.js +94 -45
- package/components/form/uploader/index.js +7 -15
- package/components/form/uploaderFile/index.js +3 -2
- package/components/formdetail/index.js +9 -28
- package/components/listView/index.js +1 -1
- package/components/listView/index.wxml +5 -5
- package/components/listView/index.wxss +20 -67
- package/components/qrcode/index.js +3 -4
- package/components/wd-form/index.js +72 -163
- package/components/wd-form/wd-form.wxss +15 -0
- package/components/wd-form-item/wd-form-item.wxss +15 -0
- package/components/wd-form-item-obj/wd-form-item.wxss +15 -0
- package/components/wd-input/inner-input/index.js +22 -56
- package/components/wd-input/inner-input/index.wxml +6 -2
- package/components/wd-input/inner-input/wd-input.wxss +15 -0
- package/components/wd-progress/wd-progress.wxss +15 -0
- package/components/wd-rating/wd-rating.wxss +15 -0
- package/components/wd-select/index.js +14 -10
- package/components/wd-select/index.json +1 -1
- package/components/wd-select/index.wxml +3 -0
- package/components/wd-select/select/formats-util.js +9 -0
- package/components/wd-select/select/index.js +545 -0
- package/components/wd-select/select/index.json +8 -0
- package/components/wd-select/select/index.wxml +26 -0
- package/components/wd-select/select/index.wxss +5 -0
- package/components/wd-select-multiple/index.js +13 -5
- package/components/wd-select-multiple/index.wxml +3 -0
- package/components/wd-switch/wd-switch.wxss +15 -0
- package/components/wd-tag-select/wd-tag-select.wxss +15 -0
- package/package.json +1 -1
- package/utils/getModelParams.js +27 -1
- package/utils/tcb.js +11 -2
|
@@ -1230,4 +1230,19 @@ textarea {
|
|
|
1230
1230
|
}
|
|
1231
1231
|
.wd-mp-form-item-obj .wd-form-item--weui.wd-form-item {
|
|
1232
1232
|
width: 100%;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
.wd-input-password-icon {
|
|
1236
|
+
padding: 0 5px;
|
|
1237
|
+
display: flex;
|
|
1238
|
+
cursor: pointer;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
.wd-pc-input-password-icon {
|
|
1242
|
+
position: absolute;
|
|
1243
|
+
right: -30px;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
.password-input .wd-form-item-wrap__control-wrap {
|
|
1247
|
+
position: relative;
|
|
1233
1248
|
}
|
|
@@ -1271,4 +1271,19 @@ textarea {
|
|
|
1271
1271
|
}
|
|
1272
1272
|
.wd-mp-form-item-obj .wd-form-item--weui.wd-form-item {
|
|
1273
1273
|
width: 100%;
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
.wd-input-password-icon {
|
|
1277
|
+
padding: 0 5px;
|
|
1278
|
+
display: flex;
|
|
1279
|
+
cursor: pointer;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
.wd-pc-input-password-icon {
|
|
1283
|
+
position: absolute;
|
|
1284
|
+
right: -30px;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
.password-input .wd-form-item-wrap__control-wrap {
|
|
1288
|
+
position: relative;
|
|
1274
1289
|
}
|
package/package.json
CHANGED
package/utils/getModelParams.js
CHANGED
|
@@ -22,7 +22,7 @@ export const convertWhere = (props) => {
|
|
|
22
22
|
/**
|
|
23
23
|
* 拼接filter参数
|
|
24
24
|
*/
|
|
25
|
-
const getFilter = (wList) => {
|
|
25
|
+
export const getFilter = (wList) => {
|
|
26
26
|
let where = [];
|
|
27
27
|
let filter = { where: {} };
|
|
28
28
|
if (wList?.where?.$or) {
|
|
@@ -151,3 +151,29 @@ const transformSorter = (sorter = []) => {
|
|
|
151
151
|
}
|
|
152
152
|
});
|
|
153
153
|
};
|
|
154
|
+
|
|
155
|
+
export function getDefaultQuery({ supportManyRelated, queryCondition, where, sorter }) {
|
|
156
|
+
const params = {};
|
|
157
|
+
// 兼容旧的筛选条件
|
|
158
|
+
const _queryCondition = supportManyRelated ? queryCondition : getWhereList(where);
|
|
159
|
+
// 支持多关联查询,需要将查询条件转换为filter
|
|
160
|
+
params.filter = getFilter(_queryCondition);
|
|
161
|
+
params.select = { $master: true };
|
|
162
|
+
// 处理排序字段
|
|
163
|
+
params.orderBy = sorter
|
|
164
|
+
?.filter((n) => (n.orderBy && n.orderType) || n.relationalTableName)
|
|
165
|
+
?.map((i) => {
|
|
166
|
+
if (i.relationalTableName) {
|
|
167
|
+
return {
|
|
168
|
+
[i.relationalTableName]: i.sorter
|
|
169
|
+
?.filter((j) => j.orderBy && j.orderType)
|
|
170
|
+
?.map((k) => ({ [k.orderBy]: k.orderType })),
|
|
171
|
+
};
|
|
172
|
+
} else {
|
|
173
|
+
return { [i.orderBy]: i.orderType };
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
params.getCount = true;
|
|
177
|
+
params.compatibleWithV1 = true;
|
|
178
|
+
return params;
|
|
179
|
+
}
|
package/utils/tcb.js
CHANGED
|
@@ -150,8 +150,7 @@ export async function callDataSourceApi(param) {
|
|
|
150
150
|
*/
|
|
151
151
|
export const resolveStaticResourceUrl = (path) => {
|
|
152
152
|
try {
|
|
153
|
-
const resourceUrl =
|
|
154
|
-
getWedaAPI()?.app?.__internal__?.resolveStaticResourceUrl(path);
|
|
153
|
+
const resourceUrl = getWedaAPI()?.app?.__internal__?.resolveStaticResourceUrl(path);
|
|
155
154
|
return resourceUrl;
|
|
156
155
|
} catch (error) {
|
|
157
156
|
errorHandler({
|
|
@@ -175,3 +174,13 @@ export const getDataSourceByName = async (dbName, swrMode = true) => {
|
|
|
175
174
|
});
|
|
176
175
|
return datasource;
|
|
177
176
|
};
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* 设置默认上传路径
|
|
180
|
+
*/
|
|
181
|
+
export const getDefaultUploadPath = async (uploadPath) => {
|
|
182
|
+
const app = await getWedaAPI().app;
|
|
183
|
+
const WeAppName = app?.name || app?.id;
|
|
184
|
+
const _uploadPath = WeAppName ? `${uploadPath}/${WeAppName}` : uploadPath;
|
|
185
|
+
return _uploadPath;
|
|
186
|
+
};
|