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.
- package/gante.vue +53 -49
- 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
|
-
|
|
127
|
+
this.change(data)
|
|
105
128
|
});
|
|
106
129
|
commitEmit.$off('change-calendar')
|
|
107
130
|
commitEmit.$on('change-calendar', (data) => {
|
|
108
|
-
|
|
131
|
+
this.change_calendar(data)
|
|
109
132
|
});
|
|
110
133
|
// 某个单元格的点击事件
|
|
111
134
|
commitEmit.$off('on-click')
|
|
112
135
|
commitEmit.$on('on-click', (data) => {
|
|
113
|
-
|
|
136
|
+
this.onclick(data)
|
|
114
137
|
});
|
|
115
138
|
// 拖动改变时间
|
|
116
139
|
commitEmit.$off('onDragChangeTime')
|
|
117
140
|
commitEmit.$on('onDragChangeTime', (oldData,data) => {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
141
|
+
const resolves = (bol)=>{
|
|
142
|
+
if(!bol){
|
|
143
|
+
this.resetTask(this.ganteData,oldData);
|
|
122
144
|
}
|
|
123
|
-
|
|
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
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
},
|