bibi 3 years ago
parent 4a45b396f2
commit 1f4f15d0a7

@ -0,0 +1,24 @@
module.exports = {
"env": {
"browser": true,
"es6": true
},
"extends": [
"plugin:vue/essential",
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"vue"
],
"rules": {
indent: ['error', 'tab'],
'no-console': 'off',
}
};

@ -1,5 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
presets: [
'@vue/cli-plugin-babel/preset'
]
}

25723
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -22,7 +22,7 @@
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint": "^6.8.0",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
},

@ -17,12 +17,12 @@
<script>
import zhCN from "ant-design-vue/lib/locale-provider/zh_CN";
export default {
name: 'App',
data() {
return {
locale: zhCN
};
},
name: 'App',
data() {
return {
locale: zhCN
};
},
}
</script>

@ -2,10 +2,10 @@ import httpService from "@/request"
// 工单
export function name(params) {
return httpService({
url: ` `,
method: 'get/post',
data: params,
})
return httpService({
url: ` `,
method: 'get/post',
data: params,
})
}

@ -2,89 +2,89 @@ import httpService from "@/request"
// 所有的组织架构
export function departmentList(params) {
return httpService({
url: `/user/department/list`,
method: 'get',
data: params,
})
return httpService({
url: `/user/department/list`,
method: 'get',
data: params,
})
}
// 添加组织
export function departmentInsert(params) {
return httpService({
url: `/user/department/insert`,
method: 'post',
data: params,
})
return httpService({
url: `/user/department/insert`,
method: 'post',
data: params,
})
}
// 组织删除
export function departmentDel(params) {
return httpService({
url: `/user/department/delete`,
method: 'post',
data: params,
})
return httpService({
url: `/user/department/delete`,
method: 'post',
data: params,
})
}
// 组织修改
export function departmentUpdate(params) {
return httpService({
url: `/user/department/update`,
method: 'post',
data: params,
})
return httpService({
url: `/user/department/update`,
method: 'post',
data: params,
})
}
// 组织员工
export function findToUser(params) {
return httpService({
url: `/user/department/findToUser`,
method: 'GET',
params: params,
})
return httpService({
url: `/user/department/findToUser`,
method: 'GET',
params: params,
})
}
// 新增员工
export function insertManageUser(params) {
return httpService({
url: `/user/manageUser/insertManageUser`,
method: 'post',
data: params,
})
return httpService({
url: `/user/manageUser/insertManageUser`,
method: 'post',
data: params,
})
}
// 上传身份证照片
export function uploadManageUserIdCard(params) {
return httpService({
url: `/user/upload/uploadManageUserIdCard`,
method: 'post',
data: params,
})
return httpService({
url: `/user/upload/uploadManageUserIdCard`,
method: 'post',
data: params,
})
}
// 员工info
export function manageUserInfo(params) {
return httpService({
url: `/user/manageUser/findById`,
method: 'GET',
params: params,
})
return httpService({
url: `/user/manageUser/findById`,
method: 'GET',
params: params,
})
}
// 员工edit
export function EditManageUser(params) {
return httpService({
url: `/user/manageUser/update`,
method: 'post',
data: params,
})
return httpService({
url: `/user/manageUser/update`,
method: 'post',
data: params,
})
}
// 员工开启关闭
export function userEnable(params) {
return httpService({
url: `/user/manageUser/isEnable`,
method: 'GET',
params: params,
})
return httpService({
url: `/user/manageUser/isEnable`,
method: 'GET',
params: params,
})
}
// 重置密码
export function rePassword(params) {
return httpService({
url: `/user/manageUser/rePassword`,
method: 'post',
data: params,
})
return httpService({
url: `/user/manageUser/rePassword`,
method: 'post',
data: params,
})
}

@ -2,17 +2,17 @@ import httpService from "@/request"
// 楼栋列表
export function buildingList(params) {
return httpService({
url: `/user/building/list`,
method: 'get',
params: params,
})
return httpService({
url: `/user/building/list`,
method: 'get',
params: params,
})
}
// 房屋列表
export function houseList(params) {
return httpService({
url: `/user/estate/list`,
method: 'get',
params: params,
})
return httpService({
url: `/user/estate/list`,
method: 'get',
params: params,
})
}

@ -9,25 +9,25 @@ import httpService from "@/request"
* 住户列表
*/
export function residentList(params) {
return httpService({
url: `/user/resident/list`,
method: 'get',
params: params,
})
return httpService({
url: `/user/resident/list`,
method: 'get',
params: params,
})
}
// 审核列表
export function reviewList(params) {
return httpService({
url: `/user/review/list`,
method: 'get',
params: params,
})
return httpService({
url: `/user/review/list`,
method: 'get',
params: params,
})
}
// 审核通过 不通过
export function review(params) {
return httpService({
url: `/user/review/review`,
method: 'post',
data: params,
})
return httpService({
url: `/user/review/review`,
method: 'post',
data: params,
})
}

@ -3,26 +3,26 @@ import httpService from "@/request"
// 权限 角色
// 角色列表
export function rolelist(params) {
return httpService({
url: `/user/role/list`,
method: 'get',
data: params,
})
return httpService({
url: `/user/role/list`,
method: 'get',
data: params,
})
}
// 角色-----员工列表
export function listByRole(params) {
return httpService({
url: `/user/role/listByRole`,
method: 'GET',
params: params,
})
return httpService({
url: `/user/role/listByRole`,
method: 'GET',
params: params,
})
}
// 查询当前角色下的所有的菜单权限信息 roleId
export function FindAllMenus(params) {
return httpService({
url: `/user/jurisdiction/findAllMenus`,
method: 'GET',
params: params,
})
return httpService({
url: `/user/jurisdiction/findAllMenus`,
method: 'GET',
params: params,
})
}

@ -2,18 +2,18 @@ import httpService from "@/request"
// 发送验证码
export function sendTelCode(params) {
return httpService({
url: `/sendTelCode`,
method: 'post',
data: params,
})
return httpService({
url: `/sendTelCode`,
method: 'post',
data: params,
})
}
// 登录
export function loginTel(params) {
return httpService({
url: `/loginTelCode`,
method: 'post',
data: params,
})
return httpService({
url: `/loginTelCode`,
method: 'post',
data: params,
})
}
// 退出登录

@ -19,18 +19,18 @@
</template>
<script>
export default {
data() {
return {
visible: false,
};
},
methods: {
showDrawer() {
this.visible = true;
},
onClose() {
this.visible = false;
},
},
data() {
return {
visible: false,
};
},
methods: {
showDrawer() {
this.visible = true;
},
onClose() {
this.visible = false;
},
},
};
</script>

@ -57,16 +57,16 @@
<script>
export default {
data() {
return {
//
pagination: {
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
},
activeAction:undefined,
/**
data() {
return {
//
pagination: {
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
},
activeAction:undefined,
/**
*
*
* customRender: function (gender) {
@ -77,43 +77,43 @@ export default {
}
},
*/
loading: false,
// index
selectedRowKeys: [],
};
},
computed: {
// selection
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
//
props: {
columns: Array,
tableData: Array,
ActionsList: Array,
// activeAction:Number
},
methods: {
// selection
selectionChoosed(selectedRowKeys, data) {
this.selectedRowKeys = selectedRowKeys;
this.$emit("selectionChoosed", data);
},
//
handleTableChange(val) {
this.$emit("handleTableChange", val);
},
//
Actions(val) {
this.$emit("Actions", val);
this.activeAction = undefined
},
formatter(val){
this.$emit("formatter", val);
}
},
loading: false,
// index
selectedRowKeys: [],
};
},
computed: {
// selection
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
//
props: {
columns: Array,
tableData: Array,
ActionsList: Array,
// activeAction:Number
},
methods: {
// selection
selectionChoosed(selectedRowKeys, data) {
this.selectedRowKeys = selectedRowKeys;
this.$emit("selectionChoosed", data);
},
//
handleTableChange(val) {
this.$emit("handleTableChange", val);
},
//
Actions(val) {
this.$emit("Actions", val);
this.activeAction = undefined
},
formatter(val){
this.$emit("formatter", val);
}
},
};
</script>

@ -19,14 +19,14 @@ Vue.use(Antd);
Vue.use(mixins);
import store from "@/store";
import router from "@/permission";
Vue.prototype.$baseUrl = process.env.VUE_APP_URL+'123456/manage'
Vue.prototype.$baseUrl = process.env.VUE_APP_URL + '123456/manage'
Vue.config.productionTip = false
import commonTable from './components/table'
// 注册组件
Vue.component('commonTable', commonTable)
new Vue({
render: h => h(App),
router,
store
render: h => h(App),
router,
store
}).$mount('#app')

@ -9,14 +9,14 @@
import { mapGetters, mapActions } from "vuex";
export default {
install(Vue) {
Vue.mixin({
computed: {
...mapGetters(['getToken','getSelectedKeys', 'getOpenKeys'])
},
methods: {
...mapActions(['setToken','setSelectedKeys', 'setOpenKeys'])
}
})
}
install(Vue) {
Vue.mixin({
computed: {
...mapGetters(['getToken','getSelectedKeys', 'getOpenKeys'])
},
methods: {
...mapActions(['setToken','setSelectedKeys', 'setOpenKeys'])
}
})
}
}

@ -6,17 +6,17 @@ import store from '@/store'
const whitePath = [ '/login']
// 判断登录
router.beforeEach((to, from, next) => {
NProgress.start()
const token = store.getters.getToken;
if(!token && !whitePath.includes(to.path)) {
next('/login');
} else {
next();
}
NProgress.start()
const token = store.getters.getToken;
if(!token && !whitePath.includes(to.path)) {
next('/login');
} else {
next();
}
})
router.afterEach(() => {
NProgress.done()
NProgress.done()
})
export default router

@ -13,80 +13,80 @@ import { message} from 'ant-design-vue'
import store from '@/store'
// import baseURL from "@/utils/baseURL"
function filterRequestData(obj) {
let o = {};
for(let key in obj) {
let b1 = obj[key] === 0;
let b2 = obj[key] === false;
if(obj[key] || b1 || b2) {
o[key] = obj[key]
}
}
return o;
let o = {};
for(let key in obj) {
let b1 = obj[key] === 0;
let b2 = obj[key] === false;
if(obj[key] || b1 || b2) {
o[key] = obj[key]
}
}
return o;
}
//创建axios的实例
const httpService = axios.create({
baseURL: process.env.VUE_APP_URL+'123456/manage',// TODO:具体的配置可以根据项目情况而来
timeout: 5000
baseURL: process.env.VUE_APP_URL+'123456/manage',// TODO:具体的配置可以根据项目情况而来
timeout: 5000
})
//axios的拦截--request
httpService.interceptors.request.use(config => {
const rqParams = filterRequestData(config.params);
const rqData = filterRequestData(config.data);
// post 'Content-Type' === 'application/x-www-form-urlencoded'
config.headers['Content-Type'] = "application/json";
config.headers['manage-login-token'] = store.getters.getToken;
// config.headers['device-type'] = "web";
if(config.method === 'post') {
config.data = rqData;
} else {
config.data = rqData;
config.params = rqParams;
}
return config;
const rqParams = filterRequestData(config.params);
const rqData = filterRequestData(config.data);
// post 'Content-Type' === 'application/x-www-form-urlencoded'
config.headers['Content-Type'] = "application/json";
config.headers['manage-login-token'] = store.getters.getToken;
// config.headers['device-type'] = "web";
if(config.method === 'post') {
config.data = rqData;
} else {
config.data = rqData;
config.params = rqParams;
}
return config;
},err => {
Promise.reject(err);// 请求错误处理
Promise.reject(err);// 请求错误处理
})
//4、axios的拦截--response
httpService.interceptors.response.use(response => {
// TODO:具体的code对应的处理可继续添加修改
// let data = null;
let msg = '';
let res = response.data;
// console.log(response);
if(res.code === 200){
// code = 200;
// data = res.data;
// msg = res.msg || "";
// console.log(msg);
// console.log(data);
return res;
} else if(res.code == 10010) {
router.replace({
path: '/login'
});
} else {
msg = res.msg || "";
message.error(msg);
return Promise.reject(new Error(msg))
}
// let data = null;
let msg = '';
let res = response.data;
// console.log(response);
if(res.code === 200){
// code = 200;
// data = res.data;
// msg = res.msg || "";
// console.log(msg);
// console.log(data);
return res;
} else if(res.code == 10010) {
router.replace({
path: '/login'
});
} else {
msg = res.msg || "";
message.error(msg);
return Promise.reject(new Error(msg))
}
},err => {
console.log(err)
console.log(err)
// TODO:具体的code对应的处理可继续添加修改
if(err.response.code === 301){
//登录过期跳转登录页面并将要浏览的页面fullPath传过去登录成功后跳转需要访问的页面 ---主页(index) 或者 退出到登录前的浏览的页面
//这样登录页面登录接口成功之后可以进行跳转 主页(index) 或者 退出到登录前的页面: let path = this.$route.query.redirect || '/index.js'; this.$router.push(path);
setTimeout(() => {
router.replace({
path: '/login',
query: {
redirect: router.currentRoute.fullPath
}
});
}, 1000);
}
return Promise.reject(err);
if(err.response.code === 301){
//登录过期跳转登录页面并将要浏览的页面fullPath传过去登录成功后跳转需要访问的页面 ---主页(index) 或者 退出到登录前的浏览的页面
//这样登录页面登录接口成功之后可以进行跳转 主页(index) 或者 退出到登录前的页面: let path = this.$route.query.redirect || '/index.js'; this.$router.push(path);
setTimeout(() => {
router.replace({
path: '/login',
query: {
redirect: router.currentRoute.fullPath
}
});
}, 1000);
}
return Promise.reject(err);
})
export default httpService

