fix: 新增删除字段
This commit is contained in:
		
							parent
							
								
									030c84dc65
								
							
						
					
					
						commit
						01023fc14b
					
				| @ -127,9 +127,13 @@ | |||||||
|               >取消</a-button |               >取消</a-button | ||||||
|               > |               > | ||||||
|             </a-space> |             </a-space> | ||||||
|             <a-button v-else type="link" @click="handleEdit(record)" |             <div v-else> | ||||||
|             >修改</a-button |               <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> | ||||||
|         </template> |         </template> | ||||||
|       </a-table> |       </a-table> | ||||||
| @ -177,7 +181,7 @@ import { | |||||||
|   getFieldTypeSelect, |   getFieldTypeSelect, | ||||||
|   getFieldNumSelect, |   getFieldNumSelect, | ||||||
|   getFieldList, |   getFieldList, | ||||||
|   // deleteField, |   deleteField, | ||||||
|   saveField, |   saveField, | ||||||
|   // getFieldDetail, |   // getFieldDetail, | ||||||
| } from "@/views/config-manage/module-cfg/service"; | } 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) => { | const handleCancel = (record) => { | ||||||
|   if (typeof record.field_id === "string") { |   if (typeof record.field_id === "string") { | ||||||
|     dataList.value.shift(); |     dataList.value.shift(); | ||||||
| @ -382,4 +395,8 @@ const handleSave = (record) => { | |||||||
| .pagination-box { | .pagination-box { | ||||||
|   text-align: center; |   text-align: center; | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | :deep(.@{ant-prefix}-btn) { | ||||||
|  |   padding: 4px 8px; | ||||||
|  | } | ||||||
| </style> | </style> | ||||||
|  | |||||||
| @ -20,7 +20,7 @@ export const viewCfgCols = [ | |||||||
|   { dataIndex: 'is_other_database', title: '数据库特配', align: 'center'}, |   { dataIndex: 'is_other_database', title: '数据库特配', align: 'center'}, | ||||||
|   { dataIndex: 'original_type', title: '数据源类型', align: 'center'}, |   { dataIndex: 'original_type', title: '数据源类型', align: 'center'}, | ||||||
|   { dataIndex: 'original_sql', title: '数据源', align: 'center', width: 400}, |   { dataIndex: 'original_sql', title: '数据源', align: 'center', width: 400}, | ||||||
|   { dataIndex: 'action', title: '操作', align: 'center'}, |   { dataIndex: 'action', title: '操作', align: 'center', width: 120}, | ||||||
| ]; | ]; | ||||||
| 
 | 
 | ||||||
| export const originalTypes = [ | export const originalTypes = [ | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 sy2084
						sy2084