style: lint格式化文件

This commit is contained in:
2025-10-21 18:04:02 +08:00
parent f9ca969fec
commit 7629120548
1092 changed files with 148218 additions and 157907 deletions

View File

@ -5,36 +5,31 @@
<div v-for="(item, index) in dataList" :class="{ sep: index !== 0 }" class="item">
<div class="row">
<div class="col-6">
<span style="color: gray;">{{ index + 1 + "、" }}</span>
<span style="color: gray;">用户 </span>
<span style="font-weight: bold;font-size: larger;"> {{ props.currentUserName }} </span>
<span style="color: gray;"> </span>
<span style="font-weight: bold;font-size: larger;"> {{ item.fieldName ? item.fieldName :
item.fieldCode }} </span>
<span v-if="item.changeType == 'insert'">{{ " 新增为 " }}
<span style="color: gray">{{ index + 1 + '、' }}</span>
<span style="color: gray">用户 </span>
<span style="font-weight: bold; font-size: larger"> {{ props.currentUserName }} </span>
<span style="color: gray"> </span>
<span style="font-weight: bold; font-size: larger"> {{ item.fieldName ? item.fieldName : item.fieldCode }} </span>
<span v-if="item.changeType == 'insert'"
>{{ ' 新增为 ' }}
<span v-for="file in fileList">
<span style="font-weight: bold;font-size: larger;color: black;"
v-if="file.id == item.oldValue">{{ file.name + "-" }}</span>
<span style="font-weight: bold; font-size: larger; color: black" v-if="file.id == item.oldValue">{{ file.name + '-' }}</span>
</span>
<span style="font-weight: bold;font-size: larger;">{{
item.newValue }} </span>
<span style="font-weight: bold; font-size: larger">{{ item.newValue }} </span>
</span>
<span v-if="item.changeType == 'update'" style="color: gray;">{{ " 从 " }}
<span v-if="item.changeType == 'update'" style="color: gray"
>{{ ' 从 ' }}
<span v-for="file2 in fileList">
<span style="font-weight: bold;font-size: larger;color: black;"
v-if="file2.id == item.oldValue">{{ file2.name + "-" }}</span>
<span style="font-weight: bold; font-size: larger; color: black" v-if="file2.id == item.oldValue">{{ file2.name + '-' }}</span>
</span>
<span style="font-weight: bold;font-size: larger;color: black;">{{
item.oldValue }}</span>
<span>{{ " 修改至 " }}</span>
<span style="font-weight: bold; font-size: larger; color: black">{{ item.oldValue }}</span>
<span>{{ ' 修改至 ' }}</span>
<span v-for="file3 in fileList">
<span style="font-weight: bold;font-size: larger;color: black;"
v-if="file3.id == item.newValue">{{ file3.name + "-" }}</span>
<span style="font-weight: bold; font-size: larger; color: black" v-if="file3.id == item.newValue">{{ file3.name + '-' }}</span>
</span>
<span style="font-weight: bold;font-size: larger;color: black;">{{
item.newValue }}</span>
<span style="font-weight: bold; font-size: larger; color: black">{{ item.newValue }}</span>
</span>
<span v-if="item.changeType == 'delete'" style="color: gray;">{{ " 删除了 " }}</span>
<span v-if="item.changeType == 'delete'" style="color: gray">{{ ' 删除了 ' }}</span>
</div>
<div class="col-4">&nbsp;&nbsp;&nbsp;&nbsp;</div>
<div class="col-2">
@ -46,156 +41,150 @@
</template>
<script lang="ts" setup>
import { useI18n } from '/@/hooks/web/useI18n';
import { defineProps, onMounted, ref, watch } from 'vue';
import dayjs from 'dayjs';
import { getFileList } from "/@/api/system/file";
import { getFormChangeRecordItemPage, getFormChangeRecordItemList } from '/@/api/formChange/changeLogDetail/index'
import { FormChangeRecordItemModel, FormChangeRecordItemPageModel, FormChangeRecordItemPageParams } from '/@/api/formChange/changeLogDetail/model/ChangeLogDetailModel';
import { array } from 'vue-types';
import { FilePageListModel } from '/@/api/system/file/model';
import { useI18n } from '/@/hooks/web/useI18n';
import { defineProps, onMounted, ref, watch } from 'vue';
import dayjs from 'dayjs';
import { getFileList } from '/@/api/system/file';
import { getFormChangeRecordItemPage, getFormChangeRecordItemList } from '/@/api/formChange/changeLogDetail/index';
import { FormChangeRecordItemModel, FormChangeRecordItemPageModel, FormChangeRecordItemPageParams } from '/@/api/formChange/changeLogDetail/model/ChangeLogDetailModel';
import { array } from 'vue-types';
import { FilePageListModel } from '/@/api/system/file/model';
const { t } = useI18n();
const props = defineProps({
mode: {
type: String,
default: 'simple'
},
items: Array,
autoHide: {
type: Boolean,
default: true
},
sort: {
type: String,
default: 'desc'
},
rowId: {
type: Number
},
currentUserName: {
type: String,
},
currentCreateTime: {
type: String,
},
formInfos: {
type: Array,
},
isShow: {
type: Boolean
const { t } = useI18n();
const props = defineProps({
mode: {
type: String,
default: 'simple'
},
items: Array,
autoHide: {
type: Boolean,
default: true
},
sort: {
type: String,
default: 'desc'
},
rowId: {
type: Number
},
currentUserName: {
type: String
},
currentCreateTime: {
type: String
},
formInfos: {
type: Array
},
isShow: {
type: Boolean
}
});
const dataList = ref<FormChangeRecordItemPageModel[]>([]);
const fileList = ref<{ id: string; name: string }[]>([]);
function parseTime(t) {
return dayjs(t).format('YYYY-MM-DD HH:mm');
}
});
const dataList = ref<FormChangeRecordItemPageModel[]>([]);
const fileList = ref<{ id: string; name: string }[]>([]);
async function getData() {
getFormChangeRecordItemList({ operationId: props.rowId, size: 99, limit: 1 }).then((res) => {
dataList.value = res.list;
});
fileList.value = [];
function parseTime(t) {
return dayjs(t).format('YYYY-MM-DD HH:mm');
}
dataList.value.forEach(async (ele1) => {
props.formInfos?.forEach((ele2) => {
if (ele1.fieldName == null && ele1.fieldCode == ele2.fieldId) {
ele1.fieldName = ele2.fieldName;
}
});
if (ele1.fieldCode.indexOf('file') > 0 || ele1.fieldCode.indexOf('File') > 0) {
const newlist = await getFileList({ folderId: ele1.newValue });
fileList.value.push({ id: ele1.newValue, name: newlist.map((item) => item.fileName).join('、') });
async function getData() {
getFormChangeRecordItemList({ "operationId": props.rowId, "size": 99, "limit": 1 }).then((res) => {
dataList.value = res.list;
})
fileList.value = [];
dataList.value.forEach(async ele1 => {
props.formInfos?.forEach(ele2 => {
if (ele1.fieldName == null && ele1.fieldCode == ele2.fieldId) {
ele1.fieldName = ele2.fieldName
const oldlist = await getFileList({ folderId: ele1.oldValue });
fileList.value.push({ id: ele1.oldValue, name: oldlist.map((item) => item.fileName).join('、') });
}
})
if (ele1.fieldCode.indexOf('file') > 0 || ele1.fieldCode.indexOf('File') > 0) {
const newlist = await getFileList({ folderId: ele1.newValue });
fileList.value.push({ 'id': ele1.newValue, 'name': newlist.map((item) => item.fileName).join('、') });
});
}
const oldlist = await getFileList({ folderId: ele1.oldValue });
fileList.value.push({ 'id': ele1.oldValue, 'name': oldlist.map((item) => item.fileName).join('、') });
onMounted(async () => {
await getData();
});
watch(
() => props.isShow,
async (val) => {
if (val) {
await getData();
}
}
})
}
onMounted(async () => {
await getData();
});
watch(
() => props.isShow,
async (val) => {
if (val) {
await getData();
}
},
);
);
</script>
<style lang="less">
.geg-flow-history {
.signature {
/* height: 20px;*/
height: 30px;
width: 50px;
}
.row {
display: flex;
flex-direction: row;
margin: 6px 0;
line-height: 20px;
font-size: 14px;
}
.col-1 {
width: 160px;
}
.col-2 {
width: 130px;
color: #5a6875;
}
.col-3 {
flex: 1;
&.agree {
color: #52c41a;
}
}
.tag {
padding-right: 4px;
&.agree {
color: #52c41a;
.geg-flow-history {
.signature {
/* height: 20px;*/
height: 30px;
width: 50px;
}
&.reject {
color: #eaa63c;
.row {
display: flex;
flex-direction: row;
margin: 6px 0;
line-height: 20px;
font-size: 14px;
}
.col-1 {
width: 160px;
}
.col-2 {
width: 130px;
color: #5a6875;
}
.col-3 {
flex: 1;
&.agree {
color: #52c41a;
}
}
.tag {
padding-right: 4px;
&.agree {
color: #52c41a;
}
&.reject {
color: #eaa63c;
}
}
.col-node {
width: 120px;
}
.position {
color: #90a0af;
}
.item {
padding: 8px 0;
&.sep {
border-top: 1px solid #e9e9e9;
}
}
}
.col-node {
width: 120px;
}
.position {
color: #90a0af;
}
.item {
padding: 8px 0;
&.sep {
border-top: 1px solid #e9e9e9;
}
}
}
</style>

View File

@ -1,32 +1,32 @@
<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;
@ -37,7 +37,7 @@
showCancelBtn: !state.isView,
showOkBtn: !state.isView,
canFullscreen: true,
width: 900,
width: 900
});
if (state.isUpdate || state.isView || state.isCopy) {
state.rowId = data.id;
@ -67,11 +67,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;
@ -81,18 +80,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();
@ -100,7 +99,7 @@
emit('success');
}
} finally {
setModalProps({confirmLoading: false});
setModalProps({ confirmLoading: false });
}
}

View File

@ -1,79 +1,138 @@
<template>
<div ref="formWrap">
<Form ref="formRef" :label-col="getProps?.labelCol" :labelAlign="getProps?.labelAlign" :layout="getProps?.layout" :model="formModel" :wrapper-col="getProps?.wrapperCol" @keypress.enter="handleEnterPress">
<!-- 主表id -->
<!-- 主表id -->
<Col v-if="getIfShow2('1f7a5fa213f549748f3d00e177d86b1b')" v-show="getIsShow2('1f7a5fa213f549748f3d00e177d86b1b')" :span="getColWidth(schemaMap['1f7a5fa213f549748f3d00e177d86b1b'])">
<template v-if="showComponent(schemaMap['1f7a5fa213f549748f3d00e177d86b1b'])">
<SimpleFormItem v-model:value="formModel[schemaMap['1f7a5fa213f549748f3d00e177d86b1b'].field]" :form-api="formApi" :isWorkFlow="isWorkFlow" :refreshFieldObj="refreshFieldObj" :schema="schemaMap['1f7a5fa213f549748f3d00e177d86b1b']" />
</template>
</Col>
<!-- 表单类型 -->
<Col v-if="getIfShow2('1f7a5fa213f549748f3d00e177d86b1b')" v-show="getIsShow2('1f7a5fa213f549748f3d00e177d86b1b')" :span="getColWidth(schemaMap['1f7a5fa213f549748f3d00e177d86b1b'])">
<template v-if="showComponent(schemaMap['1f7a5fa213f549748f3d00e177d86b1b'])">
<SimpleFormItem
v-model:value="formModel[schemaMap['1f7a5fa213f549748f3d00e177d86b1b'].field]"
:form-api="formApi"
:isWorkFlow="isWorkFlow"
:refreshFieldObj="refreshFieldObj"
:schema="schemaMap['1f7a5fa213f549748f3d00e177d86b1b']"
/>
</template>
</Col>
<!-- 表单类型 -->
<Col v-if="getIfShow2('524a5c581073419d8e8daff9e461695a')" v-show="getIsShow2('524a5c581073419d8e8daff9e461695a')" :span="getColWidth(schemaMap['524a5c581073419d8e8daff9e461695a'])">
<template v-if="showComponent(schemaMap['524a5c581073419d8e8daff9e461695a'])">
<SimpleFormItem v-model:value="formModel[schemaMap['524a5c581073419d8e8daff9e461695a'].field]" :form-api="formApi" :isWorkFlow="isWorkFlow" :refreshFieldObj="refreshFieldObj" :schema="schemaMap['524a5c581073419d8e8daff9e461695a']" />
</template>
</Col>
<!-- 表单编码 -->
<Col v-if="getIfShow2('524a5c581073419d8e8daff9e461695a')" v-show="getIsShow2('524a5c581073419d8e8daff9e461695a')" :span="getColWidth(schemaMap['524a5c581073419d8e8daff9e461695a'])">
<template v-if="showComponent(schemaMap['524a5c581073419d8e8daff9e461695a'])">
<SimpleFormItem
v-model:value="formModel[schemaMap['524a5c581073419d8e8daff9e461695a'].field]"
:form-api="formApi"
:isWorkFlow="isWorkFlow"
:refreshFieldObj="refreshFieldObj"
:schema="schemaMap['524a5c581073419d8e8daff9e461695a']"
/>
</template>
</Col>
<!-- 表单编码 -->
<Col v-if="getIfShow2('d74b7a7bede24820a6c85677a6cdb5fe')" v-show="getIsShow2('d74b7a7bede24820a6c85677a6cdb5fe')" :span="getColWidth(schemaMap['d74b7a7bede24820a6c85677a6cdb5fe'])">
<template v-if="showComponent(schemaMap['d74b7a7bede24820a6c85677a6cdb5fe'])">
<SimpleFormItem v-model:value="formModel[schemaMap['d74b7a7bede24820a6c85677a6cdb5fe'].field]" :form-api="formApi" :isWorkFlow="isWorkFlow" :refreshFieldObj="refreshFieldObj" :schema="schemaMap['d74b7a7bede24820a6c85677a6cdb5fe']" />
</template>
</Col>
<!-- 主表或子表的id -->
<Col v-if="getIfShow2('d74b7a7bede24820a6c85677a6cdb5fe')" v-show="getIsShow2('d74b7a7bede24820a6c85677a6cdb5fe')" :span="getColWidth(schemaMap['d74b7a7bede24820a6c85677a6cdb5fe'])">
<template v-if="showComponent(schemaMap['d74b7a7bede24820a6c85677a6cdb5fe'])">
<SimpleFormItem
v-model:value="formModel[schemaMap['d74b7a7bede24820a6c85677a6cdb5fe'].field]"
:form-api="formApi"
:isWorkFlow="isWorkFlow"
:refreshFieldObj="refreshFieldObj"
:schema="schemaMap['d74b7a7bede24820a6c85677a6cdb5fe']"
/>
</template>
</Col>
<!-- 主表或子表的id -->
<Col v-if="getIfShow2('3d499852001044c0a6230e5ce18532d2')" v-show="getIsShow2('3d499852001044c0a6230e5ce18532d2')" :span="getColWidth(schemaMap['3d499852001044c0a6230e5ce18532d2'])">
<template v-if="showComponent(schemaMap['3d499852001044c0a6230e5ce18532d2'])">
<SimpleFormItem v-model:value="formModel[schemaMap['3d499852001044c0a6230e5ce18532d2'].field]" :form-api="formApi" :isWorkFlow="isWorkFlow" :refreshFieldObj="refreshFieldObj" :schema="schemaMap['3d499852001044c0a6230e5ce18532d2']" />
</template>
</Col>
<!-- 变更字段编码 -->
<Col v-if="getIfShow2('3d499852001044c0a6230e5ce18532d2')" v-show="getIsShow2('3d499852001044c0a6230e5ce18532d2')" :span="getColWidth(schemaMap['3d499852001044c0a6230e5ce18532d2'])">
<template v-if="showComponent(schemaMap['3d499852001044c0a6230e5ce18532d2'])">
<SimpleFormItem
v-model:value="formModel[schemaMap['3d499852001044c0a6230e5ce18532d2'].field]"
:form-api="formApi"
:isWorkFlow="isWorkFlow"
:refreshFieldObj="refreshFieldObj"
:schema="schemaMap['3d499852001044c0a6230e5ce18532d2']"
/>
</template>
</Col>
<!-- 变更字段编码 -->
<Col v-if="getIfShow2('32b4ed61b5504f74943ead2cdc770baf')" v-show="getIsShow2('32b4ed61b5504f74943ead2cdc770baf')" :span="getColWidth(schemaMap['32b4ed61b5504f74943ead2cdc770baf'])">
<template v-if="showComponent(schemaMap['32b4ed61b5504f74943ead2cdc770baf'])">
<SimpleFormItem v-model:value="formModel[schemaMap['32b4ed61b5504f74943ead2cdc770baf'].field]" :form-api="formApi" :isWorkFlow="isWorkFlow" :refreshFieldObj="refreshFieldObj" :schema="schemaMap['32b4ed61b5504f74943ead2cdc770baf']" />
</template>
</Col>
<!-- 变更字段名 -->
<Col v-if="getIfShow2('32b4ed61b5504f74943ead2cdc770baf')" v-show="getIsShow2('32b4ed61b5504f74943ead2cdc770baf')" :span="getColWidth(schemaMap['32b4ed61b5504f74943ead2cdc770baf'])">
<template v-if="showComponent(schemaMap['32b4ed61b5504f74943ead2cdc770baf'])">
<SimpleFormItem
v-model:value="formModel[schemaMap['32b4ed61b5504f74943ead2cdc770baf'].field]"
:form-api="formApi"
:isWorkFlow="isWorkFlow"
:refreshFieldObj="refreshFieldObj"
:schema="schemaMap['32b4ed61b5504f74943ead2cdc770baf']"
/>
</template>
</Col>
<!-- 变更字段名 -->
<Col v-if="getIfShow2('f08ff059b6db43608e6ecf5f195f92bb')" v-show="getIsShow2('f08ff059b6db43608e6ecf5f195f92bb')" :span="getColWidth(schemaMap['f08ff059b6db43608e6ecf5f195f92bb'])">
<template v-if="showComponent(schemaMap['f08ff059b6db43608e6ecf5f195f92bb'])">
<SimpleFormItem v-model:value="formModel[schemaMap['f08ff059b6db43608e6ecf5f195f92bb'].field]" :form-api="formApi" :isWorkFlow="isWorkFlow" :refreshFieldObj="refreshFieldObj" :schema="schemaMap['f08ff059b6db43608e6ecf5f195f92bb']" />
</template>
</Col>
<!-- 变更字段类型 -->
<Col v-if="getIfShow2('f08ff059b6db43608e6ecf5f195f92bb')" v-show="getIsShow2('f08ff059b6db43608e6ecf5f195f92bb')" :span="getColWidth(schemaMap['f08ff059b6db43608e6ecf5f195f92bb'])">
<template v-if="showComponent(schemaMap['f08ff059b6db43608e6ecf5f195f92bb'])">
<SimpleFormItem
v-model:value="formModel[schemaMap['f08ff059b6db43608e6ecf5f195f92bb'].field]"
:form-api="formApi"
:isWorkFlow="isWorkFlow"
:refreshFieldObj="refreshFieldObj"
:schema="schemaMap['f08ff059b6db43608e6ecf5f195f92bb']"
/>
</template>
</Col>
<!-- 变更字段类型 -->
<Col v-if="getIfShow2('4f11bf8e79484cc7a694b52c9524c371')" v-show="getIsShow2('4f11bf8e79484cc7a694b52c9524c371')" :span="getColWidth(schemaMap['4f11bf8e79484cc7a694b52c9524c371'])">
<template v-if="showComponent(schemaMap['4f11bf8e79484cc7a694b52c9524c371'])">
<SimpleFormItem v-model:value="formModel[schemaMap['4f11bf8e79484cc7a694b52c9524c371'].field]" :form-api="formApi" :isWorkFlow="isWorkFlow" :refreshFieldObj="refreshFieldObj" :schema="schemaMap['4f11bf8e79484cc7a694b52c9524c371']" />
</template>
</Col>
<!-- 变更前的值 -->
<Col v-if="getIfShow2('4f11bf8e79484cc7a694b52c9524c371')" v-show="getIsShow2('4f11bf8e79484cc7a694b52c9524c371')" :span="getColWidth(schemaMap['4f11bf8e79484cc7a694b52c9524c371'])">
<template v-if="showComponent(schemaMap['4f11bf8e79484cc7a694b52c9524c371'])">
<SimpleFormItem
v-model:value="formModel[schemaMap['4f11bf8e79484cc7a694b52c9524c371'].field]"
:form-api="formApi"
:isWorkFlow="isWorkFlow"
:refreshFieldObj="refreshFieldObj"
:schema="schemaMap['4f11bf8e79484cc7a694b52c9524c371']"
/>
</template>
</Col>
<!-- 变更前的值 -->
<Col v-if="getIfShow2('5aa4b801a16d41e88b8ef61a0a93f2f7')" v-show="getIsShow2('5aa4b801a16d41e88b8ef61a0a93f2f7')" :span="getColWidth(schemaMap['5aa4b801a16d41e88b8ef61a0a93f2f7'])">
<template v-if="showComponent(schemaMap['5aa4b801a16d41e88b8ef61a0a93f2f7'])">
<SimpleFormItem v-model:value="formModel[schemaMap['5aa4b801a16d41e88b8ef61a0a93f2f7'].field]" :form-api="formApi" :isWorkFlow="isWorkFlow" :refreshFieldObj="refreshFieldObj" :schema="schemaMap['5aa4b801a16d41e88b8ef61a0a93f2f7']" />
</template>
</Col>
<!-- 变更后的值 -->
<Col v-if="getIfShow2('5aa4b801a16d41e88b8ef61a0a93f2f7')" v-show="getIsShow2('5aa4b801a16d41e88b8ef61a0a93f2f7')" :span="getColWidth(schemaMap['5aa4b801a16d41e88b8ef61a0a93f2f7'])">
<template v-if="showComponent(schemaMap['5aa4b801a16d41e88b8ef61a0a93f2f7'])">
<SimpleFormItem
v-model:value="formModel[schemaMap['5aa4b801a16d41e88b8ef61a0a93f2f7'].field]"
:form-api="formApi"
:isWorkFlow="isWorkFlow"
:refreshFieldObj="refreshFieldObj"
:schema="schemaMap['5aa4b801a16d41e88b8ef61a0a93f2f7']"
/>
</template>
</Col>
<!-- 变更后的值 -->
<Col v-if="getIfShow2('870896f3810543bc83a1510ff141bfb8')" v-show="getIsShow2('870896f3810543bc83a1510ff141bfb8')" :span="getColWidth(schemaMap['870896f3810543bc83a1510ff141bfb8'])">
<template v-if="showComponent(schemaMap['870896f3810543bc83a1510ff141bfb8'])">
<SimpleFormItem v-model:value="formModel[schemaMap['870896f3810543bc83a1510ff141bfb8'].field]" :form-api="formApi" :isWorkFlow="isWorkFlow" :refreshFieldObj="refreshFieldObj" :schema="schemaMap['870896f3810543bc83a1510ff141bfb8']" />
</template>
</Col>
<!-- 变更类型 -->
<Col v-if="getIfShow2('870896f3810543bc83a1510ff141bfb8')" v-show="getIsShow2('870896f3810543bc83a1510ff141bfb8')" :span="getColWidth(schemaMap['870896f3810543bc83a1510ff141bfb8'])">
<template v-if="showComponent(schemaMap['870896f3810543bc83a1510ff141bfb8'])">
<SimpleFormItem
v-model:value="formModel[schemaMap['870896f3810543bc83a1510ff141bfb8'].field]"
:form-api="formApi"
:isWorkFlow="isWorkFlow"
:refreshFieldObj="refreshFieldObj"
:schema="schemaMap['870896f3810543bc83a1510ff141bfb8']"
/>
</template>
</Col>
<!-- 变更类型 -->
<Col v-if="getIfShow2('52ef4d91155f4666b697b5aab1adb2c7')" v-show="getIsShow2('52ef4d91155f4666b697b5aab1adb2c7')" :span="getColWidth(schemaMap['52ef4d91155f4666b697b5aab1adb2c7'])">
<template v-if="showComponent(schemaMap['52ef4d91155f4666b697b5aab1adb2c7'])">
<SimpleFormItem v-model:value="formModel[schemaMap['52ef4d91155f4666b697b5aab1adb2c7'].field]" :form-api="formApi" :isWorkFlow="isWorkFlow" :refreshFieldObj="refreshFieldObj" :schema="schemaMap['52ef4d91155f4666b697b5aab1adb2c7']" />
</template>
</Col>
<div :style="{ textAlign: getProps.buttonLocation }">
<Col v-if="getIfShow2('52ef4d91155f4666b697b5aab1adb2c7')" v-show="getIsShow2('52ef4d91155f4666b697b5aab1adb2c7')" :span="getColWidth(schemaMap['52ef4d91155f4666b697b5aab1adb2c7'])">
<template v-if="showComponent(schemaMap['52ef4d91155f4666b697b5aab1adb2c7'])">
<SimpleFormItem
v-model:value="formModel[schemaMap['52ef4d91155f4666b697b5aab1adb2c7'].field]"
:form-api="formApi"
:isWorkFlow="isWorkFlow"
:refreshFieldObj="refreshFieldObj"
:schema="schemaMap['52ef4d91155f4666b697b5aab1adb2c7']"
/>
</template>
</Col>
<div :style="{ textAlign: getProps.buttonLocation }">
<slot name="buttonBefore"></slot>
<a-button v-if="getProps.showSubmitButton" type="primary" @click="handleSubmit">
{{ t('提交') }}
@ -94,28 +153,24 @@
import SimpleFormItem from '/@/components/SimpleForm/src/components/SimpleFormItem.vue';
import { ref } from 'vue';
import { CheckCircleOutlined } from '@ant-design/icons-vue';
const FormItem = Form.Item;
export default {
components: {
CheckCircleOutlined,
Form,
Col,
SimpleFormItem,
Row,
components: {
CheckCircleOutlined,
Form,
Col,
SimpleFormItem,
Row,
FormItem
},
mixins: [SimpleFormSetup],
setup(props, ctx) {
const ret = SimpleFormSetup.setup(props, ctx);
const expose = ctx.expose;
return {
...ret
};
},
@ -125,13 +180,13 @@
const schemaMap = {};
this.getSchemas.forEach((schema) => {
schemaMap[schema.key] = schema;
if(schema.children) {
schema.children.forEach(sChild=>{
if(sChild.list){
sChild.list.forEach(lChild=>{
schemaMap[lChild.key] = lChild;
});
}
if (schema.children) {
schema.children.forEach((sChild) => {
if (sChild.list) {
sChild.list.forEach((lChild) => {
schemaMap[lChild.key] = lChild;
});
}
});
}
});
@ -153,16 +208,16 @@
size: schema.componentProps.tabSize,
tabPosition: schema.componentProps.tabPosition,
type: schema.componentProps.type
}
};
},
getTdStyle(tdElement) {
return {
height: tdElement.height ? tdElement.height + 'px' : '',
minHeight: (tdElement.height || '42') + 'px',
overflow: 'hidden',
padding: '10px'
}
};
}
}
};

View File

@ -1,185 +1,161 @@
<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 } from 'vue';
import { formProps, formEventConfigs } from './config';
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
import { addFormChangeRecordItem, getFormChangeRecordItem, updateFormChangeRecordItem } from '/@/api/formChange/changeLogDetail';
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 { reactive, ref, onMounted } from 'vue';
import { formProps, formEventConfigs } from './config';
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
import { addFormChangeRecordItem, getFormChangeRecordItem, updateFormChangeRecordItem } from '/@/api/formChange/changeLogDetail';
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 { 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); //表单事件:加载表单
const RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds', 'loadingCompleted', 'form-mounted']);
const props = defineProps({
fromPage: {
type: Number,
default: FromPageType.MENU
}
emits('form-mounted', formProps);
} catch (error) {
});
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!);
}
});
// 根据菜单页面权限,设置表单属性(必填,禁用,显示)
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;
});
// 校验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 {
}
} finally {
return values;
}
return values;
}
// 根据行唯一ID查询行数据并设置表单数据 【编辑】
async function setFormDataFromId(rowId, skipUpdate) {
try {
const record = await getFormChangeRecordItem(rowId);
if (skipUpdate) {
// 根据行唯一ID查询行数据并设置表单数据 【编辑】
async function setFormDataFromId(rowId, skipUpdate) {
try {
const record = await getFormChangeRecordItem(rowId);
if (skipUpdate) {
return record;
}
setFieldsValue(record);
state.formModel = record;
await getFormDataEvent(formEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据
return record;
}
setFieldsValue(record);
state.formModel = record;
await getFormDataEvent(formEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据
return record;
} catch (error) {
} 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 updateFormChangeRecordItem(values);
await submitFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:提交表单
return saveVal;
} catch (error) {
// 辅助设置表单数据
function setFieldsValue(record) {
systemFormRef.value.setFieldsValue(record);
}
}
// 新增api表单数据
async function add(values) {
try {
state.formModel = values;
let saveVal = await addFormChangeRecordItem(values);
await submitFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:提交表单
return saveVal;
} catch (error) {
// 重置表单数据
async function resetFields() {
await systemFormRef.value.resetFields();
}
}
// 根据工作流页面权限,设置表单属性(必填,禁用,显示)
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;
setFieldsValue(formModels);
} catch (error) {
// 设置表单数据全部为Disabled 【查看】
async function setDisabledForm() {
data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas));
}
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,
});
// 获取行键值
function getRowKey() {
return RowKey;
}
// 更新api表单数据
async function update({ values, rowId }) {
try {
values[RowKey] = rowId;
state.formModel = values;
let saveVal = await updateFormChangeRecordItem(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 addFormChangeRecordItem(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;
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>

View File

@ -30,310 +30,294 @@
</template>
<script lang="ts" setup>
import {
ref, computed, onMounted, onUnmounted, createVNode,
provide,
import { ref, computed, onMounted, onUnmounted, createVNode, provide } from 'vue';
} from 'vue';
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getFormChangeRecordItemPage, deleteFormChangeRecordItem } from '/@/api/formChange/changeLogDetail';
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 { getFormChangeRecordItem } from '/@/api/formChange/changeLogDetail';
import DiffDetailModal from './components/DiffDetailModal.vue';
// import LookTask from '/@/views/workflow/task/components/flow/ChangeLookTask.vue';
import { getRecordDetail } from '/@/api/formChange/changeLogDetail/index';
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getFormChangeRecordItemPage, deleteFormChangeRecordItem } from '/@/api/formChange/changeLogDetail';
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 { getFormChangeRecordItem } from '/@/api/formChange/changeLogDetail';
import DiffDetailModal from './components/DiffDetailModal.vue'
// import LookTask from '/@/views/workflow/task/components/flow/ChangeLookTask.vue';
import { getRecordDetail } from '/@/api/formChange/changeLogDetail/index'
import { useModal } from '/@/components/Modal';
import ChangeLogDetailModal from './components/ChangeLogDetailModal.vue';
import { useModal } from '/@/components/Modal';
import { searchFormSchema, columns } from './components/config';
import Icon from '/@/components/Icon/index';
import useEventBus from '/@/hooks/event/useEventBus';
import ChangeLogDetailModal from './components/ChangeLogDetailModal.vue';
let props = withDefaults(
defineProps<{
processId: string | undefined;
taskId: string | undefined;
recordId: string;
}>(),
{
processId: '',
taskId: '',
recordId: '123456789-987654321'
}
);
const recordList = [
{ oldValue: 'old111', filedCode: 'totalContractAmount', changeType: 'update' },
{ oldValue: 'old222', filedCode: 'totalInvoiceAmount', changeType: 'add' }
];
provide('recordList', recordList);
import { searchFormSchema, columns } from './components/config';
import Icon from '/@/components/Icon/index';
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
const { notification } = useMessage();
const { t } = useI18n();
defineEmits(['register']);
const { filterColumnAuth, filterButtonAuth } = usePermission();
import useEventBus from '/@/hooks/event/useEventBus';
const filterColumns = filterColumnAuth(columns);
const tableRef = ref();
let props = withDefaults(
defineProps<{
processId: string | undefined;
taskId: string | undefined;
recordId: string;
}>(),
{
processId: '',
taskId: '',
recordId: '123456789-987654321'
},
);
//展示在列表内的按钮
const actionButtons = ref<string[]>(['view', 'edit', 'copyData', 'delete', 'startwork', 'flowRecord']);
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: 'view', icon: 'ant-design:eye-outlined', isDefault: true },
{
isUse: true,
name: '查看详情',
code: 'detail',
icon: 'ant-design:eye-outlined',
isDefault: true
},
{ isUse: true, name: '删除', code: 'delete', icon: 'ant-design:delete-outlined', isDefault: true }
];
return filterButtonAuth(list);
});
const recordList = [{ 'oldValue': 'old111', 'filedCode': 'totalContractAmount', 'changeType': 'update' }, { 'oldValue': 'old222', 'filedCode': 'totalInvoiceAmount', 'changeType': 'add' }];
provide('recordList', recordList);
const tableButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
});
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
const actionButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
});
const { notification } = useMessage();
const { t } = useI18n();
defineEmits(['register']);
const { filterColumnAuth, filterButtonAuth } = usePermission();
// const btnEvent = { add: handleAdd, edit: handleEdit, refresh: handleRefresh, view: handleView, detail: handleDetail, delete: handleDelete, }
const btnEvent = { add: handleAdd, edit: handleEdit, refresh: handleRefresh, view: handleView, delete: handleDelete };
const filterColumns = filterColumnAuth(columns);
const tableRef = ref();
const { currentRoute } = useRouter();
const router = useRouter();
//展示在列表内的按钮
const actionButtons = ref<string[]>(['view', 'edit', 'copyData', 'delete', 'startwork', 'flowRecord']);
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": "view", "icon": "ant-design:eye-outlined", "isDefault": true }, {
"isUse": true,
"name": "查看详情",
"code": "detail",
"icon": "ant-design:eye-outlined",
"isDefault": true
}, { "isUse": true, "name": "删除", "code": "delete", "icon": "ant-design:delete-outlined", "isDefault": true }]
return filterButtonAuth(list);
})
const formIdComputedRef = ref();
formIdComputedRef.value = currentRoute.value.meta.formId;
const schemaIdComputedRef = ref();
schemaIdComputedRef.value = currentRoute.value.meta.schemaId;
const tableButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
});
const [registerModal, { openModal }] = useModal();
const actionButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
});
// const btnEvent = { add: handleAdd, edit: handleEdit, refresh: handleRefresh, view: handleView, detail: handleDetail, delete: handleDelete, }
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
const schemaIdComputedRef = ref();
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
const [registerModal, { openModal }] = useModal();
const formName = '变更日志详情';
const [registerTable, { reload, }] = useTable({
title: '' || (formName + '列表'),
api: getFormChangeRecordItemPage,
rowKey: 'id',
columns: filterColumns,
formConfig: {
rowProps: {
gutter: 16,
const formName = '变更日志详情';
const [registerTable, { reload }] = useTable({
title: '' || formName + '列表',
api: getFormChangeRecordItemPage,
rowKey: 'id',
columns: filterColumns,
formConfig: {
rowProps: {
gutter: 16
},
schemas: searchFormSchema,
fieldMapToTime: [],
showResetButton: false
},
schemas: searchFormSchema,
fieldMapToTime: [],
showResetButton: false,
},
beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
},
afterFetch: (res) => {
tableRef.value.setToolBarWidth();
beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
},
afterFetch: (res) => {
tableRef.value.setToolBarWidth();
},
useSearchForm: true,
showTableSetting: true,
},
useSearchForm: true,
showTableSetting: true,
striped: false,
actionColumn: {
width: 160,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
},
tableSetting: {
size: false,
setting: false,
},
});
function dbClickRow(record) {
const { processId, taskIds, schemaId } = record.workflowData || {};
if (taskIds && taskIds.length) {
router.push({
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
query: {
taskId: taskIds[0],
formName: formName
}
});
} else if (schemaId && !taskIds && processId) {
router.push({
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
query: {
readonly: 1,
taskId: '',
formName: formName
}
});
} else {
router.push({
path: '/form/changeLogDetail/' + record.id + '/viewForm',
query: {
formPath: 'formChange/changeLogDetail',
formName: formName
}
});
}
}
function buttonClick(code) {
btnEvent[code]();
}
function handleAdd() {
if (schemaIdComputedRef.value) {
router.push({
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow'
});
} else {
router.push({
path: '/form/changeLogDetail/0/createForm',
query: {
formPath: 'formChange/changeLogDetail',
formName: formName
}
});
}
}
function handleEdit(record: Recordable) {
router.push({
path: '/form/changeLogDetail/' + record.id + '/updateForm',
query: {
formPath: 'formChange/changeLogDetail',
formName: formName
striped: false,
actionColumn: {
width: 160,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' }
},
tableSetting: {
size: false,
setting: false
}
});
}
function handleDelete(record: Recordable) {
deleteList([record.id]);
}
function deleteList(ids) {
Modal.confirm({
title: '提示信息',
icon: createVNode(ExclamationCircleOutlined),
content: '是否确认删除?',
okText: '确认',
cancelText: '取消',
onOk() {
deleteFormChangeRecordItem(ids).then((_) => {
handleSuccess();
notification.success({
message: 'Tip',
description: t('删除成功!'),
});
function dbClickRow(record) {
const { processId, taskIds, schemaId } = record.workflowData || {};
if (taskIds && taskIds.length) {
router.push({
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
query: {
taskId: taskIds[0],
formName: formName
}
});
} else if (schemaId && !taskIds && processId) {
router.push({
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
query: {
readonly: 1,
taskId: '',
formName: formName
}
});
},
onCancel() {
},
});
}
function handleRefresh() {
reload();
}
function handleSuccess() {
reload();
}
function handleView(record: Recordable) {
dbClickRow(record);
}
onMounted(() => {
if (schemaIdComputedRef.value) {
bus.on(FLOW_PROCESSED, handleRefresh);
bus.on(CREATE_FLOW, handleRefresh);
} else {
bus.on(FORM_LIST_MODIFIED, handleRefresh);
}
// getRecordDetail({ 'recordId': props.recordId }).then(res => {
// provide('recordList', res.list);
// })
});
onUnmounted(() => {
if (schemaIdComputedRef.value) {
bus.off(FLOW_PROCESSED, handleRefresh);
bus.off(CREATE_FLOW, handleRefresh);
} else {
bus.off(FORM_LIST_MODIFIED, handleRefresh);
}
});
function getActions(record: Recordable): ActionItem[] {
const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => {
if (!record.workflowData?.processId) {
return {
icon: button?.icon,
tooltip: button?.name,
color: button.code === 'delete' ? 'error' : undefined,
onClick: btnEvent[button.code].bind(null, record),
};
} else {
if (button.code === 'view') {
router.push({
path: '/form/changeLogDetail/' + record.id + '/viewForm',
query: {
formPath: 'formChange/changeLogDetail',
formName: formName
}
});
}
}
function buttonClick(code) {
btnEvent[code]();
}
function handleAdd() {
if (schemaIdComputedRef.value) {
router.push({
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow'
});
} else {
router.push({
path: '/form/changeLogDetail/0/createForm',
query: {
formPath: 'formChange/changeLogDetail',
formName: formName
}
});
}
}
function handleEdit(record: Recordable) {
router.push({
path: '/form/changeLogDetail/' + record.id + '/updateForm',
query: {
formPath: 'formChange/changeLogDetail',
formName: formName
}
});
}
function handleDelete(record: Recordable) {
deleteList([record.id]);
}
function deleteList(ids) {
Modal.confirm({
title: '提示信息',
icon: createVNode(ExclamationCircleOutlined),
content: '是否确认删除?',
okText: '确认',
cancelText: '取消',
onOk() {
deleteFormChangeRecordItem(ids).then((_) => {
handleSuccess();
notification.success({
message: 'Tip',
description: t('删除成功!')
});
});
},
onCancel() {}
});
}
function handleRefresh() {
reload();
}
function handleSuccess() {
reload();
}
function handleView(record: Recordable) {
dbClickRow(record);
}
onMounted(() => {
if (schemaIdComputedRef.value) {
bus.on(FLOW_PROCESSED, handleRefresh);
bus.on(CREATE_FLOW, handleRefresh);
} else {
bus.on(FORM_LIST_MODIFIED, handleRefresh);
}
// getRecordDetail({ 'recordId': props.recordId }).then(res => {
// provide('recordList', res.list);
// })
});
onUnmounted(() => {
if (schemaIdComputedRef.value) {
bus.off(FLOW_PROCESSED, handleRefresh);
bus.off(CREATE_FLOW, handleRefresh);
} else {
bus.off(FORM_LIST_MODIFIED, handleRefresh);
}
});
function getActions(record: Recordable): ActionItem[] {
const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => {
if (!record.workflowData?.processId) {
return {
icon: button?.icon,
tooltip: button?.name,
onClick: btnEvent[button.code].bind(null, record),
color: button.code === 'delete' ? 'error' : undefined,
onClick: btnEvent[button.code].bind(null, record)
};
} else {
return {};
if (button.code === 'view') {
return {
icon: button?.icon,
tooltip: button?.name,
onClick: btnEvent[button.code].bind(null, record)
};
} else {
return {};
}
}
}
});
return actionsList;
}
});
return actionsList;
}
</script>
<style lang="less" scoped>
:deep(.ant-table-selection-col) {
width: 50px;
}
:deep(.ant-table-selection-col) {
width: 50px;
}
.show {
display: flex;
}
.show {
display: flex;
}
.hide {
display: none !important;
}
.hide {
display: none !important;
}
</style>