@netang/quasar 0.1.83 → 0.1.85
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/field-table/index.vue +33 -32
- package/package.json +1 -1
- package/sass/common.scss +5 -0
|
@@ -664,10 +664,11 @@ export default {
|
|
|
664
664
|
* 加载已选数据
|
|
665
665
|
*/
|
|
666
666
|
async function loadSelected() {
|
|
667
|
-
|
|
668
667
|
if (
|
|
669
668
|
// 如果值类型不是数组对象
|
|
670
669
|
props.valueType !== 'objectArray'
|
|
670
|
+
// 如果初始加载已选数据
|
|
671
|
+
&& ! props.noDefaultLoadSelected
|
|
671
672
|
// 如果有请求路由路径
|
|
672
673
|
&& routePath
|
|
673
674
|
) {
|
|
@@ -689,7 +690,6 @@ export default {
|
|
|
689
690
|
// 触发更新值
|
|
690
691
|
emit('update:modelValue', _value)
|
|
691
692
|
}
|
|
692
|
-
|
|
693
693
|
// 初始化加载成功
|
|
694
694
|
emit('loaded', _selected)
|
|
695
695
|
return
|
|
@@ -778,41 +778,42 @@ export default {
|
|
|
778
778
|
return val
|
|
779
779
|
}
|
|
780
780
|
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
// 如果是有效数组
|
|
794
|
-
if ($n_isValidArray(val)) {
|
|
795
|
-
val = val.filter(e => $n_isValidValue(e))
|
|
796
|
-
if (val.length) {
|
|
797
|
-
const _selected = []
|
|
798
|
-
for (const item of props.defaultLoadSelected) {
|
|
799
|
-
if (
|
|
800
|
-
$n_has(item, props.valueKey)
|
|
801
|
-
&& $n_indexOf(val, item[props.valueKey]) > -1
|
|
802
|
-
) {
|
|
803
|
-
_selected.push($n_cloneDeep(item))
|
|
804
|
-
}
|
|
805
|
-
}
|
|
781
|
+
if (
|
|
782
|
+
// 如果初始化
|
|
783
|
+
isFirst
|
|
784
|
+
// 如果初始加载已选数据方法
|
|
785
|
+
&& ! props.noDefaultLoadSelected
|
|
786
|
+
// 如果有初始加载已选数据数组
|
|
787
|
+
&& props.defaultLoadSelected !== void 0
|
|
788
|
+
&& $n_isValidArray(props.defaultLoadSelected)
|
|
789
|
+
) {
|
|
790
|
+
// 将值转为数组
|
|
791
|
+
val = props.valueType === 'string' ? $n_split(val, props.valueSeparator) : val
|
|
806
792
|
|
|
807
|
-
|
|
793
|
+
// 如果是有效数组
|
|
794
|
+
if ($n_isValidArray(val)) {
|
|
795
|
+
val = val.filter(e => $n_isValidValue(e))
|
|
796
|
+
if (val.length) {
|
|
797
|
+
const _selected = []
|
|
798
|
+
for (const item of props.defaultLoadSelected) {
|
|
799
|
+
if (
|
|
800
|
+
$n_has(item, props.valueKey)
|
|
801
|
+
&& $n_indexOf(val, item[props.valueKey]) > -1
|
|
802
|
+
) {
|
|
803
|
+
_selected.push($n_cloneDeep(item))
|
|
804
|
+
}
|
|
808
805
|
}
|
|
806
|
+
|
|
807
|
+
return _selected
|
|
809
808
|
}
|
|
810
809
|
}
|
|
810
|
+
}
|
|
811
811
|
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
812
|
+
if (
|
|
813
|
+
// 非初始化
|
|
814
|
+
! isFirst
|
|
815
|
+
// 或初始不加载已选数据
|
|
816
|
+
|| props.noDefaultLoadSelected
|
|
816
817
|
// 或没有路由路径
|
|
817
818
|
|| ! routePath
|
|
818
819
|
) {
|
package/package.json
CHANGED