a-table单元格指定合并以及表格双击编辑以及未填写指定验证功能

a-table单元格指定合并以及表格双击编辑以及未填写指定验证功能

一、 a-table单元格指定合并

1. a-table

				<a-table
					ref="table"
					:pagination="{
   
						position: ['none']
					}"
					:columns="columns"
					:dataSource="tableData"
					:alert="false"
					:row-key="(record) => record.id"
					bordered
				>
				</a-table>

2. columns

columns.value = [
			{
   
				title: '序号',
				dataIndex: 'index',
				align: 'center',
				width: '300px',
				customRender: function ({
     text, record, index }) {
   
					if (record.objectName === '单元测评结果(符合/部分符合/不符合/不适用)') {
   
						return record.objectName
					} else {
   
						return index + 1
					}
				},
				customCell: (data, index) => {
   
					if (data.objectName === '单元测评结果(符合/部分符合/不符合/不适用)') {
   
						return {
   
							colSpan: 2
						}
					} else {
   
						return {
    colSpan: 1 }
					}
				}
			},
			{
   
				title: '测评对象',
				dataIndex: 'objectName',
				align: 'center',
				width: '300px',
				customCell: (data, index) => {
   
					if (data.objectName === '单元测评结果(符合/部分符合/不符合/不适用)') {
   
						return {
   
							colSpan: 0
						}
					} else {
   
						return {
    colSpan: 1 }
					}
				}
			},
			{
   
				title: '测评指标符合情况(符合/部分符合/不符合/不适用)',
				dataIndex: 'content1',
				align: 'center',
				width: '300px',
				children: [
					{
   
						title: '身份鉴别',
						dataIndex: '9',
						align: 'center',
						width: '300px'
					},
					{
   
						title: '远程管理通道安全',
						dataIndex: '10',
						align: 'center',
						width: '300px'
					},
					{
   
						title: '系统资源访问控制信息完整性',
						dataIndex: '11',
						align: 'center',
						width: '300px'
					},
					{
   
						title: '重要信息资源安全标记完整性',
						dataIndex: '12',
						align: 'center',
						width: '300px'
					},
					{
   
						title: '日志记录完整性',
						dataIndex: '13',
						align: 'center',
						width: '300px'
					},
					{
   
						title: '重要可执行程序完整性、重要可执行程序来源真实性',
						dataIndex: '14',
						align: 'center',
						width: '300px'
					}
				]
			}
		]

3. 图例

在这里插入图片描述

二、a-table 表格双击编辑以及未填写验证

1. a-table

		<a-table
			style="width: 100%"
			bordered
			:dataSource="tableData"
			ref="selection"
			:pagination="false"
			:columns="columns"
			:customRow="Rowclick"
			:row-key="(record) => record.evaluationEnvironmentId"
			:class="{ 'no-hover': disableHover }"
		>
			<template #bodyCell="{ column, index, record }">
				<template v-if="column.key === 'handle'">
					<a-space>
						<a-button type="primary" danger @click="onDelete(record, index)" :disabled="isReview"> 删除 </a-button>
						<a-button
							type="primary"
							@click="getModifications(record, index)"
							:disabled="isReview"
							v-if="record.checkState == '0' || !record.checkState"
							style="background: rgb(183 175 175); border: none"
						>
							后续修改
						</a-button>
						<a-button
							type="primary"
							@click="getModifications(record, index)"
							:disabled="isReview"
							v-if="record.checkState == '1'"
							style="background: #f88f5e; border: none"
						>
							后续修改
							<CloseCircleFilled />
						</a-button>
					</a-space>
				</template>
			</template>
		</a-table>

2. js

子组件内容

//双击编辑

const Rowclick = (columns, index, record) => {
   
		return {
   
			onClick: (event) => {
   
				if (!isReview) {
   
				//isReview为验证在什么条件下可以编辑/不可以编辑
					if (
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Coisini_甜柚か

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值