| | |
| | | "parser": "babel-eslint" |
| | | }, |
| | | "rules": { |
| | | <<<<<<< Updated upstream |
| | | "no-debugger":"off" |
| | | ======= |
| | | "no-unused-vars": "off", |
| | | "vue/no-unused-components": "off" |
| | | >>>>>>> Stashed changes |
| | | } |
| | | }, |
| | | "browserslist": [ |
New file |
| | |
| | | <template> |
| | | <div |
| | | class="flex-layout" |
| | | :class="getRootClass" |
| | | :style="getRootStyle" |
| | | v-loading="loading" |
| | | element-loading-text="拼命加载中" |
| | | element-loading-spinner="el-icon-loading" |
| | | element-loading-background="rgba(0, 0, 0, 0.2)" |
| | | > |
| | | <div class="flex-layout-header"> |
| | | <slot name="header"></slot> |
| | | </div> |
| | | <div class="flex-layout-body" :class="{ 'no-bg': noBg }"> |
| | | <slot></slot> |
| | | </div> |
| | | <div class="flex-layout-footer"> |
| | | <slot name="footer"></slot> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | props: { |
| | | direction: { |
| | | type: String, |
| | | default: "", |
| | | }, |
| | | height: { |
| | | type: String, |
| | | default: "100%", |
| | | }, |
| | | noBg: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | loading: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | }, |
| | | computed: { |
| | | getRootClass: function() { |
| | | return { |
| | | "direction-row": this.direction == "row" ? true : false, |
| | | }; |
| | | }, |
| | | getRootStyle: function() { |
| | | return { |
| | | height: this.height, |
| | | }; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .flex-layout { |
| | | display: flex; |
| | | flex-direction: column; |
| | | height: 100%; |
| | | } |
| | | .flex-layout.direction-row { |
| | | flex-direction: row; |
| | | } |
| | | .flex-layout.full-ht { |
| | | height: 100%; |
| | | } |
| | | |
| | | .flex-layout-body { |
| | | flex: 1; |
| | | overflow-x: hidden; |
| | | overflow-y: auto; |
| | | } |
| | | .flex-layout-body.no-bg { |
| | | background-color: #05227200; |
| | | } |
| | | </style> |
| | |
| | | * 查询所有用户信息 |
| | | * @returns |
| | | */ |
| | | export const getAllUser = () => { |
| | | export const getAllUser = (params) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "docUser/getAllUser" |
| | | url: "docUser/getAllUser", |
| | | params |
| | | }) |
| | | } |
| | |
| | | <a-card> |
| | | <div> |
| | | <a-space class="operator"> |
| | | <a-button @click="addNew" type="primary">新建</a-button> |
| | | <!-- <a-button @click="addNew" type="primary">新建</a-button> --> |
| | | </a-space> |
| | | <advance-table |
| | | :columns="columns" |
| | |
| | | :format-conditions="true" |
| | | @reset="onReset" |
| | | :pagination="{ |
| | | current: page, |
| | | current: pageCurr, |
| | | pageSize: pageSize, |
| | | total: total, |
| | | showSizeChanger: true, |
| | | showLessItems: true, |
| | | showQuickJumper: true, |
| | | pageSizeOptions: ['2', '4', '10'], |
| | | 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 slot="operation" slot-scope="text"> |
| | | <span> |
| | | <a @click="edit(text)">编辑</a> |
| | | <a-divider type="vertical" /> |
| | | <a-popconfirm |
| | | title="是否要删除此行?" |
| | | @confirm="remove(text)" |
| | | > |
| | | <a>删除</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | </template> |
| | | </advance-table> |
| | | </div> |
| | | <!-- 编辑用户 --> |
| | | <a-modal :visible="editShow" title="编辑用户" @ok="handleOk"> |
| | | <user-info :info="userData"></user-info> |
| | | </a-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import AdvanceTable from "@/components/table/advance/AdvanceTable"; |
| | | import UserInfo from "./components/userInfo"; |
| | | import { getAllUser } from "./apis"; |
| | | |
| | | export default { |
| | | name: "", |
| | | components: { AdvanceTable }, |
| | | components: { AdvanceTable, UserInfo }, |
| | | data() { |
| | | return { |
| | | editShow: false, |
| | | loading: false, |
| | | page: 1, |
| | | pageCurr: 1, |
| | | pageSize: 10, |
| | | total: 0, |
| | | userData: undefined, |
| | | columns: [ |
| | | { |
| | | title: "姓名", |
| | |
| | | { |
| | | title: "组别", |
| | | dataIndex: ["depart", "departName"], |
| | | key: 'departName' |
| | | }, |
| | | { |
| | | title: "权限", |
| | | title: "角色", |
| | | dataIndex: ["drole", "roleName"], |
| | | key: 'roleName' |
| | | }, |
| | | { |
| | | title: "创建时间", |
| | | dataIndex: 'creTime' |
| | | }, |
| | | { |
| | | title: "操作", |
| | | key: "operation", |
| | | scopedSlots: { customRender: "operation" }, |
| | | }, |
| | | ], |
| | | dataSource: [], |
| | |
| | | }, |
| | | created() { |
| | | this.getGoodList(); |
| | | this.getColumns(); |
| | | }, |
| | | methods: { |
| | | getGoodList() { |
| | | this.loading = true; |
| | | // const { page, pageSize, conditions } = this; |
| | | getAllUser().then((res) => { |
| | | const { pageCurr, pageSize, conditions } = this; |
| | | getAllUser({ pageCurr, pageSize }).then((res) => { |
| | | console.log(res); |
| | | res = res.data; |
| | | let data = []; |
| | | this.loading = false; |
| | | if (res.code && res.data) { |
| | | data = res.data2.list; |
| | | } |
| | | this.dataSource = data; |
| | | }); |
| | | // ds.goodsList({ page, pageSize, ...conditions }).then((result) => { |
| | | // const { list, page, pageSize, total } = result.data.data; |
| | |
| | | // this.pageSize = pageSize; |
| | | // this.loading = false; |
| | | // }); |
| | | }, |
| | | getColumns() { |
| | | // ds.goodsColumns().then((res) => { |
| | | // this.columns = res.data; |
| | | // }); |
| | | }, |
| | | onSearch(conditions, searchOptions) { |
| | | console.log(searchOptions); |
| | |
| | | this.pageSize = pageSize; |
| | | this.getGoodList(); |
| | | }, |
| | | handleOk() { |
| | | this.editShow = false; |
| | | }, |
| | | edit(obj) { |
| | | console.log(obj); |
| | | this.userData = obj.text; |
| | | this.editShow = true; |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | * @returns {*} |
| | | */ |
| | | onFulfilled(config, options) { |
| | | const {message} = options |
| | | const {url, xsrfCookieName} = config |
| | | if (url.indexOf('login') === -1 && xsrfCookieName && !Cookie.get(xsrfCookieName)) { |
| | | message.warning('认证 token 已过期,请重新登录') |
| | | } |
| | | // const {message} = options |
| | | // const {url, xsrfCookieName} = config |
| | | // if (url.indexOf('login') === -1 && xsrfCookieName && !Cookie.get(xsrfCookieName)) { |
| | | // message.warning('认证 token 已过期,请重新登录') |
| | | // } |
| | | return config |
| | | }, |
| | | /** |
| | |
| | | |
| | | axios.defaults.timeout = 5000 |
| | | axios.defaults.withCredentials= true |
| | | axios.defaults.xsrfHeaderName= xsrfHeaderName |
| | | axios.defaults.xsrfCookieName= xsrfHeaderName |
| | | // axios.defaults.xsrfHeaderName= xsrfHeaderName |
| | | // axios.defaults.xsrfCookieName= xsrfHeaderName |
| | | |
| | | // 认证类型 |
| | | const AUTH_TYPE = { |