cyl/dev
wangxia 2 years ago
parent cf37f0db8b
commit 0d1b9e9630

@ -8,7 +8,7 @@
<script>
import zhCn from "ant-design-vue/lib/locale-provider/zh_CN";
let sp = document.createElement('script')
sp.src = '//at.alicdn.com/t/c/font_3135652_etcavihgi6d.js'
sp.src = '//at.alicdn.com/t/c/font_3135652_st06ih16ux9.js'
document.body.appendChild(sp)
export default {
provide() {

@ -27,35 +27,56 @@
</a-radio-group>
<div v-if="menuType == 'role'">
<a-menu :selectedKeys="selectedKeys" class="bgf" mode="inline" :class="'leftMenu'" style="overflow-y:scroll;height:calc(100%);overflow-x:hidden;">
<a-menu-item key="all" class="fsa showdot bb_after fw500" @click="selectGroup('all')">19</a-menu-item>
<a-menu-item key="all" class="fsa bb_after fw500" @click="selectGroup('all')">
全部角色
<i class="the_num f14 tac" style="min-width:12px" @click.stop>19</i>
</a-menu-item>
</a-menu>
<div class="bb1 ml12 mr12 mt4 mb4" style="wdith:calc(100% - 24px)"></div>
<div class="f12 c9 ml24 mb8">默认角色11</div>
<!-- <div class="bb1 ml12 mr12 mt4 mb4" style="wdith:calc(100% - 24px)"></div> -->
<!-- <div class="f12 c9 ml24 mb8">默认角色11</div> -->
<a-menu :selectedKeys="selectedKeys" class="bgf" mode="inline" :class="'leftMenu'" style="overflow-y:scroll;height:calc(100%);overflow-x:hidden;">
<template v-for="(item, index) in ['创建人(1人)','管理员(3人)','成员(12人)']">
<a-menu-item :key="item" class="fsa showdot" @click="selectGroup(item)">{{item}}</a-menu-item>
<template v-for="(item, index) in ['创建人','管理员','成员']">
<a-menu-item :key="item" class="fsa" @click="selectGroup(item)">
<span>
{{item}}
<svg class="svg f20 ml4 mb2" aria-hidden="true">
<use xlink:href="#icon-xitong" />
</svg>
</span>
<i class="the_num tac" style="min-width:12px" @click.stop>3</i>
</a-menu-item>
</template>
</a-menu>
<div class="bb1 ml12 mr12 mt4 mb4" style="wdith:calc(100% - 24px)"></div>
<div class="f12 c9 ml24 mb8">自定义角色8</div>
<!-- <div class="bb1 ml12 mr12 mt4 mb4" style="wdith:calc(100% - 24px)"></div> -->
<!-- <div class="f12 c9 ml24 mb8">自定义角色8</div> -->
<a-menu :selectedKeys="selectedKeys" class="bgf" mode="inline" :class="'leftMenu'" style="overflow-y:scroll;height:calc(100%);overflow-x:hidden;">
<!-- <template v-for="(item, index) in groupList"> -->
<a-menu-item key="角色18人" class="fsa showdot" @click="selectGroup('角色18人')">{{'18'}}</a-menu-item>
<a-menu-item key="角色28人" class="fsa showdot" @click="selectGroup('角色28人')">{{'28'}}</a-menu-item>
<!-- </template> -->
<template v-for="(item, index) in ['角色1','角色2']">
<a-menu-item :key="item" class="fsa" @click="selectGroup(item)">
<span>
{{item}}
<svg class="svg f26 ml4 mb2" aria-hidden="true">
<use xlink:href="#icon-zidingyi" />
</svg>
</span>
<span class="the_num tac" style="min-width:12px">1</span>
</a-menu-item>
</template>
</a-menu>
</div>
<div v-else>
<a-menu :selectedKeys="selectedKeys" class="bgf" mode="inline" :class="'leftMenu'" style="overflow-y:scroll;height:calc(100%);overflow-x:hidden;">
<a-menu-item key="all" class="fsa showdot bb_after fw500" @click="selectGroup('all')">19</a-menu-item>
<a-menu-item key="all" class="fsa bb_after fw500" @click="selectGroup('all')">
全部部门
<i class="the_num f14" @click.stop>18</i>
</a-menu-item>
</a-menu>
<div class="bb1 ml12 mr12 mt4 mb4" style="wdith:calc(100% - 24px)"></div>
<!-- <div class="bb1 ml12 mr12 mt4 mb4" style="wdith:calc(100% - 24px)"></div> -->
<a-menu :selectedKeys="selectedKeys" class="bgf" mode="inline" :class="'leftMenu'" style="overflow-y:scroll;height:calc(100%);overflow-x:hidden;">
<template v-for="(item, index) in groupList">
<a-menu-item :key="item.teamName" class="fsa showdot" @click="selectGroup(item)">
{{item.teamName + '8人'}}
{{item.teamName}}
<a-dropdown overlayClassName="groupdropdown" :trigger="['click']" placement="bottomRight">
<i class="iconfont icon-gengduo3 thedot f12" @click.stop></i>
<i class="iconfont icon-gengduo3 thedot f14" @click.stop></i>
<div class="groupdropdownbox backTable" slot="overlay">
<div @click="[addGroupShow = true,isEdit = true,recordId = item.id,groupName=item.teamName]">修改名称</div>
<div @click="delGroup(item)"></div>
@ -63,6 +84,7 @@
<div @click="index + 1 < groupList.length?moveList(item,'down'):null" :class="index + 1 == groupList.length? 'unactive':''">下移</div>
</div>
</a-dropdown>
<div class="the_num f14 tac" style="min-width:12px" @click.stop>6</div>
</a-menu-item>
</template>
</a-menu>
@ -89,11 +111,11 @@
<a-table :columns="columns" :scroll="{x:currWidth}" :data-source="memberList" :pagination="false" @change="onChange" :loading="{spinning: isspinning,tip: '加载中',wrapperClassName: 'spinstyle'}" :rowKey="(record) => record.id" :locale="tablenodata">
<!-- <a slot="index" slot-scope="record, text, index">{{ index + 1 }}</a> -->
<span slot="nickName" slot-scope="text, record">{{ record.aliasName || record.userName }}</span>
<div slot="join" slot-scope="text, record">
<a-switch default-checked :checked="record.join" @change="showChange(record,'join')" />
<div slot="inAgencyStatistics" slot-scope="text, record">
<a-switch :checked="text" @change="showChange(record,'inAgencyStatistics')" />
</div>
<div slot="bigScreen" slot-scope="text, record">
<a-switch default-checked :checked="record.bigScreen" @change="showChange(record,'bigScreen')" />
<div slot="showAgencyScreen" slot-scope="text, record">
<a-switch :checked="text" @change="showChange(record,'showAgencyScreen')" />
</div>
<div slot="setting" v-if="!record.children" class="setting" slot-scope="text, record" style="color: #1890FF">
<!-- <a @click="showDetail('detail', record)">详情</a> -->
@ -219,39 +241,38 @@
<a-input placeholder="请输入备注名" v-decorator="[ 'aliasName', { rules: [{ required: true, message: '' }] }, ]" />
</a-form-item>
<a-form-item label="手机号">
<a-input placeholder="请输入手机号" v-decorator="['tel', {rules: [{ required: true, message: '' },{ type: 'regexp', validator: validateServiceName, message: '', }, ], validateTrigger: 'submit', }, ]" :max-length="11" />
<a-input placeholder="请输入手机号" v-decorator="['tel', {rules: [{ required: true, message: '' },{ type: 'regexp', validator: validateServiceName, message: '', }, ], validateTrigger: 'submit',validateFirst:true }, ]" :max-length="11" />
</a-form-item>
<a-form-item label="部门选择">
<a-select default-value="lucy" placeholder="请选择部门" v-decorator="['agencyTeamId',{ rules: [{ required: false, message: '请选择部门' }] },]" dropdownClassName="groupSelectDrop">
<div slot="dropdownRender" slot-scope="menu">
<a-select placeholder="请选择部门" v-decorator="['agencyTeamId',{ rules: [{ required: false, message: '请选择部门' }] },]" dropdownClassName="groupSelectDrop">
<a-select-option v-for="(item,index) in groupList" :value="item.id" class="groupSelectSub fsa" :key="index">
<div>{{item.teamName}}</div>
</a-select-option>
<!-- <div slot="dropdownRender" slot-scope="menu">
<div v-for="(item,index) in groupList" @click="choiceGroup(item)" class="groupSelectSub fsa" :key="index">
<div>{{item.teamName}}</div>
</div>
<!-- <div class="bt1" style="padding: 9px 16px; cursor: pointer;" @mousedown="e => e.preventDefault()" @click="[addGroupShow = true,isEdit = false]">添加新部门</div> -->
</div>
</div>-->
</a-select>
</a-form-item>
<a-form-item label="角色">
<a-select default-value="lucy" placeholder="请选择角色" v-decorator="['role',{ rules: [{ required: true, message: '请选择角色' }] },]" dropdownClassName="groupSelectDrop">
<div slot="dropdownRender" slot-scope="menu">
<div v-for="(item,index) in groupList" @click="choiceGroup(item)" class="groupSelectSub fsa" :key="index">
<div>{{item.teamName}}</div>
</div>
<!-- <div class="bt1" style="padding: 9px 16px; cursor: pointer;" @mousedown="e => e.preventDefault()" @click="[addGroupShow = true,isEdit = false]">添加新部门</div> -->
</div>
<a-select placeholder="请选择角色" :defaultActiveFirstOption="false" v-decorator="['agencyRole',{ rules: [{ required: true, message: '请选择角色' }] },]" dropdownClassName="groupSelectDrop">
<a-select-option v-for="(item,index) in roleOptions" :value="item.value" class="groupSelectSub fsa" :key="index">
<div>{{item.label}}</div>
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="角色" class="dn">
<!-- <a-form-item label="角色" class="dn">
<a-radio-group v-decorator="[
'agencyRole',
{ rules: [{ required: true, message: '请选择角色' }] },
]" :options="options" @change="groupChange" />
</a-form-item>
]" :options="roleOptions" @change="groupChange" />
</a-form-item>-->
<a-form-item label="参与统计">
<a-switch default-checked @change="onChange" />
<a-switch v-decorator="['inAgencyStatistics',{ valuePropName: 'checked' }]" />
</a-form-item>
<a-form-item label="大屏显示">
<a-switch default-checked @change="onChange" />
<a-switch v-decorator="['showAgencyScreen',{ valuePropName: 'checked' }]" />
</a-form-item>
<!-- <a-row>
<a-col :span="4">权限</a-col>
@ -283,7 +304,7 @@
</template>
<script>
import { getMemberListApi, deleteMemberApi, addMemberApi, getMemberGroupApi, addMemberGroupApi, updateMemberGroupApi, delMemberGroupApi, updateMemberApi, moveGroupNextApi, moveGroupPrevApi } from '../../api/userinfo'
import { getMemberListApi, deleteMemberApi, addMemberApi, getMemberGroupApi, addMemberGroupApi, updateMemberGroupApi, delMemberGroupApi, updateMemberApi, moveGroupNextApi, moveGroupPrevApi, memberShowScreenApi, memberJoinDataApi } from '../../api/userinfo'
import { formatDateYMD, getUserApplyOrderStatusById, getAgencyRoleTypeById, getAgencyPermissionNameById, getAgencyPermissionsByRole, tableWidth } from '../../utils/commonUtil'
export default {
@ -336,7 +357,7 @@ export default {
visible: false,
currentMember: {},
modalTitle: '',
options: [
roleOptions: [
// { label: "", value: "1" },
{ label: '管理员', value: '2' },
{ label: '成员', value: '3' },
@ -436,17 +457,19 @@ export default {
},
{
title: '参与统计',
dataIndex: 'join',
key: 'join',
scopedSlots: { customRender: 'join' },
dataIndex: 'inAgencyStatistics',
key: 'inAgencyStatistics',
scopedSlots: { customRender: 'inAgencyStatistics' },
ellipsis: true,
width: 80,
},
{
title: '大屏显示',
dataIndex: 'bigScreen',
key: 'bigScreen',
scopedSlots: { customRender: 'bigScreen' },
dataIndex: 'showAgencyScreen',
key: 'showAgencyScreen',
scopedSlots: { customRender: 'showAgencyScreen' },
ellipsis: true,
width: 80,
},
@ -546,12 +569,13 @@ export default {
this.memberList.forEach((item, index) => {
// item.group = '' + ((index % 5) + 1)
// item1.children.forEach((item) => {
item.join = false
item.bigScreen = false
item.inAgencyStatistics = item.inAgencyStatistics == 0 ? true : false
item.showAgencyScreen = item.showAgencyScreen == 0 ? true : false
item.role = getAgencyRoleTypeById(item.agencyRole)
item.permission = getAgencyPermissionNameById(item.agencyPermissions)
// })
})
console.log(this.memberList)
// this.memberList.sort((a, b) => {
// return a.agencyRole - b.agencyRole
// })
@ -709,6 +733,8 @@ export default {
tel: this.currentMember.tel,
group: this.currentMember.group,
agencyTeamId: this.currentMember.agencyTeamName,
showAgencyScreen: this.currentMember.showAgencyScreen,
inAgencyStatistics: this.currentMember.inAgencyStatistics,
})
}, 200)
} else if (type == 'detail') {
@ -721,7 +747,7 @@ export default {
this.$nextTick(() => {
console.log(123)
that.form.setFieldsValue({
agencyRole: '2',
agencyRole: '3',
})
})
}
@ -766,6 +792,8 @@ export default {
handleSubmit() {
console.log('issubmit')
console.log(this.currentMember)
console.log(this.form.getFieldsValue())
let formData = this.form.getFieldsValue()
this.form.validateFields(async (err) => {
console.log(err)
if (err == null) {
@ -774,7 +802,9 @@ export default {
let { data } = await updateMemberApi({
...this.form.getFieldsValue(),
agencyPermissions: this.permission,
agencyTeamId: this.agencyTeamId,
inAgencyStatistics: formData.inAgencyStatistics == true ? 0 : 1,
showAgencyScreen: formData.showAgencyScreen == true ? 0 : 1,
// agencyTeamId: this.agencyTeamId,
id: this.currentMember.id,
})
console.log(data)
@ -797,7 +827,9 @@ export default {
let { data } = await addMemberApi({
...this.form.getFieldsValue(),
agencyPermissions: this.permission,
agencyTeamId: this.agencyTeamId,
inAgencyStatistics: formData.inAgencyStatistics == true ? 0 : 1,
showAgencyScreen: formData.showAgencyScreen == true ? 0 : 1,
// agencyTeamId: this.agencyTeamId,
})
console.log(data)
if (data.status == 200) {
@ -827,14 +859,22 @@ export default {
}
})
},
choiceGroup(e) {
console.log(e)
this.form.setFieldsValue({
agencyTeamId: e.teamName,
})
this.agencyTeamId = e.id
console.log(this.agencyTeamId)
},
// choiceGroup(e) {
// console.log(e)
// this.form.setFieldsValue({
// agencyTeamId: e.teamName,
// })
// this.agencyTeamId = e.id
// console.log(this.agencyTeamId)
// },
// choiceRole(e) {
// console.log(e)
// this.form.setFieldsValue({
// agencyRole: e.teamName,
// })
// this.agencyTeamId = e.id
// console.log(this.agencyTeamId)
// },
groupChange(e) {
console.log(e)
this.form.setFieldsValue({
@ -874,10 +914,10 @@ export default {
if (item.id == e.id) {
item[type] = !item[type]
console.log(item[type])
if (type == 'bigScreen' && item['bigScreen'] == true) {
item['join'] = true
} else if (type == 'join' && item['join'] == false) {
item['bigScreen'] = false
if (type == 'showAgencyScreen' && item['showAgencyScreen'] == true) {
item['inAgencyStatistics'] = true
} else if (type == 'inAgencyStatistics' && item['inAgencyStatistics'] == false) {
item['showAgencyScreen'] = false
}
console.log(item)
@ -887,6 +927,18 @@ export default {
that.$forceUpdate()
}, 10)
},
/**
* 大屏显示
*/
memberShowScreen(val) {
memberShowScreenApi().then(({ data }) => {})
},
/**
* 参与统计
*/
memberJoinData(val) {
memberJoinDataApi().then(({ data }) => {})
},
moveList(item, type) {
console.log(item)
if (type == 'up') {
@ -1033,8 +1085,13 @@ export default {
.thedot {
display: none;
}
.showdot:hover .thedot {
display: block;
.showdot:hover {
.thedot {
display: block;
}
.the_num {
display: none;
}
}
}
.rightContainer {

@ -27,19 +27,28 @@
</a-radio-group>
<div v-if="menuType == 'role'">
<a-menu :selectedKeys="selectedKeys" class="bgf" mode="inline" :class="'leftMenu'" style="overflow-y:scroll;height:calc(100%);overflow-x:hidden;">
<a-menu-item key="all" class="fsa showdot bb_after fw500" @click="selectGroup('all')">50</a-menu-item>
<a-menu-item key="all" class="fsa showdot bb_after fw500" @click="selectGroup('all')">
全部成员
<span>{{totalDataList.length}}</span>
</a-menu-item>
</a-menu>
<div class="bb1 ml12 mr12 mt4 mb8" style="wdith:calc(100% - 24px)"></div>
<!-- <div class="bb1 ml12 mr12 mt4 mb8" style="wdith:calc(100% - 24px)"></div> -->
<!-- <div class="f12 c9 ml24 mb8">默认角色11</div> -->
<a-menu :selectedKeys="selectedKeys" class="bgf" mode="inline" :class="'leftMenu'" style="overflow-y:scroll;height:calc(100%);overflow-x:hidden;">
<template v-for="(item, index) in groupList">
<a-menu-item :key="item.teamName" class="fsa showdot" @click="selectGroup(item)">{{item.teamName + '18'}}</a-menu-item>
<a-menu-item :key="item.teamName" class="fsa showdot" @click="selectGroup(item)">
<span>{{item.teamName}}</span>
<i class="the_num" @click.stop>3</i>
</a-menu-item>
</template>
</a-menu>
</div>
<div v-else>
<a-menu :selectedKeys="selectedKeys" class="bgf" mode="inline" :class="'leftMenu'" style="overflow-y:scroll;height:calc(100%);overflow-x:hidden;">
<a-menu-item key="all" class="fsa showdot bb_after fw500" @click="selectGroup('all')">50</a-menu-item>
<a-menu-item key="all" class="fsa showdot bb_after fw500" @click="selectGroup('all')">
全部部门
<span>32</span>
</a-menu-item>
</a-menu>
<!-- <a-menu :selectedKeys="selectedKeys" class="bgf" mode="inline" :class="'leftMenu'" style="overflow-y:scroll;height:calc(100%);overflow-x:hidden;">
<a-menu-item key="all" class="fsa showdot bb_after" @click="selectGroup('all')"></a-menu-item>
@ -179,7 +188,7 @@
<script>
import { dataStatisticsListApi, dataStatisticsTeamDetailApi, getMemberGroupApi } from '../../../../api/userinfo'
import moment from 'moment'
import { getDateYMD, formatDateYMD, formatDateYMDHM, getUserApplyOrderStatusById, toFixed, tableWidth } from '../../../../utils/commonUtil'
import { getDateYMD, formatDateYMD, formatDateYMDHM, getUserApplyOrderStatusById, toFixed, tableWidth, fullCopy } from '../../../../utils/commonUtil'
const rowSelection = {
onChange: (selectedRowKeys, selectedRows) => {
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
@ -613,36 +622,45 @@ export default {
watch: {
menuType: {
handler(value) {
let that = this
console.log(value)
if (value == 'group') {
console.log(this.columns)
this.columns.splice(1, 1, {
title: '部门',
dataIndex: 'agencyTeamName',
key: 'agencyTeamName',
ellipsis: true,
// width: 120,
slots: { title: 'agencyTeamName' },
})
tableWidth(this, this.columns, 120)
console.log(this.currWidth)
that
.getDataStatisticsList()
.then(() => {
console.log(1313123131231232)
// this.dataList = this.groupDataList
that.columns.splice(1, 1, {
title: '部门',
dataIndex: 'agencyTeamName',
key: 'agencyTeamName',
ellipsis: true,
// width: 120,
slots: { title: 'agencyTeamName' },
})
tableWidth(that, that.columns, 120)
this.$forceUpdate()
})
.catch((err) => {
console.log(err)
})
//
} else {
console.log(value)
console.log(this.columns.slice(2, 3))
if (this.columns.slice(1, 2)[0].title == '部门') {
this.columns.splice(1, 1, {
title: '姓名',
dataIndex: 'aliasName',
key: 'aliasName',
customRender: (text, row, index) => {
// if (row.users) {
// return row.agencyTeamName
// } else {
return row.aliasName
// }
},
ellipsis: true,
// width: 100,
console.log(that.columns.slice(1, 2)[0].title)
if (that.columns.slice(1, 2)[0].title == '部门') {
that.getDataStatisticsList().then(() => {
console.log(1313123131231232)
that.dataList = fullCopy(that.totalDataList)
that.columns.splice(1, 1, {
title: '姓名',
dataIndex: 'aliasName',
key: 'aliasName',
customRender: (text, row, index) => {
return row.aliasName
},
ellipsis: true,
})
})
}
}
@ -779,10 +797,17 @@ export default {
console.log(index)
})
console.log(newList)
this.dataList = newList
if (this.menuType == 'group') {
this.dataList = data.data.list
} else {
this.dataList = newList
}
this.groupDataList = fullCopy(data.data.list)
this.totalDataList = fullCopy(newList)
this.isspinning = false
}
},
toFixed(value) {
return toFixed(value)
},
@ -1183,7 +1208,7 @@ td:empty:before {
}
}
/deep/.searchinput {
width: 326px;
width: 320px;
// margin-bottom: 16px;
position: relative;
}

@ -389,7 +389,7 @@ i {
font-size: 14px;
}
.f16 {
font-size: 16px;
font-size: 16px !important;
}
.f18 {
font-size: 18px;
@ -403,6 +403,9 @@ i {
.f24 {
font-size: 24px;
}
.f26 {
font-size: 26px;
}
.f32 {
font-size: 32px !important;
}
@ -471,7 +474,7 @@ i {
.svg_icon {
width: 1em;
height: 1em;
fill: currentColor;
// fill: currentColor;
overflow: hidden;
display: inline-block;
vertical-align: middle;
@ -481,7 +484,19 @@ i {
font-weight: normal;
margin-right: 2px;
}
.svg {
width: 1em;
height: 1em;
// fill: currentColor;
overflow: hidden;
display: inline-block;
vertical-align: middle;
// min-width: 30px;
text-align: center;
// font-size: 20px;
font-weight: normal;
margin-right: 2px;
}
// 公用样式类名
.w {
width: 1200px;

File diff suppressed because it is too large Load Diff

@ -11,7 +11,7 @@
<use xlink:href="#icon-bocai1" />
</svg>
<!-- <router-link :to="{name:'home'}"><img src="http://matripeweb.oss-cn-hangzhou.aliyuncs.com/antd/adminLogo.svg" alt=""> -->
<h1>商家管理后台</h1>
<h1>稻田商家后台</h1>
<!-- style="position: relative;top: -1px;" -->
</router-link>
</div>

Loading…
Cancel
Save