|
|
@ -85,7 +85,7 @@ |
|
|
|
<ul class="styles"> |
|
|
|
<ul class="styles"> |
|
|
|
<li v-for="(item, i) in listStyle" :key="i" @click="form.listStyleId = item.id"> |
|
|
|
<li v-for="(item, i) in listStyle" :key="i" @click="form.listStyleId = item.id"> |
|
|
|
<div class="review"> |
|
|
|
<div class="review"> |
|
|
|
<!-- <img :src="require('@/assets/images/list' + item.id + '.png')" alt=""> --> |
|
|
|
<img :src="require('@/assets/images/style/' + item.id + '.png')" alt=""> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-radio v-model="form.listStyleId" :label="item.id">{{ item.style }}</el-radio> |
|
|
|
<el-radio v-model="form.listStyleId" :label="item.id">{{ item.style }}</el-radio> |
|
|
|
</li> |
|
|
|
</li> |
|
|
@ -95,7 +95,7 @@ |
|
|
|
<ul class="styles"> |
|
|
|
<ul class="styles"> |
|
|
|
<li v-for="(item, i) in detailStyleId" :key="i" @click="form.detailStyleId = item.id"> |
|
|
|
<li v-for="(item, i) in detailStyleId" :key="i" @click="form.detailStyleId = item.id"> |
|
|
|
<div class="review"> |
|
|
|
<div class="review"> |
|
|
|
<!-- <img :src="require('@/assets/images/article' + item.id + '.png')" alt=""> --> |
|
|
|
<img :src="require('@/assets/images/style/' + item.id + '.png')" alt=""> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-radio v-model="form.detailStyleId" :label="item.id">{{ item.style }}</el-radio> |
|
|
|
<el-radio v-model="form.detailStyleId" :label="item.id">{{ item.style }}</el-radio> |
|
|
|
</li> |
|
|
|
</li> |
|
|
@ -322,7 +322,8 @@ export default { |
|
|
|
route: '/site' |
|
|
|
route: '/site' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: '内容管理' |
|
|
|
name: '内容管理', |
|
|
|
|
|
|
|
route: '/column' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: '栏目管理', |
|
|
|
name: '栏目管理', |
|
|
@ -353,7 +354,7 @@ export default { |
|
|
|
const { id } = this.form |
|
|
|
const { id } = this.form |
|
|
|
const { updateTime } = this |
|
|
|
const { updateTime } = this |
|
|
|
// 更改了信息才需要提示 |
|
|
|
// 更改了信息才需要提示 |
|
|
|
if ((!id && updateTime) || (id && updateTime > 1)) { |
|
|
|
if (updateTime > 1) { |
|
|
|
this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', { |
|
|
|
this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', { |
|
|
|
type: 'warning' |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
@ -525,9 +526,8 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 图片裁剪上传事件 |
|
|
|
// 图片裁剪上传事件 |
|
|
|
customUpload(data) { |
|
|
|
customUpload(data) { |
|
|
|
const blob = this.dataURItoBlob(data) |
|
|
|
|
|
|
|
const formData = new FormData() |
|
|
|
const formData = new FormData() |
|
|
|
formData.append('file', blob, this.file.name) |
|
|
|
formData.append('file', data, this.file.name) |
|
|
|
formData.append('quote', this.form.columnName) |
|
|
|
formData.append('quote', this.form.columnName) |
|
|
|
formData.append('site', this.site.siteName) |
|
|
|
formData.append('site', this.site.siteName) |
|
|
|
formData.append('uploader', this.userName) |
|
|
|
formData.append('uploader', this.userName) |
|
|
@ -537,6 +537,7 @@ export default { |
|
|
|
compress(img) { |
|
|
|
compress(img) { |
|
|
|
const canvas = document.createElement('canvas') |
|
|
|
const canvas = document.createElement('canvas') |
|
|
|
const ctx = canvas.getContext('2d') |
|
|
|
const ctx = canvas.getContext('2d') |
|
|
|
|
|
|
|
console.log("🚀 ~ file: index.vue:540 ~ compress ~ ctx", ctx,img.width) |
|
|
|
// let initSize = img.src.length; |
|
|
|
// let initSize = img.src.length; |
|
|
|
const width = img.width |
|
|
|
const width = img.width |
|
|
|
const height = img.height |
|
|
|
const height = img.height |
|
|
|