fix: bug#11082
This commit is contained in:
parent
da00041536
commit
9a5436c94d
|
@ -1,10 +1,22 @@
|
|||
<template>
|
||||
<j-form class="table" ref="formTableRef" :model="modelRef">
|
||||
<j-table
|
||||
v-if="modelRef.dataSource.length !== 0"
|
||||
:dataSource="modelRef.dataSource"
|
||||
:columns="FormTableColumns"
|
||||
:scroll="{ x: 1000, y: 550 }"
|
||||
>
|
||||
<template #headerCell="{ column }">
|
||||
<template
|
||||
v-if="column.key === 'nodeId' || column.key === 'action'"
|
||||
>
|
||||
<span> {{ column.title }} </span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span> {{ column.title }} </span>
|
||||
<span style="margin-left: 5px; color: red">*</span>
|
||||
</template>
|
||||
</template>
|
||||
<template #bodyCell="{ column: { dataIndex }, record, index }">
|
||||
<template v-if="dataIndex === 'name'">
|
||||
<j-form-item
|
||||
|
@ -24,15 +36,20 @@
|
|||
</j-form-item>
|
||||
</template>
|
||||
<template v-if="dataIndex === 'id'">
|
||||
<j-form-item :name="['dataSource', index, 'id']">
|
||||
<j-form-item
|
||||
v-show="false"
|
||||
:name="['dataSource', index, 'id']"
|
||||
>
|
||||
<j-input
|
||||
v-model:value="record[dataIndex]"
|
||||
disabled
|
||||
:bordered="false"
|
||||
></j-input>
|
||||
</j-form-item>
|
||||
<div style="margin: -24px 0 0 10px">
|
||||
{{ record[dataIndex] }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-if="dataIndex === 'accessModes'">
|
||||
<j-form-item
|
||||
class="form-item"
|
||||
|
@ -163,12 +180,15 @@
|
|||
title="确认删除"
|
||||
@confirm="clickDelete(record.id)"
|
||||
>
|
||||
<a><AIcon type="DeleteOutlined" /></a>
|
||||
<a style="color: red"
|
||||
><AIcon type="DeleteOutlined"
|
||||
/></a>
|
||||
</j-popconfirm>
|
||||
</j-tooltip>
|
||||
</template>
|
||||
</template>
|
||||
</j-table>
|
||||
<j-empty v-else style="margin-top: 10%" />
|
||||
</j-form>
|
||||
</template>
|
||||
|
||||
|
@ -286,7 +306,20 @@ watch(
|
|||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.table {}
|
||||
.table {
|
||||
:deep(.ant-table-tbody) {
|
||||
.ant-table-cell {
|
||||
padding: 24px 0 0 0;
|
||||
}
|
||||
.ant-table-cell-fix-right-first {
|
||||
padding: 0 0 0 20px;
|
||||
}
|
||||
}
|
||||
:deep(.ant-pagination) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.form-item {
|
||||
display: flex;
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
:load-data="onLoadData"
|
||||
:tree-data="treeData"
|
||||
v-model:checkedKeys="checkedKeys"
|
||||
:selectedKeys="selectedKeys"
|
||||
:selectable="false"
|
||||
checkable
|
||||
@check="onCheck"
|
||||
:height="600"
|
||||
|
@ -26,7 +28,7 @@
|
|||
</span>
|
||||
</template>
|
||||
</j-tree>
|
||||
<j-empty v-else />
|
||||
<j-empty v-else style="margin-top: 22%" />
|
||||
</j-spin>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -216,13 +218,16 @@ watch(
|
|||
.tree-content {
|
||||
padding: 16px;
|
||||
padding-left: 0;
|
||||
min-width: 180px;
|
||||
.tree-header {
|
||||
margin-bottom: 16px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.tree-selected {
|
||||
color: #1d39c4;
|
||||
padding: 2px 5px;
|
||||
background-color: #d6e4ff;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.tree-title {
|
||||
color: black;
|
||||
|
|
|
@ -170,38 +170,39 @@ export const FormTableColumns = [
|
|||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
width: 200,
|
||||
width: 140,
|
||||
fixed: 'left',
|
||||
},
|
||||
{
|
||||
title: 'nodeId',
|
||||
dataIndex: 'id',
|
||||
key: 'id',
|
||||
width: 180,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '访问类型',
|
||||
dataIndex: 'accessModes',
|
||||
key: 'accessModes',
|
||||
width: 300,
|
||||
width: 260,
|
||||
},
|
||||
{
|
||||
title: '采集频率',
|
||||
key: 'interval',
|
||||
dataIndex: 'interval',
|
||||
width: 260,
|
||||
width: 220,
|
||||
},
|
||||
{
|
||||
title: '只推送变化的数据',
|
||||
key: 'features',
|
||||
dataIndex: 'features',
|
||||
width: 200,
|
||||
width: 160,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
dataIndex: 'action',
|
||||
fixed: 'right',
|
||||
width: 80,
|
||||
width: 60,
|
||||
},
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue