+
+
预览
@@ -15,10 +16,11 @@
{{ item.name }}
-
+
-

+
自定义模板
@@ -30,20 +32,20 @@
站点ICO
+ :limit="Number(1)" ref="avatorUpload" :auto-upload="false" accept=".ico">
选择文件
浏览器标题前面的图片,必须是ico格式,尺寸32PX*32PX
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ :limit="Number(1)" ref="avatorUpload2" :auto-upload="false" accept=".zip">
根据开发文档的提示,将内容压缩成zip包上传
@@ -148,18 +153,19 @@ export default {
templeteList: [],
formData: new FormData(),
previewVisible: false,
- currentImage: ''
+ currentImage: '',
+ itemRefs: {}
}
},
mounted() {
- if(!this.$route.query.uid && !this.$route.query.site_type){
+ if (!this.$route.query.uid && !this.$route.query.site_type) {
this.$message.error('未知错误');
this.$router.push('/')
return false;
}
//站点不存在 读取本地存储设置的数据
const siteTplInfo = JSON.parse(localStorage.getItem('site_tpl_info'))
- if(!this.$route.query.uid && siteTplInfo) {
+ if (!this.$route.query.uid && siteTplInfo) {
this.tpl_id = siteTplInfo.site_tpl
this.pictureUrl = siteTplInfo.picture
this.previewUrl = siteTplInfo.preview
@@ -173,13 +179,13 @@ export default {
// 初始化
get_site_tpl_list() {
let obj = {}
- if(this.$route.query.site_type) obj.site_type = this.$route.query.site_type;
- if(this.$route.query.uid) obj.uid = this.$route.query.uid;
+ if (this.$route.query.site_type) obj.site_type = this.$route.query.site_type;
+ if (this.$route.query.uid) obj.uid = this.$route.query.uid;
this.$http('POST', '/agentnew/ajax_get_site_tpl_list', obj).then(response => {
- if(response.status) {
+ if (response.status) {
this.$nextTick(() => {
- if(!this.tpl_id) {
+ if (!this.tpl_id) {
this.tpl_id = response.data.tpl_data.tpl_id
this.pictureUrl = response.data.tpl_data.picture
this.previewUrl = response.data.tpl_data.thumbnail
@@ -197,17 +203,17 @@ export default {
console.error(error, 'error')
})
},
- jumpCancle(){
+ jumpCancle() {
this.$router.go(-1)
},
- jumpDoc(){
+ jumpDoc() {
window.open(this.$router.resolve({
path: '/customizeDoc',
}).href, '_blank')
},
update_site_tpl() {
//站点不存在只保存选择的模板id到
- if(!this.$route.query.uid){
+ if (!this.$route.query.uid) {
let site_tpl_info = {
site_tpl: this.tpl_id,
site_tpl_name: this.tpl_name,
@@ -225,7 +231,7 @@ export default {
this.formData.set('tpl_id', this.tpl_id)
this.formData.set('is_public_tpl', this.is_public_tpl)
this.$http('POST', '/agentnew/ajax_update_site_tpl', this.formData).then(response => {
- if(response.status){
+ if (response.status) {
this.$router.go(-1)
return true
}
@@ -235,15 +241,26 @@ export default {
})
return true;
},
- chooseTemplate(item) {
+ chooseTemplate(item, index) {
+ // 获取动态 ref 对应的 DOM 元素
+ const targetEl = this.itemRefs[index]; // 注意:$refs 是数组
this.is_public_tpl = 1
this.tpl_id = item.id;
this.tpl_name = item.name;
this.pictureUrl = item.picture;
this.previewUrl = item.thumbnail;
- this.$Message.info(item.introduce)
+ this.openDialog3(targetEl, 'top', item.introduce)
+ },
+ openDialog3(el, pos, introduce) {
+ // type属性可更换
+ this.$positionMessage({
+ type: 'info',
+ message: introduce,
+ target: el, // 可以是DOM元素或选择器
+ position: pos || 'bottom' // 或 'bottom'
+ }) // 2秒后自动隐藏(可选)
},
- choosePrivTemplate(){
+ choosePrivTemplate() {
this.is_public_tpl = 0
this.tpl_id = ''
this.tpl_name = '';
@@ -285,40 +302,46 @@ export default {
}