Commit f92e42f9 by 无尘

add: 增加首页接口

parent 472d9116
...@@ -6,7 +6,12 @@ ...@@ -6,7 +6,12 @@
</div> </div>
<div class="custom-dialog__checkbox"> <div class="custom-dialog__checkbox">
<el-checkbox-group v-model="checkList" @change="customChange" :max="8"> <el-checkbox-group v-model="checkList" @change="customChange" :max="8">
<el-checkbox v-for="item in customData" :label="item.id" :key="item.id" name="type">{{item.name}}</el-checkbox> <template v-if="customType === 'data'">
<el-checkbox v-for="item in customData" :label="item.dataViewId" :key="item.dataViewId" name="type">{{item.fieldTitle}}</el-checkbox>
</template>
<template v-if="customType != 'data'">
<el-checkbox v-for="item in customData" :label="item.settingViewId" :key="item.settingViewId" name="type">{{item.fieldTitle}}</el-checkbox>
</template>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -20,14 +25,17 @@ ...@@ -20,14 +25,17 @@
import { getRequest, postRequest, postJsonRequest } from '@/api/api'; import { getRequest, postRequest, postJsonRequest } from '@/api/api';
import showMsg from '@/common/js/showmsg'; import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error'; import errMsg from '@/common/js/error';
import qs from 'qs';
export default { export default {
name: 'custom-dialog', name: 'custom-dialog',
props: { props: {
showCustomDialog: { showCustomDialog: {
type: Boolean, type: Boolean,
default: false default: false
} },
customType: {
type: String,
default: ''
},
}, },
data () { data () {
return { return {
...@@ -35,120 +43,78 @@ ...@@ -35,120 +43,78 @@
customDialog: false, // 弹框显示 customDialog: false, // 弹框显示
// 复选框数据 // 复选框数据
customData: [ customData: [
{ // {
id: 1, // dataViewId: 1,
name: "通讯录行政架构", // fieldTitle: "通讯录行政架构",
}, // homeDisplay: true
{ // }
id: 2,
name: "通讯录门店架构",
},
{
id: 3,
name: "员工档案",
},
{
id: 4,
name: "共享通讯录",
},
{
id: 5,
name: "企业应用",
},
{
id: 6,
name: "我的企业",
},
{
id: 7,
name: "企业地址",
},
{
id: 8,
name: "企业认证设置",
},
{
id: 9,
name: "员工详情设置",
},
{
id: 10,
name: "门店权限设置",
},
{
id: 11,
name: "设置子管理员",
},
{
id: 12,
name: "更换超级管理员",
},
{
id: 13,
name: "行政架构添加部门",
},
], ],
checkList: [], //已选数据 checkList: [], //已选数据
// 获取 location origin
baseUrl: '',
} }
}, },
beforeMount() { beforeMount() {
var that = this
var host = window.location.origin;
console.log("当前host:",host)
if (host.indexOf('localhost') != '-1') {
that.baseUrl = 'http://gicdev.demogic.com';
}else {
that.baseUrl = host
}
}, },
methods:{ methods:{
// 关闭 /**
* 关闭
*/
handleCardClose() { handleCardClose() {
var that = this; const that = this;
that.customCancel(); that.customCancel();
}, },
// 取消 /**
* 取消
*/
customCancel() { customCancel() {
var that = this; const that = this;
that.customDialog = false that.customDialog = false
that.$emit('customHandleConfirm') that.$emit('customHandleConfirm')
}, },
// 确定 /**
* 确定
*/
customConfirm() { customConfirm() {
var that = this const that = this
that.$emit('customHandleConfirm') if (!that.checkList.length) {
that.$message.error({
duration: 1000,
message: '请选择操作'
})
return false;
}
that.setData(that.checkList)
}, },
// 复选框选择事件 /**
* 复选框选择事件
*/
customChange(value) { customChange(value) {
var that = this const that = this
console.log(value) console.log(value)
}, },
// 获取已经勾选 /**
getCardList() { * 设置首页数据概览显示项
var that = this */
var para = { setData(list) {
requestProject: that.repProjectName const that = this
let para = {
viewIdList: JSON.stringify(list)
} }
that.axios.post(that.baseUrl+'/api-plug/get-coupon-list',qs.stringify(para)) let url = that.customType == 'data'? '/haoban-manage-web/home/set-display-enterprise-data':'/haoban-manage-web/home/set-display-quick-entry';
postRequest(url,para)
.then((res) => { .then((res) => {
console.log(res,res.data,res.data.errorCode) console.log(res,res.data,res.data.errorCode)
var resData = res.data let resData = res.data
if (resData.errorCode == 0) { if (resData.errorCode == 1) {
that.$emit('customHandleConfirm')
return; return;
} }
that.$message.error({ errMsg.errorMsg(resData)
duration: 1000,
message: resData.message
})
}) })
.catch(function (error) { .catch(function (error) {
...@@ -161,32 +127,64 @@ ...@@ -161,32 +127,64 @@
}); });
}, },
formatDate(time,flag) { /**
var that = this * 获取 设置首页数据概览显示项
// (0-9)年月数字的显示 */
function formatDig(num) { getCardList() {
return num > 9 ? '' + num : '0' + num; const that = this
let para = {
all: true
}
that.customType == 'data'? (para.fetchData = false) : '';
// 判断企业数据概览
let url = that.customType == 'data'? '/haoban-manage-web/home/find-enterprise-data':'/haoban-manage-web/home/find-quick-entry';
that.checkList = [];
postRequest(url,para)
.then((res) => {
console.log(res,res.data,res.data.errorCode)
let resData = res.data
if (resData.errorCode == 1) {
let selList = []
resData.result.forEach(function(ele,index){
if (!!ele.homeDisplay) {
that.customType == 'data'?selList.push(ele.dataViewId):selList.push(ele.settingViewId)
} }
var myDate = new Date(time); })
let y = myDate.getFullYear(); that.customData = resData.result;
let m = myDate.getMonth()+1; that.checkList = selList;
let d = myDate.getDate(); return;
return y + flag + formatDig(m) + flag + formatDig(d) + flag
} }
errMsg.errorMsg(resData)
})
.catch(function (error) {
console.log(error);
// that.toLogin()
that.$message.error({
duration: 1000,
message: error.message
})
});
},
}, },
watch: { watch: {
showCustomDialog: function(newData,oldData){ showCustomDialog: function(newData,oldData){
var that = this; const that = this;
console.log("新数据:",newData,oldData)
that.customDialog = newData that.customDialog = newData
}, },
customType: function(newData,oldData){
const that = this;
if (!!newData) {
that.getCardList()
}
}
}, },
/* 接收数据 */ /* 接收数据 */
mounted(){ mounted(){
console.log("传递的参数对象:",this.showCustomDialog) console.log("传递的参数对象:",this.showCustomDialog)
var that = this; const that = this;
that.customDialog = that.showCustomDialog that.customDialog = that.showCustomDialog
}, },
......
...@@ -64,7 +64,7 @@ export default { ...@@ -64,7 +64,7 @@ export default {
that.baseUrl = host that.baseUrl = host
} }
that.upUrl = that.baseUrl + '/api-plug/upload-img?wxFlag=1' // that.upUrl = that.baseUrl + '/api-plug/upload-img?wxFlag=1'
}, },
methods: { methods: {
/** /**
...@@ -76,12 +76,12 @@ export default { ...@@ -76,12 +76,12 @@ export default {
let baseUrl; let baseUrl;
console.log("当前host:",host) console.log("当前host:",host)
if (host.indexOf('localhost') != '-1') { if (host.indexOf('localhost') != '-1') {
baseUrl = 'http://gicdev.demogic.com'; baseUrl = 'http://www.gicdev.com';
}else { }else {
baseUrl = host baseUrl = host
} }
that.upUrl = baseUrl + '/api-plug/upload-img?wxFlag=1&requestProject=gic-clique' that.upUrl = baseUrl + '/haoban-manage-web/upload-img'
console.log(that.upUrl) console.log(that.upUrl)
return that.upUrl return that.upUrl
}, },
......
...@@ -159,7 +159,7 @@ export default { ...@@ -159,7 +159,7 @@ export default {
countyId: '' countyId: ''
}, },
upUrl: '',// 上传地址 upUrl: 'upload-img',// 上传地址
baseUrl: '', baseUrl: '',
} }
}, },
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class="text-center"><el-button @click="changeRoute('/addAdminrole')">新增管理员角色</el-button></div> <div class="text-center"><el-button @click="changeRoute('/addAdminrole')">新增管理员角色</el-button></div>
<div class="m-t-20"> <div class="m-t-20">
<ul> <ul>
<li v-for="(item,index) in adminRole" :key="index" :class="['role-cell',item.id == activeId? 'role-active':'']" @click.stop="selectRole(item.id)"><i class="iconfont icon-lizhi p-r-6"></i>{{item.name}}</li> <li v-for="(item,index) in adminRole" :key="index" :class="['role-cell',item.roleId == activeId? 'role-active':'']" @click.stop="selectRole(item.roleId)"><i class="iconfont icon-lizhi p-r-6"></i>{{item.roleName}}</li>
</ul> </ul>
</div> </div>
</div> </div>
...@@ -46,6 +46,18 @@ ...@@ -46,6 +46,18 @@
label="部门"> label="部门">
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="block common-wrap__page text-right" v-if="tableData.length!=0">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -87,16 +99,22 @@ export default { ...@@ -87,16 +99,22 @@ export default {
boxHeight: window.screen.availHeight + 'px', boxHeight: window.screen.availHeight + 'px',
activeId: 1, activeId: 1,
// roleListData: [
// {
// roleParentName: '集团',
adminRole: [ adminRole: [
{ // {
id: '1', // roleId: '1',
name: '超级管理员' // roleName: '超级管理员'
}, // },
{ // {
id: '2', // roleId: '2',
name: '企业管理员' // roleName: '企业管理员'
} // }
], ],
// }
// ],
roleRightObj: { roleRightObj: {
name: '超级管理员', name: '超级管理员',
...@@ -111,7 +129,11 @@ export default { ...@@ -111,7 +129,11 @@ export default {
phone: '13333333333', phone: '13333333333',
depart: '技术部' depart: '技术部'
} }
] ],
// 分页参数
currentPage: 1,
pageSize: 20,
total: 0,
} }
}, },
computed: { computed: {
...@@ -139,27 +161,119 @@ export default { ...@@ -139,27 +161,119 @@ export default {
selectRole(id) { selectRole(id) {
const that = this; const that = this;
that.activeId = id that.activeId = id
that.getRoleUsers();
}, },
/** /**
* 请求角色---api * 添加成员
*/ */
postRole() { toAddRole() {
const that = this; const that = this;
that.changeRoute(`/addAdmin?roleId=${that.activeId}`);
},
/**
* 分页---页码变化
*/
handleSizeChange(val) {
const that = this;
that.pageSize = val;
that.getRoleUsers();
}, },
/** /**
* 添加成员 * 分页---当前页变化
*/ */
toAddRole() { handleCurrentChange(val) {
const that = this; const that = this;
that.changeRoute(`/addAdmin?roleId=${that.activeId}`); that.currentPage = val;
that.getRoleUsers();
},
/**
* 获取角色用户数据
*/
getRoleUsers() {
const that = this;
let para = {
roleId: that.activeId,
pageSize: that.pageSize,
pageNum: that.currentPage
}
postRequest('/haoban-manage-web/role-user-list',para)
.then((res) => {
// console.log(res,res.data,res.data.errorCode)
var resData = res.data;
if (resData.errorCode == 1) {
// showMsg.showmsg('操作成功','success')
if(!resData.result || !resData.result.result){
that.$message.error({
duration: 1000,
message: '暂无数据'
})
return false;
}
that.tableData = resData.result.result;
that.total = resData.result.totalCount;
return;
}
errMsg.errorMsg(resData)
})
.catch(function (error) {
console.log(error);
that.$message.error({
duration: 1000,
message: error.message
})
});
},
/**
* 获取角色数据
*/
getRoles() {
const that = this;
let para = {
}
postRequest('/haoban-manage-web/role-list',para)
.then((res) => {
// console.log(res,res.data,res.data.errorCode)
var resData = res.data;
if (resData.errorCode == 1) {
// showMsg.showmsg('操作成功','success')
that.adminRole = resData.result;
if (!!resData.result && !!resData.result.length) {
that.activeId = that.adminRole[0].roleId;
that.getRoleUsers()
}
return;
}
errMsg.errorMsg(resData)
})
.catch(function (error) {
console.log(error);
that.$message.error({
duration: 1000,
message: error.message
})
});
} }
}, },
mounted() { mounted() {
const that = this; const that = this;
that.boxHeight = (window.screen.availHeight - 430) + 'px' that.boxHeight = (window.screen.availHeight - 430) + 'px';
that.getRoles();
}, },
components: { components: {
navCrumb navCrumb
...@@ -293,6 +407,10 @@ export default { ...@@ -293,6 +407,10 @@ export default {
margin-top: 27px; margin-top: 27px;
} }
.common-wrap__page {
margin-top: 24px;
}
.right-content { .right-content {
/*width: 100%;*/ /*width: 100%;*/
padding: 24px; padding: 24px;
......
...@@ -276,6 +276,18 @@ ...@@ -276,6 +276,18 @@
<div class="fontclass">.icon-yewuduanmorentouxian</div> <div class="fontclass">.icon-yewuduanmorentouxian</div>
</li> </li>
<li>
<i class="icon iconfont icon-qiyerenzheng1"></i>
<div class="name">renzhengzhong</div>
<div class="fontclass">.icon-qiyerenzheng1</div>
</li>
<li>
<i class="icon iconfont icon-qiyerenzheng2"></i>
<div class="name">renzhengshibai</div>
<div class="fontclass">.icon-qiyerenzheng2</div>
</li>
</ul> </ul>
<h2 id="font-class-">font-class引用</h2> <h2 id="font-class-">font-class引用</h2>
......
...@@ -379,6 +379,22 @@ ...@@ -379,6 +379,22 @@
<div class="fontclass">#icon-yewuduanmorentouxian</div> <div class="fontclass">#icon-yewuduanmorentouxian</div>
</li> </li>
<li>
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-qiyerenzheng1"></use>
</svg>
<div class="name">renzhengzhong</div>
<div class="fontclass">#icon-qiyerenzheng1</div>
</li>
<li>
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-qiyerenzheng2"></use>
</svg>
<div class="name">renzhengshibai</div>
<div class="fontclass">#icon-qiyerenzheng2</div>
</li>
</ul> </ul>
......
...@@ -296,6 +296,18 @@ ...@@ -296,6 +296,18 @@
<div class="code">&amp;#xe7a3;</div> <div class="code">&amp;#xe7a3;</div>
</li> </li>
<li>
<i class="icon iconfont">&#xe7b0;</i>
<div class="name">renzhengzhong</div>
<div class="code">&amp;#xe7b0;</div>
</li>
<li>
<i class="icon iconfont">&#xe7b1;</i>
<div class="name">renzhengshibai</div>
<div class="code">&amp;#xe7b1;</div>
</li>
</ul> </ul>
<h2 id="unicode-">unicode引用</h2> <h2 id="unicode-">unicode引用</h2>
<hr> <hr>
......
No preview for this file type
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -152,6 +152,12 @@ Created by iconfont ...@@ -152,6 +152,12 @@ Created by iconfont
<glyph glyph-name="yewuduanmorentouxian" unicode="&#59299;" d="M506.368 365.056c146.944 0 266.24 117.76 266.24 262.656s-119.296 262.656-266.24 262.656-266.24-117.76-266.24-262.656 119.296-262.656 266.24-262.656z m105.984-46.592h-199.68c-185.344 0-335.872-148.48-335.872-331.264v-19.968C76.8-128 225.28-128 412.672-128h199.168c180.224 0 335.872 0 335.872 95.232v19.968c0.512 182.272-150.528 331.264-335.36 331.264z" horiz-adv-x="1024" /> <glyph glyph-name="yewuduanmorentouxian" unicode="&#59299;" d="M506.368 365.056c146.944 0 266.24 117.76 266.24 262.656s-119.296 262.656-266.24 262.656-266.24-117.76-266.24-262.656 119.296-262.656 266.24-262.656z m105.984-46.592h-199.68c-185.344 0-335.872-148.48-335.872-331.264v-19.968C76.8-128 225.28-128 412.672-128h199.168c180.224 0 335.872 0 335.872 95.232v19.968c0.512 182.272-150.528 331.264-335.36 331.264z" horiz-adv-x="1024" />
<glyph glyph-name="qiyerenzheng1" unicode="&#59312;" d="M860.672 528.896V733.184h-204.288L512 877.568 367.616 733.184h-204.8v-204.8L18.432 384l144.384-144.896v-204.288h204.8l144.384-144.384 144.896 145.408h204.288v204.288l144.384 144.384-144.896 144.384zM384 341.504H298.496V426.496H384v-84.992z m170.496 0H469.504V426.496h85.504v-84.992z m171.008 0H640V426.496h85.504v-84.992z" horiz-adv-x="1024" />
<glyph glyph-name="qiyerenzheng2" unicode="&#59313;" d="M860.672 528.896V733.184h-204.288L512 877.568 367.616 733.184h-204.8v-204.8L18.432 384l144.384-144.896v-204.288h204.8l144.384-144.384 144.896 145.408h204.288v204.288l144.384 144.384-144.896 144.384z m-302.592-373.76H476.16v81.92h81.92v-81.92z m3.072 326.656l-20.992-216.576h-46.08l-21.504 216.576V582.144h88.576v-100.352z" horiz-adv-x="1024" />
</font> </font>
......
No preview for this file type
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 to comment