| | |
| | | } |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'fixtureName', |
| | | label: 'å·¥å
·åç§°', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'fixtureId', |
| | | label: 'å·¥å
·id', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | getPopupContainer, |
| | |
| | | <script setup lang="ts"> |
| | | import { computed, onMounted, ref } from 'vue'; |
| | | import { computed, ref } from 'vue'; |
| | | |
| | | import { useVbenDrawer, useVbenModal } from '@vben/common-ui'; |
| | | import { DictEnum } from '@vben/constants'; |
| | |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'equName' |
| | | }, |
| | | { |
| | | dependencies: { |
| | | show: () => reqType === '2', |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'fixtureName' |
| | | } |
| | | ]); |
| | | } |
| | |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'equName' |
| | | }, |
| | | { |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'fixtureName' |
| | | } |
| | | ]); |
| | | drawerApi.drawerLoading(true); |
| | |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'equName' |
| | | }, |
| | | { |
| | | dependencies: { |
| | | show: () => reqType === '2', |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'fixtureName' |
| | | } |
| | | ]); |
| | | } |
| | |
| | | return; |
| | | } |
| | | const data = cloneDeep(await formApi.getValues()); |
| | | // todo å é¤å¤ä½å段 Reflect.deleteProperty(formValues, 'equId'); |
| | | await (isUpdate.value ? updateRepairReq(data) : addRepairReq(data)); |
| | | emit('reload'); |
| | | await handleCancel(); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.common.core.service; |
| | | |
| | | public interface FixtureService { |
| | | /** |
| | | * éè¿å·¥å
·IDæ¥è¯¢å·¥å
·åç§° |
| | | * |
| | | * @param fixIds å·¥å
·ID串éå·åé |
| | | * @return å·¥å
·å称串éå·åé |
| | | */ |
| | | String selectFixtureNameByIds(String fixIds); |
| | | } |
| | |
| | | */ |
| | | String EQU_ID_TO_NAME = "equ_id_to_name"; |
| | | /** |
| | | * å·¥å
·ç±»å(æ²»å
·)id转åç§° |
| | | * å·¥å
·(æ²»å
·)ç±»åid转åç§° |
| | | */ |
| | | String FIXTURE_TYPE_ID_TO_NAME = "fixture_type_id_to_name"; |
| | | |
| | | /** |
| | | * å·¥å
·(æ²»å
·)id转åç§° |
| | | */ |
| | | String FIXTURE_ID_TO_NAME = "fixture_id_to_name"; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.common.translation.core.impl; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import org.dromara.common.core.service.FixtureService; |
| | | import org.dromara.common.core.service.FixtureTypeService; |
| | | import org.dromara.common.translation.annotation.TranslationType; |
| | | import org.dromara.common.translation.constant.TransConstant; |
| | | import org.dromara.common.translation.core.TranslationInterface; |
| | | |
| | | /** |
| | | * å·¥å
·åç§°ç¿»è¯å®ç° |
| | | * |
| | | * @author zhuguifei |
| | | */ |
| | | @AllArgsConstructor |
| | | @TranslationType(type = TransConstant.FIXTURE_ID_TO_NAME) |
| | | public class FixtureNameTranslationImpl implements TranslationInterface<String> { |
| | | |
| | | private final FixtureService fixtureService; |
| | | |
| | | @Override |
| | | public String translation(Object key, String other) { |
| | | if (key instanceof String ids) { |
| | | return fixtureService.selectFixtureNameByIds(ids); |
| | | } else if (key instanceof Long id) { |
| | | return fixtureService.selectFixtureNameByIds(id.toString()); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | import org.dromara.common.translation.core.TranslationInterface; |
| | | |
| | | /** |
| | | * å·¥å
·åç§°ç¿»è¯å®ç° |
| | | * å·¥å
·ç±»ååç§°ç¿»è¯å®ç° |
| | | * |
| | | * @author zhuguifei |
| | | */ |
| | |
| | | org.dromara.common.translation.core.impl.EquTypeNameTranslationImpl |
| | | org.dromara.common.translation.core.impl.EquNameTranslationImpl |
| | | org.dromara.common.translation.core.impl.FixtureTypeNameTranslationImpl |
| | | org.dromara.common.translation.core.impl.FixtureNameTranslationImpl |
| | |
| | | private Long equId; |
| | | |
| | | /** |
| | | * å·¥å
·id |
| | | */ |
| | | private Long fixtureId; |
| | | |
| | | /** |
| | | * ç»´ä¿®åid |
| | | */ |
| | | private Long repairId; |
| | |
| | | private Long equId; |
| | | |
| | | /** |
| | | * å·¥å
·id |
| | | */ |
| | | private Long fixtureId; |
| | | |
| | | /** |
| | | * ç»´ä¿®åid |
| | | */ |
| | | private Long repairId; |
| | |
| | | private Long equId; |
| | | |
| | | /** |
| | | * å·¥å
·id |
| | | */ |
| | | private Long fixtureId; |
| | | |
| | | /** |
| | | * å·¥å
· |
| | | */ |
| | | @Translation(type = TransConstant.FIXTURE_ID_TO_NAME, mapper = "fixtureId") |
| | | private String fixtureName; |
| | | |
| | | /** |
| | | * ç»´ä¿®åid |
| | | */ |
| | | @ExcelProperty(value = "ç»´ä¿®åid") |
| | |
| | | import cn.hutool.core.convert.Convert; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.dromara.common.core.service.FixtureService; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.common.core.utils.SpringUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | public class EimsFixtureServiceImpl implements IEimsFixtureService { |
| | | public class EimsFixtureServiceImpl implements IEimsFixtureService, FixtureService { |
| | | |
| | | private final EimsFixtureMapper baseMapper; |
| | | private final EimsFixtureTypeMapper fixtureTypeMapper; |
| | |
| | | return baseMapper.deleteByIds(ids) > 0; |
| | | } |
| | | |
| | | @Override |
| | | public String selectFixtureNameByIds(String fixIds) { |
| | | List<String> list = new ArrayList<>(); |
| | | for (Long id : StringUtils.splitTo(fixIds, Convert::toLong)) { |
| | | EimsFixtureVo vo = SpringUtils.getAopProxy(this).queryById(id); |
| | | if (ObjectUtil.isNotNull(vo)) { |
| | | list.add(vo.getFixtureName()); |
| | | } |
| | | } |
| | | return String.join(StringUtils.SEPARATOR, list); |
| | | } |
| | | } |