@tongfun/tf-widget 0.1.21 → 0.1.22
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/README.md +49 -49
- package/lib/tf-widget.common.js +547 -503
- package/lib/tf-widget.css +1 -1
- package/lib/tf-widget.umd.js +547 -503
- package/lib/tf-widget.umd.min.js +4 -4
- package/package/svg-icon/index.js +8 -8
- package/package/svg-icon/src/SvgIcon.vue +59 -59
- package/package/t-data-list/index.js +6 -6
- package/package/t-data-list/main.vue +193 -193
- package/package/t-data-list/src/condition-input/basic.vue +31 -31
- package/package/t-data-list/src/condition-input/date.vue +106 -106
- package/package/t-data-list/src/condition-input/index.vue +100 -100
- package/package/t-data-list/src/condition-input/input.vue +31 -31
- package/package/t-data-list/src/condition-input/number.vue +115 -115
- package/package/t-data-list/src/condition-input/select.vue +86 -86
- package/package/t-data-list/src/js/fieldTypeEnum.js +10 -10
- package/package/t-data-list/src/js/operatorEnum.js +108 -108
- package/package/t-data-list/src/js/qureyParamsEnum.js +4 -4
- package/package/t-data-list/src/js/util.js +34 -34
- package/package/t-data-list/src/mixins/button-controll-mixin.js +93 -93
- package/package/t-data-list/src/pushdown/push-down.vue +158 -158
- package/package/t-data-list/src/t-list-search.vue +36 -36
- package/package/t-data-list/src/t-plan/condition-always-item.vue +143 -143
- package/package/t-data-list/src/t-plan/condition-mult-item.vue +222 -222
- package/package/t-data-list/src/t-plan/index.vue +195 -195
- package/package/t-data-list/src/t-plan/plan-content.vue +389 -389
- package/package/t-data-list/src/t-table/index.vue +129 -129
- package/package/t-data-list/src/t-table/table-group-item-edit.vue +238 -238
- package/package/t-data-list/src/t-table/table-group-item.vue +87 -87
- package/package/t-data-list/src/t-table/table-group.vue +180 -180
- package/package/t-data-list/src/t-table/table-records-header-popover.vue +246 -246
- package/package/t-data-list/src/t-table/table-records-selected.vue +159 -159
- package/package/t-data-list/src/t-table/table-records.vue +337 -337
- package/package/t-input/children/address.vue +101 -101
- package/package/t-input/children/basic-display.vue +41 -41
- package/package/t-input/children/basic.vue +253 -253
- package/package/t-input/children/date.vue +89 -89
- package/package/t-input/children/group-components/group-dialog.vue +344 -344
- package/package/t-input/children/group.vue +126 -126
- package/package/t-input/children/input.vue +72 -72
- package/package/t-input/children/number.vue +74 -74
- package/package/t-input/children/select.vue +89 -89
- package/package/t-input/children/tfile/fiile-enclosure.vue +233 -233
- package/package/t-input/index.js +7 -7
- package/package/t-input/index.vue +337 -337
- package/package/t-input/tInputCache.js +24 -24
- package/package/tf-icon-picker/README.md +7 -7
- package/package/tf-icon-picker/index.js +8 -8
- package/package/tf-icon-picker/src/tf-icon-picker.vue +266 -266
- package/package/tf-layout/README.md +115 -115
- package/package/tf-layout/index.js +8 -8
- package/package/tf-layout/src/components/tf-labelbar.vue +394 -394
- package/package/tf-layout/src/components/tf-menu.vue +180 -180
- package/package/tf-layout/src/components/tf-right-menu.vue +89 -89
- package/package/tf-layout/src/components/tf-rotate-box.vue +50 -50
- package/package/tf-layout/src/tf-layout.vue +140 -140
- package/package/tf-widget/index.js +8 -8
- package/package/tf-widget/src/assets/common-input.less +10 -10
- package/package/tf-widget/src/children/basic-data/basic-data.vue +361 -361
- package/package/tf-widget/src/children/basic-data/dependcy/basic-data-selector.vue +1087 -1087
- package/package/tf-widget/src/children/basic-data/dependcy/common-table.vue +750 -750
- package/package/tf-widget/src/children/basic-data/dependcy/condition-filter.vue +519 -519
- package/package/tf-widget/src/children/basic-data/dependcy/pagination.vue +93 -93
- package/package/tf-widget/src/children/basic-data/dependcy/table-control.vue +240 -240
- package/package/tf-widget/src/children/basic-data/dependcy/view-picture.vue +108 -108
- package/package/tf-widget/src/children/date-time.vue +103 -103
- package/package/tf-widget/src/children/date.vue +103 -103
- package/package/tf-widget/src/children/decimal.vue +115 -115
- package/package/tf-widget/src/children/integer.vue +104 -104
- package/package/tf-widget/src/children/property.vue +59 -59
- package/package/tf-widget/src/children/single-line-text.vue +82 -82
- package/package/tf-widget/src/children/small-pictures.vue +223 -223
- package/package/tf-widget/src/children/text-area.vue +74 -74
- package/package/tf-widget/src/children/tf-select.vue +113 -113
- package/package/tf-widget/src/tf-widget.vue +175 -175
- package/package.json +44 -44
- package/src/api/edit.js +97 -97
- package/src/api/file-enclosure.js +26 -26
- package/src/api/push-down.js +19 -19
- package/src/api/table.js +294 -294
- package/src/api/tableV3.js +166 -160
- package/src/assets/images/icons/index.js +9 -9
- package/src/assets/images/icons/svg/add.svg +5 -5
- package/src/assets/images/icons/svg/push-down.svg +1 -1
- package/src/assets/images/icons/svg/remove.svg +1 -1
- package/src/assets/styles/common-table.less +202 -202
- package/src/directives/debounce.js +24 -24
- package/src/index.js +31 -31
- package/src/mixins/t-data-query-mixin.js +290 -290
- package/src/utils/auth.js +22 -22
- package/src/utils/request.js +42 -42
- package/src/utils/stato-anormale.js +59 -59
- package/src/utils/utils.js +109 -109
- package/src/utils/validate.js +84 -84
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-input v-if="!range" :value="value" size="mini" @input="handleInput" />
|
|
3
|
-
<div v-else :class="[tableHead?'col-layout':'row-layout']">
|
|
4
|
-
<el-input :value="numberRangeValue.start" size="mini" @input="handleStartInput" />
|
|
5
|
-
<span class="number-separators">~</span>
|
|
6
|
-
<el-input :value="numberRangeValue.end" size="mini" @input="handleEndInput" />
|
|
7
|
-
</div>
|
|
8
|
-
</template>
|
|
9
|
-
<script>
|
|
10
|
-
export default {
|
|
11
|
-
components: {
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
props: {
|
|
15
|
-
value: {
|
|
16
|
-
type: String,
|
|
17
|
-
default: ''
|
|
18
|
-
},
|
|
19
|
-
disabled: {
|
|
20
|
-
type: Boolean,
|
|
21
|
-
default: false
|
|
22
|
-
},
|
|
23
|
-
range: {
|
|
24
|
-
type: Boolean,
|
|
25
|
-
default: false
|
|
26
|
-
},
|
|
27
|
-
tableHead: {
|
|
28
|
-
type: Boolean,
|
|
29
|
-
default: false
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
data () {
|
|
33
|
-
return {
|
|
34
|
-
numberRangeValue: {
|
|
35
|
-
start: '',
|
|
36
|
-
end: ''
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
watch: {
|
|
41
|
-
value () {
|
|
42
|
-
if (this.range) {
|
|
43
|
-
if (!this.value) return
|
|
44
|
-
const dataArr = this.value.split(',')
|
|
45
|
-
this.numberRangeValue.start = dataArr[0] || ''
|
|
46
|
-
this.numberRangeValue.end = dataArr[1] || ''
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
methods: {
|
|
51
|
-
/**
|
|
52
|
-
* 将输入转换为数字,如果不能转换则进行忽略
|
|
53
|
-
*/
|
|
54
|
-
inputValid (value) {
|
|
55
|
-
return /^\d*$/g.test(value)
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* 非范围状态的输入处理函数
|
|
60
|
-
*/
|
|
61
|
-
handleInput (value) {
|
|
62
|
-
if (!this.inputValid(value)) {
|
|
63
|
-
return
|
|
64
|
-
}
|
|
65
|
-
this.$emit('input', value)
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* 范围开始的输入处理
|
|
70
|
-
*/
|
|
71
|
-
handleStartInput (value) {
|
|
72
|
-
if (!this.inputValid(value)) {
|
|
73
|
-
return
|
|
74
|
-
}
|
|
75
|
-
this.numberRangeValue.start = value
|
|
76
|
-
this.emitRangeValue()
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* 范围的结束输入处理
|
|
81
|
-
*/
|
|
82
|
-
handleEndInput (value) {
|
|
83
|
-
if (!this.inputValid(value)) {
|
|
84
|
-
return
|
|
85
|
-
}
|
|
86
|
-
this.numberRangeValue.end = value
|
|
87
|
-
this.emitRangeValue()
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* 范围输入对外发射
|
|
92
|
-
*/
|
|
93
|
-
emitRangeValue () {
|
|
94
|
-
const start = this.numberRangeValue.start
|
|
95
|
-
const end = this.numberRangeValue.end
|
|
96
|
-
this.$emit('input', `${start},${end}`)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
</script>
|
|
102
|
-
<style lang='less' scoped>
|
|
103
|
-
.row-layout {
|
|
104
|
-
display:flex;
|
|
105
|
-
}
|
|
106
|
-
.col-layout {
|
|
107
|
-
display:flex;
|
|
108
|
-
flex-direction: column;
|
|
109
|
-
}
|
|
110
|
-
.number-separators{
|
|
111
|
-
display:flex;
|
|
112
|
-
align-items: center;
|
|
113
|
-
justify-content: center;
|
|
114
|
-
}
|
|
115
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<el-input v-if="!range" :value="value" size="mini" @input="handleInput" />
|
|
3
|
+
<div v-else :class="[tableHead?'col-layout':'row-layout']">
|
|
4
|
+
<el-input :value="numberRangeValue.start" size="mini" @input="handleStartInput" />
|
|
5
|
+
<span class="number-separators">~</span>
|
|
6
|
+
<el-input :value="numberRangeValue.end" size="mini" @input="handleEndInput" />
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
<script>
|
|
10
|
+
export default {
|
|
11
|
+
components: {
|
|
12
|
+
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
value: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: ''
|
|
18
|
+
},
|
|
19
|
+
disabled: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: false
|
|
22
|
+
},
|
|
23
|
+
range: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false
|
|
26
|
+
},
|
|
27
|
+
tableHead: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
data () {
|
|
33
|
+
return {
|
|
34
|
+
numberRangeValue: {
|
|
35
|
+
start: '',
|
|
36
|
+
end: ''
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
watch: {
|
|
41
|
+
value () {
|
|
42
|
+
if (this.range) {
|
|
43
|
+
if (!this.value) return
|
|
44
|
+
const dataArr = this.value.split(',')
|
|
45
|
+
this.numberRangeValue.start = dataArr[0] || ''
|
|
46
|
+
this.numberRangeValue.end = dataArr[1] || ''
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
methods: {
|
|
51
|
+
/**
|
|
52
|
+
* 将输入转换为数字,如果不能转换则进行忽略
|
|
53
|
+
*/
|
|
54
|
+
inputValid (value) {
|
|
55
|
+
return /^\d*$/g.test(value)
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 非范围状态的输入处理函数
|
|
60
|
+
*/
|
|
61
|
+
handleInput (value) {
|
|
62
|
+
if (!this.inputValid(value)) {
|
|
63
|
+
return
|
|
64
|
+
}
|
|
65
|
+
this.$emit('input', value)
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 范围开始的输入处理
|
|
70
|
+
*/
|
|
71
|
+
handleStartInput (value) {
|
|
72
|
+
if (!this.inputValid(value)) {
|
|
73
|
+
return
|
|
74
|
+
}
|
|
75
|
+
this.numberRangeValue.start = value
|
|
76
|
+
this.emitRangeValue()
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* 范围的结束输入处理
|
|
81
|
+
*/
|
|
82
|
+
handleEndInput (value) {
|
|
83
|
+
if (!this.inputValid(value)) {
|
|
84
|
+
return
|
|
85
|
+
}
|
|
86
|
+
this.numberRangeValue.end = value
|
|
87
|
+
this.emitRangeValue()
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* 范围输入对外发射
|
|
92
|
+
*/
|
|
93
|
+
emitRangeValue () {
|
|
94
|
+
const start = this.numberRangeValue.start
|
|
95
|
+
const end = this.numberRangeValue.end
|
|
96
|
+
this.$emit('input', `${start},${end}`)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
</script>
|
|
102
|
+
<style lang='less' scoped>
|
|
103
|
+
.row-layout {
|
|
104
|
+
display:flex;
|
|
105
|
+
}
|
|
106
|
+
.col-layout {
|
|
107
|
+
display:flex;
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
}
|
|
110
|
+
.number-separators{
|
|
111
|
+
display:flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
}
|
|
115
|
+
</style>
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-select
|
|
3
|
-
:value="selectValue"
|
|
4
|
-
:popper-append-to-body="false"
|
|
5
|
-
size="mini"
|
|
6
|
-
filterable
|
|
7
|
-
clearable
|
|
8
|
-
placeholder=""
|
|
9
|
-
:multiple="multi"
|
|
10
|
-
collapse-tags
|
|
11
|
-
:disabled="disabled"
|
|
12
|
-
style="display:block"
|
|
13
|
-
@input="selectValue = $event"
|
|
14
|
-
>
|
|
15
|
-
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.enumId" />
|
|
16
|
-
</el-select>
|
|
17
|
-
</template>
|
|
18
|
-
<script>
|
|
19
|
-
import { getEnumOptions } from '@/api/tableV3.js'
|
|
20
|
-
export default {
|
|
21
|
-
props: {
|
|
22
|
-
value: {
|
|
23
|
-
type: String,
|
|
24
|
-
default: ''
|
|
25
|
-
},
|
|
26
|
-
disabled: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
default: false
|
|
29
|
-
},
|
|
30
|
-
multi: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: false
|
|
33
|
-
},
|
|
34
|
-
field: {
|
|
35
|
-
type: String,
|
|
36
|
-
default: '2'
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
inject: ['target', 'enumOptionCache'],
|
|
40
|
-
data () {
|
|
41
|
-
return {
|
|
42
|
-
options: []
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
computed: {
|
|
46
|
-
selectValue: {
|
|
47
|
-
set (value) {
|
|
48
|
-
if (this.multi) {
|
|
49
|
-
return this.$emit('input', value.join())
|
|
50
|
-
}
|
|
51
|
-
this.$emit('input', value)
|
|
52
|
-
},
|
|
53
|
-
get () {
|
|
54
|
-
if (this.multi) {
|
|
55
|
-
if (this.value === '') {
|
|
56
|
-
return []
|
|
57
|
-
}
|
|
58
|
-
return this.value.split(',')
|
|
59
|
-
}
|
|
60
|
-
return this.value
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
created () {
|
|
66
|
-
this.getOptions()
|
|
67
|
-
},
|
|
68
|
-
methods: {
|
|
69
|
-
async getOptions () {
|
|
70
|
-
if (this.enumOptionCache[this.field]) {
|
|
71
|
-
this.options = this.enumOptionCache[this.field]
|
|
72
|
-
return
|
|
73
|
-
}
|
|
74
|
-
const res = await getEnumOptions(this.target, this.field)
|
|
75
|
-
if (res.code !== 0) {
|
|
76
|
-
return this.$message.error(res.msg)
|
|
77
|
-
}
|
|
78
|
-
this.options = res.data
|
|
79
|
-
this.enumOptionCache[this.field] = res.data
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
</script>
|
|
84
|
-
|
|
85
|
-
<style lang="less" scoped>
|
|
86
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<el-select
|
|
3
|
+
:value="selectValue"
|
|
4
|
+
:popper-append-to-body="false"
|
|
5
|
+
size="mini"
|
|
6
|
+
filterable
|
|
7
|
+
clearable
|
|
8
|
+
placeholder=""
|
|
9
|
+
:multiple="multi"
|
|
10
|
+
collapse-tags
|
|
11
|
+
:disabled="disabled"
|
|
12
|
+
style="display:block"
|
|
13
|
+
@input="selectValue = $event"
|
|
14
|
+
>
|
|
15
|
+
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.enumId" />
|
|
16
|
+
</el-select>
|
|
17
|
+
</template>
|
|
18
|
+
<script>
|
|
19
|
+
import { getEnumOptions } from '@/api/tableV3.js'
|
|
20
|
+
export default {
|
|
21
|
+
props: {
|
|
22
|
+
value: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ''
|
|
25
|
+
},
|
|
26
|
+
disabled: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false
|
|
29
|
+
},
|
|
30
|
+
multi: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false
|
|
33
|
+
},
|
|
34
|
+
field: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: '2'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
inject: ['target', 'enumOptionCache'],
|
|
40
|
+
data () {
|
|
41
|
+
return {
|
|
42
|
+
options: []
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
computed: {
|
|
46
|
+
selectValue: {
|
|
47
|
+
set (value) {
|
|
48
|
+
if (this.multi) {
|
|
49
|
+
return this.$emit('input', value.join())
|
|
50
|
+
}
|
|
51
|
+
this.$emit('input', value)
|
|
52
|
+
},
|
|
53
|
+
get () {
|
|
54
|
+
if (this.multi) {
|
|
55
|
+
if (this.value === '') {
|
|
56
|
+
return []
|
|
57
|
+
}
|
|
58
|
+
return this.value.split(',')
|
|
59
|
+
}
|
|
60
|
+
return this.value
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
},
|
|
65
|
+
created () {
|
|
66
|
+
this.getOptions()
|
|
67
|
+
},
|
|
68
|
+
methods: {
|
|
69
|
+
async getOptions () {
|
|
70
|
+
if (this.enumOptionCache[this.field]) {
|
|
71
|
+
this.options = this.enumOptionCache[this.field]
|
|
72
|
+
return
|
|
73
|
+
}
|
|
74
|
+
const res = await getEnumOptions(this.target, this.field)
|
|
75
|
+
if (res.code !== 0) {
|
|
76
|
+
return this.$message.error(res.msg)
|
|
77
|
+
}
|
|
78
|
+
this.options = res.data
|
|
79
|
+
this.enumOptionCache[this.field] = res.data
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<style lang="less" scoped>
|
|
86
|
+
</style>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const fieldType = {
|
|
2
|
-
PARAM_TEXT: 'input',
|
|
3
|
-
PARAM_TIME_LONG: 'datetime',
|
|
4
|
-
PARAM_TIME_SHORT: 'date',
|
|
5
|
-
PARAM_ENUM: 'enum',
|
|
6
|
-
PARAM_BASIC: 'basic',
|
|
7
|
-
PARAM_NUMBER: 'number'
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export default fieldType
|
|
1
|
+
const fieldType = {
|
|
2
|
+
PARAM_TEXT: 'input',
|
|
3
|
+
PARAM_TIME_LONG: 'datetime',
|
|
4
|
+
PARAM_TIME_SHORT: 'date',
|
|
5
|
+
PARAM_ENUM: 'enum',
|
|
6
|
+
PARAM_BASIC: 'basic',
|
|
7
|
+
PARAM_NUMBER: 'number'
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default fieldType
|
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
const typeEnum = {
|
|
2
|
-
/**
|
|
3
|
-
* 文本类型
|
|
4
|
-
*/
|
|
5
|
-
input: [
|
|
6
|
-
{ label: '等于', value: 'TEXT_EQUAL', strict: true },
|
|
7
|
-
{ label: '包含', value: 'TEXT_LIKE', isFrezz: true },
|
|
8
|
-
{ label: '不等于', value: 'TEXT_UNEQUAL' },
|
|
9
|
-
{ label: '不包含', value: 'TEXT_NOT_LIKE' }
|
|
10
|
-
],
|
|
11
|
-
|
|
12
|
-
// 基础资料类型
|
|
13
|
-
basic: [
|
|
14
|
-
{ label: '等于', value: 'BASIC_EQUAL', strict: true },
|
|
15
|
-
{ label: '包含', value: 'BASIC_LIKE', isFrezz: true },
|
|
16
|
-
{ label: '不等于', value: 'BASIC_UNEQUAL' },
|
|
17
|
-
{ label: '不包含', value: 'BASIC_NOT_LIKE' }
|
|
18
|
-
],
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* 时间类型
|
|
22
|
-
*/
|
|
23
|
-
// 短时间
|
|
24
|
-
date: [
|
|
25
|
-
{ label: '大于', value: 'TIME_MORE_SHORT' },
|
|
26
|
-
{ label: '小于', value: 'TIME_LESS_SHORT' },
|
|
27
|
-
{ label: '大于等于', value: 'TIME_MORE_EQ_SHORT' },
|
|
28
|
-
{ label: '小于等于', value: 'TIME_LESS_EQ_SHORT' },
|
|
29
|
-
{ label: '等于', value: 'TIME_EQUAL_SHORT' },
|
|
30
|
-
// { label: '在...中', value: 'TIME_EQUAL_SHORT_BETWEEN', range: true },
|
|
31
|
-
// 时间通用
|
|
32
|
-
{ label: '前天', value: 'TIME_BEFORE_YESTERDAY', over: true },
|
|
33
|
-
{ label: '昨天', value: 'TIME_YESTERDAY', over: true },
|
|
34
|
-
{ label: '今天', value: 'TIME_TODAY', over: true },
|
|
35
|
-
{ label: '明天', value: 'TIME_TOMORROW', over: true },
|
|
36
|
-
{ label: '后天', value: 'TIME_AFTER_TOMORROW', over: true },
|
|
37
|
-
{ label: '上周', value: 'TIME_LAST_WEEK', over: true },
|
|
38
|
-
{ label: '本周', value: 'TIME_WEEK', over: true },
|
|
39
|
-
{ label: '下周', value: 'TIME_NEXT_WEEK', over: true },
|
|
40
|
-
{ label: '本月', value: 'TIME_MONTH', over: true },
|
|
41
|
-
{ label: '上月', value: 'TIME_LAST_MONTH', over: true }
|
|
42
|
-
],
|
|
43
|
-
// 长时间
|
|
44
|
-
datetime: [
|
|
45
|
-
{ label: '大于', value: 'TIME_MORE_LONG' },
|
|
46
|
-
{ label: '大于等于', value: 'TIME_MORE_EQ_LONG' },
|
|
47
|
-
{ label: '等于', value: 'TIME_EQUAL_LONG' },
|
|
48
|
-
{ label: '小于等于', value: 'TIME_LESS_EQ_LONG' },
|
|
49
|
-
{ label: '小于', value: 'TIME_LESS' },
|
|
50
|
-
// { label: '在...中', value: 'TIME_EQUAL_BETWEEN', range: true },
|
|
51
|
-
// 时间通用
|
|
52
|
-
{ label: '前天', value: 'TIME_BEFORE_YESTERDAY', over: true },
|
|
53
|
-
{ label: '昨天', value: 'TIME_YESTERDAY', over: true },
|
|
54
|
-
{ label: '今天', value: 'TIME_TODAY', over: true },
|
|
55
|
-
{ label: '明天', value: 'TIME_TOMORROW', over: true },
|
|
56
|
-
{ label: '后天', value: 'TIME_AFTER_TOMORROW', over: true },
|
|
57
|
-
{ label: '上周', value: 'TIME_LAST_WEEK', over: true },
|
|
58
|
-
{ label: '本周', value: 'TIME_WEEK', over: true },
|
|
59
|
-
{ label: '下周', value: 'TIME_NEXT_WEEK', over: true },
|
|
60
|
-
{ label: '本月', value: 'TIME_MONTH', over: true },
|
|
61
|
-
{ label: '上月', value: 'TIME_LAST_MONTH', over: true }
|
|
62
|
-
],
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* 枚举类型
|
|
66
|
-
*/
|
|
67
|
-
enum: [
|
|
68
|
-
{ label: '等于', value: 'ENUM_EQUAL', strict: true },
|
|
69
|
-
{ label: '不等于', value: 'ENUM_UNEQUAL', isFrezz: true },
|
|
70
|
-
{ label: '在...中', value: 'ENUM_IN', multi: true },
|
|
71
|
-
{ label: '不在...中', value: 'ENUM_NOT_IN', multi: true }
|
|
72
|
-
],
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* 数字类型
|
|
76
|
-
*/
|
|
77
|
-
number: [
|
|
78
|
-
{ label: '大于', value: 'NUMBER_MORE' },
|
|
79
|
-
{ label: '大于等于', value: 'NUMBER_MORE_EQUAL' },
|
|
80
|
-
{ label: '等于', value: 'NUMBER_EQUAL', strict: true },
|
|
81
|
-
{ label: '不等于', value: 'NUMBER_NOT_EQUAL' },
|
|
82
|
-
{ label: '小于', value: 'NUMBER_LESS' },
|
|
83
|
-
{ label: '小于等于', value: 'NUMBER_LESS_EQUAL' },
|
|
84
|
-
{ label: '在...中', value: 'NUMBER_BETWEEN', range: true }
|
|
85
|
-
]
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* 所有的不需要输入值的选项的操作符
|
|
90
|
-
* @returns string[]
|
|
91
|
-
*/
|
|
92
|
-
export function getAllOverOperatorList () {
|
|
93
|
-
const overOptions = []
|
|
94
|
-
for (const key in typeEnum) {
|
|
95
|
-
for (const option of typeEnum[key]) {
|
|
96
|
-
option.over && !overOptions.find(item => item === option.value) && overOptions.push(option.value)
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return overOptions
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export default function getOperatorOption (type) {
|
|
103
|
-
// todo: 优化一下判断次数???
|
|
104
|
-
if (type === 'decimal' || type === 'integer') {
|
|
105
|
-
type = 'number'
|
|
106
|
-
}
|
|
107
|
-
return typeEnum[type]
|
|
108
|
-
}
|
|
1
|
+
const typeEnum = {
|
|
2
|
+
/**
|
|
3
|
+
* 文本类型
|
|
4
|
+
*/
|
|
5
|
+
input: [
|
|
6
|
+
{ label: '等于', value: 'TEXT_EQUAL', strict: true },
|
|
7
|
+
{ label: '包含', value: 'TEXT_LIKE', isFrezz: true },
|
|
8
|
+
{ label: '不等于', value: 'TEXT_UNEQUAL' },
|
|
9
|
+
{ label: '不包含', value: 'TEXT_NOT_LIKE' }
|
|
10
|
+
],
|
|
11
|
+
|
|
12
|
+
// 基础资料类型
|
|
13
|
+
basic: [
|
|
14
|
+
{ label: '等于', value: 'BASIC_EQUAL', strict: true },
|
|
15
|
+
{ label: '包含', value: 'BASIC_LIKE', isFrezz: true },
|
|
16
|
+
{ label: '不等于', value: 'BASIC_UNEQUAL' },
|
|
17
|
+
{ label: '不包含', value: 'BASIC_NOT_LIKE' }
|
|
18
|
+
],
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 时间类型
|
|
22
|
+
*/
|
|
23
|
+
// 短时间
|
|
24
|
+
date: [
|
|
25
|
+
{ label: '大于', value: 'TIME_MORE_SHORT' },
|
|
26
|
+
{ label: '小于', value: 'TIME_LESS_SHORT' },
|
|
27
|
+
{ label: '大于等于', value: 'TIME_MORE_EQ_SHORT' },
|
|
28
|
+
{ label: '小于等于', value: 'TIME_LESS_EQ_SHORT' },
|
|
29
|
+
{ label: '等于', value: 'TIME_EQUAL_SHORT' },
|
|
30
|
+
// { label: '在...中', value: 'TIME_EQUAL_SHORT_BETWEEN', range: true },
|
|
31
|
+
// 时间通用
|
|
32
|
+
{ label: '前天', value: 'TIME_BEFORE_YESTERDAY', over: true },
|
|
33
|
+
{ label: '昨天', value: 'TIME_YESTERDAY', over: true },
|
|
34
|
+
{ label: '今天', value: 'TIME_TODAY', over: true },
|
|
35
|
+
{ label: '明天', value: 'TIME_TOMORROW', over: true },
|
|
36
|
+
{ label: '后天', value: 'TIME_AFTER_TOMORROW', over: true },
|
|
37
|
+
{ label: '上周', value: 'TIME_LAST_WEEK', over: true },
|
|
38
|
+
{ label: '本周', value: 'TIME_WEEK', over: true },
|
|
39
|
+
{ label: '下周', value: 'TIME_NEXT_WEEK', over: true },
|
|
40
|
+
{ label: '本月', value: 'TIME_MONTH', over: true },
|
|
41
|
+
{ label: '上月', value: 'TIME_LAST_MONTH', over: true }
|
|
42
|
+
],
|
|
43
|
+
// 长时间
|
|
44
|
+
datetime: [
|
|
45
|
+
{ label: '大于', value: 'TIME_MORE_LONG' },
|
|
46
|
+
{ label: '大于等于', value: 'TIME_MORE_EQ_LONG' },
|
|
47
|
+
{ label: '等于', value: 'TIME_EQUAL_LONG' },
|
|
48
|
+
{ label: '小于等于', value: 'TIME_LESS_EQ_LONG' },
|
|
49
|
+
{ label: '小于', value: 'TIME_LESS' },
|
|
50
|
+
// { label: '在...中', value: 'TIME_EQUAL_BETWEEN', range: true },
|
|
51
|
+
// 时间通用
|
|
52
|
+
{ label: '前天', value: 'TIME_BEFORE_YESTERDAY', over: true },
|
|
53
|
+
{ label: '昨天', value: 'TIME_YESTERDAY', over: true },
|
|
54
|
+
{ label: '今天', value: 'TIME_TODAY', over: true },
|
|
55
|
+
{ label: '明天', value: 'TIME_TOMORROW', over: true },
|
|
56
|
+
{ label: '后天', value: 'TIME_AFTER_TOMORROW', over: true },
|
|
57
|
+
{ label: '上周', value: 'TIME_LAST_WEEK', over: true },
|
|
58
|
+
{ label: '本周', value: 'TIME_WEEK', over: true },
|
|
59
|
+
{ label: '下周', value: 'TIME_NEXT_WEEK', over: true },
|
|
60
|
+
{ label: '本月', value: 'TIME_MONTH', over: true },
|
|
61
|
+
{ label: '上月', value: 'TIME_LAST_MONTH', over: true }
|
|
62
|
+
],
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 枚举类型
|
|
66
|
+
*/
|
|
67
|
+
enum: [
|
|
68
|
+
{ label: '等于', value: 'ENUM_EQUAL', strict: true },
|
|
69
|
+
{ label: '不等于', value: 'ENUM_UNEQUAL', isFrezz: true },
|
|
70
|
+
{ label: '在...中', value: 'ENUM_IN', multi: true },
|
|
71
|
+
{ label: '不在...中', value: 'ENUM_NOT_IN', multi: true }
|
|
72
|
+
],
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* 数字类型
|
|
76
|
+
*/
|
|
77
|
+
number: [
|
|
78
|
+
{ label: '大于', value: 'NUMBER_MORE' },
|
|
79
|
+
{ label: '大于等于', value: 'NUMBER_MORE_EQUAL' },
|
|
80
|
+
{ label: '等于', value: 'NUMBER_EQUAL', strict: true },
|
|
81
|
+
{ label: '不等于', value: 'NUMBER_NOT_EQUAL' },
|
|
82
|
+
{ label: '小于', value: 'NUMBER_LESS' },
|
|
83
|
+
{ label: '小于等于', value: 'NUMBER_LESS_EQUAL' },
|
|
84
|
+
{ label: '在...中', value: 'NUMBER_BETWEEN', range: true }
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* 所有的不需要输入值的选项的操作符
|
|
90
|
+
* @returns string[]
|
|
91
|
+
*/
|
|
92
|
+
export function getAllOverOperatorList () {
|
|
93
|
+
const overOptions = []
|
|
94
|
+
for (const key in typeEnum) {
|
|
95
|
+
for (const option of typeEnum[key]) {
|
|
96
|
+
option.over && !overOptions.find(item => item === option.value) && overOptions.push(option.value)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return overOptions
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export default function getOperatorOption (type) {
|
|
103
|
+
// todo: 优化一下判断次数???
|
|
104
|
+
if (type === 'decimal' || type === 'integer') {
|
|
105
|
+
type = 'number'
|
|
106
|
+
}
|
|
107
|
+
return typeEnum[type]
|
|
108
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const paramsEnum = {
|
|
2
|
-
LIST: 'LIST',
|
|
3
|
-
SELECTOR: 'SELECTOR'
|
|
4
|
-
}
|
|
1
|
+
export const paramsEnum = {
|
|
2
|
+
LIST: 'LIST',
|
|
3
|
+
SELECTOR: 'SELECTOR'
|
|
4
|
+
}
|