<template>
|
<app-dialog-form
|
v-bind="dialogFormProps"
|
>
|
<app-layout-row top="-13">
|
<app-tab-wrapper v-bind="tabWrapperProps">
|
<template #property="scope">
|
<property-table
|
v-bind="tableProps"
|
:options="options"
|
/>
|
</template>
|
<template #flow="scope">
|
<flow-table
|
v-bind="tableProps"
|
/>
|
</template>
|
</app-tab-wrapper>
|
</app-layout-row>
|
</app-dialog-form>
|
</template>
|
|
<script setup>
|
import FlowTable from './FlowTable';
|
import PropertyTable from './PropertyTable';
|
import {useEntityStore, useAppStore} from '@/store/modules';
|
import {meta} from '@/hooks';
|
|
const {useMetaData} = meta;
|
|
const tableSearchRef = ref();
|
const tableProRef = ref();
|
const entityStore = useEntityStore();
|
const appStore = useAppStore();
|
|
const props = defineProps({
|
subSubmit: {
|
type: Function,
|
default: () => {
|
}
|
},
|
});
|
|
let options;
|
|
const tableRef = ref();
|
|
const tableProps = {
|
ref: tableRef,
|
}
|
|
const tabWrapperRef = ref();
|
|
const tabWrapperProps = {
|
tabList: [
|
{name: 'property', label: '业务参数'},
|
{name: 'flow', label: '流程参数'}
|
],
|
ref: tabWrapperRef
|
};
|
|
const dialogFormRef = ref();
|
|
const dialogFormProps = {
|
title: '请选择参数',
|
ref: dialogFormRef,
|
resetDom: false,
|
subSubmit: async () => {
|
const current = tableRef.value.getTableCurrent();
|
const active = tabWrapperRef.value.getActive();
|
|
if (active === 'property') {
|
props.subSubmit({name: `业务参数.${current.label_chinese}`});
|
}
|
if (active === 'flow') {
|
props.subSubmit({name: `流程.${current.value}`});
|
}
|
|
}
|
};
|
|
const onOpen = async (_options) => {
|
options = _options || {};
|
dialogFormRef.value.onOpen();
|
await nextTick();
|
tabWrapperProps.tabList = [
|
{name: 'property', label: '业务参数'},
|
options.has_flow === 'T' ? {name: 'flow', label: '流程参数'} : null
|
].filter(Boolean);
|
if(options.has_flow !== 'T') {
|
tabWrapperRef.value.setActive('property');
|
}
|
tabWrapperRef.value.$forceUpdate(tabWrapperProps);
|
}
|
|
defineExpose({
|
onOpen
|
});
|
|
</script>
|