@tongfun/tf-widget 0.1.8-beta → 0.1.9
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 +4 -1
- package/dist/css/chunk-9c7a8e06.920744ef.css +1 -0
- package/dist/css/{chunk-vendors.a16c4353.css → chunk-vendors.de967301.css} +1 -1
- package/dist/css/index.9f1afeaf.css +1 -0
- package/dist/js/chunk-9c7a8e06.ffff58b5.js +1 -0
- package/dist/js/chunk-vendors.45086d09.js +39 -0
- package/dist/js/index.a3b16e45.js +1 -0
- package/package/t-data-list/index.js +6 -0
- package/package/t-data-list/main.vue +192 -0
- package/package/t-data-list/src/condition-input/basic.vue +31 -0
- package/package/t-data-list/src/condition-input/date.vue +106 -0
- package/package/t-data-list/src/condition-input/index.vue +100 -0
- package/package/t-data-list/src/condition-input/input.vue +31 -0
- package/package/t-data-list/src/condition-input/number.vue +115 -0
- package/package/t-data-list/src/condition-input/select.vue +86 -0
- package/package/t-data-list/src/js/fieldTypeEnum.js +10 -0
- package/package/t-data-list/src/js/operatorEnum.js +109 -0
- package/package/t-data-list/src/js/qureyParamsEnum.js +4 -0
- package/package/t-data-list/src/js/util.js +34 -0
- package/package/t-data-list/src/mixins/button-controll-mixin.js +77 -0
- package/package/t-data-list/src/pushdown/push-down.vue +158 -0
- package/package/t-data-list/src/t-list-search.vue +32 -0
- package/package/t-data-list/src/t-plan/condition-always-item.vue +143 -0
- package/package/t-data-list/src/t-plan/condition-mult-item.vue +222 -0
- package/package/t-data-list/src/t-plan/index.vue +190 -0
- package/package/t-data-list/src/t-plan/plan-content.vue +396 -0
- package/package/t-data-list/src/t-table/index.vue +120 -0
- package/package/t-data-list/src/t-table/table-group-item-edit.vue +238 -0
- package/package/t-data-list/src/t-table/table-group-item.vue +87 -0
- package/package/t-data-list/src/t-table/table-group.vue +179 -0
- package/package/t-data-list/src/t-table/table-records-header-popover.vue +250 -0
- package/package/t-data-list/src/t-table/table-records-selected.vue +159 -0
- package/package/t-data-list/src/t-table/table-records.vue +324 -0
- package/package/t-input/children/address.vue +101 -0
- package/package/t-input/children/basic-display.vue +41 -0
- package/package/t-input/children/basic.vue +251 -0
- package/package/t-input/children/date.vue +89 -0
- package/package/t-input/children/group-components/group-dialog.vue +350 -0
- package/package/t-input/children/group.vue +126 -0
- package/package/t-input/children/input.vue +72 -0
- package/package/t-input/children/number.vue +74 -0
- package/package/t-input/children/select.vue +89 -0
- package/package/t-input/children/tfile/fiile-enclosure.vue +233 -0
- package/package/t-input/children/tfile/file-img/comp.png +0 -0
- package/package/t-input/children/tfile/file-img/excel.png +0 -0
- package/package/t-input/children/tfile/file-img/img.png +0 -0
- package/package/t-input/children/tfile/file-img/pdf.png +0 -0
- package/package/t-input/children/tfile/file-img/word.png +0 -0
- package/package/t-input/index.js +7 -0
- package/package/t-input/index.vue +337 -0
- package/package/t-input/tInputCache.js +24 -0
- package/package/tf-layout/README.md +69 -2
- package/package/tf-layout/src/components/tf-labelbar.vue +90 -75
- package/package/tf-layout/src/components/tf-menu.vue +21 -8
- package/package/tf-layout/src/tf-layout.vue +18 -7
- package/package.json +4 -2
- package/src/api/file-enclosure.js +26 -0
- package/src/api/push-down.js +19 -0
- package/src/api/tableV3.js +186 -0
- package/src/index.js +8 -2
- package/src/mixins/t-data-query-mixin.js +289 -0
- package/dist/css/index.f35459d8.css +0 -1
- package/dist/js/chunk-vendors.c86d3e60.js +0 -41
- package/dist/js/index.36f35563.js +0 -1
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="condition-item">
|
|
3
|
+
<!-- 左侧括号 -->
|
|
4
|
+
<el-select v-model="condition.leftBracket" :popper-append-to-body="false" size="mini" class="bracket" placeholder="">
|
|
5
|
+
<el-option lable="(" value="(" />
|
|
6
|
+
<el-option lable="((" value="((" />
|
|
7
|
+
<el-option lable="(((" value="(((" />
|
|
8
|
+
</el-select>
|
|
9
|
+
|
|
10
|
+
<!-- 字段名 -->
|
|
11
|
+
<el-select v-model="condition.field" :popper-append-to-body="false" size="mini" placeholder="" class="condition-field" @change="handleFieldSelect">
|
|
12
|
+
<el-option
|
|
13
|
+
v-for="option in fieldsOptions"
|
|
14
|
+
:key="option.field"
|
|
15
|
+
:label="option.title"
|
|
16
|
+
:value="option.field"
|
|
17
|
+
/>
|
|
18
|
+
</el-select>
|
|
19
|
+
|
|
20
|
+
<!-- 运算符 -->
|
|
21
|
+
<el-select v-model="condition.operator" :popper-append-to-body="false" size="mini" placeholder="" class="condition-operator">
|
|
22
|
+
<el-option
|
|
23
|
+
v-for="option in operatorOptions"
|
|
24
|
+
:key="option.value"
|
|
25
|
+
:label="option.label"
|
|
26
|
+
:value="option.value"
|
|
27
|
+
/>
|
|
28
|
+
</el-select>
|
|
29
|
+
|
|
30
|
+
<!-- 值 -->
|
|
31
|
+
<ConditionInput
|
|
32
|
+
v-model="condition.value"
|
|
33
|
+
:disabled="inputDisabled"
|
|
34
|
+
:type="inputType"
|
|
35
|
+
:field="condition.field"
|
|
36
|
+
:multi="multiSelect"
|
|
37
|
+
:range="range"
|
|
38
|
+
/>
|
|
39
|
+
|
|
40
|
+
<!-- 右侧括号 -->
|
|
41
|
+
<el-select v-model="condition.rightBracket" :popper-append-to-body="false" class="bracket" size="mini" placeholder="">
|
|
42
|
+
<el-option label=")" value=")" />
|
|
43
|
+
<el-option label="))" value="))" />
|
|
44
|
+
<el-option label=")))" value=")))" />
|
|
45
|
+
</el-select>
|
|
46
|
+
|
|
47
|
+
<!-- 条件之间的逻辑运算符 -->
|
|
48
|
+
<el-select v-model="condition.relation" :popper-append-to-body="false" size="mini" class="condition-relation" placeholder="">
|
|
49
|
+
<el-option value="AND" label="并且" />
|
|
50
|
+
<el-option value="OR" label="或者" />
|
|
51
|
+
</el-select>
|
|
52
|
+
|
|
53
|
+
<!-- 移除条件按钮 -->
|
|
54
|
+
<i class="el-icon-remove icon" @click="removeCondition" />
|
|
55
|
+
</div>
|
|
56
|
+
</template>
|
|
57
|
+
<script>
|
|
58
|
+
import getOperatorOption from '../js/operatorEnum.js'
|
|
59
|
+
import ConditionInput from '../condition-input'
|
|
60
|
+
import FieldTypeEnum from '../js/fieldTypeEnum.js'
|
|
61
|
+
export default {
|
|
62
|
+
name: 'ConditionItem',
|
|
63
|
+
components: {
|
|
64
|
+
ConditionInput
|
|
65
|
+
},
|
|
66
|
+
props: {
|
|
67
|
+
condition: {
|
|
68
|
+
type: Object,
|
|
69
|
+
default: null
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
data () {
|
|
73
|
+
return {
|
|
74
|
+
selectData: {
|
|
75
|
+
field: {}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
computed: {
|
|
80
|
+
/**
|
|
81
|
+
* 字段相关
|
|
82
|
+
*/
|
|
83
|
+
// 字段的可选选项
|
|
84
|
+
fieldsOptions () {
|
|
85
|
+
this.getFieldsOption().forEach(e => {
|
|
86
|
+
this.selectData.field[e.field] = e
|
|
87
|
+
})
|
|
88
|
+
return this.getFieldsOption()
|
|
89
|
+
},
|
|
90
|
+
// 当前选择的字段
|
|
91
|
+
currentField () {
|
|
92
|
+
return this.fieldsOptions.find(item => item.field === this.condition.field) || null
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* 操作符相关
|
|
97
|
+
*/
|
|
98
|
+
// 当前字段对应的操作符可选选项
|
|
99
|
+
operatorOptions () {
|
|
100
|
+
if (!this.currentField) {
|
|
101
|
+
return []
|
|
102
|
+
}
|
|
103
|
+
return getOperatorOption(FieldTypeEnum[this.currentField.componentValueType])
|
|
104
|
+
},
|
|
105
|
+
// 当前选中的操作符选项
|
|
106
|
+
currentOperatorOption () {
|
|
107
|
+
return this.operatorOptions.find(item => item.value === this.condition.operator) || null
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* 值相关
|
|
112
|
+
*/
|
|
113
|
+
inputType () {
|
|
114
|
+
if (!this.currentField) {
|
|
115
|
+
return 'input'
|
|
116
|
+
}
|
|
117
|
+
return FieldTypeEnum[this.currentField.componentValueType]
|
|
118
|
+
},
|
|
119
|
+
// 如果值是枚举类型,是否要开启select的多选模式
|
|
120
|
+
multiSelect () {
|
|
121
|
+
const currentOperatorOption = this.operatorOptions.find(item => item.value === this.condition.operator)
|
|
122
|
+
return currentOperatorOption && currentOperatorOption.multi
|
|
123
|
+
},
|
|
124
|
+
range () {
|
|
125
|
+
const currentOperatorOption = this.operatorOptions.find(item => item.value === this.condition.operator)
|
|
126
|
+
return currentOperatorOption && currentOperatorOption.range
|
|
127
|
+
},
|
|
128
|
+
// 值输入控件是否关闭
|
|
129
|
+
inputDisabled () {
|
|
130
|
+
if (!this.condition.field) {
|
|
131
|
+
return true
|
|
132
|
+
}
|
|
133
|
+
const currentOperatorOption = this.operatorOptions.find(item => item.value === this.condition.operator)
|
|
134
|
+
if (!currentOperatorOption) {
|
|
135
|
+
return true
|
|
136
|
+
}
|
|
137
|
+
return currentOperatorOption.over
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
watch: {
|
|
141
|
+
// 当字段发生了变化,清空之前的字段的之后输入的内容,并将操作符切换到第一个
|
|
142
|
+
'condition.field' (newValue) {
|
|
143
|
+
this.condition.value = ''
|
|
144
|
+
this.$nextTick(() => {
|
|
145
|
+
this.condition.operator = this.operatorOptions[0].value
|
|
146
|
+
})
|
|
147
|
+
},
|
|
148
|
+
// 监听运算符选项的变化,清空输入框的值
|
|
149
|
+
'condition.operator' (newValue) {
|
|
150
|
+
this.condition.value = ''
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
created () {
|
|
154
|
+
/**
|
|
155
|
+
* 点击新增按钮添加的条件,需要进行初始化
|
|
156
|
+
*
|
|
157
|
+
*/
|
|
158
|
+
if (!this.condition.field) {
|
|
159
|
+
this.condition.field = this.fieldsOptions[0].field
|
|
160
|
+
this.condition.fieldType = this.fieldsOptions[0].componentType
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
inject: ['getFieldsOption'],
|
|
164
|
+
methods: {
|
|
165
|
+
removeCondition () {
|
|
166
|
+
this.$emit('remove')
|
|
167
|
+
},
|
|
168
|
+
// 绑定fieldType的值
|
|
169
|
+
handleFieldSelect (field) {
|
|
170
|
+
this.condition.fieldType = this.selectData.field[field].componentType
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
</script>
|
|
175
|
+
|
|
176
|
+
<style scoped lang='less'>
|
|
177
|
+
.condition-item {
|
|
178
|
+
margin:10px 0;
|
|
179
|
+
display:flex;
|
|
180
|
+
//左右括号
|
|
181
|
+
.bracket {
|
|
182
|
+
::v-deep .el-input__inner {
|
|
183
|
+
width:70px;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
//字段选择框
|
|
188
|
+
.condition-field {
|
|
189
|
+
::v-deep .el-input__inner {
|
|
190
|
+
width:140px;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// 条件运算符,选择框
|
|
195
|
+
.condition-operator{
|
|
196
|
+
::v-deep .el-input__inner {
|
|
197
|
+
width:100px;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
//值输入框
|
|
202
|
+
|
|
203
|
+
// 条件直接的逻辑关系
|
|
204
|
+
.condition-relation {
|
|
205
|
+
::v-deep .el-input__inner {
|
|
206
|
+
width:76px;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.el-icon-remove {
|
|
211
|
+
color:gainsboro;
|
|
212
|
+
display:flex;
|
|
213
|
+
align-items: center;
|
|
214
|
+
justify-content: center;
|
|
215
|
+
font-size:15px;
|
|
216
|
+
margin-left:7px;
|
|
217
|
+
}
|
|
218
|
+
.icon:hover {
|
|
219
|
+
color:red !important;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
</style>
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="t-plan">
|
|
3
|
+
<!-- 展开关闭方案详情的按钮 -->
|
|
4
|
+
<div
|
|
5
|
+
:class="['plan-expanser',showExpanse?'expanse-active':'']"
|
|
6
|
+
@mouseup.stop="showExpanse = !showExpanse"
|
|
7
|
+
>
|
|
8
|
+
<span>{{ showExpanse ? '收起方案' : '展开方案' }}</span>
|
|
9
|
+
<i :class="[showExpanse? 'el-icon-arrow-up':'el-icon-arrow-down']" />
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<!-- 过滤方案列表 -->
|
|
13
|
+
<div class="plan-list">
|
|
14
|
+
<span class="title">过滤方案:</span>
|
|
15
|
+
<draggble v-model="planList" class="draggble-wraper" @start="handleStart" @end="handleEnd">
|
|
16
|
+
<div
|
|
17
|
+
v-for="plan in planList"
|
|
18
|
+
:key="plan.id"
|
|
19
|
+
:class="['plan-item',isActive(plan.id)?'plan-active':'']"
|
|
20
|
+
@click="handlePlanClick(plan.id)"
|
|
21
|
+
>
|
|
22
|
+
<span>{{ plan.name }}</span>
|
|
23
|
+
</div>
|
|
24
|
+
</draggble>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<!-- 当先选中的方案详情 -->
|
|
28
|
+
<planContent
|
|
29
|
+
ref="planContentRef"
|
|
30
|
+
:visible.sync="showExpanse"
|
|
31
|
+
:plan-names="planNameList"
|
|
32
|
+
:content="currentPlan"
|
|
33
|
+
@listChange="handleListChange"
|
|
34
|
+
@change="handleChange"
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
<script>
|
|
39
|
+
import draggble from 'vuedraggable'
|
|
40
|
+
import planContent from './plan-content.vue'
|
|
41
|
+
import { getFilterPlan } from '@/api/tableV3.js'
|
|
42
|
+
export default {
|
|
43
|
+
components: {
|
|
44
|
+
draggble, planContent
|
|
45
|
+
},
|
|
46
|
+
props: {
|
|
47
|
+
// 表的布局,作为高级过滤的字段可选项目
|
|
48
|
+
fieldsOption: {
|
|
49
|
+
type: Array,
|
|
50
|
+
default: null
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
data () {
|
|
54
|
+
return {
|
|
55
|
+
showExpanse: false,
|
|
56
|
+
currentPlanId: '',
|
|
57
|
+
planList: []
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
computed: {
|
|
61
|
+
// 目前所有方案列表的内容,用来在新增方案的时候你,进行判断相同名称的方案是否已经存在
|
|
62
|
+
planNameList () {
|
|
63
|
+
const planNameList = []
|
|
64
|
+
for (const plan of this.planList) {
|
|
65
|
+
planNameList.push(plan.name)
|
|
66
|
+
}
|
|
67
|
+
return planNameList
|
|
68
|
+
},
|
|
69
|
+
// 计算是否使用激活状态下的样式
|
|
70
|
+
isActive () {
|
|
71
|
+
return function (planId) {
|
|
72
|
+
return this.currentPlanId === planId
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
currentPlan () {
|
|
76
|
+
const emptyContent = {
|
|
77
|
+
name: '',
|
|
78
|
+
schemeUsefulList: [],
|
|
79
|
+
contentsList: []
|
|
80
|
+
}
|
|
81
|
+
return this.planList.find(item => item.id === this.currentPlanId) || emptyContent
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
provide () {
|
|
85
|
+
return {
|
|
86
|
+
getFieldsOption: () => this.fieldsOption
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
inject: ['target'],
|
|
90
|
+
created () {
|
|
91
|
+
this.getFilterPlan()
|
|
92
|
+
},
|
|
93
|
+
methods: {
|
|
94
|
+
/**
|
|
95
|
+
* 获取方案列表
|
|
96
|
+
* 并切换到指定方案(选中状态)
|
|
97
|
+
*/
|
|
98
|
+
async getFilterPlan (selectId) {
|
|
99
|
+
const res = await getFilterPlan(this.target)
|
|
100
|
+
if (res.code !== 0) {
|
|
101
|
+
return this.$message.error(res.msg)
|
|
102
|
+
}
|
|
103
|
+
this.planList = res.data
|
|
104
|
+
this.currentPlanId = selectId || this.planList.find(item => item.isDefault).id
|
|
105
|
+
!selectId && this.$refs.planContentRef.$emit('doSearch')
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* 方案被添加或者删除,导致方案数量发生了变化
|
|
110
|
+
*/
|
|
111
|
+
handleListChange (planId) {
|
|
112
|
+
this.getFilterPlan(planId)
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* 方案被点击切换方法并查询数据
|
|
117
|
+
*/
|
|
118
|
+
handlePlanClick (planId) {
|
|
119
|
+
if (this.currentPlanId === planId) {
|
|
120
|
+
return
|
|
121
|
+
}
|
|
122
|
+
this.currentPlanId = planId
|
|
123
|
+
this.$refs.planContentRef.$emit('doSearch')
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
*
|
|
128
|
+
*/
|
|
129
|
+
handleChange (condition) {
|
|
130
|
+
this.$emit('change', condition)
|
|
131
|
+
},
|
|
132
|
+
/**
|
|
133
|
+
* 方案列表的拖动
|
|
134
|
+
*/
|
|
135
|
+
handleStart () {
|
|
136
|
+
|
|
137
|
+
},
|
|
138
|
+
handleEnd () {
|
|
139
|
+
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
</script>
|
|
144
|
+
|
|
145
|
+
<style scoped lang='less'>
|
|
146
|
+
.t-plan {
|
|
147
|
+
position:relative;
|
|
148
|
+
margin:1vh 0;
|
|
149
|
+
padding-bottom:5px;
|
|
150
|
+
display:flex;
|
|
151
|
+
|
|
152
|
+
.plan-expanser{
|
|
153
|
+
cursor: pointer;
|
|
154
|
+
user-select:none;
|
|
155
|
+
margin-right:10px;
|
|
156
|
+
color:#0a5295;
|
|
157
|
+
span {
|
|
158
|
+
font-size:15px;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
.expanse-active {
|
|
162
|
+
// background-color: #f6f7f9;
|
|
163
|
+
color:black;
|
|
164
|
+
// border:1px solid gray;
|
|
165
|
+
border-bottom:none;
|
|
166
|
+
// box-shadow: 1px 1px 4px 1px rgba(0,0,0,0.2);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.plan-list {
|
|
170
|
+
display:flex;
|
|
171
|
+
font-size: 15px;
|
|
172
|
+
.title {
|
|
173
|
+
margin-right:10px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.draggble-wraper {
|
|
177
|
+
display:flex;
|
|
178
|
+
.plan-item{
|
|
179
|
+
cursor: pointer;
|
|
180
|
+
margin-right:7px;
|
|
181
|
+
}
|
|
182
|
+
.plan-active {
|
|
183
|
+
color:#0a5295;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
</style>
|