@ -1,138 +1,138 @@
export default [
{
path: '/Console',
name: "Console",
title: "控制台",
hide: false,
icon: 'container',
component: resolve => require(['@/views/Basic/Console'], resolve),
meta: {title: '控制台'}
},
{
path: '/Employee',
name: "Employee",
title: "员工管理",
icon: 'team',
hide: false,
component: resolve => require(['@/views/Basic/Employee'], resolve),
meta: {title: '员工管理'}
},
{
path: '/authority',
name: "Authority",
title: "权限管理",
icon: 'appstore',
hide: false,
component: resolve => require(['@/views/Basic/Authority'], resolve),
meta: {title: '权限管理'},
children: [
{
path: '/Authority/_details',
name: "Authority_details",
title: "账单管理-详情",
icon: 'profile',
hide: true,
component: resolve => require(['@/views/Basic/Authority/_details'], resolve),
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: '/EstateInfo/HouseHoldAudit',
name: "HouseHoldAudit",
title: "住户审核",
hide: false,
component: resolve => require(['@/views/Basic/EstateInfo/_houseHoldAudit'], resolve),
meta: {title: '住户审核'},
},
]
},
{
path: '/Workorder',
name: "Workorder",
title: "工单管理",
icon: 'solution',
hide: false,
component: resolve => require(['@/views/Basic/WorkOrder'], resolve),
meta: {title: '工单管理'}
},
// {
// path: '/attendance',
// name: "Attendance",
// title: "考勤管理",
// icon: 'reconciliation',
// hide: false,
// redirect: '/attendance/record',
// component: resolve => require(['@/views/Basic/Attendance'], resolve),
// meta: {title: '考勤管理'},
// children: [
// {
// path: '/attendance/record',
// name: "Attendance_record",
// title: "考勤记录",
// hide: false,
// component: resolve => require(['@/views/Basic/Attendance/_record'], resolve),
// meta: {title: '考勤记录'},
// },
// {
// path: '/attendance/application',
// name: "Attendance_application",
// title: "申请记录",
// hide: false,
// component: resolve => require(['@/views/Basic/Attendance/application'], resolve),
// meta: {title: '申请记录'},
// },
// {
// path: '/attendance/attendanceteam',
// name: "Attendance_attendanceteam",
// title: "考勤小组",
// hide: false,
// component: resolve => require(['@/views/Basic/Attendance/_attendanceteam'], resolve),
// meta: {title: '考勤小组'},
// },
// {
// path: '/attendance/scheduling',
// name: "Attendance_scheduling",
// title: "排班计划",
// hide: false,
// component: resolve => require(['@/views/Basic/Attendance/_scheduling'], resolve),
// meta: {title: '排班计划'},
// },
{
path: '/Console',
name: "Console",
title: "控制台",
hide: false,
icon: 'container',
component: resolve => require(['@/views/Basic/Console'], resolve),
meta: {title: '控制台'}
},
{
path: '/Employee',
name: "Employee",
title: "员工管理",
icon: 'team',
hide: false,
component: resolve => require(['@/views/Basic/Employee'], resolve),
meta: {title: '员工管理'}
},
{
path: '/authority',
name: "Authority",
title: "权限管理",
icon: 'appstore',
hide: false,
component: resolve => require(['@/views/Basic/Authority'], resolve),
meta: {title: '权限管理'},
children: [
{
path: '/Authority/_details',
name: "Authority_details",
title: "账单管理-详情",
icon: 'profile',
hide: true,
component: resolve => require(['@/views/Basic/Authority/_details'], resolve),
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: '/EstateInfo/HouseHoldAudit',
name: "HouseHoldAudit",
title: "住户审核",
hide: false,
component: resolve => require(['@/views/Basic/EstateInfo/_houseHoldAudit'], resolve),
meta: {title: '住户审核'},
},
]
},
{
path: '/Workorder',
name: "Workorder",
title: "工单管理",
icon: 'solution',
hide: false,
component: resolve => require(['@/views/Basic/WorkOrder'], resolve),
meta: {title: '工单管理'}
},
// {
// path: '/attendance',
// name: "Attendance",
// title: "考勤管理",
// icon: 'reconciliation',
// hide: false,
// redirect: '/attendance/record',
// component: resolve => require(['@/views/Basic/Attendance'], resolve),
// meta: {title: '考勤管理'},
// children: [
// {
// path: '/attendance/record',
// name: "Attendance_record",
// title: "考勤记录",
// hide: false,
// component: resolve => require(['@/views/Basic/Attendance/_record'], resolve),
// meta: {title: '考勤记录'},
// },
// {
// path: '/attendance/application',
// name: "Attendance_application",
// title: "申请记录",
// hide: false,
// component: resolve => require(['@/views/Basic/Attendance/application'], resolve),
// meta: {title: '申请记录'},
// },
// {
// path: '/attendance/attendanceteam',
// name: "Attendance_attendanceteam",
// title: "考勤小组",
// hide: false,
// component: resolve => require(['@/views/Basic/Attendance/_attendanceteam'], resolve),
// meta: {title: '考勤小组'},
// },
// {
// path: '/attendance/scheduling',
// name: "Attendance_scheduling",
// title: "排班计划",
// hide: false,
// component: resolve => require(['@/views/Basic/Attendance/_scheduling'], resolve),
// meta: {title: '排班计划'},
// },
// ]
// }
// ]
// }
]

@ -11,48 +11,48 @@ import Router from "vue-router"
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
return originalPush.call(this, location).catch(err => err)
}
Vue.use(Router);
import Layout from "@/views/Layout"
import basic from "./basic" // 基础功能
// import payment from "./payment" // 缴费管理
// import smartMall from "./smartMall" // 智慧商城
// import smartMall from "./smartMall" // 智慧商城
// import operation from "./operation" // 运营管理
import setting from "./setting" // 设置
const router = [
{
path: "/",
name: "basic",
title: "基础",
component: Layout,
redirect: '/Console',
meta: {title: '首页'},
children: [
...basic,
]
},
{
path: "/setting",
name: "setting",
title: "设置",
component: Layout,
redirect: '/basicSet',
meta: {title: '设置'},
children: [
...setting,
]
},
{
path: "/login",
name: "Login",
title: "登录",
component: resolve => require(['@/views/Login'], resolve)
}
{
path: "/",
name: "basic",
title: "基础",
component: Layout,
redirect: '/Console',
meta: {title: '首页'},
children: [
...basic,
]
},
{
path: "/setting",
name: "setting",
title: "设置",
component: Layout,
redirect: '/basicSet',
meta: {title: '设置'},
children: [
...setting,
]
},
{
path: "/login",
name: "Login",
title: "登录",
component: resolve => require(['@/views/Login'], resolve)
}
]
export default new Router({
routes: router
routes: router
})

@ -1,11 +1,11 @@
export default [
{
path: '/basicSet',
name: "basicSet",
title: "基础设置",
hide: false,
icon: 'container',
component: resolve => require(['@/views/Set/basicSet'], resolve),
meta: {title: '基础设置'}
},
{
path: '/basicSet',
name: "basicSet",
title: "基础设置",
hide: false,
icon: 'container',
component: resolve => require(['@/views/Set/basicSet'], resolve),
meta: {title: '基础设置'}
},
]

@ -7,15 +7,15 @@
* @FilePath: /ansu-business/src/store/actions.js
*/
const actions = {
setToken: ({commit}, log) => {
commit('setToken', log)
},
setSelectedKeys: ({commit}, log) => {
commit('setSelectedKeys', log)
},
setOpenKeys: ({commit}, log) => {
commit('setOpenKeys', log)
},
setToken: ({commit}, log) => {
commit('setToken', log)
},
setSelectedKeys: ({commit}, log) => {
commit('setSelectedKeys', log)
},
setOpenKeys: ({commit}, log) => {
commit('setOpenKeys', log)
},
}
export default actions

@ -7,15 +7,15 @@
* @FilePath: /ansu-business/src/store/getters.js
*/
const getters = {
getSelectedKeys(state) {
return state.selectedKeys
},
getOpenKeys(state) {
return state.openKeys
},
getToken(state) {
return state.token
},
getSelectedKeys(state) {
return state.selectedKeys
},
getOpenKeys(state) {
return state.openKeys
},
getToken(state) {
return state.token
},
}
export default getters

@ -14,10 +14,10 @@ import actions from "./actions";
import mutations from "./mutations";
import getters from "./getters";
import state from "./state";
const store = new Vuex.Store({
state,
actions,
mutations,
getters
const store = new Vuex.Store({
state,
actions,
mutations,
getters
})
export default store

@ -7,20 +7,20 @@
* @FilePath: /ansu-business/src/store/mutations.js
*/
const mutations = {
setSelectedKeys: (state, log) => {
state.selectedKeys = log;
let str = JSON.stringify(log);
sessionStorage.setItem('selectedKeys', str);
},
setOpenKeys: (state, log) => {
state.openKeys = log;
let str = JSON.stringify(log);
sessionStorage.setItem('openKeys', str);
},
setToken: (state, log) => {
state.token = log;
sessionStorage.setItem('token', log);
},
setSelectedKeys: (state, log) => {
state.selectedKeys = log;
let str = JSON.stringify(log);
sessionStorage.setItem('selectedKeys', str);
},
setOpenKeys: (state, log) => {
state.openKeys = log;
let str = JSON.stringify(log);
sessionStorage.setItem('openKeys', str);
},
setToken: (state, log) => {
state.token = log;
sessionStorage.setItem('token', log);
},
}
export default mutations

@ -7,8 +7,8 @@
* @FilePath: /ansu-business/src/store/state.js
*/
const state = {
selectedKeys: JSON.parse(sessionStorage.getItem('selectedKeys')) || ['/'],
openKeys: JSON.parse(sessionStorage.getItem('openKeys')) || [],
token: sessionStorage.getItem('token') || ""
selectedKeys: JSON.parse(sessionStorage.getItem('selectedKeys')) || ['/'],
openKeys: JSON.parse(sessionStorage.getItem('openKeys')) || [],
token: sessionStorage.getItem('token') || ""
}
export default state

@ -11,7 +11,7 @@
line-height: 1 !important;
}
.ant-menu {
background: #2a334f !important;
background: #2a334f !important;
}
.ant-menu-inline {
border-right: 1px solid transparent !important;

@ -1,31 +1,32 @@
export default {
install: function (Vue) {
Vue.prototype.ImgUrl = (src) => {
return process.env.VUE_APP_CDN + src
}
Vue.prototype.formatDate = (time, fmt) => {
if (time > 0) {
let date = new Date(time * 1000)
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
}
let o = {
'M+': date.getMonth() + 1,
'd+': date.getDate(),
'h+': date.getHours(),
'm+': date.getMinutes(),
's+': date.getSeconds()
}
for (let k in o) {
if (new RegExp(`(${k})`).test(fmt)) {
let str = o[k] + ''
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : ('00' + str).substr(str.length))
}
}
return fmt
} else {
return ''
}
}
}
install: function (Vue) {
Vue.prototype.$upload = process.env.VUE_APP_URL + 'user/upload/uploadTestMinioImg'
Vue.prototype.ImgUrl = (src) => {
return process.env.VUE_APP_STATIC + src
}
Vue.prototype.formatDate = (time, fmt) => {
if (time > 0) {
let date = new Date(time * 1000)
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
}
let o = {
'M+': date.getMonth() + 1,
'd+': date.getDate(),
'h+': date.getHours(),
'm+': date.getMinutes(),
's+': date.getSeconds()
}
for (let k in o) {
if (new RegExp(`(${k})`).test(fmt)) {
let str = o[k] + ''
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : ('00' + str).substr(str.length))
}
}
return fmt
} else {
return ''
}
}
}
}

