|
@@ -13,7 +13,7 @@
|
|
|
<a-input
|
|
|
v-model:value="record[column.key]"
|
|
|
placeholder="输入接口地址"
|
|
|
- @change="handelInput(index, 1, record[column.key])"
|
|
|
+ @change="handelInput(index, 1, record[column.key], column.key)"
|
|
|
/>
|
|
|
</template>
|
|
|
</template>
|
|
@@ -22,7 +22,10 @@
|
|
|
<div style="height: 50%">
|
|
|
<BasicTable @register="registerTableItem">
|
|
|
<template #toolbar>
|
|
|
- <div> 删除、作废 url 填表名</div>
|
|
|
+ <div class="flex items-center">
|
|
|
+ <div> 删除、作废 url 填表名</div>
|
|
|
+ <a-button class="ml-4" type="dashed" @click="addDetailRow(2)"> 添加 </a-button>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<template #bodyCell="{ column, record, index }">
|
|
|
<template v-if="column.key === 'use'">
|
|
@@ -31,11 +34,18 @@
|
|
|
@change="handelChecked(index, 2, $event)"
|
|
|
/>
|
|
|
</template>
|
|
|
+ <template v-if="column.key === 'label'">
|
|
|
+ <a-input
|
|
|
+ v-model:value="record[column.key]"
|
|
|
+ placeholder="名称"
|
|
|
+ @change="handelInput(index, 2, record[column.key], column.key)"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
<template v-if="column.key === 'url'">
|
|
|
<a-input
|
|
|
v-model:value="record[column.key]"
|
|
|
placeholder="输入接口地址"
|
|
|
- @change="handelInput(index, 2, record[column.key])"
|
|
|
+ @change="handelInput(index, 2, record[column.key], column.key)"
|
|
|
/>
|
|
|
</template>
|
|
|
</template>
|
|
@@ -92,7 +102,7 @@
|
|
|
pagination: false,
|
|
|
});
|
|
|
|
|
|
- const [registerTableItem] = useTable({
|
|
|
+ const [registerTableItem, { setTableData: setTableDataItem }] = useTable({
|
|
|
title: '列表功能',
|
|
|
columns: columns,
|
|
|
dataSource: dataSourceItem,
|
|
@@ -112,11 +122,11 @@
|
|
|
dataSourceItem.value[index]['use'] = checked;
|
|
|
}
|
|
|
};
|
|
|
- const handelInput = (index: number, type: number, value: string) => {
|
|
|
+ const handelInput = (index: number, type: number, value: string, key: string) => {
|
|
|
if (type === 1) {
|
|
|
- dataSource.value[index]['url'] = value;
|
|
|
+ dataSource.value[index][key] = value;
|
|
|
} else {
|
|
|
- dataSourceItem.value[index]['url'] = value;
|
|
|
+ dataSourceItem.value[index][key] = value;
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -157,6 +167,21 @@
|
|
|
dataSourceItem.value = cloneDeep(buttonConfigs.item);
|
|
|
};
|
|
|
|
|
|
+ const addDetailRow = (type: number) => {
|
|
|
+ const newData: LedgerButtonItemConfigs = {
|
|
|
+ use: false,
|
|
|
+ label: '名称',
|
|
|
+ value: 'update',
|
|
|
+ url: '',
|
|
|
+ };
|
|
|
+ if (type === 1) {
|
|
|
+ dataSource.value.push(newData);
|
|
|
+ } else {
|
|
|
+ dataSourceItem.value.push(newData);
|
|
|
+ setTableDataItem([...dataSourceItem.value]);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
defineExpose({ validateStep, setTableData });
|
|
|
</script>
|
|
|
|