This commit is contained in:
DESKTOP-369JRHT\12997 2024-07-11 18:20:25 +08:00
commit adf5b1ea7a
7 changed files with 201 additions and 37 deletions

View File

@ -15,7 +15,7 @@
</div>
<div><span>{{radio}}交易金额总计</span><span class="title-lan">{{sum}}</span> <span></span></div>
<div v-loading="oilLoading" id="ccccc" style="width: 100%; height: 400px; background: linear-gradient( 360deg, #F8F1E7 0%, #FFFFFF 100%); "></div>
<div v-loading="oilLoading" id="ccccc" style="width: 100%; height: 370px; background: linear-gradient( 360deg, #F8F1E7 0%, #FFFFFF 100%); "></div>
</div>
@ -194,7 +194,14 @@ export default {
},
]
],
grid: {
left: '8%',
right: '8%',
bottom: '5%',
containLabel: true
},
};
chart.setOption(option)

View File

@ -131,3 +131,16 @@
.el-pagination.is-background .el-pager li:hover{
color: #FF9655 !important;/*hover时候的文字颜色*/
}
//修改选择框的颜色
.el-checkbox__input.is-checked .el-checkbox__inner,
.el-checkbox__input.is-indeterminate .el-checkbox__inner {
border-color: #FF9655!important;
background-color: #FF9655!important;
}
.el-checkbox__input.is-focus .el-checkbox__inner{
border-color: #FF9655!important;
}
//修改选中后文本的颜色
.el-checkbox__input.is-checked+.el-checkbox__label{
color:#FF9655!important;
}

View File

@ -7,6 +7,7 @@ export default {
data() {
return {
merchantId: "2",
isOpen: true,
ruleForm: {
roleName: '',
storeId: '',
@ -15,9 +16,11 @@ export default {
description: '',
dutyId: "",
checkedKeys: [],
roleCode:"",
roleCode:"0",
},
checked:true,
checkedKeys:[],
isCashier:false,
checked:false,
rules: {
roleName: [
{required: true, message: '请输入角色名称', trigger: 'blur'},
@ -94,11 +97,15 @@ export default {
// merchantId deptType
this.tableData = []
menuTreeselect({merchantId: this.merchantId, roleId: this.ruleForm.dutyId}).then(response => {
let show = false
if (this.isCashier) {
show = true
}
let data = {
id: 0,
label: '收银台',
childrens: [],
list: [{id: 0,show: false, name: '选中菜单'},]
list: [{id: 0,show: show, name: '选中菜单'},]
}
this.tableData.push(data);
this.tableData.push(...response.data);
@ -148,6 +155,11 @@ export default {
this.ruleForm.checkedKeys = checkedKeys
this.ruleForm.menuIds = checkedKeys
this.merchantId = response.data.roleInfo.type
if (response.data.roleInfo.roleCode==2 || response.data.roleInfo.roleCode==3){
this.isCashier = true
}else {
this.isCashier = false
}
this.getMenuTreeselect()
// this.tableData = response.data.treeselect;
});
@ -162,9 +174,114 @@ export default {
}
})
},
openTable(str) {
// if (str == 'open') {
// this.isOpen = true;
// } else {
// this.isOpen = false;
// }
this.$nextTick(() => {
this.handleArr(this.tableData, this.isOpen);
});
},
handleArr(arr, flag) {
arr.forEach(i => {
this.$refs.table.toggleRowExpansion(i, flag);
if (i.children) {
this.handleArr(i.children);
}
});
},
//
chooseAllOrNo(val){
let show = val
if (val){
let ids = []
this.tableData.forEach(item => {
if (item.id == 0){
item.show = show
item.list.forEach(item1 => {
item1.show = show
})
return;
}
ids.push(item.id)
item.show = show
item.list.forEach(item1 => {
ids.push(item1.id)
item1.show = show
})
item.childrens.forEach(item1 => {
ids.push(item1.id)
item1.show = show
item1.list.forEach(item2 => {
ids.push(item2.id)
item2.show = show
})
})
})
this.ruleForm.roleCode = '3'
this.ruleForm.checkedKeys = ids.filter((item, index) => ids.indexOf(item) === index);
}else {
this.tableData.forEach(item => {
item.show = show
item.list.forEach(item1 => {
item1.show = show
})
item.childrens.forEach(item1 => {
item1.show = show
item1.list.forEach(item2 => {
item2.show = show
})
})
})
this.ruleForm.roleCode = '0'
this.ruleForm.checkedKeys = []
}
this.ruleForm.menuIds = this.ruleForm.checkedKeys;
},
getLengthCheck(){
let ids = []
this.tableData.forEach(item => {
if (item.id == 0){
return;
}
ids.push(item.id)
item.list.forEach(item1 => {
ids.push(item1.id)
})
item.childrens.forEach(item1 => {
ids.push(item1.id)
item1.list.forEach(item2 => {
ids.push(item2.id)
})
})
})
this.checkedKeys = ids.filter((item, index) => ids.indexOf(item) === index);
},
chooseImg(row, data) {
if (row.id==0){
row.show = !row.show
if (row.show) {
if (this.ruleForm.checkedKeys.length>0){
this.ruleForm.roleCode = '3'
}else {
this.ruleForm.roleCode = '2'
}
}else {
if (this.ruleForm.checkedKeys.length>0){
this.ruleForm.roleCode = '1'
}else {
this.ruleForm.roleCode = '0'
}
}
this.isCashier = row.show
this.getLengthCheck();
if (this.checkedKeys.length==this.ruleForm.checkedKeys.length && this.isCashier){
this.checked = true
}else {
this.checked = false
}
return;
}
let ids = []
@ -211,7 +328,12 @@ export default {
this.ruleForm.checkedKeys = this.ruleForm.checkedKeys.filter(item => !uniqueArr.includes(item));
}
this.ruleForm.menuIds = this.ruleForm.checkedKeys;
// this.ruleForm.checkedKeys = this.ruleForm.checkedKeys.filter(item => item !== row.id);
this.getLengthCheck();
if (this.checkedKeys.length==this.ruleForm.checkedKeys.length && this.isCashier){
this.checked = true
}else {
this.checked = false
}
}
}
}
@ -267,16 +389,21 @@ export default {
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<el-form-item label="菜单功能权限" prop="checkedKeys">
<el-checkbox v-model="checked">全选</el-checkbox>
<el-checkbox v-model="checked" @change="chooseAllOrNo">全选</el-checkbox>
<el-checkbox v-model="isOpen" @change="openTable">展开</el-checkbox>
</el-form-item>
</el-form>
<!-- <el-button size="mini" @click.native="openTable('open')">一键展开</el-button>-->
<!-- <el-button size="mini" @click.native="openTable('fold')">折叠</el-button>-->
</div>
<el-table
ref="table"
:data="tableData"
style="width: 100%;margin-bottom: 20px;"
row-key="id"
border
default-expand-all
stripe
:tree-props="{children: 'childrens', hasChildren: 'hasChildren'}">
<el-table-column

View File

@ -43,6 +43,17 @@ public class RoleDto {
*/
private String status;
// 是否拥有登录权限
private String roleCode;
public String getRoleCode() {
return roleCode;
}
public void setRoleCode(String roleCode) {
this.roleCode = roleCode;
}
public Integer getStoreId() {
return storeId;
}

View File

@ -143,6 +143,7 @@ public class BackendDutyController extends BaseController {
String type = param.get("deptType").toString();
String status = param.get("status").toString();
String description = param.get("description").toString();
String roleCode = param.get("roleCode").toString();
if (ObjectUtil.isEmpty(param.get("storeId"))){
return getFailureResult(1001, "请先选择机构");
}
@ -174,6 +175,7 @@ public class BackendDutyController extends BaseController {
tDuty.setStatus(status);
tDuty.setDescription(description);
tDuty.setStoreId(storeId);
tDuty.setRoleCode(roleCode);
// 添加角色信息
try {
@ -212,6 +214,7 @@ public class BackendDutyController extends BaseController {
roleInfo.setStatus(htDuty.getStatus());
roleInfo.setStoreId(htDuty.getStoreId());
roleInfo.setDescription(htDuty.getDescription());
roleInfo.setRoleCode(htDuty.getRoleCode());
result.put("roleInfo", roleInfo);
@ -245,6 +248,7 @@ public class BackendDutyController extends BaseController {
String type = param.get("roleType").toString();
String status = param.get("status").toString();
String description = param.get("description").toString();
String roleCode = param.get("roleCode").toString();
AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
if (accountInfo == null) {
@ -265,6 +269,7 @@ public class BackendDutyController extends BaseController {
duty.setDutyName(name);
duty.setStatus(status);
duty.setDutyType(type);
duty.setRoleCode(roleCode);
// 获取角色所分配的菜单
List<TSource> sources = null;

View File

@ -153,6 +153,7 @@ public class DutyServiceImpl extends ServiceImpl<TDutyMapper, TDuty> implements
existsDuty.setDutyType(tduty.getDutyType());
existsDuty.setDutyName(tduty.getDutyName());
existsDuty.setStatus(tduty.getStatus());
existsDuty.setRoleCode(tduty.getRoleCode());
if (sources != null && sources.size() > 0) {
tDutySourceMapper.deleteSourcesByDutyId(tduty.getDutyId());

View File

@ -243,16 +243,17 @@
<div class="center-top-of">
<div class="wrap-wrap">
<div class="of-box" v-for="(item,index) in gunList" :key="index"
:style="{'background-color': colorList[index%5].color}"
:style="{'background-color': colorList[index%4].color}"
@click="refuel(item)">
<div>{{ getName(oilNameList,getOilNames(oilNumberList,item.numberId)) }}</div>
<div :style="{'color': colorList[index%4].border}" >{{ getName(oilNameList,getOilNames(oilNumberList,item.numberId)) }}</div>
<!-- <div>{{ getOilNames(oilNumberList,item.numberId) }}</div>-->
<!-- <div>{{ item.oilNumber }</div>-->
<div class="of-title" >{{item.gunName}}</div>
<div style="display: flex;justify-content: space-between">
<div style="display: flex;justify-content: space-between ;font-size: 12px" >
<img src="../../../assets/images/jya.png" style="width: 18px;height: 18px;">
<span style="font-size: 12px">{{ item.tankName }}</span>
<span :style="{'color': colorList[index%4].border}" >{{ item.tankName }}</span>
</div>
</div>
@ -268,7 +269,7 @@
</div>
</div>
<div class="center-left-bottom">
<div class="bottom-gd" @click="resetting">重置</div>
<div class="bottom-qk" @click="resetting">重置</div>
<!-- <div class="bottom-qk">解锁</div>-->
</div>
</div>
@ -1497,11 +1498,10 @@
leftindex:0,
oilList:[],
colorList:[
{color:'#e5f0ff'},
{color:'#fff2e5'},
{color:'#e5edf1'},
{color:'#ecfae5'},
{color:'#fafafa'}
{color:'#e5f0ff',border:"#409EFF"},
{color:'#fff2e5',border:"#FF9655"},
{color:'#ecfae5',border:"#0DC291"},
{color:'#fff8e7',border:"#FFB519"}
],
restaurants:'',
num: 1,
@ -4829,19 +4829,19 @@
//cursor: pointer;
//color: #20b400;
}
.wrap-box :hover{
/*background: #00afff !important;*/
width: 100%;
height: 100%;
border-radius: 8px;
height: 80px;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #00afff;
cursor: pointer;
/*color: white;*/
}
//.wrap-box :hover{
// /*background: #00afff !important;*/
// width: 100%;
// height: 100%;
// border-radius: 8px;
// height: 80px;
// display: flex;
// align-items: center;
// justify-content: center;
// border: 1px solid #00afff;
// cursor: pointer;
// /*color: white;*/
//}
.box-center{
width: 100%;
@ -4864,27 +4864,27 @@
.bottom-qk{
border: 1px solid #99a9bf;
box-sizing: border-box;
padding: 14px 20px;
border-radius: 50px;
padding: 10px 20px;
border-radius: 10px;
color: #99a9bf;
margin: 15px 0px ;
}
.bottom-qd{
border: 1px solid #13ce66;
background: #13ce66;
background: linear-gradient( 312deg, #9CDCA0 0%, #5BC557 100%);
box-sizing: border-box;
padding: 14px 20px;
border-radius: 50px;
border-radius: 8px;
color: #ffffff;
margin: 15px 10px ;
}
.bottom-gd{
border: 1px solid #FF9655;
background: #FF9655;
border: 1px solid #02AAFE;
background: linear-gradient( 312deg, #70CAFD 0%, #0BADFE 100%, #02AAFE 100%);
box-sizing: border-box;
padding: 14px 20px;
border-radius: 50px;
border-radius: 8px;
color: #ffffff;
margin: 15px 10px ;