free-fe-core-modules 0.0.42 → 0.0.44
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/free-field/Fields/Search.vue +10 -21
- package/index.js +7 -1
- package/package.json +1 -1
|
@@ -124,6 +124,7 @@
|
|
|
124
124
|
v-else
|
|
125
125
|
modelValue=""
|
|
126
126
|
:type="`${Field?.Multiple ? 'textarea' : ''}`"
|
|
127
|
+
rows="1"
|
|
127
128
|
hide-bottom-space
|
|
128
129
|
readonly
|
|
129
130
|
:class="`${Field?.Multiple
|
|
@@ -226,24 +227,6 @@ export default defineComponent({
|
|
|
226
227
|
Type: 'Boolean',
|
|
227
228
|
Label: '可多选',
|
|
228
229
|
Name: 'Multiple',
|
|
229
|
-
// Extra: [
|
|
230
|
-
// {
|
|
231
|
-
// Label: '最多可选',
|
|
232
|
-
// Type: 'Number',
|
|
233
|
-
// Name: 'Options.MaxSelection',
|
|
234
|
-
// Default: 2,
|
|
235
|
-
// MinValue: 1,
|
|
236
|
-
// // Options: {
|
|
237
|
-
// // Postfix: '个',
|
|
238
|
-
// // },
|
|
239
|
-
// },
|
|
240
|
-
// {
|
|
241
|
-
// Label: '换行显示',
|
|
242
|
-
// Type: 'Boolean',
|
|
243
|
-
// Default: false,
|
|
244
|
-
// Name: 'Options.AutoWrap',
|
|
245
|
-
// },
|
|
246
|
-
// ],
|
|
247
230
|
},
|
|
248
231
|
{
|
|
249
232
|
Label: '最多可选',
|
|
@@ -333,6 +316,12 @@ export default defineComponent({
|
|
|
333
316
|
if (nV === oV || !nV) return;
|
|
334
317
|
}
|
|
335
318
|
|
|
319
|
+
if (Array.isArray(fieldData.value) && fieldData.value.length === 0) {
|
|
320
|
+
searchSelected.value = [];
|
|
321
|
+
searchDisplay.value = '';
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
|
|
336
325
|
if (props.Field.Options && props.Field.Options.SearchUrl) {
|
|
337
326
|
const paramObj = {};
|
|
338
327
|
paramObj[props.Field.Options.SearchField || 'id'] = props.Field.Multiple
|
|
@@ -499,9 +488,9 @@ export default defineComponent({
|
|
|
499
488
|
const selected = props.Field?.Multiple
|
|
500
489
|
? searchSelected.value : [searchSelected.value[0]];
|
|
501
490
|
const sFieldName = props.Field?.SearchField || 'id';
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
491
|
+
setFieldData(selected.map(
|
|
492
|
+
(ss) => Object.nestValue(ss, sFieldName),
|
|
493
|
+
).filter((ss) => !!ss));
|
|
505
494
|
|
|
506
495
|
const sdFieldName = props.Field?.Options?.SearchDisplayField || 'id';
|
|
507
496
|
searchDisplay.value = selected.map((ss) => Object.nestValue(ss, sdFieldName))
|
package/index.js
CHANGED
|
@@ -71,8 +71,14 @@ const filters = {
|
|
|
71
71
|
case '.flv':
|
|
72
72
|
case '.mkv':
|
|
73
73
|
return `${config.videoUrlBase}${url}`;
|
|
74
|
-
|
|
74
|
+
case '.doc':
|
|
75
|
+
case '.docx':
|
|
76
|
+
case '.xls':
|
|
77
|
+
case '.xlsx':
|
|
78
|
+
case '.pdf':
|
|
75
79
|
return `${config.documentUrlBase}${url}`;
|
|
80
|
+
default:
|
|
81
|
+
return `${config.videoUrlBase}${url}`;
|
|
76
82
|
}
|
|
77
83
|
},
|
|
78
84
|
padding: (d, p = 2, c = '0') => {
|