|
@@ -101,7 +101,7 @@
|
|
|
style="width: 200px; margin-right: 20px"
|
|
style="width: 200px; margin-right: 20px"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="tab1Arr[index].herf"
|
|
|
|
|
|
|
+ v-model="tab1Arr[index].href"
|
|
|
placeholder="URL网址链接"
|
|
placeholder="URL网址链接"
|
|
|
style="width: 500px"
|
|
style="width: 500px"
|
|
|
></el-input>
|
|
></el-input>
|
|
@@ -123,7 +123,7 @@
|
|
|
style="width: 200px; margin-right: 20px"
|
|
style="width: 200px; margin-right: 20px"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="tab2Arr[index].herf"
|
|
|
|
|
|
|
+ v-model="tab2Arr[index].href"
|
|
|
placeholder="URL网址链接"
|
|
placeholder="URL网址链接"
|
|
|
style="width: 500px"
|
|
style="width: 500px"
|
|
|
></el-input>
|
|
></el-input>
|
|
@@ -166,7 +166,9 @@
|
|
|
@mouseenter="moveShowIdn = index"
|
|
@mouseenter="moveShowIdn = index"
|
|
|
@mouseleave="moveShowIdn = null"
|
|
@mouseleave="moveShowIdn = null"
|
|
|
>
|
|
>
|
|
|
- <img :src="baseURL + item.url" alt="" />{{ item.name }}
|
|
|
|
|
|
|
+ <img :src="baseURL + item.url" alt="" :onerror="defaultImg" />{{
|
|
|
|
|
+ item.name
|
|
|
|
|
+ }}
|
|
|
<!-- 鼠标移上去显示的盒子 -->
|
|
<!-- 鼠标移上去显示的盒子 -->
|
|
|
<div class="moveShow" v-show="moveShowIdn === index">
|
|
<div class="moveShow" v-show="moveShowIdn === index">
|
|
|
<i class="el-icon-edit" @click="outEditAntique(item.id)"></i>
|
|
<i class="el-icon-edit" @click="outEditAntique(item.id)"></i>
|
|
@@ -181,11 +183,15 @@
|
|
|
<!-- 底部按钮 -->
|
|
<!-- 底部按钮 -->
|
|
|
<div class="button_btn">
|
|
<div class="button_btn">
|
|
|
<div @click="$router.go(-1)">取 消</div>
|
|
<div @click="$router.go(-1)">取 消</div>
|
|
|
- <div class="edit">保 存</div>
|
|
|
|
|
|
|
+ <div class="edit" @click="outBtnOk">保 存</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<!-- 点击 文物 的+号出现弹出层 -->
|
|
<!-- 点击 文物 的+号出现弹出层 -->
|
|
|
- <el-dialog :title="addForm.id?'编辑文物':'添加文物'" :visible.sync="addIsShow">
|
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ :title="addForm.id ? '编辑文物' : '添加文物'"
|
|
|
|
|
+ :visible.sync="addIsShow"
|
|
|
|
|
+ @close="addBtnX()"
|
|
|
|
|
+ >
|
|
|
<el-form
|
|
<el-form
|
|
|
:model="addForm"
|
|
:model="addForm"
|
|
|
:rules="addRules"
|
|
:rules="addRules"
|
|
@@ -230,6 +236,7 @@
|
|
|
<img
|
|
<img
|
|
|
style="width: 100%; height: 100%"
|
|
style="width: 100%; height: 100%"
|
|
|
:src="baseURL + item.url"
|
|
:src="baseURL + item.url"
|
|
|
|
|
+ :onerror="defaultImg"
|
|
|
/>
|
|
/>
|
|
|
<div class="imgIcon" v-show="index === imgIconInd">
|
|
<div class="imgIcon" v-show="index === imgIconInd">
|
|
|
<i class="el-icon-zoom-in" @click="lookImg(item.url)"></i>
|
|
<i class="el-icon-zoom-in" @click="lookImg(item.url)"></i>
|
|
@@ -271,7 +278,7 @@
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
<!-- 点击查看图片 -->
|
|
<!-- 点击查看图片 -->
|
|
|
<div class="lookImg" v-if="dialogImageIshow">
|
|
<div class="lookImg" v-if="dialogImageIshow">
|
|
|
- <img :src="baseURL + dialogImageUrl" alt="" />
|
|
|
|
|
|
|
+ <img :src="baseURL + dialogImageUrl" alt="" :onerror="defaultImg" />
|
|
|
<div class="imgBtnX" @click="dialogImageIshow = false">关 闭</div>
|
|
<div class="imgBtnX" @click="dialogImageIshow = false">关 闭</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -322,16 +329,8 @@ export default {
|
|
|
token: '',
|
|
token: '',
|
|
|
// 项目网址数据
|
|
// 项目网址数据
|
|
|
tab1Arr: [{ name: '', href: '' }],
|
|
tab1Arr: [{ name: '', href: '' }],
|
|
|
- tab1: {
|
|
|
|
|
- name: '',
|
|
|
|
|
- herf: ''
|
|
|
|
|
- },
|
|
|
|
|
// 三维场景数据
|
|
// 三维场景数据
|
|
|
tab2Arr: [{ name: '', href: '' }],
|
|
tab2Arr: [{ name: '', href: '' }],
|
|
|
- tab2: {
|
|
|
|
|
- name: '',
|
|
|
|
|
- herf: ''
|
|
|
|
|
- },
|
|
|
|
|
topTabInd: 0,
|
|
topTabInd: 0,
|
|
|
topTab: [
|
|
topTab: [
|
|
|
{ name: '项目详情', id: '#tab0' },
|
|
{ name: '项目详情', id: '#tab0' },
|
|
@@ -379,6 +378,10 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 点击添加网址
|
|
// 点击添加网址
|
|
|
tab1Add () {
|
|
tab1Add () {
|
|
|
|
|
+ if (
|
|
|
|
|
+ this.tab1Arr[this.tab1Arr.length - 1].name.trim() === '' ||
|
|
|
|
|
+ this.tab1Arr[this.tab1Arr.length - 1].href.trim() === ''
|
|
|
|
|
+ ) { return this.$message.warning('网址名称或链接不能为空') }
|
|
|
this.tab1Arr.push({ name: '', href: '' })
|
|
this.tab1Arr.push({ name: '', href: '' })
|
|
|
},
|
|
},
|
|
|
tab1Del (index) {
|
|
tab1Del (index) {
|
|
@@ -397,6 +400,10 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 点击添加场景
|
|
// 点击添加场景
|
|
|
tab2Add () {
|
|
tab2Add () {
|
|
|
|
|
+ if (
|
|
|
|
|
+ this.tab2Arr[this.tab2Arr.length - 1].name.trim() === '' ||
|
|
|
|
|
+ this.tab2Arr[this.tab2Arr.length - 1].href.trim() === ''
|
|
|
|
|
+ ) { return this.$message.warning('场景名称或链接不能为空') }
|
|
|
this.tab2Arr.push({ name: '', href: '' })
|
|
this.tab2Arr.push({ name: '', href: '' })
|
|
|
},
|
|
},
|
|
|
tab2Del (index) {
|
|
tab2Del (index) {
|
|
@@ -445,6 +452,31 @@ export default {
|
|
|
this.$message.info('已取消删除')
|
|
this.$message.info('已取消删除')
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ // 保存
|
|
|
|
|
+ outBtnOk () {
|
|
|
|
|
+ if (this.ruleForm.name.trim() === '') { return this.$message.warning('项目名称不能为空') }
|
|
|
|
|
+ // 遍历文物数组,得到文物id
|
|
|
|
|
+ const temp = []
|
|
|
|
|
+ this.saveAntiqueArr.forEach((v) => {
|
|
|
|
|
+ temp.push(v.id)
|
|
|
|
|
+ })
|
|
|
|
|
+ // 处理项目网址数据
|
|
|
|
|
+ const websites = {}
|
|
|
|
|
+ this.tab1Arr.forEach((v) => {
|
|
|
|
|
+ websites[v.name] = v.href
|
|
|
|
|
+ })
|
|
|
|
|
+ // 处理三维场景数据
|
|
|
|
|
+ const scenes = {}
|
|
|
|
|
+ this.tab2Arr.forEach((v) => {
|
|
|
|
|
+ scenes[v.name] = v.href
|
|
|
|
|
+ })
|
|
|
|
|
+ console.log(999, {
|
|
|
|
|
+ ...this.ruleForm,
|
|
|
|
|
+ goodsIds: temp.join(','),
|
|
|
|
|
+ websites,
|
|
|
|
|
+ scenes
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
// --------------附件--------------
|
|
// --------------附件--------------
|
|
|
successFujian (file) {
|
|
successFujian (file) {
|
|
|
console.log('上传附件成功', file)
|
|
console.log('上传附件成功', file)
|
|
@@ -474,7 +506,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- upload_thumb_success (data) {
|
|
|
|
|
|
|
+ async upload_thumb_success (data) {
|
|
|
this.$message.success('上传成功')
|
|
this.$message.success('上传成功')
|
|
|
// console.log('上传文件成功', data)
|
|
// console.log('上传文件成功', data)
|
|
|
this.imgList.push({
|
|
this.imgList.push({
|
|
@@ -483,7 +515,12 @@ export default {
|
|
|
id: data.data.fileId
|
|
id: data.data.fileId
|
|
|
})
|
|
})
|
|
|
// 把第一张的url设置为封面---如果是新增
|
|
// 把第一张的url设置为封面---如果是新增
|
|
|
- if (!this.addForm.id) this.addForm.thumb = this.imgList[0].url
|
|
|
|
|
|
|
+ // if (!this.addForm.id || this.imgList.length === 1) this.addForm.thumb = this.imgList[0].url
|
|
|
|
|
+ if (this.imgList.length === 1) {
|
|
|
|
|
+ await modelSetIndex(data.data.fileId)
|
|
|
|
|
+ this.fengmianInd = 0
|
|
|
|
|
+ this.addForm.thumb = this.imgList[0].url
|
|
|
|
|
+ }
|
|
|
// this.loading = false
|
|
// this.loading = false
|
|
|
// this.ruleForm.thumb = data.data.filePath
|
|
// this.ruleForm.thumb = data.data.filePath
|
|
|
},
|
|
},
|
|
@@ -496,6 +533,11 @@ export default {
|
|
|
})
|
|
})
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
this.imgList.splice(index, 1)
|
|
this.imgList.splice(index, 1)
|
|
|
|
|
+ if (index === this.fengmianInd) {
|
|
|
|
|
+ // 删除的是封面
|
|
|
|
|
+ this.fengmianInd = null
|
|
|
|
|
+ this.addForm.thumb = ''
|
|
|
|
|
+ }
|
|
|
this.$message.success('删除成功!')
|
|
this.$message.success('删除成功!')
|
|
|
})
|
|
})
|
|
|
.catch(() => {
|
|
.catch(() => {
|
|
@@ -518,8 +560,12 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 点击弹窗里面的保存
|
|
// 点击弹窗里面的保存
|
|
|
async addBtnOk () {
|
|
async addBtnOk () {
|
|
|
- if (this.addForm.name.trim() === '') { return this.$message.warning('文物名称不能为空') }
|
|
|
|
|
- if (this.addForm.url.trim() === '') { return this.$message.warning('文物链接不能为空') }
|
|
|
|
|
|
|
+ if (this.addForm.name.trim() === '') {
|
|
|
|
|
+ return this.$message.warning('文物名称不能为空')
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.addForm.url.trim() === '') {
|
|
|
|
|
+ return this.$message.warning('文物链接不能为空')
|
|
|
|
|
+ }
|
|
|
const temp = []
|
|
const temp = []
|
|
|
this.imgList.forEach((v) => {
|
|
this.imgList.forEach((v) => {
|
|
|
temp.push(v.id)
|
|
temp.push(v.id)
|
|
@@ -528,7 +574,8 @@ export default {
|
|
|
// console.log(999, this.addForm)
|
|
// console.log(999, this.addForm)
|
|
|
const res = await modelSave(this.addForm)
|
|
const res = await modelSave(this.addForm)
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
- if (!this.addForm.id) { // 新增的push进去
|
|
|
|
|
|
|
+ if (!this.addForm.id) {
|
|
|
|
|
+ // 新增的push进去
|
|
|
this.saveAntiqueArr.push({
|
|
this.saveAntiqueArr.push({
|
|
|
id: res.data.id,
|
|
id: res.data.id,
|
|
|
name: res.data.name,
|
|
name: res.data.name,
|
|
@@ -536,7 +583,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
// 修改的改变之前的数组
|
|
// 修改的改变之前的数组
|
|
|
- this.saveAntiqueArr.forEach(v => {
|
|
|
|
|
|
|
+ this.saveAntiqueArr.forEach((v) => {
|
|
|
if (v.id === this.addForm.id) {
|
|
if (v.id === this.addForm.id) {
|
|
|
v.name = res.data.name
|
|
v.name = res.data.name
|
|
|
v.url = res.data.thumb
|
|
v.url = res.data.thumb
|
|
@@ -605,6 +652,7 @@ export default {
|
|
|
height: 30px;
|
|
height: 30px;
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
left: 50%;
|
|
left: 50%;
|
|
|
|
|
+ transform: translateX(-50%);
|
|
|
bottom: 20px;
|
|
bottom: 20px;
|
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
|
border-radius: 8px;
|
|
border-radius: 8px;
|
|
@@ -663,7 +711,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
i:hover {
|
|
i:hover {
|
|
|
-
|
|
|
|
|
color: #dc3545;
|
|
color: #dc3545;
|
|
|
}
|
|
}
|
|
|
& > span {
|
|
& > span {
|