Commit f754beb2 by cwq0219

create

1 parent 2b64067a
......@@ -7,6 +7,8 @@ import GlsxVueComponents from 'glsx-vue-components'
import 'glsx-vue-components/dist/glsx-vue-components.css'
import GlsxVueCommon from 'glsx-vue-common'
import config from './config'
import './styles/role-user-common.scss'
import './styles/index.scss'
// import _ from 'lodash'
Vue.use(GlsxVueComponents)
......
//to reset element-ui default css
.el-upload {
input[type="file"] {
display: none !important;
}
}
.el-upload__input {
display: none;
}
//暂时性解决diolag 问题 https://github.com/ElemeFE/element/issues/2461
.el-dialog {
transform: none;
left: 0;
position: relative;
margin: 0 auto;
}
//element ui upload
.upload-container {
.el-upload {
width: 100%;
.el-upload-dragger {
width: 100%;
height: 200px;
}
}
}
//解决el-dialog 打开时 body padding-right 17px问题
.el-popup-parent--hidden{
padding-right: 0 !important;
}
@import './element-ui.scss';
body {
overflow: hidden;
height: 100%;
......@@ -9,10 +7,6 @@ body {
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
}
label {
font-weight: 700;
}
html {
height: 100%;
box-sizing: border-box;
......@@ -28,6 +22,12 @@ html {
box-sizing: inherit;
}
hr {
height:1px;
border:0px;
background-color:#e7eaec
}
a,
a:focus,
a:hover {
......
.default {
position: relative;
padding: 0px 25px;
}
.m-b20 {
margin-bottom: 20px;
}
.p-t15 {
padding-top: 15px;
}
.control-tabledata-button {
position: absolute;
right: 25px;
top: -56px;
}
\ No newline at end of file
<!-- roleManagement -->
<template>
<div>
<div class="default-style role-header">
<gl-input class="role-input" placeholder="请输入角色名称" v-model="roleName" clearable></gl-input>
<div class="default m-b20">
<gl-input class="search-w250" placeholder="请输入角色名称" v-model="roleName" clearable></gl-input>
<gl-button type="primary" @click="findRoleName">搜索</gl-button>
</div>
<hr style="height:1px;border:0px;background-color:#e7eaec">
<div class="default-style">
<gl-button class="create-button" size="small" @click="createRole">创建</gl-button>
<div class="dataTables-scroll">
<hr>
<div class="default p-t15">
<gl-button class="control-tabledata-button" size="small" @click="createRole">创建</gl-button>
<div class="m-b8">
<gl-table :table="roleData"></gl-table>
</div>
<div>
<label>显示
<gl-dropdown>{{showNumber}}</gl-dropdown>条
<!-- <gl-dropdown>{{showNumber}}</gl-dropdown> -->
条
</label>
<label>,&nbsp;共&nbsp;{{total}}&nbsp;条</label>
</div>
......@@ -24,7 +25,7 @@
<script>
export default {
name: 'role',
data () {
data() {
return {
roleName: '',
showNumber: 10,
......@@ -84,10 +85,36 @@ export default {
}, {
label: '创建时间',
prop: 'createTime'
}, {
}],
console: {
label: '操作',
prop: 'operation'
}]
prop: 'operation',
button: [{
label: '编辑',
type: 'text',
callback: (index, rows) => {
this.$alert(rows[index])
}
}, {
label: '详细',
type: 'text',
callback: (index, rows) => {
this.$alert(rows[index])
}
}, {
label: '删除',
type: 'text',
callback: (index, rows) => {
this.confirmDeleteOrNot(index)
}
}, {
label: '用户',
type: 'text',
callback: (index, rows) => {
this.$alert(rows[index])
}
}]
}
}
}
},
......@@ -98,38 +125,41 @@ export default {
findRoleName () {
this.roleName = ''
},
message (type, message) {
this.$message({
showClose: true,
type: type,
message: message
})
},
createRole () {
this.$alert('创建成功', '创建角色', {
confirmButtonTest: '确定',
callback: action => {
this.$message({
showClose: true,
type: 'success',
message: 'action: 创建成功'
})
this.message('success', '创建成功')
}
})
},
confirmDeleteOrNot (index) {
this.$confirm('确定要删除这条数据?', '', {
confirmButtonTest: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.roleData.data.splice(index, 1)
this.message('success', '删除成功')
}).catch(() => {
this.message('', '取消删除')
})
}
}
}
</script>
<style scoped>
.default-style {
position: relative;
padding: 0px 25px;
}
.role-header {
margin-bottom: 20px;
}
.dataTables-scroll{
margin-bottom: 8px;
}
.role-input {
.search-w250 {
width: 250px;
}
.create-button {
position: absolute;
right: 25px;
top: -56px;
.m-b8{
margin-bottom: 8px;
}
</style>
<!-- userManagement -->
<template>
<div>userList</div>
<div>
<div class="default m-b20">
<gl-input class="search-w250" placeholder="请输入用户名或姓名" v-model="userName" clearable></gl-input>
<gl-button type="primary" @click="finduserName">搜索</gl-button>
</div>
<hr>
<div class="default p-t15">
<div class="control-tabledata-button">
<gl-button size="small" @click="createUser">新增用户</gl-button>
<gl-button size="small" @click="delteSelected">删除选中</gl-button>
</div>
<div class="m-b8">
<gl-table :table="userData"></gl-table>
</div>
<div>
<label>显示
<!-- <gl-dropdown>{{showNumber}}</gl-dropdown> -->
条
</label>
<label>,&nbsp;共&nbsp;{{total}}&nbsp;条</label>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'user',
data () {
data() {
return {
userName: '',
showNumber: 10,
showNumberList: [],
total: 0,
userData: {
border: true,
data: [{
id: '1032',
name: '好车主',
department: '研发中心-网络软件部',
state: '开启',
createTime: '2018-08-12 13:00:00'
}, {
id: '1033',
name: '运营平台',
department: '研发中心-网络软件部',
state: '开启',
createTime: '2018-08-12 13:00:00'
}, {
id: '1034',
name: '精品车主',
department: '研发中心-网络软件部',
state: '开启',
createTime: '2018-08-12 13:00:00'
}, {
id: '1035',
name: '云商分润',
department: '研发中心-网络软件部',
state: '开启',
createTime: '2018-08-12 13:00:00'
}, {
id: '1036',
name: '营销系统',
department: '研发中心-网络软件部',
state: '开启',
createTime: '2018-08-12 13:00:00'
}, {
id: '1037',
name: 'test',
department: '研发中心-网络软件部',
state: '开启',
createTime: '2018-08-12 13:00:00'
}],
column: [{
label: '序号',
prop: 'id'
}, {
label: '角色名字',
prop: 'name'
}, {
label: '所属部门',
prop: 'department'
}, {
label: '状态',
prop: 'state'
}, {
label: '创建时间',
prop: 'createTime'
}],
console: {
label: '操作',
prop: 'operation',
button: [{
label: '编辑',
type: 'text',
callback: (index, rows) => {
this.$alert(rows[index])
}
}, {
label: '详细',
type: 'text',
callback: (index, rows) => {
this.$alert(rows[index])
}
}, {
label: '删除',
type: 'text',
callback: (index, rows) => {
this.confirmDeleteOrNot(index)
}
}, {
label: '用户',
type: 'text',
callback: (index, rows) => {
this.$alert(rows[index])
}
}]
}
}
}
},
mounted () {
this.total = this.userData.data.length
},
methods: {
finduserName () {
this.userName = ''
},
message (type, message) {
this.$message({
showClose: true,
type: type,
message: message
})
},
createUser () {
},
delteSelected () {
},
confirmDeleteOrNot (index) {
this.$confirm('确定要删除这条数据?', '', {
confirmButtonTest: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.userData.data.splice(index, 1)
this.message('success', '删除成功')
}).catch(() => {
this.message('', '取消删除')
})
}
}
}
</script>
<style scoped>
.search-w250 {
width: 250px;
}
.m-b8{
margin-bottom: 8px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!