@ -14,7 +14,7 @@
<script>
export default {
name: "Billing_details"
name: "Billing_details"
}
</script>

@ -3,49 +3,49 @@
* 表格列
*/
export const columns = [
{
title: "真实姓名",
dataIndex: "actualName",
width: "20%",
},
{
title: "手机号",
dataIndex: "tel",
width: "20%",
},
{
title: "角色",
dataIndex: "roleNameList",
width: "20%",
customRender: function (roleNameList) {
return roleNameList.toString();
},
},
{
title: "备注",
dataIndex: "remake",
width: "20%",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
{
title: "真实姓名",
dataIndex: "actualName",
width: "20%",
},
{
title: "手机号",
dataIndex: "tel",
width: "20%",
},
{
title: "角色",
dataIndex: "roleNameList",
width: "20%",
customRender: function (roleNameList) {
return roleNameList.toString();
},
},
{
title: "备注",
dataIndex: "remake",
width: "20%",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
// 搜索项
export const searchForm = {
roleId: null,
keyword: '',
roleId: null,
keyword: '',
}
// 分页
export const pagination = {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
}

@ -208,166 +208,166 @@
import { insertManageUser,departmentList,uploadManageUserIdCard } from "@/api/basic/department";
import store from "@/store";
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);
});
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = (error) => reject(error);
});
}
export default {
name: "Vueform",
props: {
type: {
type: String,
default: "add",
},
},
watch: {
type: {
handler(val) {
if (val === "edit") {
console.log(1);
}
},
immediate: true,
},
},
data() {
return {
previewVisible: false,
previewImage: "",
treeData:[],
cascVal:[],
uploadHeaders: {
"manage-login-token": store.getters.getToken,
'Content-Type': 'multipart/form-data'
},
sexOption: [
{
id: 1,
name: "男",
},
{
id: 2,
name: "女",
},
{
id: 3,
name: "保密",
},
],
form: {
actualName: "",
sex: null,
idCard: "",
tel: "",
birthday: "",
password: "",
email: "",
address: "",
idCardImgUrls: "",
departmentId: "",
departmentIdPath: "",
positionId: "",
entryDate: "",
salary: "",
dataImgUrls: "",
emergencyContact: "",
emergencyContactNumber: "",
emergencyContactAddress: "",
maritalStatus: "",
nation: "",
politicalOutlook: "",
accountType: "",
remake: "",
},
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" },
],
entryDate: [
{ required: true, message: "请选择入职时间", trigger: "change" },
],
},
fileList: [],
};
},
created() {
this.getData()
},
methods: {
getData(){
departmentList().then((res) => {
this.treeData = res.data;
});
},
//
submit() {
this.$refs.ruleForm.validate((valid) => {
if (!valid) {
return;
}
if (this.type === "add") {
insertManageUser(this.form).then((res) => {
if(res.code===200){
this.$message.success(res.msg)
this.success()
this.close()
}
});
} else {
console.log(1);
}
});
},
//
close() {
this.$refs.ruleForm.resetFields();
this.cascVal=[]
},
success(){
this.$emit('success')
},
async handlePreview(file) {
if (!file.url && !file.preview) {
file.preview = await getBase64(file.originFileObj);
}
this.previewImage = file.url || file.preview;
this.previewVisible = true;
},
onChange(data) {
// data [1,2,2]
// yyyy-mm-dd hh:mm:ss
let _data = JSON.parse(JSON.stringify(data))
this.form.positionId = _data.pop() //2
this.form.departmentId = _data[_data.length-1] //[1,2]==>2
let str = ''
// 1:2:
for (let i = 0; i < _data.length; i++) {
str += _data[i]+':'
}
// 0:1:2:
this.form.departmentIdPath = '0:'+ str
},
handleCancel() {
this.previewVisible = false;
},
handleChange({ fileList }) {
this.fileList = fileList;
},
u1pload(){
uploadManageUserIdCard().then((res) => {console.log(res);})
}
},
name: "Vueform",
props: {
type: {
type: String,
default: "add",
},
},
watch: {
type: {
handler(val) {
if (val === "edit") {
console.log(1);
}
},
immediate: true,
},
},
data() {
return {
previewVisible: false,
previewImage: "",
treeData:[],
cascVal:[],
uploadHeaders: {
"manage-login-token": store.getters.getToken,
'Content-Type': 'multipart/form-data'
},
sexOption: [
{
id: 1,
name: "男",
},
{
id: 2,
name: "女",
},
{
id: 3,
name: "保密",
},
],
form: {
actualName: "",
sex: null,
idCard: "",
tel: "",
birthday: "",
password: "",
email: "",
address: "",
idCardImgUrls: "",
departmentId: "",
departmentIdPath: "",
positionId: "",
entryDate: "",
salary: "",
dataImgUrls: "",
emergencyContact: "",
emergencyContactNumber: "",
emergencyContactAddress: "",
maritalStatus: "",
nation: "",
politicalOutlook: "",
accountType: "",
remake: "",
},
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" },
],
entryDate: [
{ required: true, message: "请选择入职时间", trigger: "change" },
],
},
fileList: [],
};
},
created() {
this.getData()
},
methods: {
getData(){
departmentList().then((res) => {
this.treeData = res.data;
});
},
//
submit() {
this.$refs.ruleForm.validate((valid) => {
if (!valid) {
return;
}
if (this.type === "add") {
insertManageUser(this.form).then((res) => {
if(res.code===200){
this.$message.success(res.msg)
this.success()
this.close()
}
});
} else {
console.log(1);
}
});
},
//
close() {
this.$refs.ruleForm.resetFields();
this.cascVal=[]
},
success(){
this.$emit('success')
},
async handlePreview(file) {
if (!file.url && !file.preview) {
file.preview = await getBase64(file.originFileObj);
}
this.previewImage = file.url || file.preview;
this.previewVisible = true;
},
onChange(data) {
// data [1,2,2]
// yyyy-mm-dd hh:mm:ss
let _data = JSON.parse(JSON.stringify(data))
this.form.positionId = _data.pop() //2
this.form.departmentId = _data[_data.length-1] //[1,2]==>2
let str = ''
// 1:2:
for (let i = 0; i < _data.length; i++) {
str += _data[i]+':'
}
// 0:1:2:
this.form.departmentIdPath = '0:'+ str
},
handleCancel() {
this.previewVisible = false;
},
handleChange({ fileList }) {
this.fileList = fileList;
},
u1pload(){
uploadManageUserIdCard().then((res) => {console.log(res);})
}
},
};
</script>

@ -49,99 +49,99 @@
import {columns,pagination,searchForm} from './config.js'
import { rolelist,FindAllMenus } from "@/api/basic/role";
export default {
data() {
return {
tableChoosed: [],
roleList: [],
//
pagination: pagination,
//
columns: columns,
searchForm:searchForm,
expandedKeys: [],
replaceFields: {
children: 'childrenList',
title: 'name',
key: 'id',
},
autoExpandParent: true,
checkedKeys: [],
selectedKeys: [],
//
tableData: [],
ActionsList: [ ],
menus:[]
};
},
mounted() {
this.getData();
},
methods: {
getData() {
rolelist().then((res) => {
this.roleList = res.data;
});
},
rolechange(data){
if(data){
this.searchForm.roleId = this.roleList[data].id
FindAllMenus({roleId:this.searchForm.roleId}).then(res=>{
this.menus = res.data
})
data() {
return {
tableChoosed: [],
roleList: [],
//
pagination: pagination,
//
columns: columns,
searchForm:searchForm,
expandedKeys: [],
replaceFields: {
children: 'childrenList',
title: 'name',
key: 'id',
},
autoExpandParent: true,
checkedKeys: [],
selectedKeys: [],
//
tableData: [],
ActionsList: [ ],
menus:[]
};
},
mounted() {
this.getData();
},
methods: {
getData() {
rolelist().then((res) => {
this.roleList = res.data;
});
},
rolechange(data){
if(data){
this.searchForm.roleId = this.roleList[data].id
FindAllMenus({roleId:this.searchForm.roleId}).then(res=>{
this.menus = res.data
})
}else{
this.searchForm.roleId = null
}
},
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;
},
reset(){
this.searchForm.keyword =''
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
del(data) {
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "",
onOk: function () {
console.log(data);
},
});
},
Actions(data) {
console.log(data);
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
},
// watch:{
// checkedKeys(val) {
// console.log('onCheck', val);
// },
// }
}else{
this.searchForm.roleId = null
}
},
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;
},
reset(){
this.searchForm.keyword =''
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
del(data) {
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "",
onOk: function () {
console.log(data);
},
});
},
Actions(data) {
console.log(data);
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
},
// watch:{
// checkedKeys(val) {
// console.log('onCheck', val);
// },
// }
};
</script>

@ -49,99 +49,99 @@
import {columns,pagination,searchForm} from './config.js'
import { rolelist,FindAllMenus } from "@/api/basic/role";
export default {
data() {
return {
tableChoosed: [],
roleList: [],
//
pagination: pagination,
//
columns: columns,
searchForm:searchForm,
expandedKeys: [],
replaceFields: {
children: 'childrenList',
title: 'name',
key: 'id',
},
autoExpandParent: true,
checkedKeys: [],
selectedKeys: [],
//
tableData: [],
ActionsList: [ ],
menus:[]
};
},
mounted() {
this.getData();
},
methods: {
getData() {
rolelist().then((res) => {
this.roleList = res.data;
});
},
rolechange(data){
if(data){
this.searchForm.roleId = this.roleList[data].id
FindAllMenus({roleId:this.searchForm.roleId}).then(res=>{
this.menus = res.data
})
data() {
return {
tableChoosed: [],
roleList: [],
//
pagination: pagination,
//
columns: columns,
searchForm:searchForm,
expandedKeys: [],
replaceFields: {
children: 'childrenList',
title: 'name',
key: 'id',
},
autoExpandParent: true,
checkedKeys: [],
selectedKeys: [],
//
tableData: [],
ActionsList: [ ],
menus:[]
};
},
mounted() {
this.getData();
},
methods: {
getData() {
rolelist().then((res) => {
this.roleList = res.data;
});
},
rolechange(data){
if(data){
this.searchForm.roleId = this.roleList[data].id
FindAllMenus({roleId:this.searchForm.roleId}).then(res=>{
this.menus = res.data
})
}else{
this.searchForm.roleId = null
}
},
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;
},
reset(){
this.searchForm.keyword =''
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
del(data) {
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "",
onOk: function () {
console.log(data);
},
});
},
Actions(data) {
console.log(data);
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
},
watch:{
checkedKeys(val) {
console.log('onCheck', val);
},
}
}else{
this.searchForm.roleId = null
}
},
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;
},
reset(){
this.searchForm.keyword =''
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
del(data) {
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "",
onOk: function () {
console.log(data);
},
});
},
Actions(data) {
console.log(data);
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
},
watch:{
checkedKeys(val) {
console.log('onCheck', val);
},
}
};
</script>

