canyin-project/ybcy/views/admin/site/site_setting.php

450 lines
25 KiB
PHP
Raw Normal View History

2024-11-01 16:07:54 +08:00
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<?php if($this->params['site_image']):?>
<link rel="shortcut icon" type="image/x-icon" href="<?php echo $this->params['site_image'];?>" />
<?php else:?>
<link rel="shortcut icon" type="image/x-icon" href="<?=Yii::$app->request->baseUrl?>/web/favicon.ico" />
<?php endif;?>
<title><?php if($this->params['site_title']):?>
<?php echo $this->params['site_title']; ?>
<?php else:?>
应用管理后台
<?php endif;?>-站点设置</title>
<link rel="stylesheet" type="text/css" href="<?=Yii::$app->request->baseUrl?>/web/static/css/globle.css"/>
<script src="<?=Yii::$app->request->baseUrl?>/web/static/js/config.js" type="text/javascript" charset="utf-8"></script>
</head>
<style>
.main_con .elinput {
width: 330px;
}
.right-left {
width: 15%;
}
.right-width {
width: 85%;
}
.imgbox {
width: 100px;
height: 100px;
}
.main_con .eltextarea {
width: 414px;
}
.color_rb{
color: #f00;
}
</style>
<body>
<div class="pHead">
<div class="publicHeader"><?php echo $this->render('@app/views/admin/public/publicHeader.html'); ?></div>
</div>
<div class="pLeft">
<div class="publicAside hei"><?php echo $this->render('@app/views/admin/public/publicAside.html'); ?></div>
</div>
<div class="upimg">
<div class="attachment hei"><?php echo $this->render('@app/views/admin/public/attachment-img.html'); ?></div>
</div>
<div class="yb_body">
<div class="layout" id="platformList" v-cloak v-loading="cardLoading">
<el-container>
<el-container>
<el-main>
<div class="main" style="min-width: 800px">
<div class="ba_f">
<div class="main-tab ba_f bor_rad5 mar_l20 pad_t_20">
<div class="main-search-tit t_l fon_16 wei pad_20 ">站点设置</div>
</div>
<div class="main_con pad_b_30 mar_l50">
<div class="flex-bet wid pad_tb_20">
<div class="flex-grow-0 t_r pad_r_25 right-left">站点状态</div>
<div class="flex-grow-1 t_l right-width">
<el-radio v-model="formInline.status" label="1">开启</el-radio>
<el-radio v-model="formInline.status" label="2">关闭</el-radio>
</div>
</div>
<div class="flex-bet wid pad_tb_20">
<div class="flex-grow-0 t_r pad_r_25 right-left"><span class="color_rb">*</span>系统名称(name)
</div>
<div class="flex-grow-1 t_l right-width">
<el-input v-model="formInline.site_name" placeholder="请输入系统名称"
class="elinput"></el-input>
<span class="fon_12 color_9 mar_l20">
位置显示在管理后台的左上角logo右边
</span>
</div>
</div>
<div class="flex-bet wid pad_tb_20">
<div class="flex-grow-0 t_r pad_r_25 right-left"><span class="color_rb">*</span>网站标题(title)
</div>
<div class="flex-grow-1 t_l right-width">
<el-input v-model="formInline.site_title" placeholder="请输入网站标题"
class="elinput"></el-input>
</div>
</div>
<div class="flex-bet wid pad_tb_20">
<div class="flex-grow-0 t_r pad_r_25 right-left">网站关键字(keywords)</div>
<div class="flex-grow-1 t_l right-width">
<el-input v-model="formInline.site_keyword" placeholder="请输入网站关键字"
class="elinput"></el-input>
</div>
</div>
<div class="flex-bet wid pad_tb_20">
<div class="flex-grow-0 t_r pad_r_25 right-left">网站描述(description)</div>
<div class="flex-grow-1 t_l right-width">
<el-input v-model="formInline.site_description" type="textarea"
:autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入网站描述"
class="eltextarea"></el-input>
</div>
</div>
<div class="flex-bet wid pad_tb_20">
<div class="flex-grow-0 t_r pad_r_25 right-left">站点icon(favorite icon)</div>
<div class="flex-grow-1 t_l right-width flex-y-bottom">
<div class="uploadSource bor_de rel flex curs" v-if="imageUrl">
<label class="statusLabel curs" @mouseenter="enter(1)" @mouseleave="leave(1)">
<i class="el-icon-check" ref="imgicon1"></i>
<i class="el-icon-close" @click="deleteMultiImage(imageUrl,1)"></i>
</label>
<img :src="imageUrl" @click='test(1)' class="wid"/>
</div>
<div class="uploadSource flex-center curs" v-else @click='test(1)'>
<i class="el-icon-plus fon_40 color_d9"></i>
</div>
<attachment-img ref="img1" type="img" @attachment='imgadd1'></attachment-img>
<!-- <el-upload
class="avatar-uploader"
:action="upload_url"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload">
<img v-if="imageUrl" :src="imageUrl" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload> -->
<div class="fon_12 color_9 mar_l20">
建议尺寸16*16px,位置显示在浏览器地址栏图标
</div>
</div>
</div>
<div class="flex-bet wid pad_tb_20">
<div class="flex-grow-0 t_r pad_r_25 right-left">网站LOGO</div>
<div class="flex-grow-1 t_l right-width flex-y-bottom">
<div class="uploadSource bor_de rel flex curs" v-if="imageUrl3">
<label class="statusLabel curs" @mouseenter="enter(3)" @mouseleave="leave(3)">
<i class="el-icon-check" ref="imgicon3"></i>
<i class="el-icon-close" @click="deleteMultiImage(imageUrl3,3)"></i>
</label>
<img :src="imageUrl3" @click='test(3)' class="wid"/>
</div>
<div class="uploadSource flex-center curs" v-else @click='test(3)'>
<i class="el-icon-plus fon_40 color_d9"></i>
</div>
<attachment-img ref="img3" type="img" @attachment='imgadd3'></attachment-img>
<div class="fon_12 color_9 mar_l20">
建议尺寸50px*50px,位置显示在管理后台的左上角
</div>
</div>
</div>
<div class="flex-bet wid pad_tb_20">
<div class="flex-grow-0 t_r pad_r_25 right-left">登录页背景图</div>
<div class="flex-grow-1 t_l right-width flex-y-bottom">
<!-- <div class="imgbox bor_rad5 ba_f5 ">
<el-upload
class="avatar-uploader"
:action="upload_url2"
:show-file-list="false"
:on-success="handleAvatarSuccess2"
:before-upload="beforeAvatarUpload">
<img v-if="imageUrl2" :src="imageUrl2" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div> -->
<div class="uploadSource bor_de rel flex curs" v-if="imageUrl2">
<label class="statusLabel curs" @mouseenter="enter(2)" @mouseleave="leave(2)">
<i class="el-icon-check" ref="imgicon2"></i>
<i class="el-icon-close" @click="deleteMultiImage(imageUrl2,2)"></i>
</label>
<img :src="imageUrl2" @click='test(2)' class="wid"/>
</div>
<div class="uploadSource flex-center curs" v-else @click='test(2)'>
<i class="el-icon-plus fon_40 color_d9"></i>
</div>
<attachment-img ref="img2" type="img" @attachment='imgadd2'></attachment-img>
<div class="fon_12 color_9 mar_l20">
建议尺寸500px*520px位置显示在登录页面左侧
</div>
</div>
</div>
</div>
</div>
</div>
<!-- <div class="ba_f bor_rad5 mar_t20">-->
<!-- <div class="main-tab ba_f bor_rad5 mar_l20">-->
<!-- <div class="main-search-tit t_l fon_16 wei pad_20">业务站点设置</div>-->
<!-- </div>-->
<!-- <div class="main_con pad_b_30 mar_l50">-->
<!-- <div class="flex-bet wid pad_tb_20">-->
<!-- <div class="flex-grow-0 t_r pad_r_25 right-left"><span class="color_rb">*</span>业务后台标题(title)-->
<!-- </div>-->
<!-- <div class="flex-grow-1 t_l right-width">-->
<!-- <div class="flex-grow-1 t_l right-width">-->
<!-- <el-input v-model="formInline.bgtitle" placeholder="请输入业务后台标题"-->
<!-- class="elinput"></el-input>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="flex-bet wid pad_tb_20">-->
<!-- <div class="flex-grow-0 t_r pad_r_25 right-left">业务后台关键字(keywords)</div>-->
<!-- <div class="flex-grow-1 t_l right-width">-->
<!-- <el-input v-model="formInline.ywkeywords" placeholder="请输入业务后台关键字"-->
<!-- class="elinput"></el-input>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="flex-bet wid pad_tb_20">-->
<!-- <div class="flex-grow-0 t_r pad_r_25 right-left">业务后台描述(description)</div>-->
<!-- <div class="flex-grow-1 t_l right-width flex-y-bottom">-->
<!-- <el-input v-model="formInline.ywdescription" type="textarea"-->
<!-- :autosize="{ minRows: 4, maxRows: 6}" placeholder="请输入业业务后台描述 "-->
<!-- class="eltextarea"></el-input>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="flex-bet wid pad_tb_20">-->
<!-- <div class="flex-grow-0 t_r pad_r_25 right-left">业务后台登录页背景图</div>-->
<!-- <div class="flex-grow-1 t_l right-width flex-y-bottom">-->
<!-- <div class="imgbox bor_rad5 ba_f5 "></div>-->
<!-- <div class="fon_12 color_9 mar_l20">-->
<!-- 建议尺寸1920px*1080px系统按比例裁切背景上展示内容内容尽量显示在图片中间确保能够正常显示效果自行调整-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div class="ba_f bor_rad5 mar_t20">
<div class="main-tab ba_f bor_rad5 mar_l20">
<div class="main-search-tit t_l fon_16 wei pad_20">版权设置(登录页显示)</div>
</div>
<div class="main_con pad_b_30 mar_l50">
<div class="flex-bet wid pad_tb_20">
<div class="flex-grow-0 t_r pad_r_25 right-left">第一行底部版权信息</div>
<div class="flex-grow-1 t_l right-width flex-y-bottom">
<el-input v-model="formInline.copyright" type="textarea"
:autosize="{ minRows: 4, maxRows: 6}" placeholder="请输入第一行底部版权信息 "
class="eltextarea"></el-input>
</div>
</div>
<div class="flex-bet wid pad_tb_20">
<div class="flex-grow-0 t_r pad_r_25 right-left">第二行底部版权信息</div>
<div class="flex-grow-1 t_l right-width flex-y-bottom">
<el-input v-model="formInline.copyright_str" type="textarea"
:autosize="{ minRows: 4, maxRows: 6}" placeholder="请输入第二行底部版权信息 "
class="eltextarea"></el-input>
</div>
</div>
<div class="flex-bet wid pad_tb_20">
<div class="flex-grow-0 t_r pad_r_25 right-left">备案号</div>
<div class="flex-grow-1 t_l right-width">
<div class="flex-grow-1 t_l right-width">
<el-input v-model="formInline.record_number" placeholder="请输入备案号"
class="elinput"></el-input>
</div>
</div>
</div>
</div>
</div>
<div class="ba_f mar_t20 pad_30 main-button">
<el-button type="primary" class="tijiao" @click="onSubmit">保存</el-button>
</div>
</div>
</el-main>
</el-container>
</el-container>
</div>
</div>
<script>
$(document).ready(function () {
$(".slimScrollDiv ul .main-nav-li a").eq(10).addClass("menu_active");
$(".main-nav .main-nav-li .submenu").eq(4).addClass("block");
$(".main-nav .main-nav-li .submenu").children().children().eq(15).addClass("menu_active2")
});
</script>
<script>
new Vue({
el: '#platformList',
created() {
this.init();
},
data: function () {
return {
cardLoading: true,
activeName: 'msg',
formInline: {
status: '1',
site_title: '',
site_keyword: '',
site_description: '',
site_image: '',
site_backgroundpicture: '',
copyright: '',
copyright_str: '',
record_number: '',
site_name: '',
},
imageUrl: '',
upload_url: "",
imageUrl2: '',
imageUrl3: '',
upload_url2: "",
img:'',
}
},
methods: {
enter(i=0){
this.$refs['imgicon' + i].style.display = 'none'
},
leave(i=0){
this.$refs['imgicon' + i].style.display = 'inline-block'
},
test(i = 0) {
// console.log(this.$refs, i)
this.$refs['img' + i].dialogVisible = true
},
imgadd1(url) {
this.imageUrl = url.str
},
imgadd2(url) {
this.imageUrl2 = url.str
},
imgadd3(url) {
this.imageUrl3 = url.str
},
deleteMultiImage(item, index, type) {
//typem没传是单图multigraph多图index上传图片组件排序
Array.prototype.remove = function (val) {
var index = this.indexOf(val);
if (index > -1) {
this.splice(index, 1);
}
};
if (type == 'multigraph') {
} else {
switch (index) {
case 1:
this.imageUrl = '';
break
case 2:
this.imageUrl2 = '';
break
case 3:
this.imageUrl3 = '';
break
}
}
},
async init() {
res = await utils.requestGet({data: '', url: "admin/site/getsite"},this)
if (res.code == 1) {
this.cardLoading= false
// console.log(res.data)
// this.formInline = res.data
this.formInline.status = res.data.status?res.data.status:'1'
this.formInline.site_title = res.data.site_title?res.data.site_title:''
this.formInline.site_keyword = res.data.site_keyword?res.data.site_keyword:''
this.formInline.site_description = res.data.site_description?res.data.site_description:''
this.formInline.site_image = res.data.site_image?res.data.site_image:''
this.formInline.site_backgroundpicture = res.data.site_backgroundpicture?res.data.site_backgroundpicture:''
this.formInline.copyright = res.data.copyright?res.data.copyright:''
this.formInline.copyright_str = res.data.copyright_str?res.data.copyright_str:''
this.formInline.record_number = res.data.record_number?res.data.record_number:''
this.formInline.site_name = res.data.site_name?res.data.site_name:''
this.imageUrl = res.data.site_image?"<?=Yii::$app->request->baseUrl?>"+res.data.site_image:''
this.imageUrl2 = res.data.site_backgroundpicture?"<?=Yii::$app->request->baseUrl?>"+res.data.site_backgroundpicture:''
this.imageUrl3 = res.data.site_logo?"<?=Yii::$app->request->baseUrl?>"+res.data.site_logo:''
}
},
handleClick(tab, event) {
if (tab.name == 'msg') {
location.href = "<?= Yii::$app->urlManager->createUrl('admin/apply/platform_add');?>";
}
if (tab.name == 'user') {
location.href = "<?= Yii::$app->urlManager->createUrl('admin/apply/platform_userm');?>";
}
if (tab.name == 'enclosure') {
location.href = "<?= Yii::$app->urlManager->createUrl('admin/apply/platform_enclosure');?>";
}
},
//提交数据
async onSubmit() {
console.log('formInline', this.formInline)
// return
// const formdata = new FormData()
// formdata.append('status', this.formInline.status)
// formdata.append('site_title', this.formInline.site_title)
// formdata.append('site_keyword', this.formInline.site_keyword)
// formdata.append('site_description', this.formInline.site_description)
// formdata.append('site_image',this.imageUrl)
// formdata.append('site_backgroundpicture', this.imageUrl2)
// formdata.append('site_logo',this.imageUrl3)
// formdata.append('copyright',this.formInline.copyright)
// formdata.append('copyright_str',this.formInline.copyright_str)
// formdata.append('record_number',this.formInline.record_number)
this.formInline.site_image = this.imageUrl
this.formInline.site_backgroundpicture = this.imageUrl2
this.formInline.site_logo = this.imageUrl3
if(this.formInline.site_title==''){
this.$message.error('请输入网址标题')
return
}
res = await utils.requestPost({
data: this.formInline,
url: "admin/site/sitesave"
},this)
if (res.code == 1) {
this.$message({
type: 'success',
message: '操作成功!',
duration: 1000,
onClose: () => {
location.href ="<?= Yii::$app->urlManager->createUrl('admin/site/site_setting');?>";
},
});
}
},
// handleAvatarSuccess(res, file) {
// this.imageUrl = URL.createObjectURL(file.raw);
// this.formInline.site_image = file.raw
// },
// handleAvatarSuccess2(res, file) {
// this.imageUrl2 = URL.createObjectURL(file.raw);
// this.formInline.site_backgroundpicture = file.raw
// },
// beforeAvatarUpload(file) {
// const isJPG = file.type ===
// file.type === 'image/jpg' ||
// file.type === 'image/jpeg' ||
// file.type === 'image/png' ||
// file.type === 'image/gif'
// const isLt2M = file.size / 1024 / 1024 < 2;
// if (!isJPG) {
// this.$message.error('请上传图片文件!');
// }
// if (!isLt2M) {
// this.$message.error('上传头像图片大小不能超过 2MB!');
// }
// return isJPG && isLt2M;
// }
}
})
</script>
</body>
</html>