mirror of
				https://github.com/continew-org/continew-admin.git
				synced 2025-10-31 00:57:13 +08:00 
			
		
		
		
	refactor: 消除前端红色报警、更新表格创建者和更新者字段索引,自定义单选框数据 (#108)
This commit is contained in:
		| @@ -11,6 +11,7 @@ export interface ${classNamePrefix}Resp { | |||||||
| </#list> | </#list> | ||||||
|   createUserString: string |   createUserString: string | ||||||
|   updateUserString: string |   updateUserString: string | ||||||
|  |   disabled: boolean | ||||||
| </#if> | </#if> | ||||||
| } | } | ||||||
| export interface ${classNamePrefix}DetailResp { | export interface ${classNamePrefix}DetailResp { | ||||||
| @@ -26,7 +27,7 @@ export interface ${classNamePrefix}Query { | |||||||
| <#if fieldConfigs??> | <#if fieldConfigs??> | ||||||
| <#list fieldConfigs as fieldConfig> | <#list fieldConfigs as fieldConfig> | ||||||
|   <#if fieldConfig.showInQuery> |   <#if fieldConfig.showInQuery> | ||||||
|   ${fieldConfig.fieldName}: string |   ${fieldConfig.fieldName}: string | undefined | ||||||
|   </#if> |   </#if> | ||||||
| </#list> | </#list> | ||||||
| </#if> | </#if> | ||||||
| @@ -61,5 +62,5 @@ export function delete${classNamePrefix}(id: string) { | |||||||
|  |  | ||||||
| /** @desc 导出${businessName} */ | /** @desc 导出${businessName} */ | ||||||
| export function export${classNamePrefix}(query: ${classNamePrefix}Query) { | export function export${classNamePrefix}(query: ${classNamePrefix}Query) { | ||||||
|   return http.download<any>(`${'$'}{BASE_URL}/export`, query) |   return http.download(`${'$'}{BASE_URL}/export`, query) | ||||||
| } | } | ||||||
|   | |||||||
| @@ -26,7 +26,7 @@ | |||||||
|           @change="search" |           @change="search" | ||||||
|         /> |         /> | ||||||
| 	  <#elseif fieldConfig.formType == "RADIO"><#-- 单选框 --> | 	  <#elseif fieldConfig.formType == "RADIO"><#-- 单选框 --> | ||||||
| 		<a-radio-group v-model="queryForm.${fieldConfig.fieldName}" :options="${fieldConfig.dictCode}" @change="search"/> | 		<a-radio-group v-model="queryForm.${fieldConfig.fieldName}" :options="${fieldConfig.dictCode!'dictKey 或者自定义数组'}" @change="search"/> | ||||||
| 	  <#elseif fieldConfig.formType == "DATE"><#-- 日期框 --> | 	  <#elseif fieldConfig.formType == "DATE"><#-- 日期框 --> | ||||||
|         <#if fieldConfig.queryType == "BETWEEN"> |         <#if fieldConfig.queryType == "BETWEEN"> | ||||||
|         <DateRangePicker v-model="queryForm.${fieldConfig.fieldName}" format="YYYY-MM-DD" @change="search" /> |         <DateRangePicker v-model="queryForm.${fieldConfig.fieldName}" format="YYYY-MM-DD" @change="search" /> | ||||||
| @@ -135,13 +135,19 @@ const { | |||||||
|   search, |   search, | ||||||
|   handleDelete |   handleDelete | ||||||
| } = useTable((page) => list${classNamePrefix}({ ...queryForm, ...page }), { immediate: true }) | } = useTable((page) => list${classNamePrefix}({ ...queryForm, ...page }), { immediate: true }) | ||||||
| const columns: TableInstanceColumns[] = [ | const columns = ref<TableInstanceColumns[]>([ | ||||||
| <#if fieldConfigs??> | <#if fieldConfigs??> | ||||||
|   <#list fieldConfigs as fieldConfig> |   <#list fieldConfigs as fieldConfig> | ||||||
|   <#if fieldConfig.showInList> |   <#if fieldConfig.showInList> | ||||||
|  |    <#if fieldConfig.fieldName=="createUser" > | ||||||
|  |   { title: '${fieldConfig.comment}', dataIndex: 'createUserString', slotName: '${fieldConfig.fieldName}' }, | ||||||
|  |    <#elseif fieldConfig.fieldName=="updateUser"  > | ||||||
|  |   { title: '${fieldConfig.comment}', dataIndex: 'updateUserString', slotName: '${fieldConfig.fieldName}' }, | ||||||
|  |   <#else> | ||||||
|   { title: '${fieldConfig.comment}', dataIndex: '${fieldConfig.fieldName}', slotName: '${fieldConfig.fieldName}' }, |   { title: '${fieldConfig.comment}', dataIndex: '${fieldConfig.fieldName}', slotName: '${fieldConfig.fieldName}' }, | ||||||
|   </#if> |   </#if> | ||||||
|   </#list> | </#if> | ||||||
|  | </#list> | ||||||
| </#if> | </#if> | ||||||
|   { |   { | ||||||
|     title: '操作', |     title: '操作', | ||||||
| @@ -152,7 +158,7 @@ const columns: TableInstanceColumns[] = [ | |||||||
|     fixed: !isMobile() ? 'right' : undefined, |     fixed: !isMobile() ? 'right' : undefined, | ||||||
|     show: has.hasPermOr(['${apiModuleName}:${apiName}:detail', '${apiModuleName}:${apiName}:update', '${apiModuleName}:${apiName}:delete']) |     show: has.hasPermOr(['${apiModuleName}:${apiName}:detail', '${apiModuleName}:${apiName}:update', '${apiModuleName}:${apiName}:delete']) | ||||||
|   } |   } | ||||||
| ] | ]); | ||||||
|  |  | ||||||
| // 重置 | // 重置 | ||||||
| const reset = () => { | const reset = () => { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 luoqiz
					luoqiz