outaozhen 5 年之前
父节点
当前提交
77dde1b68b

+ 0 - 486
mock/contact.js

@@ -1,486 +0,0 @@
-const dataSource = [
-  {
-    key: '1',
-    clientname: '刘泽富',
-    companyname: '重庆秀山县公路局',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: '协作标签1',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  },
-  {
-    key: '2',
-    clientname: '李功信',
-    companyname: '西和县财政局',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: 'adada测试',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  },
-  {
-    key: '3',
-    clientname: '孙杨',
-    companyname: '甘肃恒和交通工程科技开发有限公司',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: 'adada测试',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  },
-  {
-    key: '4',
-    clientname: '刘泽富',
-    companyname: '重庆秀山县公路局',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: 'adada测试',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  },
-  {
-    key: '5',
-    clientname: '李功信',
-    companyname: '西和县财政局',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: 'adada测试',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  },
-  {
-    key: '6',
-    clientname: '孙杨',
-    companyname: '甘肃恒和交通工程科技开发有限公司',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: 'adada测试',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  },
-  {
-    key: '7',
-    clientname: '刘泽富',
-    companyname: '重庆秀山县公路局',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: 'adada测试',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  },
-  {
-    key: '8',
-    clientname: '李功信',
-    companyname: '西和县财政局',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: 'adada测试',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  },
-  {
-    key: '9',
-    clientname: '孙杨',
-    companyname: '甘肃恒和交通工程科技开发有限公司',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: 'adada测试',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  },
-  {
-    key: '10',
-    clientname: '刘泽富',
-    companyname: '重庆秀山县公路局',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: 'adada测试',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  },
-  {
-    key: '11',
-    clientname: '李功信',
-    companyname: '西和县财政局',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: 'adada测试',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  },
-  {
-    key: '12',
-    clientname: '孙杨',
-    companyname: '甘肃恒和交通工程科技开发有限公司',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: 'adada测试',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  },
-  {
-    key: '13',
-    clientname: '孙杨',
-    companyname: '甘肃恒和交通工程科技开发有限公司',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: 'adada测试',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  },
-  {
-    key: '14',
-    clientname: '孙杨',
-    companyname: '甘肃恒和交通工程科技开发有限公司',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: 'adada测试',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  },
-  {
-    key: '15',
-    clientname: '孙杨',
-    companyname: '甘肃恒和交通工程科技开发有限公司',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: 'adada测试',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  },
-  {
-    key: '16',
-    clientname: '孙杨',
-    companyname: '甘肃恒和交通工程科技开发有限公司',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: 'adada测试',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  },
-  {
-    key: '17',
-    clientname: '孙杨',
-    companyname: '甘肃恒和交通工程科技开发有限公司',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: 'adada测试',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  },
-  {
-    key: '18',
-    clientname: '孙杨',
-    companyname: '甘肃恒和交通工程科技开发有限公司',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: 'adada测试',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  },
-  {
-    key: '19',
-    clientname: '孙杨',
-    companyname: '甘肃恒和交通工程科技开发有限公司',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: 'adada测试',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  },
-  {
-    key: '20',
-    clientname: '孙杨',
-    companyname: '甘肃恒和交通工程科技开发有限公司',
-    department: '部门',
-    telephone: '13896881179',
-    phone: '13896881179',
-    qq: 'qq',
-    email: '171247210@qq.com',
-    position: '职务',
-    office: '办公室',
-    local: '地区',
-    tag: '测试test',
-    tooltip: 'adada测试',
-    address: '地址',
-    ride: '乘车',
-    landmarks: '地标',
-    stay: '住宿',
-    mark: '备注',
-    keynum: 'ZH-06272',
-    dasikong: '大司空',
-    yanghuyun: '养护云',
-    chuanpeople: '创建人'
-  }
-]
-
-export default {
-  'GET /api/contact': dataSource
-}

+ 0 - 15
mock/curinglist.js

@@ -1,15 +0,0 @@
-const curinglist = [
-  {
-    key:'1',
-    productname:'重庆养护(2018)',
-    majorcont:'已升级(@刘飞 6月5日 13:32)'
-  },
-  {
-    key:'2',
-    productname:'广东养护(2018)',
-    majorcont:''
-  },
-]
-export default {
-  'GET /api/curinglist': curinglist
-}

+ 0 - 25
mock/journallist.js

