tianheng-ui 0.0.4 → 0.0.8

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,111 @@
1
+ <template>
2
+ <div>
3
+ <template v-for="(item, index) in options">
4
+ <template v-if="!item.hide">
5
+ <el-table-column
6
+ v-if="item.type"
7
+ :key="index"
8
+ :type="item.type"
9
+ :label="item.label"
10
+ width="50"
11
+ >
12
+ </el-table-column>
13
+ <el-table-column
14
+ v-else-if="item.children"
15
+ :key="index"
16
+ :prop="item.prop"
17
+ :label="item.label"
18
+ :width="item.width"
19
+ :align="item.align"
20
+ :fixed="item.fixed"
21
+ :sortable="item.sortable"
22
+ :sort-method="item.sortMethod"
23
+ show-overflow-tooltip
24
+ >
25
+ <TableColumn :key="index" :options="item.children"></TableColumn>
26
+ </el-table-column>
27
+ <el-table-column
28
+ v-else
29
+ :key="index"
30
+ :prop="item.prop"
31
+ :label="item.label"
32
+ :width="item.width"
33
+ :align="item.align"
34
+ :fixed="item.fixed"
35
+ :sortable="item.sortable"
36
+ :sort-method="item.sortMethod"
37
+ show-overflow-tooltip
38
+ >
39
+ <template slot-scope="scope">
40
+ <slot v-if="item.slot" name="slot" :scope="scope" :option="item" />
41
+ <div v-else>{{ scope.row[item.prop] }}</div>
42
+ </template>
43
+ </el-table-column>
44
+ </template>
45
+ </template>
46
+ </div>
47
+ </template>
48
+
49
+ <script>
50
+ export default {
51
+ name: "TableColumn",
52
+ props: {
53
+ options: {
54
+ type: Array,
55
+ default: () => {
56
+ return [];
57
+ },
58
+ },
59
+ },
60
+ created(){
61
+ /**
62
+ *
63
+ * <template v-if={!item.hide}>
64
+ <el-table-column
65
+ v-if={item.type}
66
+ type={item.type}
67
+ label={item.label}
68
+ width="50"
69
+ ></el-table-column>
70
+ <el-table-column
71
+ v-else-if={item.children}
72
+ prop={item.prop}
73
+ label={item.label}
74
+ width={item.width}
75
+ align={item.align}
76
+ fixed={item.fixed}
77
+ sortable={item.sortable}
78
+ sort-method={item.sortMethod}
79
+ show-overflow-tooltip
80
+ >
81
+ {this.dynamicItem(item.children)}
82
+ </el-table-column>
83
+ <el-table-column
84
+ v-else
85
+ prop={item.prop}
86
+ label={item.label}
87
+ width={item.width}
88
+ align={item.align}
89
+ fixed={item.fixed}
90
+ sortable={item.sortable}
91
+ sort-method={item.sortMethod}
92
+ show-overflow-tooltip
93
+ >
94
+ <template slot-scope="scope">
95
+ <slot
96
+ v-if={item.slot}
97
+ name="slot"
98
+ scope={scope}
99
+ option={item}
100
+ />
101
+ <div v-else>{scope.row[item.prop]}</div>
102
+ </template>
103
+ </el-table-column>
104
+ </template>
105
+ */
106
+ console.log(this.options)
107
+ }
108
+ };
109
+ </script>
110
+
111
+ <style></style>
@@ -0,0 +1,8 @@
1
+ import Table from "./index.vue";
2
+
3
+ /* istanbul ignore next */
4
+ Table.install = function(Vue) {
5
+ Vue.component(Table.name, Table);
6
+ };
7
+
8
+ export default Table;
@@ -0,0 +1,251 @@
1
+ <template>
2
+ <div class="th-table">
3
+ <el-table
4
+ ref="th_table"
5
+ v-loading="loading"
6
+ :data="data"
7
+ :row-key="rowKey"
8
+ stripe
9
+ :highlight-current-row="selectType === 'single'"
10
+ :tree-props="treeProps"
11
+ @current-change="handleSingleSelect"
12
+ @row-dblclick="dblclick"
13
+ @selection-change="handleSelectionChange"
14
+ >
15
+ <template v-for="(item, index) in options">
16
+ <template v-if="!item.hide">
17
+ <el-table-column
18
+ v-if="item.type"
19
+ :key="index"
20
+ :type="item.type"
21
+ :label="item.label"
22
+ width="50"
23
+ >
24
+ </el-table-column>
25
+ <el-table-column
26
+ v-else-if="item.children"
27
+ :key="index"
28
+ :prop="item.prop"
29
+ :label="item.label"
30
+ :width="item.width"
31
+ :align="item.align || 'left'"
32
+ :fixed="item.fixed || null"
33
+ :sortable="item.sortable"
34
+ :sort-method="item.sortMethod"
35
+ show-overflow-tooltip
36
+ >
37
+ <table-column :options="item.children"></table-column>
38
+ </el-table-column>
39
+ <el-table-column
40
+ v-else
41
+ :key="index"
42
+ :prop="item.prop"
43
+ :label="item.label"
44
+ :width="item.width"
45
+ :align="item.align || 'left'"
46
+ :fixed="item.fixed || null"
47
+ :sortable="item.sortable"
48
+ :sort-method="item.sortMethod"
49
+ show-overflow-tooltip
50
+ >
51
+ <template slot-scope="scope">
52
+ <slot
53
+ v-if="item.slot"
54
+ :name="item.slot"
55
+ :scope="scope"
56
+ :option="item"
57
+ />
58
+ <div v-else>{{ scope.row[item.prop] }}</div>
59
+ </template>
60
+ </el-table-column>
61
+ </template>
62
+ </template>
63
+ <!-- <table-column :options="options">
64
+ <template #slot="{ scope,option }">
65
+ <slot :name="option.slot" :scope="scope" :option="option" />
66
+ </template>
67
+ </table-column> -->
68
+ <template #empty>
69
+ <div>
70
+ {{ loading ? loadingText || "加载中" : emptyText || "暂无数据" }}
71
+ </div>
72
+ </template>
73
+ </el-table>
74
+ <!-- <i class="th-table-more el-icon-setting"></i> -->
75
+
76
+ <div v-if="Object.keys(pageInfo).length > 0 && showPage" class="pagination">
77
+ <el-pagination
78
+ :current-page="pageInfo.currentPage"
79
+ :page-sizes="pageInfo.sizes"
80
+ :page-size="pageInfo.pageSize"
81
+ layout="total, prev, pager, next, sizes"
82
+ :total="pageInfo.total"
83
+ @size-change="handleSizeChange"
84
+ @current-change="handleCurrentChange"
85
+ @prev-click="handlePrevClick"
86
+ @next-click="handleNextClick"
87
+ />
88
+ </div>
89
+ </div>
90
+ </template>
91
+
92
+ <script>
93
+ import TableColumn from "./column.vue";
94
+
95
+ export default {
96
+ name:'ThTable',
97
+ components: {
98
+ TableColumn,
99
+ },
100
+ props: {
101
+ data: {
102
+ type: Array,
103
+ default: () => {
104
+ return [];
105
+ },
106
+ },
107
+ options: {
108
+ type: Array,
109
+ default: () => {
110
+ return [];
111
+ },
112
+ },
113
+ // single:单行选中 multiple:多行选中
114
+ selectType: {
115
+ type: String,
116
+ default: () => {
117
+ return "";
118
+ },
119
+ },
120
+ // 行双击事件
121
+ dblclick: {
122
+ type: Function,
123
+ default: () => {
124
+ return null;
125
+ },
126
+ },
127
+ treeProps: {
128
+ type: Object,
129
+ default: function() {
130
+ return {};
131
+ },
132
+ },
133
+ // 对象,不传表示没有分页,包含三个参数,均必填pageSize:每页展示的条数。currentPage:当前页码。pageCount:总页数
134
+ pageInfo: {
135
+ type: Object,
136
+ default: function() {
137
+ return {};
138
+ },
139
+ },
140
+ loading: {
141
+ type: Boolean,
142
+ default: () => {
143
+ return false;
144
+ },
145
+ },
146
+ height: {
147
+ type: String,
148
+ default: () => {
149
+ return "";
150
+ },
151
+ },
152
+ rowKey: {
153
+ type: String,
154
+ default: () => {
155
+ return "";
156
+ },
157
+ },
158
+ showPage: {
159
+ type: Boolean,
160
+ default: () => {
161
+ return true;
162
+ },
163
+ },
164
+ emptyText: {
165
+ type: String,
166
+ default: () => {
167
+ return "暂无数据";
168
+ },
169
+ },
170
+ loadingText: {
171
+ type: String,
172
+ default: () => {
173
+ return "加载中";
174
+ },
175
+ },
176
+ },
177
+ data() {
178
+ return {};
179
+ },
180
+ methods: {
181
+ handleSelectionChange(currentRow) {
182
+ if (currentRow) {
183
+ this.$emit("selection-change", currentRow);
184
+ }
185
+ },
186
+ // 选中行--单选
187
+ handleSingleSelect(currentRow, oldCurrentRow) {
188
+ if (currentRow) {
189
+ this.$emit("select-row-change", currentRow);
190
+ }
191
+ },
192
+ // 每页展示的条数 改变时
193
+ handleSizeChange(val) {
194
+ this.pageInfo.pageSize = val;
195
+ this.$emit(
196
+ "pageNumberChange",
197
+ this.pageInfo.currentPage,
198
+ this.pageInfo.pageSize
199
+ );
200
+ },
201
+ // 当前页码 改变时
202
+ handleCurrentChange(val) {
203
+ this.pageInfo.currentPage = val;
204
+ this.$emit(
205
+ "pageNumberChange",
206
+ this.pageInfo.currentPage,
207
+ this.pageInfo.pageSize
208
+ );
209
+ },
210
+ // 点击上一页
211
+ handlePrevClick() {
212
+ if (this.pageInfo.currentPage === 1) return;
213
+ this.pageInfo.currentPage -= 1;
214
+ this.$emit(
215
+ "pageNumberChange",
216
+ this.pageInfo.currentPage,
217
+ this.pageInfo.pageSize
218
+ );
219
+ },
220
+ // 点击下一页
221
+ handleNextClick() {
222
+ if (this.pageInfo.currentPage === this.pageInfo.pageCount) return;
223
+ this.pageInfo.currentPage += 1;
224
+ this.$emit(
225
+ "pageNumberChange",
226
+ this.pageInfo.currentPage,
227
+ this.pageInfo.pageSize
228
+ );
229
+ },
230
+ getTable() {
231
+ return this.$refs["th_table"];
232
+ },
233
+ },
234
+ };
235
+ </script>
236
+
237
+ <style lang="less" scoped>
238
+ .th-table {
239
+ position: relative;
240
+ width: 100%;
241
+ .pagination {
242
+ margin-top: 20px;
243
+ }
244
+ &-more {
245
+ position: absolute;
246
+ top: 13px;
247
+ right: 5px;
248
+ cursor: pointer;
249
+ }
250
+ }
251
+ </style>
@@ -0,0 +1,105 @@
1
+ <template>
2
+ <div class="table-search">
3
+ <template v-for="(item, index) in options">
4
+ <el-input
5
+ v-if="item.type === 'input'"
6
+ class="table-search-item"
7
+ v-model="params[item.value]"
8
+ :key="index"
9
+ :style="{ width: item.width + 'px' }"
10
+ :placeholder="item.placeholder || '请输入'"
11
+ :size="item.size || 'mini'"
12
+ clearable
13
+ ></el-input>
14
+ <el-date-picker
15
+ v-if="item.type === 'date'"
16
+ class="table-search-item"
17
+ v-model="params[item.value]"
18
+ :key="index"
19
+ :style="{ width: item.width + 'px' }"
20
+ :type="item.dateType || 'date'"
21
+ :format="item.format"
22
+ :value-format="item.valueFormat"
23
+ :size="item.size || 'mini'"
24
+ range-separator="至"
25
+ start-placeholder="开始日期"
26
+ end-placeholder="结束日期"
27
+ >
28
+ </el-date-picker>
29
+ </template>
30
+
31
+ <el-button
32
+ type="primary"
33
+ icon="el-icon-search"
34
+ size="mini"
35
+ plain
36
+ @click="doSearch"
37
+ >查询</el-button
38
+ >
39
+ <el-button
40
+ type="primary"
41
+ icon="el-icon-refresh-right"
42
+ size="mini"
43
+ plain
44
+ @click="doReset"
45
+ >重置</el-button
46
+ >
47
+ </div>
48
+ </template>
49
+
50
+ <script>
51
+ export default {
52
+ props: {
53
+ options: {
54
+ type: Array,
55
+ default: () => {
56
+ return [];
57
+ },
58
+ },
59
+ params: {
60
+ type: Object,
61
+ default: () => {
62
+ return {};
63
+ },
64
+ },
65
+ },
66
+ data() {
67
+ return {
68
+ datePickerTypes: [
69
+ "year",
70
+ "month",
71
+ "date",
72
+ "dates",
73
+ "week",
74
+ "datetime",
75
+ "datetimerange",
76
+ "daterange",
77
+ "monthrange",
78
+ ],
79
+ };
80
+ },
81
+ methods: {
82
+ doSearch() {
83
+ this.$emit("on-search", this.params);
84
+ },
85
+ doReset() {
86
+ this.params = {};
87
+ this.$emit("on-reset", this.params);
88
+ },
89
+ },
90
+ };
91
+ </script>
92
+
93
+ <style lang="less" scoped>
94
+ .table-search {
95
+ display: flex;
96
+ align-items: center;
97
+ margin-bottom: 10px;
98
+ &-item {
99
+ margin-right: 10px;
100
+ }
101
+ }
102
+ .table-search-item:last-child {
103
+ margin-right: 20px !important;
104
+ }
105
+ </style>
@@ -0,0 +1,98 @@
1
+ <template>
2
+ <div class="tableTools">
3
+ <template v-for="(item, index) in options">
4
+ <el-button
5
+ v-if="item.act_type === 'add'"
6
+ :key="index"
7
+ :style="{ color: item.btn_color }"
8
+ :type="item.btn_type"
9
+ :icon="item.btn_icon"
10
+ :disabled="item.btn_disabled"
11
+ @click="doAdd(item)"
12
+ >{{ item.btn_name }}</el-button
13
+ >
14
+ <el-button
15
+ v-if="item.act_type === 'refresh'"
16
+ :key="index"
17
+ :style="{ color: item.btn_color }"
18
+ :type="item.btn_type"
19
+ :icon="item.btn_icon"
20
+ :disabled="item.btn_disabled"
21
+ @click="doRefresh(item)"
22
+ >{{ item.btn_name }}</el-button
23
+ >
24
+ <el-button
25
+ v-if="item.act_type === 'export'"
26
+ :key="index"
27
+ :style="{ color: item.btn_color }"
28
+ :type="item.btn_type"
29
+ :icon="item.btn_icon"
30
+ :disabled="item.btn_disabled"
31
+ @click="doExport(item)"
32
+ >{{ item.btn_name }}</el-button
33
+ >
34
+ <el-button
35
+ v-if="item.act_type === 'batch'"
36
+ :key="index"
37
+ :style="{ color: item.btn_color }"
38
+ :type="item.btn_type"
39
+ :icon="item.btn_icon"
40
+ :disabled="item.btn_disabled || selectionDisabled"
41
+ :loading="loadingDel"
42
+ @click="doBatch(item)"
43
+ >{{ item.btn_name }}</el-button
44
+ >
45
+ </template>
46
+ </div>
47
+ </template>
48
+
49
+ <script>
50
+ export default {
51
+ props: {
52
+ options: {
53
+ type: Array,
54
+ default: () => {
55
+ return [];
56
+ },
57
+ },
58
+ selectionDisabled: {
59
+ type: Boolean,
60
+ default: () => {
61
+ return true;
62
+ },
63
+ },
64
+ },
65
+ data() {
66
+ return {
67
+ loadingDel: false,
68
+ };
69
+ },
70
+ methods: {
71
+ doEval(item) {
72
+ this.$emit("on-eval", item);
73
+ },
74
+ doAdd(item) {
75
+ this.$emit("on-add", item);
76
+ },
77
+ doRefresh(item) {
78
+ this.$emit("on-refresh", item);
79
+ },
80
+ doExport(item) {
81
+ this.$emit("on-export", item);
82
+ },
83
+ doBatch(item) {
84
+ this.loadingDel = true;
85
+ const callback = (bool) => {
86
+ this.loadingDel = false;
87
+ };
88
+ this.$emit("on-batch", item, callback);
89
+ },
90
+ },
91
+ };
92
+ </script>
93
+
94
+ <style lang="less">
95
+ .tableTools {
96
+ margin-bottom: 10px;
97
+ }
98
+ </style>
@@ -1,2 +0,0 @@
1
- !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("tianheng-ui",[],n):"object"==typeof exports?exports["tianheng-ui"]=n():e["tianheng-ui"]=n()}("undefined"!=typeof self?self:this,function(){return function(e){function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}var t={};return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="/dist/",n(n.s=7)}([function(e,n){function t(e,n){var t=e[1]||"",i=e[3];if(!i)return t;if(n&&"function"==typeof btoa){var l=o(i);return[t].concat(i.sources.map(function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"})).concat([l]).join("\n")}return[t].join("\n")}function o(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var n=[];return n.toString=function(){return this.map(function(n){var o=t(n,e);return n[2]?"@media "+n[2]+"{"+o+"}":o}).join("")},n.i=function(e,t){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},i=0;i<this.length;i++){var l=this[i][0];"number"==typeof l&&(o[l]=!0)}for(i=0;i<e.length;i++){var c=e[i];"number"==typeof c[0]&&o[c[0]]||(t&&!c[2]?c[2]=t:t&&(c[2]="("+c[2]+") and ("+t+")"),n.push(c))}},n}},function(e,n,t){function o(e){for(var n=0;n<e.length;n++){var t=e[n],o=u[t.id];if(o){o.refs++;for(var i=0;i<o.parts.length;i++)o.parts[i](t.parts[i]);for(;i<t.parts.length;i++)o.parts.push(l(t.parts[i]));o.parts.length>t.parts.length&&(o.parts.length=t.parts.length)}else{for(var c=[],i=0;i<t.parts.length;i++)c.push(l(t.parts[i]));u[t.id]={id:t.id,refs:1,parts:c}}}}function i(){var e=document.createElement("style");return e.type="text/css",d.appendChild(e),e}function l(e){var n,t,o=document.querySelector("style["+v+'~="'+e.id+'"]');if(o){if(h)return g;o.parentNode.removeChild(o)}if(b){var l=f++;o=p||(p=i()),n=c.bind(null,o,l,!1),t=c.bind(null,o,l,!0)}else o=i(),n=a.bind(null,o),t=function(){o.parentNode.removeChild(o)};return n(e),function(o){if(o){if(o.css===e.css&&o.media===e.media&&o.sourceMap===e.sourceMap)return;n(e=o)}else t()}}function c(e,n,t,o){var i=t?"":o.css;if(e.styleSheet)e.styleSheet.cssText=y(n,i);else{var l=document.createTextNode(i),c=e.childNodes;c[n]&&e.removeChild(c[n]),c.length?e.insertBefore(l,c[n]):e.appendChild(l)}}function a(e,n){var t=n.css,o=n.media,i=n.sourceMap;if(o&&e.setAttribute("media",o),m.ssrId&&e.setAttribute(v,n.id),i&&(t+="\n/*# sourceURL="+i.sources[0]+" */",t+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}var r="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!r)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var s=t(12),u={},d=r&&(document.head||document.getElementsByTagName("head")[0]),p=null,f=0,h=!1,g=function(){},m=null,v="data-vue-ssr-id",b="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,n,t,i){h=t,m=i||{};var l=s(e,n);return o(l),function(n){for(var t=[],i=0;i<l.length;i++){var c=l[i],a=u[c.id];a.refs--,t.push(a)}n?(l=s(e,n),o(l)):l=[];for(var i=0;i<t.length;i++){var a=t[i];if(0===a.refs){for(var r=0;r<a.parts.length;r++)a.parts[r]();delete u[a.id]}}}};var y=function(){var e=[];return function(n,t){return e[n]=t,e.filter(Boolean).join("\n")}}()},function(e,n){e.exports=function(e,n,t,o,i,l){var c,a=e=e||{},r=typeof e.default;"object"!==r&&"function"!==r||(c=e,a=e.default);var s="function"==typeof a?a.options:a;n&&(s.render=n.render,s.staticRenderFns=n.staticRenderFns,s._compiled=!0),t&&(s.functional=!0),i&&(s._scopeId=i);var u;if(l?(u=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(l)},s._ssrRegister=u):o&&(u=o),u){var d=s.functional,p=d?s.render:s.beforeCreate;d?(s._injectStyles=u,s.render=function(e,n){return u.call(n),p(e,n)}):s.beforeCreate=p?[].concat(p,u):[u]}return{esModule:c,exports:a,options:s}}},function(e,n,t){"use strict";n.a={name:"ThCell",props:{title:{type:String,default:function(){return""}},value:{type:String,default:function(){return""}},label:{type:String,default:function(){return""}},icon:{type:String,default:function(){return""}},customStyle:{type:String,default:function(){return""}},loading:{type:Boolean,default:function(){return!1}}}}},function(e,n,t){"use strict";n.a={name:"ThIcons",props:["value","width"],data:function(){return{icons:["el-icon-platform-eleme","el-icon-eleme","el-icon-delete-solid","el-icon-delete","el-icon-s-tools","el-icon-setting","el-icon-user-solid","el-icon-user","el-icon-phone","el-icon-phone-outline","el-icon-more","el-icon-more-outline","el-icon-star-on","el-icon-star-off","el-icon-s-goods","el-icon-goods","el-icon-warning","el-icon-warning-outline","el-icon-question","el-icon-info","el-icon-remove","el-icon-circle-plus","el-icon-success","el-icon-error","el-icon-zoom-in","el-icon-zoom-out","el-icon-remove-outline","el-icon-circle-plus-outline","el-icon-circle-check","el-icon-circle-close","el-icon-s-help","el-icon-help","el-icon-minus","el-icon-plus","el-icon-check","el-icon-close","el-icon-picture","el-icon-picture-outline","el-icon-picture-outline-round","el-icon-upload","el-icon-upload2","el-icon-download","el-icon-camera-solid","el-icon-camera","el-icon-video-camera-solid","el-icon-video-camera","el-icon-message-solid","el-icon-bell","el-icon-s-cooperation","el-icon-s-order","el-icon-s-platform","el-icon-s-fold","el-icon-s-unfold","el-icon-s-operation","el-icon-s-promotion","el-icon-s-home","el-icon-s-release","el-icon-s-ticket","el-icon-s-management","el-icon-s-open","el-icon-s-shop","el-icon-s-marketing","el-icon-s-flag","el-icon-s-comment","el-icon-s-finance","el-icon-s-claim","el-icon-s-custom","el-icon-s-opportunity","el-icon-s-data","el-icon-s-check","el-icon-s-grid","el-icon-menu","el-icon-share","el-icon-d-caret","el-icon-caret-left","el-icon-caret-right","el-icon-caret-bottom","el-icon-caret-top","el-icon-bottom-left","el-icon-bottom-right","el-icon-back","el-icon-right","el-icon-bottom","el-icon-top","el-icon-top-left","el-icon-top-right","el-icon-arrow-left","el-icon-arrow-right","el-icon-arrow-down","el-icon-arrow-up","el-icon-d-arrow-left","el-icon-d-arrow-right","el-icon-video-pause","el-icon-video-play","el-icon-refresh","el-icon-refresh-right","el-icon-refresh-left","el-icon-finished","el-icon-sort","el-icon-sort-up","el-icon-sort-down","el-icon-rank","el-icon-loading","el-icon-view","el-icon-c-scale-to-original","el-icon-date","el-icon-edit","el-icon-edit-outline","el-icon-folder","el-icon-folder-opened","el-icon-folder-add","el-icon-folder-remove","el-icon-folder-delete","el-icon-folder-checked","el-icon-tickets","el-icon-document-remove","el-icon-document-delete","el-icon-document-copy","el-icon-document-checked","el-icon-document","el-icon-document-add","el-icon-printer","el-icon-paperclip","el-icon-takeaway-box","el-icon-search","el-icon-monitor","el-icon-attract","el-icon-mobile","el-icon-scissors","el-icon-umbrella","el-icon-headset","el-icon-brush","el-icon-mouse","el-icon-coordinate","el-icon-magic-stick","el-icon-reading","el-icon-data-line","el-icon-data-board","el-icon-pie-chart","el-icon-data-analysis","el-icon-collection-tag","el-icon-film","el-icon-suitcase","el-icon-suitcase-1","el-icon-receiving","el-icon-collection","el-icon-files","el-icon-notebook-1","el-icon-notebook-2","el-icon-toilet-paper","el-icon-office-building","el-icon-school","el-icon-table-lamp","el-icon-house","el-icon-no-smoking","el-icon-smoking","el-icon-shopping-cart-full","el-icon-shopping-cart-1","el-icon-shopping-cart-2","el-icon-shopping-bag-1","el-icon-shopping-bag-2","el-icon-sold-out","el-icon-sell","el-icon-present","el-icon-box","el-icon-bank-card","el-icon-money","el-icon-coin","el-icon-wallet","el-icon-discount","el-icon-price-tag","el-icon-news","el-icon-guide","el-icon-male","el-icon-female","el-icon-thumb","el-icon-cpu","el-icon-link","el-icon-connection","el-icon-open","el-icon-turn-off","el-icon-set-up","el-icon-chat-round","el-icon-chat-line-round","el-icon-chat-square","el-icon-chat-dot-round","el-icon-chat-dot-square","el-icon-chat-line-square","el-icon-message","el-icon-postcard","el-icon-position","el-icon-turn-off-microphone","el-icon-microphone","el-icon-close-notification","el-icon-bangzhu","el-icon-time","el-icon-odometer","el-icon-crop","el-icon-aim","el-icon-switch-button","el-icon-full-screen","el-icon-copy-document","el-icon-mic","el-icon-stopwatch","el-icon-medal-1","el-icon-medal","el-icon-trophy","el-icon-trophy-1","el-icon-first-aid-kit","el-icon-discover","el-icon-place","el-icon-location","el-icon-location-outline","el-icon-location-information","el-icon-add-location","el-icon-delete-location","el-icon-map-location","el-icon-alarm-clock","el-icon-timer","el-icon-watch-1","el-icon-watch","el-icon-lock","el-icon-unlock","el-icon-key","el-icon-service","el-icon-mobile-phone","el-icon-bicycle","el-icon-truck","el-icon-ship","el-icon-basketball","el-icon-football","el-icon-soccer","el-icon-baseball","el-icon-wind-power","el-icon-light-rain","el-icon-lightning","el-icon-heavy-rain","el-icon-sunrise","el-icon-sunrise-1","el-icon-sunset","el-icon-sunny","el-icon-cloudy","el-icon-partly-cloudy","el-icon-cloudy-and-sunny","el-icon-moon","el-icon-moon-night","el-icon-dish","el-icon-dish-1","el-icon-food","el-icon-chicken","el-icon-fork-spoon","el-icon-knife-fork","el-icon-burger","el-icon-tableware","el-icon-sugar","el-icon-dessert","el-icon-ice-cream","el-icon-hot-water","el-icon-water-cup","el-icon-coffee-cup","el-icon-cold-drink","el-icon-goblet","el-icon-goblet-full","el-icon-goblet-square","el-icon-goblet-square-full","el-icon-refrigerator","el-icon-grape","el-icon-watermelon","el-icon-cherry","el-icon-apple","el-icon-pear","el-icon-orange","el-icon-coffee","el-icon-ice-tea","el-icon-ice-drink","el-icon-milk-tea","el-icon-potato-strips","el-icon-lollipop","el-icon-ice-cream-square","el-icon-ice-cream-round"]}},created:function(){},methods:{handleIconClick:function(e){this.$emit("input",e)},handleInputClear:function(){this.$emit("input","")}}}},function(e,n,t){"use strict";var o=t(23);n.a={name:"ThTable",components:{TableColumn:o.a},props:{data:{type:Array,default:function(){return[]}},options:{type:Array,default:function(){return[]}},selectType:{type:String,default:function(){return""}},dblclick:{type:Function,default:function(){return null}},treeProps:{type:Object,default:function(){return{}}},pageInfo:{type:Object,default:function(){return{}}},loading:{type:Boolean,default:function(){return!1}},height:{type:String,default:function(){return""}},rowKey:{type:String,default:function(){return""}},showPage:{type:Boolean,default:function(){return!0}},emptyText:{type:String,default:function(){return"暂无数据"}},loadingText:{type:String,default:function(){return"加载中"}}},data:function(){return{}},methods:{handleSelectionChange:function(e){e&&this.$emit("selection-change",e)},handleSingleSelect:function(e,n){e&&this.$emit("select-row-change",e)},handleSizeChange:function(e){this.pageInfo.pageSize=e,this.$emit("pageNumberChange",this.pageInfo.currentPage,this.pageInfo.pageSize)},handleCurrentChange:function(e){this.pageInfo.currentPage=e,this.$emit("pageNumberChange",this.pageInfo.currentPage,this.pageInfo.pageSize)},handlePrevClick:function(){1!==this.pageInfo.currentPage&&(this.pageInfo.currentPage-=1,this.$emit("pageNumberChange",this.pageInfo.currentPage,this.pageInfo.pageSize))},handleNextClick:function(){this.pageInfo.currentPage!==this.pageInfo.pageCount&&(this.pageInfo.currentPage+=1,this.$emit("pageNumberChange",this.pageInfo.currentPage,this.pageInfo.pageSize))},getTable:function(){return this.$refs.th_table}}}},function(e,n,t){"use strict";n.a={name:"TableColumn",props:{options:{type:Array,default:function(){return[]}}},created:function(){console.log(this.options)}}},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=t(8),i=t(14),l=t(19),c=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},a=[o.a,i.a,l.a],r=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];a.forEach(function(n){e.component(n.name,n)})};"undefined"!=typeof window&&window.Vue&&r(window.Vue),n.default=c({version:"0.0.4",install:r},a)},function(e,n,t){"use strict";var o=t(9);o.a.install=function(e){e.component(o.a.name,o.a)},n.a=o.a},function(e,n,t){"use strict";function o(e){t(10)}var i=t(3),l=t(13),c=t(2),a=o,r=c(i.a,l.a,!1,a,"data-v-7900d0bc",null);n.a=r.exports},function(e,n,t){var o=t(11);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);t(1)("5a987caa",o,!0,{})},function(e,n,t){n=e.exports=t(0)(!1),n.push([e.i,".th-cell[data-v-7900d0bc]{position:relative;display:flex;align-items:center;padding:10px 15px;border-radius:4px;border:1px solid #ebeef5;background-color:#fff;overflow:hidden;transition:.3s}.th-cell .th-cell-icon[data-v-7900d0bc]{margin-right:10px;font-size:18px}.th-cell .th-cell-content[data-v-7900d0bc]{flex:1}.th-cell-title[data-v-7900d0bc]{font-size:16px;color:#333}.th-cell-label[data-v-7900d0bc]{margin-top:5px;font-size:14px;color:#666;word-wrap:break-word;word-break:break-all}.th-cell-value[data-v-7900d0bc]{margin-left:10px;max-width:50%;font-size:14px;color:#999;word-wrap:break-word;word-break:break-all}.th-cell[data-v-7900d0bc]:hover{box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.skeleton[data-v-7900d0bc]{display:flex;align-items:center;margin-bottom:20px;padding:10px 15px;border-radius:4px;border:1px solid #ebeef5}.skeleton-icon[data-v-7900d0bc]{width:30px;height:30px;margin-right:10px;font-size:18px}.skeleton-content[data-v-7900d0bc]{flex:1}.skeleton-title[data-v-7900d0bc]{width:100px}.skeleton-label[data-v-7900d0bc]{margin-top:5px}.skeleton-value[data-v-7900d0bc]{margin-left:10px;width:100px}",""])},function(e,n){e.exports=function(e,n){for(var t=[],o={},i=0;i<n.length;i++){var l=n[i],c=l[0],a=l[1],r=l[2],s=l[3],u={id:e+":"+i,css:a,media:r,sourceMap:s};o[c]?o[c].parts.push(u):t.push(o[c]={id:c,parts:[u]})}return t}},function(e,n,t){"use strict";var o=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",[t("el-skeleton",{attrs:{loading:e.loading,animated:""}},[t("template",{slot:"template"},[t("div",{staticClass:"skeleton"},[t("el-skeleton-item",{staticClass:"skeleton-icon",attrs:{variant:"image"}}),e._v(" "),t("div",{staticClass:"skeleton-content"},[t("el-skeleton-item",{staticClass:"skeleton-title",attrs:{variant:"h4"}}),e._v(" "),t("el-skeleton-item",{staticClass:"skeleton-label",attrs:{variant:"text"}})],1),e._v(" "),t("el-skeleton-item",{staticClass:"skeleton-value",attrs:{variant:"text"}})],1)])],2),e._v(" "),e.loading?e._e():t("div",{staticClass:"th-cell",style:e.customStyle},[e.icon?t("i",{staticClass:"th-cell-icon",class:e.icon}):e._t("icon"),e._v(" "),t("div",{staticClass:"th-cell-content"},[e.title?t("div",{staticClass:"th-cell-title"},[e._v(e._s(e.title))]):e._t("title"),e._v(" "),e.label?t("div",{staticClass:"th-cell-label"},[e._v(e._s(e.label))]):e._t("label")],2),e._v(" "),e.value?t("div",{staticClass:"th-cell-value"},[e._v(e._s(e.value))]):e._t("default")],2)],1)},i=[],l={render:o,staticRenderFns:i};n.a=l},function(e,n,t){"use strict";var o=t(15);o.a.install=function(e){e.component(o.a.name,o.a)},n.a=o.a},function(e,n,t){"use strict";function o(e){t(16)}var i=t(4),l=t(18),c=t(2),a=o,r=c(i.a,l.a,!1,a,"data-v-7d8c5857",null);n.a=r.exports},function(e,n,t){var o=t(17);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);t(1)("a2abff02",o,!0,{})},function(e,n,t){n=e.exports=t(0)(!1),n.push([e.i,".input-prefix[data-v-7d8c5857]{height:100%;width:32px;display:flex;align-items:center}.input-prefix .icon[data-v-7d8c5857]{font-size:20px}.th-icons[data-v-7d8c5857]{height:300px;overflow-y:scroll}.th-icons .icon[data-v-7d8c5857]{padding:8px;font-size:20px;border-radius:2px}.th-icons .icon[data-v-7d8c5857]:hover{cursor:pointer;background-color:#f2f2f2}",""])},function(e,n,t){"use strict";var o=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",[t("el-popover",{attrs:{placement:"bottom-start",title:"Element图标库",width:e.width||400,trigger:"click"}},[t("el-input",{attrs:{slot:"reference",value:e.value,placeholder:"请选择图标",clearable:""},on:{clear:e.handleInputClear},slot:"reference"},[e.value?t("div",{staticClass:"input-prefix",attrs:{slot:"prefix"},slot:"prefix"},[t("i",{staticClass:"icon",class:e.value})]):e._e()]),e._v(" "),t("div",{staticClass:"th-icons"},e._l(e.icons,function(n,o){return t("i",{key:o,staticClass:"icon",class:n,on:{click:function(t){return e.handleIconClick(n)}}})}),0)],1)],1)},i=[],l={render:o,staticRenderFns:i};n.a=l},function(e,n,t){"use strict";var o=t(20);o.a.install=function(e){e.component(o.a.name,o.a)},n.a=o.a},function(e,n,t){"use strict";function o(e){t(21)}var i=t(5),l=t(27),c=t(2),a=o,r=c(i.a,l.a,!1,a,"data-v-47ddb3be",null);n.a=r.exports},function(e,n,t){var o=t(22);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);t(1)("7dff0719",o,!0,{})},function(e,n,t){n=e.exports=t(0)(!1),n.push([e.i,".th-table[data-v-47ddb3be]{position:relative;width:100%}.th-table .pagination[data-v-47ddb3be]{margin-top:20px}.th-table-more[data-v-47ddb3be]{position:absolute;top:13px;right:5px;cursor:pointer}",""])},function(e,n,t){"use strict";function o(e){t(24)}var i=t(6),l=t(26),c=t(2),a=o,r=c(i.a,l.a,!1,a,null,null);n.a=r.exports},function(e,n,t){var o=t(25);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);t(1)("0f315418",o,!0,{})},function(e,n,t){n=e.exports=t(0)(!1),n.push([e.i,"",""])},function(e,n,t){"use strict";var o=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",[e._l(e.options,function(n,o){return[n.hide?e._e():[n.type?t("el-table-column",{key:o,attrs:{type:n.type,label:n.label,width:"50"}}):n.children?t("el-table-column",{key:o,attrs:{prop:n.prop,label:n.label,width:n.width,align:n.align,fixed:n.fixed,sortable:n.sortable,"sort-method":n.sortMethod,"show-overflow-tooltip":""}},[t("TableColumn",{key:o,attrs:{options:n.children}})],1):t("el-table-column",{key:o,attrs:{prop:n.prop,label:n.label,width:n.width,align:n.align,fixed:n.fixed,sortable:n.sortable,"sort-method":n.sortMethod,"show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(o){return[n.slot?e._t("slot",null,{scope:o,option:n}):t("div",[e._v(e._s(o.row[n.prop]))])]}}],null,!0)})]]})],2)},i=[],l={render:o,staticRenderFns:i};n.a=l},function(e,n,t){"use strict";var o=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{staticClass:"th-table"},[t("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"th_table",attrs:{data:e.data,"row-key":e.rowKey,stripe:"","highlight-current-row":"single"===e.selectType,"tree-props":e.treeProps},on:{"current-change":e.handleSingleSelect,"row-dblclick":e.dblclick,"selection-change":e.handleSelectionChange},scopedSlots:e._u([{key:"empty",fn:function(){return[t("div",[e._v("\n "+e._s(e.loading?e.loadingText||"加载中":e.emptyText||"暂无数据")+"\n ")])]},proxy:!0}])},[e._l(e.options,function(n,o){return[n.hide?e._e():[n.type?t("el-table-column",{key:o,attrs:{type:n.type,label:n.label,width:"50"}}):n.children?t("el-table-column",{key:o,attrs:{prop:n.prop,label:n.label,width:n.width,align:n.align||"left",fixed:n.fixed||null,sortable:n.sortable,"sort-method":n.sortMethod,"show-overflow-tooltip":""}},[t("table-column",{attrs:{options:n.children}})],1):t("el-table-column",{key:o,attrs:{prop:n.prop,label:n.label,width:n.width,align:n.align||"left",fixed:n.fixed||null,sortable:n.sortable,"sort-method":n.sortMethod,"show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(o){return[n.slot?e._t(n.slot,null,{scope:o,option:n}):t("div",[e._v(e._s(o.row[n.prop]))])]}}],null,!0)})]]})],2),e._v(" "),Object.keys(e.pageInfo).length>0&&e.showPage?t("div",{staticClass:"pagination"},[t("el-pagination",{attrs:{"current-page":e.pageInfo.currentPage,"page-sizes":e.pageInfo.sizes,"page-size":e.pageInfo.pageSize,layout:"total, prev, pager, next, sizes",total:e.pageInfo.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange,"prev-click":e.handlePrevClick,"next-click":e.handleNextClick}})],1):e._e()],1)},i=[],l={render:o,staticRenderFns:i};n.a=l}])});
2
- //# sourceMappingURL=tianheng-ui.js.map
package/src/App.vue DELETED
@@ -1,31 +0,0 @@
1
- <template>
2
- <div id="app">
3
- <th-cell
4
- v-for="(item, index) in list"
5
- :key="index"
6
- :title="item.title" :label="item.label"
7
- ></th-cell>
8
- </div>
9
- </template>
10
-
11
- <script>
12
- import ThCell from "../packages/cell/index.vue";
13
- export default {
14
- name: "app",
15
- components: { ThCell },
16
- data() {
17
- return {
18
- list: [{ title: "张三", label: "18岁" }]
19
- };
20
- }
21
- };
22
- </script>
23
-
24
- <style lang="scss">
25
- #app {
26
- font-family: "Avenir", Helvetica, Arial, sans-serif;
27
- -webkit-font-smoothing: antialiased;
28
- -moz-osx-font-smoothing: grayscale;
29
- color: #2c3e50;
30
- }
31
- </style>
Binary file
package/src/main.js DELETED
@@ -1,11 +0,0 @@
1
- import Vue from 'vue'
2
- import App from './App.vue'
3
-
4
- import ElementUI from 'element-ui';
5
- import 'element-ui/lib/theme-chalk/index.css';
6
- Vue.use(ElementUI);
7
-
8
- new Vue({
9
- el: '#app',
10
- render: h => h(App)
11
- })