fix: 删除无用代码
This commit is contained in:
		
							parent
							
								
									f78a5001a7
								
							
						
					
					
						commit
						da56c2438b
					
				| @ -71,15 +71,6 @@ const currentChart = computed(() => { | |||||||
|   return props.chartCfg[chartType.value]; |   return props.chartCfg[chartType.value]; | ||||||
| }) | }) | ||||||
| 
 | 
 | ||||||
| watch( |  | ||||||
|   () => props.filterConfig, |  | ||||||
|   (newVal) => { |  | ||||||
|     // newVal.forEach((item) => { |  | ||||||
|     //   filterData.value[item.name] = undefined; |  | ||||||
|     // }); |  | ||||||
|   }, |  | ||||||
| ); |  | ||||||
| 
 |  | ||||||
| const toFilt = () => { | const toFilt = () => { | ||||||
|   const cloneFilter = _.cloneDeep(props.filterConfig); |   const cloneFilter = _.cloneDeep(props.filterConfig); | ||||||
|   const filter = cloneFilter |   const filter = cloneFilter | ||||||
|  | |||||||
| @ -87,16 +87,6 @@ const pageState = reactive({ | |||||||
|   perPage: 20, |   perPage: 20, | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| watch( |  | ||||||
|   () => props.filterConfig, |  | ||||||
|   (newVal) => { |  | ||||||
| 
 |  | ||||||
|     // newVal.forEach((item) => { |  | ||||||
|     //   filterData.value[item.name] = undefined; |  | ||||||
|     // }); |  | ||||||
|   } |  | ||||||
| ); |  | ||||||
| 
 |  | ||||||
| const getData = () => { | const getData = () => { | ||||||
|   const cloneFilter = _.cloneDeep(props.filterConfig); |   const cloneFilter = _.cloneDeep(props.filterConfig); | ||||||
|   const filter = cloneFilter |   const filter = cloneFilter | ||||||
|  | |||||||
| @ -126,10 +126,6 @@ watch( | |||||||
|   } |   } | ||||||
| ); | ); | ||||||
| 
 | 
 | ||||||
| // onMounted(() => { |  | ||||||
| //   toGetDbTable(); |  | ||||||
| // }); |  | ||||||
| 
 |  | ||||||
| const toGetDbTable = () => { | const toGetDbTable = () => { | ||||||
|   getDbTableSelect({ projectId: formData.value.project_id }).then((res) => { |   getDbTableSelect({ projectId: formData.value.project_id }).then((res) => { | ||||||
|     tableTypes.value = res.data; |     tableTypes.value = res.data; | ||||||
|  | |||||||
| @ -34,6 +34,7 @@ | |||||||
|             <a-input |             <a-input | ||||||
|               v-if="editableData[record.field_id]" |               v-if="editableData[record.field_id]" | ||||||
|               v-model:value="record[column.dataIndex]" |               v-model:value="record[column.dataIndex]" | ||||||
|  |               allow-clear | ||||||
|               placeholder="请输入" |               placeholder="请输入" | ||||||
|             /> |             /> | ||||||
|             <template v-else> |             <template v-else> | ||||||
| @ -46,6 +47,7 @@ | |||||||
|               v-model:value="record.field_numerical_type_id"  |               v-model:value="record.field_numerical_type_id"  | ||||||
|               :options="fieldNumTypeSel"  |               :options="fieldNumTypeSel"  | ||||||
|               placeholder="请选择" |               placeholder="请选择" | ||||||
|  |               allow-clear | ||||||
|               style="width: 160px"> |               style="width: 160px"> | ||||||
|             </a-select> |             </a-select> | ||||||
|             <template v-else> |             <template v-else> | ||||||
| @ -58,6 +60,7 @@ | |||||||
|               v-model:value="record.field_type_id" |               v-model:value="record.field_type_id" | ||||||
|               :options="fieldTypeSel" |               :options="fieldTypeSel" | ||||||
|               placeholder="请选择" |               placeholder="请选择" | ||||||
|  |               allow-clear | ||||||
|               style="width: 160px" |               style="width: 160px" | ||||||
|             > |             > | ||||||
|             </a-select> |             </a-select> | ||||||
| @ -223,22 +226,37 @@ const handleCancel = (record) => { | |||||||
| 
 | 
 | ||||||
| const handleSave = (record) => { | const handleSave = (record) => { | ||||||
|   const params = { |   const params = { | ||||||
|     field_id: record.field_id, |  | ||||||
|     field_title: record.field_title, |  | ||||||
|     field_name: record.field_name, |  | ||||||
|     field_numerical_type_id: record.field_numerical_type_id, |  | ||||||
|     is_search: record.is_search, |     is_search: record.is_search, | ||||||
|     field_type_id: record.field_type_id, |     field_type_id: record.field_type_id, | ||||||
|     belong_to_table: record.belong_to_table, |  | ||||||
|     original_sql: record.original_sql, |  | ||||||
|     modular_id: props.modularId, |     modular_id: props.modularId, | ||||||
|   }; |   }; | ||||||
|   if (typeof params.field_id === "string") { |   // 检验必填参数 | ||||||
|     // 新建 |   const validateFields = [ | ||||||
|     delete params.field_id; |     { field: 'field_title', msg: "请填写字段标题" }, | ||||||
|   } else { |     { field: 'field_name', msg: "请填写字段名称" }, | ||||||
|  |     { field: 'field_numerical_type_id', msg: "请选择字段类型" }, | ||||||
|  |     { field: 'belong_to_table', msg: "请填写关联表" }, | ||||||
|  |     { field: 'original_sql', msg: "请填写sql数据源" }, | ||||||
|  |   ] | ||||||
|  |   for(let i = 0; i < validateFields.length; i++) { | ||||||
|  |     const curr = validateFields[i]; | ||||||
|  |     if (!record[curr.field]) { | ||||||
|  |       message.error(curr.msg); | ||||||
|  |       return; | ||||||
|  |     } else { | ||||||
|  |       params[curr.field] = record[curr.field]; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   if (record.is_search && !record.field_type_id) { | ||||||
|  |     message.error("请选择搜索类型"); | ||||||
|  |     return; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   // 如果是编辑操作 | ||||||
|  |   if (typeof record.field_id === "number") { | ||||||
|     params.field_id = record.field_id; |     params.field_id = record.field_id; | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|   saveField(params).then(() => { |   saveField(params).then(() => { | ||||||
|     delete editableData[record.field_id]; |     delete editableData[record.field_id]; | ||||||
|     message.success("保存成功"); |     message.success("保存成功"); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 sy2084
						sy2084