| | |
| | | "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", |
New file |
| | |
| | | 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; |
| | |
| | | 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 { |
New file |
| | |
| | | import axios from "@/assets/axios"; |
| | | |
| | | /** |
| | | * 查询所有用户信息 |
| | | * @returns |
| | | */ |
| | | export const getAllUser = () => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "docUser/getAllUser" |
| | | }) |
| | | } |
New file |
| | |
| | | import list from './list' |
| | | export default list |
New file |
| | |
| | | <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> |
| | | |
| | | |
| | | |
| | |
| | | import TabsView from '@/layouts/tabs/TabsView' |
| | | import BlankView from '@/layouts/BlankView' |
| | | import PageView from '@/layouts/PageView' |
| | | // import PageView from '@/layouts/PageView' |
| | | |
| | | // 路由配置 |
| | | const options = { |
| | |
| | | children: [ |
| | | { |
| | | path: 'dashboard', |
| | | name: 'Dashboard', |
| | | name: '图纸管理', |
| | | meta: { |
| | | icon: 'dashboard' |
| | | }, |
| | | component: BlankView, |
| | | children: [ |
| | | { |
| | | path: 'workplace', |
| | | name: '工作台', |
| | | path: 'docCenter', |
| | | name: '图纸中心', |
| | | meta: { |
| | | page: { |
| | | closable: false |
| | |
| | | }, |
| | | { |
| | | 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'), |
| | | // } |
| | | ] |
| | | }, |
| | | ] |