@ -62,82 +62,82 @@ import {columns,pagination,searchForm} from './component/config.js'
import { rolelist,listByRole } from "@/api/basic/role";
import rolePermissions from './component/permissions.vue'
export default {
components:{
rolePermissions
},
data() {
return {
tableChoosed: [],
roleList: [],
//
pagination: pagination,
//
columns: columns,
searchForm:searchForm,
//
tableData: [],
ActionsList: [
],
};
},
mounted() {
this.getData();
this.getPeople()
},
methods: {
getData() {
rolelist().then((res) => {
this.roleList = res.data;
});
},
getPeople(){
listByRole({
pageNum:this.pagination.current,
size:this.pagination.pageSize,
roleId:this.searchForm.roleId,
keyword:this.searchForm.keyword,
}).then((res) => {
this.tableData = res.data.rows;
});
},
rolechange(data){
if(data){
this.searchForm.roleId = this.roleList[data].id
}else{
this.searchForm.roleId = null
}
this.getPeople();
},
reset(){
this.searchForm.keyword =''
this.getPeople()
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
del(data) {
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "",
onOk: function () {
console.log(data);
},
});
},
Actions(data) {
console.log(data);
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
},
components:{
rolePermissions
},
data() {
return {
tableChoosed: [],
roleList: [],
//
pagination: pagination,
//
columns: columns,
searchForm:searchForm,
//
tableData: [],
ActionsList: [
],
};
},
mounted() {
this.getData();
this.getPeople()
},
methods: {
getData() {
rolelist().then((res) => {
this.roleList = res.data;
});
},
getPeople(){
listByRole({
pageNum:this.pagination.current,
size:this.pagination.pageSize,
roleId:this.searchForm.roleId,
keyword:this.searchForm.keyword,
}).then((res) => {
this.tableData = res.data.rows;
});
},
rolechange(data){
if(data){
this.searchForm.roleId = this.roleList[data].id
}else{
this.searchForm.roleId = null
}
this.getPeople();
},
reset(){
this.searchForm.keyword =''
this.getPeople()
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
del(data) {
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "",
onOk: function () {
console.log(data);
},
});
},
Actions(data) {
console.log(data);
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
},
};
</script>

@ -14,7 +14,7 @@
<script>
export default {
name: "Console"
name: "Console"
}
</script>

@ -3,52 +3,52 @@
* 表格列
*/
export const columns = [
{
title: "真实名称",
dataIndex: "actualName",
width: "16%",
},
{
title: "手机号",
dataIndex: "tel",
width: "16%",
},
{
title: "所属部门",
dataIndex: "departmentName",
width: "16%",
},
{
title: "岗位",
dataIndex: "positionName",
width: "16%",
},
{
title: "备注",
dataIndex: "remake",
width: "300",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
{
title: "真实名称",
dataIndex: "actualName",
width: "16%",
},
{
title: "手机号",
dataIndex: "tel",
width: "16%",
},
{
title: "所属部门",
dataIndex: "departmentName",
width: "16%",
},
{
title: "岗位",
dataIndex: "positionName",
width: "16%",
},
{
title: "备注",
dataIndex: "remake",
width: "300",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
// 搜索项
export const searchForm = {
keyword: "",
departmentId: null,
positionId: null,
keyword: "",
departmentId: null,
positionId: null,
}
// 分页
export const pagination = {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
}

@ -69,7 +69,7 @@
</a-col>
身份证照片
<a-upload
:action="`${$baseUrl}/user/upload/uploadManageUserIdCard`"
:action="`${$upload}`"
:headers="uploadHeaders"
list-type="picture-card"
:file-list="fileList"
@ -208,212 +208,212 @@
import { insertManageUser,departmentList,uploadManageUserIdCard,manageUserInfo,EditManageUser } from "@/api/basic/department";
import store from "@/store";
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);
});
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = (error) => reject(error);
});
}
export default {
name: "Vueform",
props: {
type: {
type: String,
default:'add'
},
editId:Number,
},
watch: {
editId: {
handler(val) {
if(val === null){
return
}
this.form.id =val;
manageUserInfo({id:this.form.id}).then(res=>{
let data = res.data
this.form.actualName = data.actualName
this.form.sex = data.sex
this.form.idCard = data.idCard
this.form.tel = data.tel
this.telephoneNum = data.tel
// this.form.birthday = this.formatDate(data.birthday/1000,'yyyy-MM-dd hh:mm:ss')
this.form.password = data.password
this.form.email = data.email
this.form.address = data.address
this.form.idCardImgUrls = data.idCardImgUrls
// this.form.entryDate = this.formatDate(data.entryDate/1000,'yyyy-MM-dd hh:mm:ss')
this.form.salary = data.salary
this.form.emergencyContact = data.emergencyContact
this.form.emergencyContactNumber = data.emergencyContactNumber
this.form.emergencyContactAddress = data.emergencyContactAddress
this.form.maritalStatus = data.maritalStatus
this.form.nation = data.nation
this.form.politicalOutlook = data.politicalOutlook
this.form.accountType = data.accountType
this.form.remake = data.remake
//
this.cascVal = []
let path = data.departmentIdPath.split(':')
path.pop()
path.splice(0,1)
path.push(data.positionId)
path.forEach(element => {
this.cascVal.push(Number(element))
});
//
})
},
immediate: true,
},
},
data() {
return {
previewVisible: false,
previewImage: "",
treeData:[],
cascVal:[],
telephoneNum:"",
uploadHeaders: {
"manage-login-token": store.getters.getToken,
'Content-Type': 'multipart/form-data'
},
sexOption: [
{
id: 1,
name: "男",
},
{
id: 2,
name: "女",
},
{
id: 3,
name: "保密",
},
],
form: {
id:null,
actualName: "",
sex: null,
idCard: "",
tel: "",
birthday: "",
password: "",
email: "",
address: "",
idCardImgUrls: "",
departmentId: "",
departmentIdPath: "",
positionId: "",
entryDate: "",
salary: "",
dataImgUrls: "",
emergencyContact: "",
emergencyContactNumber: "",
emergencyContactAddress: "",
maritalStatus: "",
nation: "",
politicalOutlook: "",
accountType: "",
remake: "",
},
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" },
],
entryDate: [
{ required: true, message: "请选择入职时间", trigger: "change" },
],
},
fileList: [],
};
},
created() {
this.getData()
},
methods: {
getData(){
departmentList().then((res) => {
this.treeData = res.data;
});
},
//
submit() {
this.$refs.ruleForm.validate((valid) => {
if (!valid) {
return;
}
if (this.type === "add") {
insertManageUser(this.form).then((res) => {
if(res.code===200){
this.$message.success(res.msg)
this.success()
this.close()
}
});
} else {
if(this.form.tel === this.telephoneNum){
this.form.tel = null
}
EditManageUser(this.form).then((res) => {
if(res.code===200){
this.$message.success(res.msg)
this.success()
this.close()
}
});
}
});
},
//
close() {
this.$refs.ruleForm.resetFields();
this.cascVal=[]
},
success(){
this.$emit('success')
},
async handlePreview(file) {
if (!file.url && !file.preview) {
file.preview = await getBase64(file.originFileObj);
}
this.previewImage = file.url || file.preview;
this.previewVisible = true;
},
onChange(data) {
// data [1,2,2]
// yyyy-mm-dd hh:mm:ss
let _data = JSON.parse(JSON.stringify(data))
this.form.positionId = _data.pop() //2
this.form.departmentId = _data[_data.length-1] //[1,2]==>2
let str = ''
// 1:2:
for (let i = 0; i < _data.length; i++) {
str += _data[i]+':'
}
// 0:1:2:
this.form.departmentIdPath = '0:'+ str
},
handleCancel() {
this.previewVisible = false;
},
handleChange({ fileList }) {
this.fileList = fileList;
},
u1pload(){
uploadManageUserIdCard().then((res) => {console.log(res);})
}
},
name: "Vueform",
props: {
type: {
type: String,
default:'add'
},
editId:Number,
},
watch: {
editId: {
handler(val) {
if(val === null){
return
}
this.form.id =val;
manageUserInfo({id:this.form.id}).then(res=>{
let data = res.data
this.form.actualName = data.actualName
this.form.sex = data.sex
this.form.idCard = data.idCard
this.form.tel = data.tel
this.telephoneNum = data.tel
// this.form.birthday = this.formatDate(data.birthday/1000,'yyyy-MM-dd hh:mm:ss')
this.form.password = data.password
this.form.email = data.email
this.form.address = data.address
this.form.idCardImgUrls = data.idCardImgUrls
// this.form.entryDate = this.formatDate(data.entryDate/1000,'yyyy-MM-dd hh:mm:ss')
this.form.salary = data.salary
this.form.emergencyContact = data.emergencyContact
this.form.emergencyContactNumber = data.emergencyContactNumber
this.form.emergencyContactAddress = data.emergencyContactAddress
this.form.maritalStatus = data.maritalStatus
this.form.nation = data.nation
this.form.politicalOutlook = data.politicalOutlook
this.form.accountType = data.accountType
this.form.remake = data.remake
//
this.cascVal = []
let path = data.departmentIdPath.split(':')
path.pop()
path.splice(0,1)
path.push(data.positionId)
path.forEach(element => {
this.cascVal.push(Number(element))
});
//
})
},
immediate: true,
},
},
data() {
return {
previewVisible: false,
previewImage: "",
treeData:[],
cascVal:[],
telephoneNum:"",
uploadHeaders: {
"manage-login-token": store.getters.getToken,
'Content-Type': 'multipart/form-data'
},
sexOption: [
{
id: 1,
name: "男",
},
{
id: 2,
name: "女",
},
{
id: 3,
name: "保密",
},
],
form: {
id:null,
actualName: "",
sex: null,
idCard: "",
tel: "",
birthday: "",
password: "",
email: "",
address: "",
idCardImgUrls: "",
departmentId: "",
departmentIdPath: "",
positionId: "",
entryDate: "",
salary: "",
dataImgUrls: "",
emergencyContact: "",
emergencyContactNumber: "",
emergencyContactAddress: "",
maritalStatus: "",
nation: "",
politicalOutlook: "",
accountType: "",
remake: "",
},
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" },
],
entryDate: [
{ required: true, message: "请选择入职时间", trigger: "change" },
],
},
fileList: [],
};
},
created() {
this.getData()
},
methods: {
getData(){
departmentList().then((res) => {
this.treeData = res.data;
});
},
//
submit() {
this.$refs.ruleForm.validate((valid) => {
if (!valid) {
return;
}
if (this.type === "add") {
insertManageUser(this.form).then((res) => {
if(res.code===200){
this.$message.success(res.msg)
this.success()
this.close()
}
});
} else {
if(this.form.tel === this.telephoneNum){
this.form.tel = null
}
EditManageUser(this.form).then((res) => {
if(res.code===200){
this.$message.success(res.msg)
this.success()
this.close()
}
});
}
});
},
//
close() {
this.$refs.ruleForm.resetFields();
this.cascVal=[]
},
success(){
this.$emit('success')
},
async handlePreview(file) {
if (!file.url && !file.preview) {
file.preview = await getBase64(file.originFileObj);
}
this.previewImage = file.url || file.preview;
this.previewVisible = true;
},
onChange(data) {
// data [1,2,2]
// yyyy-mm-dd hh:mm:ss
let _data = JSON.parse(JSON.stringify(data))
this.form.positionId = _data.pop() //2
this.form.departmentId = _data[_data.length-1] //[1,2]==>2
let str = ''
// 1:2:
for (let i = 0; i < _data.length; i++) {
str += _data[i]+':'
}
// 0:1:2:
this.form.departmentIdPath = '0:'+ str
},
handleCancel() {
this.previewVisible = false;
},
handleChange({ fileList }) {
this.fileList = fileList;
},
u1pload(){
uploadManageUserIdCard().then((res) => {console.log(res);})
}
},
};
</script>

