tianheng-ui 0.1.31 → 0.1.33

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,100 @@
1
+ <template>
2
+ <div class="generateList">
3
+ <!-- 搜索栏 -->
4
+ <search v-if="searchConfig.show" :options="searchConfig.options" />
5
+ <list
6
+ v-if="tableData.length"
7
+ :data="tableData"
8
+ :config="tableConfig"
9
+ ></list>
10
+ <th-empty v-else style="padding:100px 0;">
11
+ <img
12
+ slot="image"
13
+ :src="require('../../lib/theme-chalk/images/notData.png')"
14
+ style="width:150px;"
15
+ alt=""
16
+ />
17
+ </th-empty>
18
+ <tools :config="toolsConfig" @click="handleActionClick"></tools>
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+ import Search from "./custom/items/search/index-h5.vue";
24
+ import List from "./custom/items/table/index-h5.vue";
25
+ import Tools from "./custom/items/tools/index-h5.vue";
26
+ export default {
27
+ name: "thListGenerate",
28
+ components: { Search, List, Tools },
29
+ props: {
30
+ config: Object,
31
+ data: Array
32
+ },
33
+ data() {
34
+ return {
35
+ searchConfig: {},
36
+ toolsConfig: [],
37
+ tableConfig: {},
38
+ tableData: this.data,
39
+ networkConfig: {}
40
+ };
41
+ },
42
+ watch: {
43
+ config(val) {
44
+ this.initConfig();
45
+ },
46
+ data(val) {
47
+ this.tableData = val;
48
+ }
49
+ },
50
+ mounted() {
51
+ this.initConfig();
52
+ },
53
+ methods: {
54
+ // 处理配置信息
55
+ initConfig() {
56
+ if (!this.config || !this.config.table) return;
57
+ // 搜索配置
58
+ this.searchConfig = this.config.search;
59
+
60
+ // 操作配置
61
+ const toolsConfig = this.config.tools;
62
+ this.toolsConfig = Object.values(toolsConfig).filter(item => {
63
+ return item.position === "header" && item.show;
64
+ });
65
+
66
+ // 表格配置
67
+ const tableConfig = this.config.table;
68
+ const rowActions = Object.values(toolsConfig).filter(item => {
69
+ return item.position === "row" && item.show;
70
+ });
71
+ tableConfig.actions = rowActions;
72
+ this.tableConfig = tableConfig;
73
+
74
+ // 网络请求
75
+ this.networkConfig = this.config.network;
76
+ },
77
+ handleSearchChange(data) {
78
+ this.$emit("search", data);
79
+ },
80
+ handleTableClick(data) {
81
+ this.$emit("click", data);
82
+ },
83
+ handleActionClick(action, data) {
84
+ this.tableData.push({ id: new Date().getTime() });
85
+ this.$emit("action", action, data);
86
+ }
87
+ }
88
+ };
89
+ </script>
90
+
91
+ <style lang="scss" scoped>
92
+ .generateList {
93
+ width: 300px;
94
+ height: 649px;
95
+ margin: auto;
96
+ overflow-y: scroll;
97
+ border: 1px solid #e5e5e5;
98
+ border-radius: 10px;
99
+ }
100
+ </style>
@@ -0,0 +1,5 @@
1
+ import GenerateTable from "./generateTable.vue";
2
+ GenerateTable.install = function(Vue) {
3
+ Vue.component(GenerateTable.name, GenerateTable);
4
+ };
5
+ export default GenerateTable;
@@ -88,9 +88,9 @@
88
88
  </template>
89
89
 
90
90
  <script>
91
- import Search from "./custom/items/search";
92
- import Tools from "./custom/items/tools";
93
- import STable from "./custom/items/table";
91
+ import Search from "./custom/items/search/index-pc.vue";
92
+ import Tools from "./custom/items/tools/index-pc.vue";
93
+ import STable from "./custom/items/table/index-pc.vue";
94
94
  import * as Axios from "lib/theme-chalk/js/axios";
