gunter-kgd 1.0.9 → 1.0.11

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