tianheng-ui 0.0.69 → 0.0.71

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.69",
4
+ "version": "0.0.71",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -78,7 +78,7 @@
78
78
  "lib",
79
79
  "packages"
80
80
  ],
81
- "homepage": "",
81
+ "homepage": "https://tianhengui.demo.tianhengyun.com/",
82
82
  "keywords": [
83
83
  "tianheng",
84
84
  "tianheng-ui"
@@ -1,29 +1,35 @@
1
1
  <template>
2
2
  <el-dialog
3
3
  class="th-dialog"
4
+ :class="[customClass]"
4
5
  :visible.sync="visible"
6
+ :width="width"
7
+ :top="top"
5
8
  :fullscreen="dialogFullscreen"
6
- :close-on-click-modal="false"
9
+ :close-on-click-modal="closeOnClickModal"
10
+ :close-on-press-escape="closeOnPressEscape"
7
11
  :show-close="false"
8
- :before-close="handleClose"
12
+ :modal="modal"
13
+ :modal-append-to-body="modalAppendToBody"
14
+ :append-to-body="appendToBody"
15
+ :before-close="handleBeforeClose"
16
+ :destroy-on-close="destroyOnClose"
9
17
  >
10
- <div slot="title">
11
- <div slot="title" class="th-dialog__header">
12
- <div class="th-dialog__title">{{ title }}</div>
13
- <div class="th-dialog__action">
14
- <i
15
- v-if="showFullscreen"
16
- class="th-dialog__action_item"
17
- :class="fullscreenIcon"
18
- @click="handleFullscreenChange"
19
- ></i>
20
- <i
21
- v-if="showClose"
22
- class="th-dialog__action_item "
23
- :class="closeIcon"
24
- @click="handleClose"
25
- ></i>
26
- </div>
18
+ <div slot="title" class="th-dialog__header">
19
+ <div class="th-dialog__title">{{ title }}</div>
20
+ <div class="th-dialog__action">
21
+ <i
22
+ v-if="showFullscreen"
23
+ class="th-dialog__action_item"
24
+ :class="fullscreenIcon"
25
+ @click="handleFullscreenChange"
26
+ ></i>
27
+ <i
28
+ v-if="showClose"
29
+ class="th-dialog__action_item "
30
+ :class="closeIcon"
31
+ @click="handleBeforeClose"
32
+ ></i>
27
33
  </div>
28
34
  </div>
29
35
  <slot />
@@ -57,6 +63,17 @@ export default {
57
63
  visible: Boolean,
58
64
  loading: Boolean,
59
65
  title: { type: String, default: "" },
66
+ width: { type: String, default: "800px" },
67
+ fullscreen: { type: Boolean, default: false },
68
+ top: { type: String, default: "15vh" },
69
+ modal: { type: Boolean, default: true },
70
+ modalAppendToBody: { type: Boolean, default: true },
71
+ appendToBody: { type: Boolean, default: false },
72
+ customClass: String,
73
+ closeOnClickModal: { type: Boolean, default: false },
74
+ closeOnPressEscape: { type: Boolean, default: false },
75
+ beforeClose: Function,
76
+ destroyOnClose: { type: Boolean, default: false },
60
77
 
61
78
  showAffirm: { type: Boolean, default: true },
62
79
  affirmText: { type: String, default: "确 认" },
@@ -67,7 +84,6 @@ export default {
67
84
  showClose: { type: Boolean, default: true },
68
85
  closeIcon: { type: String, default: "el-icon-close" },
69
86
 
70
- fullscreen: { type: Boolean, default: false },
71
87
  showFullscreen: { type: Boolean, default: true },
72
88
  fullscreenIcon: { type: String, default: "el-icon-full-screen" },
73
89
 
@@ -89,6 +105,16 @@ export default {
89
105
  this.$emit("input", !this.visible);
90
106
  this.$emit("on-close");
91
107
  },
108
+ handleBeforeClose(done) {
109
+ if (this.beforeClose) {
110
+ const callback = () => {
111
+ this.handleClose();
112
+ };
113
+ this.beforeClose(callback);
114
+ } else {
115
+ this.handleClose();
116
+ }
117
+ },
92
118
  handleAffirm() {
93
119
  this.$emit("on-affirm");
94
120
  },
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="th-grid">
2
+ <div class="th-grid" :class="{ 'th-grid__border': border }">
3
3
  <slot></slot>
4
4
  </div>
5
5
  </template>
@@ -8,7 +8,9 @@
8
8
  export default {
9
9
  name: "ThGrid",
10
10
  props: {
11
- column: Number | String
11
+ column: Number | String,
12
+ position: { type: String, default: "block" },
13
+ border: Boolean
12
14
  },
13
15
  data() {
14
16
  return {};
@@ -1,11 +1,19 @@
1
1
  <template>
2
- <div class="th-grid-item" :style="selfStyle">
2
+ <div
3
+ class="th-grid-item"
4
+ :class="{ 'th-grid-item__border': border }"
5
+ :style="selfStyle"
6
+ >
3
7
  <slot v-if="$slots.default"></slot>
4
- <div v-else class="th-grid-item-content">
5
- <i v-if="isIcon" :class="['th-icon',icon]"></i>
8
+ <div
9
+ v-else
10
+ class="th-grid-item-content"
11
+ :class="`th-grid-item-content_${position}`"
12
+ >
13
+ <i v-if="isIcon" :class="['th-icon', icon]"></i>
6
14
  <img v-else class="th-grid-item-img" src="" alt="" />
7
- <p class="th-grid-item-title">{{ title }}</p>
8
- <p class="th-grid-item-label">{{ label }}</p>
15
+ <slot v-if="$slots.title" name="title"></slot>
16
+ <p v-else class="th-grid-item-title">{{ title }}</p>
9
17
  </div>
10
18
  </div>
11
19
  </template>
@@ -15,11 +23,13 @@ export default {
15
23
  name: "ThGridItem",
16
24
  props: {
17
25
  title: String,
18
- label: String,
19
26
  icon: String
20
27
  },
21
28
  data() {
22
- return {};
29
+ return {
30
+ position: "",
31
+ border: false
32
+ };
23
33
  },
24
34
  computed: {
25
35
  isIcon() {
@@ -33,11 +43,15 @@ export default {
33
43
  }
34
44
 
35
45
  let column = 0;
36
- if (parent) column = parent.column;
46
+ if (parent) {
47
+ column = parent.column;
48
+ this.position = parent.position;
49
+ this.border = parent.border;
50
+ }
37
51
 
38
52
  const style = {};
39
53
  if (column) {
40
- style.flex = 'none'
54
+ style.flex = "none";
41
55
  style.flexBasis = `${100 / column}%`;
42
56
  }
43
57
  return style;
@@ -308,7 +308,6 @@ export default {
308
308
  .th-table {
309
309
  position: relative;
310
310
  width: 100%;
311
- height: 100%;
312
311
  .pagination {
313
312
  margin-top: 20px;
314
313
  }
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="th-tools">
2
+ <div class="th-table-tools">
3
3
  <el-button
4
4
  v-for="(item, index) in options"
5
5
  :key="index"
@@ -43,7 +43,7 @@ export default {
43
43
  </script>
44
44
 
45
45
  <style lang="less" scoped>
46
- .th-tools {
46
+ .th-table-tools {
47
47
  margin-bottom: 10px;
48
48
  }
49
49
  </style>
@@ -9,11 +9,11 @@ export default {
9
9
  components: { VueEditor },
10
10
  model: {
11
11
  prop: "value",
12
- event: "uploadValue"
12
+ event: "upload:value"
13
13
  },
14
14
  props: {
15
15
  value: String,
16
- disabled: String
16
+ disabled: Boolean
17
17
  },
18
18
  data() {
19
19
  return {
@@ -21,10 +21,17 @@ export default {
21
21
  };
22
22
  },
23
23
  watch: {
24
- data(val) {
25
- this.$emit("uploadValue", val);
24
+ data: {
25
+ handler(val) {
26
+ this.$emit("upload:value", val);
27
+ },
28
+ deep: true
29
+ },
30
+ value(val) {
31
+ this.data = val;
26
32
  }
27
- }
33
+ },
34
+ methods: {}
28
35
  };
29
36
  </script>
30
37