95
95
  export default {
96
96
  name: "thTableGenerate",
@@ -10,7 +10,6 @@
10
10
  <slot name="action"></slot>
11
11
  </widget-tools>
12
12
  <widget-table
13
- v-if="client === 'monitor'"
14
13
  style="height:calc(100% - 45px)"
15
14
  :config="tableConfig"
16
15
  ></widget-table>
@@ -1,5 +1,5 @@
1
- import TableMaking from "./index.vue";
2
- TableMaking.install = function(Vue) {
3
- Vue.component(TableMaking.name, TableMaking);
1
+ import MakingTable from "./index.vue";
2
+ MakingTable.install = function(Vue) {
3
+ Vue.component(MakingTable.name, MakingTable);
4
4
  };
5
- export default TableMaking;
5
+ export default MakingTable;
@@ -190,9 +190,24 @@
190
190
  title="table 样式配置(电脑端)"
191
191
  name="group-style_table"
192
192
  >
193
- <el-form-item label="是否边框">
193
+ <el-form-item label="显示边框">
194
194
  <el-switch v-model="config.table.style.table.border"> </el-switch>
195
195
  </el-form-item>
196
+ <el-form-item>
197
+ <el-tooltip
198
+ slot="label"
199
+ effect="dark"
200
+ content="Table 的高度,默认为自动高度。如果 height 为 number 类型,单位 px;如果 height 为 string 类型,则这个高度会设置为 Table 的 style.height 的值,Table 的高度会受控于外部样式。"
201
+ placement="top"
202
+ >
203
+ <span style="color: #409EFF;">高度</span>
204
+ </el-tooltip>
205
+ <el-input
206
+ v-model="config.table.style.table.height"
207
+ placeholder="请输入"
208
+ clearable
209
+ ></el-input>
210
+ </el-form-item>
196
211
  </el-collapse-item>
197
212
  <el-collapse-item
198
213
  title="cell 样式配置(移动端)"
package/packages/index.js CHANGED
@@ -41,10 +41,11 @@ import ImagePreview from "./ImagePreview/index.js";
41
41
  import Row from "./Row/index.js";
42
42
  import Col from "./Col/index.js";
43
43
  import Upload from "./Upload/index.js";
44
- import FormMaking from "./FormMaking/making.js";
45
- import FormGenerate from "./FormMaking/generate.js";
46
- import TableMaking from "./TableMaking/making.js";
47
- import TableGenerate from "./TableMaking/generate.js";
44
+ import MakingForm from "./FormMaking/making.js";
45
+ import GenerateForm from "./FormMaking/generate.js";
46
+ import MakingTable from "./TableMaking/making.js";
47
+ import GenerateTable from "./TableMaking/generateTable.js";
48
+ import GenerateList from "./TableMaking/generateList.js";
48
49
  import Workflow from "../packages/Workflow/index.js";
49
50
 
50
51
  const components = [
@@ -67,10 +68,11 @@ const components = [
67
68
  Row,
68
69
  Col,
69
70
  Upload,
70
- FormMaking,
71
- FormGenerate,
72
- TableMaking,
73
- TableGenerate,
71
+ MakingForm,
72
+ GenerateForm,
73
+ MakingTable,
74
+ GenerateTable,
75
+ GenerateList,
74
76
  Workflow
75
77
  ];
76
78
 
@@ -125,10 +127,11 @@ export default {
125
127
  Row,
126
128
  Col,
127
129
  Upload,
128
- FormMaking,
129
- FormGenerate,
130
- TableMaking,
131
- TableGenerate,
130
+ MakingForm,
131
+ GenerateForm,
132
+ MakingTable,
133
+ GenerateTable,
134
+ GenerateList,
132
135
  Workflow
133
136
  };
134
137
 
@@ -153,9 +156,10 @@ export {
153
156
  Row,
154
157
  Col,
155
158
  Upload,
156
- FormMaking,
157
- FormGenerate,
158
- TableMaking,
159
- TableGenerate,
159
+ MakingForm,
160
+ GenerateForm,
161
+ MakingTable,
162
+ GenerateTable,
163
+ GenerateList,
160
164
  Workflow
161
165
  };
@@ -1,5 +0,0 @@
1
- import TableGenerate from "./generateTable.vue";
2
- TableGenerate.install = function(Vue) {
3
- Vue.component(TableGenerate.name, TableGenerate);
4
- };
5
- export default TableGenerate;