eztech-core-components 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.
@@ -193,7 +193,7 @@ export default {
193
193
  await this.$showConfirm('Та тухайн хүснэгтийн анхны тохиргоонд буцаах уу?')
194
194
  this.loading = true
195
195
  for (const r of this.list) {
196
- await this.$axios.delete(`1/config_table_users/${r._id}`)
196
+ await this.$axios.delete(`1/config_table_users/${r._id}`, { data: { tid: r.tid }})
197
197
  }
198
198
  this.handleReload()
199
199
  } catch (err) {
@@ -213,6 +213,7 @@ const resizeImage = ({ file, maxSize }) => {
213
213
  const canvas = document.createElement('canvas')
214
214
  const resize = () => {
215
215
  let { width, height } = image
216
+
216
217
  if (width > height) {
217
218
  if (width > maxSize) {
218
219
  height *= maxSize / width
@@ -224,8 +225,10 @@ const resizeImage = ({ file, maxSize }) => {
224
225
  }
225
226
  canvas.width = width
226
227
  canvas.height = height
227
- canvas.getContext('2d').drawImage(image, 0, 0, width, height)
228
- const dataUrl = canvas.toDataURL('image/jpeg')
228
+ const ctx = canvas.getContext('2d')
229
+ ctx.clearRect(0, 0, width, height)
230
+ ctx.drawImage(image, 0, 0, width, height)
231
+ const dataUrl = canvas.toDataURL('image/png')
229
232
  return dataURItoBlob(dataUrl, file.name)
230
233
  }
231
234
  return new Promise((ok, no) => {
@@ -234,11 +237,12 @@ const resizeImage = ({ file, maxSize }) => {
234
237
  return
235
238
  }
236
239
  reader.onload = (readerEvent) => {
237
- image.onload = () => ok({
238
- resizedImage: resize(),
239
- width: image.width,
240
- height: image.height
241
- })
240
+ image.onload = () =>
241
+ ok({
242
+ resizedImage: resize(),
243
+ width: image.width,
244
+ height: image.height
245
+ })
242
246
  image.src = readerEvent.target.result
243
247
  }
244
248
  reader.readAsDataURL(file)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eztech-core-components",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },