392 lines
16 KiB
PHP
392 lines
16 KiB
PHP
<!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>
|
||
|
||
.imgbox {
|
||
width: 100px;
|
||
height: 100px;
|
||
}
|
||
|
||
.channel-icon img {
|
||
width: 32px;
|
||
height: 32px;
|
||
}
|
||
|
||
.namelogo {
|
||
width: 54px;
|
||
height: 54px;
|
||
border-radius: 50%;
|
||
}
|
||
|
||
.hed-right .el-button {
|
||
height: 38px;
|
||
}
|
||
|
||
.hed-right .btn-jrpt {
|
||
width: 130px;
|
||
}
|
||
|
||
.hed-right .btn-ty {
|
||
width: 104px;
|
||
}
|
||
|
||
.lsb {
|
||
color: #FD5500;
|
||
background: #FFF6F2;
|
||
border-color: #FFF6F2
|
||
}
|
||
|
||
.ptb {
|
||
color: #3F83E8;
|
||
background: #F5F9FE;
|
||
border-color: #F5F9FE
|
||
}
|
||
|
||
.ddb {
|
||
color: #606273;
|
||
background: #F7F7F8;
|
||
border-color: #F7F7F8
|
||
}
|
||
|
||
.sjsjd {
|
||
color: #1F8C0D;
|
||
background: #F4F9F3;
|
||
border-color: #F4F9F3
|
||
}
|
||
|
||
</style>
|
||
<body>
|
||
<div class="head">
|
||
<div class="publicHeader"><?php echo $this->render('@app/views/admin/public/publicHeader.html');?></div>
|
||
</div>
|
||
<div class="left">
|
||
<div class="publicAside"><?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="attachmentImg">-->
|
||
<!--<attachment-img type="img" @attachment='attachment'></attachment-img>-->
|
||
<!--</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 bor_rad5 pad_20 mar_b30">
|
||
<div class="flex-bet">
|
||
<div class="flex pad_tb_10 mar_l20">
|
||
<div class=""><img class="namelogo" :src="apply_image"/></div>
|
||
<div class="flex-col mar_l20 t_l">
|
||
<div class="overflowlnr">{{apply_name}}</div>
|
||
<div class="color_9 fon_12 mar_t10">
|
||
<el-tag type="repair" class="lsb">{{app_name}}</el-tag>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="mar_r20 hed-right">
|
||
<el-button class="btn-ty" @click="deactivation()">删除</el-button>
|
||
</div>
|
||
</div>
|
||
</div> -->
|
||
<div class="ba_f">
|
||
<div class="main_search pad_30 mar_t30 ba_f bor_rad5">
|
||
<div class="main_search_tit t_l fon_16 wei">用户编辑</div>
|
||
</div>
|
||
<div class="main-con pad_tb_30">
|
||
<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-input v-model="formInline.user_phone" 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">账号头像</div>
|
||
<div class="flex-grow-1 t_l right-width">
|
||
<div class="imgbox bor_rad5 ba_f5">
|
||
<!--<attachment-img ref="img0" type="img" @attachment='imgadd'></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="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>
|
||
</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">
|
||
<el-input v-model="formInline.user_name" 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">登录密码</div>
|
||
<div class="flex-grow-1 t_l right-width">
|
||
<el-input v-model="formInline.password" type="password" 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">确认登录密码</div>
|
||
<div class="flex-grow-1 t_l right-width">
|
||
<el-input v-model="formInline.chekcpassword" type="password"
|
||
placeholder="请再次输入登录密码"
|
||
class="elinput"></el-input>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="ba_f mar_t20 pad_30 main-button">
|
||
<el-button type="primary" class="tijiao" @click="submit()">保存</el-button>
|
||
</div>
|
||
</div>
|
||
</el-main>
|
||
</el-container>
|
||
</el-container>
|
||
</div>
|
||
</div>
|
||
<script>
|
||
console.time()
|
||
$(document).ready(function () {
|
||
$(".slimScrollDiv ul .main-nav-li a").eq(7).addClass("menu_active");
|
||
$(".main-nav .main-nav-li .submenu").eq(3).addClass("block");
|
||
$(".main-nav .main-nav-li .submenu").children().children().eq(8).addClass("menu_active2")
|
||
});
|
||
</script>
|
||
<script>
|
||
new Vue({
|
||
el: '#platformList',
|
||
created() {
|
||
const id = utils.GetQueryString("id")
|
||
if (id) {
|
||
console.log(id)
|
||
this.formInline.id = id
|
||
this.getbyid(id)
|
||
}
|
||
},
|
||
data: function () {
|
||
return {
|
||
cardLoading: true,
|
||
show: true,
|
||
activeName: 'base',
|
||
formInline: {
|
||
id: '',
|
||
user_phone: '',
|
||
user_name: '',
|
||
password: '',
|
||
chekcpassword: '',
|
||
headimgurl:'',
|
||
},
|
||
imageUrl: '',
|
||
upload_url: "",
|
||
apply_name: '',
|
||
app_name: '',
|
||
apply_image:'',
|
||
fileList: [],//文件列表
|
||
upload_url: "",
|
||
uploadData:{
|
||
key: "",
|
||
token: ""
|
||
},
|
||
}
|
||
},
|
||
methods: {
|
||
// 编辑显示数据
|
||
async getbyid(id) {
|
||
let params = {
|
||
id: id
|
||
}
|
||
res = await utils.requestPost({
|
||
data: params,
|
||
url: "admin/applyuser/getuserbyid"
|
||
}, this)
|
||
if (res.code == 1) {
|
||
this.cardLoading= false
|
||
this.formInline = res.data
|
||
this.user_phone= res.data.user_phone
|
||
this.imageUrl = res.data.headimgurl
|
||
// this.formInline.chekcpassword = res.data.password
|
||
this.apply_name = res.data.apply_name
|
||
this.app_name = res.data.app_name
|
||
this.apply_image = res.data.apply_image
|
||
}
|
||
},
|
||
async deactivation() {
|
||
await utils.showConfirm({content: '此操作将删除该项目, 是否继续?'}, this)
|
||
var requstData = {
|
||
id: this.id,
|
||
status: 3,
|
||
}
|
||
res = await utils.requestPost({
|
||
data: requstData,
|
||
url: "admin/apply/delapply"
|
||
},this)
|
||
if (res.code == 1) {
|
||
this.$message({
|
||
type: 'success',
|
||
message: '操作成功!',
|
||
duration: 1000,
|
||
onClose: () => {
|
||
location.href = "<?= Yii::$app->urlManager->createUrl('admin/applyuser/administration_user');?>";
|
||
},
|
||
});
|
||
}
|
||
},
|
||
handleClick(tab, event) {
|
||
if (tab.name == 'base') {
|
||
location.href ="<?= Yii::$app->urlManager->createUrl('admin/applyuser/administration_set');?>";
|
||
}
|
||
if (tab.name == 'upgrade') {
|
||
location.href ="<?= Yii::$app->urlManager->createUrl('admin/applyuser/administration_upgrade');?>";
|
||
}
|
||
},
|
||
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
|
||
},
|
||
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
|
||
}
|
||
}
|
||
},
|
||
// handleAvatarSuccess(res, file) {
|
||
// this.imageUrl = URL.createObjectURL(file.raw);
|
||
// this.formInline.headimgurl = 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;
|
||
// },
|
||
async submit() {
|
||
const formdata = new FormData()
|
||
formdata.append('headimgurl', this.imageUrl)
|
||
formdata.append('id', this.formInline.id)
|
||
formdata.append('user_phone', this.formInline.user_phone)
|
||
formdata.append('user_name', this.formInline.user_name)
|
||
formdata.append('password', this.formInline.password)
|
||
res = await utils.requestPost({
|
||
data: formdata,
|
||
url: "admin/applyuser/usersave"
|
||
}, this)
|
||
if (res.code == 1) {
|
||
this.$message({
|
||
type: 'success',
|
||
message: '操作成功!',
|
||
duration: 1000,
|
||
//onClose: () => {
|
||
// location.href ="<?//= Yii::$app->urlManager->createUrl('admin/applyuser/administration_user');?>//";
|
||
//},
|
||
});
|
||
}
|
||
},
|
||
|
||
//上传前判断
|
||
beforeUpload: function (file) {
|
||
var date = new Date();
|
||
const isIMG =
|
||
file.type === 'image/jpg' ||
|
||
file.type === 'image/jpeg' ||
|
||
file.type === 'image/png' ||
|
||
file.type === 'image/gif'
|
||
const isLt = file.size / 1024 / 1024 < 50
|
||
if (!isIMG) {
|
||
this.$message.error("上传图片只支持jpg、jpeg、png格式!");
|
||
return false;
|
||
}
|
||
if (!isLt) {
|
||
this.$message.error("文件大小不能超过 50MB!");
|
||
return false;
|
||
}
|
||
},
|
||
handleError: function (res) {
|
||
this.$message({
|
||
message: "上传失败",
|
||
duration: 2000,
|
||
type: "warning"
|
||
});
|
||
},
|
||
handleSuccess: function (res, file,fileList) {
|
||
this.file = file
|
||
const formData = new FormData();
|
||
formData.append("file", this.file.raw);
|
||
console.log('formData',formData,this.file.raw)
|
||
},
|
||
}
|
||
})
|
||
|
||
</script>
|
||
</body>
|
||
</html>
|