Commit 0cff4816 by LJM

css

parent eaf42f75
......@@ -59,4 +59,19 @@
}
}
.role-auth {
background: #FFFFFF;
margin-bottom: 10px;
ul {
li {
padding: 0 10px;
border-right: 1px dashed #DCDFE6;
margin-bottom: 10px;
&:last-child {
border-right: none;
}
}
}
}
}
\ No newline at end of file
......@@ -50,4 +50,16 @@
border-radius: 50px;
margin-bottom: 16px;
}
.messagexk .role-auth {
background: #FFFFFF;
margin-bottom: 10px;
}
.messagexk .role-auth ul li {
padding: 0 10px;
border-right: 1px dashed #DCDFE6;
margin-bottom: 10px;
}
.messagexk .role-auth ul li:last-child {
border-right: none;
}
/*# sourceMappingURL=message.min.css.map */
\ No newline at end of file
{"version":3,"sources":["message.less"],"names":[],"mappings":"AAAA,UAEE;EACE,gBAAA;EACA,aAAA;EACA,QAAQ,mBAAR;;AALJ,UAEE,aAKE;EACE,eAAA;EACA,WAAA;EACA,iBAAA;EACA,kBAAA;;AAEA,UAXJ,aAKE,IAMG;EACC,SAAS,EAAT;EACA,UAAA;EACA,YAAA;EACA,mBAAA;EACA,kBAAA;EACA,WAAA;EACA,MAAA;;AApBR,UAEE,aAuBE;EACE,kBAAA;;AA1BN,UAEE,aAuBE,QAGE;EACE,WAAA;EACA,YAAA;EACA,kBAAA;EACA,yBAAA;EACA,gBAAA;EACA,iBAAA;EACA,eAAA;EACA,cAAA;;AApCR,UAEE,aAuBE,QAGE,iBAUE;EACE,eAAA;EACA,kBAAA;EACA,SAAA;EACA,iBAAA;;AAGF,UA3CN,aAuBE,QAGE,iBAiBG;AA7CT,UAEE,aAuBE,QAGE,iBAiBW,yBAAwB;AA7CzC,UAEE,aAuBE,QAGE,iBAiB2C,WAAU;EACjD,cAAA;EACA,qBAAA;;AA/CV,UAEE,aAuBE,QA0BE;EACE,YAAA;EACA,aAAA;EACA,iBAAA;EACA,mBAAA;EACA,mBAAA","file":"message.min.css"}
\ No newline at end of file
{"version":3,"sources":["message.less"],"names":[],"mappings":"AAAA,UAEI;EACI,gBAAA;EACA,aAAA;EACA,QAAQ,mBAAR;;AALR,UAEI,aAKI;EACI,eAAA;EACA,WAAA;EACA,iBAAA;EACA,kBAAA;;AAEA,UAXR,aAKI,IAMK;EACG,SAAS,EAAT;EACA,UAAA;EACA,YAAA;EACA,mBAAA;EACA,kBAAA;EACA,WAAA;EACA,MAAA;;AApBhB,UAEI,aAuBI;EACI,kBAAA;;AA1BZ,UAEI,aAuBI,QAGI;EACI,WAAA;EACA,YAAA;EACA,kBAAA;EACA,yBAAA;EACA,gBAAA;EACA,iBAAA;EACA,eAAA;EACA,cAAA;;AApChB,UAEI,aAuBI,QAGI,iBAUI;EACI,eAAA;EACA,kBAAA;EACA,SAAA;EACA,iBAAA;;AAGJ,UA3CZ,aAuBI,QAGI,iBAiBK;AA7CjB,UAEI,aAuBI,QAGI,iBAiBa,yBAAwB;AA7CjD,UAEI,aAuBI,QAGI,iBAiB6C,WAAU;EAC/C,cAAA;EACA,qBAAA;;AA/CpB,UAEI,aAuBI,QA0BI;EACI,YAAA;EACA,aAAA;EACA,iBAAA;EACA,mBAAA;EACA,mBAAA;;AAxDhB,UA6DI;EACI,mBAAA;EACA,mBAAA;;AA/DR,UA6DI,WAGI,GACI;EACI,eAAA;EACA,gCAAA;EACA,mBAAA;;AAEA,UATZ,WAGI,GACI,GAKK;EACG,kBAAA","file":"message.min.css"}
\ No newline at end of file
......@@ -363,9 +363,9 @@ export default {
if (res.code === 0) {
const overviewItem = res.data.data.find(item => item.name === "概况");
const menuData = res.data.data.filter(item => item.name !== "概况");
this.index_home = overviewItem;
this.menuData = menuData;
} else {
this.$message({
message: res.msg,
......
......@@ -4,7 +4,7 @@
<div class="tip">基本信息</div>
<div class="row verCenter">
<div class="up-box">
<img :src="userinfo.avatar" class="imspre"/>
<img :src="userinfo.avatar || 'https://www.ichunt.com/v3/dist/res/home/images/headimg/boy1.png'" class="imspre"/>
<el-upload class="avatar-uploader" :data="fileData" :action="upUrl" :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
<span class="icon iconfont fl"></span>
<div class="fl">更换头像</div>
......@@ -28,34 +28,43 @@
<div class="tip" style="margin-top: 20px">猎芯联系渠道</div>
<el-form :inline="true" :model="userinfo" label-width="124px">
<el-form-item label="猎芯专属采购经理">
<el-input v-model="userinfo.sku_user_info.name" placeholder="" :readonly="true"></el-input>
<el-input v-model="userinfo.sku_user_info.name" placeholder="" :readonly="true" disabled v-if="userinfo.sku_user_info"></el-input>
</el-form-item>
<el-form-item label="联系电话">
<el-input v-model="userinfo.sku_user_info.mobile" :readonly="true"></el-input>
<el-input v-model="userinfo.sku_user_info.mobile" :readonly="true" disabled v-if="userinfo.sku_user_info"></el-input>
</el-form-item>
<el-form-item label="邮箱">
<el-input v-model="userinfo.sku_user_info.email" :readonly="true"></el-input>
<el-input v-model="userinfo.sku_user_info.email" :readonly="true" disabled v-if="userinfo.sku_user_info"></el-input>
</el-form-item>
<br>
<el-form-item label="猎芯渠道经理">
<el-input v-model="userinfo.channel_user_info.name" :readonly="true"></el-input>
<el-input v-model="userinfo.channel_user_info.name" :readonly="true" disabled v-if="userinfo.sku_user_info"></el-input>
</el-form-item>
<el-form-item label="联系电话">
<el-input v-model="userinfo.channel_user_info.mobile" :readonly="true"></el-input>
<el-input v-model="userinfo.channel_user_info.mobile" :readonly="true" disabled v-if="userinfo.sku_user_info"></el-input>
</el-form-item>
<el-form-item label="邮箱">
<el-input v-model="userinfo.channel_user_info.email" :readonly="true"></el-input>
<el-input v-model="userinfo.channel_user_info.email" :readonly="true" disabled v-if="userinfo.sku_user_info"></el-input>
</el-form-item>
</el-form>
<div class="tip" style="margin-top: 20px">意见反馈渠道</div>
<div class="tip">意见反馈渠道</div>
<el-form :inline="true" :model="userinfo" label-width="124px">
<el-form-item label="运营总监">
<el-input value="Sophie(符静女士)" placeholder=""></el-input>
<el-input value="Sophie(符静女士)" placeholder="" disabled></el-input>
</el-form-item>
<el-form-item label="邮箱">
<el-input value="sophie@ichunt.com"></el-input>
<el-input value="sophie@ichunt.com" disabled></el-input>
</el-form-item>
</el-form>
<div class="tip">消息推送配置</div>
<!--子账号消息推送配置-->
<section class="role-auth">
<ul class="row">
<li v-for="(item,index) in messageMenu" :key="item.id">
<el-tree :data="item" show-checkbox :props="defaultProps" :default-checked-keys="filteredMessageIds" default-expand-all node-key="id" @check-change="handleCheckMsgChange"></el-tree>
</li>
</ul>
</section>
<el-row>
<el-button type="primary" @click="submituser">编辑</el-button>
</el-row>
......@@ -68,48 +77,97 @@ import Vue from 'vue';
import Menu from "@/components/menu.vue";
import {NODE_ENVS} from "../../ajax";
import Tool from '../../tool'
import {Form, FormItem, Input, Message, Row, Upload} from 'element-ui'
import {Form, FormItem, Input, Message, Row, Tree, Upload} from 'element-ui'
Vue.prototype.$message = Message;
Vue.use(Form).use(FormItem).use(Input).use(Upload).use(Row);
Vue.use(Form).use(FormItem).use(Input).use(Upload).use(Row).use(Tree);
export default {
name: "message",
data() {
return {
defaultProps: {
children: 'children',
label: 'name'
},
filteredMessageIds: [],
upUrl: NODE_ENVS + '/api/user/setavatar',
fileData: {token: Tool.getCookie('token')},
userinfo: {
company_name: '',
contacts_name: '',
mobile: '',
email: '',
avatar: 'https://www.ichunt.com/v3/dist/res/home/images/headimg/boy1.png'
}
messageMenu: [],//消息权限菜单
user_message_rule: [],
userinfo: {}
};
},
created() {
this.getUseInfo()
this.getUseInfo();
this.getMessageMenu();
},
computed: {},
methods: {
getUseInfo() {
if (window.userInfo) {
this.userinfo = window.userInfo;
/**
* 获取当前用户的消息权限菜单
*/
getMessageMenu() {
this.$http('GET', "/api/subAccount/getMessageMenu", {}).then(res => {
if (res.code === 0) {
let newMenuData = res.data.data.map(item => [item]);
this.messageMenu = newMenuData;
const filteredIds = [];
res.data.data.forEach(item => {
if (item.children) {
const childrenWithChecked = item.children.filter(child => child.checked);
const ids = childrenWithChecked.map(child => child.id);
filteredIds.push(...ids);
} else {
this.$http('get', "/api/user/getuserinfo").then(res => {
this.userinfo = res.data;
window.userInfo = res.data
if (item.checked) {
filteredIds.push(item.id);
}
}
});
this.filteredMessageIds = filteredIds;
//筛选出rule-message
const result = [];
for (let obj of res.data.data) {
if (obj.checked) {
result.push(obj.name);
}
if (obj.children) {
for (let child of obj.children) {
if (child.checked) {
result.push(child.name);
}
}
}
}
this.user_message_rule = result;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
getUseInfo() {
this.$http('GET', "/api/user/getuserinfo").then(res => {
if (res.code === 0) {
this.userinfo = res.data;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
submituser() {
this.$http('post', "/api/user/setuserinfo", {
email: this.userinfo.email,
contacts_name: this.userinfo.contacts_name
contacts_name: this.userinfo.contacts_name,
user_message_rule: JSON.stringify(this.user_message_rule)
}).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
message: '更新成功',
type: 'success'
});
sessionStorage.removeItem('userInfox')
......@@ -152,6 +210,28 @@ export default {
});
}
return isJPG && isLt2M;
},
/**
* 筛选子账号勾选的消息推送配置
* @param data
* @param checked
*/
handleCheckMsgChange(data, checked) {
if (checked) {
if (!this.user_message_rule.includes(data.name)) {
this.user_message_rule.push(data.name);
}
} else {
const index = this.user_message_rule.indexOf(data.name);
if (index !== -1) {
this.user_message_rule.splice(index, 1);
}
if (data.children) {
if (!this.user_message_rule.includes(data.name)) {
this.user_message_rule.push(data.name);
}
}
}
}
},
components: {
......
......@@ -72,11 +72,14 @@
<script>
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, MessageBox, Option, Pagination, Popover, Radio, RadioButton, RadioGroup, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui'
import {Alert, Autocomplete, Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, MessageBox, Option, Pagination, Popover, Radio, RadioButton, RadioGroup, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui'
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Autocomplete).use(Radio).use(RadioGroup).use(RadioButton);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover).use(Tag).use(Tooltip);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover).use(Tag).use(Tooltip).use(Alert);
export default {
name: "subAccount",
......@@ -128,14 +131,20 @@ export default {
})
},
/**
* 启用,禁用
* 1启用,2禁用
* @param row
*/
confirmEnable(row, type) {
this.$confirm(`确定要"${row.status == 1 ? '禁用' : '启用'}" 吗?`, '提示', {
if (type == 1) {
var html = `确定<span style="color: #00BFBF">启用</span>当前子账号吗?<p style="font-size: 13px;color: #999;">PS:启用后,该子账号可登录芯链系统,操作对应权限页面</p>`;
} else {
var html = `确定<span style="color: #E6A23C">禁用</span>当前子账号吗?<p style="font-size: 13px;color: #999;">PS:禁用后,该子账号无法再登录芯链系统</p>`;
}
this.$confirm(html, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
type: type,
dangerouslyUseHTMLString: true
}).then(() => {
this.$http('POST', "/api/subAccount/changeStatus", {sbat_id: row.sbat_id, status: type}).then(res => {
if (res.code === 0) {
......@@ -155,10 +164,12 @@ export default {
* 删除
*/
confirmDelete(row) {
this.$confirm(`确定要删除 "${row.name}" 吗?`, '提示', {
var html = `确定<span style="color: red;">删除</span>当前子账号吗?<p style="font-size: 13px;color: #999;">PS:删除后,该子账号从系统清除,无法再登录芯链系统!</p>`;
this.$confirm(html, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
this.$http('POST', "/api/subAccount/changeStatus", {sbat_id: row.sbat_id, status: 0}).then(res => {
if (res.code === 0) {
......
......@@ -26,7 +26,7 @@
<!--子账号权限配置-->
<section class="role-auth">
<ul class="row">
<li v-for="(item,index) in menuData" :key="index">
<li v-for="(item,index) in menuData" :key="item.id">
<el-tree :data="item" show-checkbox node-key="id" :props="defaultProps" default-expand-all @check-change="handleCheckChange"></el-tree>
</li>
</ul>
......@@ -35,7 +35,7 @@
<!--子账号消息推送配置-->
<section class="role-auth">
<ul class="row">
<li v-for="(item,index) in messageMenu" :key="index">
<li v-for="(item,index) in messageMenu" :key="item.id">
<el-tree :data="item" show-checkbox node-key="id" :props="defaultProps" default-expand-all @check-change="handleCheckMsgChange"></el-tree>
</li>
</ul>
......@@ -66,11 +66,10 @@ export default {
label: 'name'
},
rules: {
mobile: [{
required: true,
message: '请输入手机号',
trigger: 'blur'
}],
mobile: [
{required: true, message: '请输入手机号', trigger: 'blur'},
{pattern: /^1\d{10}$/, message: '请输入有效的手机号', trigger: 'blur'}
],
name: [{
required: true,
message: '请输入名称',
......@@ -81,16 +80,13 @@ export default {
message: '请输入密码',
trigger: 'blur'
}],
email: [{
required: true,
message: '请输入邮箱',
trigger: 'blur'
}],
email: [
{required: true, message: '请输入邮箱', trigger: 'blur'},
{type: 'email', message: '请输入有效的邮箱地址', trigger: ['blur', 'change']}
]
},
menuData: [],//权限菜单
messageMenu: [],//消息权限菜单
checkedNodes: [],//存储勾选的子账号权限配置
checkedMessageNodes: [],//存储勾选的消息菜单
formParam: {
mobile: '',
name: '',
......@@ -145,17 +141,17 @@ export default {
*/
handleCheckChange(data, checked) {
if (checked) {
if (!this.checkedNodes.includes(data.name)) {
this.checkedNodes.push(data.name);
if (!this.formParam.user_rule.includes(data.name)) {
this.formParam.user_rule.push(data.name);
}
} else {
const index = this.checkedNodes.indexOf(data.name);
const index = this.formParam.user_rule.indexOf(data.name);
if (index !== -1) {
this.checkedNodes.splice(index, 1);
this.formParam.user_rule.splice(index, 1);
}
if (data.children) {
if (!this.checkedNodes.includes(data.name)) {
this.checkedNodes.push(data.name);
if (!this.formParam.user_rule.includes(data.name)) {
this.formParam.user_rule.push(data.name);
}
}
}
......@@ -167,17 +163,17 @@ export default {
*/
handleCheckMsgChange(data, checked) {
if (checked) {
if (!this.checkedMessageNodes.includes(data.name)) {
this.checkedMessageNodes.push(data.name);
if (!this.formParam.user_message_rule.includes(data.name)) {
this.formParam.user_message_rule.push(data.name);
}
} else {
const index = this.checkedMessageNodes.indexOf(data.name);
const index = this.formParam.user_message_rule.indexOf(data.name);
if (index !== -1) {
this.checkedMessageNodes.splice(index, 1);
this.formParam.user_message_rule.splice(index, 1);
}
if (data.children) {
if (!this.checkedMessageNodes.includes(data.name)) {
this.checkedMessageNodes.push(data.name);
if (!this.formParam.user_message_rule.includes(data.name)) {
this.formParam.user_message_rule.push(data.name);
}
}
}
......@@ -189,8 +185,8 @@ export default {
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.formParam.user_message_rule = JSON.stringify(this.checkedMessageNodes);
this.formParam.user_rule = JSON.stringify(this.checkedNodes);
this.formParam.user_rule = JSON.stringify(this.formParam.user_rule);
this.formParam.user_message_rule = JSON.stringify(this.formParam.user_message_rule);
this.$http('POST', "/api/subAccount/create", this.formParam).then(res => {
if (res.code === 0) {
this.$message({
......
......@@ -8,10 +8,10 @@
<el-input v-model="formParam.mobile" placeholder="请输入手机号"></el-input>
</el-form-item>
<el-form-item label="密码" prop="password_raw">
<el-input v-model="formParam.password_raw" placeholder="请输入登录密码"></el-input>
<el-input placeholder="请输入登录密码" v-model="formParam.password_raw" show-password></el-input>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="formParam.name" placeholder="请输入名称"></el-input>
<el-input v-model="formParam.name" placeholder="请输入名称" maxlength="10"></el-input>
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="formParam.email" placeholder="请输入邮箱"></el-input>
......@@ -35,7 +35,7 @@
<!--子账号消息推送配置-->
<section class="role-auth">
<ul class="row">
<li v-for="(item,index) in messageMenu" :key="index">
<li v-for="(item,index) in messageMenu" :key="item.id">
<el-tree :data="item" show-checkbox :props="defaultProps" :default-checked-keys="filteredMessageIds" default-expand-all node-key="id" @check-change="handleCheckMsgChange"></el-tree>
</li>
</ul>
......@@ -66,11 +66,10 @@ export default {
label: 'name'
},
rules: {
mobile: [{
required: true,
message: '请输入手机号',
trigger: 'blur'
}],
mobile: [
{required: true, message: '请输入手机号', trigger: 'blur'},
{pattern: /^1\d{10}$/, message: '请输入有效的手机号', trigger: 'blur'}
],
name: [{
required: true,
message: '请输入名称',
......@@ -81,16 +80,13 @@ export default {
message: '请输入密码',
trigger: 'blur'
}],
email: [{
required: true,
message: '请输入邮箱',
trigger: 'blur'
}],
email: [
{required: true, message: '请输入邮箱', trigger: 'blur'},
{type: 'email', message: '请输入有效的邮箱地址', trigger: ['blur', 'change']}
]
},
menuData: [],//权限菜单
messageMenu: [],//消息权限菜单
checkedNodes: [],//存储勾选的子账号权限配置
checkedMessageNodes: [],//存储勾选的消息菜单
filteredRuleIds: [],
filteredMessageIds: [],
ynat_id: this.$route.query.ynat_id,
......@@ -142,9 +138,29 @@ export default {
const childrenWithChecked = item.children.filter(child => child.checked);
const ids = childrenWithChecked.map(child => child.id);
filteredIds.push(...ids);
} else {
if (item.checked) {
filteredIds.push(item.id);
}
}
});
this.filteredRuleIds = filteredIds;
//筛选出rule
const result = [];
for (let obj of res.data.data) {
if (obj.checked) {
result.push(obj.name);
}
if (obj.children) {
for (let child of obj.children) {
if (child.checked) {
result.push(child.name);
}
}
}
}
this.formParam.user_rule = result;
}
} else {
this.$message({
......@@ -169,9 +185,28 @@ export default {
const childrenWithChecked = item.children.filter(child => child.checked);
const ids = childrenWithChecked.map(child => child.id);
filteredIds.push(...ids);
} else {
if (item.checked) {
filteredIds.push(item.id);
}
}
});
this.filteredMessageIds = filteredIds;
//筛选出rule-message
const result = [];
for (let obj of res.data.data) {
if (obj.checked) {
result.push(obj.name);
}
if (obj.children) {
for (let child of obj.children) {
if (child.checked) {
result.push(child.name);
}
}
}
}
this.formParam.user_message_rule = result;
}
} else {
this.$message({
......@@ -188,17 +223,17 @@ export default {
*/
handleCheckChange(data, checked) {
if (checked) {
if (!this.checkedNodes.includes(data.name)) {
this.checkedNodes.push(data.name);
if (!this.formParam.user_rule.includes(data.name)) {
this.formParam.user_rule.push(data.name);
}
} else {
const index = this.checkedNodes.indexOf(data.name);
const index = this.formParam.user_rule.indexOf(data.name);
if (index !== -1) {
this.checkedNodes.splice(index, 1);
this.formParam.user_rule.splice(index, 1);
}
if (data.children) {
if (!this.checkedNodes.includes(data.name)) {
this.checkedNodes.push(data.name);
if (!this.formParam.user_rule.includes(data.name)) {
this.formParam.user_rule.push(data.name);
}
}
}
......@@ -210,17 +245,17 @@ export default {
*/
handleCheckMsgChange(data, checked) {
if (checked) {
if (!this.checkedMessageNodes.includes(data.name)) {
this.checkedMessageNodes.push(data.name);
if (!this.formParam.user_message_rule.includes(data.name)) {
this.formParam.user_message_rule.push(data.name);
}
} else {
const index = this.checkedMessageNodes.indexOf(data.name);
const index = this.formParam.user_message_rule.indexOf(data.name);
if (index !== -1) {
this.checkedMessageNodes.splice(index, 1);
this.formParam.user_message_rule.splice(index, 1);
}
if (data.children) {
if (!this.checkedMessageNodes.includes(data.name)) {
this.checkedMessageNodes.push(data.name);
if (!this.formParam.user_message_rule.includes(data.name)) {
this.formParam.user_message_rule.push(data.name);
}
}
}
......@@ -232,8 +267,8 @@ export default {
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.formParam.user_message_rule = JSON.stringify(this.checkedNodes);
this.formParam.user_rule = JSON.stringify(this.checkedMessageNodes);
this.formParam.user_rule = JSON.stringify(this.formParam.user_rule);
this.formParam.user_message_rule = JSON.stringify(this.formParam.user_message_rule);
this.$http('POST', "/api/subAccount/edit", this.formParam).then(res => {
if (res.code === 0) {
this.$message({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment