tianheng-ui 0.0.73 → 0.0.75

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.
@@ -0,0 +1,240 @@
1
+ <template>
2
+ <div class="widgetTable">
3
+ <div class="table-title">查询字段</div>
4
+ <div class="searchList">
5
+ <div class="table-header">
6
+ <div>拖动</div>
7
+ <div>列名</div>
8
+ <div>字段</div>
9
+ <div>类型</div>
10
+ </div>
11
+ <draggable
12
+ class="table-content"
13
+ v-model="searchData"
14
+ v-bind="{
15
+ group: 'people',
16
+ ghostClass: 'ghost',
17
+ animation: 200,
18
+ handle: '.drag-widget'
19
+ }"
20
+ @end="handleSearchMoveEnd"
21
+ >
22
+ <div
23
+ v-for="item in searchData"
24
+ :key="item.key"
25
+ class="table-content-item"
26
+ >
27
+ <div class="drag">
28
+ <i class="iconfont icon-drag drag-widget"></i>
29
+ </div>
30
+ <div>{{ item.label }}</div>
31
+ <div>{{ item.prop }}</div>
32
+ <div>{{ item.type }}</div>
33
+ </div>
34
+ </draggable>
35
+ </div>
36
+ <div class="table-title">列表字段</div>
37
+ <div class="tableList">
38
+ <div class="table-header">
39
+ <div>拖动</div>
40
+ <div>列名</div>
41
+ <div>字段</div>
42
+ <div>排序</div>
43
+ <div>对齐</div>
44
+ <div>宽度</div>
45
+ </div>
46
+ <draggable
47
+ class="table-content"
48
+ v-model="tableData"
49
+ v-bind="{
50
+ group: 'people',
51
+ ghostClass: 'ghost',
52
+ animation: 200,
53
+ handle: '.drag-widget'
54
+ }"
55
+ @end="handleTableMoveEnd"
56
+ >
57
+ <div
58
+ v-for="item in tableData"
59
+ :key="item.key"
60
+ class="table-content-item"
61
+ >
62
+ <div class="drag">
63
+ <i class="iconfont icon-drag drag-widget"></i>
64
+ </div>
65
+ <div>{{ item.label }}</div>
66
+ <div>{{ item.prop }}</div>
67
+ <div><el-checkbox v-model="item.sortable"></el-checkbox></div>
68
+ <div>
69
+ <el-select v-model="item.align" placeholder="请选择" size="mini">
70
+ <el-option
71
+ v-for="item in ['left', 'center', 'right']"
72
+ :key="item"
73
+ :label="item"
74
+ :value="item"
75
+ >
76
+ </el-option>
77
+ </el-select>
78
+ </div>
79
+ <div>
80
+ <el-input-number
81
+ v-model="item.width"
82
+ controls-position="right"
83
+ :min="0"
84
+ size="mini"
85
+ ></el-input-number>
86
+ </div>
87
+ </div>
88
+ </draggable>
89
+ </div>
90
+ </div>
91
+ </template>
92
+
93
+ <script>
94
+ import Draggable from "vuedraggable";
95
+ export default {
96
+ components: { Draggable },
97
+ props: {
98
+ searchFields: {
99
+ type: Array,
100
+ default: () => {
101
+ return [];
102
+ }
103
+ },
104
+ tableFields: {
105
+ type: Array,
106
+ default: () => {
107
+ return [];
108
+ }
109
+ }
110
+ },
111
+ data() {
112
+ return {
113
+ searchData: this.searchFields,
114
+ tableData: this.tableFields
115
+ };
116
+ },
117
+ watch: {
118
+ searchData: {
119
+ handler(val) {
120
+ this.$emit("update:searchFields", val);
121
+ },
122
+ deep: true
123
+ },
124
+ searchFields(val) {
125
+ this.searchData = val;
126
+ },
127
+ tableData: {
128
+ handler(val) {
129
+ this.$emit("update:tableFields", val);
130
+ },
131
+ deep: true
132
+ },
133
+ tableFields(val) {
134
+ this.tableData = val;
135
+ }
136
+ },
137
+ mounted() {},
138
+ methods: {
139
+ handleSearchMoveEnd(val) {
140
+ this.$emit("move", { type: "search", data: val });
141
+ },
142
+ handleTableMoveEnd(val) {
143
+ this.$emit("move", { type: "table", data: val });
144
+ }
145
+ }
146
+ };
147
+ </script>
148
+
149
+ <style lang="scss" scoped>
150
+ .widgetTable {
151
+ height: 100%;
152
+ padding: 10px;
153
+ background-color: white;
154
+ .table-title {
155
+ height: 25px;
156
+ line-height: 25px;
157
+ }
158
+ .searchList {
159
+ margin: 10px 0;
160
+ border: 1px solid #dcdfe6;
161
+ box-sizing: border-box;
162
+
163
+ .table-content {
164
+ height: 120px;
165
+ overflow-y: scroll;
166
+ }
167
+ }
168
+ .tableList {
169
+ margin-top: 10px;
170
+ height: calc(100% - 280px);
171
+ border: 1px solid #dcdfe6;
172
+
173
+ .table-header {
174
+ div:nth-child(4) {
175
+ flex: none;
176
+ width: 60px !important;
177
+ }
178
+ }
179
+ .table-content {
180
+ height: calc(100% - 40px);
181
+ overflow-y: scroll;
182
+ }
183
+ .table-content .table-content-item > div:nth-child(4) {
184
+ flex: none;
185
+ width: 60px !important;
186
+ }
187
+ .el-input-number--mini {
188
+ width: 100%;
189
+ }
190
+ }
191
+
192
+ .table-header {
193
+ display: flex;
194
+ align-items: center;
195
+ background-color: #f5f7f9;
196
+ div {
197
+ flex: 1;
198
+ padding: 0 10px;
199
+ height: 40px;
200
+ line-height: 40px;
201
+ }
202
+ div:nth-child(1) {
203
+ flex: none;
204
+ width: 60px;
205
+ text-align: center;
206
+ }
207
+ }
208
+ .table-content {
209
+ .table-content-item {
210
+ display: flex;
211
+ align-items: center;
212
+
213
+ .drag {
214
+ i {
215
+ font-size: 14px;
216
+ margin: 0 5px;
217
+ cursor: move;
218
+ }
219
+ }
220
+ > div {
221
+ flex: 1;
222
+ height: 40px;
223
+ line-height: 40px;
224
+ padding: 0 10px;
225
+ }
226
+ > div:nth-child(1) {
227
+ flex: none;
228
+ width: 60px;
229
+ text-align: center;
230
+ }
231
+ }
232
+ }
233
+ .table-content:hover::-webkit-scrollbar-thumb {
234
+ background-color: rgba(69, 90, 100, 0.2);
235
+ }
236
+ .table-content:hover::-webkit-scrollbar-thumb {
237
+ background-color: rgba(69, 90, 100, 0.2);
238
+ }
239
+ }
240
+ </style>
package/packages/index.js CHANGED
@@ -41,6 +41,7 @@ import Col from "./Col/index.js";
41
41
  import Upload from "./Upload/index.js";
42
42
  import FormMaking from "./FormMaking/making.js";
43
43
  import FormGenerate from "./FormMaking/generate.js";
44
+ import TableMaking from "./TableMaking/making.js";
44
45
  import Workflow from "../packages/Workflow/index.js";
45
46
 
46
47
  const components = [
@@ -65,6 +66,7 @@ const components = [
65
66
  Upload,
66
67
  FormMaking,
67
68
  FormGenerate,
69
+ TableMaking,
68
70
  Workflow
69
71
  ];
70
72
 
@@ -108,6 +110,7 @@ export default {
108
110
  Upload,
109
111
  FormMaking,
110
112
  FormGenerate,
113
+ TableMaking,
111
114
  Workflow
112
115
  };
113
116
 
@@ -134,5 +137,6 @@ export {
134
137
  Upload,
135
138
  FormMaking,
136
139
  FormGenerate,
140
+ TableMaking,
137
141
  Workflow
138
142
  };