Compare commits

...

2 Commits

Author SHA1 Message Date
刘妍 b13705a705 Merge branch 'main' of http://123.132.248.154:10000/HC_YFZX/CaiYuanYiTiHua 2024-05-30 17:02:07 +08:00
刘妍 88d6efd626 问题优化 2024-05-30 17:02:01 +08:00
9 changed files with 59 additions and 32 deletions

View File

@ -6,6 +6,8 @@
:columns="subTableColumns"
:data-source="subTableList"
:pagination="false"
v-if="subTableId"
:scroll="{ x: 3000, y: 300 }"
>
<template #headerCell="{ column, record }">
<template v-if="column.key === 'setting'">
@ -66,6 +68,8 @@
{
dataIndex: 'setting',
key: 'setting',
fixed: 'left',
width: 60,
},
];

View File

@ -147,8 +147,8 @@
function tableHandleOk() {
console.log(tableRef.value.getRow());
const obj = tableRef.value.getRow();
formData.value.table = obj[0].name;
handleTableChange(obj[0].name);
formData.value.table = obj[0].tableName;
handleTableChange(obj[0].tableName);
data.tableOpen = false;
}
//

View File

@ -113,7 +113,7 @@
v-else
>
<template #bodyCell="{ column, record }">
<template v-if="['label', 'field'].includes(column.dataIndex)">
<template v-if="['label', 'fieldName'].includes(column.dataIndex)">
<div>
<a-input v-model:value="record[column.dataIndex]" placeholder="请输入" />
</div>
@ -200,7 +200,7 @@
},
{
title: '字段',
dataIndex: 'field',
dataIndex: 'fieldName',
},
{
title: '必填',
@ -352,10 +352,12 @@
obj.componentProps.disabled = true;
obj.disabled = true;
obj.ifShow = true;
obj.fieldName = element.componentProps.fieldName;
fields.push(obj);
}
},
);
console.log(fields);
data.formRelations = rfields;
if (isChange) {
node.value.authFields = fields;

View File

@ -227,7 +227,7 @@
v-if="node.formType == 1"
>
<template #bodyCell="{ column, text, record }">
<template v-if="['label', 'field'].includes(column.dataIndex)">
<template v-if="['label', 'fieldName'].includes(column.dataIndex)">
<div>
{{ text }}
</div>
@ -247,7 +247,7 @@
v-else
>
<template #bodyCell="{ column, record }">
<template v-if="['label', 'field'].includes(column.dataIndex)">
<template v-if="['label', 'fieldName'].includes(column.dataIndex)">
<div>
<a-input v-model:value="record[column.dataIndex]" placeholder="请输入" />
</div>
@ -574,7 +574,7 @@
},
{
title: '字段',
dataIndex: 'field',
dataIndex: 'fieldName',
},
{
title: '必填',
@ -874,6 +874,7 @@
obj.componentProps.disabled = true;
obj.disabled = true;
obj.ifShow = true;
obj.fieldName = element.componentProps.fieldName;
fields.push(obj);
}
},

View File

@ -4,36 +4,36 @@
</div>
</template>
<script lang="ts" setup>
import { reactive, defineProps ,watch} from 'vue';
import { getTableList } from '@/api/sys/flowPenal'
import { reactive, defineProps, watch } from 'vue';
import { getDataBaseTableList } from '@/api/formdesign';
import { BasicTable, useTable, TableAction } from '@/components/Table';
defineOptions({ name: 'RoleManagement' });
const props = defineProps({
dbCode: String
})
const searchInfo = reactive < Recordable > ({
code: props.dbCode
dbCode: String,
});
const searchInfo = reactive<Recordable>({
dbCode: props.dbCode,
});
watch(
() => props.dbCode,
(newVal, oldVal) => {
searchInfo.code = newVal
reload()
}
)
searchInfo.dbCode = newVal;
reload();
},
);
const [registerTable, { reload, getSelectRows, clearSelectedRowKeys }] = useTable({
//
title: '数据表列表',
//
api: getTableList,
api: getDataBaseTableList,
// BasicColumn[]
columns: [
{
title: '表名',
dataIndex: 'name',
dataIndex: 'tableName',
width: 200,
},
{
@ -42,7 +42,18 @@
width: 180,
},
],
rowKey: 'name',
formConfig: {
labelWidth: 80,
schemas: [
{
field: 'key',
label: '关键字',
component: 'Input',
colProps: { span: 8 },
},
],
},
rowKey: 'tableName',
// 使
useSearchForm: false,
//
@ -52,7 +63,8 @@
//
showIndexColumn: false,
//
rowSelection: {//
rowSelection: {
//
type: 'radio',
},
tableSetting: { fullScreen: true },
@ -65,16 +77,15 @@
function getRow() {
let rows = getSelectRows();
return rows
return rows;
}
defineExpose({
getRow
})
getRow,
});
</script>
<style scoped>
.div-box{
.div-box {
display: flex;
height: 100%;
}
</style>
</style>

View File

@ -6,6 +6,8 @@
:data-source="subTableList"
:pagination="false"
style="width: 100%"
v-if="subTableId"
:scroll="{ x: 3000, y: 300 }"
>
<template #headerCell="{ column, record }">
<template v-if="column.key === 'setting'">
@ -92,6 +94,8 @@
{
dataIndex: 'setting',
key: 'setting',
fixed: 'left',
width: 60,
},
]);
let subTableId = ref(null);

View File

@ -8,7 +8,7 @@
:showOkBtn="!isDetail"
:title="getTitle"
@ok="ModalSureClick"
width="60%"
width="80%"
>
<BasicForm ref="myDataBaseFormRef" @register="registerForm" v-if="formModalVisible" />
<a-table
@ -16,6 +16,8 @@
:columns="subTableColumns"
:data-source="subTableList"
:pagination="false"
v-if="subTableId"
:scroll="{ x: 3000, y: 300 }"
>
<template #headerCell="{ column, record }">
<template v-if="column.key === 'setting'">
@ -90,6 +92,8 @@
{
dataIndex: 'setting',
key: 'setting',
fixed: 'left',
width: 60,
},
];
@ -168,7 +172,6 @@
let keyValue = uuidv4();
let emptyItem = { key: keyValue };
subTableData.value.map((item) => {
console.log(item);
if (item.component == 'InputGuid') {
emptyItem[item.field] = keyValue;
} else {
@ -179,7 +182,6 @@
subTableList.value.push(emptyItem);
};
const delListItem = (column, record) => {
console.log(column, record);
subTableList.value = subTableList.value.filter((item) => item.key != record.key);
};

View File

@ -12,6 +12,8 @@
:data-source="subTableList"
:pagination="false"
:customRow="customRow"
v-if="subTableId"
:scroll="{ x: 3000, y: 300 }"
>
<template #headerCell="{ column, record }">
<template v-if="column.key === 'setting'">
@ -71,6 +73,8 @@
{
dataIndex: 'setting',
key: 'setting',
fixed: 'left',
width: 60,
},
]);
const subTableData = ref([]);

View File

@ -158,7 +158,6 @@
function getForm() {
const formData = modalFrom_formData.value.formData;
const config = modalDesign_config.value.config;
console.log('config', config)
//
let formModuleEntity: any = {};
formModuleEntity = formData;
@ -170,7 +169,7 @@
// sysModule
let sysModule: any = {};
sysModule.id = '';
sysModule.id = formData.moduleId ? formData.moduleId : '';
sysModule.cascadeId = '';
sysModule.name = formData.name;
sysModule.parentId = formData.pmoduleId;