@ -204,357 +204,357 @@
import { columns, pagination, searchForm } from "./component/config.js";
import vueForm from "./component/form.vue";
import {
departmentList,
departmentInsert,
departmentUpdate,
departmentDel,
findToUser,
rePassword
departmentList,
departmentInsert,
departmentUpdate,
departmentDel,
findToUser,
rePassword
} from "@/api/basic/department";
export default {
components: {
vueForm,
},
data() {
return {
columns: columns,
pagination: pagination,
searchForm: searchForm,
searchStr: "",
searchValue: "",
rules: {
type: [{ required: true, message: "请选择类型", trigger: "change" }],
name: [{ required: true, message: "请输入名称", trigger: "blur" }],
},
cascVal: [],
typeOption: [
{
id: 1,
name: "公司/部门",
},
{
id: 2,
name: "岗位",
},
],
form: {
parentId: 0,
type: null,
name: "",
},
editId:null,
password:{
id:null,
newPassword:'',
confirmpsw:''
},
choose: {
id: undefined,
},
show: {
addStaffShow: false,
addDepartment: false,
resetPswShow:false,
addStaffTitle:'添加员工信息',
depepartmentTitle: "",
},
expandedKeys: [],
autoExpandParent: true,
backupsExpandedKeys: [],
checkedKeys: [],
selectedKeys: [],
treeData: [],
//
tableData: [],
//
loading: false,
selectedRowKeys: [],
type: "add",
};
},
mounted() {
this.getData();
},
methods: {
getData() {
departmentList().then((res) => {
this.treeData = res.data;
});
findToUser({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
keyword:this.searchForm.keyword,
departmentId:this.searchForm.departmentId,
positionId:this.searchForm.positionId,
}).then((res) => {
this.tableData = res.data.rows;
});
},
openDepartment(type) {
if (type === 1) {
this.show.depepartmentTitle = "新增组织架构";
this.show.addDepartment = true;
} else {
if (this.choose.id !== undefined) {
this.show.depepartmentTitle = "修改组织架构";
this.show.addDepartment = true;
this.form.id = this.choose.id;
this.form.name = this.choose.name;
this.form.type = this.choose.type;
} else {
this.$message.error("请选择组织架构");
}
}
},
edit(row){
this.show.addStaffShow = true;
this.type = 'edit'
this.editId = row.id
this.show.addStaffTitle = "修改员工信息"
},
//
handleOk() {
if (this.depepartmentTitle === "新增组织架构") {
departmentInsert(this.form).then((res) => {
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
this.handleCancel();
} else {
this.$message.error(res.msg);
}
});
} else {
departmentUpdate({
id: this.form.id,
type: this.form.type,
name: this.form.name,
}).then((res) => {
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
this.handleCancel();
} else {
this.$message.error(res.msg);
}
});
}
},
del() {
if (this.choose.id === undefined) {
this.$message.error("请选择组织架构");
} else {
this.$confirm({
title: "是否删除",
icon: "",
onOk: () => {
departmentDel({ id: this.choose.id, type: this.choose.type }).then(
(res) => {
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
} else {
this.$message.error(res.msg);
}
}
);
},
});
}
},
handleCancel() {
this.show.addDepartment = false;
this.$refs.ruleForm.resetFields();
this.cascVal = [];
},
success() {
this.addStaffClose();
this.getData();
},
reset(){
this.searchForm.keyword=''
this.getData();
},
//
addStaff() {
this.show.addStaffShow = true;
},
addStaffSubmit() {
this.$refs.addform.submit();
},
addStaffClose() {
this.$refs.addform.close();
this.show.addStaffShow = false;
this.editId =null
},
resetPsw(id){
this.show.resetPswShow = true
this.password.id = id
},
rePswSubmit() {
if(this.password.newPassword !== this.password.confirmpsw){
this.$message.error('两次输入密码不同')
return
}
rePassword(this.password).then(res=>{
if(res.code === 200){
this.$message.success(res.msg)
this.repswClose()
}else{
this.$message.error(res.msg)
}
})
},
repswClose(){
this.show.resetPswShow = false
this.password = {
id:null,
newPassword:'',
confirmpsw:''
}
},
onExpand(expandedKeys) {
this.expandedKeys = expandedKeys;
this.autoExpandParent = false;
},
onCheck(checkedKeys) {
this.checkedKeys = checkedKeys;
},
onSelect(selectedKeys, info) {
this.selectedKeys = selectedKeys;
this.searchForm.departmentId = null
this.searchForm.positionId = null
components: {
vueForm,
},
data() {
return {
columns: columns,
pagination: pagination,
searchForm: searchForm,
searchStr: "",
searchValue: "",
rules: {
type: [{ required: true, message: "请选择类型", trigger: "change" }],
name: [{ required: true, message: "请输入名称", trigger: "blur" }],
},
cascVal: [],
typeOption: [
{
id: 1,
name: "公司/部门",
},
{
id: 2,
name: "岗位",
},
],
form: {
parentId: 0,
type: null,
name: "",
},
editId:null,
password:{
id:null,
newPassword:'',
confirmpsw:''
},
choose: {
id: undefined,
},
show: {
addStaffShow: false,
addDepartment: false,
resetPswShow:false,
addStaffTitle:'添加员工信息',
depepartmentTitle: "",
},
expandedKeys: [],
autoExpandParent: true,
backupsExpandedKeys: [],
checkedKeys: [],
selectedKeys: [],
treeData: [],
//
tableData: [],
//
loading: false,
selectedRowKeys: [],
type: "add",
};
},
mounted() {
this.getData();
},
methods: {
getData() {
departmentList().then((res) => {
this.treeData = res.data;
});
findToUser({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
keyword:this.searchForm.keyword,
departmentId:this.searchForm.departmentId,
positionId:this.searchForm.positionId,
}).then((res) => {
this.tableData = res.data.rows;
});
},
openDepartment(type) {
if (type === 1) {
this.show.depepartmentTitle = "新增组织架构";
this.show.addDepartment = true;
} else {
if (this.choose.id !== undefined) {
this.show.depepartmentTitle = "修改组织架构";
this.show.addDepartment = true;
this.form.id = this.choose.id;
this.form.name = this.choose.name;
this.form.type = this.choose.type;
} else {
this.$message.error("请选择组织架构");
}
}
},
edit(row){
this.show.addStaffShow = true;
this.type = 'edit'
this.editId = row.id
this.show.addStaffTitle = "修改员工信息"
},
//
handleOk() {
if (this.depepartmentTitle === "新增组织架构") {
departmentInsert(this.form).then((res) => {
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
this.handleCancel();
} else {
this.$message.error(res.msg);
}
});
} else {
departmentUpdate({
id: this.form.id,
type: this.form.type,
name: this.form.name,
}).then((res) => {
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
this.handleCancel();
} else {
this.$message.error(res.msg);
}
});
}
},
del() {
if (this.choose.id === undefined) {
this.$message.error("请选择组织架构");
} else {
this.$confirm({
title: "是否删除",
icon: "",
onOk: () => {
departmentDel({ id: this.choose.id, type: this.choose.type }).then(
(res) => {
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
} else {
this.$message.error(res.msg);
}
}
);
},
});
}
},
handleCancel() {
this.show.addDepartment = false;
this.$refs.ruleForm.resetFields();
this.cascVal = [];
},
success() {
this.addStaffClose();
this.getData();
},
reset(){
this.searchForm.keyword=''
this.getData();
},
//
addStaff() {
this.show.addStaffShow = true;
},
addStaffSubmit() {
this.$refs.addform.submit();
},
addStaffClose() {
this.$refs.addform.close();
this.show.addStaffShow = false;
this.editId =null
},
resetPsw(id){
this.show.resetPswShow = true
this.password.id = id
},
rePswSubmit() {
if(this.password.newPassword !== this.password.confirmpsw){
this.$message.error('两次输入密码不同')
return
}
rePassword(this.password).then(res=>{
if(res.code === 200){
this.$message.success(res.msg)
this.repswClose()
}else{
this.$message.error(res.msg)
}
})
},
repswClose(){
this.show.resetPswShow = false
this.password = {
id:null,
newPassword:'',
confirmpsw:''
}
},
onExpand(expandedKeys) {
this.expandedKeys = expandedKeys;
this.autoExpandParent = false;
},
onCheck(checkedKeys) {
this.checkedKeys = checkedKeys;
},
onSelect(selectedKeys, info) {
this.selectedKeys = selectedKeys;
this.searchForm.departmentId = null
this.searchForm.positionId = null
if (info.selectedNodes.length !== 0) {
this.choose.id = info.selectedNodes[0].data.props.id;
this.choose.name = info.selectedNodes[0].data.props.name;
this.choose.type = info.selectedNodes[0].data.props.type;
if(this.choose.type === 1){
this.searchForm.departmentId = this.choose.id
this.getData()
}else if(this.choose.type === 2){
this.searchForm.positionId = this.choose.id
this.getData()
}
} else {
this.choose = {};
this.getData()
}
},
detail() {
this.$router.push({ name: "settle_detail" });
},
// selection
onSelectChange(selectedRowKeys) {
this.selectedRowKeys = selectedRowKeys;
},
handleTableChange(pagination) {
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
this.getData();
},
//
onChange(data) {
let thatId = data.slice(-1);
this.form.parentId = thatId[0];
},
onSearch() {
var vm = this;
//
vm.searchValue = vm.searchStr;
//expandedKeys
//expandedKeys
if (vm.searchValue === "") {
vm.expandedKeys = [];
} else {
//
vm.expandedKeys = [];
vm.backupsExpandedKeys = [];
//searchValue
let candidateKeysList = vm.getkeyList(vm.searchValue, vm.treeData, []);
//
candidateKeysList.map((item) => {
//
var key = vm.getParentKey(item, vm.treeData);
//itemkeyundefined
//
if (key && !vm.backupsExpandedKeys.some((item) => item === key))
vm.backupsExpandedKeys.push(key);
});
let length = this.backupsExpandedKeys.length;
for (let i = 0; i < length; i++) {
vm.getAllParentKey(vm.backupsExpandedKeys[i], vm.treeData);
}
vm.expandedKeys = vm.backupsExpandedKeys.slice();
}
},
//valuekey
getkeyList(value, tree, keyList) {
//
for (let i = 0; i < tree.length; i++) {
let node = tree[i];
//valuepush
if (node.name.indexOf(value) > -1) {
keyList.push(node.key);
}
//
if (node.childList) {
this.getkeyList(value, node.childList, keyList);
}
}
//
return keyList;
},
//keykey
getParentKey(key, tree) {
let parentKey, temp;
//
for (let i = 0; i < tree.length; i++) {
const node = tree[i];
if (node.childList) {
//key
//
if (node.childList.some((item) => item.key === key)) {
parentKey = node.key;
} else if ((temp = this.getParentKey(key, node.childList))) {
//parentKey = this.getParentKey(key,node.children)
//
parentKey = temp;
}
}
}
return parentKey;
},
//
getAllParentKey(key, tree) {
var parentKey;
if (key) {
//
parentKey = this.getParentKey(key, tree);
if (parentKey) {
//push
if (!this.backupsExpandedKeys.some((item) => item === parentKey)) {
this.backupsExpandedKeys.push(parentKey);
}
//
this.getAllParentKey(parentKey, tree);
}
}
},
},
computed: {
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
watch: {
checkedKeys(val) {
console.log("onCheck", val);
},
},
if (info.selectedNodes.length !== 0) {
this.choose.id = info.selectedNodes[0].data.props.id;
this.choose.name = info.selectedNodes[0].data.props.name;
this.choose.type = info.selectedNodes[0].data.props.type;
if(this.choose.type === 1){
this.searchForm.departmentId = this.choose.id
this.getData()
}else if(this.choose.type === 2){
this.searchForm.positionId = this.choose.id
this.getData()
}
} else {
this.choose = {};
this.getData()
}
},
detail() {
this.$router.push({ name: "settle_detail" });
},
// selection
onSelectChange(selectedRowKeys) {
this.selectedRowKeys = selectedRowKeys;
},
handleTableChange(pagination) {
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
this.getData();
},
//
onChange(data) {
let thatId = data.slice(-1);
this.form.parentId = thatId[0];
},
onSearch() {
var vm = this;
//
vm.searchValue = vm.searchStr;
//expandedKeys
//expandedKeys
if (vm.searchValue === "") {
vm.expandedKeys = [];
} else {
//
vm.expandedKeys = [];
vm.backupsExpandedKeys = [];
//searchValue
let candidateKeysList = vm.getkeyList(vm.searchValue, vm.treeData, []);
//
candidateKeysList.map((item) => {
//
var key = vm.getParentKey(item, vm.treeData);
//itemkeyundefined
//
if (key && !vm.backupsExpandedKeys.some((item) => item === key))
vm.backupsExpandedKeys.push(key);
});
let length = this.backupsExpandedKeys.length;
for (let i = 0; i < length; i++) {
vm.getAllParentKey(vm.backupsExpandedKeys[i], vm.treeData);
}
vm.expandedKeys = vm.backupsExpandedKeys.slice();
}
},
//valuekey
getkeyList(value, tree, keyList) {
//
for (let i = 0; i < tree.length; i++) {
let node = tree[i];
//valuepush
if (node.name.indexOf(value) > -1) {
keyList.push(node.key);
}
//
if (node.childList) {
this.getkeyList(value, node.childList, keyList);
}
}
//
return keyList;
},
//keykey
getParentKey(key, tree) {
let parentKey, temp;
//
for (let i = 0; i < tree.length; i++) {
const node = tree[i];
if (node.childList) {
//key
//
if (node.childList.some((item) => item.key === key)) {
parentKey = node.key;
} else if ((temp = this.getParentKey(key, node.childList))) {
//parentKey = this.getParentKey(key,node.children)
//
parentKey = temp;
}
}
}
return parentKey;
},
//
getAllParentKey(key, tree) {
var parentKey;
if (key) {
//
parentKey = this.getParentKey(key, tree);
if (parentKey) {
//push
if (!this.backupsExpandedKeys.some((item) => item === parentKey)) {
this.backupsExpandedKeys.push(parentKey);
}
//
this.getAllParentKey(parentKey, tree);
}
}
},
},
computed: {
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
watch: {
checkedKeys(val) {
console.log("onCheck", val);
},
},
};
</script>
<style lang="less" scoped>

