Browse Source

权限配置

lwx_v26
herenshan112 7 months ago
parent
commit
33d73c15b9
  1. 32
      src/api/system/roleapi/postrole.ts
  2. 20
      src/api/system/roleapi/types.ts
  3. 9
      src/components/DesignForm/app/index.vue
  4. 25
      src/utils/workflow/const.ts
  5. 346
      src/views/powermanage/rolepower/setuprole/index.vue
  6. 371
      src/views/powermanage/rolepower/setuprole/setuprolepower.vue
  7. 255
      src/views/sysworkflow/lowcodepage/appPage/releaseApp/index.vue
  8. 15
      src/views/sysworkflow/lowcodepage/runApp/runAppForm.vue

32
src/api/system/roleapi/postrole.ts

@ -81,3 +81,35 @@ export function getSystemType(data: setupPage){
data:data
});
}
/**
* App列表
*/
export function gainAppList(data?: any){
return request({
url: '/systemapi/grant/gainAppList',
method: 'post',
data:data
});
}
/**
*
*/
export function gainAppTableList(data?: any){
return request({
url: '/systemapi/grant/gainAppTableList',
method: 'post',
data:data
});
}
/**
*
*/
export function setpAppTableForms(data?: any){
return request({
url: '/systemapi/grant/setpAppTableForms',
method: 'post',
data:data
});
}

20
src/api/system/roleapi/types.ts

@ -265,3 +265,23 @@ export interface setupRolePeople{
roleid:string;
peoplelist:orgAndPeopleLists[];
}
/**
@ 作者: 秦东
@ 时间: 2025-05-13 14:24:55
@ 功能: 自定义App列表结构
*/
export interface custerAppInfo{
id:string;
name:string;
signCode:string;
}
export interface custerAppTablePower extends custerAppInfo{
tablePower:string[];
listPower:string[];
datePower:{
types:number,
attribute:number[]
};
}

9
src/components/DesignForm/app/index.vue

@ -79,6 +79,7 @@ const props = withDefaults(
formBasicConfig?: any;
fieldsDetailList?: any;
orgAndManTree?: any;
appPower?: any;
}>(),
{
showPage: true,
@ -127,6 +128,12 @@ const props = withDefaults(
orgAndManTree: () => {
return {};
},
appPower: {
Level: 1,
Operation: [],
OrgList: [],
PointId: [],
},
}
);
const emits = defineEmits<{
@ -1550,7 +1557,7 @@ const readerColumnSun = (column: any) => {
<template>
<div ref="container" v-loading="state.loading" class="table-list-comm">
<el-row class="rowBox">
<el-col :span="24">
<el-col :span="24" 6>
<el-form v-if="config.searchIsShow" ref="ruleSearchForm" class="seacherForm">
<template v-for="(item, index) in searchData" :key="index">
<div class="group group-input">

25
src/utils/workflow/const.ts

@ -387,3 +387,28 @@ export let editLookFormCont = {
}
]
}
/**
@ 作者: 秦东
@ 时间: 2025-05-15 08:06:57
@ 功能: 表格按钮
*/
export let appTableBut = [
{ label: '暂存',value: 'zc',key:1},
{ label: '提交',value: 'tj',key:2},
{ label: '打印',value: 'dy',key:3},
{ label: '删除',value: 'sc',key:4},
{ label: '复制',value: 'fz',key:5}
]
/**
@ 作者: 秦东
@ 时间: 2025-05-15 08:06:57
@ 功能: 列表按钮
*/
export let appListBut = [
{ label: '新增',value: 'xz',key:1},
{ label: '导入',value: 'dr',key:2},
{ label: '导出 ',value: 'dc',key:3},
{ label: '删除',value: 'sc',key:4},
{ label: '打印',value: 'dy',key:5},
{ label: '打印二维码',value: 'dyewm',key:6}
]

346
src/views/powermanage/rolepower/setuprole/index.vue

