bibi 3 years ago
parent e015cae8e5
commit a74ef209ab

@ -0,0 +1,10 @@
import httpService from "@/request"
// 获取预报列表
export function forecastList(params) {
return httpService({
url: `/order/forecast/lists`,
method: 'post',
data: params,
})
}

@ -0,0 +1,39 @@
<template>
<div>
<a-button type="primary" @click="showDrawer">
<a-icon type="plus" /> New account
</a-button>
<a-drawer
title="抽屉"
:width="720"
:visible="visible"
:body-style="{ paddingBottom: '80px' }"
@close="onClose"
>
<div class="drawer-content"></div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="onClose">
关闭
</a-button>
<a-button type="primary" @click="onClose"> </a-button>
</div>
</a-drawer>
</div>
</template>
<script>
export default {
data() {
return {
visible: false,
};
},
methods: {
showDrawer() {
this.visible = true;
},
onClose() {
this.visible = false;
},
},
};
</script>

@ -4,6 +4,7 @@
<!-- 批量操作 --> <!-- 批量操作 -->
<a-select <a-select
type="primary" type="primary"
v-model="activeAction"
:disabled="!hasSelected" :disabled="!hasSelected"
:loading="loading" :loading="loading"
style="width: 120px" style="width: 120px"
@ -55,6 +56,18 @@ export default {
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
}, },
activeAction:undefined,
/**
*
*
* customRender: function (gender) {
if (gender === 1) {
return "是";
} else {
return "否";
}
},
*/
loading: false, loading: false,
// index // index
selectedRowKeys: [], selectedRowKeys: [],
@ -71,6 +84,7 @@ export default {
columns: Array, columns: Array,
tableData: Array, tableData: Array,
ActionsList: Array, ActionsList: Array,
// activeAction:Number
}, },
methods: { methods: {
// selection // selection
@ -85,6 +99,7 @@ export default {
// //
Actions(val) { Actions(val) {
this.$emit("Actions", val); this.$emit("Actions", val);
this.activeAction = undefined
}, },
}, },
}; };

