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