tianheng-ui 0.0.27 → 0.0.28

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tianheng-ui",
3
3
  "description": "A Vue.js project",
4
- "version": "0.0.27",
4
+ "version": "0.0.28",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -183,8 +183,4 @@ export default {
183
183
  margin-left: 0px;
184
184
  }
185
185
  }
186
-
187
- // .el-button + .action-popover {
188
- // margin-left: 10px !important;
189
- // }
190
186
  </style>
@@ -249,7 +249,6 @@ export default {
249
249
  return this.$refs["th_table"];
250
250
  },
251
251
  handleFormatTime(time, cFormat) {
252
- console.log(time, cFormat);
253
252
  if (arguments.length === 0) {
254
253
  return null;
255
254
  }
@@ -0,0 +1,8 @@
1
+ import Tools from "./tools.vue";
2
+
3
+ /* istanbul ignore next */
4
+ Tools.install = function(Vue) {
5
+ Vue.component(Tools.name, Tools);
6
+ };
7
+
8
+ export default Tools;
@@ -1,99 +1,43 @@
1
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>
2
+ <div class="th-Tools">
3
+ <el-button
4
+ v-for="(item, index) in options"
5
+ :key="index"
6
+ :style="item.style"
7
+ :type="item.type"
8
+ :icon="item.icon"
9
+ :disabled="item.disabled || disabled[item.act]"
10
+ :loading="item.loading"
11
+ @click="handleClick(item)"
12
+ >{{ item.name }}</el-button
13
+ >
46
14
  </div>
47
15
  </template>
48
16
 
49
17
  <script>
50
18
  export default {
51
- name: "ThTableTools",
19
+ name:'ThTools',
52
20
  props: {
53
21
  options: {
54
22
  type: Array,
55
23
  default: () => {
56
24
  return [];
57
- }
25
+ },
58
26
  },
59
- selectionDisabled: {
60
- type: Boolean,
27
+ disabled: {
28
+ type: Object,
61
29
  default: () => {
62
- return true;
63
- }
64
- }
30
+ return {};
31
+ },
32
+ },
65
33
  },
66
34
  data() {
67
- return {
68
- loadingDel: false
69
- };
35
+ return {};
70
36
  },
71
37
  methods: {
72
- doEval(item) {
73
- this.$emit("on-eval", item);
74
- },
75
- doAdd(item) {
76
- this.$emit("on-add", item);
77
- },
78
- doRefresh(item) {
79
- this.$emit("on-refresh", item);
38
+ handleClick(item) {
39
+ this.$emit("on-click", item);
80
40
  },
81
- doExport(item) {
82
- this.$emit("on-export", item);
83
- },
84
- doBatch(item) {
85
- this.loadingDel = true;
86
- const callback = bool => {
87
- this.loadingDel = false;
88
- };
89
- this.$emit("on-batch", item, callback);
90
- }
91
- }
41
+ },
92
42
  };
93
43
  </script>
94
-
95
- <style lang="less">
96
- .tableTools {
97
- margin-bottom: 10px;
98
- }
99
- </style>