@ -3,27 +3,31 @@
@ 时间: 2023-05-26 09:32:10
@ 备注:
-->
<script lang='ts' setup>
<script lang="ts" setup>
defineOptions({
name: "setuprole",
inheritAttrs: false,
name: "setuprole",
inheritAttrs: false,
});
import { searchRoleWord, roleLietCont, editRoleContKeyword } from "@/api/system/roleapi/types"; //
import { getSystemRoleList, editRoleContStatus } from "@/api/system/roleapi/rolecont"; //api
import AddCont from "@/views/powermanage/rolepower/setuprole/addrole.vue" //
import EditCont from "@/views/powermanage/rolepower/setuprole/editrole.vue" //
import SetupRolePower from "@/views/powermanage/rolepower/setuprole/setuprolepower.vue" //
import StaffingRole from "@/views/powermanage/rolepower/setuprole/staffingrole.vue" //使
import {
searchRoleWord,
roleLietCont,
editRoleContKeyword,
} from "@/api/system/roleapi/types"; //
import { getSystemRoleList, editRoleContStatus } from "@/api/system/roleapi/rolecont"; //api
import AddCont from "@/views/powermanage/rolepower/setuprole/addrole.vue"; //
import EditCont from "@/views/powermanage/rolepower/setuprole/editrole.vue"; //
import SetupRolePower from "@/views/powermanage/rolepower/setuprole/setuprolepower.vue"; //
import StaffingRole from "@/views/powermanage/rolepower/setuprole/staffingrole.vue"; //使
const queryFormRef = ref(ElForm); //
const searchForm = reactive<searchRoleWord>({ name: "" }); //
const ids = ref<number[]>([]); //ID
const loading = ref(false); //
const roleContList = ref<roleLietCont[]>([])
const openAddBox = ref(false); //
const openEditBox = ref(false); //
const openSetupPowerBox = ref(false); //
const openSetupUsersBox = ref(false); //使
const queryFormRef = ref(ElForm); //
const searchForm = reactive<searchRoleWord>({ name: "" }); //
const ids = ref<number[]>([]); //ID
const loading = ref(false); //
const roleContList = ref<roleLietCont[]>([]);
const openAddBox = ref(false); //
const openEditBox = ref(false); //
const openSetupPowerBox = ref(false); //
const openSetupUsersBox = ref(false); //使
const selectTableLength = ref(0);
const currentRoleCont = reactive<editRoleContKeyword>({});
@ -31,93 +35,92 @@ const currentRoleCont = reactive<editRoleContKeyword>({});
* 搜索角色
*/
function searchRoleList() {
getSystemRoleList(searchForm)
.then(({ data }) => {
roleContList.value = data;
})
getSystemRoleList(searchForm).then(({ data }) => {
roleContList.value = data;
});
}
/**
* 行checkbox change事件
*/
function handleSelectionChange(selection: any) {
selectTableLength.value = selection.length;
ids.value = selection.map((item: any) => item.id);
selectTableLength.value = selection.length;
ids.value = selection.map((item: any) => item.id);
}
/**
* 查询重置
*/
function resetQuery() {
queryFormRef.value.resetFields();
searchRoleList();
queryFormRef.value.resetFields();
searchRoleList();
}
/**
* 打开角色新增页面
*/
function openAddRoleDialog() {
openAddBox.value = true;
openAddBox.value = true;
}
/**
* 打开编辑角色页面
*/
function openEditRoleDialog(roleCont: roleLietCont) {
currentRoleCont.id = roleCont.id.toString()
currentRoleCont.name = roleCont.name
currentRoleCont.sort = roleCont.sort
openEditBox.value = true
// console.log("--->",openEditBox.value,currentRoleCont);
currentRoleCont.id = roleCont.id.toString();
currentRoleCont.name = roleCont.name;
currentRoleCont.sort = roleCont.sort;
openEditBox.value = true;
// console.log("--->",openEditBox.value,currentRoleCont);
}
/**
* 删除角色
*/
function handleDelete(delId?: number) {
const delRoleIds = [delId || ids.value].join(",");
if (!delRoleIds) {
ElMessage.warning("请勾选删除项");
return;
}
let dictTypeIdAry = delRoleIds.split(",")
ElMessageBox.confirm("确认删除已选中的数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
const delRoleIds = [delId || ids.value].join(",");
if (!delRoleIds) {
ElMessage.warning("请勾选删除项");
return;
}
let dictTypeIdAry = delRoleIds.split(",");
ElMessageBox.confirm("确认删除已选中的数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
editRoleContStatus({ id: dictTypeIdAry, istrue: 2, state: 3 }).then(() => {
ElMessage.success("删除成功");
searchRoleList();
});
})
.then(() => {
editRoleContStatus({ id: dictTypeIdAry, istrue: 2, state: 3 }).then(() => {
ElMessage.success("删除成功");
searchRoleList();
});
})
.catch(() => ElMessage.info("已取消删除"));
.catch(() => ElMessage.info("已取消删除"));
}
/**
* 配置权限
*/
function openSetupPwoerDialog(roleCont: roleLietCont) {
currentRoleCont.id = roleCont.id.toString()
currentRoleCont.name = "配置 < " + roleCont.name + " > 权限"
currentRoleCont.sort = roleCont.sort
openSetupPowerBox.value = true;
currentRoleCont.id = roleCont.id.toString();
currentRoleCont.name = "配置 < " + roleCont.name + " > 权限";
currentRoleCont.sort = roleCont.sort;
openSetupPowerBox.value = true;
}
/**
* 配置使用人员
*/
function openSetupUsersDialog(roleCont: roleLietCont) {
currentRoleCont.id = roleCont.id.toString()
currentRoleCont.name = roleCont.name
currentRoleCont.sort = roleCont.sort
openSetupUsersBox.value = true;
currentRoleCont.id = roleCont.id.toString();
currentRoleCont.name = roleCont.name;
currentRoleCont.sort = roleCont.sort;
openSetupUsersBox.value = true;
}
const searchRoleListsun = () => {
searchRoleList();
}
searchRoleList();
};
//
onMounted(() => {
searchRoleList();
searchRoleList();
});
</script>
<template>
<div class="app-container">
<!-- <div class="search">
<div class="app-container">
<!-- <div class="search">
<el-form ref="queryFormRef" :model="searchForm" :inline="true">
<el-form-item label="关键字" prop="keywords">
<el-input v-model="searchForm.name" placeholder="角色名称" clearable />
@ -131,101 +134,152 @@ onMounted(() => {
</el-form-item>
</el-form>
</div> -->
<!--角色主体部门-->
<el-card shadow="never">
<template #header>
<el-form ref="queryFormRef" :model="searchForm" :inline="true">
<el-row style="padding-left: 20px;">
<el-col :span="19">
<el-form-item label="关键字" prop="keywords">
<el-input v-model="searchForm.name" placeholder="角色名称" clearable />
</el-form-item>
</el-col>
<el-col :span="5" class="flex-end">
<el-form-item>
<el-button type="primary" @click="searchRoleList"><template
#icon><i-ep-search /></template>搜索</el-button>
<el-button @click="resetQuery">
<template #icon><i-ep-refresh /></template>
重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- -->
</template>
<div style="margin-bottom: 15px;height: 32px;display: flex;">
<el-button type="primary" @click="openAddRoleDialog()"
v-hasPerm="['124066798512386048']"><i-ep-plus />新增</el-button>
<el-button plain type="primary" v-hasPerm="['124066956029472768']" :disabled="ids.length === 0"
@click="handleDelete()"><i-ep-delete />删除</el-button>
<span class="select-text">已选 {{ selectTableLength }} </span>
</div>
<!--角色主体部门-->
<el-card shadow="never">
<template #header>
<el-form ref="queryFormRef" :model="searchForm" :inline="true">
<el-row style="padding-left: 20px">
<el-col :span="19">
<el-form-item label="关键字" prop="keywords">
<el-input v-model="searchForm.name" placeholder="角色名称" clearable />
</el-form-item>
</el-col>
<el-col :span="5" class="flex-end">
<el-form-item>
<el-button type="primary" @click="searchRoleList"
><template #icon><i-ep-search /></template>搜索</el-button
>
<el-button @click="resetQuery">
<template #icon><i-ep-refresh /></template>
重置</el-button
>
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- -->
</template>
<div style="margin-bottom: 15px; height: 32px; display: flex">
<el-button
type="primary"
@click="openAddRoleDialog()"
v-hasPerm="['124066798512386048']"
><i-ep-plus />新增</el-button
>
<el-button
plain
type="primary"
v-hasPerm="['124066956029472768']"
:disabled="ids.length === 0"
@click="handleDelete()"
><i-ep-delete />删除</el-button
>
<span class="select-text">已选 {{ selectTableLength }} </span>
</div>
<el-table v-loading="loading" highlight-current-row :data="roleContList" stripe
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="角色名称" prop="name" />
<el-table-column label="排序" prop="sort" align="center" width="200" />
<el-table-column label="状态" align="center" width="100">
<template #default="scope">
<el-tag v-if="scope.row.state === 1" type="success">启用</el-tag>
<el-tag v-else type="info">禁用</el-tag>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center">
<template #default="scope">
<el-button v-hasPerm="['124067026950959104']" type="primary" link size="small"
@click.stop="openSetupPwoerDialog(scope.row)">配置权限</el-button>
<el-button v-hasPerm="['124067108593086464']" type="primary" link size="small"
@click.stop="openSetupUsersDialog(scope.row)">使用人员</el-button>
<el-button v-hasPerm="['124066883237326848']" type="primary" link size="small"
@click.stop="openEditRoleDialog(scope.row)">编辑</el-button>
<el-button v-hasPerm="['124066956029472768']" type="primary" link size="small"
@click.stop="handleDelete(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<!--新增角色-->
<AddCont v-model:addIsShow="openAddBox" />
<!--编辑角色-->
<EditCont v-model:isShow="openEditBox" :roleCont="currentRoleCont" @refreshRoleList="searchRoleListsun" />
<!--配置权限-->
<SetupRolePower v-model:powerIsShow="openSetupPowerBox" :roleId="currentRoleCont.id"
:roleTitle="currentRoleCont.name" />
<!--配置角色使用人员-->
<StaffingRole v-model:userIsShow="openSetupUsersBox" :roleId="currentRoleCont.id"
:roleTitle="currentRoleCont.name" @refreshRoleUserList="searchRoleListsun" />
</div>
<el-table
v-loading="loading"
highlight-current-row
:data="roleContList"
stripe
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="角色名称" prop="name" />
<el-table-column label="排序" prop="sort" align="center" width="200" />
<el-table-column label="状态" align="center" width="100">
<template #default="scope">
<el-tag v-if="scope.row.state === 1" type="success">启用</el-tag>
<el-tag v-else type="info">禁用</el-tag>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center">
<template #default="scope">
<el-button
v-hasPerm="['124067026950959104']"
type="primary"
link
size="small"
@click.stop="openSetupPwoerDialog(scope.row)"
>配置权限</el-button
>
<el-button
v-hasPerm="['124067108593086464']"
type="primary"
link
size="small"
@click.stop="openSetupUsersDialog(scope.row)"
>使用人员</el-button
>
<el-button
v-hasPerm="['124066883237326848']"
type="primary"
link
size="small"
@click.stop="openEditRoleDialog(scope.row)"
>编辑</el-button
>
<el-button
v-hasPerm="['124066956029472768']"
type="primary"
link
size="small"
@click.stop="handleDelete(scope.row.id)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
<!--新增角色-->
<AddCont v-model:addIsShow="openAddBox" />
<!--编辑角色-->
<EditCont
v-model:isShow="openEditBox"
:roleCont="currentRoleCont"
@refreshRoleList="searchRoleListsun"
/>
<!--配置权限-->
<SetupRolePower
v-model:powerIsShow="openSetupPowerBox"
:roleId="currentRoleCont.id"
:roleTitle="currentRoleCont.name"
/>
<!--配置角色使用人员-->
<StaffingRole
v-model:userIsShow="openSetupUsersBox"
:roleId="currentRoleCont.id"
:roleTitle="currentRoleCont.name"
@refreshRoleUserList="searchRoleListsun"
/>
</div>
</template>
<style lang='scss' scoped>
<style lang="scss" scoped>
::v-deep(.el-card__header) {
padding: 0 !important;
height: 78px !important;
line-height: 78px;
padding: 0 !important;
height: 78px !important;
line-height: 78px;
}
::v-deep(.el-form) {
padding-top: 10px;
padding-top: 10px;
}
.flex-end {
width: 100%;
display: flex;
justify-content: flex-end;
width: 100%;
display: flex;
justify-content: flex-end;
.el-form-item {
margin-right: 20px;
}
.el-form-item {
margin-right: 20px;
}
}
.select-text {
display: inline-block;
color: #999;
font-size: 16px;
padding-left: 15px;
line-height: 40px;
height: 32px;
display: inline-block;
color: #999;
font-size: 16px;
padding-left: 15px;
line-height: 40px;
height: 32px;
}
</style>

371
src/views/powermanage/rolepower/setuprole/setuprolepower.vue

@ -9,13 +9,24 @@ import {
systemCont,
systemMenusTypeTree,
submintPostPower,
custerAppInfo,
custerAppTablePower,
} from "@/api/system/roleapi/types";
import {
getSystemType,
getSystemPoewrTreeForRole,
getGrantRolePowers,
grantSystemRolePoewr,
gainAppList,
gainAppTableList,
setpAppTableForms,
} from "@/api/system/roleapi/postrole";
import { appTableBut, appListBut } from "@/utils/workflow/const";
import { orgInfo } from "@/api/hr/org/type";
import { getOrgTreeList } from "@/api/hr/org/index";
const props = defineProps({
powerIsShow: {
type: Boolean,
@ -37,6 +48,9 @@ const menuRef = ref(ElTree);
const powerLoading = ref(false);
const powerLoadingSub = ref(false);
const emits = defineEmits(["update:powerIsShow"]); //
const appList = ref<custerAppInfo[]>([]);
const activeAppId = ref<string>("");
const appTableList = ref<custerAppTablePower[]>([]);
/**
* 系统选择标签
*/
@ -55,6 +69,7 @@ const manageScope = ref(0);
const systemMenuTreeProps = {
children: "child",
label: "name",
value: "id",
};
/**
* 分页参数
@ -163,7 +178,11 @@ watch(
() => {
powerLoading.value = true;
if (systemTabs.value != "" && systemTabs.value != null) {
getSysMenuTree(systemTabs.value);
if (systemTabs.value == "appdevel") {
getAppList();
} else {
getSysMenuTree(systemTabs.value);
}
}
}
);
@ -171,37 +190,160 @@ watch(
* 授权
*/
function enterEmpowerClick() {
powerLoadingSub.value = true;
const checkedMenuTrue: systemMenusTypeTree[] = menuRef.value
.getCheckedNodes(false, true)
.map((node: any) => node);
// console.log("", checkedMenuTrue);
checkedMenuTrue.forEach((item) => {
item.child = [];
});
grantSystemRolePoewr({
systemname: systemTabs.value,
roleid: props.roleId,
level: manageScope.value * 1,
power: checkedMenuTrue,
})
.then((data) => {
// console.log("----", data);
ElMessage.success("授权成功");
handleClosePower();
})
.finally(() => {
powerLoadingSub.value = false;
console.log("确定授权", systemTabs.value);
if (systemTabs.value == "appdevel") {
console.log("确定授权--21-->", props.roleId);
console.log("确定授权--1-->", activeAppId.value);
console.log("确定授权---->", appTableList.value);
if (appTableList.value.length < 1) {
ElMessage.error("没有要授权的表单。");
} else {
let sendInfo = {
id: activeAppId.value.toString(),
roleId: props.roleId.toString(),
appTablePwoer: appTableList.value,
};
console.log("确定授权------------->", sendInfo);
setpAppTableForms(sendInfo)
.then((data) => {
// console.log("----", data);
ElMessage.success("授权成功");
handleClosePower();
})
.finally(() => {
powerLoadingSub.value = false;
});
}
} else {
powerLoadingSub.value = true;
const checkedMenuTrue: systemMenusTypeTree[] = menuRef.value
.getCheckedNodes(false, true)
.map((node: any) => node);
// console.log("", checkedMenuTrue);
checkedMenuTrue.forEach((item) => {
item.child = [];
});
grantSystemRolePoewr({
systemname: systemTabs.value,
roleid: props.roleId,
level: manageScope.value * 1,
power: checkedMenuTrue,
})
.then((data) => {
// console.log("----", data);
ElMessage.success("授权成功");
handleClosePower();
})
.finally(() => {
powerLoadingSub.value = false;
});
}
}
/**
@ 作者: 秦东
@ 时间: 2025-05-13 14:20:47
@ 功能: 获取自定义App
*/
const getAppList = () => {
getList();
gainAppList().then((data: any) => {
console.log("获取自定义App", data);
appList.value = data.data;
if (data.data && data.data.length > 0) {
if (data.data[0] && data.data[0].signCode) {
activeAppId.value = data.data[0].signCode;
getAppTableList();
}
}
console.log("获取自定义App", activeAppId.value);
});
};
/**
@ 作者: 秦东
@ 时间: 2025-05-13 16:00:19
@ 功能: 获取对应App下边的表单
*/
const getAppTableList = () => {
gainAppTableList({ id: activeAppId.value, roleId: props.roleId.toString() }).then(
(data: any) => {
console.log("获取对应App下边的表单", data);
if (Array.isArray(data.data)) {
appTableList.value = data.data;
} else {
appTableList.value = [];
}
}
);
};
watch(
() => activeAppId.value,
(val) => {
getAppTableList();
}
);
/**
@ 作者: 秦东
@ 时间: 2025-05-14 15:01:26
@ 功能: 选择App数据
*/
const pickAppList = (val: custerAppInfo) => {
activeAppId.value = val.signCode;
};
/**
@ 作者: 秦东
@ 时间: 2025-05-16 08:37:50
@ 功能: app数据范围
*/
const orgListTree = ref<orgInfo[]>([]);
const openAppDataBox = ref(false);
const pickOrgId = ref<number[]>([]);
const pickAppDataPower = (val: any) => {
if (val.types == 5) {
// openAppDataBox.value = true;
pickOrgId.value = val.attribute;
// getList();
} else {
openAppDataBox.value = false;
}
};
const defaultProps = {
children: "child",
label: "name",
};
const systemMenuTreePropsing = {
children: "child",
label: "name",
value: "id",
};
/**
@ 作者: 秦东
@ 时间: 2025-05-16 10:18:49
@ 功能: 获取行政组织列表
*/
const getList = () => {
getOrgTreeList({ orgid: 309, keywords: "", class: 0 }).then((data) => {
console.log("获取行政组织列表", data);
orgListTree.value = data.data;
});
};
/**
@ 作者: 秦东
@ 时间: 2025-05-16 14:30:32
@ 功能: 确定选择
*/
const pickOrgIdClick = () => {
console.log("确定选择", pickOrgId.value);
};
</script>
<template>
<el-dialog
v-model="power_is_Show"
custom-class="dialog_box"
:title="roleTitle"
top="50px"
:before-close="handleClosePower"
draggable
width="70%"
fullscreen
>
<el-container>
<el-aside width="125px">
@ -214,7 +356,124 @@ function enterEmpowerClick() {
></el-tab-pane>
</el-tabs>
</el-aside>
<el-main>
<el-main v-if="systemTabs == 'appdevel'">
<!-- <el-tabs v-model="activeAppId" class="demo-tabs">
<el-tab-pane
v-for="itemes in appList"
:key="itemes.signCode"
:label="itemes.name"
:name="itemes.signCode"
></el-tab-pane>
</el-tabs> -->
<el-scrollbar class="tab_pane_box">
<table class="table_body">
<thead>
<tr>
<td align="center" width="20%">应用</td>
<td align="center" width="20%">页面</td>
<td align="center" width="20%">表单权限</td>
<td align="center" width="20%">列表权限</td>
<td align="center" width="20%">数据权限</td>
</tr>
</thead>
<tbody>
<tr v-if="appTableList && appTableList.length <= 0">
<td valign="top">
<ul class="appListBox">
<li
v-for="itemes in appList"
:class="itemes.signCode == activeAppId ? 'active' : ''"
@click="pickAppList(itemes)"
>
{{ itemes.name }}
</li>
</ul>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr v-else v-for="(item, index) in appTableList" :key="item.id">
<td
:rowspan="appTableList.length"
v-if="index == 0 || index + 1 > appTableList.length"
valign="top"
>
<ul class="appListBox">
<li
v-for="itemes in appList"
:class="itemes.signCode == activeAppId ? 'active' : ''"
@click="pickAppList(itemes)"
>
{{ itemes.name }}
</li>
</ul>
</td>
<td valign="top">{{ item.name }}</td>
<td valign="top">
<!-- {{ item.tableIsAll }}
<el-checkbox v-model="item.tableIsAll"> 全选 </el-checkbox> -->
<el-checkbox-group v-model="item.tablePower">
<el-checkbox
v-for="city in appTableBut"
:key="city.key"
:label="city.label"
:value="city.value"
>
{{ city.label }}
</el-checkbox>
</el-checkbox-group>
</td>
<td valign="top">
<el-checkbox-group v-if="item.istIsTrue" v-model="item.listPower">
<el-checkbox
v-for="city in appListBut"
:key="city.key"
:label="city.label"
:value="city.value"
>
{{ city.label }}
</el-checkbox>
</el-checkbox-group>
</td>
<td valign="top">
<el-radio-group
v-model="item.datePower.types"
@change="pickAppDataPower(item.datePower)"
>
<el-row>
<el-col :span="24"><el-radio :value="1">本人</el-radio></el-col>
<el-col :span="24"><el-radio :value="2">本岗位</el-radio></el-col>
<el-col :span="24"><el-radio :value="3">本部门</el-radio></el-col>
<el-col :span="24"><el-radio :value="4">本分部</el-radio></el-col>
<el-col :span="24">
<el-radio :value="5">指定行政组织</el-radio>
<el-tree-select
v-if="item.datePower.types == 5"
v-model="item.datePower.attribute"
:data="orgListTree"
:render-after-expand="false"
show-checkbox
style="width: 240px"
node-key="id"
:props="systemMenuTreePropsing"
multiple
clearable
collapse-tags
/>
</el-col>
<el-col :span="24"><el-radio :value="6">所有</el-radio></el-col>
</el-row>
</el-radio-group>
</td>
</tr>
</tbody>
</table>
</el-scrollbar>
</el-main>
<el-main v-if="systemTabs != 'appdevel'">
<el-radio-group v-model="manageScope" style="margin-bottom: 10px">
<el-radio-button label="0">默认</el-radio-button>
<el-radio-button label="1">本岗位</el-radio-button>
@ -243,6 +502,32 @@ function enterEmpowerClick() {
</el-scrollbar>
</el-main>
</el-container>
<el-dialog
v-model="openAppDataBox"
width="500"
title="选择行政组织"
draggable
append-to-body
>
<el-tree
style="max-width: 600px"
:data="orgListTree"
show-checkbox
node-key="id"
:default-checked-keys="pickOrgId"
:props="defaultProps"
/>
<template #footer>
<span class="dialog-footer">
<el-button type="danger" @click="openAppDataBox = false">取消</el-button>
<el-button type="primary" :loading="powerLoadingSub" @click="pickOrgIdClick"
>确定选择</el-button
>
</span>
</template>
</el-dialog>
<template #footer>
<span class="dialog-footer">
<el-button type="danger" @click="handleClosePower">取消</el-button>
@ -258,19 +543,51 @@ function enterEmpowerClick() {
padding: 0;
}
.tabs_box {
height: calc(100vh - 500px);
height: calc(100vh - 140px);
.tab_pane_box {
height: calc(100vh - 550px);
height: calc(100vh - 220px);
overflow: hidden;
overflow-y: auto;
}
}
.tab_pane_box {
height: calc(100vh - 550px);
height: calc(100vh - 230px);
overflow: hidden;
overflow-y: auto;
}
.tree_sapn {
padding: 0 15px;
}
.table_body {
background-color: #ffffff;
width: 100%;
border-collapse: collapse;
/*
* 设置边框
*/
td,
th {
border: 1px solid #cccccc;
padding: 5px;
table {
width: 100%;
td,
th {
border: 0px solid #cccccc;
padding: 0px;
}
}
}
}
.appListBox {
width: 100%;
li {
padding: 4px 2px;
border-bottom: 1px solid #ececec;
cursor: pointer;
}
li.active {
background-color: #a0cfff;
}
}
</style>

255
src/views/sysworkflow/lowcodepage/appPage/releaseApp/index.vue

@ -3,40 +3,40 @@
@ 时间: 2024-05-29 13:25:09
@ 备注: 应用发布页面
-->
<script lang='ts' setup>
import { gainAppPageInfo,setCustomerFormState } from '@/api/DesignForm/requestapi'
<script lang="ts" setup>
import { gainAppPageInfo, setCustomerFormState } from "@/api/DesignForm/requestapi";
const props = defineProps({
appCont:{
type:Object,
default(){
return {}
}
},
groupKey:{
type:String,
default:""
}
appCont: {
type: Object,
default() {
return {};
},
},
groupKey: {
type: String,
default: "",
},
});
const appStatue = ref(true);
const isEdit = ref(false);
onMounted(() => {
gainAppPageInfo({ id: props.appCont.uuid })
.then((data) => {
// console.log("",data)
if (data.data.appForm.states == 1) {
appStatue.value = true;
props.appCont.state = 1;
} else {
appStatue.value = false;
props.appCont.state = 2;
}
})
.finally(() => {
isEdit.value = true;
});
});
const appStatue = ref(true)
const isEdit = ref(false)
onMounted(()=>{
gainAppPageInfo({id:props.appCont.uuid})
.then((data)=>{
// console.log("",data)
if(data.data.appForm.states == 1){
appStatue.value = true
props.appCont.state = 1
}else{
appStatue.value = false
props.appCont.state = 2
}
})
.finally(()=>{
isEdit.value = true;
})
})
// watch(()=>appStatue.value,(val:boolean) => {
// let sta = 1
// if(val){
// props.appCont.state = 1
@ -48,110 +48,111 @@ onMounted(()=>{
// setUpState(sta)
// })
/**
@ 作者: 秦东
@ 时间: 2024-05-29 14:38:01
@ 功能: 设置状态
*/
const setUpState = (val:number) => {
setCustomerFormState({id:props.appCont.uuid,state:val})
.then((data)=>{
props.appCont.state = appStatue.value
// ElMessage({
// showClose: true,
// message: data.msg,
// type: 'success',
// })
})
}
const switchChang = () =>{
if(appStatue.value == 1){
setUpState(1)
}else{
setUpState(2)
}
}
const setUpState = (val: number) => {
setCustomerFormState({ id: props.appCont.uuid, state: val }).then((data) => {
props.appCont.state = appStatue.value;
// ElMessage({
// showClose: true,
// message: data.msg,
// type: 'success',
// })
});
};
const switchChang = () => {
if (appStatue.value == 1) {
setUpState(1);
} else {
setUpState(2);
}
};
</script>
<template>
<div class="appBox">
<el-card class="appCardBox" shadow="always">
<table>
<tr>
<td width="100px" align="center">
<el-image :src="props.appCont.appSvg">
<template #error>
<div class="image-slot">
<el-icon><icon-picture /></el-icon>
</div>
</template>
</el-image>
</td>
<td width="150px" align="center">
<el-text v-if="appStatue" class="mx-1 bigWord" type="success">已启用</el-text>
<el-text v-else class="mx-1 bigWord" type="danger">已停用</el-text>
</td>
<td align="left" >
<el-text v-if="appStatue" class="mx-1" type="success">应用已启用为可用状态</el-text>
<el-text v-else class="mx-1" type="danger">应用已停用不可使用此App</el-text>
</td>
<td width="100px" align="right">
<el-switch
v-model="appStatue"
class="ml-2"
inline-prompt
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
active-text="已启用"
inactive-text="已停用"
@change="switchChang"
/>
</td>
</tr>
</table>
</el-card>
</div>
<div class="appBox">
<el-card class="appCardBox" shadow="always">
<table>
<tr>
<td width="100px" align="center">
<el-image :src="props.appCont.appSvg">
<template #error>
<div class="image-slot">
<el-icon><icon-picture /></el-icon>
</div>
</template>
</el-image>
</td>
<td width="150px" align="center">
<el-text v-if="appStatue" class="mx-1 bigWord" type="success">已启用</el-text>
<el-text v-else class="mx-1 bigWord" type="danger">已停用</el-text>
</td>
<td align="left">
<el-text v-if="appStatue" class="mx-1" type="success"
>应用已启用为可用状态</el-text
>
<el-text v-else class="mx-1" type="danger"
>应用已停用不可使用此App</el-text
>
</td>
<td width="100px" align="right">
<el-switch
v-model="appStatue"
class="ml-2"
inline-prompt
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
active-text="已启用"
inactive-text="已停用"
@change="switchChang"
/>
</td>
</tr>
</table>
</el-card>
</div>
</template>
<style lang='scss' scoped>
.appBox{
width:100%;
background-color : #F5F7FA;
height: calc(100vh - 40px);
text-align: center;
.appCardBox{
max-width: 60%;
min-width: 40%;
margin: 20px auto;
td{
vertical-align: middle;
.bigWord{
font-size:30px;
}
}
.el-image {
padding: 0 5px;
max-width: 80px;
max-height: 70px;
width: 100%;
height: 70px;
border: 1px solid #F0F2F5;
border-radius: 5px;
background: var(--el-fill-color-light);
}
.image-slot {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
background: var(--el-fill-color-light);
color: var(--el-text-color-secondary);
font-size: 30px;
}
.image-slot .el-icon {
font-size: 30px;
}
}
<style lang="scss" scoped>
.appBox {
width: 100%;
background-color: #f5f7fa;
height: calc(100vh - 40px);
text-align: center;
.appCardBox {
max-width: 60%;
min-width: 40%;
margin: 20px auto;
td {
vertical-align: middle;
.bigWord {
font-size: 30px;
}
}
.el-image {
padding: 0 5px;
max-width: 80px;
max-height: 70px;
width: 100%;
height: 70px;
border: 1px solid #f0f2f5;
border-radius: 5px;
background: var(--el-fill-color-light);
}
.image-slot {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
background: var(--el-fill-color-light);
color: var(--el-text-color-secondary);
font-size: 30px;
}
.image-slot .el-icon {
font-size: 30px;
}
}
}
</style>

15
src/views/sysworkflow/lowcodepage/runApp/runAppForm.vue

@ -173,6 +173,12 @@ const mastesformjson = ref(""); //
onMounted(() => {
initLoadData();
});
const appPower = reactive({
Level: 1,
Operation: [],
OrgList: [],
PointId: [],
});
/**
@ 作者: 秦东
@ 时间: 2024-06-03 09:00:10
@ -183,8 +189,12 @@ const initLoadData = () => {
if (props.pickAppMenu.type != 1) {
appFormTitle.value = props.pickAppMenu.label;
gainAppPageInfo({ id: props.pickAppMenu.id }).then((data) => {
// console.log("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",data)
console.log("获取初始化表单数据bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", data);
appInitData.value = data.data;
appPower.Level = data.data.powerInfo.AppSystem.Level;
appPower.Operation = data.data.powerInfo.AppSystem.Operation;
appPower.OrgList = data.data.powerInfo.AppSystem.OrgList;
appPower.PointId = data.data.powerInfo.AppSystem.PointId;
// console.log("---!",appInitData.value)
mastesformjson.value = data.data.appForm.mastesformjson;
isFlow.value = data.data.appForm.flowIsOpen;
@ -389,6 +399,7 @@ function optionsValue3Get3(data: any, fieldName: string) {
:form-basic-config="stateForm.formData.form"
:fields-detail-list="stateForm.formData.list"
:org-and-man-tree="orgAndManTree"
:app-power="appPower"
/>
<!-- <AppFormPage
v-else
@ -396,7 +407,7 @@ function optionsValue3Get3(data: any, fieldName: string) {
:number="props.pickAppMenu.id"
:isWorkFlow="isFlow"
:form-data="stateForm.formData"
:type="1"
:type="1" uu
:mastesformjson="mastesformjson"
:flowkey="appInitData.flowkey"
:groupid="appInitData.groupid"

Loading…
Cancel
Save