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. 150
      src/views/powermanage/rolepower/setuprole/index.vue
  6. 327
      src/views/powermanage/rolepower/setuprole/setuprolepower.vue
  7. 59
      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 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; roleid:string;
peoplelist:orgAndPeopleLists[]; 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; formBasicConfig?: any;
fieldsDetailList?: any; fieldsDetailList?: any;
orgAndManTree?: any; orgAndManTree?: any;
appPower?: any;
}>(), }>(),
{ {
showPage: true, showPage: true,
@ -127,6 +128,12 @@ const props = withDefaults(
orgAndManTree: () => { orgAndManTree: () => {
return {}; return {};
}, },
appPower: {
Level: 1,
Operation: [],
OrgList: [],
PointId: [],
},
} }
); );
const emits = defineEmits<{ const emits = defineEmits<{
@ -1550,7 +1557,7 @@ const readerColumnSun = (column: any) => {
<template> <template>
<div ref="container" v-loading="state.loading" class="table-list-comm"> <div ref="container" v-loading="state.loading" class="table-list-comm">
<el-row class="rowBox"> <el-row class="rowBox">
<el-col :span="24"> <el-col :span="24" 6>
<el-form v-if="config.searchIsShow" ref="ruleSearchForm" class="seacherForm"> <el-form v-if="config.searchIsShow" ref="ruleSearchForm" class="seacherForm">
<template v-for="(item, index) in searchData" :key="index"> <template v-for="(item, index) in searchData" :key="index">
<div class="group group-input"> <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}
]

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

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

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

@ -9,13 +9,24 @@ import {
systemCont, systemCont,
systemMenusTypeTree, systemMenusTypeTree,
submintPostPower, submintPostPower,
custerAppInfo,
custerAppTablePower,
} from "@/api/system/roleapi/types"; } from "@/api/system/roleapi/types";
import { import {
getSystemType, getSystemType,
getSystemPoewrTreeForRole, getSystemPoewrTreeForRole,
getGrantRolePowers, getGrantRolePowers,
grantSystemRolePoewr, grantSystemRolePoewr,
gainAppList,
gainAppTableList,
setpAppTableForms,
} from "@/api/system/roleapi/postrole"; } 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({ const props = defineProps({
powerIsShow: { powerIsShow: {
type: Boolean, type: Boolean,
@ -37,6 +48,9 @@ const menuRef = ref(ElTree);
const powerLoading = ref(false); const powerLoading = ref(false);
const powerLoadingSub = ref(false); const powerLoadingSub = ref(false);
const emits = defineEmits(["update:powerIsShow"]); // 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 = { const systemMenuTreeProps = {
children: "child", children: "child",
label: "name", label: "name",
value: "id",
}; };
/** /**
* 分页参数 * 分页参数
@ -163,14 +178,43 @@ watch(
() => { () => {
powerLoading.value = true; powerLoading.value = true;
if (systemTabs.value != "" && systemTabs.value != null) { if (systemTabs.value != "" && systemTabs.value != null) {
if (systemTabs.value == "appdevel") {
getAppList();
} else {
getSysMenuTree(systemTabs.value); getSysMenuTree(systemTabs.value);
} }
} }
}
); );
/** /**
* 授权 * 授权
*/ */
function enterEmpowerClick() { function enterEmpowerClick() {
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; powerLoadingSub.value = true;
const checkedMenuTrue: systemMenusTypeTree[] = menuRef.value const checkedMenuTrue: systemMenusTypeTree[] = menuRef.value
.getCheckedNodes(false, true) .getCheckedNodes(false, true)
@ -194,14 +238,112 @@ function enterEmpowerClick() {
powerLoadingSub.value = false; 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> </script>
<template> <template>
<el-dialog <el-dialog
v-model="power_is_Show" v-model="power_is_Show"
custom-class="dialog_box" custom-class="dialog_box"
:title="roleTitle" :title="roleTitle"
top="50px"
:before-close="handleClosePower" :before-close="handleClosePower"
draggable
width="70%"
fullscreen
> >
<el-container> <el-container>
<el-aside width="125px"> <el-aside width="125px">
@ -214,7 +356,124 @@ function enterEmpowerClick() {
></el-tab-pane> ></el-tab-pane>
</el-tabs> </el-tabs>
</el-aside> </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-group v-model="manageScope" style="margin-bottom: 10px">
<el-radio-button label="0">默认</el-radio-button> <el-radio-button label="0">默认</el-radio-button>
<el-radio-button label="1">本岗位</el-radio-button> <el-radio-button label="1">本岗位</el-radio-button>
@ -243,6 +502,32 @@ function enterEmpowerClick() {
</el-scrollbar> </el-scrollbar>
</el-main> </el-main>
</el-container> </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> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="danger" @click="handleClosePower">取消</el-button> <el-button type="danger" @click="handleClosePower">取消</el-button>
@ -258,19 +543,51 @@ function enterEmpowerClick() {
padding: 0; padding: 0;
} }
.tabs_box { .tabs_box {
height: calc(100vh - 500px); height: calc(100vh - 140px);
.tab_pane_box { .tab_pane_box {
height: calc(100vh - 550px); height: calc(100vh - 220px);
overflow: hidden; overflow: hidden;
overflow-y: auto; overflow-y: auto;
} }
} }
.tab_pane_box { .tab_pane_box {
height: calc(100vh - 550px); height: calc(100vh - 230px);
overflow: hidden; overflow: hidden;
overflow-y: auto; overflow-y: auto;
} }
.tree_sapn { .tree_sapn {
padding: 0 15px; 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> </style>

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

@ -3,38 +3,38 @@
@ 时间: 2024-05-29 13:25:09 @ 时间: 2024-05-29 13:25:09
@ 备注: 应用发布页面 @ 备注: 应用发布页面
--> -->
<script lang='ts' setup> <script lang="ts" setup>
import { gainAppPageInfo,setCustomerFormState } from '@/api/DesignForm/requestapi' import { gainAppPageInfo, setCustomerFormState } from "@/api/DesignForm/requestapi";
const props = defineProps({ const props = defineProps({
appCont: { appCont: {
type: Object, type: Object,
default() { default() {
return {} return {};
} },
}, },
groupKey: { groupKey: {
type: String, type: String,
default:"" default: "",
} },
}); });
const appStatue = ref(true) const appStatue = ref(true);
const isEdit = ref(false) const isEdit = ref(false);
onMounted(() => { onMounted(() => {
gainAppPageInfo({ id: props.appCont.uuid }) gainAppPageInfo({ id: props.appCont.uuid })
.then((data) => { .then((data) => {
// console.log("",data) // console.log("",data)
if (data.data.appForm.states == 1) { if (data.data.appForm.states == 1) {
appStatue.value = true appStatue.value = true;
props.appCont.state = 1 props.appCont.state = 1;
} else { } else {
appStatue.value = false appStatue.value = false;
props.appCont.state = 2 props.appCont.state = 2;
} }
}) })
.finally(() => { .finally(() => {
isEdit.value = true; isEdit.value = true;
}) });
}) });
// watch(()=>appStatue.value,(val:boolean) => { // watch(()=>appStatue.value,(val:boolean) => {
// let sta = 1 // let sta = 1
@ -48,7 +48,6 @@ onMounted(()=>{
// setUpState(sta) // setUpState(sta)
// }) // })
/** /**
@ 作者: 秦东 @ 作者: 秦东
@ -56,23 +55,22 @@ onMounted(()=>{
@ 功能: 设置状态 @ 功能: 设置状态
*/ */
const setUpState = (val: number) => { const setUpState = (val: number) => {
setCustomerFormState({id:props.appCont.uuid,state:val}) setCustomerFormState({ id: props.appCont.uuid, state: val }).then((data) => {
.then((data)=>{ props.appCont.state = appStatue.value;
props.appCont.state = appStatue.value
// ElMessage({ // ElMessage({
// showClose: true, // showClose: true,
// message: data.msg, // message: data.msg,
// type: 'success', // type: 'success',
// }) // })
}) });
} };
const switchChang = () => { const switchChang = () => {
if (appStatue.value == 1) { if (appStatue.value == 1) {
setUpState(1) setUpState(1);
} else { } else {
setUpState(2) setUpState(2);
}
} }
};
</script> </script>
<template> <template>
<div class="appBox"> <div class="appBox">
@ -93,9 +91,12 @@ const switchChang = () =>{
<el-text v-else class="mx-1 bigWord" type="danger">已停用</el-text> <el-text v-else class="mx-1 bigWord" type="danger">已停用</el-text>
</td> </td>
<td align="left"> <td align="left">
<el-text v-if="appStatue" class="mx-1" type="success"
<el-text v-if="appStatue" class="mx-1" type="success">应用已启用为可用状态</el-text> >应用已启用为可用状态</el-text
<el-text v-else class="mx-1" type="danger">应用已停用不可使用此App</el-text> >
<el-text v-else class="mx-1" type="danger"
>应用已停用不可使用此App</el-text
>
</td> </td>
<td width="100px" align="right"> <td width="100px" align="right">
<el-switch <el-switch
@ -113,10 +114,10 @@ const switchChang = () =>{
</el-card> </el-card>
</div> </div>
</template> </template>
<style lang='scss' scoped> <style lang="scss" scoped>
.appBox { .appBox {
width: 100%; width: 100%;
background-color : #F5F7FA; background-color: #f5f7fa;
height: calc(100vh - 40px); height: calc(100vh - 40px);
text-align: center; text-align: center;
.appCardBox { .appCardBox {
@ -135,7 +136,7 @@ const switchChang = () =>{
max-height: 70px; max-height: 70px;
width: 100%; width: 100%;
height: 70px; height: 70px;
border: 1px solid #F0F2F5; border: 1px solid #f0f2f5;
border-radius: 5px; border-radius: 5px;
background: var(--el-fill-color-light); background: var(--el-fill-color-light);
} }

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

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

Loading…
Cancel
Save