fix: 登陆->登录 #126

parent b5579dcd
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<a-input placeholder="h3gSbecd"/> <a-input placeholder="h3gSbecd"/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="登密码" label="登密码"
:required="false" :required="false"
> >
<a-input placeholder="密码"/> <a-input placeholder="密码"/>
...@@ -158,4 +158,4 @@ export default { ...@@ -158,4 +158,4 @@ export default {
overflow: hidden; overflow: hidden;
} }
} }
</style> </style>
<template> <template>
<a-card :bordered="false"> <a-card :bordered="false">
<a-row :gutter="8"> <a-row :gutter="8">
<a-col :span="5"> <a-col :span="5">
<s-tree <s-tree
:dataSource="orgTree" :dataSource="orgTree"
:openKeys.sync="openKeys" :openKeys.sync="openKeys"
:search="true" :search="true"
@click="handleClick" @click="handleClick"
@add="handleAdd" @add="handleAdd"
@titleClick="handleTitleClick"></s-tree> @titleClick="handleTitleClick"></s-tree>
</a-col> </a-col>
<a-col :span="19"> <a-col :span="19">
<s-table <s-table
ref="table" ref="table"
size="default" size="default"
:columns="columns" :columns="columns"
:data="loadData" :data="loadData"
:alert="false" :alert="false"
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
> >
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<template v-if="$auth('table.update')"> <template v-if="$auth('table.update')">
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
</template> </template>
<a-dropdown> <a-dropdown>
<a class="ant-dropdown-link"> <a class="ant-dropdown-link">
更多 <a-icon type="down" /> 更多 <a-icon type="down" />
</a> </a>
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item> <a-menu-item>
<a href="javascript:;">详情</a> <a href="javascript:;">详情</a>
</a-menu-item> </a-menu-item>
<a-menu-item v-if="$auth('table.disable')"> <a-menu-item v-if="$auth('table.disable')">
<a href="javascript:;">禁用</a> <a href="javascript:;">禁用</a>
</a-menu-item> </a-menu-item>
<a-menu-item v-if="$auth('table.delete')"> <a-menu-item v-if="$auth('table.delete')">
<a href="javascript:;">删除</a> <a href="javascript:;">删除</a>
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
</a-dropdown> </a-dropdown>
</span> </span>
</s-table> </s-table>
</a-col> </a-col>
</a-row> </a-row>
<org-modal ref="modal" @ok="handleSaveOk" @close="handleSaveClose" /> <org-modal ref="modal" @ok="handleSaveOk" @close="handleSaveClose" />
</a-card> </a-card>
</template> </template>
<script> <script>
import STree from '@/components/Tree/Tree' import STree from '@/components/Tree/Tree'
import STable from '@/components/table/' import STable from '@/components/table/'
import OrgModal from './modules/OrgModal' import OrgModal from './modules/OrgModal'
import { getOrgTree, getServiceList } from '@/api/manage' import { getOrgTree, getServiceList } from '@/api/manage'
export default { export default {
name: 'TreeList', name: 'TreeList',
components: { components: {
STable, STable,
STree, STree,
OrgModal OrgModal
}, },
data () { data () {
return { return {
openKeys: ['key-01'], openKeys: ['key-01'],
// 查询参数 // 查询参数
queryParam: {}, queryParam: {},
// 表头 // 表头
columns: [ columns: [
{ {
title: '#', title: '#',
dataIndex: 'no' dataIndex: 'no'
}, },
{ {
title: '成员名称', title: '成员名称',
dataIndex: 'description' dataIndex: 'description'
}, },
{ {
title: '登陆次数', title: '登录次数',
dataIndex: 'callNo', dataIndex: 'callNo',
sorter: true, sorter: true,
needTotal: true, needTotal: true,
customRender: (text) => text + ' 次' customRender: (text) => text + ' 次'
}, },
{ {
title: '状态', title: '状态',
dataIndex: 'status', dataIndex: 'status',
needTotal: true needTotal: true
}, },
{ {
title: '更新时间', title: '更新时间',
dataIndex: 'updatedAt', dataIndex: 'updatedAt',
sorter: true sorter: true
}, },
{ {
table: '操作', table: '操作',
dataIndex: 'action', dataIndex: 'action',
width: '150px', width: '150px',
scopedSlots: { customRender: 'action' } scopedSlots: { customRender: 'action' }
} }
], ],
// 加载数据方法 必须为 Promise 对象 // 加载数据方法 必须为 Promise 对象
loadData: parameter => { loadData: parameter => {
return getServiceList(Object.assign(parameter, this.queryParam)) return getServiceList(Object.assign(parameter, this.queryParam))
.then(res => { .then(res => {
return res.result return res.result
}) })
}, },
orgTree: [], orgTree: [],
selectedRowKeys: [], selectedRowKeys: [],
selectedRows: [] selectedRows: []
} }
}, },
created () { created () {
getOrgTree().then(res => { getOrgTree().then(res => {
this.orgTree = res.result this.orgTree = res.result
}) })
}, },
methods: { methods: {
handleClick (e) { handleClick (e) {
console.log('handleClick', e) console.log('handleClick', e)
this.queryParam = { this.queryParam = {
key: e.key key: e.key
} }
this.$refs.table.refresh(true) this.$refs.table.refresh(true)
}, },
handleAdd (item) { handleAdd (item) {
console.log('add button, item', item) console.log('add button, item', item)
this.$message.info(`提示:你点了 ${item.key} - ${item.title} `) this.$message.info(`提示:你点了 ${item.key} - ${item.title} `)
this.$refs.modal.add(item.key) this.$refs.modal.add(item.key)
}, },
handleTitleClick (item) { handleTitleClick (item) {
console.log('handleTitleClick', item) console.log('handleTitleClick', item)
}, },
titleClick (e) { titleClick (e) {
console.log('titleClick', e) console.log('titleClick', e)
}, },
handleSaveOk () { handleSaveOk () {
}, },
handleSaveClose () { handleSaveClose () {
}, },
onSelectChange (selectedRowKeys, selectedRows) { onSelectChange (selectedRowKeys, selectedRows) {
this.selectedRowKeys = selectedRowKeys this.selectedRowKeys = selectedRowKeys
this.selectedRows = selectedRows this.selectedRows = selectedRows
} }
} }
} }
</script> </script>
<style lang="less"> <style lang="less">
.custom-tree { .custom-tree {
/deep/ .ant-menu-item-group-title { /deep/ .ant-menu-item-group-title {
position: relative; position: relative;
&:hover { &:hover {
.btn { .btn {
display: block; display: block;
} }
} }
} }
/deep/ .ant-menu-item { /deep/ .ant-menu-item {
&:hover { &:hover {
.btn { .btn {
display: block; display: block;
} }
} }
} }
/deep/ .btn { /deep/ .btn {
display: none; display: none;
position: absolute; position: absolute;
top: 0; top: 0;
right: 10px; right: 10px;
width: 20px; width: 20px;
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
z-index: 1050; z-index: 1050;
&:hover { &:hover {
transform: scale(1.2); transform: scale(1.2);
transition: 0.5s all; transition: 0.5s all;
} }
} }
} }
</style> </style>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
:tabBarStyle="{ textAlign: 'center', borderBottom: 'unset' }" :tabBarStyle="{ textAlign: 'center', borderBottom: 'unset' }"
@change="handleTabClick" @change="handleTabClick"
> >
<a-tab-pane key="tab1" tab="账号密码登"> <a-tab-pane key="tab1" tab="账号密码登">
<a-form-item> <a-form-item>
<a-input <a-input
size="large" size="large"
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
</a-input> </a-input>
</a-form-item> </a-form-item>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="tab2" tab="手机号登"> <a-tab-pane key="tab2" tab="手机号登">
<a-form-item> <a-form-item>
<a-input size="large" type="text" placeholder="手机号" v-decorator="['mobile', {rules: [{ required: true, pattern: /^1[34578]\d{9}$/, message: '请输入正确的手机号' }], validateTrigger: 'change'}]"> <a-input size="large" type="text" placeholder="手机号" v-decorator="['mobile', {rules: [{ required: true, pattern: /^1[34578]\d{9}$/, message: '请输入正确的手机号' }], validateTrigger: 'change'}]">
<a-icon slot="prefix" type="mobile" :style="{ color: 'rgba(0,0,0,.25)' }"/> <a-icon slot="prefix" type="mobile" :style="{ color: 'rgba(0,0,0,.25)' }"/>
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
</a-tabs> </a-tabs>
<a-form-item> <a-form-item>
<a-checkbox v-decorator="['rememberMe']">自动登</a-checkbox> <a-checkbox v-decorator="['rememberMe']">自动登</a-checkbox>
<router-link <router-link
:to="{ name: 'recover', params: { user: 'aaa'} }" :to="{ name: 'recover', params: { user: 'aaa'} }"
class="forge-password" class="forge-password"
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
</a-form-item> </a-form-item>
<div class="user-login-other"> <div class="user-login-other">
<span>其他登方式</span> <span>其他登方式</span>
<a> <a>
<a-icon class="item-icon" type="alipay-circle"></a-icon> <a-icon class="item-icon" type="alipay-circle"></a-icon>
</a> </a>
...@@ -314,4 +314,4 @@ export default { ...@@ -314,4 +314,4 @@ export default {
} }
} }
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment