add:添加用户组功能模块
This commit is contained in:
179
src/views/system/group/components/Form.vue
Normal file
179
src/views/system/group/components/Form.vue
Normal file
@ -0,0 +1,179 @@
|
||||
<template>
|
||||
<SimpleForm
|
||||
ref="systemFormRef"
|
||||
:formProps="data.formDataProps"
|
||||
:formModel="{}"
|
||||
:isWorkFlow="props.fromPage!=FromPageType.MENU"
|
||||
/>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref, onMounted } from 'vue';
|
||||
import { formProps, formEventConfigs } from './config';
|
||||
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
|
||||
import { addXjrGroup, getXjrGroup, updateXjrGroup } from '/@/api/system/group';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { FormDataProps } from '/@/components/Designer/src/types';
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
import { FromPageType } from '/@/enums/workflowEnum';
|
||||
import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent,} from '/@/hooks/web/useFormEvent';
|
||||
import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm';
|
||||
import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig';
|
||||
const { filterFormSchemaAuth } = usePermission();
|
||||
|
||||
const RowKey = 'id';
|
||||
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'form-mounted']);
|
||||
const props = defineProps({
|
||||
fromPage: {
|
||||
type: Number,
|
||||
default: FromPageType.MENU,
|
||||
},
|
||||
});
|
||||
const systemFormRef = ref();
|
||||
const data: { formDataProps: FormDataProps } = reactive({
|
||||
formDataProps: cloneDeep(formProps),
|
||||
});
|
||||
const state = reactive({
|
||||
formModel: {},
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
if (props.fromPage == FromPageType.MENU) {
|
||||
setMenuPermission();
|
||||
await createFormEvent(formEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:初始化表单
|
||||
await loadFormEvent(formEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:加载表单
|
||||
} else if (props.fromPage == FromPageType.FLOW) {
|
||||
emits('loadingCompleted'); //告诉系统表单已经加载完毕
|
||||
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
|
||||
} else if (props.fromPage == FromPageType.PREVIEW) {
|
||||
// 预览 无需权限,表单事件也无需执行
|
||||
} else if (props.fromPage == FromPageType.DESKTOP) {
|
||||
// 桌面设计 表单事件需要执行
|
||||
emits('loadingCompleted'); //告诉系统表单已经加载完毕
|
||||
await createFormEvent(formEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:初始化表单
|
||||
await loadFormEvent(formEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:加载表单
|
||||
}
|
||||
emits('form-mounted', formProps);
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
});
|
||||
// 根据菜单页面权限,设置表单属性(必填,禁用,显示)
|
||||
function setMenuPermission() {
|
||||
data.formDataProps.schemas = filterFormSchemaAuth(formProps.schemas!);
|
||||
}
|
||||
|
||||
// 校验form 通过返回表单数据
|
||||
async function validate() {
|
||||
let values = [];
|
||||
try {
|
||||
values = await systemFormRef.value?.validate();
|
||||
//添加隐藏组件
|
||||
if (data.formDataProps.hiddenComponent?.length) {
|
||||
data.formDataProps.hiddenComponent.forEach((component) => {
|
||||
values[component.bindField] = component.value;
|
||||
});
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
return values;
|
||||
}
|
||||
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】
|
||||
async function setFormDataFromId(rowId, skipUpdate) {
|
||||
try {
|
||||
const record = await getXjrGroup(rowId);
|
||||
if (skipUpdate) {
|
||||
return record;
|
||||
}
|
||||
setFieldsValue(record);
|
||||
state.formModel = record;
|
||||
await getFormDataEvent(formEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据
|
||||
return record;
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
}
|
||||
// 辅助设置表单数据
|
||||
function setFieldsValue(record) {
|
||||
systemFormRef.value.setFieldsValue(record);
|
||||
}
|
||||
// 重置表单数据
|
||||
async function resetFields() {
|
||||
await systemFormRef.value.resetFields();
|
||||
}
|
||||
// 设置表单数据全部为Disabled 【查看】
|
||||
async function setDisabledForm() {
|
||||
data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas));
|
||||
}
|
||||
// 获取行键值
|
||||
function getRowKey() {
|
||||
return RowKey;
|
||||
}
|
||||
// 更新api表单数据
|
||||
async function update({ values, rowId }) {
|
||||
try {
|
||||
values[RowKey] = rowId;
|
||||
state.formModel = values;
|
||||
let saveVal = await updateXjrGroup(values);
|
||||
await submitFormEvent(formEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:提交表单
|
||||
return saveVal;
|
||||
} catch (error) {}
|
||||
}
|
||||
// 新增api表单数据
|
||||
async function add(values) {
|
||||
try {
|
||||
state.formModel = values;
|
||||
let saveVal = await addXjrGroup(values);
|
||||
await submitFormEvent(formEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:提交表单
|
||||
return saveVal;
|
||||
} catch (error) {}
|
||||
}
|
||||
// 根据工作流页面权限,设置表单属性(必填,禁用,显示)
|
||||
async function setWorkFlowForm(obj: WorkFlowFormParams) {
|
||||
try {
|
||||
let flowData = changeWorkFlowForm(cloneDeep(formProps), obj);
|
||||
let { buildOptionJson, uploadComponentIds, formModels, isViewProcess } = flowData;
|
||||
data.formDataProps = buildOptionJson;
|
||||
emits('changeUploadComponentIds', uploadComponentIds); //工作流中必须保存上传组件id【附件汇总需要】
|
||||
if (isViewProcess) {
|
||||
setDisabledForm(); //查看
|
||||
}
|
||||
state.formModel = formModels;
|
||||
if(formModels[RowKey]) {
|
||||
setFormDataFromId(formModels[RowKey], false)
|
||||
} else {
|
||||
setFieldsValue(formModels)
|
||||
}
|
||||
} catch (error) {}
|
||||
await createFormEvent(formEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:初始化表单
|
||||
await loadFormEvent(formEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:加载表单
|
||||
}
|
||||
defineExpose({
|
||||
setFieldsValue,
|
||||
resetFields,
|
||||
validate,
|
||||
add,
|
||||
update,
|
||||
setFormDataFromId,
|
||||
setDisabledForm,
|
||||
setMenuPermission,
|
||||
setWorkFlowForm,
|
||||
getRowKey,
|
||||
});
|
||||
</script>
|
||||
110
src/views/system/group/components/GroupModal.vue
Normal file
110
src/views/system/group/components/GroupModal.vue
Normal file
@ -0,0 +1,110 @@
|
||||
<template>
|
||||
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit" @cancel="handleClose" :paddingRight="15" :bodyStyle="{ minHeight: '400px !important' }">
|
||||
<ModalForm ref="formRef" :fromPage="FromPageType.MENU" />
|
||||
</BasicModal>
|
||||
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, reactive } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { formProps } from './config';
|
||||
import ModalForm from './Form.vue';
|
||||
import { FromPageType } from '/@/enums/workflowEnum';
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
const { notification } = useMessage();
|
||||
const formRef = ref();
|
||||
const state = reactive({
|
||||
formModel: {},
|
||||
isUpdate: true,
|
||||
isView: false,
|
||||
isCopy: false,
|
||||
rowId: '',
|
||||
});
|
||||
|
||||
const { t } = useI18n();
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
state.isUpdate = !!data?.isUpdate;
|
||||
state.isView = !!data?.isView;
|
||||
state.isCopy = !!data?.isCopy;
|
||||
|
||||
setModalProps({
|
||||
destroyOnClose: true,
|
||||
maskClosable: false,
|
||||
showCancelBtn: !state.isView,
|
||||
showOkBtn: !state.isView,
|
||||
canFullscreen: true,
|
||||
width: 900,
|
||||
});
|
||||
if (state.isUpdate || state.isView || state.isCopy) {
|
||||
state.rowId = data.id;
|
||||
if (state.isView) {
|
||||
await formRef.value.setDisabledForm();
|
||||
}
|
||||
await formRef.value.setFormDataFromId(state.rowId);
|
||||
} else {
|
||||
formRef.value.resetFields();
|
||||
}
|
||||
});
|
||||
|
||||
const getTitle = computed(() => (state.isView ? '查看' : !state.isUpdate ? '新增' : '编辑'));
|
||||
|
||||
async function saveModal() {
|
||||
let saveSuccess = false;
|
||||
try {
|
||||
const values = await formRef.value?.validate();
|
||||
//添加隐藏组件
|
||||
if (formProps.hiddenComponent?.length) {
|
||||
formProps.hiddenComponent.forEach((component) => {
|
||||
values[component.bindField] = component.value;
|
||||
});
|
||||
}
|
||||
if (values !== false) {
|
||||
try {
|
||||
if (!state.isUpdate || state.isCopy) {
|
||||
saveSuccess = await formRef.value.add(values);
|
||||
} else {
|
||||
saveSuccess = await formRef.value.update({ values, rowId: state.rowId });
|
||||
}
|
||||
return saveSuccess;
|
||||
} catch (error) {}
|
||||
}
|
||||
} catch (error) {
|
||||
return saveSuccess;
|
||||
}
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const saveSuccess = await saveModal();
|
||||
setModalProps({ confirmLoading: true });
|
||||
if (saveSuccess) {
|
||||
if (!state.isUpdate || state.isCopy) {
|
||||
//false 新增
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('新增成功!'),
|
||||
}); //提示消息
|
||||
} else {
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('修改成功!'),
|
||||
}); //提示消息
|
||||
}
|
||||
closeModal();
|
||||
formRef.value.resetFields();
|
||||
emit('success');
|
||||
}
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
|
||||
function handleClose() {
|
||||
formRef.value.resetFields();
|
||||
}
|
||||
</script>
|
||||
34
src/views/system/group/components/RoleListModal.vue
Normal file
34
src/views/system/group/components/RoleListModal.vue
Normal file
@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<BasicModal
|
||||
width="1000px"
|
||||
v-bind="$attrs"
|
||||
@register="registerModal"
|
||||
:show-cancel-btn="false"
|
||||
:show-ok-btn="false"
|
||||
>
|
||||
<div class="flex flex-wrap" v-if="datas.length > 0">
|
||||
<UserCard v-for="(item, index) in datas" :key="index" :item="item" />
|
||||
</div>
|
||||
<div v-else><a-empty :image="simpleImage" /></div>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import UserCard from './UserCard.vue';
|
||||
import { Empty } from 'ant-design-vue';
|
||||
export default defineComponent({
|
||||
name: 'AuthModal',
|
||||
components: { BasicModal, UserCard },
|
||||
emits: ['success', 'register'],
|
||||
setup(_) {
|
||||
const datas = ref<any>([]);
|
||||
const [registerModal, { setModalProps }] = useModalInner(async (data) => {
|
||||
setModalProps({ confirmLoading: false });
|
||||
datas.value = data;
|
||||
});
|
||||
|
||||
return { registerModal, datas, simpleImage: Empty.PRESENTED_IMAGE_SIMPLE };
|
||||
},
|
||||
});
|
||||
</script>
|
||||
190
src/views/system/group/components/UserCard.vue
Normal file
190
src/views/system/group/components/UserCard.vue
Normal file
@ -0,0 +1,190 @@
|
||||
<template>
|
||||
<div class="list-item">
|
||||
<div class="item-box">
|
||||
<div class="item-left"><img :src="genderImg" /></div>
|
||||
<div class="z-10">
|
||||
<div class="item-right flex items-center">
|
||||
<div class="item-title">{{ t('角色编码') }}</div>
|
||||
<a-tooltip v-if="item?.code && item.code.length > 12" :title="item.code">
|
||||
<div class="item-form-name"> {{ `${item.code.slice(0, 12)}...` }}</div>
|
||||
</a-tooltip>
|
||||
<div class="item-form-name" v-else> {{ item?.code || '-' }}</div>
|
||||
</div>
|
||||
<div class="item-right flex items-center">
|
||||
<div class="item-title">{{ t('角色名称') }}</div>
|
||||
<a-tooltip v-if="item?.name && item.name.length > 8" :title="item.name">
|
||||
<div class="item-form-name"> {{ `${item.name.slice(0, 8)}...` }}</div>
|
||||
</a-tooltip>
|
||||
<div class="item-form-name" v-else> {{ item?.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fixed-checked" v-if="hasCheckSlot">
|
||||
<slot name="check"></slot>
|
||||
</div>
|
||||
<div class="fixed-icon">
|
||||
<IconFontSymbol icon="user" :fillColor="genderFillColor" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, useSlots } from 'vue';
|
||||
import defaultImg from '/@/assets/workflow/default.png';
|
||||
import FemaleImg from '/@/assets/workflow/female.png';
|
||||
import MaleImg from '/@/assets/workflow/male.png';
|
||||
import IconFontSymbol from '/@/components/IconFontSymbol/Index.vue';
|
||||
import { GenderEnum } from '/@/enums/userEnum';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
const { t } = useI18n();
|
||||
let props = defineProps({
|
||||
item: Object,
|
||||
disabled: Boolean,
|
||||
isShowTree: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
});
|
||||
const hasCheckSlot = computed(() => {
|
||||
return !!useSlots().check;
|
||||
});
|
||||
const genderImg = computed(() => {
|
||||
switch (props.item?.gender) {
|
||||
case GenderEnum.FEMALE:
|
||||
return FemaleImg;
|
||||
case GenderEnum.MALE:
|
||||
return MaleImg;
|
||||
default:
|
||||
return defaultImg;
|
||||
}
|
||||
});
|
||||
const genderFillColor = computed(() => {
|
||||
switch (props.item?.gender) {
|
||||
case GenderEnum.FEMALE:
|
||||
return '#ffedf5';
|
||||
case GenderEnum.MALE:
|
||||
return '#e9f0fe';
|
||||
default:
|
||||
return '#f1ecfe';
|
||||
}
|
||||
});
|
||||
|
||||
let fontcolor = computed(() => {
|
||||
switch (props.item?.gender) {
|
||||
case GenderEnum.FEMALE:
|
||||
return '#ffd1d7';
|
||||
case GenderEnum.MALE:
|
||||
return '#3c7eff';
|
||||
default:
|
||||
return '#b389ff';
|
||||
}
|
||||
});
|
||||
let bgcolor = computed(() => {
|
||||
switch (props.item?.gender) {
|
||||
case GenderEnum.FEMALE:
|
||||
return '#fef6fa';
|
||||
case GenderEnum.MALE:
|
||||
return '#f3f8ff';
|
||||
default:
|
||||
return '#f5f1fd';
|
||||
}
|
||||
});
|
||||
|
||||
const itemleftwidth = computed(() => {
|
||||
return props.isShowTree ? '30%' : '25%';
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.list-item {
|
||||
width: 30%;
|
||||
background: v-bind(bgcolor);
|
||||
border-color: transparent;
|
||||
border-radius: 8px;
|
||||
margin-left: 20px;
|
||||
margin-bottom: 20px;
|
||||
overflow: hidden;
|
||||
|
||||
&:hover {
|
||||
border: 1px dotted v-bind(fontcolor);
|
||||
}
|
||||
|
||||
.item-box {
|
||||
display: flex;
|
||||
margin: 14px;
|
||||
position: relative;
|
||||
|
||||
.item-left {
|
||||
width: v-bind(itemleftwidth);
|
||||
margin-right: 14px;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.item-right {
|
||||
.item-title {
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
color: #999;
|
||||
margin: 10px 10px 4px 0;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.item-form-name {
|
||||
color: #303133;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
margin: 8px 0 4px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
|
||||
.fixed-checked {
|
||||
position: absolute;
|
||||
bottom: -4px;
|
||||
z-index: 1;
|
||||
right: -6px;
|
||||
}
|
||||
|
||||
.fixed-icon {
|
||||
position: absolute;
|
||||
right: -24px;
|
||||
font-size: 70px;
|
||||
transform: rotate(48deg);
|
||||
top: -24px;
|
||||
z-index: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ant-checkbox-inner) {
|
||||
border-color: v-bind(fontcolor);
|
||||
}
|
||||
|
||||
:deep(.ant-checkbox-checked .ant-checkbox-inner) {
|
||||
background-color: v-bind(fontcolor);
|
||||
border-color: v-bind(fontcolor);
|
||||
}
|
||||
|
||||
:deep(.ant-checkbox-checked::after),
|
||||
:deep(.ant-checkbox-wrapper:hover .ant-checkbox-inner, .ant-checkbox:hover),
|
||||
:deep(.ant-checkbox-inner),
|
||||
:deep(.ant-checkbox:hover),
|
||||
:deep(.ant-checkbox-input:focus + .ant-checkbox-inner) {
|
||||
border-color: v-bind(fontcolor);
|
||||
}
|
||||
|
||||
.picked {
|
||||
border-width: 1px;
|
||||
border-style: dotted;
|
||||
border-color: v-bind(fontcolor);
|
||||
}
|
||||
|
||||
.not-picked {
|
||||
border-width: 1px;
|
||||
border-style: dotted;
|
||||
}
|
||||
</style>
|
||||
291
src/views/system/group/components/config.ts
Normal file
291
src/views/system/group/components/config.ts
Normal file
@ -0,0 +1,291 @@
|
||||
import { FormProps, FormSchema } from '/@/components/Form';
|
||||
import { BasicColumn } from '/@/components/Table';
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'name',
|
||||
label: '用户组名称',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'code',
|
||||
label: '用户组编码',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'enabledMark',
|
||||
label: '状态',
|
||||
component: 'XjrSelect',
|
||||
componentProps: {
|
||||
datasourceType: 'staticData',
|
||||
staticOptions: [
|
||||
{ key: 1, label: '启用', value: '0' },
|
||||
{ key: 2, label: '停用', value: '1' },
|
||||
],
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
}
|
||||
];
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
dataIndex: 'name',
|
||||
title: '用户组名称',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'code',
|
||||
title: '用户组编码',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'enabledMark',
|
||||
title: '状态',
|
||||
componentType: 'radio',
|
||||
align: 'left',
|
||||
|
||||
customRender: ({ record }) => {
|
||||
const staticOptions = [
|
||||
{ key: 1, label: '启用', value: 0 },
|
||||
{ key: 2, label: '停用', value: 1 },
|
||||
];
|
||||
return staticOptions.filter((x) => x.value === record.enabledMark)[0]?.label;
|
||||
},
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'remark',
|
||||
title: '备注',
|
||||
componentType: 'textarea',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
];
|
||||
//表单事件
|
||||
export const formEventConfigs = {
|
||||
0: [
|
||||
{
|
||||
type: 'circle',
|
||||
color: '#2774ff',
|
||||
text: '开始节点',
|
||||
icon: '#icon-kaishi',
|
||||
bgcColor: '#D8E5FF',
|
||||
isUserDefined: false,
|
||||
},
|
||||
{
|
||||
color: '#F6AB01',
|
||||
icon: '#icon-chushihua',
|
||||
text: '初始化表单',
|
||||
bgcColor: '#f9f5ea',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
],
|
||||
1: [
|
||||
{
|
||||
color: '#B36EDB',
|
||||
icon: '#icon-shujufenxi',
|
||||
text: '获取表单数据',
|
||||
detail: '(新增无此操作)',
|
||||
bgcColor: '#F8F2FC',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
],
|
||||
2: [
|
||||
{
|
||||
color: '#F8625C',
|
||||
icon: '#icon-jiazai',
|
||||
text: '加载表单',
|
||||
bgcColor: '#FFF1F1',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
],
|
||||
3: [
|
||||
{
|
||||
color: '#6C6AE0',
|
||||
icon: '#icon-jsontijiao',
|
||||
text: '提交表单',
|
||||
bgcColor: '#F5F4FF',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
],
|
||||
4: [
|
||||
{
|
||||
type: 'circle',
|
||||
color: '#F8625C',
|
||||
text: '结束节点',
|
||||
icon: '#icon-jieshuzhiliao',
|
||||
bgcColor: '#FFD6D6',
|
||||
isLast: true,
|
||||
isUserDefined: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
export const formProps: FormProps = {
|
||||
labelCol: { span: 3, offset: 0, labelWidthMode: 'flex' },
|
||||
labelAlign: 'right',
|
||||
layout: 'horizontal',
|
||||
size: 'default',
|
||||
schemas: [
|
||||
{
|
||||
key: '78982448aafb4c6aa670af77d3c81671',
|
||||
field: 'name',
|
||||
label: '用户组名称',
|
||||
type: 'input',
|
||||
component: 'Input',
|
||||
colProps: { span: 24 },
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
span: '',
|
||||
defaultValue: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: true,
|
||||
respNewRow: false,
|
||||
placeholder: '请输入用户组名称',
|
||||
maxlength: null,
|
||||
prefix: '',
|
||||
suffix: '',
|
||||
addonBefore: '',
|
||||
addonAfter: '',
|
||||
disabled: false,
|
||||
allowClear: false,
|
||||
showLabel: true,
|
||||
required: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
{
|
||||
key: '5042a508994f4b73a6e6ff826bfc90a3',
|
||||
field: 'code',
|
||||
label: '用户组编码',
|
||||
type: 'input',
|
||||
component: 'Input',
|
||||
colProps: { span: 24 },
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
span: '',
|
||||
defaultValue: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: true,
|
||||
respNewRow: false,
|
||||
placeholder: '请输入用户组编码',
|
||||
maxlength: null,
|
||||
prefix: '',
|
||||
suffix: '',
|
||||
addonBefore: '',
|
||||
addonAfter: '',
|
||||
disabled: false,
|
||||
allowClear: false,
|
||||
showLabel: true,
|
||||
required: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'f236824d858c43cfb801762f2a585f75',
|
||||
field: 'enabledMark',
|
||||
label: '状态',
|
||||
type: 'radio',
|
||||
component: 'ApiRadioGroup',
|
||||
colProps: { span: 24 },
|
||||
componentProps: {
|
||||
span: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: true,
|
||||
respNewRow: false,
|
||||
showLabel: true,
|
||||
disabled: false,
|
||||
optionType: 'default',
|
||||
staticOptions: [
|
||||
{ key: 1, label: '启用', value: 0 },
|
||||
{ key: 2, label: '停用', value: 1 },
|
||||
],
|
||||
datasourceType: 'staticData',
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
defaultSelect: '0',
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
method: 'GET',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
},
|
||||
dicOptions: [],
|
||||
required: false,
|
||||
rules: [],
|
||||
events: {},
|
||||
isShow: true,
|
||||
params: null,
|
||||
style: {},
|
||||
},
|
||||
},
|
||||
{
|
||||
key: '06f7026e60a14d07a0e53043caf99437',
|
||||
field: 'remark',
|
||||
label: '备注',
|
||||
type: 'textarea',
|
||||
component: 'InputTextArea',
|
||||
colProps: { span: 24 },
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
span: '',
|
||||
defaultValue: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: true,
|
||||
respNewRow: true,
|
||||
placeholder: '请输入备注',
|
||||
maxlength: null,
|
||||
rows: 4,
|
||||
autoSize: false,
|
||||
showCount: false,
|
||||
disabled: false,
|
||||
showLabel: true,
|
||||
allowClear: false,
|
||||
required: false,
|
||||
isShow: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
],
|
||||
showActionButtonGroup: false,
|
||||
buttonLocation: 'center',
|
||||
actionColOptions: { span: 24 },
|
||||
showResetButton: false,
|
||||
showSubmitButton: false,
|
||||
hiddenComponent: [],
|
||||
};
|
||||
62
src/views/system/group/components/workflowPermission.ts
Normal file
62
src/views/system/group/components/workflowPermission.ts
Normal file
@ -0,0 +1,62 @@
|
||||
export const permissionList = [
|
||||
{
|
||||
required: true,
|
||||
view: true,
|
||||
edit: true,
|
||||
disabled: false,
|
||||
isSaveTable: false,
|
||||
tableName: '',
|
||||
fieldName: '用户组名称',
|
||||
fieldId: 'name',
|
||||
isSubTable: false,
|
||||
showChildren: true,
|
||||
type: 'input',
|
||||
key: '78982448aafb4c6aa670af77d3c81671',
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
view: true,
|
||||
edit: true,
|
||||
disabled: false,
|
||||
isSaveTable: false,
|
||||
tableName: '',
|
||||
fieldName: '用户组编码',
|
||||
fieldId: 'code',
|
||||
isSubTable: false,
|
||||
showChildren: true,
|
||||
type: 'input',
|
||||
key: '5042a508994f4b73a6e6ff826bfc90a3',
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
view: true,
|
||||
edit: true,
|
||||
disabled: false,
|
||||
isSaveTable: false,
|
||||
tableName: '',
|
||||
fieldName: '状态',
|
||||
fieldId: 'enabledMark',
|
||||
isSubTable: false,
|
||||
showChildren: true,
|
||||
type: 'radio',
|
||||
key: 'f236824d858c43cfb801762f2a585f75',
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
view: true,
|
||||
edit: true,
|
||||
disabled: false,
|
||||
isSaveTable: false,
|
||||
tableName: '',
|
||||
fieldName: '备注',
|
||||
fieldId: 'remark',
|
||||
isSubTable: false,
|
||||
showChildren: true,
|
||||
type: 'textarea',
|
||||
key: '06f7026e60a14d07a0e53043caf99437',
|
||||
children: [],
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user