InputParamItem.vue
1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<template>
<div>
<a-card :title="`参数名称:${item.id}`" style="width: 540px; margin-top: -5px">
<template #extra>
<div style="display: flex; align-items: center">
<span style="color: #0170cc; cursor: pointer" @click="handleEdit">编辑</span>
<a-divider type="vertical" style="height: 12px; background-color: #d8d8d8" />
<span style="color: #0170cc; cursor: pointer" class="ml-1" @click="handleDelete"
>删除</span
>
</div>
</template>
</a-card>
</div>
</template>
<script lang="ts" setup>
import { FunctionJson } from '/@/api/device/model/modelOfMatterModel';
const emit = defineEmits(['delete', 'edit']);
type ItemRecrod = FunctionJson & { id: string };
const props = defineProps({
item: {
type: Object as PropType<ItemRecrod>,
required: true,
default: () => {},
},
});
const handleDelete = () => {
emit('delete', props.item);
};
const handleEdit = () => {
emit('edit', props.item);
};
const getFormData = () => {
return props.item;
};
defineExpose({
getFormData,
});
</script>
<style lang="less" scoped>
:deep(.ant-card-body) {
display: none !important;
}
</style>