菜单管理:菜单和按钮增加是否启用字段,系统菜单、路由、页面按钮关联启用字段
parent
1b0b31a3e0
commit
73cfc8c7be
|
|
@ -6,7 +6,7 @@ VITE_PUBLIC_PATH = /
|
|||
|
||||
# Basic interface address SPA
|
||||
#VITE_GLOB_API_URL=/basic-api
|
||||
VITE_GLOB_API_URL=http://192.168.10.102:9020
|
||||
VITE_GLOB_API_URL=http://192.168.10.102:9500
|
||||
|
||||
|
||||
# File upload address, optional
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ VITE_BUILD_COMPRESS = 'none'
|
|||
|
||||
|
||||
# Basic interface address SPA
|
||||
VITE_GLOB_API_URL=http://192.168.10.102:9020
|
||||
VITE_GLOB_API_URL=http://192.168.10.102:9500
|
||||
|
||||
# File upload address, optional
|
||||
# It can be forwarded by nginx or write the actual address directly
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ interface UseFormValuesContext {
|
|||
* @desription deconstruct array-link key. This method will mutate the target.
|
||||
*/
|
||||
function tryDeconstructArray(key: string, value: any, target: Recordable) {
|
||||
console.log('11111111111111');
|
||||
const pattern = /^\[(.+)\]$/;
|
||||
if (pattern.test(key)) {
|
||||
const match = key.match(pattern);
|
||||
|
|
@ -35,7 +34,6 @@ function tryDeconstructArray(key: string, value: any, target: Recordable) {
|
|||
* @desription deconstruct object-link key. This method will mutate the target.
|
||||
*/
|
||||
function tryDeconstructObject(key: string, value: any, target: Recordable) {
|
||||
console.log('2222222222');
|
||||
const pattern = /^\{(.+)\}$/;
|
||||
if (pattern.test(key)) {
|
||||
const match = key.match(pattern);
|
||||
|
|
|
|||
|
|
@ -1,18 +1,27 @@
|
|||
<template>
|
||||
<div>
|
||||
<template v-for="item in btnList">
|
||||
<a-button :color="item.class ? item.class : 'info'" class="ml-2" type="primary"
|
||||
@click="emit('btnEvent',item.domId)"> {{item.name}} </a-button>
|
||||
<a-button
|
||||
:color="item.class ? item.class : 'info'"
|
||||
class="ml-2"
|
||||
:type="item.class ? item.class : 'primary'"
|
||||
@click="emit('btnEvent', item.domId)"
|
||||
v-if="item.status"
|
||||
>
|
||||
{{ item.name }}
|
||||
</a-button>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { router } from '@/router';
|
||||
import { defineEmits } from 'vue'
|
||||
const btnList = router.currentRoute.value.meta.elements ?router.currentRoute.value.meta.elements :[]
|
||||
import { defineEmits } from 'vue';
|
||||
|
||||
const btnList = router.currentRoute.value.meta.elements
|
||||
? router.currentRoute.value.meta.elements
|
||||
: [];
|
||||
btnList.sort((a, b) => {
|
||||
return (a.sort || 0) - (b.sort || 0);
|
||||
});
|
||||
const emit = defineEmits(['btnEvent'])
|
||||
|
||||
</script>
|
||||
const emit = defineEmits(['btnEvent']);
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -60,6 +60,13 @@
|
|||
:pageType="props.pageType"
|
||||
:class="data.currentWfNode.type == 'bpmn:SequenceFlow' ? '' : 'hidden'"
|
||||
/>
|
||||
<!-- 脚本节点 -->
|
||||
<script-option
|
||||
ref="scriptRef"
|
||||
:element="data.currentWfNode"
|
||||
:pageType="props.pageType"
|
||||
:class="data.currentWfNode.type == 'bpmn:ScriptTask' ? '' : 'hidden'"
|
||||
/>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane tab="流程属性" key="2">
|
||||
<shcemeinfo-config ref="shcemeinfoRef" :disabled="true" :pageType="props.pageType" />
|
||||
|
|
@ -97,6 +104,7 @@
|
|||
inclusiveGatewayOption,
|
||||
subprocessOption,
|
||||
mylineOption,
|
||||
scriptOption,
|
||||
} from './page';
|
||||
import { flowStore } from '@/store/modules/flow';
|
||||
|
||||
|
|
@ -329,7 +337,22 @@
|
|||
to: element.businessObject.targetRef.id,
|
||||
};
|
||||
break;
|
||||
|
||||
case 'bpmn:ScriptTask':
|
||||
data.wfNodeName = '脚本节点';
|
||||
data.currentWfNode = {
|
||||
id: element.id,
|
||||
type: element.type,
|
||||
isInit: true,
|
||||
executeType: '1',
|
||||
sqlDb: '',
|
||||
sqlStr: '',
|
||||
sqlStrRevoke: '',
|
||||
apiUrl: '',
|
||||
apiUrlRevoke: '',
|
||||
ioc: '',
|
||||
iocRevoke: '',
|
||||
};
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,3 +8,4 @@ export { default as exclusiveGatewayOption } from './exclusiveGateway/index.vue'
|
|||
export { default as inclusiveGatewayOption } from './inclusiveGateway/index.vue';
|
||||
export { default as subprocessOption } from './subprocess/index.vue';
|
||||
export { default as mylineOption } from './myline/index.vue';
|
||||
export { default as scriptOption } from './script/index.vue';
|
||||
|
|
|
|||
|
|
@ -0,0 +1,272 @@
|
|||
<template>
|
||||
<div class="start-event">
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="node"
|
||||
labelAlign="left"
|
||||
:label-col="labelCol"
|
||||
:wrapper-col="wrapperCol"
|
||||
:disabled="data.componentDisabled"
|
||||
>
|
||||
<a-form-item label="节点标识">
|
||||
<a-input v-model:value="node.id" placeholder="请输入" readonly />
|
||||
</a-form-item>
|
||||
<a-divider plain="true">执行操作</a-divider>
|
||||
<a-tabs v-model:activeKey="node.executeType" type="card" size="small" centered="true">
|
||||
<a-tab-pane key="1" tab="执行SQL">
|
||||
<a-space direction="vertical" size="middle" class="site-space-compact-wrapper">
|
||||
<a-alert
|
||||
message="sql参数说明"
|
||||
description="参数有 @processId流程进程主键 @code上一步执行码 @userId流程发起人Id @userAccount流程发起人账号 @companyId流程发起人公司 @departmentId流程发起人部门;
|
||||
@userId2上一步审核人Id @userAccount2上一步审核人账号 @companyId2上一步审核人公司 @departmentId2上一步审核人部门;
|
||||
"
|
||||
type="info"
|
||||
show-icon
|
||||
/>
|
||||
<a-space-compact block>
|
||||
<a-select
|
||||
v-model:value="node.sqlDb"
|
||||
placeholder="请选择执行SQL数据库"
|
||||
:options="sqlOptions"
|
||||
:field-names="{ label: 'text', value: 'id', options: 'childNodes' }"
|
||||
/>
|
||||
</a-space-compact>
|
||||
<a-space-compact block>
|
||||
<a-textarea
|
||||
v-model:value="node.sqlStr"
|
||||
placeholder="请填写SQL语句"
|
||||
:auto-size="{ minRows: 5, maxRows: 8 }"
|
||||
/>
|
||||
</a-space-compact>
|
||||
<a-space-compact block>
|
||||
<a-textarea
|
||||
v-model:value="node.sqlStrRevoke"
|
||||
placeholder="请填写SQL语句(撤销)"
|
||||
:auto-size="{ minRows: 5, maxRows: 8 }"
|
||||
/>
|
||||
</a-space-compact>
|
||||
</a-space>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="2" tab=".NET方法">
|
||||
<a-space direction="vertical" size="middle" class="site-space-compact-wrapper">
|
||||
<a-alert
|
||||
message="IOC说明"
|
||||
description="注意:编写一个继承IWorkFlowMethod的类
|
||||
"
|
||||
type="info"
|
||||
show-icon
|
||||
/>
|
||||
<a-space-compact block>
|
||||
<a-textarea
|
||||
v-model:value="node.ioc"
|
||||
placeholder="IOC名称"
|
||||
:auto-size="{ minRows: 5, maxRows: 8 }"
|
||||
/>
|
||||
</a-space-compact>
|
||||
<a-space-compact block>
|
||||
<a-textarea
|
||||
v-model:value="node.iocRevoke"
|
||||
placeholder="IOC名称(撤销)"
|
||||
:auto-size="{ minRows: 5, maxRows: 8 }"
|
||||
/>
|
||||
</a-space-compact>
|
||||
</a-space>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="3" tab="第三方接口">
|
||||
<a-space direction="vertical" size="middle" class="site-space-compact-wrapper">
|
||||
<a-alert
|
||||
message="接口参数说明"
|
||||
description="注意:配置支持Post方法的接口,json数据格式。{
|
||||
processId:'流程发起实例主键',userId:'流程发起人Id',userAccount:'流程发起人账号',companyId:'流程发起人公司',departmentId:'流程发起人部门',code:'上一步执行码',
|
||||
userId2:'上一步审核人Id',userAccount2:'上一步审核人账号',companyId2:'上一步审核人公司',departmentId2:'上一步审核人部门'
|
||||
}
|
||||
"
|
||||
type="info"
|
||||
show-icon
|
||||
/>
|
||||
<a-space-compact block>
|
||||
<a-textarea
|
||||
v-model:value="node.apiUrl"
|
||||
placeholder="接口地址"
|
||||
:auto-size="{ minRows: 5, maxRows: 8 }"
|
||||
/>
|
||||
</a-space-compact>
|
||||
<a-space-compact block>
|
||||
<a-textarea
|
||||
v-model:value="node.apiUrlRevoke"
|
||||
placeholder="接口地址(撤销)"
|
||||
:auto-size="{ minRows: 5, maxRows: 8 }"
|
||||
/>
|
||||
</a-space-compact>
|
||||
</a-space>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-form>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { reactive, defineProps, ref, watch, onMounted } from 'vue';
|
||||
import { flowStore } from '@/store/modules/flow';
|
||||
import { getLoadDataBaseLinkTree } from '@/api/demo/system';
|
||||
|
||||
const flowWfDataStore = flowStore();
|
||||
const labelCol = { span: 7 };
|
||||
const wrapperCol = { span: 17 };
|
||||
// 表单选择声明
|
||||
const props = defineProps({
|
||||
element: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {};
|
||||
},
|
||||
},
|
||||
pageType: String,
|
||||
});
|
||||
console.log(props);
|
||||
interface dataType {
|
||||
columns: any;
|
||||
formRelations: any;
|
||||
elementData: any;
|
||||
componentDisabled: boolean;
|
||||
formOpen: boolean;
|
||||
formVerisons: any;
|
||||
formName: string;
|
||||
}
|
||||
const data: dataType = reactive({
|
||||
columns: [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'label',
|
||||
},
|
||||
{
|
||||
title: '字段',
|
||||
dataIndex: 'field',
|
||||
},
|
||||
{
|
||||
title: '必填',
|
||||
dataIndex: 'required',
|
||||
},
|
||||
{
|
||||
title: '编辑',
|
||||
dataIndex: 'disabled',
|
||||
},
|
||||
{
|
||||
title: '查看',
|
||||
dataIndex: 'ifShow',
|
||||
},
|
||||
],
|
||||
formRelations: [],
|
||||
elementData: props.element,
|
||||
componentDisabled: props.pageType == 'detail' ? true : false,
|
||||
formOpen: false,
|
||||
formVerisons: [],
|
||||
formName: '',
|
||||
});
|
||||
let node: any = ref({});
|
||||
console.log(props);
|
||||
watch(
|
||||
() => props.element,
|
||||
(newVal) => {
|
||||
if (newVal.type == 'bpmn:ScriptTask') {
|
||||
const currentNode = flowWfDataStore.getWfDataNode(newVal.id);
|
||||
console.log(currentNode);
|
||||
if (currentNode) {
|
||||
node.value = currentNode;
|
||||
} else {
|
||||
node.value = newVal;
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
const sqlOptions = ref([]);
|
||||
async function getSQL() {
|
||||
const data = await getLoadDataBaseLinkTree();
|
||||
let res: any = [];
|
||||
data.forEach((element) => {
|
||||
if (element.childNodes == null) {
|
||||
element.childNodes = [];
|
||||
}
|
||||
let point = {};
|
||||
if (element.id == 'hcsystemdb') {
|
||||
point = {
|
||||
id: '1',
|
||||
text: '常用数据库',
|
||||
childNodes: [
|
||||
{
|
||||
id: element.id,
|
||||
text: element.text,
|
||||
},
|
||||
],
|
||||
};
|
||||
res.push(point);
|
||||
} else {
|
||||
res.push(element);
|
||||
}
|
||||
});
|
||||
sqlOptions.value = res;
|
||||
}
|
||||
onMounted(() => {
|
||||
getSQL();
|
||||
});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.site-space-compact-wrapper {
|
||||
width: 100%;
|
||||
|
||||
.ant-select {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .ant-tabs {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
::v-deep .ant-space {
|
||||
width: 90%;
|
||||
margin-left: 5%;
|
||||
|
||||
.ant-space-item {
|
||||
width: 100%;
|
||||
|
||||
button {
|
||||
width: 20%;
|
||||
}
|
||||
.ant-btn-dangerous {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.l-rblock {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f0f2f5;
|
||||
}
|
||||
.l-page-pane {
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
max-width: 794px;
|
||||
overflow: hidden auto;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
margin: auto;
|
||||
padding: 24px;
|
||||
}
|
||||
.addDataBaseTableBox {
|
||||
border: 1px dashed #f0f0f0;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
margin-top: -20px;
|
||||
&:hover {
|
||||
border-color: #409eff;
|
||||
}
|
||||
}
|
||||
.connectTableTitle {
|
||||
padding-top: 20px;
|
||||
}
|
||||
.formLine {
|
||||
height: 50px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -133,7 +133,7 @@ export const usePermissionStore = defineStore({
|
|||
elements: (data.item && data.item.elements) || '',
|
||||
},
|
||||
name: data.item.name,
|
||||
hideMenu: false,
|
||||
hideMenu: data.item.status == 1 ? false : true,
|
||||
path:
|
||||
data.item.url ||
|
||||
'/formCallPage?id=' +
|
||||
|
|
@ -155,7 +155,7 @@ export const usePermissionStore = defineStore({
|
|||
// 注册路由
|
||||
const registeredRoute = (data) => {
|
||||
const modules = import.meta.glob('../../views/demo/**/**/index.vue');
|
||||
if (data.children.length == 0 && data.item.parentId == 0) {
|
||||
if (data.children.length == 0 && data.item.parentId == 0 && data.item.status == 1) {
|
||||
router.addRoute('Root', {
|
||||
path: data.item.url,
|
||||
name: data.item.code,
|
||||
|
|
@ -180,6 +180,9 @@ export const usePermissionStore = defineStore({
|
|||
],
|
||||
});
|
||||
} else {
|
||||
if (data.item.status == 0) {
|
||||
return;
|
||||
}
|
||||
router.addRoute('Root', {
|
||||
path: data.item.url,
|
||||
name: data.item.code,
|
||||
|
|
@ -196,7 +199,7 @@ export const usePermissionStore = defineStore({
|
|||
});
|
||||
if (data.children && data.children.length > 0) {
|
||||
data.children.forEach((element) => {
|
||||
if (element.item.code) {
|
||||
if (element.item.code && element.item.status == 1) {
|
||||
router.addRoute(element.item.code, {
|
||||
path: element.item.url,
|
||||
name: element.item.url.replaceAll('/', ''),
|
||||
|
|
@ -227,6 +230,7 @@ export const usePermissionStore = defineStore({
|
|||
|
||||
await Promise.all(moduleRoutes);
|
||||
// 设置菜单列表
|
||||
console.log(moduleRoutes);
|
||||
_this.setFrontMenuList(moduleRoutes);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,12 +38,16 @@
|
|||
isUpdate.value = !!data?.isUpdate;
|
||||
|
||||
if (unref(isUpdate)) {
|
||||
const { record } = data;
|
||||
if (record.type == '2') {
|
||||
record.status = record.status ? 1 : 0;
|
||||
}
|
||||
setFieldsValue({
|
||||
...data.record,
|
||||
...record,
|
||||
});
|
||||
}
|
||||
const treeData = await getMenuList();
|
||||
treeData.unshift ({
|
||||
treeData.unshift({
|
||||
id: '0',
|
||||
key: '0',
|
||||
name: '根节点',
|
||||
|
|
@ -90,6 +94,7 @@
|
|||
} else {
|
||||
// 新增按钮
|
||||
delete values.type;
|
||||
values.status = values.status == 1 ? true : false;
|
||||
if (!unref(isUpdate)) {
|
||||
const data = await addButton(values);
|
||||
if (data) {
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
import { columns, searchFormSchema } from './menu.data';
|
||||
import { PermissionBtn } from '@/components/PermissionBtn/index';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm, createMessage } = useMessage();
|
||||
defineOptions({ name: 'MenuManagement' });
|
||||
const searchInfo = reactive<Recordable>({});
|
||||
|
|
@ -107,9 +108,9 @@
|
|||
const data = await deleteButton(query);
|
||||
if (data) {
|
||||
reload();
|
||||
return createMessage.success('成功');
|
||||
createMessage.success('成功');
|
||||
} else {
|
||||
return createMessage.error('失败');
|
||||
createMessage.error('失败');
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -16,7 +16,20 @@ export const columns: BasicColumn[] = [
|
|||
title: '排序',
|
||||
dataIndex: 'sort',
|
||||
},
|
||||
|
||||
{
|
||||
title: '样式',
|
||||
dataIndex: 'class',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'enabledMark',
|
||||
width: 80,
|
||||
customRender: ({ record }) => {
|
||||
const color = record.status == 1 ? 'blue' : 'red';
|
||||
const text = record.status == 1 ? '启用' : '停用';
|
||||
return h(Tag, { color: color }, () => text);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const isDir = (type: string) => type === '0';
|
||||
|
|
@ -51,7 +64,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'id',
|
||||
label: '名称',
|
||||
component: 'Input',
|
||||
ifShow:false
|
||||
ifShow: false,
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
|
|
@ -143,16 +156,15 @@ export const formSchema: FormSchema[] = [
|
|||
},
|
||||
{
|
||||
field: 'status',
|
||||
label: '是否系统',
|
||||
label: '是否启用',
|
||||
component: 'RadioButtonGroup',
|
||||
defaultValue: 1,
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '是', value: 0 },
|
||||
{ label: '否', value: 1 },
|
||||
{ label: '否', value: 0 },
|
||||
{ label: '是', value: 1 },
|
||||
],
|
||||
},
|
||||
ifShow: ({ values }) => !isButton(values.type),
|
||||
},
|
||||
// {
|
||||
// field: 'isExt',
|
||||
|
|
|
|||
|
|
@ -257,6 +257,8 @@
|
|||
designerData.task = data.task;
|
||||
let content = JSON.parse(data.scheme.content);
|
||||
let wfData = content.wfData;
|
||||
flowWfDataStore.setWfDataAll(wfData);
|
||||
|
||||
const currentNode = wfData.find((t) => t.type == 'bpmn:StartEvent');
|
||||
if (currentNode.authFields.length > 0) {
|
||||
formVisble.value = true;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
>关闭
|
||||
</a-button>
|
||||
</div>
|
||||
<process-designer
|
||||
<process-designer-page
|
||||
:key="designerOpen"
|
||||
style="border: 1px solid rgba(0, 0, 0, 0.1)"
|
||||
ref="modelDesigner"
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
<script lang="ts" setup>
|
||||
// scheme_preview?code=tset0411
|
||||
import { h, ref, reactive } from 'vue';
|
||||
import { ProcessDesigner } from '@/components/ProcessDesigner/page';
|
||||
import { ProcessDesignerPage } from '@/components/ProcessDesigner/page';
|
||||
import { SaveOutlined, CloseCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { postAdd, update } from '@/api/sys/WFSchemeInfo';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
|
|
|
|||
Loading…
Reference in New Issue