@ -2,54 +2,54 @@
* 配置
* 表格列
*/
export const columns = [
{
title: "楼栋名称",
dataIndex: "name",
width: "20%",
},
{
title: "房屋总数",
dataIndex: "estateTotals",
width: "20%",
},
{
title: "租赁房屋数",
dataIndex: "leaseEstateNums",
width: "20%"
},
{
title: "租赁率",
dataIndex: "leaseRate",
width: "20%",
customRender:function(leaseRate){
return leaseRate+'%'
}
},
{
title: "入住率",
dataIndex: "occupancyRate",
width: "20%",
customRender:function(occupancyRate){
return occupancyRate+'%'
}
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
export const columns = [
{
title: "楼栋名称",
dataIndex: "name",
width: "20%",
},
{
title: "房屋总数",
dataIndex: "estateTotals",
width: "20%",
},
{
title: "租赁房屋数",
dataIndex: "leaseEstateNums",
width: "20%"
},
{
title: "租赁率",
dataIndex: "leaseRate",
width: "20%",
customRender:function(leaseRate){
return leaseRate+'%'
}
},
{
title: "入住率",
dataIndex: "occupancyRate",
width: "20%",
customRender:function(occupancyRate){
return occupancyRate+'%'
}
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
// 搜索项
export const searchForm = {
name: "",
name: "",
}
// 分页
export const pagination = {
current: 1,
total: 0,
pageSize: 10,
current: 1,
total: 0,
pageSize: 10,
}

@ -138,161 +138,161 @@
import { columns,pagination,searchForm} from "./component/config"
import { buildingList } from "@/api/basic/estate"
export default {
data() {
return {
drawerConfig:{
addShow:false,
detailShow:false,
title:'添加楼栋',
editNow:false,
},
addUnitShow:false,
form:{
name:''
},
rules:{
name:[{required:true,message:'请输入楼栋',trigger:'blur'}],
fileList:[{required:true}]
},
fileList: [
{
uid: '-1',
name: 'xxx.png',
url: '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: pagination,
//
columns:columns,
searchForm:searchForm,
unitData:[],
unitColumns: [
{
title: "单元名称",
dataIndex: "name",
width: "15%",
},
{
title: "楼层数",
dataIndex: "floor",
width: "15%",
},
{
title: "公共楼层数",
dataIndex: "publicFloor",
width: "18%",
},
{
title: "是否有电梯",
dataIndex: "elevator",
width: "18%",
customRender:function(elevator){
switch (elevator) {
case 1:
return '有'
case 0:
return '无'
default:
break;
}
}
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
],
//
tableData: [],
ActionsList: [
{
label: "批量删除",
value: 1,
},
{
label: "批量导出",
value: 2,
},
],
};
},
created() {
this.getData()
},
methods: {
async getData() {
const res = await buildingList(
{
pageNum:this.pagination.current,
size:this.pagination.pageSize,
name:this.searchForm.name
}
)
this.tableData = res.data.rows
},
addBuilding(){
this.drawerConfig.addShow = true
},
addSubmit(){
this.$refs.ruleForm.validate(valid => {
if (valid) {
alert('submit!');
} else {
console.log('error submit!!');
return false;
}
});
},
addClose(){
this.drawerConfig.addShow = false
},
detail(data){
console.log(data);
this.drawerConfig.detailShow = true;
},
detailClose(){
this.drawerConfig.detailShow = false;
this.drawerConfig.editNow = false;
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
del(data) {
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "",
onOk: function () {
console.log(data);
},
});
},
Actions(data) {
console.log(data);
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
},
data() {
return {
drawerConfig:{
addShow:false,
detailShow:false,
title:'添加楼栋',
editNow:false,
},
addUnitShow:false,
form:{
name:''
},
rules:{
name:[{required:true,message:'请输入楼栋',trigger:'blur'}],
fileList:[{required:true}]
},
fileList: [
{
uid: '-1',
name: 'xxx.png',
url: '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: pagination,
//
columns:columns,
searchForm:searchForm,
unitData:[],
unitColumns: [
{
title: "单元名称",
dataIndex: "name",
width: "15%",
},
{
title: "楼层数",
dataIndex: "floor",
width: "15%",
},
{
title: "公共楼层数",
dataIndex: "publicFloor",
width: "18%",
},
{
title: "是否有电梯",
dataIndex: "elevator",
width: "18%",
customRender:function(elevator){
switch (elevator) {
case 1:
return '有'
case 0:
return '无'
default:
break;
}
}
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
],
//
tableData: [],
ActionsList: [
{
label: "批量删除",
value: 1,
},
{
label: "批量导出",
value: 2,
},
],
};
},
created() {
this.getData()
},
methods: {
async getData() {
const res = await buildingList(
{
pageNum:this.pagination.current,
size:this.pagination.pageSize,
name:this.searchForm.name
}
)
this.tableData = res.data.rows
},
addBuilding(){
this.drawerConfig.addShow = true
},
addSubmit(){
this.$refs.ruleForm.validate(valid => {
if (valid) {
alert('submit!');
} else {
console.log('error submit!!');
return false;
}
});
},
addClose(){
this.drawerConfig.addShow = false
},
detail(data){
console.log(data);
this.drawerConfig.detailShow = true;
},
detailClose(){
this.drawerConfig.detailShow = false;
this.drawerConfig.editNow = false;
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
del(data) {
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "",
onOk: function () {
console.log(data);
},
});
},
Actions(data) {
console.log(data);
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
},
};
</script>

@ -2,91 +2,91 @@
* 配置
* 表格列
*/
export const columns = [
{
title: "申请人姓名",
dataIndex:"name",
width:'14%'
},
{
title: "申请人身份",
key: "tags",
width: "14%",
dataIndex: "identity",
scopedSlots: { customRender: "tags" },
},
{
title: "房屋名称",
dataIndex: "manageBuildingName",
scopedSlots: { customRender: "name" },
width: "20%",
},
{
title: "申请人手机号",
dataIndex:"tel",
width:'14%'
},
{
title: "申请人身份证号",
dataIndex:"idCard",
width:'14%'
},
{
title: "状态",
dataIndex:"status",
width:'14%',
customRender:function(status){
switch (status) {
case 1:
return '审核中'
case 2:
return '驳回'
case 3:
return '通过'
default:
break;
}
}
},
{
title: "房屋类型",
dataIndex:"estateTypeName",
width:'14%'
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "100",
fixed: "right",
scopedSlots: { customRender: "action" },
},
export const columns = [
{
title: "申请人姓名",
dataIndex:"name",
width:'14%'
},
{
title: "申请人身份",
key: "tags",
width: "14%",
dataIndex: "identity",
scopedSlots: { customRender: "tags" },
},
{
title: "房屋名称",
dataIndex: "manageBuildingName",
scopedSlots: { customRender: "name" },
width: "20%",
},
{
title: "申请人手机号",
dataIndex:"tel",
width:'14%'
},
{
title: "申请人身份证号",
dataIndex:"idCard",
width:'14%'
},
{
title: "状态",
dataIndex:"status",
width:'14%',
customRender:function(status){
switch (status) {
case 1:
return '审核中'
case 2:
return '驳回'
case 3:
return '通过'
default:
break;
}
}
},
{
title: "房屋类型",
dataIndex:"estateTypeName",
width:'14%'
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "100",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
// 搜索项
export const searchForm = {
status:null,
identity: null
status:null,
identity: null
}
export function reset() {
this.searchForm = {
status:null,
identity:null,
}
this.getData()
this.searchForm = {
status:null,
identity:null,
}
this.getData()
}
export function handleTableChange(pagination) {
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
this.getData()
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
this.getData()
}
// 分页
export const pagination = {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
}

@ -117,86 +117,86 @@
<script>
import {
columns,
pagination,
searchForm,
reset,
handleTableChange,
columns,
pagination,
searchForm,
reset,
handleTableChange,
} from "./component/config";
import { reviewList, review } from "@/api/basic/resident";
export default {
data() {
return {
pagination: pagination,
searchForm: searchForm,
columns: columns,
activeAction: undefined,
loading: false,
// index
selectedRowKeys: [],
tableChoosed: [],
tableData: [],
ActionsList: [],
};
},
mounted() {
this.getData();
},
methods: {
async getData() {
const res = await reviewList({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
status: this.searchForm.status,
identity: this.searchForm.identity,
});
this.tableData = res.data.rows;
},
tabsChange(e) {
if (e.target.value === "0") {
this.searchForm.status = null;
} else {
this.searchForm.status = e.target.value;
}
this.getData();
},
// 1 2
audit(estateReviewId, operate) {
this.$confirm({
title: "是否" + (operate === 1 ? "通过" : "驳回"),
// okText:'',
// cancelText:'',
icon: "",
onOk: async function () {
const res = await review({
estateReviewId: estateReviewId,
operate: operate,
});
if (res.code === 0) {
this.$message.success(res.msg);
} else {
this.$message.error(res.msg);
}
},
});
},
handleTableChange:handleTableChange,
Actions(data) {
console.log(data);
this.activeAction = undefined;
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
reset: reset,
},
computed: {
// selection
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
data() {
return {
pagination: pagination,
searchForm: searchForm,
columns: columns,
activeAction: undefined,
loading: false,
// index
selectedRowKeys: [],
tableChoosed: [],
tableData: [],
ActionsList: [],
};
},
mounted() {
this.getData();
},
methods: {
async getData() {
const res = await reviewList({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
status: this.searchForm.status,
identity: this.searchForm.identity,
});
this.tableData = res.data.rows;
},
tabsChange(e) {
if (e.target.value === "0") {
this.searchForm.status = null;
} else {
this.searchForm.status = e.target.value;
}
this.getData();
},
// 1 2
audit(estateReviewId, operate) {
this.$confirm({
title: "是否" + (operate === 1 ? "通过" : "驳回"),
// okText:'',
// cancelText:'',
icon: "",
onOk: async function () {
const res = await review({
estateReviewId: estateReviewId,
operate: operate,
});
if (res.code === 0) {
this.$message.success(res.msg);
} else {
this.$message.error(res.msg);
}
},
});
},
handleTableChange:handleTableChange,
Actions(data) {
console.log(data);
this.activeAction = undefined;
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
reset: reset,
},
computed: {
// selection
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
};
</script>

@ -214,11 +214,11 @@
<script>
export default {
data() {
return {
data() {
return {
}
}
}
}
};
</script>

@ -2,76 +2,76 @@
* 配置
* 表格列
*/
export const columns = [
{
title: "住户姓名",
dataIndex: "name",
width: "10%",
},
{
title: "住户手机号",
dataIndex: "tel",
width: "10%",
},
{
title: "住户性别",
dataIndex: "sex",
width: "8%",
customRender:function(sex){
switch (sex) {
case 1:
return '男'
case 2:
return '女'
case 3:
return '保密'
default:
break;
}
}
},
{
title: "住户身份证号",
dataIndex: "idCard",
width: "10%",
},
{
title: "房屋名称",
dataIndex: "manageBuildingName",
scopedSlots: { customRender: "name" },
width: "20%",
},
{
title: "房屋类型",
dataIndex: "manageEstateTypeName",
width: "10%",
},
{
title: "用户身份",
key: "tags",
dataIndex: "identity",
scopedSlots: { customRender: "tags" },
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
export const columns = [
{
title: "住户姓名",
dataIndex: "name",
width: "10%",
},
{
title: "住户手机号",
dataIndex: "tel",
width: "10%",
},
{
title: "住户性别",
dataIndex: "sex",
width: "8%",
customRender:function(sex){
switch (sex) {
case 1:
return '男'
case 2:
return '女'
case 3:
return '保密'
default:
break;
}
}
},
{
title: "住户身份证号",
dataIndex: "idCard",
width: "10%",
},
{
title: "房屋名称",
dataIndex: "manageBuildingName",
scopedSlots: { customRender: "name" },
width: "20%",
},
{
title: "房屋类型",
dataIndex: "manageEstateTypeName",
width: "10%",
},
{
title: "用户身份",
key: "tags",
dataIndex: "identity",
scopedSlots: { customRender: "tags" },
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
// 搜索项
export const searchForm = {
keyword: "",
sex: null
keyword: "",
sex: null
}
// 分页
export const pagination = {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
}

@ -97,123 +97,123 @@
import { columns,pagination,searchForm } from './component/config.js'
import { residentList } from '@/api/basic/resident'
export default {
data() {
return {
imageUrl: '',
form:{
identity:2
},
drawer:{
add:{
show: false
},
detail:{}
},
changeId:null,
pagination: pagination,
searchForm:searchForm,
activeAction: undefined,
loading: false,
// index
selectedRowKeys: [],
tableChoosed: [],
//
//
columns: columns,
newData:[],
//
tableData:[],
ActionsList: [
{
label: "批量删除",
value: 1,
},
{
label: "批量导出",
value: 2,
},
],
};
},
mounted(){
this.getData()
},
methods: {
async getData() {
const res = await residentList({
pageNum: this.pagination.current,
size :this.pagination.pageSize,
sex:this.searchForm.sex,
keyword:this.searchForm.keyword,
})
this.tableData = res.data.rows
this.newData = this.tableData
},
addClose(){
this.drawer.add.show = false;
},
handleChange(info){
console.log(info);
},
beforeUpload(file) {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('You can only upload JPG file!');
}
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
this.$message.error('Image must smaller than 2MB!');
}
return isJpgOrPng && isLt2M;
},
//
changeHouse(value){
//
this.newData.forEach((item,index)=>{
//
item.residentListEstateVoList.forEach(items=>{
// idchangeid
if(items.id === value){
// newData
this.$set(this.newData[index],'identity' ,items.identity )
this.$set(this.newData[index],'manageEstateTypeName' ,items.manageEstateTypeName )
}
})
})
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
del(data) {
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "",
onOk: function () {
console.log(data);
},
});
},
Actions(data) {
console.log(data);
this.activeAction = undefined;
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
},
computed: {
// selection
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
data() {
return {
imageUrl: '',
form: {
identity: 2
},
drawer: {
add: {
show: false
},
detail:{}
},
changeId:null,
pagination: pagination,
searchForm:searchForm,
activeAction: undefined,
loading: false,
// index
selectedRowKeys: [],
tableChoosed: [],
//
//
columns: columns,
newData:[],
//
tableData:[],
ActionsList: [
{
label: "批量删除",
value: 1,
},
{
label: "批量导出",
value: 2,
},
],
};
},
mounted(){
this.getData()
},
methods: {
async getData() {
const res = await residentList({
pageNum: this.pagination.current,
size :this.pagination.pageSize,
sex:this.searchForm.sex,
keyword:this.searchForm.keyword,
})
this.tableData = res.data.rows
this.newData = this.tableData
},
addClose(){
this.drawer.add.show = false;
},
handleChange(info){
console.log(info);
},
beforeUpload(file) {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('You can only upload JPG file!');
}
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
this.$message.error('Image must smaller than 2MB!');
}
return isJpgOrPng && isLt2M;
},
//
changeHouse(value){
//
this.newData.forEach((item,index)=>{
//
item.residentListEstateVoList.forEach(items=>{
// idchangeid
if(items.id === value){
// newData
this.$set(this.newData[index],'identity' ,items.identity )
this.$set(this.newData[index],'manageEstateTypeName' ,items.manageEstateTypeName )
}
})
})
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
del(data) {
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "",
onOk: function () {
console.log(data);
},
});
},
Actions(data) {
console.log(data);
this.activeAction = undefined;
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
},
computed: {
// selection
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
};
</script>

@ -2,71 +2,71 @@
* 配置
* 表格列
*/
export const columns = [
{
title: "房屋名称",
dataIndex: "manageBuildingName",
scopedSlots: { customRender: "name" },
width: "20%",
},
{
title: "室内面积",
dataIndex: "indoorArea",
width: "15%",
},
{
title: "建筑面积",
dataIndex: "constructionArea",
width: "15%",
},
{
title: "房屋类型",
dataIndex: "manageEstateTypeName",
width: "15%",
},
{
title: "居住状态",
key: "tags",
dataIndex: "residenceStatus",
scopedSlots: { customRender: "tags" },
},
{
title: "是否开启租赁",
dataIndex: "isEnableLease",
scopedSlots: { customRender: "switch" },
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
export const columns = [
{
title: "房屋名称",
dataIndex: "manageBuildingName",
scopedSlots: { customRender: "name" },
width: "20%",
},
{
title: "室内面积",
dataIndex: "indoorArea",
width: "15%",
},
{
title: "建筑面积",
dataIndex: "constructionArea",
width: "15%",
},
{
title: "房屋类型",
dataIndex: "manageEstateTypeName",
width: "15%",
},
{
title: "居住状态",
key: "tags",
dataIndex: "residenceStatus",
scopedSlots: { customRender: "tags" },
},
{
title: "是否开启租赁",
dataIndex: "isEnableLease",
scopedSlots: { customRender: "switch" },
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
// 搜索项
export const searchForm = {
name: "",
isEnableLease: null,
manageEstateTypeId:null
name: "",
isEnableLease: null,
manageEstateTypeId:null
}
// 分页
export const pagination = {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
}
export function del(data) {
this.$confirm({
title: "是否删除",
// okText:'删除',
// cancelText:'取消',
icon: "",
onOk: function () {
console.log(data);
},
});
this.$confirm({
title: "是否删除",
// okText:'删除',
// cancelText:'取消',
icon: "",
onOk: function () {
console.log(data);
},
});
}

@ -243,156 +243,156 @@
<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);
});
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
import { columns,pagination,searchForm, del } from "./component/config"
import { houseList } from '@/api/basic/estate'
export default {
data() {
return {
drawerConfig:{
addShow:false,
},
previewVisible: false,
previewImage: '',
fileList: [
{
uid: '-1',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-2',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-3',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-4',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-5',
name: 'image.png',
status: 'error',
},
],
form:{
manageBuildingId:undefined,
manageUnitId:undefined,
floorLocation:undefined,
name:undefined,
indoorArea:undefined,
constructionArea:undefined,
manageEstateTypeId:undefined,
isEnableLease:undefined,
houseTypeHall:undefined,
houseTypeRoom:undefined,
houseTypeBathroom:undefined,
estateImgUrls:undefined,
remarks:undefined,
},
rules:{},
pagination:pagination ,
searchForm:searchForm,
columns:columns ,
activeAction: undefined,
loading: false,
// index
selectedRowKeys: [],
tableChoosed: [],
//
//
//
tableData:[],
ActionsList: [
{
label: "批量删除",
value: 1,
},
{
label: "批量导出",
value: 2,
},
],
};
},
created() {
this.getData()
},
methods: {
async getData() {
const res = await houseList(
{
pageNum:this.pagination.current,
size:this.pagination.pageSize,
name:this.searchForm.name,
isEnableLease:this.searchForm.isEnableLease,
manageEstateTypeId:this.searchForm.manageEstateTypeId,
}
)
this.tableData = res.data.rows
},
addHouse() {},
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;
},
enable(data) {
console.log(data);
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
// del(data) {
data() {
return {
drawerConfig:{
addShow:false,
},
previewVisible: false,
previewImage: '',
fileList: [
{
uid: '-1',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-2',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-3',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-4',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-5',
name: 'image.png',
status: 'error',
},
],
form:{
manageBuildingId:undefined,
manageUnitId:undefined,
floorLocation:undefined,
name:undefined,
indoorArea:undefined,
constructionArea:undefined,
manageEstateTypeId:undefined,
isEnableLease:undefined,
houseTypeHall:undefined,
houseTypeRoom:undefined,
houseTypeBathroom:undefined,
estateImgUrls:undefined,
remarks:undefined,
},
rules:{},
pagination:pagination ,
searchForm:searchForm,
columns:columns ,
activeAction: undefined,
loading: false,
// index
selectedRowKeys: [],
tableChoosed: [],
//
//
//
tableData:[],
ActionsList: [
{
label: "批量删除",
value: 1,
},
{
label: "批量导出",
value: 2,
},
],
};
},
created() {
this.getData()
},
methods: {
async getData() {
const res = await houseList(
{
pageNum:this.pagination.current,
size:this.pagination.pageSize,
name:this.searchForm.name,
isEnableLease:this.searchForm.isEnableLease,
manageEstateTypeId:this.searchForm.manageEstateTypeId,
}
)
this.tableData = res.data.rows
},
addHouse() {},
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;
},
enable(data) {
console.log(data);
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
// del(data) {
// },
del:del,
Actions(data) {
console.log(data);
this.activeAction = undefined;
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
addClose(){
this.drawerConfig.addShow = false;
}
},
computed: {
// selection
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
// },
del:del,
Actions(data) {
console.log(data);
this.activeAction = undefined;
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
addClose(){
this.drawerConfig.addShow = false;
}
},
computed: {
// selection
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
};
</script>

@ -41,30 +41,30 @@
</template>
<script>
export default {
name: "addWork",
data() {
return {
isVisibleDrawe: false,
};
},
props: {
visible: Boolean,
form:Object,
rules:Object
},
methods: {
onClose() {
this.$emit("onClose");
},
},
watch: {
visible: {
handler(newValue) {
this.isVisibleDrawe = newValue;
},
immediate: true,
},
},
name: "addWork",
data() {
return {
isVisibleDrawe: false,
};
},
props: {
visible: Boolean,
form:Object,
rules:Object
},
methods: {
onClose() {
this.$emit("onClose");
},
},
watch: {
visible: {
handler(newValue) {
this.isVisibleDrawe = newValue;
},
immediate: true,
},
},
};
</script>
<style lang="less" scoped>

@ -123,155 +123,155 @@
<script>
import addWork from "../WorkOrder/addWorkOrder.vue"
export default {
components:{
addWork
},
data() {
return {
form:{
identity:null
},
rules:{},
show: false,
activeName:'0',
pagination: {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
},
searchForm:{
status:null,
identity:null
},
activeAction: undefined,
loading: false,
// index
selectedRowKeys: [],
tableChoosed: [],
//
//
columns: [
{
title: "工单状态",
key: "tags",
width: "14%",
dataIndex: "status",
scopedSlots: { customRender: "tags" },
},
{
title: "工单号",
width: "14%",
dataIndex: "code",
},
{
title: "申请人",
width: "14%",
dataIndex: "people",
},
{
title: "手机号",
width: "14%",
dataIndex: "tel",
},
{
title: "工单类型",
width: "14%",
dataIndex: "type",
},
{
title: "工单类型",
width: "14%",
dataIndex: "content",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "300",
fixed: "right",
scopedSlots: { customRender: "action" },
},
],
//
tableData: [{},
],
ActionsList: [
{
label: "批量删除",
value: 1,
},
{
label: "批量导出",
value: 2,
},
],
};
},
mounted(){
this.getData()
},
methods: {
getData(){},
tabsChange(e){
this.searchForm.status = e.target.value
this.getData()
},
onClose(){
this.show = false;
},
//
put(){
components:{
addWork
},
data() {
return {
form:{
identity:null
},
rules:{},
show: false,
activeName:'0',
pagination: {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
},
searchForm:{
status:null,
identity:null
},
activeAction: undefined,
loading: false,
// index
selectedRowKeys: [],
tableChoosed: [],
//
//
columns: [
{
title: "工单状态",
key: "tags",
width: "14%",
dataIndex: "status",
scopedSlots: { customRender: "tags" },
},
{
title: "工单号",
width: "14%",
dataIndex: "code",
},
{
title: "申请人",
width: "14%",
dataIndex: "people",
},
{
title: "手机号",
width: "14%",
dataIndex: "tel",
},
{
title: "工单类型",
width: "14%",
dataIndex: "type",
},
{
title: "工单类型",
width: "14%",
dataIndex: "content",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "300",
fixed: "right",
scopedSlots: { customRender: "action" },
},
],
//
tableData: [{},
],
ActionsList: [
{
label: "批量删除",
value: 1,
},
{
label: "批量导出",
value: 2,
},
],
};
},
mounted(){
this.getData()
},
methods: {
getData(){},
tabsChange(e){
this.searchForm.status = e.target.value
this.getData()
},
onClose(){
this.show = false;
},
//
put(){
},
//
shift(){
},
//
shift(){
},
//
assign(){
},
//
assign(){
},
//
shiftAssign(){
},
//
shiftAssign(){
},
//
finish(){
},
//
finish(){
},
//
deal(){
},
//
deal(){
},
//
refuse(){
},
//
refuse(){
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
Actions(data) {
console.log(data);
this.activeAction = undefined;
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
},
computed: {
// selection
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
Actions(data) {
console.log(data);
this.activeAction = undefined;
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
},
computed: {
// selection
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
};
</script>

@ -40,60 +40,60 @@
<script>
import yMenu from "./yMenu";
export default {
components: {
yMenu,
},
watch: {
$route: {
handler(val) {
this.tags = val.matched;
},
immediate: true,
},
tagActive:{
handler(val) {
sessionStorage.setItem('modal',this.menuTags[val].value)
},
immediate: true,
}
},
data() {
return {
collapsed: false,
tagActive: 0,
menuTags: [
{
label: "基础功能",
value: "basic"
},
{
label: "缴费管理",
value: "payment"
},
{
label: "智慧商城",
value: "smartMall"
},
// {
// label: "",
// value: "operation"
// },
// {
// label: "",
// value: "setting"
// }
],
};
},
methods: {
handlerBread(row) {
let path = row.path || "/";
this.$router.push(path);
},
handlerTags(n) {
this.tagActive = n;
}
},
components: {
yMenu,
},
watch: {
$route: {
handler(val) {
this.tags = val.matched;
},
immediate: true,
},
tagActive:{
handler(val) {
sessionStorage.setItem('modal',this.menuTags[val].value)
},
immediate: true,
}
},
data() {
return {
collapsed: false,
tagActive: 0,
menuTags: [
{
label: "基础功能",
value: "basic"
},
{
label: "缴费管理",
value: "payment"
},
{
label: "智慧商城",
value: "smartMall"
},
// {
// label: "",
// value: "operation"
// },
// {
// label: "",
// value: "setting"
// }
],
};
},
methods: {
handlerBread(row) {
let path = row.path || "/";
this.$router.push(path);
},
handlerTags(n) {
this.tagActive = n;
}
},
};
</script>
<style lang="less" scoped>

@ -8,40 +8,40 @@
*/
export default [
{
key: '1',
title: '信息管理',
path: '/info',
},
{
key: '2',
title: '用户管理',
path: '/user',
children: [
{
key: '2.1',
title: '后台用户',
path: '/adminUser',
children: [
{
key: '2.1.1',
title: '新增用户',
path: '/addAdminUser',
children: [
{
key: '2.1.1。1',
title: '用户xx',
path: '/addAdminUserXX',
}
]
}
]
},
{
key: '2.2',
title: '前台用户',
path: '/frontUser',
}
]
},
{
key: '1',
title: '信息管理',
path: '/info',
},
{
key: '2',
title: '用户管理',
path: '/user',
children: [
{
key: '2.1',
title: '后台用户',
path: '/adminUser',
children: [
{
key: '2.1.1',
title: '新增用户',
path: '/addAdminUser',
children: [
{
key: '2.1.1。1',
title: '用户xx',
path: '/addAdminUserXX',
}
]
}
]
},
{
key: '2.2',
title: '前台用户',
path: '/frontUser',
}
]
},
]

@ -22,7 +22,7 @@
import ost from "../ost";
import { Menu } from 'ant-design-vue';
const SubMenu = {
template: `
template: `
<a-sub-menu :key="menuInfo.key" v-bind="$props" v-on="$listeners">
<span slot="title">
<a-icon v-if="menuInfo.icon" :type="menuInfo.icon" /><span>{{ menuInfo.title }}</span>
@ -36,128 +36,128 @@ const SubMenu = {
</template>
</a-sub-menu>
`,
name: 'SubMenu',
// must add isSubMenu: true
isSubMenu: true,
props: {
// a-sub-menu使
...Menu.SubMenu.props,
// Cannot overlap with properties within Menu.SubMenu.props
menuInfo: {
type: Object,
default: () => ({}),
},
},
name: 'SubMenu',
// must add isSubMenu: true
isSubMenu: true,
props: {
// a-sub-menu使
...Menu.SubMenu.props,
// Cannot overlap with properties within Menu.SubMenu.props
menuInfo: {
type: Object,
default: () => ({}),
},
},
};
export default {
name: "yMenu",
props: {
csd: {
type: Boolean,
default: false,
indexPath: 0
},
num:Number,
},
watch: {
csd: {
handler(val) {
this.collapsed = val
},
immediate: true
},
$route: {
handler(val) {
let secPath = [val.path];
this.selectedKeys = secPath;
this.setSelectedKeys(secPath);
},
immediate: true,
},
// num
num:{
handler() {
this.initMenu()
},
immediate: true,
}
name: "yMenu",
props: {
csd: {
type: Boolean,
default: false,
indexPath: 0
},
num:Number,
},
watch: {
csd: {
handler(val) {
this.collapsed = val
},
immediate: true
},
$route: {
handler(val) {
let secPath = [val.path];
this.selectedKeys = secPath;
this.setSelectedKeys(secPath);
},
immediate: true,
},
// num
num:{
handler() {
this.initMenu()
},
immediate: true,
}
},
components: {
'sub-menu': SubMenu,
},
data() {
return {
list: ost,
collapsed: false,
openKeys: [],
selectedKeys: [],
defaultSelectedKeys: []
};
},
created() {
this.openKeys = this.getOpenKeys;
this.defaultSelectedKeys = this.getSelectedKeys;
this.initMenu();
},
methods: {
handlerSelect({selectedKeys}) {
this.selectedKeys = selectedKeys;
this.setSelectedKeys(selectedKeys);
},
components: {
'sub-menu': SubMenu,
},
data() {
return {
list: ost,
collapsed: false,
openKeys: [],
selectedKeys: [],
defaultSelectedKeys: []
};
},
created() {
this.openKeys = this.getOpenKeys;
this.defaultSelectedKeys = this.getSelectedKeys;
this.initMenu();
},
methods: {
handlerSelect({selectedKeys}) {
this.selectedKeys = selectedKeys;
this.setSelectedKeys(selectedKeys);
},
handlerOpen(val) {
this.setOpenKeys(val);
},
menuClick({key}) {
this.$router.push(key)
},
initMenu() {
// console.log(this.$router);
// console.log(sessionStorage.getItem('modal'));
let modal= sessionStorage.getItem('modal')
let routes = this.$router.options.routes || [];
let farr = routes.filter(ele => {
return ele.name === modal
});
let arr = farr[0].children || [];
let menus = [];
this.routerToMenu(arr, menus);
this.list = menus;
let path = farr[0].redirect
this.$router.push({path:path})
},
//
routerToMenu(arr = [], menus) {
for(let i = 0; i < arr.length; i++) {
this.indexPath++
if(!arr[i].children && !arr[i].hide) {
let obj = {
key: this.indexPath,
title: arr[i].title,
path: arr[i].path,
hide: arr[i].hide,
icon: arr[i].icon || ''
}
menus.push(obj)
}
if(arr[i].children) {
let obj = {
key: this.indexPath,
title: arr[i].title,
path: arr[i].path,
hide: arr[i].hide || false,
icon: arr[i].icon || '',
children: []
}
menus.push(obj);
this.routerToMenu(arr[i].children, obj.children)
}
}
// console.log(menus);
}
},
handlerOpen(val) {
this.setOpenKeys(val);
},
menuClick({key}) {
this.$router.push(key)
},
initMenu() {
// console.log(this.$router);
// console.log(sessionStorage.getItem('modal'));
let modal= sessionStorage.getItem('modal')
let routes = this.$router.options.routes || [];
let farr = routes.filter(ele => {
return ele.name === modal
});
let arr = farr[0].children || [];
let menus = [];
this.routerToMenu(arr, menus);
this.list = menus;
let path = farr[0].redirect
this.$router.push({path:path})
},
//
routerToMenu(arr = [], menus) {
for(let i = 0; i < arr.length; i++) {
this.indexPath++
if(!arr[i].children && !arr[i].hide) {
let obj = {
key: this.indexPath,
title: arr[i].title,
path: arr[i].path,
hide: arr[i].hide,
icon: arr[i].icon || ''
}
menus.push(obj)
}
if(arr[i].children) {
let obj = {
key: this.indexPath,
title: arr[i].title,
path: arr[i].path,
hide: arr[i].hide || false,
icon: arr[i].icon || '',
children: []
}
menus.push(obj);
this.routerToMenu(arr[i].children, obj.children)
}
}
// console.log(menus);
}
}
}
};
</script>

@ -189,96 +189,96 @@
<script>
import { loginTel, sendTelCode } from "../../api/public/login";
export default {
name: "Login",
data() {
return {
status: 1,
activeName: "2",
form: {
tel: "",
code: "",
},
rules: {
tel: [
{
required: true,
message: "请输入手机号",
trigger: "blur",
},
{
min: 11,
max: 11,
message: "姓名长度必须为 11 位",
trigger: "blur",
},
],
name: [
{
required: true,
message: "请输入姓名",
trigger: "blur",
},
{
min: 3,
max: 5,
message: "姓名长度必须为 3 至 5位",
trigger: "blur",
},
],
},
};
},
created() {
this.keyupEnter();
},
methods: {
// enter
keyupEnter() {
document.onkeydown = (e) => {
if (e.keyCode === 13 && e.target.baseURI.match(/loginTel/)) {
//
this.login();
}
};
},
login() {
loginTel(this.form).then(res=>{
if (res.code === 200) {
this.$message.success(res.msg);
this.setToken(res.data);
this.$router.push("/");
} else {
this.$message.error(res.msg);
}
})
},
//
getCode() {
sendTelCode(this.form).then((res) => {
if (res) {
// this.$message.success("");
this.$message.success(res.msg +' ' +res.data);
}
});
},
onSubmit() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
alert("submit!");
} else {
console.log("error submit!!");
return false;
}
});
},
//
resetForm() {
this.$refs.ruleForm.resetFields();
},
tabsSwitch() {
console.log(this.activeName);
},
},
name: "Login",
data() {
return {
status: 1,
activeName: "2",
form: {
tel: "",
code: "",
},
rules: {
tel: [
{
required: true,
message: "请输入手机号",
trigger: "blur",
},
{
min: 11,
max: 11,
message: "姓名长度必须为 11 位",
trigger: "blur",
},
],
name: [
{
required: true,
message: "请输入姓名",
trigger: "blur",
},
{
min: 3,
max: 5,
message: "姓名长度必须为 3 至 5位",
trigger: "blur",
},
],
},
};
},
created() {
this.keyupEnter();
},
methods: {
// enter
keyupEnter() {
document.onkeydown = (e) => {
if (e.keyCode === 13 && e.target.baseURI.match(/loginTel/)) {
//
this.login();
}
};
},
login() {
loginTel(this.form).then(res=>{
if (res.code === 200) {
this.$message.success(res.msg);
this.setToken(res.data);
this.$router.push("/");
} else {
this.$message.error(res.msg);
}
})
},
//
getCode() {
sendTelCode(this.form).then((res) => {
if (res) {
// this.$message.success("");
this.$message.success(res.msg +' ' +res.data);
}
});
},
onSubmit() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
alert("submit!");
} else {
console.log("error submit!!");
return false;
}
});
},
//
resetForm() {
this.$refs.ruleForm.resetFields();
},
tabsSwitch() {
console.log(this.activeName);
},
},
};
</script>

@ -7,11 +7,11 @@
* @FilePath: /ansu-business/vue.config.js
*/
module.exports = {
// ...
runtimeCompiler: true,
devServer: {
port: "8443",
},
// ...
runtimeCompiler: true,
devServer: {
port: "8443",
},
// ...
};
// ...
};

15919
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save