Commit 620d4f7e by sunhaiwei

Merge remote-tracking branch 'origin/hongshun' into hongshun

# Conflicts:
#	xjrsoft-vue3/src/api/jcsj/cjx/model/CjxModel.ts
parents ffdcaddd 36e62166
...@@ -180,14 +180,6 @@ export interface MesCollectionScItOptionModel { ...@@ -180,14 +180,6 @@ export interface MesCollectionScItOptionModel {
modifyUserId: string; modifyUserId: string;
} }
modifyUserId: string;
sc: string;
dt: string;
bb: string;
}
/** /**
* @description: MesCollectionItem分页返回值结构 * @description: MesCollectionItem分页返回值结构
......
...@@ -41,7 +41,7 @@ export async function exportDesign(id: string, mode: ErrorMessageMode = 'modal') ...@@ -41,7 +41,7 @@ export async function exportDesign(id: string, mode: ErrorMessageMode = 'modal')
/** /**
* @description: 查询Workflow分页列表 * @description: 查询Workflow分页列表
*/ */
export async function getDesignPage(params: WorkflowPageParams, mode: ErrorMessageMode = 'modal') { export async function getDesignPage(params: WorkflowPageParams, mode: ErrorMessageMode = 'modal') {
return defHttp.get<WorkflowPageResult>( return defHttp.get<WorkflowPageResult>(
{ {
url: Api.Page, url: Api.Page,
......
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
}; };
let res = await getDesignPage(params); let res = await getDesignPage(params);
page.total = res.total; page.total = res.total;
template.list = res.list; // template.list = res.list;
} catch (error) {} } catch (error) {}
} }
function submit() { function submit() {
......
<template> <template>
<div class="pt-4"> <div class="pt-4">
<SimpleForm <SimpleForm
ref="systemFormRef" ref="systemFormRef"
:formProps="data.formDataProps" :formProps="data.formDataProps"
:formModel="state.formModel" :formModel="state.formModel"
:isWorkFlow="props.fromPage!=FromPageType.MENU" :isWorkFlow="props.fromPage != FromPageType.MENU"
:isCamelCase="true" :isCamelCase="true"
@model-change="handleChange" @model-change="handleChange"
/> />
</div> </div>
...@@ -15,21 +14,30 @@ ...@@ -15,21 +14,30 @@
import { reactive, ref, onMounted, nextTick, watch } from 'vue'; import { reactive, ref, onMounted, nextTick, watch } from 'vue';
import { formProps, formEventConfigs } from './config'; import { formProps, formEventConfigs } from './config';
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue'; import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
import { addMesTrqxunjianRecord, getMesTrqxunjianRecord, updateMesTrqxunjianRecord } from '/@/api/scgl/trqxjd'; import {
import { cloneDeep, isString } from 'lodash-es'; addMesTrqxunjianRecord,
getMesTrqxunjianRecord,
updateMesTrqxunjianRecord,
} from '/@/api/scgl/trqxjd';
import { cloneDeep, isString } from 'lodash-es';
import { FormDataProps } from '/@/components/Designer/src/types'; import { FormDataProps } from '/@/components/Designer/src/types';
import { usePermission } from '/@/hooks/web/usePermission'; import { usePermission } from '/@/hooks/web/usePermission';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue'; import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { FromPageType } from '/@/enums/workflowEnum'; import { FromPageType } from '/@/enums/workflowEnum';
import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent,} from '/@/hooks/web/useFormEvent'; import {
createFormEvent,
getFormDataEvent,
loadFormEvent,
submitFormEvent,
} from '/@/hooks/web/useFormEvent';
import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm'; import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm';
import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig'; import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
const { filterFormSchemaAuth } = usePermission(); const { filterFormSchemaAuth } = usePermission();
const RowKey = 'id'; const RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'update:value']); const emits = defineEmits(['changeUploadComponentIds', 'loadingCompleted', 'update:value']);
const props = defineProps({ const props = defineProps({
fromPage: { fromPage: {
type: Number, type: Number,
...@@ -42,34 +50,52 @@ ...@@ -42,34 +50,52 @@
}); });
const state = reactive({ const state = reactive({
formModel: {}, formModel: {},
formInfo:{formId:'',formName:''} formInfo: { formId: '', formName: '' },
}); });
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
watch( watch(
() => state.formModel, () => state.formModel,
(val) => { (val) => {
emits('update:value', val); emits('update:value', val);
}, },
{ {
deep: true, deep: true,
}, },
); );
onMounted(async () => { onMounted(async () => {
try { try {
if (props.fromPage == FromPageType.MENU) { if (props.fromPage == FromPageType.MENU) {
setMenuPermission(); setMenuPermission();
if(currentRoute.value.meta){ if (currentRoute.value.meta) {
state.formInfo.formName = currentRoute.value.meta.title&&isString(currentRoute.value.meta.title)?currentRoute.value.meta.title:''; state.formInfo.formName =
state.formInfo.formId = currentRoute.value.meta.formId&&isString(currentRoute.value.meta.formId)?currentRoute.value.meta.formId:''; currentRoute.value.meta.title && isString(currentRoute.value.meta.title)
? currentRoute.value.meta.title
: '';
state.formInfo.formId =
currentRoute.value.meta.formId && isString(currentRoute.value.meta.formId)
? currentRoute.value.meta.formId
: '';
} }
await createFormEvent(formEventConfigs, state.formModel, await createFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单 formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:初始化表单
await nextTick(); await nextTick();
await loadFormEvent(formEventConfigs, state.formModel, await loadFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单 formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:加载表单
} else if (props.fromPage == FromPageType.FLOW) { } else if (props.fromPage == FromPageType.FLOW) {
emits('loadingCompleted'); //告诉系统表单已经加载完毕 emits('loadingCompleted'); //告诉系统表单已经加载完毕
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法 // loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
...@@ -78,15 +104,28 @@ ...@@ -78,15 +104,28 @@
} else if (props.fromPage == FromPageType.DESKTOP) { } else if (props.fromPage == FromPageType.DESKTOP) {
// 桌面设计 表单事件需要执行 // 桌面设计 表单事件需要执行
emits('loadingCompleted'); //告诉系统表单已经加载完毕 emits('loadingCompleted'); //告诉系统表单已经加载完毕
await createFormEvent(formEventConfigs, state.formModel, await createFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单 formProps.schemas,
await loadFormEvent(formEventConfigs, state.formModel, true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:初始化表单
await loadFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单 formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:加载表单
} }
} catch (error) {} } catch (error) {}
}); });
// 根据菜单页面权限,设置表单属性(必填,禁用,显示) // 根据菜单页面权限,设置表单属性(必填,禁用,显示)
function setMenuPermission() { function setMenuPermission() {
data.formDataProps.schemas = filterFormSchemaAuth(data.formDataProps.schemas!); data.formDataProps.schemas = filterFormSchemaAuth(data.formDataProps.schemas!);
...@@ -106,20 +145,26 @@ ...@@ -106,20 +145,26 @@
} finally { } finally {
} }
return values; return values;
} }
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】 // 根据行唯一ID查询行数据,并设置表单数据 【编辑】
async function setFormDataFromId(rowId) { async function setFormDataFromId(rowId) {
try { try {
const record = await getMesTrqxunjianRecord(rowId); const record = await getMesTrqxunjianRecord(rowId);
setFieldsValue(record); setFieldsValue(record);
state.formModel = record; state.formModel = record;
await getFormDataEvent(formEventConfigs, state.formModel, await getFormDataEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:获取表单数据 formProps.schemas,
} catch (error) { true,
state.formInfo.formName,
} state.formInfo.formId,
); //表单事件:获取表单数据
} catch (error) {}
} }
// 辅助返回表单数据 // 辅助返回表单数据
async function getFieldsValue() { async function getFieldsValue() {
let values = []; let values = [];
...@@ -135,47 +180,66 @@ ...@@ -135,47 +180,66 @@
} }
return values; return values;
} }
// 辅助设置表单数据 // 辅助设置表单数据
function setFieldsValue(record) { function setFieldsValue(record) {
systemFormRef.value.setFieldsValue(record); systemFormRef.value.setFieldsValue(record);
} }
// 重置表单数据 // 重置表单数据
async function resetFields() { async function resetFields() {
await systemFormRef.value.resetFields(); await systemFormRef.value.resetFields();
} }
// 设置表单数据全部为Disabled 【查看】 // 设置表单数据全部为Disabled 【查看】
async function setDisabledForm( ) { async function setDisabledForm() {
data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas)); data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas));
} }
// 获取行键值 // 获取行键值
function getRowKey() { function getRowKey() {
return RowKey; return RowKey;
} }
// 更新api表单数据 // 更新api表单数据
async function update({ values, rowId }) { async function update({ values, rowId }) {
try { try {
values[RowKey] = rowId; values[RowKey] = rowId;
state.formModel = values; state.formModel = values;
let saveVal = await updateMesTrqxunjianRecord(values); let saveVal = await updateMesTrqxunjianRecord(values);
await submitFormEvent(formEventConfigs, state.formModel, await submitFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单 formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:提交表单
return saveVal; return saveVal;
} catch (error) {} } catch (error) {}
} }
// 新增api表单数据 // 新增api表单数据
async function add(values) { async function add(values) {
try { try {
state.formModel = values; state.formModel = values;
let saveVal = await addMesTrqxunjianRecord(values); let saveVal = await addMesTrqxunjianRecord(values);
await submitFormEvent(formEventConfigs, state.formModel, await submitFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单 formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:提交表单
return saveVal; return saveVal;
} catch (error) {} } catch (error) {}
} }
// 根据工作流页面权限,设置表单属性(必填,禁用,显示) // 根据工作流页面权限,设置表单属性(必填,禁用,显示)
async function setWorkFlowForm(obj: WorkFlowFormParams) { async function setWorkFlowForm(obj: WorkFlowFormParams) {
try { try {
if (obj.formId) state.formInfo.formId = obj.formId; if (obj.formId) state.formInfo.formId = obj.formId;
if (obj.formName) state.formInfo.formName = obj.formName; if (obj.formName) state.formInfo.formName = obj.formName;
...@@ -189,23 +253,38 @@ ...@@ -189,23 +253,38 @@
state.formModel = formModels; state.formModel = formModels;
setFieldsValue(formModels); setFieldsValue(formModels);
} catch (error) {} } catch (error) {}
await createFormEvent(formEventConfigs, state.formModel, await createFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单 formProps.schemas,
await loadFormEvent(formEventConfigs, state.formModel, true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:初始化表单
await loadFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单 formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:加载表单
} }
function handleChange(val) {
function handleChange(val) {
emits('update:value', val); emits('update:value', val);
} }
async function sendMessageForAllIframe() {
async function sendMessageForAllIframe() {
try { try {
if (systemFormRef.value && systemFormRef.value.sendMessageForAllIframe) { if (systemFormRef.value && systemFormRef.value.sendMessageForAllIframe) {
systemFormRef.value.sendMessageForAllIframe(); systemFormRef.value.sendMessageForAllIframe();
} }
} catch (error) {} } catch (error) {}
} }
defineExpose({ defineExpose({
setFieldsValue, setFieldsValue,
resetFields, resetFields,
...@@ -218,8 +297,6 @@ ...@@ -218,8 +297,6 @@
setWorkFlowForm, setWorkFlowForm,
getRowKey, getRowKey,
getFieldsValue, getFieldsValue,
sendMessageForAllIframe sendMessageForAllIframe,
}); });
</script> </script>
\ No newline at end of file
...@@ -210,15 +210,37 @@ export const formProps: FormProps = { ...@@ -210,15 +210,37 @@ export const formProps: FormProps = {
style: { width: '100%' }, style: { width: '100%' },
}, },
}, },
],
},
{
span: 12,
list: [
{ {
key: 'f9d86621c3354428b91bfa63ffc6f3b8', key: '2e56c34cf7564c8b94e4362f576852ad',
field: 'mc', field: 'createDate',
label: '名称', label: '巡检时间',
type: 'date',
component: 'DatePicker',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
span: 7,
defaultValue: '',
width: '100%',
placeholder: '',
format: 'YYYY-MM-DD HH:mm:ss',
showLabel: true,
allowClear: true,
disabled: false,
required: false,
isShow: true,
rules: [],
events: {},
isGetCurrent: false,
tooltipConfig: { visible: false, title: '提示文本' },
searchType: 'time',
style: { width: '100%' },
},
},
{
key: '47a71bc316a94794bbf45ec7b26ce391',
field: 'bz',
label: '备注',
type: 'input', type: 'input',
component: 'Input', component: 'Input',
colProps: { span: 24 }, colProps: { span: 24 },
...@@ -343,36 +365,9 @@ export const formProps: FormProps = { ...@@ -343,36 +365,9 @@ export const formProps: FormProps = {
span: 12, span: 12,
list: [ list: [
{ {
key: '2e56c34cf7564c8b94e4362f576852ad', key: 'f9d86621c3354428b91bfa63ffc6f3b8',
field: 'createDate', field: 'mc',
label: '巡检时间', label: '名称',
type: 'date',
component: 'DatePicker',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
span: 7,
defaultValue: '',
width: '100%',
placeholder: '',
format: 'YYYY-MM-DD HH:mm:ss',
showLabel: true,
allowClear: true,
disabled: false,
required: false,
isShow: true,
rules: [],
events: {},
isGetCurrent: false,
tooltipConfig: { visible: false, title: '提示文本' },
searchType: 'time',
style: { width: '100%' },
},
},
{
key: '47a71bc316a94794bbf45ec7b26ce391',
field: 'bz',
label: '备注',
type: 'input', type: 'input',
component: 'Input', component: 'Input',
colProps: { span: 24 }, colProps: { span: 24 },
...@@ -394,7 +389,7 @@ export const formProps: FormProps = { ...@@ -394,7 +389,7 @@ export const formProps: FormProps = {
events: {}, events: {},
listStyle: '', listStyle: '',
isSave: false, isSave: false,
isShow: true, isShow: false,
scan: false, scan: false,
bordered: true, bordered: true,
isShowAi: false, isShowAi: false,
......
...@@ -150,7 +150,7 @@ export const columns: BasicColumn[] = [ ...@@ -150,7 +150,7 @@ export const columns: BasicColumn[] = [
{ {
resizable: true, resizable: true,
dataIndex: 'lydjlx', dataIndex: 'lydjlx',
title: '来源单据', title: '来源单据111',
componentType: 'input', componentType: 'input',
fixed: false, fixed: false,
......
...@@ -28,11 +28,36 @@ ...@@ -28,11 +28,36 @@
<template v-if="column.dataIndex === 'action'"> <template v-if="column.dataIndex === 'action'">
<div style="display: flex; align-items: center;">
<TableAction <!-- 其他按钮使用TableAction组件 -->
:actions="getLessActions(record)" <TableAction
:dropDownActions="getMoreActions(record)" :actions="getLessActions(record)"
/> :dropDownActions="getMoreActions(record)"
/>
<!-- 单独渲染流程按钮 -->
<template v-if="!record.taskId">
<a-button
type="text"
size="small"
style="margin-left: 8px;color: #1c8dff; "
@click="openFlowLaunchModal(record.id)"
>
<template #icon><Icon style="color: #1c8dff;" :icon="'ant-design:rocket-outlined'" /></template>
发起流程
</a-button>
</template>
<template v-else>
<a-button
type="text"
size="small"
style="margin-left: 8px;color: #1c8dff;"
@click="viewProcess(record)"
>
<template #icon><Icon style="color: #1c8dff;" :icon="'ant-design:eye-outlined'" /></template>
查看流程
</a-button>
</template>
</div>
</template> </template>
<template v-else-if="column.dataIndex && column?.listStyle"> <template v-else-if="column.dataIndex && column?.listStyle">
...@@ -84,13 +109,73 @@ ...@@ -84,13 +109,73 @@
@success="handleExportSuccess" @success="handleExportSuccess"
/> />
<!-- 流程发起对话框 -->
<a-modal
v-model:visible="visibleFlowLaunchModal"
title="流程模板列表"
width="80%"
:bodyStyle="{ height: '620px', padding: '0' }"
:footer="null"
@cancel="visibleFlowLaunchModal = false"
>
<a-spin :spinning="loading" tip="发起流程中..." style="min-height: 500px;">
<PageLayout
:title="'流程模板列表'"
:searchConfig="searchConfig"
@search="searchFlowTemplate"
@scroll-height="scrollHeight"
>
<template #search> </template>
<template #right>
<div v-if="flowLaunchData.list.length > 0" style="height: 550px;padding: 10px;" class="list-page-box relative">
<div
class="flex flex-wrap my-10px overflow-y-auto"
style="height: calc(100% - 62px); align-content: baseline"
>
<TemplateCard
v-for="(item, index) in flowLaunchData.list"
:key="index"
:item="item"
:width="'calc((100% - 39px) / 4)'"
@click="launchProcess(item.id)"
/>
</div>
<div class="page-box">
<a-pagination
v-model:current="flowLaunchData.pagination.current"
:total="flowLaunchData.pagination.total"
v-model:pageSize="flowLaunchData.pagination.pageSize"
:showSizeChanger="true"
:showQuickJumper="true"
:show-total="(total) => `共 ${total} 条数据`"
@change="handleFlowTemplatePageChange"
/></div>
</div>
<div v-else>
<EmptyBox />
</div>
</template>
</PageLayout>
</a-spin>
</a-modal>
<!-- 查看流程组件 -->
<LookProcess
v-if="visibleLookProcess"
:visible="visibleLookProcess"
:taskId="taskIdProcess"
:processId="processIdProcess"
@close="visibleLookProcess = false"
/>
</ResizePageWrapper> </ResizePageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed,provide,Ref, onMounted,createVNode, import { ref, computed,provide,Ref, onMounted,createVNode, reactive
} from 'vue'; } from 'vue';
import { Modal } from 'ant-design-vue'; import { Modal } from 'ant-design-vue';
...@@ -132,18 +217,164 @@ ...@@ -132,18 +217,164 @@
import { moneyChineseData,camelCaseString, } from '/@/utils/event/design'; import { moneyChineseData,camelCaseString, } from '/@/utils/event/design';
import { FormSchema } from '/@/components/Form/src/types/form'; import { FormSchema } from '/@/components/Form/src/types/form';
import LookProcess from '/@/views/workflow/task/components/LookProcess.vue';
import TemplateCard from '/@bpmn/components/card/TemplateCard.vue';
import { EmptyBox } from '/@/components/ModalPanel/index';
import { getDesignPage } from '/@/api/workflow/design';
import { WorkflowPageModel } from '/@/api/workflow/model';
import { PageLayout } from '/@/components/ModalPanel';
import userTableScrollHeight from '/@/hooks/setting/userTableScrollHeight';
import { getAppEnvConfig } from '/@/utils/env';
import { getToken } from '/@/utils/auth';
const listSpliceNum = ref(3); //操作列最先展示几个
const listSpliceNum = ref(4); //操作列最先展示几个
const visibleFlowLaunchModal = ref(false);
const { scrollHeight } = userTableScrollHeight();
const fromId = ref('');
const loading = ref(false);
// 查看流程相关变量
const visibleLookProcess = ref(false);
const taskIdProcess = ref('');
const processIdProcess = ref('');
// 流程模板数据
const flowLaunchData = reactive({
list: [] as WorkflowPageModel[],
pagination: {
current: 1,
total: 0,
pageSize: 20,
},
});
// 搜索配置
const searchConfig = [
{
field: 'code',
label: '模板编码',
type: 'input',
},
{
field: 'name',
label: '模板名称',
type: 'input',
},
];
// 打开流程发起对话框
function openFlowLaunchModal(id) {
fromId.value = id;
visibleFlowLaunchModal.value = true;
// 初始化数据
flowLaunchData.pagination.current = 1;
flowLaunchData.pagination.total = 0;
getFlowTemplateList();
}
// 获取流程模板列表
async function getFlowTemplateList(params?: any) {
const searchParams = {
...{
limit: flowLaunchData.pagination.current,
size: flowLaunchData.pagination.pageSize,
},
...params,
...{ enabledMark: 1 }, // 流程发起list 需要隐藏 禁用的模板[enabledMark=1]
};
try {
let res = await getDesignPage(searchParams);
flowLaunchData.list = res.list;
flowLaunchData.pagination.total = res.total;
} catch (error) {
console.error('获取流程模板列表失败:', error);
}
}
// 搜索流程模板
function searchFlowTemplate(params: any) {
flowLaunchData.pagination.current = 1;
getFlowTemplateList(params);
}
// 分页变化
function handleFlowTemplatePageChange(page: number, pageSize: number) {
flowLaunchData.pagination.current = page;
flowLaunchData.pagination.pageSize = pageSize;
getFlowTemplateList();
}
// 发起流程
function launchProcess(schemaId: string) {
Modal.confirm({
title: '提示信息',
icon: createVNode(ExclamationCircleOutlined),
content: '是否确认发起流程?',
okText: '确认',
cancelText: '取消',
onOk() {
// 开始加载
loading.value = true;
// 调用接口发起流程
fetch( getAppEnvConfig().VITE_GLOB_API_URL + '/zlgl/bhgpcl/launchProcess', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${getToken()}`
},
body: JSON.stringify({
type: 1,
schemaId: schemaId,
fromId: fromId.value
})
})
.then(response => response.json())
.then(data => {
// 结束加载
loading.value = false;
if (data.code == 0) {
notification.success({
message: '提示',
description: '流程发起成功!',
});
visibleFlowLaunchModal.value = false;
// 刷新不合格品列表数据
reload();
} else {
notification.error({
message: '提示',
description: data.msg || '流程发起失败',
});
}
})
.catch(error => {
// 结束加载
loading.value = false;
console.error('流程发起失败:', error);
notification.error({
message: '提示',
description: '流程发起失败,请稍后重试',
});
});
},
onCancel() {},
});
}
// 查看流程
function viewProcess(record) {
visibleLookProcess.value = true;
taskIdProcess.value = record.taskId;
processIdProcess.value = record.processId;
}
import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock'; import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock';
...@@ -234,7 +465,7 @@ ...@@ -234,7 +465,7 @@
striped: false, striped: false,
actionColumn: { actionColumn: {
width: 195, width: 320,
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
slots: { customRender: 'action' }, slots: { customRender: 'action' },
...@@ -426,7 +657,7 @@ ...@@ -426,7 +657,7 @@
record.isCanEdit = true; record.isCanEdit = true;
actionsList.push({ actionsList.push({
...button, ...button,
auth: `bhgpcl:${button.code}`, auth: `bhgpcl:${button.code}`,
label: button?.name, label: button?.name,
color: button.code === 'delete' ? 'error' : undefined, color: button.code === 'delete' ? 'error' : undefined,
...@@ -435,7 +666,7 @@ ...@@ -435,7 +666,7 @@
} else { } else {
if (!['edit', 'delete'].includes(button.code)) { if (!['edit', 'delete'].includes(button.code)) {
actionsList.push({ actionsList.push({
auth: `bhgpcl:${button.code}`, auth: `bhgpcl:${button.code}`,
label: button?.name, label: button?.name,
onClick: btnEvent[button.code]?.bind(null, record), onClick: btnEvent[button.code]?.bind(null, record),
...@@ -443,6 +674,7 @@ ...@@ -443,6 +674,7 @@
} }
} }
}); });
return actionsList; return actionsList;
} }
...@@ -496,4 +728,26 @@ ...@@ -496,4 +728,26 @@
} }
} }
/* 流程模板列表样式 */
.list-page-box {
height: calc(100% - 62px);
}
.page-box {
height: 52px;
border-top: 1px solid rgb(238 238 238 / 93%);
text-align: right;
padding: 10px 16px;
background: #fff;
position: absolute;
right: 0;
bottom: 0;
left: 0;
border-radius: 16px;
}
.my-10px {
margin: 10px 0;
}
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment