@fmdeui/fmui 1.0.167 → 1.0.168
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/es/packages/components/select-table/src/index2.vue.mjs +12 -16
- package/index.js +13 -17
- package/index.min.js +7 -7
- package/index.min.mjs +7 -7
- package/index.mjs +13 -17
- package/lib/packages/components/select-table/src/index2.vue.js +12 -16
- package/locale/en.js +1 -1
- package/locale/en.min.js +1 -1
- package/locale/en.min.mjs +1 -1
- package/locale/en.mjs +1 -1
- package/locale/zh-cn.js +1 -1
- package/locale/zh-cn.min.js +1 -1
- package/locale/zh-cn.min.mjs +1 -1
- package/locale/zh-cn.mjs +1 -1
- package/package.json +1 -1
- /package/es/{defaults.css → version.css} +0 -0
|
@@ -111,7 +111,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
111
111
|
const emits = __emit;
|
|
112
112
|
const slots = useSlots();
|
|
113
113
|
const isDefaultSelectVal = ref(true);
|
|
114
|
-
const forbidden = ref(true);
|
|
115
114
|
const isRadio = ref(false);
|
|
116
115
|
const isQueryVisible = ref(false);
|
|
117
116
|
const isVisible = ref(false);
|
|
@@ -144,7 +143,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
144
143
|
}
|
|
145
144
|
});
|
|
146
145
|
const state = reactive({
|
|
147
|
-
defaultSelectValue: props.defaultSelectVal,
|
|
146
|
+
defaultSelectValue: Array.isArray(props.defaultSelectVal) ? props.defaultSelectVal : props.defaultSelectVal ? [props.defaultSelectVal] : [],
|
|
148
147
|
// 默认选中
|
|
149
148
|
tableData: props.table.data,
|
|
150
149
|
// table数据
|
|
@@ -204,8 +203,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
204
203
|
watch(
|
|
205
204
|
() => props.defaultSelectVal,
|
|
206
205
|
(val) => {
|
|
207
|
-
|
|
208
|
-
|
|
206
|
+
const valArray = Array.isArray(val) ? val : val ? [val] : [];
|
|
207
|
+
state.defaultSelectValue = valArray;
|
|
208
|
+
if (valArray.length > 0) {
|
|
209
209
|
if (props.multiple) {
|
|
210
210
|
if (isDefaultSelectVal.value) {
|
|
211
211
|
defaultSelect(state.defaultSelectValue);
|
|
@@ -262,6 +262,11 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
262
262
|
const formatted = props.responseFormatter(res);
|
|
263
263
|
pagination.total = formatted.total;
|
|
264
264
|
state.tableData = formatted.data;
|
|
265
|
+
if (formatted.data && formatted.data.length > 0) {
|
|
266
|
+
formatted.data.forEach((item) => {
|
|
267
|
+
state.tabularMap[item[props.keywords.value]] = item[props.keywords.label];
|
|
268
|
+
});
|
|
269
|
+
}
|
|
265
270
|
if (props.useVirtual) {
|
|
266
271
|
saveDATA.value = formatted.data;
|
|
267
272
|
updateRenderData(scrollTopNum.value);
|
|
@@ -423,7 +428,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
423
428
|
nowIndex.value = -1;
|
|
424
429
|
radioVal.value = "";
|
|
425
430
|
isDefaultSelectVal.value = true;
|
|
426
|
-
forbidden.value = false;
|
|
427
431
|
}
|
|
428
432
|
};
|
|
429
433
|
const defaultSelect = (defaultSelectVal) => {
|
|
@@ -563,15 +567,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
563
567
|
isDefaultSelectVal.value = false;
|
|
564
568
|
radioClick(row, rowValue);
|
|
565
569
|
};
|
|
566
|
-
const isForbidden = () => {
|
|
567
|
-
forbidden.value = false;
|
|
568
|
-
setTimeout(() => {
|
|
569
|
-
forbidden.value = true;
|
|
570
|
-
}, 0);
|
|
571
|
-
};
|
|
572
570
|
const radioClick = (row, rowValue) => {
|
|
573
|
-
|
|
574
|
-
if (
|
|
571
|
+
const isAlreadySelected = state.defaultValue && state.defaultValue[props.keywords.value] === rowValue;
|
|
572
|
+
if (isAlreadySelected) {
|
|
575
573
|
if (!props.radioSameIsCancel) return;
|
|
576
574
|
clear();
|
|
577
575
|
} else {
|
|
@@ -585,7 +583,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
585
583
|
}
|
|
586
584
|
};
|
|
587
585
|
const updateState = (row, rowValue) => {
|
|
588
|
-
isForbidden();
|
|
589
586
|
radioVal.value = rowValue;
|
|
590
587
|
state.defaultValue = row;
|
|
591
588
|
emits("radioChange", row, rowValue);
|
|
@@ -639,7 +636,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
639
636
|
}
|
|
640
637
|
nowIndex.value = -1;
|
|
641
638
|
radioVal.value = "";
|
|
642
|
-
forbidden.value = false;
|
|
643
639
|
selectDefaultLabel.value = null;
|
|
644
640
|
resetDefaultState();
|
|
645
641
|
emits("radioChange", null, null);
|
|
@@ -824,7 +820,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
824
820
|
createVNode(_component_el_radio, {
|
|
825
821
|
modelValue: radioVal.value,
|
|
826
822
|
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => radioVal.value = $event),
|
|
827
|
-
label: scope.row[__props.keywords.
|
|
823
|
+
label: scope.row[__props.keywords.value],
|
|
828
824
|
value: scope.row[__props.keywords.value],
|
|
829
825
|
disabled: scope.row.isRadioDisabled,
|
|
830
826
|
onClick: withModifiers(($event) => radioChangeHandle($event, scope.row, scope.row[__props.keywords.value]), ["stop"])
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! fmdeui-fmui v1.0.
|
|
1
|
+
/*! fmdeui-fmui v1.0.168 */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vxe-table'), require('@vxe-ui/plugin-render-element'), require('@vxe-ui/plugin-export-xlsx'), require('vxe-pc-ui'), require('exceljs'), require('@element-plus/icons-vue'), require('vue'), require('element-plus'), require('lodash-es'), require('js-cookie'), require('pinia'), require('vue-router'), require('@vueuse/core'), require('crypto-js'), require('xlsx-js-style'), require('vue-i18n'), require('sortablejs'), require('screenfull'), require('push.js'), require('mitt'), require('@microsoft/signalr'), require('axios')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports', 'vxe-table', '@vxe-ui/plugin-render-element', '@vxe-ui/plugin-export-xlsx', 'vxe-pc-ui', 'exceljs', '@element-plus/icons-vue', 'vue', 'element-plus', 'lodash-es', 'js-cookie', 'pinia', 'vue-router', '@vueuse/core', 'crypto-js', 'xlsx-js-style', 'vue-i18n', 'sortablejs', 'screenfull', 'push.js', 'mitt', '@microsoft/signalr', 'axios'], factory) :
|
|
@@ -23154,7 +23154,6 @@
|
|
|
23154
23154
|
const emits = __emit;
|
|
23155
23155
|
const slots = vue.useSlots();
|
|
23156
23156
|
const isDefaultSelectVal = vue.ref(true);
|
|
23157
|
-
const forbidden = vue.ref(true);
|
|
23158
23157
|
const isRadio = vue.ref(false);
|
|
23159
23158
|
const isQueryVisible = vue.ref(false);
|
|
23160
23159
|
const isVisible = vue.ref(false);
|
|
@@ -23187,7 +23186,7 @@
|
|
|
23187
23186
|
}
|
|
23188
23187
|
});
|
|
23189
23188
|
const state = vue.reactive({
|
|
23190
|
-
defaultSelectValue: props.defaultSelectVal,
|
|
23189
|
+
defaultSelectValue: Array.isArray(props.defaultSelectVal) ? props.defaultSelectVal : props.defaultSelectVal ? [props.defaultSelectVal] : [],
|
|
23191
23190
|
// 默认选中
|
|
23192
23191
|
tableData: props.table.data,
|
|
23193
23192
|
// table数据
|
|
@@ -23247,8 +23246,9 @@
|
|
|
23247
23246
|
vue.watch(
|
|
23248
23247
|
() => props.defaultSelectVal,
|
|
23249
23248
|
(val) => {
|
|
23250
|
-
|
|
23251
|
-
|
|
23249
|
+
const valArray = Array.isArray(val) ? val : val ? [val] : [];
|
|
23250
|
+
state.defaultSelectValue = valArray;
|
|
23251
|
+
if (valArray.length > 0) {
|
|
23252
23252
|
if (props.multiple) {
|
|
23253
23253
|
if (isDefaultSelectVal.value) {
|
|
23254
23254
|
defaultSelect(state.defaultSelectValue);
|
|
@@ -23305,6 +23305,11 @@
|
|
|
23305
23305
|
const formatted = props.responseFormatter(res);
|
|
23306
23306
|
pagination.total = formatted.total;
|
|
23307
23307
|
state.tableData = formatted.data;
|
|
23308
|
+
if (formatted.data && formatted.data.length > 0) {
|
|
23309
|
+
formatted.data.forEach((item) => {
|
|
23310
|
+
state.tabularMap[item[props.keywords.value]] = item[props.keywords.label];
|
|
23311
|
+
});
|
|
23312
|
+
}
|
|
23308
23313
|
if (props.useVirtual) {
|
|
23309
23314
|
saveDATA.value = formatted.data;
|
|
23310
23315
|
updateRenderData(scrollTopNum.value);
|
|
@@ -23466,7 +23471,6 @@
|
|
|
23466
23471
|
nowIndex.value = -1;
|
|
23467
23472
|
radioVal.value = "";
|
|
23468
23473
|
isDefaultSelectVal.value = true;
|
|
23469
|
-
forbidden.value = false;
|
|
23470
23474
|
}
|
|
23471
23475
|
};
|
|
23472
23476
|
const defaultSelect = (defaultSelectVal) => {
|
|
@@ -23606,15 +23610,9 @@
|
|
|
23606
23610
|
isDefaultSelectVal.value = false;
|
|
23607
23611
|
radioClick(row, rowValue);
|
|
23608
23612
|
};
|
|
23609
|
-
const isForbidden = () => {
|
|
23610
|
-
forbidden.value = false;
|
|
23611
|
-
setTimeout(() => {
|
|
23612
|
-
forbidden.value = true;
|
|
23613
|
-
}, 0);
|
|
23614
|
-
};
|
|
23615
23613
|
const radioClick = (row, rowValue) => {
|
|
23616
|
-
|
|
23617
|
-
if (
|
|
23614
|
+
const isAlreadySelected = state.defaultValue && state.defaultValue[props.keywords.value] === rowValue;
|
|
23615
|
+
if (isAlreadySelected) {
|
|
23618
23616
|
if (!props.radioSameIsCancel) return;
|
|
23619
23617
|
clear();
|
|
23620
23618
|
} else {
|
|
@@ -23628,7 +23626,6 @@
|
|
|
23628
23626
|
}
|
|
23629
23627
|
};
|
|
23630
23628
|
const updateState = (row, rowValue) => {
|
|
23631
|
-
isForbidden();
|
|
23632
23629
|
radioVal.value = rowValue;
|
|
23633
23630
|
state.defaultValue = row;
|
|
23634
23631
|
emits("radioChange", row, rowValue);
|
|
@@ -23682,7 +23679,6 @@
|
|
|
23682
23679
|
}
|
|
23683
23680
|
nowIndex.value = -1;
|
|
23684
23681
|
radioVal.value = "";
|
|
23685
|
-
forbidden.value = false;
|
|
23686
23682
|
selectDefaultLabel.value = null;
|
|
23687
23683
|
resetDefaultState();
|
|
23688
23684
|
emits("radioChange", null, null);
|
|
@@ -23867,7 +23863,7 @@
|
|
|
23867
23863
|
vue.createVNode(_component_el_radio, {
|
|
23868
23864
|
modelValue: radioVal.value,
|
|
23869
23865
|
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => radioVal.value = $event),
|
|
23870
|
-
label: scope.row[__props.keywords.
|
|
23866
|
+
label: scope.row[__props.keywords.value],
|
|
23871
23867
|
value: scope.row[__props.keywords.value],
|
|
23872
23868
|
disabled: scope.row.isRadioDisabled,
|
|
23873
23869
|
onClick: vue.withModifiers(($event) => radioChangeHandle($event, scope.row, scope.row[__props.keywords.value]), ["stop"])
|