@ -36,6 +36,7 @@ httpService.interceptors.request.use(config => {
const rqParams = filterRequestData(config.params); const rqParams = filterRequestData(config.params);
const rqData = filterRequestData(config.data); const rqData = filterRequestData(config.data);
// post 'Content-Type' === 'application/x-www-form-urlencoded' // post 'Content-Type' === 'application/x-www-form-urlencoded'
// manage-login-token
config.headers['Content-Type'] = 'application/x-www-form-urlencoded' config.headers['Content-Type'] = 'application/x-www-form-urlencoded'
if(config.method === 'post') { if(config.method === 'post') {
config.data = qs.stringify(rqData); config.data = qs.stringify(rqData);

@ -1,11 +1,4 @@
/*
* @Author: your name
* @Date: 2021-11-24 14:45:04
* @LastEditTime: 2021-11-24 15:27:01
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /LittleBeeSaas/src/router/basic.js
*/
export default [ export default [
{ {
path: '/Console', path: '/Console',
@ -13,82 +6,113 @@ export default [
title: "控制台", title: "控制台",
hide: false, hide: false,
icon: 'container', icon: 'container',
component: resolve => require(['@/views/Console'], resolve), component: resolve => require(['@/views/Basic/Console'], resolve),
meta: {title: '控制台'} meta: {title: '控制台'}
}, },
{ {
path: '/Employee', path: '/Employee',
name: "Employee", name: "Employee",
title: "员工管理", title: "员工管理",
icon: 'database', icon: 'team',
hide: false, hide: false,
component: resolve => require(['@/views/Employee'], resolve), component: resolve => require(['@/views/Basic/Employee'], resolve),
meta: {title: '员工管理'} meta: {title: '员工管理'}
}, },
{ {
path: '/authority', path: '/authority',
name: "Authority", name: "Authority",
title: "权限管理", title: "权限管理",
icon: 'profile', icon: 'appstore',
hide: false, hide: false,
component: resolve => require(['@/views/Authority'], resolve), component: resolve => require(['@/views/Basic/Authority'], resolve),
meta: {title: '权限管理'}, meta: {title: '权限管理'},
children: [ children: [
{ {
path: '/Authority/_details', path: '/Authority/_details',
name: "Authority_details", name: "Authority_details",
title: "账单管理-详情", title: "账单管理-详情",
icon: 'profile', icon: 'profile',
hide: true, hide: true,
component: resolve => require(['@/views/Authority/_details'], resolve), component: resolve => require(['@/views/Basic/Authority/_details'], resolve),
meta: {title: '账单管理-详情'}, meta: {title: '账单管理-详情'},
} }
] ]
}, },
{
path: '/EstateInfo',
name: "EstateInfo",
title: "小区信息",
icon: 'home',
hide: false,
component: resolve => require(['@/views/Basic/EstateInfo'], resolve),
meta: {title: '小区信息'},
children: [
{
path: '/EstateInfo/BuildingManage',
name: "BuildingManage",
title: "楼栋管理",
hide: false,
component: resolve => require(['@/views/Basic/EstateInfo/_buildingManage'], resolve),
meta: {title: '楼栋管理'},
},
{
path: '/EstateInfo/HouseManage',
name: "HouseManage",
title: "房屋管理",
hide: false,
component: resolve => require(['@/views/Basic/EstateInfo/_houseManage'], resolve),
meta: {title: '房屋管理'},
},
{
path: '/EstateInfo/HouseHoldInfo',
name: "HouseHoldInfo",
title: "住户信息",
hide: false,
component: resolve => require(['@/views/Basic/EstateInfo/_houseHoldInfo'], resolve),
meta: {title: '住户信息'},
}
]
},
{ {
path: '/attendance', path: '/attendance',
name: "Attendance", name: "Attendance",
title: "考勤管理", title: "考勤管理",
icon: 'profile', icon: 'reconciliation',
hide: false, hide: false,
redirect: '/attendance/record', redirect: '/attendance/record',
component: resolve => require(['@/views/Attendance'], resolve), component: resolve => require(['@/views/Basic/Attendance'], resolve),
meta: {title: '考勤管理'}, meta: {title: '考勤管理'},
children: [ children: [
{ {
path: '/attendance/record', path: '/attendance/record',
name: "Attendance_record", name: "Attendance_record",
title: "考勤记录", title: "考勤记录",
icon: 'profile',
hide: false, hide: false,
component: resolve => require(['@/views/Attendance/_record'], resolve), component: resolve => require(['@/views/Basic/Attendance/_record'], resolve),
meta: {title: '考勤记录'}, meta: {title: '考勤记录'},
}, },
{ {
path: '/attendance/application', path: '/attendance/application',
name: "Attendance_application", name: "Attendance_application",
title: "申请记录", title: "申请记录",
icon: 'profile',
hide: false, hide: false,
component: resolve => require(['@/views/Attendance/_application'], resolve), component: resolve => require(['@/views/Basic/Attendance/application'], resolve),
meta: {title: '申请记录'}, meta: {title: '申请记录'},
}, },
{ {
path: '/attendance/attendanceteam', path: '/attendance/attendanceteam',
name: "Attendance_attendanceteam", name: "Attendance_attendanceteam",
title: "考勤小组", title: "考勤小组",
icon: 'profile',
hide: false, hide: false,
component: resolve => require(['@/views/Attendance/_attendanceteam'], resolve), component: resolve => require(['@/views/Basic/Attendance/_attendanceteam'], resolve),
meta: {title: '考勤小组'}, meta: {title: '考勤小组'},
}, },
{ {
path: '/attendance/scheduling', path: '/attendance/scheduling',
name: "Attendance_scheduling", name: "Attendance_scheduling",
title: "排班计划", title: "排班计划",
icon: 'profile',
hide: false, hide: false,
component: resolve => require(['@/views/Attendance/_scheduling'], resolve), component: resolve => require(['@/views/Basic/Attendance/_scheduling'], resolve),
meta: {title: '排班计划'}, meta: {title: '排班计划'},
}, },

@ -1,37 +1,66 @@
@import "./antd.less"; @import "./antd.less";
// 公共样式 // 公共样式
#app{ #app {
background: #E5E5E5; background: #E5E5E5;
} }
.content{
.content {
padding: 13px; padding: 13px;
} }
.main{
padding: 13px; .main {
padding : 13px;
background: #fff; background: #fff;
} }
.cardTitle{
border-left: 8px solid #205FBD; .cardTitle {
padding-left:10px; border-left : 8px solid #205FBD;
margin-left: 10px; padding-left : 10px;
margin-left : 10px;
margin-bottom: 10px; margin-bottom: 10px;
} }
#commonTable{
// 表格
#commonTable {
margin: 24px; margin: 24px;
} }
.search-box { .search-box {
margin: 30px; margin: 30px;
} }
.add-btn{
background-color: rgba(251, 101, 61, 1) !important;
color: rgba(255, 255, 255, 1) !important;
}
.footer { .footer {
height: 84px; height : 84px;
width: 100%; width : 100%;
background: #fff; background : #fff;
position: fixed; position : fixed;
bottom: 0; bottom : 0;
z-index: 999; z-index : 999;
line-height: 84px; line-height : 84px;
box-shadow: 0px -2px 4px 0px rgba(0, 0, 0, 0.35); box-shadow : 0px -2px 4px 0px rgba(0, 0, 0, 0.35);
border-radius: 4px 4px 0px 0px; border-radius: 4px 4px 0px 0px;
border: 1px solid #e8e8e8; border : 1px solid #e8e8e8;
left: 200px; left : 200px;
} }
// 抽屉
.drawer-content {
text-align: left;
}
.drawer-footer {
position : absolute;
right : 0;
bottom : 0;
width : 100%;
border-top: 1px solid #e9e9e9;
padding : 10px 16px;
background: #fff;
text-align: right;
z-index : 1;
}

@ -1,5 +1,5 @@
<template> <template>
<div>4r</div> <div></div>
</template> </template>
<script> <script>

@ -0,0 +1,14 @@
<template>
<div>application</div>
</template>
<script>
export default {
name:'application'
}
</script>
<style>
</style>

@ -1,5 +1,5 @@
<template> <template>
<div>d21</div> <router-view></router-view>
</template> </template>
<script> <script>

@ -0,0 +1,152 @@
<template>
<div>
<a-row>
<!-- 角色列表 -->
<a-col :span="5">
<div class="cardTitle">所有角色</div>
<a-collapse accordion>
<a-collapse-panel v-for="item,index in roleList" :key="index" :header="item.name">
<div v-for="rolechild,indexs in item.children" class='role-card' :key="indexs">
<span>{{rolechild.name}}</span>
<a-button type="link" icon="form"></a-button>
</div>
</a-collapse-panel>
</a-collapse>
</a-col>
<!-- 人员表格 -->
<a-col :span="19">
<commonTable
:columns="columns"
:tableData="tableData"
:ActionsList="ActionsList"
@handleTableChange="handleTableChange"
@Actions="Actions"
@selectionChoosed="selectionChoosed"
>
<template v-slot:actionBox="data">
<a href="javascript:;" @click="del(data)"></a>
<span style="margin: 5px">|</span>
<a href="javascript:;">删除</a>
</template>
</commonTable>
</a-col>
</a-row>
</div>
</template>
<script>
export default {
data() {
return {
tableChoosed: [],
roleList: [{ name: "管理角色",children:[{ name: "管理员"},{name:'部门经理'}] }, { name: "安保部" }],
//
pagination: {
current: 1,
total: 0,
pageSize: 10,
},
//
columns: [
{
title: "真实姓名",
dataIndex: "actualName",
width: "200",
},
{
title: "手机号",
dataIndex: "tel",
width: "200",
},
{
title: "角色",
dataIndex: "roleNameList",
width: "200",
customRender:function(roleNameList){
return roleNameList.toString();
}
},
{
title: "备注",
dataIndex: "remake",
width: "200",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
],
//
tableData: [
{ name: 1, roleNameList: ['点点3','212','点点'] },
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
],
ActionsList: [
{
label: "批量删除",
value: 1,
},
{
label: "批量导出",
value: 2,
},
],
};
},
methods: {
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
del(data) {
console.log(data);
},
Actions(data) {
console.log(data);
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
},
};
</script>
<style lang="less" scoped>
.role-card{
line-height: 30px;
font-size: 16px;
cursor: pointer;
border-bottom: 1px solid #d9d9d9;
margin-bottom: 10px;
display: flex;
justify-content: space-between;
}
</style>

@ -8,7 +8,7 @@
--> -->
<template> <template>
<div> <div>
11111
</div> </div>
</template> </template>

@ -0,0 +1,495 @@
<template>
<div class="main">
<a-row>
<!-- 组织架构 -->
<a-col :span="4" class="left-tree">
<a-input-search
style="margin-bottom: 8px"
placeholder="请输入搜索信息"
@change="onChange"
/>
<a-space>
<a-button type="link">+&nbsp;&nbsp;新建分组</a-button>
<a-button type="link" icon="form"> </a-button>
<a-button type="link" style="color:#FF4D4F" icon="delete" @click="del()"> </a-button>
</a-space>
<a-tree
checkable
v-model="checkedKeys"
:expanded-keys="expandedKeys"
:auto-expand-parent="autoExpandParent"
:selected-keys="selectedKeys"
:tree-data="treeData"
@expand="onExpand"
@select="onSelect"
/>
</a-col>
<!-- right 员工 -->
<a-col :span="20">
<div class="search-box">
<a-space size="large">
<a-input placeholder="请输入申请人/公司名" />
<a-select style="width: 200px" placeholder="选择状态" />
<a-button type="primary"> </a-button>
<a-button> </a-button>
</a-space>
</div>
<!-- 表格 -->
<div id="commonTable">
<div style="margin-bottom: 16px">
<a-space size="large">
<a-button type="primary" :loading="loading" @click="addStaff()">
新增员工
</a-button>
<a-button :disabled="!hasSelected" :loading="loading">
批量操作
</a-button>
</a-space>
<span style="margin-left: 8px">
<template v-if="hasSelected">
{{ `已选择 ${selectedRowKeys.length}` }}
</template>
</span>
</div>
<a-table
:scroll="{ x: 1300 }"
:columns="columns"
:data-source="tableData"
:pagination="pagination"
@change="handleTableChange"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
:row-key="
(record, index) => {
return index;
}
"
>
<!-- 操作 -->
<span slot="action" slot-scope="scope">
<a @click="detail(scope)"></a>
<span style="margin: 5px">|</span>
<a-switch size="small"></a-switch>
<span style="margin: 5px">|</span>
<a @click="detail(scope)"></a>
</span>
<span slot="formatter" slot-scope="scope">{{
scope === 1 ? "可" : ""
}}</span>
</a-table>
</div>
</a-col>
</a-row>
<!-- 添加员工信息 -->
<a-drawer
title="添加员工信息"
:width="720"
:visible="show.addStaffShow"
:body-style="{ paddingBottom: '80px' }"
@close="addStaffClose"
>
<div class="drawer-content">
<a-form-model
title='1d2'
layout='vertical'
ref="ruleForm"
:model="form"
:rules="rules"
:wrapper-col="{span:18}"
>
<div>基本信息</div>
<a-divider></a-divider>
<a-row>
<a-col :span='12'>
<a-form-model-item label="真实姓名" prop="actualName">
<a-input v-model="form.actualName" placeholder="请输入真实姓名"/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="性别" prop="sex">
<a-select v-model="form.sex" placeholder="请选择性别"></a-select>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="身份证号" prop="idCard">
<a-input v-model="form.idCard" placeholder="请输入身份证号"/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item ref="tel" label="手机号" prop="tel">
<a-input v-model="form.tel" placeholder="请输入身份证号" @blur="()=>{$refs.tel.onFieldBlur();}"/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="出生日期" prop="birthday">
<a-date-picker v-model="form.birthday"/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="密码" prop="password">
<a-input type="password" placeholder='不输入默认为手机号后6位' v-model="form.password"/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="电子邮箱" prop="email">
<a-input placeholder='请输入电子邮箱' v-model="form.email"/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="居住地址" prop="address">
<a-input placeholder='请输入居住地址' v-model="form.address"/>
</a-form-model-item>
</a-col>
<a-col>
<a-form-model-item label="">
<template>
上传身份证照片
<a-upload
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
list-type="picture-card"
:file-list="fileList"
@preview="handlePreview"
@change="handleChange"
>
<div v-if="fileList.length < 2">
<a-icon type="plus" />
<div class="ant-upload-text">
点击上传
</div>
</div>
</a-upload>
<span style='color:#00000073'>单张最多不超过4M最多上传2张支持JPG,PNG格式</span>
</template>
</a-form-model-item>
</a-col>
</a-row>
<div>入职信息</div>
<a-divider></a-divider>
<a-row>
<a-col :span='12'>
<a-form-model-item label="岗位" prop="address">
<a-select placeholder='请选择' v-model="form.address"/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="入职时间" prop="entryDate">
<a-date-picker placeholder='请选择入职时间' v-model="form.entryDate"/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="薪资" prop="salary">
<a-input placeholder='请输入薪资' v-model="form.salary"/>
</a-form-model-item>
</a-col>
<a-col :span='24'>
<div>上传资料</div>
<a-upload
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
list-type="picture"
:default-file-list="fileList"
>
<a-button> <a-icon type="upload" /> 点击上传 </a-button>
</a-upload>
<span style='color:#00000073'>支持上传PNGJPG,PDF文件</span>
</a-col>
</a-row>
<div style='margin-top:20px'>联系信息</div>
<a-divider></a-divider>
<a-row>
<a-col :span='12'>
<a-form-model-item label="紧急联系人" prop="emergencyContact">
<a-input placeholder='请输入紧急联系人' v-model="form.emergencyContact"/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="紧急联系电话" prop="emergencyContactNumber">
<a-input placeholder='请输入紧急联系电话' v-model="form.emergencyContactNumber"/>
</a-form-model-item>
</a-col>
<a-col :span='24'>
<a-form-model-item label="紧急联系地址" prop="emergencyContactAddress">
<a-input placeholder='请输入紧急联系地址' v-model="form.emergencyContactAddress"/>
</a-form-model-item>
</a-col>
</a-row>
<div>其他信息</div>
<a-divider></a-divider>
<a-row>
<a-col :span='12'>
<a-form-model-item label="婚姻状态" prop="maritalStatus">
<a-select placeholder='请选择婚姻状态' v-model="form.maritalStatus"/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="民族" prop="nation">
<a-select placeholder='请输入民族' v-model="form.nation"/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="政治面貌" prop="politicalOutlook">
<a-select placeholder='请选择政治面貌' v-model="form.politicalOutlook"/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="户口类型" prop="accountType">
<a-select placeholder='请选择类型' v-model="form.accountType"/>
</a-form-model-item>
</a-col>
<a-col :span='24'>
<a-form-model-item label="备注" prop="remake">
<a-textarea v-model="form.remake" placeholder="请输入备注"></a-textarea>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="addStaffClose">
关闭
</a-button>
<a-button type="primary" @click="addStaffClose"> </a-button>
</div>
</a-drawer>
</div>
</template>
<script>
function getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
const treeData = [
{
title: "0-0",
key: "0-0",
children: [
{
title: "0-0-0",
key: "0-0-0",
children: [
{ title: "0-0-0-0", key: "0-0-0-0" },
{ title: "0-0-0-1", key: "0-0-0-1" },
{ title: "0-0-0-2", key: "0-0-0-2" },
],
},
{
title: "0-0-1",
key: "0-0-1",
children: [
{ title: "0-0-1-0", key: "0-0-1-0" },
{ title: "0-0-1-1", key: "0-0-1-1" },
{ title: "0-0-1-2", key: "0-0-1-2" },
],
},
{
title: "0-0-2",
key: "0-0-2",
},
],
},
{
title: "0-1",
key: "0-1",
children: [
{ title: "0-1-0-0", key: "0-1-0-0" },
{ title: "0-1-0-1", key: "0-1-0-1" },
{ title: "0-1-0-2", key: "0-1-0-2" },
],
},
{
title: "0-2",
key: "0-2",
},
];
export default {
data() {
return {
previewVisible: false,
previewImage: '',
fileList: [
],
form: {
actualName: "",
sex: null,
idCard: "",
tel: "",
},
rules: {
actualName: [{ required: true, message: "请输入真实姓名", trigger: "blur" }],
sex: [{ required: true, message: "请选择性别", trigger: "change" }],
idCard: [{ required: true, message: "请输入身份证号", trigger: "blur" }],
tel: [
{ required: true, message: "请输入手机号", trigger: "blur" },
{ min: 11, max: 11, message: "手机号只能为11位", trigger: "blur" },
],
},
show: {
addStaffShow: false,
},
expandedKeys: [],
autoExpandParent: true,
checkedKeys: [],
selectedKeys: [],
treeData,
//
searchForm: {
name: "",
code: "",
},
//
columns: [
{
title: "真实名称",
dataIndex: "actualName",
width: "200",
},
{
title: "手机号",
dataIndex: "tel",
width: "200",
},
{
title: "所属部门",
dataIndex: "departmentName",
width: "200",
},
{
title: "岗位",
dataIndex: "positionName",
width: "200",
},
{
title: "备注",
dataIndex: "remake",
width: "300",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
],
//
tableData: [],
//
pagination: {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
},
loading: false,
selectedRowKeys: [],
};
},
methods: {
//
del() {
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "",
onOk: function () {
console.log(1);
},
});
},
//
addStaff() {
this.show.addStaffShow = true;
},
onSubmit() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
alert("submit!");
} else {
console.log("error submit!!");
return false;
}
});
},
resetForm() {
this.$refs.ruleForm.resetFields();
},
addStaffClose() {
this.show.addStaffShow = false;
},
onExpand(expandedKeys) {
console.log("onExpand", expandedKeys);
// if not set autoExpandParent to false, if children expanded, parent can not collapse.
// or, you can remove all expanded children keys.
this.expandedKeys = expandedKeys;
this.autoExpandParent = false;
},
onCheck(checkedKeys) {
console.log("onCheck", checkedKeys);
this.checkedKeys = checkedKeys;
},
onSelect(selectedKeys, info) {
console.log("onSelect", info);
this.selectedKeys = selectedKeys;
},
detail(data) {
console.log(data);
this.$router.push({ name: "settle_detail" });
},
onSelectChange(selectedRowKeys) {
console.log("selectedRowKeys changed: ", selectedRowKeys);
this.selectedRowKeys = selectedRowKeys;
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
onChange() {},
handleCancel() {
this.previewVisible = false;
},
async handlePreview(file) {
if (!file.url && !file.preview) {
file.preview = await getBase64(file.originFileObj);
}
this.previewImage = file.url || file.preview;
this.previewVisible = true;
},
handleChange({ fileList }) {
this.fileList = fileList;
},
},
computed: {
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
watch: {
checkedKeys(val) {
console.log("onCheck", val);
},
},
};
</script>
<style lang="less" scoped>
.left-tree {
padding: 10px;
border-right: 1px solid #0000000f;
height: 100vh;
}
#commonTable {
padding: 10px;
}
</style>

@ -0,0 +1,229 @@
<template>
<div>
<div class="cardTitle">楼栋管理</div>
<div class="search-box">
<a-row>
<a-col :span='20'>
<a-space size="large">
<a-input placeholder="请输入楼栋名称" />
<a-button type="primary"> </a-button>
<a-button> </a-button>
</a-space>
</a-col>
<a-col :span='4'>
<a-button class="add-btn" @click="addBuilding"></a-button>
</a-col>
</a-row>
</div>
<commonTable
:columns="columns"
:tableData="tableData"
:ActionsList="ActionsList"
@handleTableChange="handleTableChange"
@Actions="Actions"
@selectionChoosed="selectionChoosed"
>
<template v-slot:actionBox="data">
<a href="javascript:;" @click="del(data)"></a>
<span style="margin: 5px">|</span>
<a href="javascript:;">删除</a>
</template>
</commonTable>
<!-- 添加 -->
<a-drawer
:title="drawerConfig.title"
:width="720"
:visible="drawerConfig.addShow"
:body-style="{ paddingBottom: '80px' }"
@close="addClose"
>
<div class="drawer-content">
楼栋信息
<a-divider></a-divider>
<a-form-model
layout='vertical'
ref="ruleForm"
:model="form"
:rules="rules"
>
<a-form-model-item label="楼栋号" prop="name">
<a-input v-model="form.name" placeholder='请输入楼栋号' style="width:50%"/>
</a-form-model-item>
<a-form-model-item label='上传照片' style="width:70%" prop='fileList'>
<a-upload
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
list-type="picture"
:default-file-list="fileList"
>
<a-button> <a-icon type="upload" /> 点击上传 </a-button>
</a-upload>
</a-form-model-item>
</a-form-model>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="addClose">
关闭
</a-button>
<a-button type="primary" @click="addClose"> </a-button>
</div>
</a-drawer>
</div>
</template>
<script>
export default {
data() {
return {
drawerConfig:{
addShow:false,
detailShow:false,
title:'添加楼栋',
},
form:{
name:''
},
rules:{
name:[{required:true,message:'请输入楼栋',trigger:'blur'}],
fileList:[{required:true,message:'请上传文件'}]
},
fileList: [
{
uid: '-1',
name: 'xxx.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
thumbUrl: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-2',
name: 'yyy.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
thumbUrl: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
],
tableChoosed: [],
//
pagination: {
current: 1,
total: 0,
pageSize: 10,
},
//
columns: [
{
title: "楼栋名称",
dataIndex: "name",
width: "200",
},
{
title: "房屋总数",
dataIndex: "estateTotals",
width: "200",
},
{
title: "租赁房屋数",
dataIndex: "leaseEstateNums",
width: "200"
},
{
title: "租赁率",
dataIndex: "leaseRate",
width: "200",
customRender:function(leaseRate){
return leaseRate+'%'
}
},
{
title: "入住率",
dataIndex: "occupancyRate",
width: "200",
customRender:function(occupancyRate){
return occupancyRate+'%'
}
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
],
//
tableData: [
{ name: 1, roleNameList: ['点点3','212','点点'] },
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
],
ActionsList: [
{
label: "批量删除",
value: 1,
},
{
label: "批量导出",
value: 2,
},
],
};
},
methods: {
addBuilding(){
this.drawerConfig.addShow = true
},
addClose(){
this.drawerConfig.addShow = false
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
del(data) {
console.log(data);
},
Actions(data) {
console.log(data);
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
},
};
</script>
<style lang="less" scoped>
.role-card{
line-height: 30px;
font-size: 16px;
cursor: pointer;
border-bottom: 1px solid #d9d9d9;
margin-bottom: 10px;
display: flex;
justify-content: space-between;
}
</style>

@ -1,19 +1,20 @@
<template> <template>
<div> <div>
<commonTable <!-- 人员表格 -->
:columns="columns" <commonTable
:tableData="tableData" :columns="columns"
:ActionsList="ActionsList" :tableData="tableData"
@handleTableChange="handleTableChange" :ActionsList="ActionsList"
@Actions="Actions" @handleTableChange="handleTableChange"
@selectionChoosed="selectionChoosed" @Actions="Actions"
> @selectionChoosed="selectionChoosed"
<template v-slot:actionBox="data"> >
<a href="javascript:;" @click="del(data)">del</a> <template v-slot:actionBox="data">
<span style="margin: 5px">|</span> <a href="javascript:;" @click="del(data)"></a>
<a href="javascript:;">detail</a> <span style="margin: 5px">|</span>
</template> <a href="javascript:;">删除</a>
</commonTable> </template>
</commonTable>
</div> </div>
</template> </template>
@ -31,56 +32,26 @@ export default {
// //
columns: [ columns: [
{ {
title: "Name", title: "真实姓名",
dataIndex: "name", dataIndex: "actualName",
width: "200", width: "200",
}, },
{ {
title: "Gender", title: "手机号",
dataIndex: "gender", dataIndex: "tel",
width: "200", width: "200",
customRender: function (gender) {
if (gender === 1) {
return "是";
} else {
return "否";
}
},
}, },
{ {
title: "Gender1", title: "角色",
dataIndex: "gender1", dataIndex: "roleNameList",
width: "200", width: "200",
customRender:function(roleNameList){
return roleNameList.toString();
}
}, },
{ {
title: "Gender2", title: "备注",
dataIndex: "gender2", dataIndex: "remake",
width: "200",
},
{
title: "Gender3",
dataIndex: "gender3",
width: "200",
},
{
title: "Gender4",
dataIndex: "gender4",
width: "200",
},
{
title: "Gender5",
dataIndex: "gender5",
width: "200",
},
{
title: "Gender6",
dataIndex: "gender6",
width: "200",
},
{
title: "status",
dataIndex: "status",
width: "200", width: "200",
}, },
{ {
@ -94,7 +65,7 @@ export default {
], ],
// //
tableData: [ tableData: [
{ name: 1, gender: 1 }, { name: 1, roleNameList: ['点点3','212','点点'] },
{}, {},
{}, {},
{}, {},
@ -145,11 +116,20 @@ export default {
}, },
selectionChoosed(data) { selectionChoosed(data) {
console.log(data); console.log(data);
this.tableChoosed = data this.tableChoosed = data;
}, },
}, },
}; };
</script> </script>
<style> <style lang="less" scoped>
.role-card{
line-height: 30px;
font-size: 16px;
cursor: pointer;
border-bottom: 1px solid #d9d9d9;
margin-bottom: 10px;
display: flex;
justify-content: space-between;
}
</style> </style>

@ -0,0 +1,13 @@
<template>
<router-view></router-view>
</template>
<script>
export default {
}
</script>
<style>
</style>

@ -1,278 +0,0 @@
<template>
<div class="main">
<a-row>
<a-col :span="4" class="left-tree">
<a-input-search
style="margin-bottom: 8px"
placeholder="请输入搜索信息"
@change="onChange"
/>
<a-tree
v-model="checkedKeys"
checkable
:expanded-keys="expandedKeys"
:auto-expand-parent="autoExpandParent"
:selected-keys="selectedKeys"
:tree-data="treeData"
@expand="onExpand"
@select="onSelect"
/>
</a-col>
<a-col :span="20">
<div class="search-box">
<a-space size="large">
<a-input placeholder="请输入申请人/公司名" />
<a-select style="width: 200px" placeholder="选择状态" />
<a-button type="primary"> </a-button>
<a-button> </a-button>
</a-space>
</div>
<!-- 表格 -->
<div id="commonTable">
<div style="margin-bottom: 16px">
<a-space size="large">
<a-button type="primary" :loading="loading"> 新增员工 </a-button>
<a-button :disabled="!hasSelected" :loading="loading">
批量操作
</a-button>
</a-space>
<span style="margin-left: 8px">
<template v-if="hasSelected">
{{ `已选择 ${selectedRowKeys.length}` }}
</template>
</span>
</div>
<a-table
:scroll="{ x: 1300 }"
:columns="columns"
:data-source="tableData"
:pagination="pagination"
@change="handleTableChange"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
:row-key="
(record, index) => {
return index;
}
"
>
<!-- 操作 -->
<span slot="action" slot-scope="scope">
<a @click="detail(scope)"></a>
<span style="margin: 5px">|</span>
<a-switch size="small"></a-switch>
<span style="margin: 5px">|</span>
<a @click="detail(scope)"></a>
</span>
<span slot="formatter" slot-scope="scope">{{
scope === 1 ? "可" : ""
}}</span>
</a-table>
</div>
</a-col>
</a-row>
</div>
</template>
<script>
const treeData = [
{
title: "0-0",
key: "0-0",
children: [
{
title: "0-0-0",
key: "0-0-0",
children: [
{ title: "0-0-0-0", key: "0-0-0-0" },
{ title: "0-0-0-1", key: "0-0-0-1" },
{ title: "0-0-0-2", key: "0-0-0-2" },
],
},
{
title: "0-0-1",
key: "0-0-1",
children: [
{ title: "0-0-1-0", key: "0-0-1-0" },
{ title: "0-0-1-1", key: "0-0-1-1" },
{ title: "0-0-1-2", key: "0-0-1-2" },
],
},
{
title: "0-0-2",
key: "0-0-2",
},
],
},
{
title: "0-1",
key: "0-1",
children: [
{ title: "0-1-0-0", key: "0-1-0-0" },
{ title: "0-1-0-1", key: "0-1-0-1" },
{ title: "0-1-0-2", key: "0-1-0-2" },
],
},
{
title: "0-2",
key: "0-2",
},
];
export default {
data() {
return {
expandedKeys: ["0-0-0", "0-0-1"],
autoExpandParent: true,
checkedKeys: ["0-0-0"],
selectedKeys: [],
treeData,
//
searchForm: {
name: "",
code: "",
},
//
columns: [
{
title: "Name",
dataIndex: "name",
width: "200",
},
{
title: "Gender",
dataIndex: "gender",
width: "200",
},
{
title: "Gender1",
dataIndex: "gender1",
width: "200",
},
{
title: "Gender2",
dataIndex: "gender2",
width: "200",
},
{
title: "Gender3",
dataIndex: "gender3",
width: "200",
},
{
title: "Gender4",
dataIndex: "gender4",
width: "200",
},
{
title: "Gender5",
dataIndex: "gender5",
width: "200",
},
{
title: "Gender6",
dataIndex: "gender6",
width: "200",
},
{
title: "status",
dataIndex: "status",
scopedSlots: { customRender: "formatter" },
width: "200",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
],
//
tableData: [
{
name: "11",
id: 1,
status: 1,
},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
],
//
pagination: {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
},
loading: false,
selectedRowKeys: [],
};
},
computed: {
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
watch: {
checkedKeys(val) {
console.log("onCheck", val);
},
},
methods: {
onExpand(expandedKeys) {
console.log("onExpand", expandedKeys);
// if not set autoExpandParent to false, if children expanded, parent can not collapse.
// or, you can remove all expanded children keys.
this.expandedKeys = expandedKeys;
this.autoExpandParent = false;
},
onCheck(checkedKeys) {
console.log("onCheck", checkedKeys);
this.checkedKeys = checkedKeys;
},
onSelect(selectedKeys, info) {
console.log("onSelect", info);
this.selectedKeys = selectedKeys;
},
detail(data) {
console.log(data);
this.$router.push({ name: "settle_detail" });
},
onSelectChange(selectedRowKeys) {
console.log("selectedRowKeys changed: ", selectedRowKeys);
this.selectedRowKeys = selectedRowKeys;
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
onChange(){}
},
};
</script>
<style lang="less" scoped>
.left-tree {
padding: 10px;
border-right: 1px solid #0000000f;
height: 100vh;
}
#commonTable {
padding: 10px;
}
</style>
Loading…
Cancel
Save