gunter-kgd 1.0.9 → 1.0.10

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.
@@ -96,73 +96,78 @@
96
96
  }
97
97
  },
98
98
  created() {
99
+ this.initEmit()
100
+
101
+ },
102
+ mounted() {
103
+ this.$nextTick(function () {
104
+ setTimeout(() => {
105
+ // 获取到左边表格所有td加起来的宽度
106
+ this.find_attr(document.getElementsByClassName('gante-table-box')[0].clientWidth, this.th_data)
107
+ })
108
+ })
109
+
110
+ },
111
+ methods: {
112
+ //初始化emit
113
+ initEmit() {
99
114
  commitEmit.$off('change')
100
115
  commitEmit.$on('change', (data) => {
101
- this.change(data)
116
+ this.change(data)
102
117
  });
103
118
  commitEmit.$off('change-calendar')
104
119
  commitEmit.$on('change-calendar', (data) => {
105
- this.change_calendar(data)
120
+ this.change_calendar(data)
106
121
  });
107
122
  // 某个单元格的点击事件
108
123
  commitEmit.$off('on-click')
109
124
  commitEmit.$on('on-click', (data) => {
110
- this.onclick(data)
125
+ this.onclick(data)
111
126
  });
112
127
  // 拖动改变时间
113
128
  commitEmit.$off('onDragChangeTime')
114
129
  commitEmit.$on('onDragChangeTime', (oldData,data) => {
115
- const resolves = (bol)=>{
116
- if(!bol){
117
- this.resetTask(this.ganteData,oldData);
118
- }
130
+ const resolves = (bol)=>{
131
+ if(!bol){
132
+ this.resetTask(this.ganteData,oldData);
119
133
  }
120
- this.onDragChangeTime(data,resolves)
134
+ }
135
+ this.onDragChangeTime(data,resolves)
121
136
  });
122
137
 
123
138
 
124
139
  //懒加载
125
140
  commitEmit.$off('on-load')
126
141
  commitEmit.$on('on-load', () => {
127
- /**
128
- *
129
- * @type {Function}
130
- * requestBol: 是否显示加载图标
131
- * data: 加载的数据
132
- * start_time: 最小开始时间
133
- * end_time: 最大的结束时间
134
- */
135
- const resolve = ((requestBol, data, start_time, end_time) => {
136
- if (!requestBol) {
137
- this.showLoading = false
138
- }
139
- this.ganteData.push(...data)
140
- this.start_time = start_time
141
- this.end_time = end_time
142
- this.init({ganteData: this.ganteData, start_time: this.start_time, end_time: this.end_time},false)
143
- this.$nextTick(function () {
144
- this.$refs.gante_gc.requestBol = requestBol
145
- })
142
+ /**
143
+ *
144
+ * @type {Function}
145
+ * requestBol: 是否显示加载图标
146
+ * data: 加载的数据
147
+ * start_time: 最小开始时间
148
+ * end_time: 最大的结束时间
149
+ */
150
+ const resolve = ((requestBol, data, start_time, end_time) => {
151
+ if (!requestBol) {
152
+ this.showLoading = false
153
+ }
154
+ this.ganteData.push(...data)
155
+ this.start_time = start_time
156
+ this.end_time = end_time
157
+ this.init({ganteData: this.ganteData, start_time: this.start_time, end_time: this.end_time},false)
158
+ this.$nextTick(function () {
159
+ this.$refs.gante_gc.requestBol = requestBol
146
160
  })
147
- this.onLoad(resolve)
161
+ })
162
+ this.onLoad(resolve)
148
163
  });
149
164
 
150
165
 
151
166
  commitEmit.$off('triggerInit');
152
167
  commitEmit.$on('triggerInit', (start_time,end_time) =>{
153
- this.init({start_time: start_time, end_time: end_time},false)
168
+ this.init({start_time: start_time, end_time: end_time},false)
154
169
  })
155
- },
156
- mounted() {
157
- this.$nextTick(function () {
158
- setTimeout(() => {
159
- // 获取到左边表格所有td加起来的宽度
160
- this.find_attr(document.getElementsByClassName('gante-table-box')[0].clientWidth, this.th_data)
161
- })
162
- })
163
-
164
- },
165
- methods: {
170
+ },
166
171
  //设置加载提示
167
172
  setShowLoading(data) {
168
173
  this.showLoading = data
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gunter-kgd",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "main": "gante-vue.common.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"