@@ -1,25 +0,0 @@
-const journal = [
-  {
-    operation:'@陈特 移除 大司空云计价 15812345678',
-    date:'5月5日 14:55'
-  },
-  {
-    operation:'@陈特 关联 养护云造价 15812345678',
-    date:'5月5日 14:55'
-  },
-  {
-    operation:'@陈特 将手机 15800000000 改为 15812345678;将客户 珠海纵横创新软件有限公司 改为 北京旺圣干科技有限公司',
-    date:'5月5日 14:55'
-  },
-  {
-    operation:'@陈特 将客户 改为 珠海纵横创新软件有限公司',
-    date:'5月5日 14:55'
-  },
-  {
-    operation:'@陈特 创建',
-    date:'5月5日 14:55'
-  },
-]
-export default {
-  'GET /api/journallist': journal
-}

+ 0 - 178
mock/listTableList.js

@@ -1,178 +0,0 @@
-// eslint-disable-next-line import/no-extraneous-dependencies
-import { parse } from 'url';
-
-// mock tableListDataSource
-const genList = (current, pageSize) => {
-  const tableListDataSource = [];
-
-  for (let i = 0; i < pageSize; i += 1) {
-    const index = (current - 1) * 10 + i;
-    tableListDataSource.push({
-      key: index,
-      disabled: i % 6 === 0,
-      href: 'https://ant.design',
-      avatar: [
-        'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-      ][i % 2],
-      name: `TradeCode ${index}`,
-      owner: '曲丽丽',
-      desc: '这是一段描述',
-      callNo: Math.floor(Math.random() * 1000),
-      status: Math.floor(Math.random() * 10) % 4,
-      updatedAt: new Date(),
-      createdAt: new Date(),
-      progress: Math.ceil(Math.random() * 100),
-    });
-  }
-
-  tableListDataSource.reverse();
-  return tableListDataSource;
-};
-
-let tableListDataSource = genList(1, 100);
-
-function getRule(req, res, u) {
-  let realUrl = u;
-
-  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
-    realUrl = req.url;
-  }
-
-  const { current = 1, pageSize = 10 } = req.query;
-  const params = parse(realUrl, true).query;
-  let dataSource = [...tableListDataSource].slice((current - 1) * pageSize, current * pageSize);
-  const sorter = JSON.parse(params.sorter);
-
-  if (sorter) {
-    dataSource = dataSource.sort((prev, next) => {
-      let sortNumber = 0;
-      Object.keys(sorter).forEach((key) => {
-        if (sorter[key] === 'descend') {
-          if (prev[key] - next[key] > 0) {
-            sortNumber += -1;
-          } else {
-            sortNumber += 1;
-          }
-
-          return;
-        }
-
-        if (prev[key] - next[key] > 0) {
-          sortNumber += 1;
-        } else {
-          sortNumber += -1;
-        }
-      });
-      return sortNumber;
-    });
-  }
-
-  if (params.filter) {
-    const filter = JSON.parse(params.filter);
-
-    if (Object.keys(filter).length > 0) {
-      dataSource = dataSource.filter((item) => {
-        return Object.keys(filter).some((key) => {
-          if (!filter[key]) {
-            return true;
-          }
-
-          if (filter[key].includes(`${item[key]}`)) {
-            return true;
-          }
-
-          return false;
-        });
-      });
-    }
-  }
-
-  if (params.name) {
-    dataSource = dataSource.filter((data) => data.name.includes(params.name || ''));
-  }
-
-  const result = {
-    data: dataSource,
-    total: tableListDataSource.length,
-    success: true,
-    pageSize,
-    current: parseInt(`${params.currentPage}`, 10) || 1,
-  };
-  return res.json(result);
-}
-
-function postRule(req, res, u, b) {
-  let realUrl = u;
-
-  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
-    realUrl = req.url;
-  }
-
-  const body = (b && b.body) || req.body;
-  const { method, name, desc, key } = body;
-
-  switch (method) {
-    /* eslint no-case-declarations:0 */
-    case 'delete':
-      tableListDataSource = tableListDataSource.filter((item) => key.indexOf(item.key) === -1);
-      break;
-
-    case 'post':
-      (() => {
-        const i = Math.ceil(Math.random() * 10000);
-        const newRule = {
-          key: tableListDataSource.length,
-          href: 'https://ant.design',
-          avatar: [
-            'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-            'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-          ][i % 2],
-          name,
-          owner: '曲丽丽',
-          desc,
-          callNo: Math.floor(Math.random() * 1000),
-          status: Math.floor(Math.random() * 10) % 2,
-          updatedAt: new Date(),
-          createdAt: new Date(),
-          progress: Math.ceil(Math.random() * 100),
-        };
-        tableListDataSource.unshift(newRule);
-        return res.json(newRule);
-      })();
-
-      return;
-
-    case 'update':
-      (() => {
-        let newRule = {};
-        tableListDataSource = tableListDataSource.map((item) => {
-          if (item.key === key) {
-            newRule = { ...item, desc, name };
-            return { ...item, desc, name };
-          }
-
-          return item;
-        });
-        return res.json(newRule);
-      })();
-
-      return;
-
-    default:
-      break;
-  }
-
-  const result = {
-    list: tableListDataSource,
-    pagination: {
-      total: tableListDataSource.length,
-    },
-  };
-  res.json(result);
-}
-
-export default {
-  'GET /api/rule': getRule,
-  'POST /api/rule': postRule,
-};

