mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-17 10:36:31 +08:00
在线表单流程用户任务支持组件显隐设置
This commit is contained in:
@@ -278,4 +278,12 @@ export default class FlowOperationController extends BaseController {
|
|||||||
httpOptions,
|
httpOptions,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
// 获取用户任务信息
|
||||||
|
static viewTaskFormKey(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
||||||
|
return super.get<ANY_OBJECT>(
|
||||||
|
API_CONTEXT + '/flow/flowOperation/viewTaskFormKey',
|
||||||
|
params,
|
||||||
|
httpOptions,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ import { API_CONTEXT } from '../config';
|
|||||||
export default class DictionaryController extends BaseController {
|
export default class DictionaryController extends BaseController {
|
||||||
static dictSysRole(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
static dictSysRole(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
||||||
return new Promise<DictionaryBase>((resolve, reject) => {
|
return new Promise<DictionaryBase>((resolve, reject) => {
|
||||||
super.get<DictData[]>(API_CONTEXT + '/upms/sysRole/listDict', params, httpOptions)
|
super
|
||||||
|
.get<DictData[]>(API_CONTEXT + '/upms/sysRole/listDict', params, httpOptions)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const dictData = new DictionaryBase('角色字典', res.data);
|
const dictData = new DictionaryBase('角色字典', res.data);
|
||||||
resolve(dictData);
|
resolve(dictData);
|
||||||
@@ -20,7 +21,8 @@ export default class DictionaryController extends BaseController {
|
|||||||
// 全局编码字典
|
// 全局编码字典
|
||||||
static dictGlobalDict(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
static dictGlobalDict(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
||||||
return new Promise<DictionaryBase>((resolve, reject) => {
|
return new Promise<DictionaryBase>((resolve, reject) => {
|
||||||
super.get<DictData[]>(API_CONTEXT + '/upms/globalDict/listDict', params, httpOptions)
|
super
|
||||||
|
.get<DictData[]>(API_CONTEXT + '/upms/globalDict/listDict', params, httpOptions)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const dictData = new DictionaryBase(
|
const dictData = new DictionaryBase(
|
||||||
'编码字典',
|
'编码字典',
|
||||||
@@ -42,7 +44,8 @@ export default class DictionaryController extends BaseController {
|
|||||||
|
|
||||||
static dictGlobalDictByIds(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
static dictGlobalDictByIds(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
||||||
return new Promise<DictionaryBase>((resolve, reject) => {
|
return new Promise<DictionaryBase>((resolve, reject) => {
|
||||||
super.get<DictData[]>(API_CONTEXT + '/upms/globalDict/listDictByIds', params, httpOptions)
|
super
|
||||||
|
.get<DictData[]>(API_CONTEXT + '/upms/globalDict/listDictByIds', params, httpOptions)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const dictData = new DictionaryBase('编码字典', res.data);
|
const dictData = new DictionaryBase('编码字典', res.data);
|
||||||
resolve(dictData);
|
resolve(dictData);
|
||||||
@@ -55,7 +58,8 @@ export default class DictionaryController extends BaseController {
|
|||||||
|
|
||||||
static dictSysDept(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
static dictSysDept(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
||||||
return new Promise<DictionaryBase>((resolve, reject) => {
|
return new Promise<DictionaryBase>((resolve, reject) => {
|
||||||
super.get<DictData[]>(API_CONTEXT + '/upms/sysDept/listDict', params, httpOptions)
|
super
|
||||||
|
.get<DictData[]>(API_CONTEXT + '/upms/sysDept/listDict', params, httpOptions)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const dictData = new DictionaryBase('部门字典', res.data);
|
const dictData = new DictionaryBase('部门字典', res.data);
|
||||||
resolve(dictData);
|
resolve(dictData);
|
||||||
@@ -71,7 +75,8 @@ export default class DictionaryController extends BaseController {
|
|||||||
httpOptions?: RequestOption,
|
httpOptions?: RequestOption,
|
||||||
): Promise<DictionaryBase> {
|
): Promise<DictionaryBase> {
|
||||||
return new Promise<DictionaryBase>((resolve, reject) => {
|
return new Promise<DictionaryBase>((resolve, reject) => {
|
||||||
super.get<DictData[]>(API_CONTEXT + '/upms/sysDept/listDictByParentId', params, httpOptions)
|
super
|
||||||
|
.get<DictData[]>(API_CONTEXT + '/upms/sysDept/listDictByParentId', params, httpOptions)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const dictData = new DictionaryBase('部门字典', res.data);
|
const dictData = new DictionaryBase('部门字典', res.data);
|
||||||
resolve(dictData);
|
resolve(dictData);
|
||||||
@@ -84,7 +89,8 @@ export default class DictionaryController extends BaseController {
|
|||||||
|
|
||||||
static dictSysMenu(params: ANY_OBJECT, httpOptions?: RequestOption): Promise<DictionaryBase> {
|
static dictSysMenu(params: ANY_OBJECT, httpOptions?: RequestOption): Promise<DictionaryBase> {
|
||||||
return new Promise<DictionaryBase>((resolve, reject) => {
|
return new Promise<DictionaryBase>((resolve, reject) => {
|
||||||
super.get<DictData[]>(API_CONTEXT + '/upms/sysMenu/listMenuDict', params, httpOptions)
|
super
|
||||||
|
.get<DictData[]>(API_CONTEXT + '/upms/sysMenu/listMenuDict', params, httpOptions)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const dictData = new DictionaryBase('菜单字典', res.data);
|
const dictData = new DictionaryBase('菜单字典', res.data);
|
||||||
resolve(dictData);
|
resolve(dictData);
|
||||||
@@ -97,7 +103,8 @@ export default class DictionaryController extends BaseController {
|
|||||||
|
|
||||||
static dictDeptPost(params: ANY_OBJECT, httpOptions?: RequestOption): Promise<ANY_OBJECT[]> {
|
static dictDeptPost(params: ANY_OBJECT, httpOptions?: RequestOption): Promise<ANY_OBJECT[]> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
super.get<ANY_OBJECT[]>(
|
super
|
||||||
|
.get<ANY_OBJECT[]>(
|
||||||
API_CONTEXT + '/upms/sysDept/listSysDeptPostWithRelation',
|
API_CONTEXT + '/upms/sysDept/listSysDeptPostWithRelation',
|
||||||
params,
|
params,
|
||||||
httpOptions,
|
httpOptions,
|
||||||
@@ -112,7 +119,8 @@ export default class DictionaryController extends BaseController {
|
|||||||
}
|
}
|
||||||
static dictSysPost(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
static dictSysPost(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
||||||
return new Promise<DictionaryBase>((resolve, reject) => {
|
return new Promise<DictionaryBase>((resolve, reject) => {
|
||||||
super.get<DictData[]>(API_CONTEXT + '/upms/sysPost/listDict', params, httpOptions)
|
super
|
||||||
|
.get<DictData[]>(API_CONTEXT + '/upms/sysPost/listDict', params, httpOptions)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const dictData = new DictionaryBase('岗位字典', res.data);
|
const dictData = new DictionaryBase('岗位字典', res.data);
|
||||||
resolve(dictData);
|
resolve(dictData);
|
||||||
@@ -125,7 +133,8 @@ export default class DictionaryController extends BaseController {
|
|||||||
|
|
||||||
static dictReportDblink(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
static dictReportDblink(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
||||||
return new Promise<DictionaryBase>((resolve, reject) => {
|
return new Promise<DictionaryBase>((resolve, reject) => {
|
||||||
super.get<DictData[]>(API_CONTEXT + '/report/reportDblink/listDict', params, httpOptions)
|
super
|
||||||
|
.get<DictData[]>(API_CONTEXT + '/report/reportDblink/listDict', params, httpOptions)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const dictData = new DictionaryBase('数据库链接', res.data);
|
const dictData = new DictionaryBase('数据库链接', res.data);
|
||||||
resolve(dictData);
|
resolve(dictData);
|
||||||
@@ -138,7 +147,8 @@ export default class DictionaryController extends BaseController {
|
|||||||
|
|
||||||
static dictReportDict(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
static dictReportDict(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
||||||
return new Promise<DictionaryBase>((resolve, reject) => {
|
return new Promise<DictionaryBase>((resolve, reject) => {
|
||||||
super.get<DictData[]>(API_CONTEXT + '/report/reportDict/listDict', params, httpOptions)
|
super
|
||||||
|
.get<DictData[]>(API_CONTEXT + '/report/reportDict/listDict', params, httpOptions)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const dictData = new DictionaryBase('报表字典', res.data);
|
const dictData = new DictionaryBase('报表字典', res.data);
|
||||||
resolve(dictData);
|
resolve(dictData);
|
||||||
@@ -150,7 +160,8 @@ export default class DictionaryController extends BaseController {
|
|||||||
}
|
}
|
||||||
static dictAreaCode(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
static dictAreaCode(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
||||||
return new Promise<DictionaryBase>((resolve, reject) => {
|
return new Promise<DictionaryBase>((resolve, reject) => {
|
||||||
super.get<DictData[]>(API_CONTEXT + '/app/areaCode/listDict', params, httpOptions)
|
super
|
||||||
|
.get<DictData[]>(API_CONTEXT + '/app/areaCode/listDict', params, httpOptions)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const dictData = new DictionaryBase('行政区划', res.data);
|
const dictData = new DictionaryBase('行政区划', res.data);
|
||||||
resolve(dictData);
|
resolve(dictData);
|
||||||
@@ -163,7 +174,8 @@ export default class DictionaryController extends BaseController {
|
|||||||
|
|
||||||
static dictAreaCodeByParentId(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
static dictAreaCodeByParentId(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
||||||
return new Promise<DictionaryBase>((resolve, reject) => {
|
return new Promise<DictionaryBase>((resolve, reject) => {
|
||||||
super.get<DictData[]>(API_CONTEXT + '/app/areaCode/listDictByParentId', params, httpOptions)
|
super
|
||||||
|
.get<DictData[]>(API_CONTEXT + '/app/areaCode/listDictByParentId', params, httpOptions)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const dictData = new DictionaryBase('行政区划', res.data);
|
const dictData = new DictionaryBase('行政区划', res.data);
|
||||||
resolve(dictData);
|
resolve(dictData);
|
||||||
@@ -177,7 +189,8 @@ export default class DictionaryController extends BaseController {
|
|||||||
// 业务相关的接口
|
// 业务相关的接口
|
||||||
static dictKnowledge(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
static dictKnowledge(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
||||||
return new Promise<DictionaryBase>((resolve, reject) => {
|
return new Promise<DictionaryBase>((resolve, reject) => {
|
||||||
super.get<DictData[]>('/admin/app/knowledge/listDict', params, httpOptions)
|
super
|
||||||
|
.get<DictData[]>('/admin/app/knowledge/listDict', params, httpOptions)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const dictData = new DictionaryBase('知识点字典', res.data);
|
const dictData = new DictionaryBase('知识点字典', res.data);
|
||||||
resolve(dictData);
|
resolve(dictData);
|
||||||
@@ -190,7 +203,8 @@ export default class DictionaryController extends BaseController {
|
|||||||
|
|
||||||
static dictStudent(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
static dictStudent(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
||||||
return new Promise<DictionaryBase>((resolve, reject) => {
|
return new Promise<DictionaryBase>((resolve, reject) => {
|
||||||
super.get<DictData[]>(API_CONTEXT + '/app/student/listDict', params, httpOptions)
|
super
|
||||||
|
.get<DictData[]>(API_CONTEXT + '/app/student/listDict', params, httpOptions)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const dictData = new DictionaryBase('学生字典', res.data);
|
const dictData = new DictionaryBase('学生字典', res.data);
|
||||||
dictData.setList(res.data);
|
dictData.setList(res.data);
|
||||||
@@ -204,7 +218,8 @@ export default class DictionaryController extends BaseController {
|
|||||||
|
|
||||||
static dictTeacher(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
static dictTeacher(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
||||||
return new Promise<DictionaryBase>((resolve, reject) => {
|
return new Promise<DictionaryBase>((resolve, reject) => {
|
||||||
super.get<DictData[]>('/admin/app/teacher/listDict', params, httpOptions)
|
super
|
||||||
|
.get<DictData[]>('/admin/app/teacher/listDict', params, httpOptions)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const dictData = new DictionaryBase('老师字典', res.data);
|
const dictData = new DictionaryBase('老师字典', res.data);
|
||||||
resolve(dictData);
|
resolve(dictData);
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { DictionaryBase } from './types';
|
import { DictionaryBase } from './types';
|
||||||
|
|
||||||
|
|
||||||
export {};
|
export {};
|
||||||
|
|||||||
@@ -220,7 +220,6 @@ const values = computed({
|
|||||||
return props.value;
|
return props.value;
|
||||||
},
|
},
|
||||||
set(val: Array<ANY_OBJECT>) {
|
set(val: Array<ANY_OBJECT>) {
|
||||||
console.log('block values>>>>>>>>>>>>', val);
|
|
||||||
emit('update:value', val);
|
emit('update:value', val);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -355,6 +355,10 @@ const getWidgetProps = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const getDisabledStatus = () => {
|
const getDisabledStatus = () => {
|
||||||
|
const formWidgetAuth: ANY_OBJECT | null = form().formAuth()
|
||||||
|
? form().formAuth().pc[pps.widget.variableName]
|
||||||
|
: null;
|
||||||
|
if (formWidgetAuth && formWidgetAuth.disabled) return true;
|
||||||
return pps.widget.props.disabled;
|
return pps.widget.props.disabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -259,7 +259,6 @@ const {
|
|||||||
} = useForm(props);
|
} = useForm(props);
|
||||||
|
|
||||||
provide('form', () => {
|
provide('form', () => {
|
||||||
console.log('provide form1', props, form);
|
|
||||||
return {
|
return {
|
||||||
...form.value,
|
...form.value,
|
||||||
mode: props.mode || 'pc',
|
mode: props.mode || 'pc',
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ const props = withDefaults(
|
|||||||
isEdit: false,
|
isEdit: false,
|
||||||
readOnly: false,
|
readOnly: false,
|
||||||
fullscreen: false,
|
fullscreen: false,
|
||||||
|
flowInfo: undefined,
|
||||||
mode: 'pc',
|
mode: 'pc',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -82,6 +83,7 @@ const {
|
|||||||
rules,
|
rules,
|
||||||
masterTable,
|
masterTable,
|
||||||
formData,
|
formData,
|
||||||
|
formAuth,
|
||||||
richEditWidgetList,
|
richEditWidgetList,
|
||||||
tableWidgetList,
|
tableWidgetList,
|
||||||
getWidgetValue,
|
getWidgetValue,
|
||||||
@@ -132,6 +134,9 @@ provide('form', () => {
|
|||||||
return props.currentWidget === widget;
|
return props.currentWidget === widget;
|
||||||
},
|
},
|
||||||
getWidgetObject: widgetData.getWidgetObject,
|
getWidgetObject: widgetData.getWidgetObject,
|
||||||
|
formAuth: () => {
|
||||||
|
return formAuth.value;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -228,11 +233,58 @@ const initFormData = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const viewTaskFormKey = () => {
|
||||||
|
if (
|
||||||
|
props.flowInfo == null ||
|
||||||
|
props.flowInfo.taskId == null ||
|
||||||
|
props.flowInfo.taskId === '' ||
|
||||||
|
props.flowInfo.processInstanceId == null ||
|
||||||
|
props.flowInfo.processInstanceId === ''
|
||||||
|
) {
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
let paraams = {
|
||||||
|
processInstanceId: props.flowInfo.processInstanceId,
|
||||||
|
taskId: props.flowInfo.taskId,
|
||||||
|
};
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
|
FlowOperationController.viewTaskFormKey(paraams)
|
||||||
|
.then(res => {
|
||||||
|
try {
|
||||||
|
let temp = JSON.parse(res.data);
|
||||||
|
formAuth.value = temp.formAuth;
|
||||||
|
Object.keys(formAuth.value || {}).forEach(key => {
|
||||||
|
let formAuthItem = formAuth.value[key];
|
||||||
|
Object.keys(formAuthItem).forEach(subKey => {
|
||||||
|
let authItem = formAuthItem[subKey];
|
||||||
|
if (authItem && authItem != null && authItem !== '') {
|
||||||
|
formAuthItem[subKey] = authItem.split(',').map(item => parseInt(item));
|
||||||
|
} else {
|
||||||
|
formAuthItem[subKey] = [0, 0];
|
||||||
|
}
|
||||||
|
let disabled = formAuthItem[subKey][0] === 1;
|
||||||
|
let hide = formAuthItem[subKey][1] === 1;
|
||||||
|
formAuthItem[subKey].disabled = disabled;
|
||||||
|
formAuthItem[subKey].hide = hide;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
console.log(formAuth.value);
|
||||||
|
} catch (e) {
|
||||||
|
formAuth.value = null;
|
||||||
|
}
|
||||||
|
resolve();
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
reject(e);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
isReady.value = false;
|
isReady.value = false;
|
||||||
if (!props.isEdit) {
|
if (!props.isEdit) {
|
||||||
|
viewTaskFormKey().then(() => {
|
||||||
initWidgetRule();
|
initWidgetRule();
|
||||||
|
|
||||||
initFormData()
|
initFormData()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
initWidgetLinkage();
|
initWidgetLinkage();
|
||||||
@@ -243,8 +295,11 @@ onMounted(() => {
|
|||||||
.catch((e: Error) => {
|
.catch((e: Error) => {
|
||||||
console.warn(e);
|
console.warn(e);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
isReady.value = true;
|
isReady.value = true;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
isReady.value = true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const getFormDataImpl = (variableList: ANY_OBJECT[] | null = null) => {
|
const getFormDataImpl = (variableList: ANY_OBJECT[] | null = null) => {
|
||||||
|
|||||||
@@ -142,7 +142,11 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
return getSystemVariableValue(widget.bindData.systemVariableType);
|
return getSystemVariableValue(widget.bindData.systemVariableType);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const getWidgetVisible = () => {
|
const getWidgetVisible = widget => {
|
||||||
|
const formWidgetAuth: ANY_OBJECT | null = formAuth.value
|
||||||
|
? formAuth.value.pc[widget.variableName]
|
||||||
|
: null;
|
||||||
|
if (formWidgetAuth && formWidgetAuth.hide) return false;
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
const onValueChange = (widget: ANY_OBJECT, value: ANY_OBJECT) => {
|
const onValueChange = (widget: ANY_OBJECT, value: ANY_OBJECT) => {
|
||||||
@@ -295,7 +299,8 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const checkOperationPermCode = (operation: ANY_OBJECT | null) => {
|
const checkOperationPermCode = (operation: ANY_OBJECT | null) => {
|
||||||
if (dialogParams.value.formConfig.formType !== SysOnlineFormType.QUERY || props.isEdit) return true;
|
if (dialogParams.value.formConfig.formType !== SysOnlineFormType.QUERY || props.isEdit)
|
||||||
|
return true;
|
||||||
return checkPermCodeExist(getOperationPermCode(operation));
|
return checkPermCodeExist(getOperationPermCode(operation));
|
||||||
};
|
};
|
||||||
const checkOperationDisabled = (
|
const checkOperationDisabled = (
|
||||||
@@ -592,7 +597,9 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (widget.props.dictInfo && widget.props.dictInfo.dictId) {
|
if (widget.props.dictInfo && widget.props.dictInfo.dictId) {
|
||||||
widget.props.dictInfo.dict = dialogParams.value.formConfig.dictMap.get(widget.props.dictInfo.dictId);
|
widget.props.dictInfo.dict = dialogParams.value.formConfig.dictMap.get(
|
||||||
|
widget.props.dictInfo.dictId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (widget.column && widget.column.dictInfo != null) {
|
if (widget.column && widget.column.dictInfo != null) {
|
||||||
dropdownWidgetList.push(widget);
|
dropdownWidgetList.push(widget);
|
||||||
@@ -663,8 +670,10 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
errorMessage.value = [];
|
errorMessage.value = [];
|
||||||
if (dialogParams.value.formConfig.tableWidget) initWidget(dialogParams.value.formConfig.tableWidget);
|
if (dialogParams.value.formConfig.tableWidget)
|
||||||
if (dialogParams.value.formConfig.leftWidget) initWidget(dialogParams.value.formConfig.leftWidget);
|
initWidget(dialogParams.value.formConfig.tableWidget);
|
||||||
|
if (dialogParams.value.formConfig.leftWidget)
|
||||||
|
initWidget(dialogParams.value.formConfig.leftWidget);
|
||||||
if (errorMessage.value.length > 0) {
|
if (errorMessage.value.length > 0) {
|
||||||
console.error(errorMessage);
|
console.error(errorMessage);
|
||||||
}
|
}
|
||||||
@@ -899,12 +908,15 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const formAuth = ref();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
rules,
|
rules,
|
||||||
isReady,
|
isReady,
|
||||||
dialogParams,
|
dialogParams,
|
||||||
form,
|
form,
|
||||||
formData,
|
formData,
|
||||||
|
formAuth,
|
||||||
masterTable,
|
masterTable,
|
||||||
isRelation,
|
isRelation,
|
||||||
tableWidgetList,
|
tableWidgetList,
|
||||||
|
|||||||
@@ -352,7 +352,8 @@ const handlerStart = (
|
|||||||
} else {
|
} else {
|
||||||
preHandlerOperation(operation, true, xml)
|
preHandlerOperation(operation, true, xml)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
getMasterData(operation.type, (res || {}).assignee).then(formData => {
|
getMasterData(operation.type, (res || {}).assignee)
|
||||||
|
.then(formData => {
|
||||||
FlowOperationController.startAndTakeUserTask(
|
FlowOperationController.startAndTakeUserTask(
|
||||||
{
|
{
|
||||||
processDefinitionKey: dialogParams.value.processDefinitionKey,
|
processDefinitionKey: dialogParams.value.processDefinitionKey,
|
||||||
|
|||||||
@@ -35,6 +35,8 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
<el-form-item label="允许编辑" style="margin-bottom: 4px">
|
<el-form-item label="允许编辑" style="margin-bottom: 4px">
|
||||||
<template #label>
|
<template #label>
|
||||||
<span>允许编辑</span>
|
<span>允许编辑</span>
|
||||||
@@ -45,6 +47,24 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item
|
||||||
|
v-if="flowEntryComputed.bindFormType === SysFlowEntryBindFormType.ONLINE_FORM"
|
||||||
|
>
|
||||||
|
<template #label>
|
||||||
|
<span>表单权限设置</span>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
size="mini"
|
||||||
|
style="margin-left: 18px"
|
||||||
|
@click="onSetOnlineFormAuth"
|
||||||
|
>设置</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-row v-else-if="tabType === 'button'" style="padding-top: 3px">
|
<el-row v-else-if="tabType === 'button'" style="padding-top: 3px">
|
||||||
<!-- <el-col :span="24">
|
<!-- <el-col :span="24">
|
||||||
@@ -107,15 +127,17 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ElMessageBox } from 'element-plus';
|
import { getUUID } from '@/common/utils/index';
|
||||||
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import { VxeTable, VxeColumn } from 'vxe-table';
|
import { VxeTable, VxeColumn } from 'vxe-table';
|
||||||
import { ANY_OBJECT } from '@/types/generic';
|
import { ANY_OBJECT } from '@/types/generic';
|
||||||
import { Dialog } from '@/components/Dialog';
|
import { Dialog } from '@/components/Dialog';
|
||||||
import { SysOnlineFormType } from '@/common/staticDict/index';
|
import { SysOnlineFormType } from '@/common/staticDict/index';
|
||||||
import { SysFlowEntryBindFormType, SysFlowTaskOperationType } from '@/common/staticDict/flow';
|
import { SysFlowEntryBindFormType, SysFlowTaskOperationType } from '@/common/staticDict/flow';
|
||||||
import EditOperation from './formEditOperation.vue';
|
import EditOperation from './formEditOperation.vue';
|
||||||
|
import FormSetOnlineFormAuth from './formSetOnlineFormAuth.vue';
|
||||||
import { useLayoutStore } from '@/store';
|
import { useLayoutStore } from '@/store';
|
||||||
|
|
||||||
const layoutStore = useLayoutStore();
|
const layoutStore = useLayoutStore();
|
||||||
|
|
||||||
const props = defineProps<{ id: string; type: string; tabType: string }>();
|
const props = defineProps<{ id: string; type: string; tabType: string }>();
|
||||||
@@ -137,6 +159,7 @@ const form = ref();
|
|||||||
const formData = ref<ANY_OBJECT>({
|
const formData = ref<ANY_OBJECT>({
|
||||||
formId: flowEntry().value.defaultFormId,
|
formId: flowEntry().value.defaultFormId,
|
||||||
routerName: flowEntry().value.defaultRouterName,
|
routerName: flowEntry().value.defaultRouterName,
|
||||||
|
formAuth: {},
|
||||||
editable: false,
|
editable: false,
|
||||||
});
|
});
|
||||||
const operationList = ref<ANY_OBJECT>({});
|
const operationList = ref<ANY_OBJECT>({});
|
||||||
@@ -163,9 +186,94 @@ const getFlowEntryValidStatus = computed(() => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const currentForm = computed(() => {
|
||||||
|
return formList().find((item: ANY_OBJECT) => item.formId === formData.value.formId);
|
||||||
|
});
|
||||||
|
|
||||||
|
const formatOnlineFormInfo = formInfo => {
|
||||||
|
if (formInfo == null) return null;
|
||||||
|
let children;
|
||||||
|
if (Array.isArray(formInfo.childWidgetList) && formInfo.childWidgetList.length > 0) {
|
||||||
|
children = formInfo.childWidgetList.map(subWidget => formatOnlineFormInfo(subWidget));
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
formId: getUUID(),
|
||||||
|
showName: formInfo.showName,
|
||||||
|
variableName: formInfo.variableName,
|
||||||
|
widgetType: formInfo.widgetType,
|
||||||
|
children: children,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const onSetOnlineFormAuth = () => {
|
||||||
|
if (currentForm.value == null) {
|
||||||
|
ElMessage.error('请先选择表单!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let formWidgetConfig = JSON.parse(currentForm.value.widgetJson);
|
||||||
|
let tempConfig = {
|
||||||
|
pc: {
|
||||||
|
widgetList: [],
|
||||||
|
},
|
||||||
|
mobile: {
|
||||||
|
widgetList: [],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
if (formWidgetConfig != null) {
|
||||||
|
if (
|
||||||
|
formWidgetConfig.pc &&
|
||||||
|
Array.isArray(formWidgetConfig.pc.widgetList) &&
|
||||||
|
formWidgetConfig.pc.widgetList.length > 0
|
||||||
|
) {
|
||||||
|
tempConfig.pc = {
|
||||||
|
widgetList: formWidgetConfig.pc.widgetList.map(subWidget =>
|
||||||
|
formatOnlineFormInfo(subWidget),
|
||||||
|
),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
formWidgetConfig.mobile &&
|
||||||
|
Array.isArray(formWidgetConfig.mobile.widgetList) &&
|
||||||
|
formWidgetConfig.mobile.widgetList.length > 0
|
||||||
|
) {
|
||||||
|
tempConfig.mobile = {
|
||||||
|
widgetList: formWidgetConfig.mobile.widgetList.map(subWidget => formatOnlineFormInfo(subWidget))
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(tempConfig);
|
||||||
|
Dialog.show<ANY_OBJECT>(
|
||||||
|
'设置表单权限',
|
||||||
|
FormSetOnlineFormAuth,
|
||||||
|
{
|
||||||
|
area: ['1000px', '700px']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
formAuth: formData.value.formAuth || {},
|
||||||
|
formWidgetConfig: tempConfig,
|
||||||
|
path: 'thirdSetOnlineFormAuth'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
width: '1000px',
|
||||||
|
height: '700px',
|
||||||
|
pathName: '/thirdParty/formSetOnlineFormAuth',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.then(res => {
|
||||||
|
formData.value.formAuth = res;
|
||||||
|
updateElementFormKey();
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
console.warn(e);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const refreshData = (data: ANY_OBJECT) => {
|
const refreshData = (data: ANY_OBJECT) => {
|
||||||
if (data.path === 'thirdEditOperation' && data.isSuccess) {
|
if (data.path === 'thirdEditOperation' && data.isSuccess) {
|
||||||
updateEditOperation(data.data);
|
updateEditOperation(data.data);
|
||||||
|
} else if (data.path === 'thirdSetOnlineFormAuth' && data.isSuccess) {
|
||||||
|
formData.value.formAuth = data.data;
|
||||||
|
updateElementFormKey();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const resetFormList = () => {
|
const resetFormList = () => {
|
||||||
@@ -176,6 +284,7 @@ const resetFormList = () => {
|
|||||||
formData.value = {
|
formData.value = {
|
||||||
formId: formObj.formId,
|
formId: formObj.formId,
|
||||||
routerName: formObj.routerName,
|
routerName: formObj.routerName,
|
||||||
|
formAuth: formObj.formAuth || {},
|
||||||
editable: !formObj.readOnly,
|
editable: !formObj.readOnly,
|
||||||
groupType: formObj.groupType || 'ASSIGNEE',
|
groupType: formObj.groupType || 'ASSIGNEE',
|
||||||
};
|
};
|
||||||
@@ -208,6 +317,7 @@ const updateElementFormKey = () => {
|
|||||||
flowEntry().value.bindFormType === SysFlowEntryBindFormType.ONLINE_FORM
|
flowEntry().value.bindFormType === SysFlowEntryBindFormType.ONLINE_FORM
|
||||||
? undefined
|
? undefined
|
||||||
: formData.value.routerName,
|
: formData.value.routerName,
|
||||||
|
formAuth: formData.value.formAuth,
|
||||||
readOnly: !formData.value.editable,
|
readOnly: !formData.value.editable,
|
||||||
groupType: formData.value.groupType || 'ASSIGNEE',
|
groupType: formData.value.groupType || 'ASSIGNEE',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -309,13 +309,20 @@ export const routers: Array<RouteRecordRaw> = [
|
|||||||
props: getProps,
|
props: getProps,
|
||||||
component: () => import('@/pages/workflow/components/CopyForSelect/addCopyForItem.vue'),
|
component: () => import('@/pages/workflow/components/CopyForSelect/addCopyForItem.vue'),
|
||||||
},
|
},
|
||||||
// 流程设计-抄送
|
// 流程设计-任务操作按钮
|
||||||
{
|
{
|
||||||
path: 'thirdEditOperation',
|
path: 'thirdEditOperation',
|
||||||
name: 'thirdEditOperation',
|
name: 'thirdEditOperation',
|
||||||
props: getProps,
|
props: getProps,
|
||||||
component: () => import('@/pages/workflow/package/refactor/form/formEditOperation.vue'),
|
component: () => import('@/pages/workflow/package/refactor/form/formEditOperation.vue'),
|
||||||
},
|
},
|
||||||
|
// 流程设计-设置表单权限
|
||||||
|
{
|
||||||
|
path: 'thirdSetOnlineFormAuth',
|
||||||
|
name: 'thirdSetOnlineFormAuth',
|
||||||
|
props: getProps,
|
||||||
|
component: () => import('@/pages/workflow/package/refactor/form/formSetOnlineFormAuth.vue'),
|
||||||
|
},
|
||||||
// 流程设计-添加变量
|
// 流程设计-添加变量
|
||||||
{
|
{
|
||||||
path: 'thirdFormEditFlowEntryVariable',
|
path: 'thirdFormEditFlowEntryVariable',
|
||||||
|
|||||||
Reference in New Issue
Block a user