cnhis-design-vue 2.1.79 → 2.1.81
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 +52 -4
- 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 +115 -95
- 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/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/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 +9 -9
- 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/index/index.js +4328 -1795
- 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 +52 -50
- package/es/scale-view/style.css +1 -1
- package/es/select/index.js +12 -12
- package/es/select-label/index.js +36 -34
- package/es/select-label/style.css +1 -1
- package/es/select-person/index.js +2 -2
- package/es/select-tag/index.js +4248 -0
- package/es/select-tag/style.css +1 -0
- package/es/shortcut-setter/index.js +10 -10
- package/es/skeleton/index.js +8 -8
- package/es/slider/index.js +8 -8
- 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 +3158 -1350
- 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 +4369 -1699
- package/lib/cui.umd.js +4369 -1699
- package/lib/cui.umd.min.js +82 -82
- package/package.json +1 -1
- package/packages/big-table/src/BigTable.vue +15 -3
- package/packages/big-table/src/assets/style/table-base.less +7 -4
- package/packages/index.js +3 -0
- package/packages/select-label/select-label.vue +18 -2
- package/packages/select-tag/index.js +14 -0
- package/packages/select-tag/label-classify.vue +133 -0
- package/packages/select-tag/labelFormContent.vue +295 -0
- package/packages/select-tag/select-label.vue +274 -0
- package/packages/table-filter/src/base-search-com/BaseSearch.vue +11 -15
- package/packages/table-filter/src/components/TextOverTooltip.vue +24 -11
- package/packages/table-filter/src/components/age-com/index.vue +3 -3
- package/packages/table-filter/src/components/checkbox-group/CheckboxGroup.vue +53 -0
- package/packages/table-filter/src/components/multi-select/multi-select.vue +7 -1
- package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +5 -119
- package/packages/table-filter/src/components/range-age/index.vue +11 -12
- package/packages/table-filter/src/components/render-widget/components/DateRangeQuick.vue +216 -0
- package/packages/table-filter/src/components/render-widget/components/Label.vue +209 -0
- package/packages/table-filter/src/components/render-widget/components/NumberRange.vue +147 -0
- package/packages/table-filter/src/components/render-widget/components/SelectDynamic.vue +280 -0
- package/packages/table-filter/src/components/render-widget/components/SelectLabel.vue +80 -0
- package/packages/table-filter/src/components/render-widget/components/index.js +6 -4
- package/packages/table-filter/src/components/render-widget/enums.js +29 -22
- package/packages/table-filter/src/components/render-widget/index.vue +45 -5
- package/packages/table-filter/src/components/render-widget/mixins/dynamic-method.js +164 -0
- package/packages/table-filter/src/components/render-widget/mixins/label-method.js +23 -0
- package/packages/table-filter/src/components/render-widget/widgetCfgMaps.js +194 -46
- package/packages/table-filter/src/components/search-filter/SearchFilter.vue +3 -1
- package/packages/table-filter/src/components/search-modal/set-classification.vue +5 -1
- package/packages/table-filter/src/mixins/mixins.js +192 -133
- package/packages/table-filter/src/mixins/out-quick-method.js +123 -0
- package/packages/table-filter/src/mixins/renderWidget.js +21 -13
- package/packages/table-filter/src/quick-search/QuickSearch.vue +201 -133
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import vexutils from '@/utils/vexutils';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
props: {},
|
|
5
|
+
data() {
|
|
6
|
+
return {};
|
|
7
|
+
},
|
|
8
|
+
methods: {
|
|
9
|
+
wordbookDataParamsRender(dynamicOptionInfo) {
|
|
10
|
+
let { dataSourceId, dataSourceType = 'WORDBOOK', filterKeys, autograph, defaultParams } = dynamicOptionInfo;
|
|
11
|
+
if (Array.isArray(filterKeys)) {
|
|
12
|
+
filterKeys = JSON.stringify(filterKeys);
|
|
13
|
+
}
|
|
14
|
+
const params = {
|
|
15
|
+
wordbookId: dataSourceId,
|
|
16
|
+
wordbookType: dataSourceType,
|
|
17
|
+
fieldKeys: filterKeys,
|
|
18
|
+
autograph
|
|
19
|
+
};
|
|
20
|
+
return params;
|
|
21
|
+
},
|
|
22
|
+
handleRenderFirstDef(item, rows) {
|
|
23
|
+
let { explicitDefaultVal, multiple } = item.widgetCfg;
|
|
24
|
+
let needSet = !item.initSearch && explicitDefaultVal;
|
|
25
|
+
if (!needSet) return;
|
|
26
|
+
let df = explicitDefaultVal;
|
|
27
|
+
let defval = [];
|
|
28
|
+
if (df === 'firstOption') {
|
|
29
|
+
let [v, k] = rows;
|
|
30
|
+
v && (defval = [v.myName]);
|
|
31
|
+
} else {
|
|
32
|
+
let f = rows.find(v => v.myName.includes(df));
|
|
33
|
+
if (f) {
|
|
34
|
+
defval = [f.myName];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
item.value = multiple ? [...defval] : defval[0];
|
|
38
|
+
},
|
|
39
|
+
getWordbookDataRender(params, row) {
|
|
40
|
+
this.$set(row, 'fetchingWordbook', true);
|
|
41
|
+
return this.handleGetConfigApi(params, 'requestGetWordbookData')
|
|
42
|
+
.then(res => {
|
|
43
|
+
this.$set(row, 'fetchingWordbook', false);
|
|
44
|
+
if (typeof res.data === 'object') {
|
|
45
|
+
res.data.reqParams = params;
|
|
46
|
+
}
|
|
47
|
+
return res;
|
|
48
|
+
})
|
|
49
|
+
.catch(() => {
|
|
50
|
+
this.$set(row, 'fetchingWordbook', false);
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
formatWordbookDataRender(item, data, params) {
|
|
55
|
+
let searchPageConfig = {
|
|
56
|
+
page: 0,
|
|
57
|
+
hasNextPage: false,
|
|
58
|
+
isRequest: true,
|
|
59
|
+
keyword: params?.keyword || undefined,
|
|
60
|
+
asyncCount: undefined
|
|
61
|
+
},
|
|
62
|
+
resArr = [];
|
|
63
|
+
if (data && data.result === 'SUCCESS') {
|
|
64
|
+
let reqParams = data?.reqParams || {};
|
|
65
|
+
let { showKeys, valueKey } = item?.widgetCfg?.dynamicOptionInfo || {};
|
|
66
|
+
showKeys = Array.isArray(showKeys) ? showKeys : [showKeys];
|
|
67
|
+
let { page, hasNextPage, fieldList, rows = [] } = data.map;
|
|
68
|
+
|
|
69
|
+
// columnName title
|
|
70
|
+
// showKeys是 columnName 需要从fieldList中匹配住中文
|
|
71
|
+
let _showKeys_ = [];
|
|
72
|
+
showKeys.forEach(v => {
|
|
73
|
+
let mItem = fieldList.find(k => k.columnName === v);
|
|
74
|
+
if (mItem) {
|
|
75
|
+
_showKeys_.push(mItem.title);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
this.$set(item, '_showKeys_', _showKeys_);
|
|
79
|
+
|
|
80
|
+
searchPageConfig = Object.assign(item.searchPageConfig || {}, {
|
|
81
|
+
page,
|
|
82
|
+
hasNextPage,
|
|
83
|
+
isRequest: true,
|
|
84
|
+
keyword: params?.keyword || undefined,
|
|
85
|
+
asyncCount: reqParams?.asyncCount || undefined
|
|
86
|
+
});
|
|
87
|
+
let rowsArr = rows.map(row => {
|
|
88
|
+
let showKeysStr = [];
|
|
89
|
+
// 取值是value, 展示是change_text
|
|
90
|
+
let valueKeyN = `_${valueKey}_`;
|
|
91
|
+
for (let key in row) {
|
|
92
|
+
let showVal = vexutils.stringToValue(row[key], 'change_text');
|
|
93
|
+
if (key === valueKey) {
|
|
94
|
+
row[valueKeyN] = vexutils.stringToValue(row[key]);
|
|
95
|
+
}
|
|
96
|
+
row[key] = showVal;
|
|
97
|
+
}
|
|
98
|
+
showKeys.forEach(s => {
|
|
99
|
+
// let str = vexutils.stringToValue(row[s]);
|
|
100
|
+
showKeysStr.push(row[s]);
|
|
101
|
+
});
|
|
102
|
+
// let name = vexutils.stringToValue(row[valueKey]);
|
|
103
|
+
let name = row[valueKeyN];
|
|
104
|
+
// 保存的时候值会变成字符串, 如果是数字的话回显会出问题, 这里全部处理成字符串
|
|
105
|
+
if (typeof name === 'number') {
|
|
106
|
+
name = String(name);
|
|
107
|
+
}
|
|
108
|
+
return Object.assign(row, {
|
|
109
|
+
myName: name,
|
|
110
|
+
_show_title: showKeysStr.join(' ')
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
// 数组对象去重
|
|
114
|
+
let obj = {};
|
|
115
|
+
resArr = rowsArr.reduce((cur, next) => {
|
|
116
|
+
obj[next.myName] ? '' : (obj[next.myName] = true && cur.push(next));
|
|
117
|
+
return cur;
|
|
118
|
+
}, []);
|
|
119
|
+
} else {
|
|
120
|
+
this.$set(item, '_showKeys_', []);
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
rows: resArr,
|
|
124
|
+
searchPageConfig
|
|
125
|
+
};
|
|
126
|
+
},
|
|
127
|
+
wordbookDataMethodRender(params, item) {
|
|
128
|
+
this.getWordbookDataRender(params, item).then(({ data }) => {
|
|
129
|
+
let { rows, searchPageConfig } = this.formatWordbookDataRender(item, data, params);
|
|
130
|
+
this.handleRenderFirstDef(item, rows);
|
|
131
|
+
this.$set(item, 'dataSource', rows);
|
|
132
|
+
this.$set(item, 'searchPageConfig', searchPageConfig);
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
async getWordbookFirstOptionRender(item) {
|
|
136
|
+
try {
|
|
137
|
+
let params = this.wordbookDataParamsRender(item.widgetCfg.dynamicOptionInfo);
|
|
138
|
+
let { data } = (await this.getWordbookDataRender(params, item)) || {};
|
|
139
|
+
let { rows, searchPageConfig } = this.formatWordbookDataRender(item, data, params);
|
|
140
|
+
this.handleRenderFirstDef(item, rows);
|
|
141
|
+
this.$set(item, 'dataSource', rows);
|
|
142
|
+
this.$set(item, 'searchPageConfig', searchPageConfig);
|
|
143
|
+
} catch (err) {
|
|
144
|
+
console.log(err);
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
dropdownVisibleChangeRender(open, item) {
|
|
148
|
+
if (!open) return;
|
|
149
|
+
let params = this.wordbookDataParamsRender(item.widgetCfg.dynamicOptionInfo);
|
|
150
|
+
this.wordbookDataMethodRender(params, item);
|
|
151
|
+
},
|
|
152
|
+
handleWordBookSearchDef(value, item, config = {}) {
|
|
153
|
+
let params = this.wordbookDataParamsRender(item.widgetCfg.dynamicOptionInfo);
|
|
154
|
+
let { tableDataType, filterKeys } = item?.widgetCfg?.dynamicOptionInfo || {};
|
|
155
|
+
let searchKeyName = 'keyword';
|
|
156
|
+
// API类型的列表, keyword名字为filterKeys的值
|
|
157
|
+
if (tableDataType === 'API' && Array.isArray(filterKeys) && filterKeys.length) {
|
|
158
|
+
searchKeyName = filterKeys[0] || 'keyword';
|
|
159
|
+
}
|
|
160
|
+
let rp = { [searchKeyName]: value, ...params, ...config };
|
|
161
|
+
this.wordbookDataMethodRender(rp, item);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
props: {},
|
|
3
|
+
data() {
|
|
4
|
+
return {};
|
|
5
|
+
},
|
|
6
|
+
methods: {
|
|
7
|
+
getLabelDataRender(params) {
|
|
8
|
+
return this.handleGetConfigApi(params, 'requestListByClassify').then(res => {
|
|
9
|
+
if (typeof res.data === 'object') {
|
|
10
|
+
res.data.reqParams = params;
|
|
11
|
+
}
|
|
12
|
+
return res;
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
getLabelListMethodRender(item) {
|
|
16
|
+
const { classifyStr = '' } = item.widgetCfg || {};
|
|
17
|
+
this.getLabelDataRender({ classifyStr }).then(({ data }) => {
|
|
18
|
+
const { list = [] } = data;
|
|
19
|
+
this.$set(item, 'tagList', list);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
@@ -1,92 +1,99 @@
|
|
|
1
1
|
import { WidgetTypeEnums, DatePresetValEnums } from './enums';
|
|
2
2
|
import { InputNumber, Input, DatePicker } from 'ant-design-vue';
|
|
3
|
-
import { CheckboxGroup, Select } from './components';
|
|
3
|
+
import { CheckboxGroup, Select, NumberRange, DateRangeQuick, SelectDynamic, Label, SelectLabel } from './components';
|
|
4
4
|
import moment from 'moment';
|
|
5
5
|
import { presetValToTimestamp } from './helpers/presetValToTimestamp';
|
|
6
6
|
|
|
7
|
-
const SetDefVal =
|
|
7
|
+
const SetDefVal = defaultValue => defaultValue;
|
|
8
8
|
|
|
9
9
|
export const WidgetCfgMaps = new Map([
|
|
10
10
|
[
|
|
11
|
-
WidgetTypeEnums.INPUT_NUMBER,
|
|
11
|
+
WidgetTypeEnums.INPUT_NUMBER,
|
|
12
12
|
{
|
|
13
13
|
component: InputNumber,
|
|
14
14
|
props: {
|
|
15
|
-
allowClear: true
|
|
15
|
+
allowClear: true
|
|
16
16
|
},
|
|
17
|
-
eventsBySearch: [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
eventsBySearch: [
|
|
18
|
+
{
|
|
19
|
+
name: 'keydown',
|
|
20
|
+
handler(e, search) {
|
|
21
|
+
if (e.key === 'Enter') {
|
|
22
|
+
search();
|
|
23
|
+
}
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
|
-
|
|
26
|
+
],
|
|
25
27
|
handlerProps(props, { title } = {}) {
|
|
26
|
-
const Props = { ...props, placeholder:
|
|
28
|
+
const Props = { ...props, placeholder: `请输入${title}` };
|
|
27
29
|
return Props;
|
|
28
30
|
},
|
|
29
|
-
setDefaultValue: SetDefVal
|
|
31
|
+
setDefaultValue: SetDefVal
|
|
30
32
|
}
|
|
31
33
|
],
|
|
32
34
|
[
|
|
33
|
-
WidgetTypeEnums.INPUT,
|
|
35
|
+
WidgetTypeEnums.INPUT,
|
|
34
36
|
{
|
|
35
37
|
component: Input,
|
|
36
38
|
props: {
|
|
37
|
-
allowClear: true
|
|
39
|
+
allowClear: true
|
|
38
40
|
},
|
|
39
|
-
eventsBySearch: [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
eventsBySearch: [
|
|
42
|
+
{
|
|
43
|
+
name: 'keydown',
|
|
44
|
+
handler(e, search) {
|
|
45
|
+
if (e.key === 'Enter') {
|
|
46
|
+
search();
|
|
47
|
+
}
|
|
44
48
|
}
|
|
45
49
|
}
|
|
46
|
-
|
|
50
|
+
],
|
|
47
51
|
handlerProps(props, { title } = {}) {
|
|
48
|
-
const Props = { ...props, placeholder:
|
|
52
|
+
const Props = { ...props, placeholder: `请输入${title}` };
|
|
49
53
|
return Props;
|
|
50
54
|
},
|
|
51
|
-
setDefaultValue: SetDefVal
|
|
55
|
+
setDefaultValue: SetDefVal
|
|
52
56
|
}
|
|
53
57
|
],
|
|
54
58
|
[
|
|
55
|
-
WidgetTypeEnums.SELECT,
|
|
59
|
+
WidgetTypeEnums.SELECT,
|
|
56
60
|
{
|
|
57
61
|
component: Select,
|
|
58
62
|
props: {
|
|
59
63
|
allowClear: true,
|
|
60
64
|
options: [],
|
|
61
65
|
showSearch: true,
|
|
62
|
-
mode:
|
|
63
|
-
showArrow: true
|
|
64
|
-
},
|
|
65
|
-
eventsBySearch: [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
mode: 'default',
|
|
67
|
+
showArrow: true
|
|
68
|
+
},
|
|
69
|
+
eventsBySearch: [
|
|
70
|
+
{
|
|
71
|
+
name: 'change',
|
|
72
|
+
handler(e, search, props) {
|
|
73
|
+
const { mode } = props;
|
|
74
|
+
if (mode !== 'multiple') {
|
|
75
|
+
search();
|
|
76
|
+
}
|
|
71
77
|
}
|
|
72
78
|
}
|
|
73
|
-
|
|
79
|
+
],
|
|
74
80
|
handlerProps(props, { valueList, multiple, title } = {}) {
|
|
75
81
|
const Props = { ...props, placeholder: `请选择${title}` };
|
|
76
82
|
if (Array.isArray(valueList)) Props.options = valueList.map(({ value, label }) => ({ value, label }));
|
|
77
|
-
if (multiple) Props.mode =
|
|
83
|
+
if (multiple) Props.mode = 'multiple';
|
|
78
84
|
return Props;
|
|
79
85
|
},
|
|
80
|
-
setDefaultValue: SetDefVal
|
|
86
|
+
setDefaultValue: SetDefVal
|
|
81
87
|
}
|
|
82
88
|
],
|
|
89
|
+
|
|
83
90
|
[
|
|
84
|
-
WidgetTypeEnums.DATE,
|
|
91
|
+
WidgetTypeEnums.DATE,
|
|
85
92
|
{
|
|
86
93
|
component: DatePicker,
|
|
87
94
|
props: {
|
|
88
95
|
allowClear: true,
|
|
89
|
-
valueFormat:
|
|
96
|
+
valueFormat: 'YYYY-MM-DD HH:mm:ss'
|
|
90
97
|
},
|
|
91
98
|
handlerProps(props, { title } = {}) {
|
|
92
99
|
const Props = { ...props, placeholder: `请选择${title}` };
|
|
@@ -94,20 +101,20 @@ export const WidgetCfgMaps = new Map([
|
|
|
94
101
|
},
|
|
95
102
|
setDefaultValue(defaultValue, defValueUnit) {
|
|
96
103
|
if (defValueUnit && defValueUnit !== DatePresetValEnums.CUSTOM) {
|
|
97
|
-
return presetValToTimestamp(defValueUnit,
|
|
104
|
+
return presetValToTimestamp(defValueUnit, 'YYYY-MM-DD HH:mm:ss');
|
|
98
105
|
}
|
|
99
106
|
return defaultValue;
|
|
100
107
|
}
|
|
101
108
|
}
|
|
102
109
|
],
|
|
103
110
|
[
|
|
104
|
-
WidgetTypeEnums.DATE_TIME,
|
|
111
|
+
WidgetTypeEnums.DATE_TIME,
|
|
105
112
|
{
|
|
106
113
|
component: DatePicker,
|
|
107
114
|
props: {
|
|
108
115
|
allowClear: true,
|
|
109
|
-
valueFormat:
|
|
110
|
-
|
|
116
|
+
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
117
|
+
'show-time': { defaultValue: moment('00:00:00', 'HH:mm:ss') }
|
|
111
118
|
},
|
|
112
119
|
handlerProps(props, { title } = {}) {
|
|
113
120
|
const Props = { ...props, placeholder: `请选择${title}` };
|
|
@@ -115,7 +122,7 @@ export const WidgetCfgMaps = new Map([
|
|
|
115
122
|
},
|
|
116
123
|
setDefaultValue(defaultValue, defValueUnit) {
|
|
117
124
|
if (defValueUnit && defValueUnit !== DatePresetValEnums.CUSTOM) {
|
|
118
|
-
return presetValToTimestamp(defValueUnit,
|
|
125
|
+
return presetValToTimestamp(defValueUnit, 'YYYY-MM-DD HH:mm:ss');
|
|
119
126
|
}
|
|
120
127
|
return defaultValue;
|
|
121
128
|
}
|
|
@@ -127,14 +134,155 @@ export const WidgetCfgMaps = new Map([
|
|
|
127
134
|
component: CheckboxGroup,
|
|
128
135
|
props: {},
|
|
129
136
|
style: {
|
|
130
|
-
|
|
137
|
+
'line-height': '32px'
|
|
131
138
|
},
|
|
132
139
|
handlerProps(props, { valueList, multiple } = {}) {
|
|
133
140
|
const Props = { ...props, multiple };
|
|
134
141
|
if (Array.isArray(valueList)) Props.options = valueList.map(({ value, label }) => ({ value, label }));
|
|
135
142
|
return Props;
|
|
136
143
|
},
|
|
137
|
-
setDefaultValue: SetDefVal
|
|
144
|
+
setDefaultValue: SetDefVal
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
[
|
|
148
|
+
WidgetTypeEnums.INPUT_NUMBER_RANGE,
|
|
149
|
+
{
|
|
150
|
+
component: NumberRange,
|
|
151
|
+
props: {},
|
|
152
|
+
handlerProps(props, { valueList, multiple, title, isQuick } = {}) {
|
|
153
|
+
const placeholderS = isQuick ? '最小值' : `起始${title}`;
|
|
154
|
+
const placeholderE = isQuick ? '最大值' : `截止${title}`;
|
|
155
|
+
const Props = { ...props, multiple, placeholderS, placeholderE };
|
|
156
|
+
if (Array.isArray(valueList)) Props.options = valueList.map(({ value, label }) => ({ value, label }));
|
|
157
|
+
return Props;
|
|
158
|
+
},
|
|
159
|
+
setDefaultValue: SetDefVal
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
[
|
|
163
|
+
WidgetTypeEnums.DATE_RANGE,
|
|
164
|
+
{
|
|
165
|
+
component: DatePicker.RangePicker,
|
|
166
|
+
props: {
|
|
167
|
+
allowClear: true,
|
|
168
|
+
valueFormat: 'YYYY-MM-DD'
|
|
169
|
+
},
|
|
170
|
+
handlerProps(props, { title } = {}) {
|
|
171
|
+
const Props = { ...props, placeholder: [`起始${title}`, `截止${title}`] };
|
|
172
|
+
return Props;
|
|
173
|
+
},
|
|
174
|
+
setDefaultValue(defaultValue, defValueUnit) {
|
|
175
|
+
if (defValueUnit && defValueUnit !== DatePresetValEnums.CUSTOM) {
|
|
176
|
+
let resDate = presetValToTimestamp(defValueUnit, 'YYYY-MM-DD');
|
|
177
|
+
return [resDate, resDate];
|
|
178
|
+
}
|
|
179
|
+
if (!defaultValue || (defaultValue && !Array.isArray(defaultValue))) {
|
|
180
|
+
return [];
|
|
181
|
+
}
|
|
182
|
+
return defaultValue;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
[
|
|
187
|
+
WidgetTypeEnums.DATETIME_RANGE,
|
|
188
|
+
{
|
|
189
|
+
component: DatePicker.RangePicker,
|
|
190
|
+
props: {
|
|
191
|
+
allowClear: true,
|
|
192
|
+
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
193
|
+
'show-time': { defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')] }
|
|
194
|
+
},
|
|
195
|
+
handlerProps(props, { title } = {}) {
|
|
196
|
+
const Props = { ...props, placeholder: [`起始${title}`, `截止${title}`] };
|
|
197
|
+
return Props;
|
|
198
|
+
},
|
|
199
|
+
setDefaultValue(defaultValue, defValueUnit) {
|
|
200
|
+
if (defValueUnit && defValueUnit !== DatePresetValEnums.CUSTOM) {
|
|
201
|
+
let resDate = presetValToTimestamp(defValueUnit, 'YYYY-MM-DD HH:mm:ss');
|
|
202
|
+
return [resDate, resDate];
|
|
203
|
+
}
|
|
204
|
+
if (!defaultValue || (defaultValue && !Array.isArray(defaultValue))) {
|
|
205
|
+
return [];
|
|
206
|
+
}
|
|
207
|
+
return defaultValue;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
],
|
|
211
|
+
[
|
|
212
|
+
WidgetTypeEnums.DATE_RANGE_QUICK,
|
|
213
|
+
{
|
|
214
|
+
component: DateRangeQuick,
|
|
215
|
+
props: {},
|
|
216
|
+
handlerProps(props, { fieldType } = {}) {
|
|
217
|
+
let str = fieldType === 'DATE' ? '日期' : '时间';
|
|
218
|
+
const Props = { ...props, placeholderS: `开始${str}`, placeholderE: `结束${str}`, fieldType };
|
|
219
|
+
return Props;
|
|
220
|
+
},
|
|
221
|
+
setDefaultValue: SetDefVal
|
|
222
|
+
}
|
|
223
|
+
],
|
|
224
|
+
[
|
|
225
|
+
WidgetTypeEnums.SELECT_DYNAMIC,
|
|
226
|
+
{
|
|
227
|
+
component: SelectDynamic,
|
|
228
|
+
props: {},
|
|
229
|
+
eventsBySearch: [
|
|
230
|
+
{
|
|
231
|
+
name: 'change',
|
|
232
|
+
handler(e, search, props) {
|
|
233
|
+
const { mode } = props;
|
|
234
|
+
if (mode !== 'multiple') {
|
|
235
|
+
search();
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
],
|
|
240
|
+
handlerProps(props, { multiple, title } = {}) {
|
|
241
|
+
const Props = { ...props, placeholder: `请选择${title}` };
|
|
242
|
+
Props.mode = multiple ? 'multiple' : 'default';
|
|
243
|
+
return Props;
|
|
244
|
+
},
|
|
245
|
+
setDefaultValue: SetDefVal
|
|
246
|
+
}
|
|
247
|
+
],
|
|
248
|
+
[
|
|
249
|
+
WidgetTypeEnums.LABEL,
|
|
250
|
+
{
|
|
251
|
+
component: Label,
|
|
252
|
+
props: {},
|
|
253
|
+
handlerProps(props) {
|
|
254
|
+
const Props = { ...props };
|
|
255
|
+
return Props;
|
|
256
|
+
},
|
|
257
|
+
setDefaultValue(defaultValue, defValueUnit) {
|
|
258
|
+
if (defaultValue && Array.isArray(defaultValue)) {
|
|
259
|
+
return defaultValue.join('|#|');
|
|
260
|
+
}
|
|
261
|
+
return defaultValue;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
],
|
|
265
|
+
[
|
|
266
|
+
WidgetTypeEnums.SELECT_LABEL,
|
|
267
|
+
{
|
|
268
|
+
component: SelectLabel,
|
|
269
|
+
props: {
|
|
270
|
+
allowClear: true,
|
|
271
|
+
showSearch: true,
|
|
272
|
+
mode: 'default',
|
|
273
|
+
showArrow: true
|
|
274
|
+
},
|
|
275
|
+
handlerProps(props, { multiple, title } = {}) {
|
|
276
|
+
const Props = { ...props, placeholder: `请选择${title}` };
|
|
277
|
+
Props.mode = multiple ? 'multiple' : 'default';
|
|
278
|
+
return Props;
|
|
279
|
+
},
|
|
280
|
+
setDefaultValue(defaultValue, defValueUnit) {
|
|
281
|
+
if (defaultValue && Array.isArray(defaultValue)) {
|
|
282
|
+
return defaultValue.join('|#|');
|
|
283
|
+
}
|
|
284
|
+
return defaultValue;
|
|
285
|
+
}
|
|
138
286
|
}
|
|
139
|
-
]
|
|
140
|
-
]);
|
|
287
|
+
],
|
|
288
|
+
]);
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
<script>
|
|
43
43
|
import {Modal,Icon} from 'ant-design-vue'
|
|
44
44
|
import SearchCondition from "../search-condition/SearchCondition.vue";
|
|
45
|
+
import svgIcon from '@/component/svg/index.vue';
|
|
45
46
|
export default {
|
|
46
47
|
name: "SearchFilter",
|
|
47
48
|
props: {
|
|
@@ -69,7 +70,8 @@ export default {
|
|
|
69
70
|
components: {
|
|
70
71
|
SearchCondition,
|
|
71
72
|
AModal:Modal,
|
|
72
|
-
[Icon.name]:Icon
|
|
73
|
+
[Icon.name]:Icon,
|
|
74
|
+
svgIcon
|
|
73
75
|
},
|
|
74
76
|
watch: {
|
|
75
77
|
visible(value) {
|
|
@@ -191,7 +191,7 @@ export default {
|
|
|
191
191
|
});
|
|
192
192
|
},
|
|
193
193
|
// 保存列表搜索分类
|
|
194
|
-
async saveAdd(params) {
|
|
194
|
+
async saveAdd(params, isValidConObj, config = {}) {
|
|
195
195
|
try {
|
|
196
196
|
Object.assign(params, {
|
|
197
197
|
tableId: this.$attrs.tableId,
|
|
@@ -202,9 +202,13 @@ export default {
|
|
|
202
202
|
let res = await this.handleGetConfigApi(params, 'requestSaveTableCondiTion');
|
|
203
203
|
if (!res) return;
|
|
204
204
|
let searchFilter = this.$refs.searchFilter;
|
|
205
|
+
let {cancelSaveAdd} = config
|
|
205
206
|
if (searchFilter) {
|
|
206
207
|
searchFilter.cancelSaveAdd();
|
|
207
208
|
}
|
|
209
|
+
if(!searchFilter && typeof cancelSaveAdd === 'function') {
|
|
210
|
+
cancelSaveAdd()
|
|
211
|
+
}
|
|
208
212
|
this.$emit('saveGetTableCondiTionList');
|
|
209
213
|
this.addVisible = false;
|
|
210
214
|
} catch (error) {
|