研发图纸文件管理系统-前端项目
he wei
2022-07-13 2a1bf7109e2318394e10b2d41aeb86c951a84b72
UA 用户列表
3个文件已修改
5个文件已添加
245 ■■■■■ 已修改文件
.env.dev 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/axios.js 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/login/Login.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/user/apis.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/user/index.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/user/list.vue 156 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/config.js 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.dev
New file
@@ -0,0 +1 @@
NODE_ENV=dev
package.json
@@ -4,7 +4,7 @@
  "homepage": "",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "serve": "vue-cli-service serve --mode dev",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint",
    "predeploy": "yarn build",
src/assets/axios.js
New file
@@ -0,0 +1,31 @@
import Vue from 'vue';
import axios from 'axios';
if (process.env.NODE_ENV == 'dev') {
  // 跨域请求
  axios.defaults.baseURL = 'http://localhost:8092/cad/';
  axios.defaults.withCredentials = true;  // 保持请求头
} else {
  axios.defaults.baseURL = location.protocol + '//' + location.host + '/cad/';
}
// 添加请求拦截器
axios.interceptors.request.use(function (config) {
  // 在发送请求之前做些什么
  return config;
}, function (error) {
  // 对请求错误做些什么
  return Promise.reject(error);
});
// 添加响应拦截器
axios.interceptors.response.use(function (response) {
  // 对响应数据做点什么
  return response;
}, function (error) {
  return Promise.reject(error);
});
Vue.prototype.$axios = axios;
export default axios;
src/pages/login/Login.vue
@@ -114,7 +114,7 @@
        getRoutesConfig().then(result => {
          const routesConfig = result.data.data
          loadRoutes(routesConfig)
          this.$router.push('/dashboard/workplace')
          this.$router.push('/dashboard/docCenter')
          this.$message.success(loginRes.message, 3)
        })
      } else {
src/pages/user/apis.js
New file
@@ -0,0 +1,12 @@
import axios from "@/assets/axios";
/**
 * 查询所有用户信息
 * @returns
 */
export const getAllUser = () => {
  return axios({
    method: "GET",
    url: "docUser/getAllUser"
  })
}
src/pages/user/index.js
New file
@@ -0,0 +1,2 @@
import list from './list'
export default list
src/pages/user/list.vue
New file
@@ -0,0 +1,156 @@
<template>
  <a-card>
    <div>
      <a-space class="operator">
        <a-button @click="addNew" type="primary">新建</a-button>
      </a-space>
      <advance-table
        :columns="columns"
        :data-source="dataSource"
        title="用户列表"
        :loading="loading"
        rowKey="id"
        @search="onSearch"
        @refresh="onRefresh"
        :format-conditions="true"
        @reset="onReset"
        :pagination="{
          current: page,
          pageSize: pageSize,
          total: total,
          showSizeChanger: true,
          showLessItems: true,
          showQuickJumper: true,
          showTotal: (total, range) =>
            `第 ${range[0]}-${range[1]} 条,总计 ${total} 条`,
          onChange: onPageChange,
          onShowSizeChange: onSizeChange,
        }"
      >
        <template slot="statusTitle">
          状态<a-icon style="margin: 0 4px" type="info-circle" />
        </template>
        <template slot="send" slot-scope="{ text }">
          {{ text ? "是" : "否" }}
        </template>
        <template slot="status" slot-scope="{ text }">
          {{ text | statusStr }}
        </template>
      </advance-table>
    </div>
  </a-card>
</template>
<script>
import AdvanceTable from "@/components/table/advance/AdvanceTable";
import { getAllUser } from "./apis";
export default {
  name: "",
  components: { AdvanceTable },
  data() {
    return {
      loading: false,
      page: 1,
      pageSize: 10,
      total: 0,
      columns: [
        {
          title: "姓名",
          dataIndex: "name",
          searchAble: true,
        },
        {
          title: "座机",
          dataIndex: "tel",
        },
        {
          title: "手机",
          dataIndex: "phone",
        },
        {
          title: "组别",
          dataIndex: ["depart", "departName"],
        },
        {
          title: "权限",
          dataIndex: ["drole", "roleName"],
        },
      ],
      dataSource: [],
      conditions: {},
    };
  },
  created() {
    this.getGoodList();
    this.getColumns();
  },
  methods: {
    getGoodList() {
      this.loading = true;
      // const { page, pageSize, conditions } = this;
      getAllUser().then((res) => {
        console.log(res);
      });
      //   ds.goodsList({ page, pageSize, ...conditions }).then((result) => {
      //     const { list, page, pageSize, total } = result.data.data;
      //     this.dataSource = list;
      //     this.page = page;
      //     this.total = total;
      //     this.pageSize = pageSize;
      //     this.loading = false;
      //   });
    },
    getColumns() {
      // ds.goodsColumns().then((res) => {
      //   this.columns = res.data;
      // });
    },
    onSearch(conditions, searchOptions) {
      console.log(searchOptions);
      this.page = 1;
      this.conditions = conditions;
      this.getGoodList();
    },
    onSizeChange(current, size) {
      this.page = 1;
      this.pageSize = size;
      this.getGoodList();
    },
    onRefresh(conditions) {
      this.conditions = conditions;
      this.getGoodList();
    },
    onReset(conditions) {
      this.conditions = conditions;
      this.getGoodList();
    },
    onPageChange(page, pageSize) {
      this.page = page;
      this.pageSize = pageSize;
      this.getGoodList();
    },
  },
};
</script>
<style lang="less" scoped>
.search {
  margin-bottom: 54px;
}
.fold {
  width: calc(100% - 216px);
  display: inline-block;
}
.operator {
  margin-bottom: 18px;
}
@media screen and (max-width: 900px) {
  .fold {
    width: 100%;
  }
}
</style>
src/router/config.js
@@ -1,6 +1,6 @@
import TabsView from '@/layouts/tabs/TabsView'
import BlankView from '@/layouts/BlankView'
import PageView from '@/layouts/PageView'
// import PageView from '@/layouts/PageView'
// 路由配置
const options = {
@@ -28,15 +28,15 @@
      children: [
        {
          path: 'dashboard',
          name: 'Dashboard',
          name: '图纸管理',
          meta: {
            icon: 'dashboard'
          },
          component: BlankView,
          children: [
            {
              path: 'workplace',
              name: '工作台',
              path: 'docCenter',
              name: '图纸中心',
              meta: {
                page: {
                  closable: false
@@ -46,37 +46,32 @@
            },
            {
              path: 'analysis',
              name: '分析页',
              name: '图纸审批',
              component: () => import('@/pages/dashboard/analysis'),
            }
          ]
        },
        {
          path: 'form',
          name: '表单页',
          path: 'user',
          name: '用户',
          meta: {
            icon: 'form',
            icon: 'user',
            page: {
              cacheAble: false
            }
          },
          component: PageView,
          component: BlankView,
          children: [
            {
              path: 'basic',
              name: '基础表单',
              component: () => import('@/pages/form/basic'),
              path: 'list',
              name: '用户信息',
              component: () => import('@/pages/user'),
            },
            {
              path: 'step',
              name: '分步表单',
              component: () => import('@/pages/form/step'),
            },
            {
              path: 'advance',
              name: '高级表单',
              component: () => import('@/pages/form/advance'),
            }
            // {
            //   path: 'power',
            //   name: '角色管理',
            //   component: () => import('@/pages/user/power'),
            // }
          ]
        },
      ]