+ 0 - 103
mock/notices.js

@@ -1,103 +0,0 @@
-const getNotices = (req, res) => {
-  res.json([
-    {
-      id: '000000001',
-      avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
-      title: '你收到了 14 份新周报',
-      datetime: '2017-08-09',
-      type: 'notification',
-    },
-    {
-      id: '000000002',
-      avatar: 'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png',
-      title: '你推荐的 曲妮妮 已通过第三轮面试',
-      datetime: '2017-08-08',
-      type: 'notification',
-    },
-    {
-      id: '000000003',
-      avatar: 'https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png',
-      title: '这种模板可以区分多种通知类型',
-      datetime: '2017-08-07',
-      read: true,
-      type: 'notification',
-    },
-    {
-      id: '000000004',
-      avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png',
-      title: '左侧图标用于区分不同的类型',
-      datetime: '2017-08-07',
-      type: 'notification',
-    },
-    {
-      id: '000000005',
-      avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
-      title: '内容不要超过两行字,超出时自动截断',
-      datetime: '2017-08-07',
-      type: 'notification',
-    },
-    {
-      id: '000000006',
-      avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg',
-      title: '曲丽丽 评论了你',
-      description: '描述信息描述信息描述信息',
-      datetime: '2017-08-07',
-      type: 'message',
-      clickClose: true,
-    },
-    {
-      id: '000000007',
-      avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg',
-      title: '朱偏右 回复了你',
-      description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像',
-      datetime: '2017-08-07',
-      type: 'message',
-      clickClose: true,
-    },
-    {
-      id: '000000008',
-      avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg',
-      title: '标题',
-      description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像',
-      datetime: '2017-08-07',
-      type: 'message',
-      clickClose: true,
-    },
-    {
-      id: '000000009',
-      title: '任务名称',
-      description: '任务需要在 2017-01-12 20:00 前启动',
-      extra: '未开始',
-      status: 'todo',
-      type: 'event',
-    },
-    {
-      id: '000000010',
-      title: '第三方紧急代码变更',
-      description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务',
-      extra: '马上到期',
-      status: 'urgent',
-      type: 'event',
-    },
-    {
-      id: '000000011',
-      title: '信息安全考试',
-      description: '指派竹尔于 2017-01-09 前完成更新并发布',
-      extra: '已耗时 8 天',
-      status: 'doing',
-      type: 'event',
-    },
-    {
-      id: '000000012',
-      title: 'ABCD 版本发布',
-      description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务',
-      extra: '进行中',
-      status: 'processing',
-      type: 'event',
-    },
-  ]);
-};
-
-export default {
-  'GET /api/notices': getNotices,
-};

+ 0 - 7
mock/route.js

@@ -1,7 +0,0 @@
-export default {
-  '/api/auth_routes': {
-    '/form/advanced-form': {
-      authority: ['admin', 'user'],
-    },
-  },
-};

+ 0 - 30
mock/servicelist.js

@@ -1,30 +0,0 @@
-const servicecont = [
-  {
-    key:'1',
-    typedate:'@陈特 上门服务 5月5日 14:55',
-    servicecont:'1-给彭工更新了软件程序,安装演示了软。2-单位彭工要考甲乙级考试,给他带了资料过去。3-表示论文发表评职称也可以随时联系我。'
-  },
-  {
-    key:'2',
-    typedate:'@陈特 上门服务 5月5日 14:55',
-    servicecont:'1-给彭工更新了软件程序,安装演示了软。2-单位彭工要考甲乙级考试,给他带了资料过去。3-表示论文发表评职称也可以随时联系我。'
-  },
-  {
-    key:'3',
-    typedate:'@陈特 上门服务 5月5日 14:55',
-    servicecont:'1-给彭工更新了软件程序,安装演示了软。2-单位彭工要考甲乙级考试,给他带了资料过去。3-表示论文发表评职称也可以随时联系我。'
-  },
-  {
-    key:'4',
-    typedate:'@陈特 上门服务 5月5日 14:55',
-    servicecont:'1-给彭工更新了软件程序,安装演示了软。2-单位彭工要考甲乙级考试,给他带了资料过去。3-表示论文发表评职称也可以随时联系我。'
-  },
-  {
-    key:'5',
-    typedate:'@陈特 上门服务 5月5日 14:55',
-    servicecont:'1-给彭工更新了软件程序,安装演示了软。2-单位彭工要考甲乙级考试,给他带了资料过去。3-表示论文发表评职称也可以随时联系我。'
-  },
-]
-export default {
-  'GET /api/servicelist': servicecont
-}

