cnhis-design-vue 2.1.116 → 2.1.119
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/CHANGELOG.md +49 -13
- package/es/affix/index.js +8 -8
- package/es/age/index.js +10 -10
- package/es/alert/index.js +8 -8
- package/es/anchor/index.js +8 -8
- package/es/auto-complete/index.js +8 -8
- package/es/avatar/index.js +8 -8
- package/es/back-top/index.js +8 -8
- package/es/badge/index.js +8 -8
- package/es/base/index.js +8 -8
- package/es/big-table/index.js +3813 -3631
- package/es/big-table/style.css +1 -1
- package/es/breadcrumb/index.js +8 -8
- package/es/button/index.js +22 -22
- package/es/calendar/index.js +8 -8
- package/es/captcha/index.js +3 -3
- package/es/card/index.js +8 -8
- package/es/card-reader-sdk/index.js +1 -1
- package/es/carousel/index.js +8 -8
- package/es/cascader/index.js +8 -8
- package/es/checkbox/index.js +9 -9
- package/es/col/index.js +8 -8
- package/es/collapse/index.js +8 -8
- package/es/color-picker/index.js +1 -1
- package/es/comment/index.js +8 -8
- package/es/config-provider/index.js +8 -8
- package/es/date-picker/index.js +8 -8
- package/es/descriptions/index.js +8 -8
- package/es/direct/index.js +16 -16
- package/es/divider/index.js +8 -8
- package/es/drag-layout/index.js +3 -3
- package/es/drawer/index.js +8 -8
- package/es/dropdown/index.js +8 -8
- package/es/editor/index.js +1 -1
- package/es/ellipsis/index.js +1 -1
- package/es/empty/index.js +8 -8
- package/es/fabric-chart/index.js +573 -75
- package/es/fabric-chart/style.css +1 -1
- package/es/form/index.js +8 -8
- package/es/form-model/index.js +8 -8
- package/es/form-table/index.js +66 -66
- package/es/full-calendar/index.js +436 -513
- package/es/full-calendar/style.css +1 -1
- package/es/index/index.js +2677 -1881
- package/es/index/style.css +1 -1
- package/es/input/index.js +9 -9
- package/es/input-number/index.js +8 -8
- package/es/layout/index.js +8 -8
- package/es/list/index.js +8 -8
- package/es/locale-provider/index.js +8 -8
- package/es/map/index.js +9 -9
- package/es/mentions/index.js +8 -8
- package/es/menu/index.js +8 -8
- package/es/message/index.js +8 -8
- package/es/multi-chat/index.js +76 -76
- package/es/multi-chat-client/index.js +70 -70
- package/es/multi-chat-history/index.js +4 -4
- package/es/multi-chat-record/index.js +14 -14
- package/es/multi-chat-setting/index.js +22 -22
- package/es/multi-chat-sip/index.js +1 -1
- package/es/notification/index.js +8 -8
- package/es/page-header/index.js +8 -8
- package/es/pagination/index.js +8 -8
- package/es/popconfirm/index.js +8 -8
- package/es/popover/index.js +8 -8
- package/es/progress/index.js +8 -8
- package/es/radio/index.js +9 -9
- package/es/rate/index.js +8 -8
- package/es/result/index.js +8 -8
- package/es/row/index.js +8 -8
- package/es/scale-container/index.js +1 -1
- package/es/scale-view/index.js +27 -27
- package/es/select/index.js +12 -12
- package/es/select-label/index.js +11 -11
- package/es/select-person/index.js +2 -2
- package/es/select-tag/index.js +4 -4
- package/es/shortcut-setter/index.js +10 -10
- package/es/skeleton/index.js +8 -8
- package/es/slider/index.js +8 -8
- package/es/slider-tree/index.js +9 -9
- package/es/space/index.js +8 -8
- package/es/spin/index.js +8 -8
- package/es/statistic/index.js +8 -8
- package/es/steps/index.js +8 -8
- package/es/switch/index.js +8 -8
- package/es/table-filter/index.js +480 -301
- package/es/table-filter/style.css +1 -1
- package/es/tabs/index.js +8 -8
- package/es/tag/index.js +9 -9
- package/es/time-picker/index.js +8 -8
- package/es/timeline/index.js +8 -8
- package/es/tooltip/index.js +8 -8
- package/es/transfer/index.js +8 -8
- package/es/tree/index.js +8 -8
- package/es/tree-select/index.js +8 -8
- package/es/upload/index.js +8 -8
- package/es/verification-code/index.js +2 -2
- package/lib/cui.common.js +43341 -21890
- package/lib/cui.umd.js +43341 -21890
- package/lib/cui.umd.min.js +82 -82
- package/package.json +1 -1
- package/packages/big-table/src/BigTable.vue +30 -433
- package/packages/big-table/src/utils/bigTableProps.js +3 -1
- package/packages/big-table/src/utils/headerFilter.js +494 -0
- package/packages/button/src/ButtonPrint/js/print.es.min.js +3 -3
- package/packages/fabric-chart/src/FabricChart.vue +1 -1
- package/packages/fabric-chart/src/fabric-chart/FabricLines.vue +6 -6
- package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +6 -6
- package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +14 -10
- package/packages/fabric-chart/src/mixins/draw.js +97 -1
- package/packages/fabric-chart/src/mixins/drawExtracorporealCirculation.js +196 -0
- package/packages/fabric-chart/src/mixins/fabricCommon.js +1 -1
- package/packages/fabric-chart/src/utils/index.js +81 -0
- package/packages/full-calendar/src/FullCalendar.vue +96 -60
- package/packages/full-calendar/src/components/Tag.vue +3 -3
- package/packages/full-calendar/src/components/TagDetail.vue +3 -3
- package/packages/full-calendar/src/utils/index.js +14 -0
- package/packages/table-filter/src/base-search-com/BaseSearch.vue +1 -0
- package/packages/table-filter/src/components/multi-select/multi-select.vue +1 -1
- package/packages/table-filter/src/components/render-widget/components/SelectDynamic.vue +1 -1
- package/packages/table-filter/src/components/render-widget/index.vue +2 -2
- package/packages/table-filter/src/components/render-widget/widgetCfgMaps.js +41 -38
- package/packages/table-filter/src/mixins/mixins.js +100 -17
- package/packages/table-filter/src/quick-search/QuickSearch.vue +38 -33
- package/packages/fabric-chart/src/mixins/type.js +0 -6
package/package.json
CHANGED
|
@@ -158,11 +158,12 @@ import DomPortal from 'vue-dom-portal';
|
|
|
158
158
|
import create from '@/core/create';
|
|
159
159
|
|
|
160
160
|
let hideAllWrap = null;
|
|
161
|
-
|
|
161
|
+
|
|
162
162
|
import { GROUP_TITLE_KEY } from '@/global/variable';
|
|
163
163
|
|
|
164
164
|
import batchEditing from './utils/batchEditing';
|
|
165
165
|
import checkStrictly from './utils/checkStrictly';
|
|
166
|
+
import headerFilter from './utils/headerFilter';
|
|
166
167
|
import EditForm from './components/edit-form/EditForm.vue';
|
|
167
168
|
|
|
168
169
|
import nestTable from './utils/nestTable';
|
|
@@ -170,18 +171,7 @@ import eventBroadcast from './utils/eventBroadcast';
|
|
|
170
171
|
import bigTableProps from './utils/bigTableProps';
|
|
171
172
|
import SvgIcon from '@/component/svg/index.vue';
|
|
172
173
|
import cloneDeep from 'lodash/cloneDeep';
|
|
173
|
-
|
|
174
|
-
large: 28,
|
|
175
|
-
medium: 24,
|
|
176
|
-
small: 22,
|
|
177
|
-
extrasmall: 20
|
|
178
|
-
}
|
|
179
|
-
const fontSizeMap = {
|
|
180
|
-
large: 1.25,
|
|
181
|
-
medium: 1.1,
|
|
182
|
-
small: 1,
|
|
183
|
-
extrasmall: 0.9
|
|
184
|
-
}
|
|
174
|
+
|
|
185
175
|
let addInlineEditPrimaryKey = '';
|
|
186
176
|
export default create({
|
|
187
177
|
name: 'big-table',
|
|
@@ -203,7 +193,7 @@ export default create({
|
|
|
203
193
|
SvgIcon,
|
|
204
194
|
AutoLayoutButton
|
|
205
195
|
},
|
|
206
|
-
mixins: [format, batchEditing, nestTable, eventBroadcast, checkStrictly],
|
|
196
|
+
mixins: [format, batchEditing, nestTable, eventBroadcast, checkStrictly, headerFilter],
|
|
207
197
|
props: Object.assign({}, bigTableProps),
|
|
208
198
|
beforeCreate() {
|
|
209
199
|
Vue.use(Button)
|
|
@@ -1460,9 +1450,10 @@ export default create({
|
|
|
1460
1450
|
// showOperatorColumn = hasOnlyIcon;
|
|
1461
1451
|
// }
|
|
1462
1452
|
this.fieldKeyMap = {};
|
|
1453
|
+
this.handlerInitSqlSearchItem(fieldList);
|
|
1463
1454
|
const currentColumns = fieldList.map((item, index) => {
|
|
1464
1455
|
this.fieldKeyMap[item.columnName] = item;
|
|
1465
|
-
|
|
1456
|
+
const { filterField } = item.filterSettingMap || {}
|
|
1466
1457
|
// 是否排序 1 不可排序
|
|
1467
1458
|
let notParticipatingSort = item?.fieldSetting?.notParticipatingSort || '';
|
|
1468
1459
|
// 有子列表fixed会遮盖 所以主表不设置fixed,子表可设置
|
|
@@ -1510,7 +1501,9 @@ export default create({
|
|
|
1510
1501
|
editRender: this.generateEditRender(item)
|
|
1511
1502
|
});
|
|
1512
1503
|
|
|
1513
|
-
|
|
1504
|
+
const isFilterField = filterField && !this.isNestTable && !isScanMultiTable && !this.isTableEdit
|
|
1505
|
+
|
|
1506
|
+
if (isFilterField) {
|
|
1514
1507
|
this.$set(
|
|
1515
1508
|
this.filterFields,
|
|
1516
1509
|
item.columnName,
|
|
@@ -1526,8 +1519,6 @@ export default create({
|
|
|
1526
1519
|
filterSort: ''
|
|
1527
1520
|
})
|
|
1528
1521
|
);
|
|
1529
|
-
let field = this.filterFields[item.columnName];
|
|
1530
|
-
this.handlerInitSearchItem([field]);
|
|
1531
1522
|
col.slots.header = this.formatterHeader(item);
|
|
1532
1523
|
} else {
|
|
1533
1524
|
col.slots.header = this.toolTipTitle(item);
|
|
@@ -1629,7 +1620,6 @@ export default create({
|
|
|
1629
1620
|
// 表头没有过滤字段 不需要设置
|
|
1630
1621
|
if (!this.filterFields || !Object.keys(this.filterFields).length) return;
|
|
1631
1622
|
let val = this.quickSearchConfig;
|
|
1632
|
-
|
|
1633
1623
|
if (!val || !val.length) {
|
|
1634
1624
|
let keys = Object.keys(this.filterFields);
|
|
1635
1625
|
keys.forEach(key => {
|
|
@@ -1644,198 +1634,19 @@ export default create({
|
|
|
1644
1634
|
}
|
|
1645
1635
|
|
|
1646
1636
|
val.forEach(item => {
|
|
1647
|
-
let itemKey = item.field_key;
|
|
1637
|
+
let itemKey = this.isApiTable ? this.apiFilterMap[item.field_key] : item.field_key;
|
|
1648
1638
|
// 参与搜索的字段必须在 filterFields中
|
|
1649
1639
|
if (itemKey in this.filterFields) {
|
|
1650
|
-
if (!this.filterFields[
|
|
1651
|
-
this.$set(this.filterFields[
|
|
1640
|
+
if (!this.filterFields[itemKey]) {
|
|
1641
|
+
this.$set(this.filterFields[itemKey], 'CONVERT', []);
|
|
1652
1642
|
return false;
|
|
1653
1643
|
}
|
|
1654
1644
|
|
|
1655
|
-
let value = item.value.map(item => JSON.stringify(item));
|
|
1656
|
-
this.$set(this.filterFields[
|
|
1645
|
+
let value = this.isApiTable ? item.value : item.value.map(item => JSON.stringify(item));
|
|
1646
|
+
this.$set(this.filterFields[itemKey], 'CONVERT', value);
|
|
1657
1647
|
}
|
|
1658
1648
|
});
|
|
1659
1649
|
},
|
|
1660
|
-
handlerInitSearchItem(arr) {
|
|
1661
|
-
if (!Array.isArray(arr)) return;
|
|
1662
|
-
arr.forEach(el => {
|
|
1663
|
-
if (el.setting) {
|
|
1664
|
-
// el.seting 可能是 string / object
|
|
1665
|
-
el.setting = typeof el.setting == 'string' ? JSON.parse(el.setting) : el.setting;
|
|
1666
|
-
if (!vexutils.isEmpty(el.setting.wordbook)) {
|
|
1667
|
-
this.$set(el, 'con', 'QUOTE');
|
|
1668
|
-
this.$set(el, 'dataSource', []);
|
|
1669
|
-
this.$set(el, 'QUOTE', []);
|
|
1670
|
-
return;
|
|
1671
|
-
} else if (el.setting.showSetting && el.setting.showSetting.length > 0) {
|
|
1672
|
-
this.$set(el, 'con', 'CONVERT');
|
|
1673
|
-
el.setting.showSetting.forEach(set => {
|
|
1674
|
-
this.$set(set, 'label', set.change_text);
|
|
1675
|
-
this.$set(set, 'value', JSON.stringify(set.filter));
|
|
1676
|
-
});
|
|
1677
|
-
this.$set(el, 'CONVERT', []);
|
|
1678
|
-
return;
|
|
1679
|
-
}
|
|
1680
|
-
}
|
|
1681
|
-
if (el.fieldType.includes('DATE')) {
|
|
1682
|
-
if (el.settingObj && el.settingObj.attr == 'BIRTHDAY') {
|
|
1683
|
-
this.$set(el, 'con', 'BIRTHDAY');
|
|
1684
|
-
this.$set(el, 'showDate', false);
|
|
1685
|
-
this.$set(el, 'marginx', 'ml');
|
|
1686
|
-
this.$set(el, 'BIRTHDAY', this.initBirthdayParams());
|
|
1687
|
-
} else {
|
|
1688
|
-
this.$set(el, 'con', 'DATE');
|
|
1689
|
-
this.$set(el, 'showDate', false);
|
|
1690
|
-
this.$set(el, 'marginx', 'ml');
|
|
1691
|
-
this.$set(el, 'DATE', {
|
|
1692
|
-
con: null,
|
|
1693
|
-
start_val: null,
|
|
1694
|
-
end_val: null
|
|
1695
|
-
});
|
|
1696
|
-
}
|
|
1697
|
-
} else if (el.fieldType == 'TEXT') {
|
|
1698
|
-
this.$set(el, 'con', 'CL');
|
|
1699
|
-
this.$set(el, 'CL', '');
|
|
1700
|
-
} else if (el.fieldType == 'NUMBER') {
|
|
1701
|
-
this.$set(el, 'con', 'EQ');
|
|
1702
|
-
this.$set(el, 'EQ', '');
|
|
1703
|
-
} else if (el.fieldType == 'JSONB') {
|
|
1704
|
-
this.$set(el, 'con', 'EQ');
|
|
1705
|
-
this.$set(el, 'EQ', '');
|
|
1706
|
-
}
|
|
1707
|
-
if (el.setting.attr === 'LABEL') {
|
|
1708
|
-
this.$set(el, 'con', 'EQ');
|
|
1709
|
-
this.$set(el, 'LABELAttr', true);
|
|
1710
|
-
this.$set(el, 'labelSelectList', []);
|
|
1711
|
-
this.handleSetLabelOptions(el.setting.labelType, el);
|
|
1712
|
-
}
|
|
1713
|
-
if (el.setting.attr === 'EVALUATE') {
|
|
1714
|
-
this.$set(el, 'con', 'CL');
|
|
1715
|
-
this.$set(el, 'selecteds', []);
|
|
1716
|
-
this.$set(el, 'EVALUATEAttr', true);
|
|
1717
|
-
}
|
|
1718
|
-
});
|
|
1719
|
-
},
|
|
1720
|
-
// 格式化设置搜索条件参数
|
|
1721
|
-
getConObj(arr) {
|
|
1722
|
-
// this.quickSearch
|
|
1723
|
-
if (!Array.isArray(arr)) {
|
|
1724
|
-
return [];
|
|
1725
|
-
}
|
|
1726
|
-
let conObj = [];
|
|
1727
|
-
for (let i = 0; i < arr.length; i++) {
|
|
1728
|
-
let item = arr[i];
|
|
1729
|
-
let value = '';
|
|
1730
|
-
let limit_date = '';
|
|
1731
|
-
if (item.EQ || item.CL) {
|
|
1732
|
-
value = item.EQ || item.CL;
|
|
1733
|
-
if (item.settingObj?.attr === 'PERCENTAGE') {
|
|
1734
|
-
value = Number(value) / 100;
|
|
1735
|
-
}
|
|
1736
|
-
if (item.EVALUATEAttr) {
|
|
1737
|
-
value = item.selecteds.join('|#|');
|
|
1738
|
-
}
|
|
1739
|
-
} else if (!vexutils.isEmpty(item.QUOTE)) {
|
|
1740
|
-
value = item.QUOTE.join('|#|');
|
|
1741
|
-
} else if (!vexutils.isEmpty(item.CONVERT)) {
|
|
1742
|
-
value = item.CONVERT.map(item => JSON.parse(item));
|
|
1743
|
-
} else if (item.DATE) {
|
|
1744
|
-
if (item.DATE.start_val || item.DATE.end_val) {
|
|
1745
|
-
item.DATE.con = 'IN';
|
|
1746
|
-
}
|
|
1747
|
-
item.tempCon = item.DATE.con;
|
|
1748
|
-
item.start_val = item.DATE.start_val ? item.DATE.start_val.format('YYYY-MM-DD HH:mm:ss') : '';
|
|
1749
|
-
item.end_val = item.DATE.end_val ? item.DATE.end_val.format('YYYY-MM-DD HH:mm:ss') : '';
|
|
1750
|
-
} else if (item.BIRTHDAY) {
|
|
1751
|
-
// 生日
|
|
1752
|
-
let isChange = false;
|
|
1753
|
-
if (item.BIRTHDAY.limit_date.length > 0 || item.BIRTHDAY.start_val || item.BIRTHDAY.end_val) {
|
|
1754
|
-
item.BIRTHDAY.con = 'IN';
|
|
1755
|
-
}
|
|
1756
|
-
item.tempCon = item.BIRTHDAY.con;
|
|
1757
|
-
// 因为年龄下拉有个默认值, 当输入框中有值时才取下拉值
|
|
1758
|
-
if (item.BIRTHDAY.start_val || item.BIRTHDAY.end_val) {
|
|
1759
|
-
isChange = true;
|
|
1760
|
-
} else {
|
|
1761
|
-
isChange = false;
|
|
1762
|
-
}
|
|
1763
|
-
|
|
1764
|
-
// 校验
|
|
1765
|
-
if (item.BIRTHDAY.start_val) {
|
|
1766
|
-
let res = vexutils.validateBirthday(item.BIRTHDAY.start_val, item.title, item.BIRTHDAY.unit);
|
|
1767
|
-
if (!res) return;
|
|
1768
|
-
}
|
|
1769
|
-
if (item.BIRTHDAY.end_val) {
|
|
1770
|
-
let res = vexutils.validateBirthday(item.BIRTHDAY.end_val, item.title, item.BIRTHDAY.unit);
|
|
1771
|
-
if (!res) return;
|
|
1772
|
-
}
|
|
1773
|
-
if (+item.BIRTHDAY.start_val > +item.BIRTHDAY.end_val) {
|
|
1774
|
-
this.$message.warning(`${item.title}请输入有效范围`, 2);
|
|
1775
|
-
return;
|
|
1776
|
-
}
|
|
1777
|
-
|
|
1778
|
-
limit_date = this.limit_date || '';
|
|
1779
|
-
item.unit = isChange ? item.BIRTHDAY.unit || '' : '';
|
|
1780
|
-
item.start_val = item.BIRTHDAY.start_val || '';
|
|
1781
|
-
item.end_val = item.BIRTHDAY.end_val || '';
|
|
1782
|
-
} else if (item.LABELAttr) {
|
|
1783
|
-
let valList = [];
|
|
1784
|
-
item.labelSelectList.forEach(v => {
|
|
1785
|
-
valList.push(v.labelName);
|
|
1786
|
-
});
|
|
1787
|
-
value = valList.join('|#|');
|
|
1788
|
-
} else if (item.EVALUATEAttr) {
|
|
1789
|
-
value = item.selecteds.join('|#|');
|
|
1790
|
-
}
|
|
1791
|
-
let temp = {
|
|
1792
|
-
field_key: item.columnName, // 一级value
|
|
1793
|
-
con: item.DATE || item.BIRTHDAY ? item.tempCon : item.con, // 二级选择项value
|
|
1794
|
-
value: value, // input输入值
|
|
1795
|
-
limit_date: limit_date || '', // 生日
|
|
1796
|
-
start_val: item.start_val || '', // 开始时间
|
|
1797
|
-
end_val: item.end_val || '', // 结束时间
|
|
1798
|
-
unit: item.unit || '' // 年龄
|
|
1799
|
-
};
|
|
1800
|
-
conObj.push(temp);
|
|
1801
|
-
}
|
|
1802
|
-
// let dateCons = this.dateTeam.map(item => item.con);
|
|
1803
|
-
let res = conObj.filter(
|
|
1804
|
-
item => item.value || item.limit_date || item.start_val || item.end_val
|
|
1805
|
-
// dateCons.includes(item.con)
|
|
1806
|
-
);
|
|
1807
|
-
return res;
|
|
1808
|
-
},
|
|
1809
|
-
mergeConObjFn() {
|
|
1810
|
-
let fields = Object.values(this.filterFields);
|
|
1811
|
-
let fieldkeys = Object.keys(this.filterFields);
|
|
1812
|
-
let conObj = this.getConObj(fields);
|
|
1813
|
-
let mergeConObj = [...conObj];
|
|
1814
|
-
let qqConObj = this.tableParams.qqConObj ? JSON.parse(this.tableParams.qqConObj) : [];
|
|
1815
|
-
|
|
1816
|
-
qqConObj.forEach(i => {
|
|
1817
|
-
if (!fieldkeys.includes(i.field_key)) {
|
|
1818
|
-
mergeConObj.push(i);
|
|
1819
|
-
}
|
|
1820
|
-
});
|
|
1821
|
-
|
|
1822
|
-
return mergeConObj;
|
|
1823
|
-
},
|
|
1824
|
-
handleFilter(field) {
|
|
1825
|
-
let conObj = this.mergeConObjFn();
|
|
1826
|
-
this.$emit('onSave', conObj, false, [], [], { isBigTable: true });
|
|
1827
|
-
field.visible = false;
|
|
1828
|
-
},
|
|
1829
|
-
handleCancelFilter() {
|
|
1830
|
-
this.hideFilterWrap();
|
|
1831
|
-
},
|
|
1832
|
-
handleFilterEmpty(field, columnName) {
|
|
1833
|
-
this.filterFields[columnName].CONVERT = [];
|
|
1834
|
-
let conObj = this.mergeConObjFn();
|
|
1835
|
-
|
|
1836
|
-
this.$emit('onSave', conObj, false, [], [], { isBigTable: true });
|
|
1837
|
-
field.visible = false;
|
|
1838
|
-
},
|
|
1839
1650
|
handleCommonTooltipTitle(item, type) {
|
|
1840
1651
|
let name = item.formTitle || item.alias || item.title;
|
|
1841
1652
|
let tooltipTitle = item.alias;
|
|
@@ -1893,6 +1704,7 @@ export default create({
|
|
|
1893
1704
|
// 表头渲染逻辑
|
|
1894
1705
|
formatterHeader(item) {
|
|
1895
1706
|
let field = this.filterFields[item.columnName];
|
|
1707
|
+
const {showfilterSearch, showSelectAll, filterOptions} = field.filterSettingMap || {}
|
|
1896
1708
|
return () => {
|
|
1897
1709
|
return [
|
|
1898
1710
|
<div class="filter-box">
|
|
@@ -1928,7 +1740,7 @@ export default create({
|
|
|
1928
1740
|
<span class="filter-header-text">筛选</span>
|
|
1929
1741
|
</div>
|
|
1930
1742
|
|
|
1931
|
-
{
|
|
1743
|
+
{showfilterSearch ? (
|
|
1932
1744
|
<div class="checkbox-wrap checkbox-wrap--search">
|
|
1933
1745
|
<div class="check-search-wrap">
|
|
1934
1746
|
<a-input-search
|
|
@@ -1945,7 +1757,7 @@ export default create({
|
|
|
1945
1757
|
)}
|
|
1946
1758
|
<div class="checkbox-box">
|
|
1947
1759
|
<div class="checkbox-wrap js-checkbox-wrap" style={{ height: this.filterHeight + this.distance + 'px' }}>
|
|
1948
|
-
{
|
|
1760
|
+
{showSelectAll ? (
|
|
1949
1761
|
<div class="ant-checkbox-group">
|
|
1950
1762
|
<a-checkbox
|
|
1951
1763
|
indeterminate={field.indeterminate}
|
|
@@ -1962,14 +1774,10 @@ export default create({
|
|
|
1962
1774
|
)}
|
|
1963
1775
|
|
|
1964
1776
|
{!field.searchFilterText ? (
|
|
1965
|
-
<a-checkbox-group options={
|
|
1777
|
+
<a-checkbox-group options={filterOptions} value={field.CONVERT} onChange={val => this.handleFilterChange(val, item.columnName, field)} />
|
|
1966
1778
|
) : (
|
|
1967
1779
|
<a-checkbox-group
|
|
1968
|
-
options={
|
|
1969
|
-
if (!field.searchFilterText) return item;
|
|
1970
|
-
let reg = new RegExp(field.searchFilterText);
|
|
1971
|
-
return reg.test(item.label);
|
|
1972
|
-
})}
|
|
1780
|
+
options={filterOptions}
|
|
1973
1781
|
value={field.searchFilterCONVERT}
|
|
1974
1782
|
onChange={val => this.handleFilterSearchChange(val, item.columnName, field)}
|
|
1975
1783
|
/>
|
|
@@ -2009,205 +1817,6 @@ export default create({
|
|
|
2009
1817
|
];
|
|
2010
1818
|
};
|
|
2011
1819
|
},
|
|
2012
|
-
onmousedownFunc(e) {
|
|
2013
|
-
this.startX = e.screenX;
|
|
2014
|
-
this.maskInsert();
|
|
2015
|
-
},
|
|
2016
|
-
maskInsert() {
|
|
2017
|
-
let mask = this.mask || this.maskCreate();
|
|
2018
|
-
document.body.appendChild(mask);
|
|
2019
|
-
},
|
|
2020
|
-
maskCreate() {
|
|
2021
|
-
if (this.mask) return this.mask;
|
|
2022
|
-
const mask = document.createElement('div');
|
|
2023
|
-
mask.style = 'position:fixed;top:0;bottom:0;left:0;right:0;z-index:99999;cursor:nw-resize';
|
|
2024
|
-
mask.addEventListener('mousemove', this.maskMove);
|
|
2025
|
-
mask.addEventListener('mouseup', this.maskUp);
|
|
2026
|
-
this.mask = mask;
|
|
2027
|
-
return mask;
|
|
2028
|
-
},
|
|
2029
|
-
maskMove(e) {
|
|
2030
|
-
this.distance = parseInt(e.screenX - this.startX);
|
|
2031
|
-
},
|
|
2032
|
-
maskUp(e) {
|
|
2033
|
-
this.filterHeight = this.filterHeight + this.distance;
|
|
2034
|
-
this.filterWidth = this.filterWidth + this.distance;
|
|
2035
|
-
this.distance = 0;
|
|
2036
|
-
this.startX = 0;
|
|
2037
|
-
const mask = this.mask;
|
|
2038
|
-
if (!mask) return;
|
|
2039
|
-
mask.parentNode && mask.parentNode.removeChild(mask);
|
|
2040
|
-
mask.removeEventListener('mousemove', this.maskMove);
|
|
2041
|
-
mask.removeEventListener('mouseup', this.maskUp);
|
|
2042
|
-
this.mask = null;
|
|
2043
|
-
},
|
|
2044
|
-
handlefilterBoxClickSort(sort, field) {
|
|
2045
|
-
if (field.filterSort === sort) {
|
|
2046
|
-
sort = null;
|
|
2047
|
-
} else {
|
|
2048
|
-
this.$refs.xGrid.clearSort();
|
|
2049
|
-
}
|
|
2050
|
-
|
|
2051
|
-
field.filterSort = sort;
|
|
2052
|
-
field.visible = false;
|
|
2053
|
-
this.$emit('sortChange', { prop: field.columnName, order: sort });
|
|
2054
|
-
},
|
|
2055
|
-
handleFilterSeach(val, field) {
|
|
2056
|
-
field.searchFilterText = val;
|
|
2057
|
-
|
|
2058
|
-
if (val === '') {
|
|
2059
|
-
field.checkAll = field.CONVERT.length === field.setting.showSetting.length;
|
|
2060
|
-
field.indeterminate = !!field.CONVERT.length && field.CONVERT.length !== field.setting.showSetting.length;
|
|
2061
|
-
return;
|
|
2062
|
-
}
|
|
2063
|
-
|
|
2064
|
-
field.searchFilterCONVERT = field.setting.showSetting
|
|
2065
|
-
.filter(item => {
|
|
2066
|
-
return field.searchFilterText === item.label && field.CONVERT.includes(item.value);
|
|
2067
|
-
})
|
|
2068
|
-
.map(item => item.value);
|
|
2069
|
-
|
|
2070
|
-
beforeSearchConvert = field.searchFilterCONVERT;
|
|
2071
|
-
},
|
|
2072
|
-
handleFilterChangeAll(e, field) {
|
|
2073
|
-
this.reScrollFilterWrap();
|
|
2074
|
-
let checked = e.target.checked;
|
|
2075
|
-
field.indeterminate = false;
|
|
2076
|
-
field.checkAll = checked;
|
|
2077
|
-
|
|
2078
|
-
this.filterFields[field.columnName].CONVERT = checked
|
|
2079
|
-
? field.setting.showSetting.map(item => {
|
|
2080
|
-
return item.value;
|
|
2081
|
-
})
|
|
2082
|
-
: [];
|
|
2083
|
-
},
|
|
2084
|
-
handleFilterClearAll(field) {
|
|
2085
|
-
field.indeterminate = false;
|
|
2086
|
-
field.checkAll = false;
|
|
2087
|
-
this.filterFields[field.columnName].CONVERT = [];
|
|
2088
|
-
if (field.searchFilterCONVERT) {
|
|
2089
|
-
this.filterFields[field.columnName].searchFilterCONVERT = [];
|
|
2090
|
-
}
|
|
2091
|
-
this.handleFilter(field);
|
|
2092
|
-
},
|
|
2093
|
-
reScrollFilterWrap() {
|
|
2094
|
-
let filterWrapEl = document.querySelectorAll('.big-table-filter-wrap');
|
|
2095
|
-
let checkboxWrapEl = filterWrapEl[filterWrapEl.length - 1].querySelector('.js-checkbox-wrap');
|
|
2096
|
-
|
|
2097
|
-
let tableScrollTop = checkboxWrapEl.scrollTop;
|
|
2098
|
-
|
|
2099
|
-
this.$nextTick(() => {
|
|
2100
|
-
checkboxWrapEl.scrollTop = tableScrollTop;
|
|
2101
|
-
});
|
|
2102
|
-
},
|
|
2103
|
-
handleFilterChange(newValue, name, field) {
|
|
2104
|
-
this.reScrollFilterWrap();
|
|
2105
|
-
let value = newValue;
|
|
2106
|
-
value = this.getSingleConvert(value, this.filterFields[name].CONVERT, field);
|
|
2107
|
-
this.filterFields[name].CONVERT = value;
|
|
2108
|
-
|
|
2109
|
-
field.checkAll = value.length === field.setting.showSetting.length;
|
|
2110
|
-
field.indeterminate = !!value.length && value.length !== field.setting.showSetting.length;
|
|
2111
|
-
},
|
|
2112
|
-
handleFilterSearchChange(value, columnName, field) {
|
|
2113
|
-
this.reScrollFilterWrap();
|
|
2114
|
-
/* filter-check-group value更新 触发 主check-group value同步更新 */
|
|
2115
|
-
let isAdd = beforeSearchConvert.length < value.length;
|
|
2116
|
-
if (isAdd) {
|
|
2117
|
-
let addItems = value.filter(item => {
|
|
2118
|
-
return !beforeSearchConvert.includes(item);
|
|
2119
|
-
});
|
|
2120
|
-
if (field.advanceOptionSetting == '0') {
|
|
2121
|
-
if (Array.isArray(this.filterFields[columnName].CONVERT)) {
|
|
2122
|
-
this.filterFields[columnName].CONVERT.length = 0;
|
|
2123
|
-
}
|
|
2124
|
-
}
|
|
2125
|
-
this.filterFields[columnName].CONVERT.push(...addItems);
|
|
2126
|
-
} else {
|
|
2127
|
-
let removeItems = beforeSearchConvert.filter(item => {
|
|
2128
|
-
return !value.includes(item);
|
|
2129
|
-
});
|
|
2130
|
-
this.filterFields[columnName].CONVERT = this.filterFields[columnName].CONVERT.filter(item => {
|
|
2131
|
-
return !removeItems.includes(item);
|
|
2132
|
-
});
|
|
2133
|
-
}
|
|
2134
|
-
|
|
2135
|
-
let newValue = value;
|
|
2136
|
-
newValue = this.getSingleConvert(newValue, field.searchFilterCONVERT, field);
|
|
2137
|
-
|
|
2138
|
-
field.searchFilterCONVERT = newValue;
|
|
2139
|
-
beforeSearchConvert = vexutils.clone(newValue, true);
|
|
2140
|
-
},
|
|
2141
|
-
getOffsetLocation(element, cls, offsetKey){
|
|
2142
|
-
let actualTop = element[offsetKey];
|
|
2143
|
-
let current = element.offsetParent;
|
|
2144
|
-
while (current && current.classList && !current.classList.contains(cls)) {
|
|
2145
|
-
actualTop += current[offsetKey];
|
|
2146
|
-
current = current.offsetParent;
|
|
2147
|
-
}
|
|
2148
|
-
return actualTop;
|
|
2149
|
-
},
|
|
2150
|
-
showFilterHandleLocationNew(target, tempWrapId){
|
|
2151
|
-
let resTop = this.getOffsetLocation(target, tempWrapId, 'offsetTop');
|
|
2152
|
-
let resLeft = this.getOffsetLocation(target, tempWrapId, 'offsetLeft');
|
|
2153
|
-
let resWidth = target.offsetWidth;
|
|
2154
|
-
let resHeight = target.offsetHeight;
|
|
2155
|
-
return {resTop, resLeft, resWidth, resHeight}
|
|
2156
|
-
},
|
|
2157
|
-
showFilter(field, columnName, event) {
|
|
2158
|
-
if (this.isInlineOperating) return false;
|
|
2159
|
-
let target = event.target;
|
|
2160
|
-
if(!target) return false;
|
|
2161
|
-
const FILTER_BOX_WIDTH = 400;
|
|
2162
|
-
let fontSize = this.styleSetting?.fontSize || 'small'
|
|
2163
|
-
let scaleNum = fontSizeMap[fontSize]
|
|
2164
|
-
let FILTER_BOX_TOP_OFFSET = filterTopOffsetMap[fontSize]
|
|
2165
|
-
|
|
2166
|
-
let transformWrap = document.body;
|
|
2167
|
-
let { left: btnRectLeft, right: btnRectRight, top: btnRectTop, width: btnWidth } = target.getBoundingClientRect();
|
|
2168
|
-
let transformWrapWidth = transformWrap.clientWidth;
|
|
2169
|
-
let isOverLeft = btnRectLeft + FILTER_BOX_WIDTH > transformWrapWidth;
|
|
2170
|
-
let right= 0;
|
|
2171
|
-
// 位置不够左定位
|
|
2172
|
-
if(isOverLeft) {
|
|
2173
|
-
let transformWrapRight = transformWrap?.getBoundingClientRect().right || 0;
|
|
2174
|
-
right = transformWrapRight - btnRectRight - btnWidth / 2
|
|
2175
|
-
}
|
|
2176
|
-
// 定位一直有问题, 最后还是相对于editTable定位, 不然弹框打开的列表会错位
|
|
2177
|
-
// 如果是相对app的话, filter-wrap插入的位置可能会有问题, 因为通过micro打开的列表, app id是重复的
|
|
2178
|
-
if(this.filterDomPortal && this.filterDomPortal != 'body' && this.filterDomPortal.includes("#")) {
|
|
2179
|
-
let tempWrapId = this.filterDomPortal.slice(1, this.filterDomPortal.length);
|
|
2180
|
-
scaleNum = 1;
|
|
2181
|
-
FILTER_BOX_TOP_OFFSET = 0;
|
|
2182
|
-
const {resTop = 0, resLeft = 0, resWidth = 0, resHeight = 0} = this.showFilterHandleLocationNew(target, tempWrapId)
|
|
2183
|
-
btnRectTop = resTop + resHeight + 8;
|
|
2184
|
-
btnWidth = resWidth;
|
|
2185
|
-
btnRectLeft = resLeft;
|
|
2186
|
-
btnRectRight = resWidth + btnRectLeft;
|
|
2187
|
-
right = document.getElementById(tempWrapId).offsetWidth - btnWidth - resLeft;
|
|
2188
|
-
}
|
|
2189
|
-
|
|
2190
|
-
field.left = 'initial';
|
|
2191
|
-
field.right = 'initial';
|
|
2192
|
-
field.top = 'initial';
|
|
2193
|
-
|
|
2194
|
-
if (isOverLeft) {
|
|
2195
|
-
field.right = right / scaleNum + 'px';
|
|
2196
|
-
} else {
|
|
2197
|
-
const left = btnRectLeft + (this.filterLeftOffset || 0)
|
|
2198
|
-
field.left = left / scaleNum + 'px';
|
|
2199
|
-
}
|
|
2200
|
-
|
|
2201
|
-
const top = btnRectTop + FILTER_BOX_TOP_OFFSET + (this.filterTopOffset || 0)
|
|
2202
|
-
field.top = top / scaleNum + 'px';
|
|
2203
|
-
|
|
2204
|
-
field.visible = !field.visible;
|
|
2205
|
-
|
|
2206
|
-
let len = this.filterFields[columnName]?.CONVERT.length;
|
|
2207
|
-
field.checkAll = len === field.setting.showSetting.length;
|
|
2208
|
-
field.indeterminate = !!len && len !== field.setting.showSetting.length;
|
|
2209
|
-
field.searchFilterText = '';
|
|
2210
|
-
},
|
|
2211
1820
|
scanMultiOperate(params) {
|
|
2212
1821
|
return [
|
|
2213
1822
|
<a-popconfirm ok-text={'确认'} cancel-text={'取消'} title={'是否确认删除?'} on-confirm={() => this.confirmScanMulti(params)}>
|
|
@@ -2304,7 +1913,11 @@ export default create({
|
|
|
2304
1913
|
}
|
|
2305
1914
|
|
|
2306
1915
|
if (['MONEY', 'NUMBER'].includes(attrType) || (own.extraField && own.fieldType === 'NUMBER')) {
|
|
2307
|
-
|
|
1916
|
+
let value = row[own.columnName];
|
|
1917
|
+
// 数字可能设置了颜色
|
|
1918
|
+
if(typeof value === 'string' && this.checkHtml(value)){
|
|
1919
|
+
return this.getField(row, own, rowIndex, true);
|
|
1920
|
+
}
|
|
2308
1921
|
return parseNumberField(value, own);
|
|
2309
1922
|
}
|
|
2310
1923
|
|
|
@@ -2510,7 +2123,7 @@ export default create({
|
|
|
2510
2123
|
// 嵌套表与主表click切换时需要清除上次的选中
|
|
2511
2124
|
this.isAboutNestTable && this.$emit('resetNestLastClickTable', table);
|
|
2512
2125
|
|
|
2513
|
-
let { row, $event = {}, rowIndex, source, column } = data;
|
|
2126
|
+
let { row, $event = {}, rowIndex, source, column, trigger } = data;
|
|
2514
2127
|
// 点击主表格展开行按钮 不需要触发选中行
|
|
2515
2128
|
let { className } = $event.target || {};
|
|
2516
2129
|
if (className && vexutils.isString(className) && className.includes('vxe-table--expand-btn')) return;
|
|
@@ -2537,7 +2150,7 @@ export default create({
|
|
|
2537
2150
|
const value = this.getRowClassName({ row }) == 'single--checked' ? [] : [row];
|
|
2538
2151
|
this.$set(this, 'checkedRows', value);
|
|
2539
2152
|
this.pubCheckChange(value);
|
|
2540
|
-
this.$emit('handlerClickRow', row, rowIndex, { source, column });
|
|
2153
|
+
this.$emit('handlerClickRow', row, rowIndex, { source, column, trigger });
|
|
2541
2154
|
return;
|
|
2542
2155
|
}
|
|
2543
2156
|
this.visibleCheckAllWrap = false;
|
|
@@ -2591,7 +2204,7 @@ export default create({
|
|
|
2591
2204
|
}
|
|
2592
2205
|
this.updateAddCheckedRows(rowVal, true);
|
|
2593
2206
|
// 需要选中行
|
|
2594
|
-
this.$emit('handlerClickRow', rowVal, rowIndex, { source, column });
|
|
2207
|
+
this.$emit('handlerClickRow', rowVal, rowIndex, { source, column, trigger });
|
|
2595
2208
|
this.setTableCurrentRow(table, row);
|
|
2596
2209
|
return;
|
|
2597
2210
|
}
|
|
@@ -2614,7 +2227,7 @@ export default create({
|
|
|
2614
2227
|
if (rowLen > 1) {
|
|
2615
2228
|
this.selectType != 'radio' && table.setCheckboxRow([row], true);
|
|
2616
2229
|
this.isTree != 0 && this.selectType != 'radio' && this.pubCheckChange(newRow);
|
|
2617
|
-
this.selectType != 'radio' && this.$emit('handlerClickRow', row, rowIndex, { source, column });
|
|
2230
|
+
this.selectType != 'radio' && this.$emit('handlerClickRow', row, rowIndex, { source, column, trigger });
|
|
2618
2231
|
} else {
|
|
2619
2232
|
setChecked = !setChecked;
|
|
2620
2233
|
if (!setChecked) {
|
|
@@ -2632,7 +2245,7 @@ export default create({
|
|
|
2632
2245
|
}
|
|
2633
2246
|
}
|
|
2634
2247
|
if (this.isTree != 0) {
|
|
2635
|
-
setChecked && this.$emit('handlerClickRow', row, rowIndex, { source, column });
|
|
2248
|
+
setChecked && this.$emit('handlerClickRow', row, rowIndex, { source, column, trigger });
|
|
2636
2249
|
this.setTableCurrentRow(table, row);
|
|
2637
2250
|
return;
|
|
2638
2251
|
}
|
|
@@ -2645,7 +2258,7 @@ export default create({
|
|
|
2645
2258
|
|
|
2646
2259
|
this.setCurrentCheckedLength();
|
|
2647
2260
|
this.lastPageIndex = this.pageVO.pageIndex;
|
|
2648
|
-
setChecked && this.$emit('handlerClickRow', row, rowIndex, { source });
|
|
2261
|
+
setChecked && this.$emit('handlerClickRow', row, rowIndex, { source, trigger });
|
|
2649
2262
|
this.setTableCurrentRow(table, row);
|
|
2650
2263
|
},
|
|
2651
2264
|
setBtmDbClick(row) {
|
|
@@ -3392,22 +3005,6 @@ export default create({
|
|
|
3392
3005
|
this.$emit('handlerClickRow', formatData[0], oldIndex);
|
|
3393
3006
|
},
|
|
3394
3007
|
|
|
3395
|
-
/**
|
|
3396
|
-
* 映射值如果配置了单选,限制只能选一个
|
|
3397
|
-
*/
|
|
3398
|
-
getSingleConvert(value, old, field) {
|
|
3399
|
-
let cValue = value;
|
|
3400
|
-
if (!Array.isArray(old) || !Array.isArray(value)) return cValue;
|
|
3401
|
-
// 单选
|
|
3402
|
-
if (field.advanceOptionSetting == '0' && (value?.length || 0) > 1) {
|
|
3403
|
-
cValue = cValue.filter(v => !old?.includes?.(v));
|
|
3404
|
-
if (cValue.length > 1) {
|
|
3405
|
-
return [cValue[0]];
|
|
3406
|
-
}
|
|
3407
|
-
}
|
|
3408
|
-
return cValue;
|
|
3409
|
-
},
|
|
3410
|
-
|
|
3411
3008
|
},
|
|
3412
3009
|
});
|
|
3413
3010
|
</script>
|
|
@@ -103,7 +103,9 @@ const bigTableProps = {
|
|
|
103
103
|
default: () => ({})
|
|
104
104
|
},
|
|
105
105
|
aboutPositionBtm: { type: Boolean, default: false },
|
|
106
|
-
treeVirtualScroll: { type: Boolean, default: false } // 树表是否开启虚拟滚动,目前值对 istree = 1 有效
|
|
106
|
+
treeVirtualScroll: { type: Boolean, default: false }, // 树表是否开启虚拟滚动,目前值对 istree = 1 有效
|
|
107
|
+
tableDataType: { type: String, defualt: 'SQL' },
|
|
108
|
+
libSource: { type: String }
|
|
107
109
|
};
|
|
108
110
|
|
|
109
111
|
export default bigTableProps;
|