gunter-kgd 1.0.10 → 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.
Files changed (2) hide show
  1. package/gante.vue +53 -49
  2. package/package.json +1 -1
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.10",
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"