diff --git a/src/assets/images/loginBg.png b/src/assets/images/loginBg.png new file mode 100644 index 0000000..8f90586 Binary files /dev/null and b/src/assets/images/loginBg.png differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png index ad01042..b3fdd44 100644 Binary files a/src/assets/images/logo.png and b/src/assets/images/logo.png differ diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue deleted file mode 100644 index 879051a..0000000 --- a/src/components/HelloWorld.vue +++ /dev/null @@ -1,58 +0,0 @@ -<template> - <div class="hello"> - <h1>{{ msg }}</h1> - <p> - For a guide and recipes on how to configure / customize this project,<br> - check out the - <a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>. - </p> - <h3>Installed CLI Plugins</h3> - <ul> - <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li> - <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li> - </ul> - <h3>Essential Links</h3> - <ul> - <li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li> - <li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li> - <li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li> - <li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li> - <li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li> - </ul> - <h3>Ecosystem</h3> - <ul> - <li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li> - <li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li> - <li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li> - <li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li> - <li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li> - </ul> - </div> -</template> - -<script> -export default { - name: 'HelloWorld', - props: { - msg: String - } -} -</script> - -<!-- Add "scoped" attribute to limit CSS to this component only --> -<style scoped> -h3 { - margin: 40px 0 0; -} -ul { - list-style-type: none; - padding: 0; -} -li { - display: inline-block; - margin: 0 10px; -} -a { - color: #42b983; -} -</style> diff --git a/src/components/table/index.vue b/src/components/table/index.vue new file mode 100644 index 0000000..227d15d --- /dev/null +++ b/src/components/table/index.vue @@ -0,0 +1,68 @@ +<template> + <div class="main"> + <div style="margin-bottom: 16px"> + <a-button type="primary" :disabled="!hasSelected" :loading="loading"> + 批量 + </a-button> + <span style="margin-left: 8px"> + <template v-if="hasSelected"> + {{ `已选择 ${selectedRowKeys.length} 条` }} + </template> + </span> + </div> + <a-table + :columns="columns" + :data-source="tableData" + :pagination="pagination" + :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" + :row-key=" + (record, index) => { + return index; + } + " + > + <!-- <a slot="del" slot-scope="scope" @click="del(scope)">删除</a> + <span slot="formatter" slot-scope="scope" >{{scope}}</span> --> + </a-table> + </div> +</template> + +<script> +export default { + data() { + return { + pagination: { + current: 1, + total: 0, + pageSize: 10, + showTotal: (total) => `共 ${total} 条`, + showSizeChanger: true, + showQuickJumper: true, + }, + loading: false, + selectedRowKeys: [], + }; + }, + computed: { + hasSelected() { + return this.selectedRowKeys.length > 0; + }, + }, + props: { + columns: Array, + tableData: Array, + }, + methods: { + onSelectChange(selectedRowKeys) { + console.log('selectedRowKeys changed: ', selectedRowKeys); + this.selectedRowKeys = selectedRowKeys; + }, + }, +}; +</script> + +<style lang="less" scoped> +#commonTable { + margin: 24px; +} +</style> diff --git a/src/main.js b/src/main.js index 52a96e4..36fe0ab 100644 --- a/src/main.js +++ b/src/main.js @@ -17,6 +17,16 @@ Vue.use(mixins); import store from "@/store"; import router from "@/permission"; Vue.config.productionTip = false +import commonTable from './components/table' + +// 注册组件 +Vue.component('commonTable', commonTable) + +router.beforeEach((to, from, next) => { + // 让页面回到顶部 + document.documentElement.scrollTop = 0 + next() +}) new Vue({ render: h => h(App), diff --git a/src/permission.js b/src/permission.js index 39af6dc..f83558e 100644 --- a/src/permission.js +++ b/src/permission.js @@ -18,9 +18,5 @@ router.beforeEach((to, from, next) => { router.afterEach(() => { NProgress.done() }) -// router.beforeEach((to, from, next) => { -// // 让页面回到顶部 -// document.documentElement.scrollTop = 0 -// next() -// }) + export default router \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index a3bf684..2c61695 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -43,7 +43,7 @@ export default new Router({ mode: 'history', routes: router, scrollBehavior(to, from, savedPosition) { - console.log(savedPosition); + // console.log(savedPosition); if (savedPosition) { return new Promise((resolve) => { setTimeout(() => { diff --git a/src/styles/index.less b/src/styles/index.less index 80820dc..6f61933 100644 --- a/src/styles/index.less +++ b/src/styles/index.less @@ -1,13 +1,24 @@ @import "./antd.less"; +// 公共样式 +#app{ + background: #E5E5E5; +} .content{ padding: 13px; } +.main{ + padding: 13px; + background: #fff; +} .cardTitle{ border-left: 8px solid #205FBD; padding-left:10px; margin-left: 10px; margin-bottom: 10px; } -#app{ - background: #E5E5E5; +#commonTable{ + margin: 24px; +} +.search-box { + margin: 30px; } \ No newline at end of file diff --git a/src/views/Login/index.vue b/src/views/Login/index.vue index a6750b1..86b764d 100644 --- a/src/views/Login/index.vue +++ b/src/views/Login/index.vue @@ -7,18 +7,18 @@ * @FilePath: /ansu-business/src/views/Login/index.vue --> <template> - <div> + <div class="bg"> <div class="logo-box"> <img src="@/assets/images/logo.png" alt="" /> </div> <div class="login-box"> <a-row> - <a-col :span="12" class="box-a"> + <!-- <a-col :span="12" class="box-a"> <img src="@/assets/images/logo.png" alt="" /> - </a-col> - <a-col :span="1" class="box-cen"></a-col> + </a-col> --> + <!-- <a-col :span="1" class="box-cen"></a-col> --> <!-- 登录 --> - <a-col :span="11" class="box-b" v-if="status === 1"> + <a-col class="box-b" v-if="status === 1"> <a-tabs v-model="activeName" @change="tabsSwitch"> <a-tab-pane key="1" tab="密码登录"> </a-tab-pane> @@ -45,7 +45,7 @@ </div> </a-col> <!-- 注册 --> - <a-col :span="11" class="box-b" v-if="status === 2"> + <a-col class="box-b" v-if="status === 2"> <div class="cardTitle">新建账号</div> <a-form-model ref="ruleForm" @@ -98,7 +98,7 @@ </a-form-model> </a-col> <!-- 找回密码 --> - <a-col :span="11" class="box-b" v-if="status === 3"> + <a-col class="box-b" v-if="status === 3"> <div class="cardTitle">找回密码</div> <a-form-model ref="ruleForm" @@ -223,6 +223,11 @@ export default { </script> <style lang="less" scoped> +.bg{ + background-image: url(../../assets/images/loginBg.png); + height: 100vh; + background-size:cover; +} .logo-box { text-align: left; background: #ffffff; @@ -231,16 +236,16 @@ export default { line-height: 93px; margin-bottom: 42px; img { - width: 126px; + width: 61px; height: 61px; background: #ffffff; - margin-left: 32px; + margin-left: 42px; } } .login-box { background: #ffffff; height: 500px; - width: 989px; + width: 489px; margin: auto; } .box-a { diff --git a/src/views/Manage/SettleRequestManage/index.vue b/src/views/Manage/SettleRequestManage/index.vue index e69de29..b34b71a 100644 --- a/src/views/Manage/SettleRequestManage/index.vue +++ b/src/views/Manage/SettleRequestManage/index.vue @@ -0,0 +1,176 @@ +<template> + <div class="main"> + <!-- 标题 --> + <div class="cardTitle">申请入驻管理</div> + <!-- 搜索 --> + <div class="search-box"> + <a-space size="large"> + <a-input placeholder="请输入申请人/公司名" /> + <a-select style="width: 200px" placeholder="选择状态" /> + <a-button type="primary">查 询</a-button> + <a-button>重 置</a-button> + </a-space> + </div> + <!-- 表格 --> + <div id="commonTable"> + <div style="margin-bottom: 16px"> + <a-button type="primary" :disabled="!hasSelected" :loading="loading"> + 批量操作 + </a-button> + <span style="margin-left: 8px"> + <template v-if="hasSelected"> + {{ `已选择 ${selectedRowKeys.length} 条` }} + </template> + </span> + </div> + <a-table + :scroll="{ x: 1300 }" + :columns="columns" + :data-source="tableData" + :pagination="pagination" + @change="handleTableChange" + :row-selection="{ + selectedRowKeys: selectedRowKeys, + onChange: onSelectChange, + }" + :row-key=" + (record, index) => { + return index; + } + " + > + 操作 + <span slot="action" slot-scope="scope"> + <a @click="del(scope)">删除</a> + <span style="margin: 2px">|</span> + <a @click="detail(scope)">详情</a> + </span> + <span slot="formatter" slot-scope="scope">{{ + scope === 1 ? "可" : "" + }}</span> + </a-table> + </div> + </div> +</template> + +<script> +export default { + data() { + return { + // 搜索项 + searchForm: { + name: "", + code: "", + }, + // 列 + columns: [ + { + title: "Name", + dataIndex: "name", + width: "200", + }, + { + title: "Gender", + dataIndex: "gender", + width: "200", + }, + { + title: "Gender1", + dataIndex: "gender1", + width: "200", + }, + { + title: "Gender2", + dataIndex: "gender2", + width: "200", + }, + { + title: "Gender3", + dataIndex: "gender3", + width: "200", + }, + { + title: "Gender4", + dataIndex: "gender4", + width: "200", + }, + { + title: "Gender5", + dataIndex: "gender5", + width: "200", + }, + { + title: "Gender6", + dataIndex: "gender6", + width: "200", + }, + { + title: "status", + dataIndex: "status", + scopedSlots: { customRender: "formatter" }, + width: "200", + }, + { + title: "操作", + dataIndex: "action", + key: "action", + width: "200", + fixed: "right", + scopedSlots: { customRender: "action" }, + }, + ], + // 数据 + tableData: [ + { + name: "11", + id: 1, + status: 1, + }, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + ], + // 分页 + pagination: { + current: 1, + total: 0, + pageSize: 10, + showTotal: (total) => `共 ${total} 条`, + showSizeChanger: true, + showQuickJumper: true, + }, + loading: false, + selectedRowKeys: [], + }; + }, + mounted(){}, + computed: { + hasSelected() { + return this.selectedRowKeys.length > 0; + }, + }, + methods: { + onSelectChange(selectedRowKeys) { + console.log("selectedRowKeys changed: ", selectedRowKeys); + this.selectedRowKeys = selectedRowKeys; + }, + handleTableChange(pagination) { + console.log(pagination); + const pager = { ...this.pagination }; + pager.current = pagination.current; + this.pagination = pager; + }, + }, +}; +</script> + +<style lang="less" scoped> + +</style>> \ No newline at end of file