fix: 新增删除字段

This commit is contained in:
sy2084 2024-10-30 10:54:56 +08:00
parent 030c84dc65
commit 01023fc14b
2 changed files with 22 additions and 5 deletions

View File

@ -127,9 +127,13 @@
>取消</a-button
>
</a-space>
<a-button v-else type="link" @click="handleEdit(record)"
>修改</a-button
>
<div v-else>
<a-button type="link" @click="handleEdit(record)">修改</a-button>
<a-popconfirm title="确定删除字段?" @confirm="handleDelete(record)">
<a-button type="link" danger>删除</a-button>
</a-popconfirm>
</div>
</template>
</template>
</a-table>
@ -177,7 +181,7 @@ import {
getFieldTypeSelect,
getFieldNumSelect,
getFieldList,
// deleteField,
deleteField,
saveField,
// getFieldDetail,
} from "@/views/config-manage/module-cfg/service";
@ -298,6 +302,15 @@ const handleEdit = (record) => {
};
};
const handleDelete = (record) => {
deleteField({
field_id: record.field_id,
}).then(() => {
message.success('删除成功')
toGetList();
})
}
const handleCancel = (record) => {
if (typeof record.field_id === "string") {
dataList.value.shift();
@ -382,4 +395,8 @@ const handleSave = (record) => {
.pagination-box {
text-align: center;
}
:deep(.@{ant-prefix}-btn) {
padding: 4px 8px;
}
</style>

View File

@ -20,7 +20,7 @@ export const viewCfgCols = [
{ dataIndex: 'is_other_database', title: '数据库特配', align: 'center'},
{ dataIndex: 'original_type', title: '数据源类型', align: 'center'},
{ dataIndex: 'original_sql', title: '数据源', align: 'center', width: 400},
{ dataIndex: 'action', title: '操作', align: 'center'},
{ dataIndex: 'action', title: '操作', align: 'center', width: 120},
];
export const originalTypes = [