style: lint格式化文件
This commit is contained in:
@ -1,59 +1,50 @@
|
||||
<template>
|
||||
<SimpleForm
|
||||
ref="systemFormRef"
|
||||
:formProps="data.formDataProps"
|
||||
:formModel="{}"
|
||||
:isWorkFlow="props.fromPage!=FromPageType.MENU"
|
||||
/>
|
||||
<SimpleForm ref="systemFormRef" :formProps="data.formDataProps" :formModel="{}" :isWorkFlow="props.fromPage != FromPageType.MENU" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import {reactive, ref, onMounted, createVNode} from 'vue';
|
||||
import {formProps, formEventConfigs} from './config';
|
||||
import { reactive, ref, onMounted, createVNode } from 'vue';
|
||||
import { formProps, formEventConfigs } from './config';
|
||||
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
|
||||
import {addActRuVariable, getActRuVariable, updateActRuVariable, deleteActRuVariable} from '/@/api/editProVar/procVarManage';
|
||||
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';
|
||||
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
|
||||
import {Modal} from "ant-design-vue";
|
||||
import {useMessage} from '/@/hooks/web/useMessage';
|
||||
import {useI18n} from '/@/hooks/web/useI18n';
|
||||
import {useRouter} from "vue-router";
|
||||
import { addActRuVariable, getActRuVariable, updateActRuVariable, deleteActRuVariable } from '/@/api/editProVar/procVarManage';
|
||||
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';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
const router = useRouter();
|
||||
const {filterFormSchemaAuth} = usePermission();
|
||||
const { filterFormSchemaAuth } = usePermission();
|
||||
const RowKey = 'id';
|
||||
const emits = defineEmits(['changeUploadComponentIds', 'loadingCompleted', 'form-mounted']);
|
||||
const props = defineProps({
|
||||
fromPage: {
|
||||
type: Number,
|
||||
default: FromPageType.MENU,
|
||||
},
|
||||
default: FromPageType.MENU
|
||||
}
|
||||
});
|
||||
const systemFormRef = ref();
|
||||
const data: { formDataProps: FormDataProps } = reactive({
|
||||
formDataProps: cloneDeep(formProps),
|
||||
formDataProps: cloneDeep(formProps)
|
||||
});
|
||||
const state = reactive({
|
||||
formModel: {},
|
||||
formModel: {}
|
||||
});
|
||||
const {notification} = useMessage();
|
||||
const {t} = useI18n();
|
||||
const { notification } = useMessage();
|
||||
const { t } = useI18n();
|
||||
|
||||
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); //表单事件:加载表单
|
||||
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方法
|
||||
@ -62,17 +53,11 @@
|
||||
} 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); //表单事件:加载表单
|
||||
await createFormEvent(formEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单
|
||||
await loadFormEvent(formEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单
|
||||
}
|
||||
emits('form-mounted', formProps);
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
} catch (error) {}
|
||||
});
|
||||
|
||||
// 根据菜单页面权限,设置表单属性(必填,禁用,显示)
|
||||
@ -105,7 +90,7 @@
|
||||
name: queryParams.name,
|
||||
type: queryParams.type,
|
||||
value: queryParams.value,
|
||||
processInstId: queryParams.processId,
|
||||
processInstId: queryParams.processId
|
||||
};
|
||||
const record = await getActRuVariable(reqParam);
|
||||
if (skipUpdate) {
|
||||
@ -116,9 +101,7 @@
|
||||
state.formModel = reqParam;
|
||||
await getFormDataEvent(formEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据
|
||||
return reqParam;
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
// 辅助设置表单数据
|
||||
@ -142,17 +125,14 @@
|
||||
}
|
||||
|
||||
// 更新api表单数据
|
||||
async function update({values, rowId}) {
|
||||
async function update({ values, rowId }) {
|
||||
try {
|
||||
let res = systemFormRef.value.getFieldsValue();
|
||||
debugger
|
||||
debugger;
|
||||
let saveVal = await updateActRuVariable(res);
|
||||
await submitFormEvent(formEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:提交表单
|
||||
await submitFormEvent(formEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
|
||||
return saveVal;
|
||||
} catch (error) {
|
||||
}
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
// 新增api表单数据
|
||||
@ -160,38 +140,30 @@
|
||||
try {
|
||||
state.formModel = values;
|
||||
let saveVal = await addActRuVariable(values);
|
||||
await submitFormEvent(formEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:提交表单
|
||||
await submitFormEvent(formEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
|
||||
return saveVal;
|
||||
} catch (error) {
|
||||
}
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
// 根据工作流页面权限,设置表单属性(必填,禁用,显示)
|
||||
async function setWorkFlowForm(obj: WorkFlowFormParams) {
|
||||
try {
|
||||
let flowData = changeWorkFlowForm(cloneDeep(formProps), obj);
|
||||
let {buildOptionJson, uploadComponentIds, formModels, isViewProcess} = flowData;
|
||||
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)
|
||||
if (formModels[RowKey]) {
|
||||
setFormDataFromId(formModels[RowKey], false);
|
||||
} else {
|
||||
setFieldsValue(formModels)
|
||||
setFieldsValue(formModels);
|
||||
}
|
||||
} catch (error) {
|
||||
}
|
||||
await createFormEvent(formEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:初始化表单
|
||||
await loadFormEvent(formEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:加载表单
|
||||
} catch (error) {}
|
||||
await createFormEvent(formEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单
|
||||
await loadFormEvent(formEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单
|
||||
}
|
||||
|
||||
// 详情页删除功能
|
||||
@ -210,12 +182,11 @@
|
||||
deleteActRuVariable(ids).then((_) => {
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('删除成功!'),
|
||||
description: t('删除成功!')
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {
|
||||
},
|
||||
onCancel() {}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -1,31 +1,31 @@
|
||||
<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"/>
|
||||
<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 { 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';
|
||||
import { FromPageType } from '/@/enums/workflowEnum';
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
const {notification} = useMessage();
|
||||
const { notification } = useMessage();
|
||||
const formRef = ref();
|
||||
const state = reactive({
|
||||
formModel: {},
|
||||
isUpdate: true,
|
||||
isView: false,
|
||||
isCopy: false,
|
||||
rowId: '',
|
||||
rowId: ''
|
||||
});
|
||||
|
||||
const {t} = useI18n();
|
||||
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
|
||||
const { t } = useI18n();
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
state.isUpdate = !!data?.isUpdate;
|
||||
state.isView = !!data?.isView;
|
||||
state.isCopy = !!data?.isCopy;
|
||||
@ -36,7 +36,7 @@
|
||||
showCancelBtn: !state.isView,
|
||||
showOkBtn: !state.isView,
|
||||
canFullscreen: true,
|
||||
width: 900,
|
||||
width: 900
|
||||
});
|
||||
if (state.isUpdate || state.isView || state.isCopy) {
|
||||
state.rowId = data.id;
|
||||
@ -66,11 +66,10 @@
|
||||
if (!state.isUpdate || state.isCopy) {
|
||||
saveSuccess = await formRef.value.add(values);
|
||||
} else {
|
||||
saveSuccess = await formRef.value.update({values, rowId: state.rowId});
|
||||
saveSuccess = await formRef.value.update({ values, rowId: state.rowId });
|
||||
}
|
||||
return saveSuccess;
|
||||
} catch (error) {
|
||||
}
|
||||
} catch (error) {}
|
||||
}
|
||||
} catch (error) {
|
||||
return saveSuccess;
|
||||
@ -80,18 +79,18 @@
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const saveSuccess = await saveModal();
|
||||
setModalProps({confirmLoading: true});
|
||||
setModalProps({ confirmLoading: true });
|
||||
if (saveSuccess) {
|
||||
if (!state.isUpdate || state.isCopy) {
|
||||
//false 新增
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('新增成功!'),
|
||||
description: t('新增成功!')
|
||||
}); //提示消息
|
||||
} else {
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('修改成功!'),
|
||||
description: t('修改成功!')
|
||||
}); //提示消息
|
||||
}
|
||||
closeModal();
|
||||
@ -99,7 +98,7 @@
|
||||
emit('success');
|
||||
}
|
||||
} finally {
|
||||
setModalProps({confirmLoading: false});
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,60 +1,40 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:mask-closable="false"
|
||||
:title="title"
|
||||
:visible="visible"
|
||||
:width="600"
|
||||
class="geg"
|
||||
style="top: 120px"
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<a-modal :mask-closable="false" :title="title" :visible="visible" :width="600" class="geg" style="top: 120px" @cancel="handleCancel">
|
||||
<div class="dialog-wrap">
|
||||
<a-tabs v-model:activeKey="activeKey">
|
||||
<a-tab-pane key="1" tab="Serialized">
|
||||
<a-textarea v-model:value="formData.value" :rows="16" @change="handleChange"/>
|
||||
<a-textarea v-model:value="formData.value" :rows="16" @change="handleChange" />
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
<a-alert
|
||||
v-if="showAlert"
|
||||
style="margin-top: 12px"
|
||||
message="警告:您确定要更改此对象的值吗?以不兼容的方式更改变量可能会导致严重的运行时问题。"
|
||||
banner
|
||||
/>
|
||||
<a-alert v-if="showAlert" style="margin-top: 12px" message="警告:您确定要更改此对象的值吗?以不兼容的方式更改变量可能会导致严重的运行时问题。" banner />
|
||||
</div>
|
||||
<template #footer>
|
||||
<a-button :loading="false" type="default" @click="handleCancel">取消</a-button>
|
||||
<a-button
|
||||
:loading="false"
|
||||
type="danger"
|
||||
@click="handleSubmit"
|
||||
:disabled="disabledSubmit"
|
||||
>
|
||||
修改
|
||||
</a-button>
|
||||
<a-button :loading="false" type="danger" @click="handleSubmit" :disabled="disabledSubmit"> 修改 </a-button>
|
||||
</template>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref, watch} from 'vue';
|
||||
import { ref, watch } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
variableId: String,
|
||||
visible: Boolean,
|
||||
title: {type: String, default: '编辑表单变量'},
|
||||
initialData: {type: Object, default: () => ({value: ''})},
|
||||
title: { type: String, default: '编辑表单变量' },
|
||||
initialData: { type: Object, default: () => ({ value: '' }) }
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:visible', 'submit', 'cancel']);
|
||||
|
||||
const formData = ref({
|
||||
processId: props.processId,
|
||||
value: props.initialData.value,
|
||||
value: props.initialData.value
|
||||
});
|
||||
|
||||
const oldData = ref({
|
||||
processId: props.initialData.processId,
|
||||
value: props.initialData.value,
|
||||
value: props.initialData.value
|
||||
});
|
||||
|
||||
const activeKey = ref('1');
|
||||
@ -64,19 +44,17 @@
|
||||
watch(
|
||||
() => props.initialData,
|
||||
(newData) => {
|
||||
formData.value = {...newData};
|
||||
oldData.value = {...newData};
|
||||
formData.value = { ...newData };
|
||||
oldData.value = { ...newData };
|
||||
disabledSubmit.value = true;
|
||||
showAlert.value = false;
|
||||
activeKey.value = '1'; //默认打开第一个tab
|
||||
},
|
||||
{deep: true},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
const handleChange = () => {
|
||||
const isModified =
|
||||
formData.value.processId !== oldData.value.processId ||
|
||||
formData.value.value !== oldData.value.value;
|
||||
const isModified = formData.value.processId !== oldData.value.processId || formData.value.value !== oldData.value.value;
|
||||
disabledSubmit.value = !isModified;
|
||||
showAlert.value = isModified;
|
||||
};
|
||||
|
||||
@ -5,13 +5,13 @@
|
||||
<template v-for="button in tableButtonConfig" :key="button.code">
|
||||
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
||||
<template #icon>
|
||||
<Icon :icon="button.icon"/>
|
||||
<Icon :icon="button.icon" />
|
||||
</template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
<a-button v-else :type="button.type">
|
||||
<template #icon>
|
||||
<Icon :icon="button.icon"/>
|
||||
<Icon :icon="button.icon" />
|
||||
</template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
@ -20,43 +20,36 @@
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'value'">
|
||||
<div v-if="record.type.indexOf('Object') === 0">
|
||||
<div :style="{color: '#155cb5',cursor: 'pointer'}" @click="handleOpenModalPage(record)">{{record.value}}</div>
|
||||
<div :style="{ color: '#155cb5', cursor: 'pointer' }" @click="handleOpenModalPage(record)">{{ record.value }}</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<TableAction :actions="getActions(record)"/>
|
||||
<div v-if="record.type.indexOf('Object') !== 0">
|
||||
</div>
|
||||
<TableAction :actions="getActions(record)" />
|
||||
<div v-if="record.type.indexOf('Object') !== 0"> </div>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<ProcVarManageModal @register="registerModal" @success="handleSuccess"/>
|
||||
|
||||
<VarModal
|
||||
v-model:visible="isOpenVarModal"
|
||||
:initialData="modalFormData"
|
||||
@submit="handleVarModalSubmit"
|
||||
@cancel="handleVarModalCancel"
|
||||
/>
|
||||
<ProcVarManageModal @register="registerModal" @success="handleSuccess" />
|
||||
|
||||
<VarModal v-model:visible="isOpenVarModal" :initialData="modalFormData" @submit="handleVarModalSubmit" @cancel="handleVarModalCancel" />
|
||||
</PageWrapper>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref, computed, onMounted, onUnmounted, createVNode, watch,} from 'vue';
|
||||
import {Modal} from 'ant-design-vue';
|
||||
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
|
||||
import {BasicTable, useTable, TableAction, ActionItem} from '/@/components/Table';
|
||||
import {getActRuVariablePage, deleteActRuVariable, getSerializedVal, updateFormVariable} from '/@/api/editProVar/procVarManage';
|
||||
import {PageWrapper} from '/@/components/Page';
|
||||
import {useMessage} from '/@/hooks/web/useMessage';
|
||||
import {useI18n} from '/@/hooks/web/useI18n';
|
||||
import {usePermission} from '/@/hooks/web/usePermission';
|
||||
import {useRouter} from 'vue-router';
|
||||
import {getActRuVariable} from '/@/api/editProVar/procVarManage';
|
||||
import {useModal} from '/@/components/Modal';
|
||||
import { ref, computed, onMounted, onUnmounted, createVNode, watch } from 'vue';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
|
||||
import { getActRuVariablePage, deleteActRuVariable, getSerializedVal, updateFormVariable } from '/@/api/editProVar/procVarManage';
|
||||
import { PageWrapper } from '/@/components/Page';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { getActRuVariable } from '/@/api/editProVar/procVarManage';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import ProcVarManageModal from './components/ProcVarManageModal.vue';
|
||||
import {searchFormSchema, columns} from './components/config';
|
||||
import { searchFormSchema, columns } from './components/config';
|
||||
import Icon from '/@/components/Icon/index';
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import VarModal from './components/VarModal.vue';
|
||||
@ -64,13 +57,13 @@
|
||||
const props = defineProps({
|
||||
processId: String,
|
||||
xml: String,
|
||||
schemaId: String,
|
||||
schemaId: String
|
||||
});
|
||||
const {bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED} = useEventBus();
|
||||
const {notification} = useMessage();
|
||||
const {t} = useI18n();
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
const { notification } = useMessage();
|
||||
const { t } = useI18n();
|
||||
defineEmits(['register']);
|
||||
const {filterColumnAuth, filterButtonAuth} = usePermission();
|
||||
const { filterColumnAuth, filterButtonAuth } = usePermission();
|
||||
//const filterColumns = filterColumnAuth(columns);
|
||||
const filterColumns = columns;
|
||||
const tableRef = ref();
|
||||
@ -79,44 +72,44 @@
|
||||
const buttonConfigs = computed(() => {
|
||||
const list = [
|
||||
/*{"isUse": true, "name": "新增", "code": "add", "icon": "ant-design:plus-outlined", "isDefault": true, "type": "primary"},*/
|
||||
{"isUse": true, "name": "编辑", "code": "edit", "icon": "ant-design:form-outlined", "isDefault": true},
|
||||
{"isUse": true, "name": "刷新", "code": "refresh", "icon": "ant-design:reload-outlined", "isDefault": true},
|
||||
{ isUse: true, name: '编辑', code: 'edit', icon: 'ant-design:form-outlined', isDefault: true },
|
||||
{ isUse: true, name: '刷新', code: 'refresh', icon: 'ant-design:reload-outlined', isDefault: true }
|
||||
/*{"isUse": true, "name": "查看", "code": "view", "icon": "ant-design:eye-outlined", "isDefault": true},
|
||||
{"isUse": true, "name": "删除", "code": "delete", "icon": "ant-design:delete-outlined", "isDefault": true}*/
|
||||
]
|
||||
];
|
||||
//return filterButtonAuth(list);
|
||||
return list;
|
||||
})
|
||||
});
|
||||
const tableButtonConfig = computed(() => {
|
||||
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
|
||||
});
|
||||
const actionButtonConfig = computed(() => {
|
||||
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
|
||||
});
|
||||
const btnEvent = {add: handleAdd, edit: handleEdit, refresh: handleRefresh, view: handleView, delete: handleDelete,}
|
||||
const {currentRoute} = useRouter();
|
||||
const btnEvent = { add: handleAdd, edit: handleEdit, refresh: handleRefresh, view: handleView, delete: handleDelete };
|
||||
const { currentRoute } = useRouter();
|
||||
const router = useRouter();
|
||||
const formIdComputedRef = ref();
|
||||
formIdComputedRef.value = currentRoute.value.meta.formId
|
||||
formIdComputedRef.value = currentRoute.value.meta.formId;
|
||||
const schemaIdComputedRef = ref();
|
||||
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
|
||||
const [registerModal, {openModal}] = useModal();
|
||||
schemaIdComputedRef.value = currentRoute.value.meta.schemaId;
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const formName = '流程变量编辑功能';
|
||||
const [registerTable, {reload,}] = useTable({
|
||||
title: '' || (formName + '列表'),
|
||||
const [registerTable, { reload }] = useTable({
|
||||
title: '' || formName + '列表',
|
||||
api: getActRuVariablePage,
|
||||
rowKey: 'id',
|
||||
columns: filterColumns,
|
||||
formConfig: {
|
||||
rowProps: {
|
||||
gutter: 16,
|
||||
gutter: 16
|
||||
},
|
||||
schemas: searchFormSchema,
|
||||
fieldMapToTime: [],
|
||||
showResetButton: false,
|
||||
showResetButton: false
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return {...params, FormId: formIdComputedRef.value, PK: 'id', procInstId: props.processId};
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id', procInstId: props.processId };
|
||||
},
|
||||
afterFetch: (res) => {
|
||||
tableRef.value.setToolBarWidth();
|
||||
@ -128,23 +121,23 @@
|
||||
width: 160,
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
slots: {customRender: 'action'},
|
||||
slots: { customRender: 'action' }
|
||||
},
|
||||
tableSetting: {
|
||||
size: false,
|
||||
setting: false,
|
||||
},
|
||||
setting: false
|
||||
}
|
||||
});
|
||||
|
||||
const isOpenVarModal = ref(false);
|
||||
const modalFormData = ref({
|
||||
processInstId: '',
|
||||
key: '',
|
||||
value: '',
|
||||
value: ''
|
||||
});
|
||||
|
||||
function dbClickRow(record) {
|
||||
const {processId, taskIds, schemaId} = record.workflowData || {};
|
||||
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||
if (taskIds && taskIds.length) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||
@ -202,8 +195,8 @@
|
||||
name: record.name,
|
||||
type: record.type,
|
||||
value: record.value,
|
||||
processId: props.processId,
|
||||
},
|
||||
processId: props.processId
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -211,13 +204,13 @@
|
||||
let reqParam = {
|
||||
processInstId: props.processId,
|
||||
name: record.name
|
||||
}
|
||||
};
|
||||
const res = await getSerializedVal(reqParam);
|
||||
if (res) {
|
||||
modalFormData.value = {
|
||||
processId: props.processId,
|
||||
key: record.name,
|
||||
value: res,
|
||||
value: res
|
||||
};
|
||||
isOpenVarModal.value = true;
|
||||
}
|
||||
@ -225,10 +218,10 @@
|
||||
|
||||
// 处理弹窗提交
|
||||
const handleVarModalSubmit = async (data) => {
|
||||
let res = await updateFormVariable(data)
|
||||
let res = await updateFormVariable(data);
|
||||
if (res) {
|
||||
isOpenVarModal.value = false;
|
||||
notification.success({message: '更新成功'});
|
||||
notification.success({ message: '更新成功' });
|
||||
await reload();
|
||||
}
|
||||
};
|
||||
@ -254,16 +247,14 @@
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('删除成功!'),
|
||||
description: t('删除成功!')
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {
|
||||
},
|
||||
onCancel() {}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function handleRefresh() {
|
||||
reload();
|
||||
}
|
||||
@ -301,14 +292,14 @@
|
||||
icon: button?.icon,
|
||||
tooltip: button?.name,
|
||||
color: button.code === 'delete' ? 'error' : undefined,
|
||||
onClick: btnEvent[button.code].bind(null, record),
|
||||
onClick: btnEvent[button.code].bind(null, record)
|
||||
};
|
||||
} else {
|
||||
if (button.code === 'view') {
|
||||
return {
|
||||
icon: button?.icon,
|
||||
tooltip: button?.name,
|
||||
onClick: btnEvent[button.code].bind(null, record),
|
||||
onClick: btnEvent[button.code].bind(null, record)
|
||||
};
|
||||
} else {
|
||||
return {};
|
||||
@ -317,7 +308,6 @@
|
||||
});
|
||||
return actionsList;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
Reference in New Issue
Block a user