Commit 65c6e5a4 authored by huangjie's avatar huangjie

企业方案

parent a2130fca
import request from '@/utils/request'
//新增租户套餐
export function addTenantPackage(param) {
return request({
url: '/system/tenant/package',
method: 'POST',
data: param
})
}
//获取租户套餐
export function detailTenantPackage(packageId) {
return request({
url: '/system/tenant/package/'+packageId,
method: 'get',
})
}
//租户套餐列表
export function getTenantPackage(param) {
return request({
url: '/system/tenant/package/list',
method: 'get',
params: param
})
}
......@@ -3,7 +3,7 @@
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item label="方案名称" prop="roleName">
<el-input
v-model="queryParams.roleName"
v-model="queryParams.packageName"
placeholder="请输入方案名称"
clearable
style="width: 240px"
......@@ -48,8 +48,8 @@
<span>{{(queryParams.pageNum - 1) *queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="方案名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
<el-table-column label="备注" prop="roleKey" width="400">
<el-table-column label="方案名称" prop="packageName" :show-overflow-tooltip="true" width="150" />
<el-table-column label="备注" prop="remark" width="400">
<template slot-scope="scope">
<el-popover
title=""
......@@ -57,8 +57,8 @@
width="400"
trigger="hover"
popper-class="popovers"
content="备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数">
<div class="over" slot="reference">备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数</div>
:content="scope.row.remark">
<div class="over" slot="reference">{{scope.row.remark}}</div>
</el-popover>
</template>
......@@ -74,7 +74,7 @@
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
<template slot-scope="scope" v-if="scope.row.packageId !== 1">
<el-button
size="mini"
type="text"
......@@ -108,11 +108,16 @@
@pagination="getList"
/>
<!-- 添加或修改角色配置对话框 -->
<!-- 添加或修改租户套餐配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="方案名称" prop="roleName">
<el-input v-model="form.roleName" placeholder="请输入方案名称" />
<el-form-item label="方案名称" prop="packageName">
<el-input v-model="form.packageName" placeholder="请输入方案名称" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio v-model="form.status" label="0">正常</el-radio>
<el-radio v-model="form.status" label="1">停用</el-radio>
</el-form-item>
<el-form-item label="角色授权">
<el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>
......@@ -124,7 +129,7 @@
show-checkbox
ref="menu"
node-key="id"
:check-strictly="!form.menuCheckStrictly"
:check-strictly="!form.menuIds"
empty-text="加载中,请稍候"
:props="defaultProps"
></el-tree>
......@@ -145,6 +150,9 @@
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role";
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
import { addTenantPackage ,getTenantPackage,detailTenantPackage} from "@/api/enterpriseManagement/enterpriseManagement";
export default {
name: "programme",
dicts: ['ent_pro_status'],
......@@ -207,9 +215,7 @@
queryParams: {
pageNum: 1,
pageSize: 10,
roleName: undefined,
roleKey: undefined,
status: undefined
packageName:'',
},
// 表单参数
form: {},
......@@ -219,15 +225,12 @@
},
// 表单校验
rules: {
roleName: [
{ required: true, message: "角色名称不能为空", trigger: "blur" }
packageName: [
{ required: true, message: "套餐名称不能为空", trigger: "blur" }
],
roleKey: [
{ required: true, message: "权限字符不能为空", trigger: "blur" }
status: [
{ required: true, message: "状态不能为空", trigger: "blur" }
],
roleSort: [
{ required: true, message: "角色顺序不能为空", trigger: "blur" }
]
}
};
},
......@@ -235,10 +238,10 @@
this.getList();
},
methods: {
/** 查询角色列表 */
/** 查询方案列表 */
getList() {
this.loading = true;
listRole(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
getTenantPackage(this.queryParams).then(response => {
this.roleList = response.rows;
this.total = response.total;
this.loading = false;
......@@ -272,7 +275,7 @@
/** 根据角色ID查询菜单树结构 */
getRoleMenuTreeselect(roleId) {
return roleMenuTreeselect(roleId).then(response => {
this.menuOptions = response.data.menus;
this.menuOptions = response.data;
return response;
});
},
......@@ -303,16 +306,12 @@
this.deptExpand = true,
this.deptNodeAll = false,
this.form = {
roleId: undefined,
roleName: undefined,
roleKey: undefined,
roleSort: 0,
packageId: undefined,
packageName: undefined,
remark: undefined,
menuCheckStrictly:true,
status: "0",
menuIds: [],
deptIds: [],
menuCheckStrictly: true,
deptCheckStrictly: true,
remark: undefined
};
this.resetForm("form");
},
......@@ -381,14 +380,14 @@
this.reset();
this.getMenuTreeselect();
this.open = true;
this.title = "添加角色";
this.title = "添加方案";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const roleId = row.roleId || this.ids
const roleMenu = this.getRoleMenuTreeselect(roleId);
getRole(roleId).then(response => {
const packageId = row.packageId
const roleMenu = this.getRoleMenuTreeselect(packageId);
detailTenantPackage(packageId).then(response => {
this.form = response.data;
this.open = true;
this.$nextTick(() => {
......@@ -401,7 +400,7 @@
})
});
});
this.title = "修改角色";
this.title = "修改方案";
});
},
/** 选择角色权限范围触发 */
......@@ -434,7 +433,7 @@
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.roleId != undefined) {
if (this.form.packageId != undefined) {
this.form.menuIds = this.getMenuAllCheckedKeys();
updateRole(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
......@@ -443,7 +442,7 @@
});
} else {
this.form.menuIds = this.getMenuAllCheckedKeys();
addRole(this.form).then(response => {
addTenantPackage(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
......
......@@ -35,8 +35,8 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
// target: `http://47.104.91.229:9099/prod-api`,
// target: `http://192.168.0.165:9098`,//施
target: `http://192.168.60.6:9098`,//谭
target: `http://192.168.0.165:9098`,//施
// target: `http://192.168.60.6:9098`,//谭
// target: `http://139.9.157.49:9099`,//测试
changeOrigin: true,
pathRewrite: {
......
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