@tongfun/tf-widget 0.1.20 → 0.1.21
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 -46
- package/lib/tf-widget.common.js +460 -416
- package/lib/tf-widget.css +1 -1
- package/lib/tf-widget.umd.js +460 -416
- package/lib/tf-widget.umd.min.js +3 -3
- 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 -382
- 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 -120
- 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 +160 -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,180 +1,180 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="table-group">
|
|
3
|
-
<!-- 节点搜索 -->
|
|
4
|
-
<el-input v-model="search" placeholder="请输入节点名称" />
|
|
5
|
-
|
|
6
|
-
<!-- 节点展示 -->
|
|
7
|
-
<el-scrollbar :class="[queryType === 'LIST' ? 'scrollbar' :'in-selector']">
|
|
8
|
-
<el-tree
|
|
9
|
-
ref="treeRef"
|
|
10
|
-
:data="dataTree"
|
|
11
|
-
node-key="id"
|
|
12
|
-
icon-class="nothing but won`t show any icon"
|
|
13
|
-
:default-expanded-keys="expandKeys"
|
|
14
|
-
:filter-node-method="treeFilter"
|
|
15
|
-
@node-expand="handleNodeExpand"
|
|
16
|
-
@node-collapse="handleCollapse"
|
|
17
|
-
>
|
|
18
|
-
<template slot-scope="{node,data}">
|
|
19
|
-
<TableGroupItem
|
|
20
|
-
:current-data="currentData"
|
|
21
|
-
:data="data"
|
|
22
|
-
:node="node"
|
|
23
|
-
@addChild="handleAddChild"
|
|
24
|
-
@edit="handleEdit"
|
|
25
|
-
@remove="handleRemove"
|
|
26
|
-
@itemClick="handleItemClick"
|
|
27
|
-
/>
|
|
28
|
-
</template>
|
|
29
|
-
</el-tree>
|
|
30
|
-
</el-scrollbar>
|
|
31
|
-
|
|
32
|
-
<!-- 节点编辑 -->
|
|
33
|
-
<TableGroupItemEdit
|
|
34
|
-
:visible.sync="editVisible"
|
|
35
|
-
:edit-data="editData"
|
|
36
|
-
:node-options="dataTree"
|
|
37
|
-
:type="type"
|
|
38
|
-
@success="getGroupTree"
|
|
39
|
-
/>
|
|
40
|
-
</div>
|
|
41
|
-
</template>
|
|
42
|
-
<script>
|
|
43
|
-
import { getGroupTree, removeGroupNode } from '@/api/tableV3.js'
|
|
44
|
-
import TableGroupItem from './table-group-item.vue'
|
|
45
|
-
import TableGroupItemEdit from './table-group-item-edit.vue'
|
|
46
|
-
export default {
|
|
47
|
-
components: {
|
|
48
|
-
TableGroupItem,
|
|
49
|
-
TableGroupItemEdit
|
|
50
|
-
},
|
|
51
|
-
data () {
|
|
52
|
-
return {
|
|
53
|
-
// 本地分组过滤输入内容
|
|
54
|
-
search: '',
|
|
55
|
-
// 分组树
|
|
56
|
-
dataTree: [],
|
|
57
|
-
// 当前选中的数据
|
|
58
|
-
currentData: null,
|
|
59
|
-
// 默认展开的key
|
|
60
|
-
expandKeys: ['0'],
|
|
61
|
-
/**
|
|
62
|
-
* 分组编辑弹窗相关属性
|
|
63
|
-
*/
|
|
64
|
-
editVisible: false,
|
|
65
|
-
// 点击新增或者修改的时候,对应节点的数据对象
|
|
66
|
-
editData: {
|
|
67
|
-
groupCode: ''
|
|
68
|
-
},
|
|
69
|
-
// 新增一个节点还是修改一个节点的标识
|
|
70
|
-
type: ''
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
watch: {
|
|
74
|
-
search (value) {
|
|
75
|
-
this.$refs.treeRef.filter(value)
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
inject: ['target', 'queryType'],
|
|
79
|
-
created () {
|
|
80
|
-
this.getGroupTree()
|
|
81
|
-
},
|
|
82
|
-
methods: {
|
|
83
|
-
/**
|
|
84
|
-
* 节点展开,记录正在展开的节点
|
|
85
|
-
*/
|
|
86
|
-
handleNodeExpand (data) {
|
|
87
|
-
this.expandKeys.push(data.id)
|
|
88
|
-
},
|
|
89
|
-
handleCollapse (data) {
|
|
90
|
-
this.expandKeys.splice(this.expandKeys.indexOf(data.id), 1)
|
|
91
|
-
},
|
|
92
|
-
// 节点内容本地过滤函数
|
|
93
|
-
treeFilter (value, data) {
|
|
94
|
-
if (!value) {
|
|
95
|
-
return true
|
|
96
|
-
}
|
|
97
|
-
return data.name.indexOf(value) !== -1
|
|
98
|
-
},
|
|
99
|
-
/**
|
|
100
|
-
* 获取分组
|
|
101
|
-
*/
|
|
102
|
-
async getGroupTree () {
|
|
103
|
-
const res = await getGroupTree(this.target)
|
|
104
|
-
if (res.code !== 0) {
|
|
105
|
-
if (res.code === 10045) {
|
|
106
|
-
this.dataTree = []
|
|
107
|
-
return
|
|
108
|
-
}
|
|
109
|
-
return this.$message.error(res.msg)
|
|
110
|
-
}
|
|
111
|
-
this.dataTree = []
|
|
112
|
-
this.dataTree.push(res.data)
|
|
113
|
-
},
|
|
114
|
-
/**
|
|
115
|
-
* 切换分组
|
|
116
|
-
*/
|
|
117
|
-
handleItemClick (data) {
|
|
118
|
-
const group = {
|
|
119
|
-
field: data.field,
|
|
120
|
-
value: data.id
|
|
121
|
-
}
|
|
122
|
-
this.$emit('groupChange', group)
|
|
123
|
-
},
|
|
124
|
-
/**
|
|
125
|
-
* 显示添加分组节点窗口
|
|
126
|
-
*/
|
|
127
|
-
handleAddChild (data) {
|
|
128
|
-
this.type = 'insert'
|
|
129
|
-
this.editData = data
|
|
130
|
-
this.editVisible = true
|
|
131
|
-
},
|
|
132
|
-
/**
|
|
133
|
-
* 显示修改分组节点窗口
|
|
134
|
-
*/
|
|
135
|
-
handleEdit (data) {
|
|
136
|
-
this.type = 'update'
|
|
137
|
-
this.editData = data
|
|
138
|
-
this.editVisible = true
|
|
139
|
-
},
|
|
140
|
-
/**
|
|
141
|
-
* 删除分组
|
|
142
|
-
*/
|
|
143
|
-
async handleRemove (data) {
|
|
144
|
-
const res = await removeGroupNode(this.target, data.id)
|
|
145
|
-
if (res.code !== 0) {
|
|
146
|
-
return this.$message.error(res.msg)
|
|
147
|
-
}
|
|
148
|
-
this.$message.success('删除成功')
|
|
149
|
-
this.getGroupTree()
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
</script>
|
|
154
|
-
|
|
155
|
-
<style scoped lang='less'>
|
|
156
|
-
.table-group {
|
|
157
|
-
height:70vh;
|
|
158
|
-
.scrollbar{
|
|
159
|
-
height:70vh;
|
|
160
|
-
}
|
|
161
|
-
.in-selector {
|
|
162
|
-
height:53vh;
|
|
163
|
-
}
|
|
164
|
-
::v-deep .el-scrollbar__wrap {
|
|
165
|
-
overflow-x:hidden;
|
|
166
|
-
}
|
|
167
|
-
background-color: #fff;
|
|
168
|
-
box-sizing: border-box;
|
|
169
|
-
border: 1px solid #e8eaec;
|
|
170
|
-
border-right: 0px;
|
|
171
|
-
&:first-child{
|
|
172
|
-
padding: 5px;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
/deep/ .el-tree{
|
|
176
|
-
display: inline-block;
|
|
177
|
-
min-width: 100%;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table-group">
|
|
3
|
+
<!-- 节点搜索 -->
|
|
4
|
+
<el-input v-model="search" placeholder="请输入节点名称" />
|
|
5
|
+
|
|
6
|
+
<!-- 节点展示 -->
|
|
7
|
+
<el-scrollbar :class="[queryType === 'LIST' ? 'scrollbar' :'in-selector']">
|
|
8
|
+
<el-tree
|
|
9
|
+
ref="treeRef"
|
|
10
|
+
:data="dataTree"
|
|
11
|
+
node-key="id"
|
|
12
|
+
icon-class="nothing but won`t show any icon"
|
|
13
|
+
:default-expanded-keys="expandKeys"
|
|
14
|
+
:filter-node-method="treeFilter"
|
|
15
|
+
@node-expand="handleNodeExpand"
|
|
16
|
+
@node-collapse="handleCollapse"
|
|
17
|
+
>
|
|
18
|
+
<template slot-scope="{node,data}">
|
|
19
|
+
<TableGroupItem
|
|
20
|
+
:current-data="currentData"
|
|
21
|
+
:data="data"
|
|
22
|
+
:node="node"
|
|
23
|
+
@addChild="handleAddChild"
|
|
24
|
+
@edit="handleEdit"
|
|
25
|
+
@remove="handleRemove"
|
|
26
|
+
@itemClick="handleItemClick"
|
|
27
|
+
/>
|
|
28
|
+
</template>
|
|
29
|
+
</el-tree>
|
|
30
|
+
</el-scrollbar>
|
|
31
|
+
|
|
32
|
+
<!-- 节点编辑 -->
|
|
33
|
+
<TableGroupItemEdit
|
|
34
|
+
:visible.sync="editVisible"
|
|
35
|
+
:edit-data="editData"
|
|
36
|
+
:node-options="dataTree"
|
|
37
|
+
:type="type"
|
|
38
|
+
@success="getGroupTree"
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
<script>
|
|
43
|
+
import { getGroupTree, removeGroupNode } from '@/api/tableV3.js'
|
|
44
|
+
import TableGroupItem from './table-group-item.vue'
|
|
45
|
+
import TableGroupItemEdit from './table-group-item-edit.vue'
|
|
46
|
+
export default {
|
|
47
|
+
components: {
|
|
48
|
+
TableGroupItem,
|
|
49
|
+
TableGroupItemEdit
|
|
50
|
+
},
|
|
51
|
+
data () {
|
|
52
|
+
return {
|
|
53
|
+
// 本地分组过滤输入内容
|
|
54
|
+
search: '',
|
|
55
|
+
// 分组树
|
|
56
|
+
dataTree: [],
|
|
57
|
+
// 当前选中的数据
|
|
58
|
+
currentData: null,
|
|
59
|
+
// 默认展开的key
|
|
60
|
+
expandKeys: ['0'],
|
|
61
|
+
/**
|
|
62
|
+
* 分组编辑弹窗相关属性
|
|
63
|
+
*/
|
|
64
|
+
editVisible: false,
|
|
65
|
+
// 点击新增或者修改的时候,对应节点的数据对象
|
|
66
|
+
editData: {
|
|
67
|
+
groupCode: ''
|
|
68
|
+
},
|
|
69
|
+
// 新增一个节点还是修改一个节点的标识
|
|
70
|
+
type: ''
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
watch: {
|
|
74
|
+
search (value) {
|
|
75
|
+
this.$refs.treeRef.filter(value)
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
inject: ['target', 'queryType'],
|
|
79
|
+
created () {
|
|
80
|
+
this.getGroupTree()
|
|
81
|
+
},
|
|
82
|
+
methods: {
|
|
83
|
+
/**
|
|
84
|
+
* 节点展开,记录正在展开的节点
|
|
85
|
+
*/
|
|
86
|
+
handleNodeExpand (data) {
|
|
87
|
+
this.expandKeys.push(data.id)
|
|
88
|
+
},
|
|
89
|
+
handleCollapse (data) {
|
|
90
|
+
this.expandKeys.splice(this.expandKeys.indexOf(data.id), 1)
|
|
91
|
+
},
|
|
92
|
+
// 节点内容本地过滤函数
|
|
93
|
+
treeFilter (value, data) {
|
|
94
|
+
if (!value) {
|
|
95
|
+
return true
|
|
96
|
+
}
|
|
97
|
+
return data.name.indexOf(value) !== -1
|
|
98
|
+
},
|
|
99
|
+
/**
|
|
100
|
+
* 获取分组
|
|
101
|
+
*/
|
|
102
|
+
async getGroupTree () {
|
|
103
|
+
const res = await getGroupTree(this.target)
|
|
104
|
+
if (res.code !== 0) {
|
|
105
|
+
if (res.code === 10045) {
|
|
106
|
+
this.dataTree = []
|
|
107
|
+
return
|
|
108
|
+
}
|
|
109
|
+
return this.$message.error(res.msg)
|
|
110
|
+
}
|
|
111
|
+
this.dataTree = []
|
|
112
|
+
this.dataTree.push(res.data)
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
* 切换分组
|
|
116
|
+
*/
|
|
117
|
+
handleItemClick (data) {
|
|
118
|
+
const group = {
|
|
119
|
+
field: data.field,
|
|
120
|
+
value: data.id
|
|
121
|
+
}
|
|
122
|
+
this.$emit('groupChange', group)
|
|
123
|
+
},
|
|
124
|
+
/**
|
|
125
|
+
* 显示添加分组节点窗口
|
|
126
|
+
*/
|
|
127
|
+
handleAddChild (data) {
|
|
128
|
+
this.type = 'insert'
|
|
129
|
+
this.editData = data
|
|
130
|
+
this.editVisible = true
|
|
131
|
+
},
|
|
132
|
+
/**
|
|
133
|
+
* 显示修改分组节点窗口
|
|
134
|
+
*/
|
|
135
|
+
handleEdit (data) {
|
|
136
|
+
this.type = 'update'
|
|
137
|
+
this.editData = data
|
|
138
|
+
this.editVisible = true
|
|
139
|
+
},
|
|
140
|
+
/**
|
|
141
|
+
* 删除分组
|
|
142
|
+
*/
|
|
143
|
+
async handleRemove (data) {
|
|
144
|
+
const res = await removeGroupNode(this.target, data.id)
|
|
145
|
+
if (res.code !== 0) {
|
|
146
|
+
return this.$message.error(res.msg)
|
|
147
|
+
}
|
|
148
|
+
this.$message.success('删除成功')
|
|
149
|
+
this.getGroupTree()
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
</script>
|
|
154
|
+
|
|
155
|
+
<style scoped lang='less'>
|
|
156
|
+
.table-group {
|
|
157
|
+
height:70vh;
|
|
158
|
+
.scrollbar{
|
|
159
|
+
height:70vh;
|
|
160
|
+
}
|
|
161
|
+
.in-selector {
|
|
162
|
+
height:53vh;
|
|
163
|
+
}
|
|
164
|
+
::v-deep .el-scrollbar__wrap {
|
|
165
|
+
overflow-x:hidden;
|
|
166
|
+
}
|
|
167
|
+
background-color: #fff;
|
|
168
|
+
box-sizing: border-box;
|
|
169
|
+
border: 1px solid #e8eaec;
|
|
170
|
+
border-right: 0px;
|
|
171
|
+
&:first-child{
|
|
172
|
+
padding: 5px;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/deep/ .el-tree{
|
|
176
|
+
display: inline-block;
|
|
177
|
+
min-width: 100%;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
</style>
|