parent
a7ae6eb9a6
commit
05fc4ae74c
26 changed files with 696 additions and 229 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,38 @@ |
|||||||
|
import request from '@/router/axios'; |
||||||
|
|
||||||
|
export const getList = (current, size, params) => { |
||||||
|
return request({ |
||||||
|
url: '/api/blade-system/tenant/list', |
||||||
|
method: 'get', |
||||||
|
params: { |
||||||
|
...params, |
||||||
|
current, |
||||||
|
size, |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
||||||
|
export const remove = (ids) => { |
||||||
|
return request({ |
||||||
|
url: '/api/blade-system/tenant/remove', |
||||||
|
method: 'post', |
||||||
|
params: { |
||||||
|
ids, |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
export const add = (row) => { |
||||||
|
return request({ |
||||||
|
url: '/api/blade-system/tenant/submit', |
||||||
|
method: 'post', |
||||||
|
data: row |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
export const update = (row) => { |
||||||
|
return request({ |
||||||
|
url: '/api/blade-system/tenant/submit', |
||||||
|
method: 'post', |
||||||
|
data: row |
||||||
|
}) |
||||||
|
} |
||||||
@ -1,15 +0,0 @@ |
|||||||
//修改阿里巴巴图表库样式 |
|
||||||
.iconfont{ |
|
||||||
margin-right: 5px; |
|
||||||
font-size: 20px !important; |
|
||||||
} |
|
||||||
.avue-icon-select__item{ |
|
||||||
margin-bottom: 20px; |
|
||||||
} |
|
||||||
.avue-icon-select__list .iconfont{ |
|
||||||
padding: 20px; |
|
||||||
font-size: 24px; |
|
||||||
} |
|
||||||
.avue-icon-select__list .iconfont:hover{ |
|
||||||
transform: scale(1.4); |
|
||||||
} |
|
||||||
@ -0,0 +1,57 @@ |
|||||||
|
.theme-d2 { |
||||||
|
.avue-logo{ |
||||||
|
color: #409EFF; |
||||||
|
background-color: #ebf1f6; |
||||||
|
box-shadow: none; |
||||||
|
.avue-logo_title{ |
||||||
|
font-size: 22px; |
||||||
|
font-weight: 400; |
||||||
|
} |
||||||
|
} |
||||||
|
.avue-top{ |
||||||
|
background-color: #ebf1f6; |
||||||
|
box-shadow: none; |
||||||
|
} |
||||||
|
.avue-main{ |
||||||
|
padding: 0 5px; |
||||||
|
} |
||||||
|
.avue-tags{ |
||||||
|
margin-left: 6px; |
||||||
|
padding: 0; |
||||||
|
border: 1px solid #e4e7ed; |
||||||
|
border-radius: 3px; |
||||||
|
background-color: #ebf1f6; |
||||||
|
box-shadow: none; |
||||||
|
.el-tabs__item{ |
||||||
|
border-left: 1px solid #cfd7e5 !important; |
||||||
|
margin: 0 !important; |
||||||
|
background-color: rgba(0,0,0,.03) !important; |
||||||
|
color: #606266 !important; |
||||||
|
font-size: 14px !important; |
||||||
|
font-weight: 500 !important; |
||||||
|
&:first-child{ |
||||||
|
border-left: none !important; |
||||||
|
} |
||||||
|
} |
||||||
|
.is-active{ |
||||||
|
border-bottom:1px solid #fff !important; |
||||||
|
background-color: #fff !important; |
||||||
|
color: #409EFF !important; |
||||||
|
} |
||||||
|
} |
||||||
|
.avue-sidebar{ |
||||||
|
background-color: #ebf1f6; |
||||||
|
box-shadow: none; |
||||||
|
.el-menu-item,.el-submenu__title{ |
||||||
|
i,span{ |
||||||
|
color:#606266 |
||||||
|
} |
||||||
|
&:hover,&.is-active{ |
||||||
|
background: hsla(0,0%,100%,.5); |
||||||
|
i,span{ |
||||||
|
color: #409EFF; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,45 @@ |
|||||||
|
.theme-hey{ |
||||||
|
.avue-sidebar{ |
||||||
|
background-color: #fff; |
||||||
|
box-shadow: 0 1px 4px rgba(0,21,41,.08); |
||||||
|
.el-menu-item,.el-submenu__title{ |
||||||
|
i,span{ |
||||||
|
color: rgba(49,58,70,.8); |
||||||
|
} |
||||||
|
&:hover{ |
||||||
|
background: transparent; |
||||||
|
i,span{ |
||||||
|
color:#409eff; |
||||||
|
} |
||||||
|
} |
||||||
|
&.is-active { |
||||||
|
&:before { |
||||||
|
left:auto; |
||||||
|
right: 0 ; |
||||||
|
} |
||||||
|
background-color: #f0f6ff; |
||||||
|
i,span{ |
||||||
|
color:#409eff; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
.avue-logo{ |
||||||
|
background-color: #fff; |
||||||
|
box-shadow: none; |
||||||
|
.avue-logo_title{ |
||||||
|
color:#409eff; |
||||||
|
font-size: 24px; |
||||||
|
} |
||||||
|
} |
||||||
|
.avue-tags{ |
||||||
|
background: #f3f6f8; |
||||||
|
.el-tabs__item{ |
||||||
|
color: rgba(0,0,0,.65) !important; |
||||||
|
} |
||||||
|
.is-active{ |
||||||
|
background-color: #fff; |
||||||
|
border-bottom: none !important; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,79 @@ |
|||||||
|
.theme-iview { |
||||||
|
.avue-logo{ |
||||||
|
background: #001529; |
||||||
|
box-shadow: none; |
||||||
|
text-align: center; |
||||||
|
.avue-logo_title{ |
||||||
|
div{ |
||||||
|
border-top-left-radius: 5px; |
||||||
|
border-top-right-radius: 5px; |
||||||
|
border-bottom-left-radius: 3px; |
||||||
|
border-bottom-right-radius: 3px; |
||||||
|
font-size: 22px; |
||||||
|
color:#fff; |
||||||
|
font-weight: 500; |
||||||
|
margin: 10px auto; |
||||||
|
width: 180px; |
||||||
|
height: 45px; |
||||||
|
background-color: #409EFF; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
.avue-tags{ |
||||||
|
padding: 3px 5px 5px 0; |
||||||
|
background: #f0f0f0; |
||||||
|
box-shadow: inset 0 0 3px 2px hsla(0,0%,39.2%,.1); |
||||||
|
.is-active{ |
||||||
|
&:before{ |
||||||
|
background: #409EFF !important; |
||||||
|
} |
||||||
|
} |
||||||
|
.el-tabs__item{ |
||||||
|
padding: 0 15px !important; |
||||||
|
position: relative; |
||||||
|
height: 32px !important; |
||||||
|
line-height:32px !important; |
||||||
|
border: 1px solid #e8eaec!important; |
||||||
|
color: #515a6e!important; |
||||||
|
background: #fff!important; |
||||||
|
border-radius: 3px; |
||||||
|
&:before{ |
||||||
|
content:''; |
||||||
|
display: inline-block; |
||||||
|
width: 12px; |
||||||
|
height: 12px; |
||||||
|
margin-right:10px; |
||||||
|
border-radius: 50%; |
||||||
|
background: #e8eaec; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.avue-sidebar{ |
||||||
|
background: #001529; |
||||||
|
.el-menu-item{ |
||||||
|
&.is-active { |
||||||
|
background-color: #000c17; |
||||||
|
&:before { |
||||||
|
display: none; |
||||||
|
} |
||||||
|
i,span{ |
||||||
|
color:#409EFF; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
.el-submenu{ |
||||||
|
.el-menu-item{ |
||||||
|
&.is-active { |
||||||
|
background-color: #409EFF; |
||||||
|
&:before { |
||||||
|
display: none; |
||||||
|
} |
||||||
|
i,span{ |
||||||
|
color:#fff; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,210 @@ |
|||||||
|
<template> |
||||||
|
<basic-container> |
||||||
|
<avue-crud :option="option" |
||||||
|
:data="data" |
||||||
|
ref="crud" |
||||||
|
v-model="form" |
||||||
|
:page="page" |
||||||
|
:permission="permissionList" |
||||||
|
@row-del="rowDel" |
||||||
|
@row-update="rowUpdate" |
||||||
|
@row-save="rowSave" |
||||||
|
@search-change="searchChange" |
||||||
|
@search-reset="searchReset" |
||||||
|
@selection-change="selectionChange" |
||||||
|
@on-load="onLoad"> |
||||||
|
<template slot="menuLeft"> |
||||||
|
<el-button type="danger" |
||||||
|
size="small" |
||||||
|
icon="el-icon-delete" |
||||||
|
v-if="permission.tenant_delete" |
||||||
|
plain |
||||||
|
@click="handleDelete">删 除 |
||||||
|
</el-button> |
||||||
|
</template> |
||||||
|
<template slot-scope="{row}" |
||||||
|
slot="roleId"> |
||||||
|
<el-tag>{{row.roleName}}</el-tag> |
||||||
|
</template> |
||||||
|
<template slot-scope="{row}" |
||||||
|
slot="deptId"> |
||||||
|
<el-tag>{{row.deptName}}</el-tag> |
||||||
|
</template> |
||||||
|
</avue-crud> |
||||||
|
</basic-container> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import {getList, remove, update, add} from "@/api/system/tenant"; |
||||||
|
import {mapGetters} from "vuex"; |
||||||
|
|
||||||
|
export default { |
||||||
|
data() { |
||||||
|
return { |
||||||
|
form: {}, |
||||||
|
selectionList: [], |
||||||
|
page: { |
||||||
|
pageSize: 10, |
||||||
|
currentPage: 1, |
||||||
|
total: 0 |
||||||
|
}, |
||||||
|
option: { |
||||||
|
tip: false, |
||||||
|
border: true, |
||||||
|
index: true, |
||||||
|
selection: true, |
||||||
|
viewBtn: true, |
||||||
|
dialogWidth: 300, |
||||||
|
dialogHeight: 400, |
||||||
|
column: [ |
||||||
|
{ |
||||||
|
label: "租户编号", |
||||||
|
prop: "tenantCode", |
||||||
|
search: true, |
||||||
|
addDisplay: false, |
||||||
|
editDisplay: false, |
||||||
|
span: 24, |
||||||
|
rules: [{ |
||||||
|
required: true, |
||||||
|
message: "请输入租户编号", |
||||||
|
trigger: "blur" |
||||||
|
}] |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: "租户名称", |
||||||
|
prop: "tenantName", |
||||||
|
search: true, |
||||||
|
span: 24, |
||||||
|
rules: [{ |
||||||
|
required: true, |
||||||
|
message: "请输入参数名称", |
||||||
|
trigger: "blur" |
||||||
|
}] |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: "联系人", |
||||||
|
prop: "linkman", |
||||||
|
search: true, |
||||||
|
span: 24, |
||||||
|
rules: [{ |
||||||
|
required: true, |
||||||
|
message: "请输入联系人", |
||||||
|
trigger: "blur" |
||||||
|
}] |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: "联系电话", |
||||||
|
prop: "contactNumber", |
||||||
|
span: 24, |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: "联系地址", |
||||||
|
prop: "address", |
||||||
|
span: 24, |
||||||
|
minRows: 6, |
||||||
|
type: "textarea", |
||||||
|
} |
||||||
|
] |
||||||
|
}, |
||||||
|
data: [] |
||||||
|
}; |
||||||
|
}, |
||||||
|
computed: { |
||||||
|
...mapGetters(["permission"]), |
||||||
|
permissionList() { |
||||||
|
return { |
||||||
|
addBtn: this.vaildData(this.permission.tenant_add, false), |
||||||
|
viewBtn: this.vaildData(this.permission.tenant_view, false), |
||||||
|
delBtn: this.vaildData(this.permission.tenant_delete, false), |
||||||
|
editBtn: this.vaildData(this.permission.tenant_edit, false) |
||||||
|
}; |
||||||
|
}, |
||||||
|
ids() { |
||||||
|
let ids = []; |
||||||
|
this.selectionList.forEach(ele => { |
||||||
|
ids.push(ele.id); |
||||||
|
}); |
||||||
|
return ids.join(","); |
||||||
|
} |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
rowSave(row, loading) { |
||||||
|
add(row).then(() => { |
||||||
|
loading(); |
||||||
|
this.onLoad(this.page); |
||||||
|
this.$message({ |
||||||
|
type: "success", |
||||||
|
message: "操作成功!" |
||||||
|
}); |
||||||
|
}); |
||||||
|
}, |
||||||
|
rowUpdate(row, index, loading) { |
||||||
|
update(row).then(() => { |
||||||
|
loading(); |
||||||
|
this.onLoad(this.page); |
||||||
|
this.$message({ |
||||||
|
type: "success", |
||||||
|
message: "操作成功!" |
||||||
|
}); |
||||||
|
}); |
||||||
|
}, |
||||||
|
rowDel(row) { |
||||||
|
this.$confirm("确定将选择数据删除?", { |
||||||
|
confirmButtonText: "确定", |
||||||
|
cancelButtonText: "取消", |
||||||
|
type: "warning" |
||||||
|
}) |
||||||
|
.then(() => { |
||||||
|
return remove(row.id); |
||||||
|
}) |
||||||
|
.then(() => { |
||||||
|
this.onLoad(this.page); |
||||||
|
this.$message({ |
||||||
|
type: "success", |
||||||
|
message: "操作成功!" |
||||||
|
}); |
||||||
|
}); |
||||||
|
}, |
||||||
|
searchReset() { |
||||||
|
this.onLoad(this.page); |
||||||
|
}, |
||||||
|
searchChange(params) { |
||||||
|
this.onLoad(this.page, params); |
||||||
|
}, |
||||||
|
selectionChange(list) { |
||||||
|
this.selectionList = list; |
||||||
|
}, |
||||||
|
handleDelete() { |
||||||
|
if (this.selectionList.length === 0) { |
||||||
|
this.$message.warning("请选择至少一条数据"); |
||||||
|
return; |
||||||
|
} |
||||||
|
this.$confirm("确定将选择数据删除?", { |
||||||
|
confirmButtonText: "确定", |
||||||
|
cancelButtonText: "取消", |
||||||
|
type: "warning" |
||||||
|
}) |
||||||
|
.then(() => { |
||||||
|
return remove(this.ids); |
||||||
|
}) |
||||||
|
.then(() => { |
||||||
|
this.$message({ |
||||||
|
type: "success", |
||||||
|
message: "操作成功!" |
||||||
|
}); |
||||||
|
this.$refs.crud.toggleSelection(); |
||||||
|
}); |
||||||
|
}, |
||||||
|
onLoad(page, params = {}) { |
||||||
|
getList(page.currentPage, page.pageSize, params).then(res => { |
||||||
|
const data = res.data.data; |
||||||
|
this.page.total = data.total; |
||||||
|
this.data = data.records; |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
|
}; |
||||||
|
</script> |
||||||
|
|
||||||
|
<style> |
||||||
|
</style> |
||||||
Loading…
Reference in new issue