文件差异内容过多而无法显示
+ 0 - 133
mock/user.js


+ 11 - 2
src/pages/Staff/Employee/components/RoleMenu/index.jsx

@@ -8,6 +8,15 @@ import { ModalForm, ProFormText } from '@ant-design/pro-form'
 
 const RoleMenu = props => {
   const { dispatch, departments = [], onSelect } = props
+  const newList = [...departments]
+  newList.unshift({
+    children: [],
+    id: '0',
+    key: '0',
+    isLeaf: false,
+    name: '总全公司',
+    title: '总全公司'
+  })
   const { DirectoryTree } = Tree
 
   const initData = () => {
@@ -80,11 +89,11 @@ const RoleMenu = props => {
           <DirectoryTree
             multiple
             defaultExpandAll
-            defaultSelectedKeys={['McjlMdO0O0Oi']}
+            defaultSelectedKeys={['0']}
             onSelect={keys => saveActiveId(keys[0])}
             onExpand={onExpand}
             showIcon={false}
-            treeData={departments}
+            treeData={newList}
           />
         )}
       </div>

+ 36 - 5
src/pages/Staff/Employee/index.jsx

@@ -1,11 +1,13 @@
 import React, { useState, useEffect } from 'react'
 import consts from '@/consts'
 import ProTable from '@ant-design/pro-table'
+import { Button, Popconfirm } from 'antd'
 import { useModal } from '@/components/Modal'
 import RoleMenu from '@/pages/Staff/Employee/components/RoleMenu'
 import { queryStaff } from '@/services/staff'
 import { useTableScroll } from '@/hooks/useAutoTable'
 import EmployeeDetail from '@/pages/staff/Employee/components/EmployeeDetail'
+import { delDepartment } from '@/services/department'
 
 const Employee = () => {
   const [selectKeys, setSelectKeys] = useState([])
@@ -105,11 +107,33 @@ const Employee = () => {
   const onSelect = id => {
     setState({ ...state, params: { id } })
   }
+
+  const handledelDepartment = async values => {
+    const { code = -1 } = await delDepartment({ ...values })
+    if (code === consts.RET_CODE.SUCCESS) {
+      message.success('删除成功')
+      initData()
+    }
+  }
+
   return (
     <div className="h-full w-full flex flex-row">
       <RoleMenu onSelect={onSelect} />
       <div className="w-max-3/4">
-        <div className="ml-8 shadow-hex-3e2c5a">
+        <div className="ml-8 shadow-hex-3e2c5a relative">
+          <div className="absolute right-33 top-3 z-100">
+            {state.params.id && (
+              <Popconfirm
+                title="确认删除吗?"
+                onText="确认"
+                cancelText="取消"
+                onConfirm={handledelDepartment}>
+                <Button danger size="small">
+                  删除
+                </Button>
+              </Popconfirm>
+            )}
+          </div>
           {state.params.id && (
             <ProTable
               bordered
@@ -117,10 +141,8 @@ const Employee = () => {
               rowKey={record => record.id}
               columns={columns}
               request={async params => {
-                const {
-                  code = -1,
-                  data: { list = [], total = 0 } = { list: [], total: 0 }
-                } = await queryStaff({ ...params })
+                const { code = -1, data: { list = [], total = 0 } = { list: [], total: 0 } } =
+                  await queryStaff({ ...params })
                 return {
                   data: list,
                   success: code === consts.RET_CODE.SUCCESS,
@@ -129,6 +151,15 @@ const Employee = () => {
               }}
               scroll={getScrollRef}
               search={{ filterType: 'light' }}
+              // toolbar={{
+              //   actions: [
+              //     <Popconfirm title="确认删除吗?">
+              //       <Button danger size="small">
+              //         删除
+              //       </Button>
+              //     </Popconfirm>
+              //   ]
+              // }}
             />
           )}
         </div>