|
@@ -1,11 +1,7 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <div class="leader-h1" v-if="show">
|
|
|
- <h1 class="h1">领导信箱</h1>
|
|
|
- <!-- 点击返回上一页 -->
|
|
|
- <div class="leader-h1-img" @click="back">
|
|
|
- <img src="@/views/XiXianZhongXin/assets/返回.png" alt="" />
|
|
|
- </div>
|
|
|
+ <div id="app">
|
|
|
+ <div v-if="show">
|
|
|
+ <van-nav-bar title="领导信箱" left-arrow @click-left="onClickLeft" />
|
|
|
</div>
|
|
|
<!-- 输入姓名,留言点击上传数据库 -->
|
|
|
<div class="inputAll">
|
|
@@ -20,11 +16,16 @@
|
|
|
placeholder="请输入姓名"
|
|
|
class="input-border"
|
|
|
v-model="username"
|
|
|
- @input="userNameChange"
|
|
|
+ readonly
|
|
|
/>
|
|
|
<!-- 这里的v-model用来控制是匿名还是非匿名 -->
|
|
|
<div>
|
|
|
- <van-checkbox v-model="checked" shape="square">匿名</van-checkbox>
|
|
|
+ <van-checkbox
|
|
|
+ v-model="checked"
|
|
|
+ shape="square"
|
|
|
+ @click="userNameChange"
|
|
|
+ >匿名</van-checkbox
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="input-message">
|
|
@@ -47,18 +48,21 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { getAllUrlParams } from "../plugins/admin/url-encapsulation.js";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- checked: 1,
|
|
|
- content: "",
|
|
|
- username: "",
|
|
|
- staff_num: "",
|
|
|
+ checked: 0, //当前复选框不为选中状态
|
|
|
+ content: "", //留言内容
|
|
|
+ username: "", //员工姓名
|
|
|
+ staff_num: "", //员工编号
|
|
|
token: sessionStorage.getItem("mytoken")
|
|
|
? sessionStorage.getItem("mytoken")
|
|
|
- : "",
|
|
|
- show: true,
|
|
|
- gettoken:""
|
|
|
+ : "", //token值保存在本地,有的话取值,没有为空
|
|
|
+ show: true, //tabber是否显示
|
|
|
+ gettoken: "", //从url获取到token值
|
|
|
+ name: "", //员工姓名赋值
|
|
|
+ leader: true, //是否为领导
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -80,9 +84,9 @@ export default {
|
|
|
});
|
|
|
//获得提示表明已提交意见
|
|
|
this.$toast("建议已提交");
|
|
|
- this.$router.push(`/leader-mailbox-list?token=${this.token}`);
|
|
|
}
|
|
|
},
|
|
|
+ //获取checked的属性值
|
|
|
userNameChange() {
|
|
|
//当checked等于true的时候表单内容被*号覆盖
|
|
|
if (this.checked == true) {
|
|
@@ -90,47 +94,73 @@ export default {
|
|
|
inputUserName = inputUserName.replace(/./g, "*");
|
|
|
this.username = inputUserName;
|
|
|
} else {
|
|
|
- //反之显示原本的内容
|
|
|
- this.username;
|
|
|
+ this.username = this.name;
|
|
|
}
|
|
|
},
|
|
|
//返回上一页面
|
|
|
- back() {
|
|
|
+ onClickLeft() {
|
|
|
window.history.back();
|
|
|
},
|
|
|
- getxinxi(){
|
|
|
- this.$http.post('http://xixuan.nxjiewei.com:8011/api/user/info').then(res=>{
|
|
|
- // console.log(res.data.data.staff_num);
|
|
|
- this.staff_num=res.data.data.staff_num
|
|
|
- })
|
|
|
- }
|
|
|
+ //获取个人信息
|
|
|
+ getxinxi() {
|
|
|
+ this.$http
|
|
|
+ .post("http://xixuan.nxjiewei.com:8011/api/user/info")
|
|
|
+ .then((res) => {
|
|
|
+ this.staff_num = res.data.data.staff_num;
|
|
|
+ this.username = res.data.data.name;
|
|
|
+ this.name = res.data.data.name;
|
|
|
+ if (this.checked == true) {
|
|
|
+ let inputUserName = this.username;
|
|
|
+ inputUserName = inputUserName.replace(/./g, "*");
|
|
|
+ this.username = inputUserName;
|
|
|
+ if (this.checked == false) {
|
|
|
+ this.username = this.name;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //页面进入是判断是否为领导,是领导跳转至领导信箱列表页
|
|
|
+ Jumpleader() {
|
|
|
+ this.$http
|
|
|
+ .post(
|
|
|
+ "http://xixuan.nxjiewei.com:8011/api/workbench/leader_mailbox/check"
|
|
|
+ )
|
|
|
+ .then((res) => {
|
|
|
+ //获取是否为领导
|
|
|
+ this.leader=res.data.data
|
|
|
+ if (this.leader == true) {
|
|
|
+ window.location.href="#/xixuanzhongxin/leader-mailbox/leader-mailbox-list"
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
//这里挂载的是获取token
|
|
|
mounted() {
|
|
|
- this.gettoken=this.$route.query.token
|
|
|
- this.token=`Bearer ${this.gettoken}`
|
|
|
+ document.body.style.backgroundColor="#3399ff";
|
|
|
+ this.gettoken =getAllUrlParams(window.location.href).token;
|
|
|
+ this.token = `Bearer ${this.gettoken}`;
|
|
|
sessionStorage.setItem("mytoken", this.token);
|
|
|
- this.show = this.$route.query.tabbar ? this.$route.query.tabbar : true;
|
|
|
- this.getxinxi()
|
|
|
+ this.show = Boolean(getAllUrlParams(window.location.href).tabber);
|
|
|
+ this.getxinxi();
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.Jumpleader();
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style>
|
|
|
-body {
|
|
|
- background: #3399ff;
|
|
|
-}
|
|
|
+<style scoped>
|
|
|
.h1 {
|
|
|
text-align: center;
|
|
|
color: #fff;
|
|
|
font-weight: 500;
|
|
|
font-size: 20px;
|
|
|
}
|
|
|
-.van-cell {
|
|
|
+>>>.van-cell {
|
|
|
margin-bottom: 3%;
|
|
|
border-radius: 10px;
|
|
|
}
|
|
|
-.van-button--info {
|
|
|
+>>>.van-button--info {
|
|
|
color: #39f;
|
|
|
background-color: #fff;
|
|
|
}
|
|
@@ -155,7 +185,7 @@ body {
|
|
|
border: none;
|
|
|
}
|
|
|
.input-border::-webkit-input-placeholder {
|
|
|
- color: #97a3b4;
|
|
|
+ color: #cccdcf;
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
.input-button {
|
|
@@ -180,24 +210,24 @@ body {
|
|
|
width: 90%;
|
|
|
margin: 0 auto;
|
|
|
}
|
|
|
-.van-checkbox {
|
|
|
+>>>.van-checkbox {
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
-.van-checkbox__icon .van-icon {
|
|
|
+>>>.van-checkbox__icon .van-icon {
|
|
|
width: 20px;
|
|
|
height: 20px;
|
|
|
}
|
|
|
-.van-checkbox__label {
|
|
|
+>>>.van-checkbox__label {
|
|
|
margin-left: 3px;
|
|
|
margin-top: 10%;
|
|
|
color: #97a3b4;
|
|
|
line-height: 10px;
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
-.van-checkbox__icon {
|
|
|
+>>>.van-checkbox__icon {
|
|
|
margin-top: 5px;
|
|
|
}
|
|
|
-.input-message span {
|
|
|
+>>>.input-message span {
|
|
|
color: #97a3b4;
|
|
|
}
|
|
|
.leader-h1 {
|
|
@@ -212,4 +242,21 @@ body {
|
|
|
width: 15px;
|
|
|
height: 18px;
|
|
|
}
|
|
|
+>>>.van-nav-bar {
|
|
|
+ background: #39f;
|
|
|
+}
|
|
|
+>>>.van-field__label{
|
|
|
+ margin-right: 5px;
|
|
|
+}
|
|
|
+>>>.van-nav-bar__title,
|
|
|
+.van-nav-bar .van-icon,
|
|
|
+.van-nav-bar__text {
|
|
|
+ color: #fff;
|
|
|
+}
|
|
|
+>>>[class*="van-hairline"]:after {
|
|
|
+ border: none;
|
|
|
+}
|
|
|
+>>>.van-field__label {
|
|
|
+ width: 3.2em;
|
|
|
+}
|
|
|
</style>
|