Merge remote-tracking branch 'origin/master'
| | |
| | | */ |
| | | public boolean checkDataSecret(BaseModel baseModel) throws VciBaseException{ |
| | | VciBaseUtil.alertNotNull(baseModel,"è¦æ ¡éªå¯çº§çæ°æ®å¯¹è±¡"); |
| | | //todo ç»å½è¿æªå¯ç¨ï¼æä»¥å¯çº§æ æ³è·åéè¦ä¿®æ¹ |
| | | // if(isCheckSecret(baseModel) && VciBaseUtil.getCurrentUserSecret()>0) { |
| | | // if (baseModel.getSecretGrade() == null ) { |
| | | // baseModel.setSecretGrade(DataSecretEnum.NONE.getValue()); |
| | | // } |
| | | // Integer userSecret = VciBaseUtil.getCurrentUserSecret(); |
| | | // if (!checkUserSecret(baseModel.getSecretGrade())) { |
| | | // throw new VciBaseException("å½åç¨æ·çå¯çº§ä½äºæ°æ®çå¯çº§ï¼ç¨æ·å¯çº§ä¸º" + UserSecretEnum.getSecretText(userSecret) + ",æ°æ®å¯çº§ä¸º" + DataSecretEnum.getSecretText(baseModel.getSecretGrade())); |
| | | // } |
| | | // } |
| | | if(isCheckSecret(baseModel) && VciBaseUtil.getCurrentUserSecret()>0) { |
| | | if (baseModel.getSecretGrade() == null ) { |
| | | baseModel.setSecretGrade(DataSecretEnum.NONE.getValue()); |
| | | } |
| | | Integer userSecret = VciBaseUtil.getCurrentUserSecret(); |
| | | if (!checkUserSecret(baseModel.getSecretGrade())) { |
| | | throw new VciBaseException("å½åç¨æ·çå¯çº§ä½äºæ°æ®çå¯çº§ï¼ç¨æ·å¯çº§ä¸º" + UserSecretEnum.getSecretText(userSecret) + ",æ°æ®å¯çº§ä¸º" + DataSecretEnum.getSecretText(baseModel.getSecretGrade())); |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | |
| | | //è½ç¶ä¸æ ¡éªæéï¼ä½æ¯å¦ætokenä¸ä¸ºç©ºï¼éè¦æ´æ°å½åç¨æ· |
| | | SessionInfo sessionInfo = getSessionInfo(userToken); |
| | | |
| | | if(sessionInfo != null){ |
| | | //åå§åå¹³å°çtoken |
| | | vciSessionForLoginI.initInvocationInfo(sessionInfo); |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | //è·åé
ç½®æä»¶ä¸ï¼ä¸æ ¡éªæéçè·¯å¾ |
| | |
| | | * @return æä»¶ä¿¡æ¯æ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @PostMapping("/uploadFile") |
| | | @VciUnCheckRight |
| | | public BaseResult<VciFileObjectVO> uploadFile(MultipartFile file, VciFileObjectDTO fileObjectDTO){ |
| | | try { |
| | | if (file != null ) { |
| | |
| | | package com.vci.web.controller; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.data.BusinessObject; |
| | | import com.vci.starter.web.annotation.controller.VciUnCheckRight; |
| | | import com.vci.starter.web.annotation.log.VciBusinessLog; |
| | | import com.vci.starter.web.pagemodel.*; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ°æ®åçï¼å端使ç¨JSONæäº¤ |
| | | * æ°æ®åçæ¬/次ï¼å端使ç¨JSONæäº¤ |
| | | * @param formDataDTO è¡¨åæ°æ® |
| | | * @return æ§è¡çç»æ |
| | | */ |
| | | @PutMapping("/upRevision") |
| | | @VciBusinessLog(operateName = "æ°æ®åç",description = "${param.btmname}éç${param.copyFromVersion}") |
| | | public BaseResult<Map<String,Object>> upRevision(@RequestBody FormDataDTO formDataDTO){ |
| | | public BaseResult<Map<String, Object>> upRevision(@RequestBody FormDataDTO formDataDTO) throws PLException { |
| | | return uiDataService.upRevision(formDataDTO); |
| | | } |
| | | |
| | | /** |
| | | * æ°æ®åçæ¬/次ï¼å端使ç¨JSONæäº¤ |
| | | * @param btmname ä¸å¡ç±»åçä¿¡æ¯ |
| | | * @param oid ä¸å¡æ°æ®çä¸»é® |
| | | * @param type 1:çæ¬¡å¯¹è±¡ï¼2ï¼çæ¬å¯¹è±¡ï¼3ï¼ä¸»å¯¹è±¡ |
| | | * @return æ§è¡çç»æ |
| | | */ |
| | | @DeleteMapping("/deleteBusinessObject") |
| | | public BaseResult deleteBusinessObject(String btmname , String oid, int type) { |
| | | try { |
| | | return uiDataService.deleteBusinessObject(btmname, oid, type); |
| | | }catch (PLException e){ |
| | | BaseResult<Object> objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | re.setData(dataMapList); |
| | | return re; |
| | | } |
| | | /** |
| | | * åæ´ææè
|
| | | * @param btmname ä¸å¡ç±»å |
| | | * @param oid ä¸»é® |
| | | * @return æ§è¡çç»æ |
| | | */ |
| | | @PutMapping("/changeBusinessObjectOwner") |
| | | public BaseResult changeBusinessObjectOwner(String btmname , String oid) { |
| | | try { |
| | | return uiDataService.changeBusinessObjectOwner(btmname, oid); |
| | | } catch (PLException e) { |
| | | BaseResult<Object> objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ç¶æè·è¿ |
| | | * @param btmname ä¸å¡ç±»å |
| | | * @param oid ä¸»é® |
| | | * @param releaseStatus åå¸ç¶æ |
| | | * @return æ§è¡çç»æ |
| | | */ |
| | | @PutMapping("/transferBusinessObject") |
| | | public BaseResult transferBusinessObject(String btmname , String oid, String toStatus, String releaseStatus) { |
| | | try { |
| | | return uiDataService.transferBusinessObject(btmname, oid, toStatus, releaseStatus); |
| | | } catch (PLException e) { |
| | | BaseResult<Object> objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.vci.web.service; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.data.BusinessObject; |
| | | import com.vci.corba.omd.data.LinkObject; |
| | | import com.vci.corba.omd.data.RevisionDataInfo; |
| | |
| | | * @return æ§è¡ç»æåæ¾ç¤ºåçå¼ |
| | | * @throws VciBaseException ä¿ååºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | BaseResult<Map<String, Object>> upRevision(FormDataDTO formDataDTO) throws VciBaseException; |
| | | BaseResult<Map<String, Object>> upRevision(FormDataDTO formDataDTO) throws VciBaseException, PLException; |
| | | |
| | | /** |
| | | * æ¹éä¿®æ¹ï¼æ³¨æè¡¨åå®ä¹çåæ®µæä¼è¢«ä¿®æ¹ï¼tsè¿ç§é»è®¤å段é¤å¤ |
| | |
| | | * @return ä¸å¡æ°æ®ç屿§ä¿¡æ¯ |
| | | */ |
| | | List<Map<String,String>> getDataAttr(String btmName, String oid); |
| | | |
| | | /** |
| | | * æ°æ®åçæ¬/次ï¼å端使ç¨JSONæäº¤ |
| | | * @param btmname ä¸å¡ç±»åçä¿¡æ¯ |
| | | * @param oid ä¸å¡æ°æ®çä¸»é® |
| | | * @param type 1:çæ¬¡å¯¹è±¡ï¼2ï¼çæ¬å¯¹è±¡ï¼3ï¼ä¸»å¯¹è±¡ |
| | | * @return æ§è¡çç»æ |
| | | */ |
| | | BaseResult deleteBusinessObject(String btmname, String oid, int type) throws PLException; |
| | | /** |
| | | * åæ´ææè
|
| | | * @param btmname ä¸å¡ç±»å |
| | | * @param oid ä¸»é® |
| | | * @return æ§è¡çç»æ |
| | | */ |
| | | BaseResult changeBusinessObjectOwner(String btmname, String oid) throws PLException; |
| | | /** |
| | | * ç¶æè·è¿ |
| | | * @param btmname ä¸å¡ç±»å |
| | | * @param oid ä¸»é® |
| | | * @param releaseStatus åå¸ç¶æ |
| | | * @return æ§è¡çç»æ |
| | | */ |
| | | BaseResult transferBusinessObject(String btmname, String oid, String toStatus, String releaseStatus) throws PLException; |
| | | } |
| | |
| | | |
| | | import com.vci.client.common.providers.ClientServiceProvider; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.data.BusinessObject; |
| | | import com.vci.corba.omd.data.LinkObject; |
| | | import com.vci.corba.omd.data.RevisionDataInfo; |
| | | import com.vci.corba.omd.data.VersionDataInfo; |
| | | import com.vci.corba.framework.data.UserInfo; |
| | | import com.vci.corba.omd.data.*; |
| | | import com.vci.corba.omd.lcm.LifeCycle; |
| | | import com.vci.file.pagemodel.VciFileObjectVO; |
| | | import com.vci.frameworkcore.lcstatuspck.FrameworkDataLCStatus; |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.lang.reflect.Method; |
| | |
| | | if(baseModel.getRevisionValue() == null){ |
| | | baseModel.setRevisionValue(""); |
| | | } |
| | | return changeRevisionValueInfoToObject(platformClientUtil.getBOFactoryService().getNextRevisionValueObject(WebUtil.getTableName(btmTypeVO.getId()),baseModel.getNameOid(),btmTypeVO.getRevisionRuleId(),btmTypeVO.isInputRevisionFlag(),baseModel.getRevisionValue())); |
| | | return changeRevisionValueInfoToObject(platformClientUtil.getBOFactoryService().getNextRevisionValueObject(btmTypeVO.getId(),baseModel.getNameOid(),btmTypeVO.getRevisionRuleId(),btmTypeVO.isInputRevisionFlag(),baseModel.getRevisionValue())); |
| | | } catch (PLException vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | |
| | | * @throws VciBaseException ä¿ååºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public BaseResult<Map<String, Object>> upRevision(FormDataDTO formDataDTO) throws VciBaseException { |
| | | public BaseResult<Map<String, Object>> upRevision(FormDataDTO formDataDTO) throws VciBaseException, PLException { |
| | | //é¦å
å¤æå¯¹è±¡æ¯å¦ä¸ºç©º |
| | | VciBaseUtil.alertNotNull(formDataDTO,"ä¿®æ¹çæ°æ®å¯¹è±¡",formDataDTO.getBtmname(),"ä¸å¡ç±»åçåç§°",formDataDTO.getFormDefineId(),"表åå®ä¹çç¼å·",formDataDTO.getCopyFromVersion(),"èçæ¬ç主é®"); |
| | | UIFormDefineVO formDefineVO = uiEngineService.getFormById(formDataDTO.getBtmname(), formDataDTO.getFormDefineId()); |
| | |
| | | //说æåç½®äºä»¶æ²¡ææ§è¡æå |
| | | return beforeResult; |
| | | } |
| | | //å°è£
æ°æ® |
| | | BaseResult<BusinessObject> resultCbo = wrapperCbo(formDataDTO,formDefineVO,false,formDataDTO.isUpVersion()?false:true,formDataDTO.isUpVersion()); |
| | | if(!resultCbo.isSuccess()){ |
| | | return BaseResult.fail(resultCbo.getMsg(),resultCbo.getMsgObjs()); |
| | | List<BusinessObject> businessObjects = null; |
| | | Date ts = formDataDTO.getTs(); |
| | | Map<String,String> conditionMap = WebUtil.getOidQuery(formDataDTO.getCopyFromVersion()); |
| | | conditionMap.put("ts", VciDateUtil.date2Str(ts,VciDateUtil.DateTimeMillFormat)); |
| | | conditionMap.put("oid",formDataDTO.getCopyFromVersion()); |
| | | businessObjects = boService.queryCBO(formDataDTO.getBtmname(), conditionMap); |
| | | if(businessObjects.size() ==0){ |
| | | throw new VciBaseException("æ°æ®ä¸æ¯ææ°çï¼å»ºè®®æ¨å·æ°åéæ°æä½"); |
| | | } |
| | | //æ©å±å±æ§çå¼ |
| | | Map<String, String> data = formDataDTO.getData(); |
| | | Map<String,String> dataLow = new HashMap<>(); |
| | | data.forEach((key,value)->{ |
| | | dataLow.put(key.toLowerCase(),value); |
| | | }); |
| | | |
| | | Map<String,String> baseDataMap = formDataDTO2MapLow(formDataDTO); |
| | | Map<String,String> allDataMapLow = new HashMap<>(); |
| | | allDataMapLow.putAll(dataLow); |
| | | allDataMapLow.putAll(baseDataMap); |
| | | //夿å¯ä¸é¡¹ |
| | | BaseResult baseResult = checkUnique(formDefineVO, null, allDataMapLow, true); |
| | | if(!baseResult.isSuccess()){ |
| | | return baseResult; |
| | | } |
| | | BusinessObject businessObject = platformClientUtil.getBOFService() |
| | | .revisionBusinessObject(businessObjects.get(0), null, !formDataDTO.isUpVersion(),true, false, false); |
| | | //æ§è¡ä¿å |
| | | BaseResult<Map<String,Object>> result = BaseResult.success(); |
| | | try { |
| | | BusinessObject bo = platformClientUtil.getBOFService().createBusinessObject(resultCbo.getObj(),formDataDTO.isUpVersion()?false:true,formDataDTO.isUpVersion()); |
| | | BusinessObject afterCbo = new BusinessObject(); |
| | | afterCbo = bo; |
| | | result.setObj(boService.cbo2Map(afterCbo)); |
| | | } catch (PLException vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | if(!CollectionUtils.isEmpty(formDataDTO.getReleaseFileOids())){ |
| | | fileObjectService.releasedFile(resultCbo.getObj().btName,resultCbo.getObj().oid,formDataDTO.getReleaseFileOids()); |
| | | } |
| | | BaseResult<Map<String, Object>> result = BaseResult.success(); |
| | | result.setObj(boService.cbo2Map(businessObject)); |
| | | //åç½®äºä»¶ |
| | | String afterEvent = formDataDTO.getPostEvent(); |
| | | try { |
| | | callPostEvent(Arrays.stream(new BusinessObject[]{resultCbo.getObj()}).collect(Collectors.toList()), null,afterEvent, VciChangeDocumentTypeEnum.EDIT); |
| | | callPostEvent(Arrays.stream(new BusinessObject[]{businessObject}).collect(Collectors.toList()), null,afterEvent, VciChangeDocumentTypeEnum.EDIT); |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e); |
| | | } |
| | |
| | | } |
| | | return dataMap; |
| | | } |
| | | |
| | | /** |
| | | * æ°æ®åçæ¬/次ï¼å端使ç¨JSONæäº¤ |
| | | * @param btmname ä¸å¡ç±»åçä¿¡æ¯ |
| | | * @param oid ä¸å¡æ°æ®çä¸»é® |
| | | * @param type 1:çæ¬¡å¯¹è±¡ï¼2ï¼çæ¬å¯¹è±¡ï¼3ï¼ä¸»å¯¹è±¡ |
| | | * @return æ§è¡çç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult deleteBusinessObject(String btmname, String oid, int type) throws PLException { |
| | | List<BusinessObject> cbos = boService.queryCBO(btmname,WebUtil.getOidQuery(oid)); |
| | | BaseResult<Object> objectBaseResult = new BaseResult<>(); |
| | | if(cbos.size() == 0){ |
| | | objectBaseResult.setSuccess(false); |
| | | throw new PLException("500", new String[]{"没æè·åå°æ°æ®ç主é®"}); |
| | | } |
| | | for (BusinessObject cbo : cbos) { |
| | | if(StringUtils.isBlank(cbo.revisionid)){ |
| | | String revisionoid = Arrays.stream(cbo.hisAttrValList).filter(e -> e.attrName.equals("REVISIONOID")).findFirst().map(e -> e.attrVal).orElse(""); |
| | | cbo.revisionid = revisionoid; |
| | | } |
| | | boolean b = platformClientUtil.getBOFService().deleteBusinessObject(cbo,type); |
| | | if(!b){ |
| | | throw new PLException("500", new String[]{"æ°æ®å é¤å¤±è´¥ï¼ï¼"}); |
| | | } |
| | | } |
| | | return BaseResult.success(); |
| | | } |
| | | /** |
| | | * åæ´ææè
|
| | | * @param btmname ä¸å¡ç±»å |
| | | * @param oid ä¸»é® |
| | | * @return æ§è¡çç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult changeBusinessObjectOwner(String btmname, String oid) throws PLException { |
| | | List<BusinessObject> cbos = boService.queryCBO(btmname,WebUtil.getOidQuery(oid)); |
| | | BaseResult<Object> objectBaseResult = new BaseResult<>(); |
| | | if(cbos.size() == 0){ |
| | | objectBaseResult.setSuccess(false); |
| | | throw new PLException("500", new String[]{"没æè·åå°æ°æ®ç主é®"}); |
| | | } |
| | | UserInfo userInfo = platformClientUtil.getFrameworkService().getUserObjectByUserName(WebUtil.getCurrentUserId()); |
| | | for (BusinessObject cbo : cbos) { |
| | | platformClientUtil.getBOFService().changeBusinessObjectOwner(cbo,userInfo); |
| | | } |
| | | return BaseResult.success(); |
| | | } |
| | | /** |
| | | * åæ´ææè
|
| | | * @param btmname ä¸å¡ç±»å |
| | | * @param oid ä¸»é® |
| | | * @param releaseStatus åå¸ç¶æ |
| | | * @return æ§è¡çç»æ |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public BaseResult transferBusinessObject(String btmname, String oid, String toStatus,String releaseStatus) throws PLException { |
| | | List<BusinessObject> cbos = boService.queryCBO(btmname,WebUtil.getOidQuery(oid)); |
| | | BaseResult<Object> objectBaseResult = new BaseResult<>(); |
| | | if(cbos.size() == 0){ |
| | | objectBaseResult.setSuccess(false); |
| | | throw new PLException("500", new String[]{"没æè·åå°æ°æ®ç主é®"}); |
| | | } |
| | | for (BusinessObject cbo : cbos) { |
| | | platformClientUtil.getBOFService().transferBusinessObjectAndRelease(cbo, toStatus, releaseStatus); |
| | | } |
| | | return BaseResult.success(); |
| | | } |
| | | } |
| | |
| | | if(vciFileObjectDO.getSecretGrade() == null) { |
| | | vciFileObjectDO.setSecretGrade(DataSecretEnum.NONE.getValue()); |
| | | } |
| | | //todo ç»å½è¿æªå¼å¥½éè¦ä¿®æ¹ |
| | | vciFileObjectDO.setCreator("1"); |
| | | vciFileObjectDO.setLastModifier("1"); |
| | | revisionModelUtil.wrapperForAdd(vciFileObjectDO); |
| | | //éæºè·¯å¾ |
| | | String randomPath = VciBaseUtil.getPk(); |
| | |
| | | if(btmName!=null){ |
| | | btmName = btmName.trim().toLowerCase(); |
| | | } |
| | | //todo ç±äºç»å½é®é¢åç»éè¦ä¿®æ¹ |
| | | // String userid = WebUtil.getCurrentUserId(); |
| | | String userid = "1"; |
| | | String userid = WebUtil.getCurrentUserId(); |
| | | if(!hasCreatedCbos.containsKey(btmName)){ |
| | | if(StringUtils.isEmpty(userid)){ |
| | | throw new VciBaseException(msgCodePrefix +"noHasUserid"); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | ## AVUE-CRUD è¡¨æ ¼é
ç½® |
| | | |
| | | ```javascript |
| | | <avue-crud :option="option" //è¡¨æ ¼é
ç½®å±æ§ |
| | | :table-loading="loading" //è¡¨æ ¼çå¾
æ¡çæ§å¶ï¼å è½½çæ¶å转ååï¼è®¾ç½®true/false |
| | | :search.sync="search" //æç´¢çåé(éè¦sync修饰符) |
| | | :visible.sync="changeInfo" //æ¯å¦æ¾ç¤ºï¼è®¾ç½®true/false |
| | | :data="data" //è¡¨æ ¼æ¾ç¤ºçæ°æ® |
| | | :page.sync="page" //è¡¨æ ¼å页é
ç½®é项(éè¦sync修饰符) |
| | | :permission="permissionList" //æéæ§å¶ |
| | | :before-open="beforeOpen" //æå¼åçåè°function(file,column) |
| | | v-model="form" //æ°æ®æ¨¡å ç¨æ¥åå页é¢å¼ç |
| | | ref="crud" //卿®éç DOM å
ç´ ä¸ä½¿ç¨ï¼å¼ç¨æåçå°±æ¯ DOM å
ç´ ï¼ |
| | | @cell-click="pageto" //è¡¨æ ¼ç¹å»è¿è¡æ¹æ³ onclickæ¹æ³å®ä¹ |
| | | @row-update="rowUpdate" //ä¿®æ¹æ°æ®åç¹å»ç¡®å®è§¦å该äºä»¶ |
| | | @row-save="rowSave" //æ°å¢æ°æ®åç¹å»ç¡®å®è§¦å该äºä»¶ |
| | | @row-del="rowDel" //è¡æ°æ®å 餿¶è§¦å该äºä»¶ |
| | | @row-click="handleRowClick" //åå»è¡è¿è¡çæ¹æ³ |
| | | @search-change="searchChange" //æç´¢æ ååäºä»¶ |
| | | @search-reset="searchReset" //æ¸
空æç´¢æ ååäºä»¶ |
| | | @selection-change="selectionChange"//éæ©æ¡ååååäºä»¶ |
| | | @current-change="currentChange" //ç¹å»é¡µç ä¼è°ç¨current-changeæ¹æ³åè°å½å页æ°ï¼è¿åå½å第å 页 |
| | | @size-change="sizeChange" //ç¹å»æ¯é¡µå¤å°æ¡ä¼è°size-changeæ¹æ³åè° |
| | | @refresh-change="refreshChange" //ç¹å»å·æ°æé®è§¦å该äºä»¶ |
| | | @on-load="onLoad"> //æå¼è¡¨æ ¼é¡µé¢çæ¹æ³ï¼ä¸è¬ç¨æ¥åå§åï¼è¿å页颿°æ® |
| | | </avue-crud> |
| | | |
| | | option: { |
| | | height:'auto', //è¡¨æ ¼é«åº¦ |
| | | emptyText: "ææ æ°æ®å¦~", //æ°æ®ä¸ºç©ºçæç¤º |
| | | calcHeight: 30, //è¡¨æ ¼é«åº¦å·®ï¼ä¸»è¦ç¨äºåå»å
¶ä»é¨åè®©è¡¨æ ¼é«åº¦èªéåºï¼ |
| | | tip: false, //æç¤ºä¿¡æ¯ |
| | | searchShow: true, //馿¬¡å è½½æ¯å¦æ¾ç¤ºæç´¢ |
| | | searchMenuSpan: 4, //æç´¢æé®é¿åº¦ |
| | | searchSpan:6, //æç´¢æ¡é¿åº¦ æå¤§é¿åº¦24 |
| | | border: true, //è¡¨æ ¼è¾¹æ¡æ¯å¦æ¾ç¤º |
| | | index: true, //æ¯å¦æ¾ç¤ºåºå· |
| | | viewBtn: true, //æ¯å¦æ¾ç¤ºæ¥çæé® |
| | | selection: true, //æç´¢æ¡æ¾ç¤º |
| | | addBtn:false, //æ¯å¦æ¾ç¤ºæ·»å æé® |
| | | editBtn:false, //æ¯å¦æ¾ç¤ºç¼è¾æé® |
| | | delBtn:false, //æ¯å¦æ¾ç¤ºå é¤æé® |
| | | excelBtn:false, //è¡¨æ ¼å¯¼åºæé®æ¯å¦æ¾ç¤º |
| | | labelWidth:120, //表ååé¢çæ é¢é¿åº¦ |
| | | refreshBtn: false, //è¡¨æ ¼ä¸é¢å°ç å·æ°æé® |
| | | columnBtn: false, //è¡¨æ ¼ä¸é¢å°ç å表æé® |
| | | searchBtn: false, //è¡¨æ ¼ä¸é¢å°ç æç´¢æé® |
| | | menu: true, //æ¯å¦æ¾ç¤ºæä½æ |
| | | defaultExpandAll:true, //æ é»è®¤å±å¼ |
| | | column:[ |
| | | { |
| | | label: "", //表å屿§åç§° |
| | | prop: "", //屿§å¯¹åºå®ä½ç±»å段 |
| | | type: "", //è¾å
¥æ¡ç±»å |
| | | addDisplay: false, //æ°å¢æ¶æ¯å¦æ¾ç¤º |
| | | editDisplay: false, //ç¼è¾æ¶æ¯å¦æ¾ç¤º |
| | | viewDisplay: true, //详æ
æ¶æ¯å¦æ¾ç¤º |
| | | hide: true, //è¡¨åæ¥è¯¢æ¶æ¯å¦æ¾ç¤º |
| | | display: true, //卿¥çï¼æ°å¢ï¼ç¼è¾é¡µé¢æ¯å¦æ¾ç¤º |
| | | labelWidth:'100', //æ é¢å称宽度 |
| | | span: 24, //24䏿¡æ°æ®å ä¸è¡ï¼8ä¸è¡3æ¡æ°æ® |
| | | gutter:20, //项é´è· |
| | | addDisabled: true, //æ·»å çæ¶åä¸è½ä¿®æ¹ |
| | | editDisabled: true, //ç¼è¾çæ¶åä¸è½ä¿®æ¹ |
| | | sortable:true, //æåºæ¹å¼åæ¢ï¼ååºãæ£åºåæ¢ |
| | | maxlength: 30, //åæ°éå¶ |
| | | showWordLimit:true, //æ¾ç¤ºåæ°éå¶ |
| | | defaultExpandAll:true, //æ é»è®¤å±å¼ |
| | | searchï¼true, //æ¥è¯¢æ¯å¦æ¾ç¤º |
| | | searchFilterable:true, //selectéæ©æ¡å¹é
|
| | | showColumn:false, //åæ¾é䏿¯å¦æ |
| | | addDisplay: false, // æ·»å å¼¹çªä¸æ¾ç¤º |
| | | editDisplay: false, // ç¼è¾å¼¹çªä¸æ¾ç¤º |
| | | viewDisplay: false // æ¥çå¼¹çªä¸æ¾ç¤º |
| | | disabled:true, //表åitemç¦ç¨ |
| | | row:'false/true', //æ¯å¦åç¬æè¡ |
| | | rules:Obj, //éªè¯è§å |
| | | dicData:[], //åå
¸ |
| | | dicUrl:'', //è¿ç¨åå
¸å°å |
| | | dicMethod:'get/post' //åå
¸è¯·æ±æ¹å¼ |
| | | dicQuery:obj, //åå
¸è¯·æ±æ¹å¼ |
| | | props:{ |
| | | lable:'åå
¸çåç§°å±æ§å¼', |
| | | value:'åå
¸çå¼å±æ§å¼', |
| | | children:'åå
¸çå屿§å¼' |
| | | }, |
| | | |
| | | } |
| | | ``` |
| | | |
| | |
| | | } |
| | | .avue-dialog .el-dialog__body{ |
| | | padding: 20px; |
| | | margin-bottom: 20px !important; |
| | | } |
| | | .avue--detail .el-col{ |
| | | margin-bottom: 0; |
| | |
| | | .tree-buttons .el-button{ |
| | | margin: 0 5px 5px 0; |
| | | } |
| | | .el-dialog__footer{ |
| | | border-top: 1px solid #e9e7e7; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | // ä¸è½½æä»¶ |
| | | export const download = (data) => { |
| | | return request({ |
| | | url: '/api/vciFileDownloadController/downloadByFileOidPost', |
| | | method: 'post', |
| | | headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}, |
| | | responseType: 'blob', |
| | | data: data |
| | | }) |
| | | } |
| | |
| | | params: params, |
| | | }); |
| | | } |
| | | |
| | | //å¯å¨æµç¨ |
| | | export const startProcess = (params) => { |
| | | let formData = new FormData() |
| | | for (let key in params) { |
| | | // å¦ææ¯ nodeUsers 对象ï¼åç¹æ®å¤ç |
| | | if (key === 'nodeUsers' && typeof params[key] === 'object' && params[key] !== null) { |
| | | for (let innerKey in params[key]) { |
| | | formData.append(`${key}[${innerKey}]`, params[key][innerKey]); |
| | | } |
| | | } else { |
| | | // énodeUsers屿§ï¼ç´æ¥æ·»å å° formData ä¸ |
| | | formData.append(key.replaceAll('"', ''), params[key]); |
| | | } |
| | | } |
| | | return request({ |
| | | url: '/api/processDefineController/startProcess', |
| | | method: 'post', |
| | | data:formData |
| | | }); |
| | | } |
| | | |
| | |
| | | // è§è²å
¨æ¥è¯¢ |
| | | export function gridRoles(page,limit) { |
| | | return request({ |
| | | url: "/api/roleQueryController/gridRoles", |
| | | url: "/api/roleQueryController/refDataGrid", |
| | | method: "get", |
| | | params:{ |
| | | page,limit |
| | |
| | | } |
| | | |
| | | // æ°å¢æå |
| | | export function addUser(data) { |
| | | export function addUser(row) { |
| | | return request({ |
| | | url: "/api/roleQueryController/addUser", |
| | | url: "/api/userQueryController/addUser", |
| | | method: "post", |
| | | data:data |
| | | data:row |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹æå |
| | | export function updateUser(data) { |
| | | return request({ |
| | | url: "/api/roleQueryController/updateUser", |
| | | method: "post", |
| | | url: "/api/userQueryController/updateUser", |
| | | method: "put", |
| | | data:data |
| | | }); |
| | | } |
| | |
| | | // å 餿å |
| | | export function deleteUser(params) { |
| | | return request({ |
| | | url: "/api/roleQueryController/deleteUser", |
| | | url: "/api/userQueryController/deleteUser", |
| | | method: "delete", |
| | | params |
| | | }); |
| | | } |
| | | |
| | | //è·åå¯ç çç¥ |
| | | export function selectPwdStrategyMap(params) { |
| | | return request({ |
| | | url: "/api/passwordStrategyQueryController/selectPwdStrategyMap", |
| | | method: "get", |
| | | params |
| | | }); |
| | | } |
| | | |
| | | //ä¿åå¯ç çç¥ |
| | | export function saveUserPasswordStrateg(params) { |
| | | let formData = new FormData() |
| | | for (let key in params){ |
| | | formData.append(key,params[key]) |
| | | } |
| | | return request({ |
| | | url: "/api/passwordStrategyQueryController/saveUserPasswordStrateg", |
| | | method: "post", |
| | | data:formData |
| | | }); |
| | | } |
| | | |
| | | // ä¸è½½æ¨¡æ¿æ¥å£ |
| | | export const download = (params) => { |
| | | return request({ |
| | | url: '/api/userQueryController/downloadImportTemplate', |
| | | method: 'get', |
| | | headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}, |
| | | responseType: 'blob', |
| | | params |
| | | }) |
| | | } |
| | | |
| | | //è·åå¯ç çç¥ |
| | | export function departmentQueryController(params) { |
| | | return request({ |
| | | url: "/api/departmentQueryController/refTree", |
| | | method: "get", |
| | | params |
| | | }); |
| | | } |
| | | |
| | | //è·åå¯ç çç¥ |
| | | export function saveUsersDepts(params) { |
| | | return request({ |
| | | url: "/api/departmentQueryController/saveUsersDepts", |
| | | method: "post", |
| | | params |
| | | }); |
| | | } |
| | | |
| | |
| | | <template> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :close-on-click-modal="false" |
| | | :destroy-on-close="true" |
| | | :title="title" |
| | | :visible.sync="visible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | style="text-align: center" |
| | | width="40%" |
| | | @close="dialogClose"> |
| | | <el-transfer |
| | | v-model="rightRoleData" |
| | | v-loading="loading" |
| | | :data="data" |
| | | :filter-method="filterMethod" |
| | | :render-content="renderFunc" |
| | | :titles="['ç°æè§è²', 'æ¥æè§è²']" |
| | | filter-placeholder="è§è²åç§°æç´¢" |
| | | filterable |
| | | style="text-align: left; display: inline-block;"> |
| | | </el-transfer> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="visible = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="sendHandler">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :close-on-click-modal="false" |
| | | :destroy-on-close="true" |
| | | :title="title" |
| | | :visible.sync="visible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | style="text-align: center" |
| | | width="50%" |
| | | @close="dialogClose"> |
| | | <el-transfer |
| | | v-model="rightRoleData" |
| | | v-loading="loading" |
| | | :data="data" |
| | | :filter-method="filterMethod" |
| | | :render-content="renderFunc" |
| | | :titles="transferTitle" |
| | | filter-placeholder="å
³é®è¯æç´¢" |
| | | filterable |
| | | style="text-align: left; display: inline-block;"> |
| | | </el-transfer> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <div class="valueInfo" v-if="bottomValue">已设置çå¼ä¸ºï¼[{{bottomValue}}]</div> |
| | | <el-button @click="visible = false" size="small">å æ¶</el-button> |
| | | <el-button type="primary" @click="sendHandler" size="small">ç¡® å®</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "transfer", |
| | | props: ['title', 'leftRoleData', 'rightRoleData'], |
| | | props: ['title', 'leftRoleData', 'rightRoleData', 'transferTitle' , 'bottomValue'], |
| | | data() { |
| | | return { |
| | | visible: false, // éè¿ this.$refs.transfer.visible = true; å¼å¯åç»ä»¶å¯¹è¯æ¡ |
| | | data: [], |
| | | value: [], |
| | | loading: false, |
| | | filterMethod(query, item) { |
| | | return item.label.indexOf(query) > -1; |
| | | }, |
| | | renderFunc(h, option) { |
| | | return <span><i class="el-icon-s-custom"></i> { option.label }</span>; |
| | | return <span><i class="el-icon-s-custom"></i> {option.label}</span>; |
| | | } |
| | | } |
| | | }, |
| | | watch: { |
| | | //渲æç©¿æ¢æ¡ |
| | | leftRoleData: { |
| | | handler(newval, oldval) { |
| | | handler(newval) { |
| | | if (newval) { |
| | | // æ¸
空dataæ°ç» |
| | | this.data = []; |
| | | newval.forEach((city, index) => { |
| | | newval.forEach((city) => { |
| | | this.data.push({ |
| | | label: city.name, |
| | | key: city.oid, |
| | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | /deep/ .el-transfer-panel{ /* å·¦å³ä¸¤ä¸ªç©¿æ¢æ¡çé«åº¦å宽度 */ |
| | | height: 450px; |
| | | /deep/ .el-transfer-panel { |
| | | height: 450px; /* å·¦å³ä¸¤ä¸ªç©¿æ¢æ¡çé«åº¦å宽度 */ |
| | | width: 300px; |
| | | } |
| | | |
| | | /deep/ .el-transfer-panel__list.is-filterable { |
| | | height: 323px; /* ç©¿æ¢æ¡å表é«åº¦ */ |
| | | } |
| | | |
| | | .valueInfo{ |
| | | float: left; |
| | | border: 1px solid #E9E7E7; |
| | | display: inline-block; |
| | | vertical-align: middle; |
| | | padding: 6px 12px; |
| | | line-height: 1; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :close-on-click-modal="false" |
| | | :destroy-on-close="true" |
| | | :title="title" |
| | | :visible.sync="visible" |
| | | width="40%" |
| | | append-to-body |
| | | class="avue-dialog" |
| | | style="margin-top: -20vh !important;" |
| | | > |
| | | <Divider left="30px" text="导å
¥æç¤º"></Divider> |
| | | <ul> |
| | | <li> |
| | | 请ç¹å»æµè§æä»¶è¿è¡ä¸ä¼ |
| | | </li> |
| | | </ul> |
| | | <Divider left="30px" text="éæ©æä»¶åä¼èªå¨ä¸ä¼ "></Divider> |
| | | <el-upload |
| | | :action="fileUrl" |
| | | :before-upload="beforeUpload" |
| | | :data="fileData" |
| | | :headers="uploadHeaders" |
| | | :on-change="uploadChange" |
| | | :on-error="onError" |
| | | :on-success="onSuccess" |
| | | :show-file-list="false" |
| | | class="upload-demo"> |
| | | <el-button size="small" style="margin: 15px 35px" type="primary">æµè§æä»¶</el-button> |
| | | </el-upload> |
| | | <template #footer> |
| | | <el-button size="small" @click="visible = false">å
³é</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getToken} from "@/util/auth"; |
| | | import func from "@/util/func"; |
| | | import {validatenull} from "@/util/validate"; |
| | | |
| | | export default { |
| | | name: "upload-file", |
| | | props: { |
| | | fileType: { |
| | | type: Array, |
| | | default: () => [] |
| | | }, |
| | | title: { |
| | | type: String, |
| | | default: 'ä¸ä¼ æä»¶' |
| | | }, |
| | | fileUrl: { |
| | | type: String, |
| | | default: '' |
| | | }, |
| | | fileData: { |
| | | type: Array, |
| | | default: () => [] |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | flga: true, |
| | | pageLoading: null, |
| | | downloadLoading: false, |
| | | visible: false, |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | watch: { |
| | | visible: { |
| | | handler(newval, oldval) { |
| | | // console.log('newval',newval) |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | uploadHeaders() { |
| | | return { |
| | | "Authorizationtoken": getToken(), |
| | | }; |
| | | }, |
| | | }, |
| | | methods: { |
| | | //æä»¶ä¸ä¼ å |
| | | async beforeUpload(file) { |
| | | // è·åæä»¶æ©å±å |
| | | const fileExtension = file.name.split(".").pop().toLowerCase(); // 转æ¢ä¸ºå°å以é¿å
大å°åä¸å¹é
çé®é¢ |
| | | if (this.fileType) { |
| | | if (!this.fileType.includes(fileExtension)) { |
| | | // ä¸ä¼ æ ¼å¼ä¸ç¬¦åè¦æ±ï¼æç¤ºé误信æ¯å¹¶åæ¶ä¸ä¼ |
| | | this.$message.error(`åªå
许ä¸ä¼ ${this.fileType.toString()}æ ¼å¼çæä»¶`); |
| | | return Promise.reject(false); |
| | | } |
| | | } |
| | | this.pageLoading = this.$loading({ |
| | | lock: true, |
| | | text: "æä»¶ä¸ä¼ ä¸", |
| | | spinner: "el-icon-loading", |
| | | background: "rgba(0, 0, 0, 0.7)", |
| | | }); |
| | | |
| | | return true; |
| | | }, |
| | | // æä»¶ä¸ä¼ æå |
| | | onSuccess(resbonse) { |
| | | console.log(resbonse); |
| | | if (resbonse.code === 200) { |
| | | this.$message.success("导å
¥æåï¼"); |
| | | this.visible = false; |
| | | } else { |
| | | this.$message.error(resbonse.msg); |
| | | } |
| | | }, |
| | | //æä»¶ä¸ä¼ 失败 |
| | | onError(res) { |
| | | this.pageLoading.close(); |
| | | this.$message.error(res); |
| | | }, |
| | | //æä»¶ç¶ææ¹å |
| | | uploadChange(file) { |
| | | console.log( this.pageLoading); |
| | | if (file.status === "success" || file.status === "error") { |
| | | this.pageLoading.close(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | ul { |
| | | color: rgb(188, 188, 188); |
| | | margin: 20px 0 20px 0; |
| | | padding: 0 0 0 30px; |
| | | list-style: none; |
| | | |
| | | li { |
| | | margin-bottom: 5px; |
| | | font-size: 13px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | |
| | | |
| | | export const doAction = (options,callback) => { |
| | | //modelName æµç¨åç§° é»è®¤ä¸º å½åç¨æ·+'å¯å¨æµç¨'+å½ååç±» |
| | | //multi æ¯å¦å¼å¯å¤é |
| | | //checknotprocess æ¯å¦å
许åèµ·æµç¨ |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "downLoadFile" |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | import {validatenull} from "@/util/validate"; |
| | | import Vue from "vue"; |
| | | import func from "@/util/func"; |
| | | import {download} from "@/api/base/file"; |
| | | |
| | | export const doAction = (options,callback) => { |
| | | console.log(options) |
| | | options.sourceData = options.sourceData || {}; |
| | | options.dataStore = options.dataStore || []; |
| | | if (!options.dataStore || options.dataStore.length < 1) { |
| | |
| | | */ |
| | | export const showStartWindow = (options,callback)=> { |
| | | const paramVOS = options.paramVOS; |
| | | if (!paramVOS['form'] && !paramVOS['context']) { |
| | | Vue.prototype.$message.error("æé®é
ç½®ä¸æ£ç¡®"); |
| | | return false; |
| | | } |
| | | const oids = options.dataStore.map(item => item.oid).join(','); |
| | | let data = new FormData(); |
| | | data.append('fileOid',oids); |
| | | download(data).then(res => { |
| | | console.log(res); |
| | | if (res) { |
| | | func.downloadFileByBlobHandler(res); |
| | | Vue.prototype.$message.success("ä¸è½½æå"); |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }); |
| | | // if (!paramVOS['form'] && !paramVOS['context']) { |
| | | // Vue.prototype.$message.error("æé®é
ç½®ä¸æ£ç¡®"); |
| | | // return false; |
| | | // } |
| | | // func.downloadFileByBlobHandler(); |
| | | |
| | | } |
| | |
| | | :width="width" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | style="margin-top: -10% !important;" |
| | | title="å¯å¨æµç¨" |
| | | top="0" |
| | | @close="dialogClose"> |
| | | |
| | | <el-form :model="saveParam" :rules="rules" class="demo-form-inline" label-position="left" label-width="auto"> |
| | | <el-divider content-position="left">æµç¨ä¿¡æ¯</el-divider> |
| | | |
| | | <el-form ref="nodeForm" :model="saveParam" :rules="rules" class="demo-form-inline" label-position="left" |
| | | label-width="auto"> |
| | | <el-form-item label="æµç¨æ¨¡æ¿"> |
| | | <el-input v-model="saveParam.modelName" disabled placeholder="æµç¨æ¨¡æ¿"></el-input> |
| | | <el-select v-model="saveParam.processTemplate" filterable style="width: 100%;" @change="proTemSelect($event)"> |
| | | <el-option v-for="(item, key) in processTemplateList" :key="key" :label="item.value" |
| | | :value="item.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æµç¨åç§°" prop="processName"> |
| | | <el-input v-model="saveParam.processName" placeholder="æµç¨åç§°"> |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-divider></el-divider> |
| | | <!-- <div class="btns-icon">--> |
| | | <!-- <el-button circle icon="el-icon-star-off" @click="handleCollect"></el-button>--> |
| | | <!-- </div>--> |
| | | <el-form :model="collectParam" class="demo-form-inline" label-position="left" label-width="auto"> |
| | | <el-form-item v-for="(item, index) in initFrom" :key="index" :label="`èç¹${index + 1}`"> |
| | | <el-select style="width: 100%;" filterable v-model="collectParam.flowTaskUsers[index]['userId']" |
| | | :placeholder="item.value" @change="handleSelect($event, index)"> |
| | | <el-option :label="key.name" :value="key.name" v-for="(key, keyi) in item.processNodes" |
| | | :key="keyi"></el-option> |
| | | </el-select> |
| | | <el-divider content-position="left">æµç¨èç¹</el-divider> |
| | | |
| | | |
| | | <el-form :key="formKey" v-loading="nodeLoading" :model="collectParam" :rules="nodeRules" class="demo-form-inline" |
| | | label-position="left" |
| | | label-width="auto"> |
| | | <el-form-item v-for="(item, index) in initFrom" :key="index" :label="item.name" prop="node"> |
| | | <div @click="nodeChange(item)"> |
| | | <el-input v-model="collectParam[item.name+'name']" readonly="true" suffix-icon="el-icon-zoom-in"></el-input> |
| | | </div> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="handleCancel">å æ¶</el-button> |
| | | <el-button type="primary" @click="handleConfirm">ç¡® å®</el-button> |
| | | </div> |
| | | |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button size="small" @click="handleCancel">å æ¶</el-button> |
| | | <el-button size="small" type="primary" @click="handleConfirm">ç¡® å®</el-button> |
| | | </div> |
| | | <transfer ref="transfer" :left-role-data="leftRoleData" :right-role-data="rightRoleData" |
| | | :title="`为ã${this.nodeName}ãéåå¼`" :transferTitle="transferTitle" :bottomValue="bottomValue" |
| | | @transferSend="roleSendHandler"></transfer> |
| | | </el-dialog> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import {validatenull} from "@/util/validate"; |
| | | import {getTemplateByType, getAllProcessNode} from "@/api/base/startWork/index" |
| | | import {getTemplateByType, getAllProcessNode, startProcess} from "@/api/base/startWork/index" |
| | | |
| | | export default { |
| | | name: "startWorkFlow", |
| | |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | saveParam: {}, // 对象å
å« {modelNameæµç¨æ¨¡æ¿(ç±æ¥å£è¿åå½åæµç¨æ¨¡æ¿) , processNameæµç¨åç§°ï¼ä¸ºå½åç¨æ·+'å¯å¨æµç¨'+å½ååç±»ï¼ , processDescæµç¨æè¿° } |
| | | saveParam: { |
| | | processName: '' |
| | | }, // 对象å
å« {processTemplateæµç¨æ¨¡æ¿(ç±æ¥å£è¿åå½åæµç¨æ¨¡æ¿) , processNameæµç¨åç§°ï¼ä¸ºå½åç¨æ·+'å¯å¨æµç¨'+å½ååç±»ï¼ , processDescæµç¨æè¿° } |
| | | processTemplateList: [], // æµç¨æ¨¡æ¿ä¸ææ°ç» |
| | | initFrom: [], // å½åæµç¨èç¹å¾ªç¯æ°ç» |
| | | collectParam: {}, // æµç¨èç¹ä¸ææ¡ååç»å®å±æ§ |
| | | typeName: [], // æµç¨èç¹option循ç¯é项 |
| | | nodeLoading: false, |
| | | rules: { |
| | | processName: [ |
| | | {required: true, message: 'æµç¨åç§°ä¸è½ä¸ºç©º', trigger: 'blur'}, |
| | | {min: 3, max: 50, message: 'é¿åº¦å¨ 3 å° 50 个å符', trigger: 'blur'} |
| | | ] |
| | | } |
| | | }, |
| | | nodeRules: { |
| | | node: [ |
| | | {required: true, message: 'éæ©å
容ä¸è½ä¸ºç©º', trigger: 'change'}, |
| | | ] |
| | | }, |
| | | bottomValue:'', |
| | | leftRoleData: [], |
| | | rightRoleData: [], |
| | | transferTitle: [], |
| | | nodeName: '', // å½åèç¹åç§° |
| | | userVo: [ |
| | | { |
| | | "children": [], |
| | | "id": "zkjs", |
| | | "leaf": true, |
| | | "name": "æ»ä¼è®¡å¸", |
| | | "oid": "1241AC3B-26AF-9B86-7870-53DA8D78A742", |
| | | "secret": -1, |
| | | "secretText": "", |
| | | "type": "user" |
| | | }, |
| | | { |
| | | "children": [], |
| | | "id": "1", |
| | | "leaf": true, |
| | | "name": "æµè¯", |
| | | "oid": "921D71F8-C2BB-3BCE-B744-AD0C3812F41A", |
| | | "secret": -1, |
| | | "secretText": "", |
| | | "type": "user" |
| | | }, |
| | | { |
| | | "children": [], |
| | | "id": "5", |
| | | "leaf": true, |
| | | "name": "æ»ä¼è®¡å¸", |
| | | "oid": "34ddb5a8-ab95-4070-b72f-abaaa48cf8b1", |
| | | "secret": -1, |
| | | "secretText": "", |
| | | "type": "user" |
| | | } |
| | | ], |
| | | formKey: 0, |
| | | |
| | | } |
| | | }, |
| | | watch: { |
| | | users: { |
| | | handler(val) { |
| | | this.collectParam.flowTaskUsers = val |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | | }, |
| | | parameter: { |
| | | handler(newval, oldval) { |
| | | this.saveParam = Object.assign({processName: '', processDesc: '',}, newval); |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | | } |
| | | }, |
| | | watch: {}, |
| | | computed: { |
| | | fullscreen() { |
| | | if (this.paramVOS.width || this.paramVOS.height) { |
| | |
| | | }, |
| | | }, |
| | | created() { |
| | | this.modelNameChange(); |
| | | // this.modelNameChange(); |
| | | this.getWorkByType(); |
| | | }, |
| | | mounted() { |
| | |
| | | getWorkByType() { |
| | | let params = { |
| | | type: 'ææ¡£å®¡ç¾æµç¨', |
| | | filterTemplate: "" |
| | | filterTemplate: "ææ¡£å®¡ç¾æµç¨" |
| | | } |
| | | getTemplateByType(params).then(res => { |
| | | const data = res.data.data; |
| | | data.forEach(item => { |
| | | this.getProcessNode(item); |
| | | }) |
| | | this.initFrom = data; |
| | | }).catch(error => { |
| | | console.log(error); |
| | | const userInfo = JSON.parse(localStorage.getItem('saber-userInfo')); |
| | | |
| | | this.processTemplateList = data; |
| | | this.saveParam.processTemplate = data[0].value; |
| | | this.saveParam.processName = this.paramVOS.processName || userInfo.content.userName + '-' + data[0].value; // 对æµç¨æ¨¡æ¿ æµç¨åç§°èµé»è®¤å¼ |
| | | |
| | | this.getProcessNode(data[0].attributes.oid); // 馿¬¡è¿å
¥è°ç¨ç¬¬ä¸ä¸ªæ¨¡æ¿çææèç¹ |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | | }, |
| | | |
| | | // è¯·æ±æµç¨èç¹ |
| | | getProcessNode(item) { |
| | | getProcessNode(oid) { |
| | | let params = { |
| | | processOid: item.attributes.oid, |
| | | processOid: oid, |
| | | maxSecret: -1 |
| | | } |
| | | getAllProcessNode(params).then(res => { |
| | | const nodes = res.data.data; |
| | | item.processNodes = nodes; |
| | | }).catch(error => { |
| | | console.log(error); |
| | | this.initFrom = nodes; |
| | | nodes.forEach(item => { |
| | | // let name = item.processUserVO[0].children.map(name => name.name).join(','); |
| | | // let ids = item.processUserVO[0].children.map(id => id.id).join(','); |
| | | let name = this.userVo.map(name => name.name).join(','); |
| | | let ids = this.userVo.map(id => id.id).join(','); |
| | | this.bottomValue = name; |
| | | this.collectParam[item.name + 'name'] = name; |
| | | this.collectParam[item.name] = ids; |
| | | }) |
| | | this.nodeLoading = false; |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | | }, |
| | | |
| | |
| | | this.visible = false; |
| | | }, |
| | | |
| | | handleSelect() { |
| | | |
| | | }, |
| | | |
| | | handleCollect() { |
| | | |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.dialogClose(); |
| | | }, |
| | | |
| | | handleConfirm() { |
| | | console.log(this.initFrom); |
| | | const oids = this.dataStore.map(item => item.oid).join(','); |
| | | let params = { |
| | | deployid:this.processTemplateList[0].attributes.deploymentId, |
| | | title:this.saveParam.processName, |
| | | description:this.saveParam.processDesc, |
| | | btmType:this.processTemplateList[0].attributes.taskType, |
| | | uiType:this.processTemplateList[0].attributes.taskType, |
| | | oids:oids, // å½åæ°æ®oidï¼å¤ä¸ªç¨,åé |
| | | detailInfoUrl:this.paramVOS.detailInfoUrl || '', // ç¨æ·é
ç½®å±æ§ |
| | | resetStatus:'Editing', |
| | | nodeUsers:{ |
| | | ...this.collectParam |
| | | } |
| | | } |
| | | startProcess(params).then(res => { |
| | | if(res.data.obj.status === 200){ |
| | | this.dialogClose(); |
| | | this.$message.success('å¯å¨æµç¨æå'); |
| | | }else { |
| | | this.$message.error(res.data.obj.error); |
| | | } |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | | }, |
| | | |
| | | // æµç¨åç§°åå§åç»å® |
| | | modelNameChange() { |
| | | var userInfo = JSON.parse(localStorage.getItem('saber-userInfo')); |
| | | // 忢æµç¨æ¨¡æ¿ |
| | | proTemSelect(event) { |
| | | this.nodeLoading = true; |
| | | this.getProcessNode(event); |
| | | this.$refs.nodeForm.clearValidate(); |
| | | }, |
| | | |
| | | if (this.paramVOS && this.paramVOS.modelName) { |
| | | this.saveParam.modelName = this.paramVOS.modelName; |
| | | } else if (userInfo.content && userInfo.content.userName) { |
| | | this.saveParam.modelName = userInfo.content.userName + 'å¯å¨æµç¨'; |
| | | } else { |
| | | this.saveParam.modelName = ''; |
| | | } |
| | | } |
| | | // èç¹ç¹å»äºä»¶ |
| | | nodeChange(item) { |
| | | this.nodeName = item.name; |
| | | this.transferTitle = [`[${item.name}]æªéç¨æ·`, `[${item.name}]å·²éç¨æ·`] |
| | | this.leftRoleData = [ |
| | | { |
| | | "children": [], |
| | | "id": "zkjs", |
| | | "leaf": true, |
| | | "name": "æ»ä¼è®¡å¸", |
| | | "oid": "1241AC3B-26AF-9B86-7870-53DA8D78A742", |
| | | "secret": -1, |
| | | "secretText": "", |
| | | "type": "user" |
| | | }, |
| | | { |
| | | "children": [], |
| | | "id": "1", |
| | | "leaf": true, |
| | | "name": "æµè¯", |
| | | "oid": "921D71F8-C2BB-3BCE-B744-AD0C3812F41A", |
| | | "secret": -1, |
| | | "secretText": "", |
| | | "type": "user" |
| | | }, |
| | | { |
| | | "children": [], |
| | | "id": "5", |
| | | "leaf": true, |
| | | "name": "æ»ä¼è®¡å¸", |
| | | "oid": "34ddb5a8-ab95-4070-b72f-abaaa48cf8b1", |
| | | "secret": -1, |
| | | "secretText": "", |
| | | "type": "user" |
| | | } |
| | | ]; |
| | | this.rightRoleData = this.userVo.map(item => item.oid); |
| | | this.$refs.transfer.visible = true; |
| | | }, |
| | | |
| | | // ç©¿æ¢æ¡åå¡« |
| | | roleSendHandler(data) { |
| | | let filterData; |
| | | filterData = this.userVo.filter(item => { |
| | | return data.includes(item.oid); |
| | | }); |
| | | const filterName = filterData.map(item => item.name).join(','); |
| | | this.$set(this.collectParam, this.nodeName + 'name', filterName); |
| | | this.formKey += 1; // å·æ°è¡¨å å 为ååç»å®çthis.collectParam[this.nodeName + 'name']æ¯å¨æå¼ vueæ æ³æ£æµå°å¼çæ´æ° |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .el-form-item { |
| | | margin-bottom: 25px; |
| | | } |
| | | |
| | | .el-divider--horizontal { |
| | | margin-bottom: 20px !important; |
| | | } |
| | | |
| | | .el-divider__text.is-left { |
| | | color: #8b8989 !important; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :width="width" |
| | | :visible.sync="visible" |
| | | :destroy-on-close="true" |
| | | :close-on-click-modal="false" |
| | | :destroy-on-close="true" |
| | | :visible.sync="visible" |
| | | :width="width" |
| | | append-to-body |
| | | title="ä¸ä¼ æä»¶" |
| | | class="avue-dialog" |
| | | title="ä¸ä¼ æä»¶" |
| | | style="margin-top: -20vh !important;" |
| | | > |
| | | <Divider left="30px" text="导å
¥æç¤º"></Divider> |
| | | <ul> |
| | | <li> |
| | | 1.红è²åä½è¡¨ç¤ºå¿
è¾é¡¹ |
| | | </li> |
| | | <li> |
| | | 2.æ¯æ¬¡ä»
è½æå¤å¯¼å
¥10000æ¡æ°æ® |
| | | 请ç¹å»æµè§æä»¶è¿è¡ä¸ä¼ |
| | | </li> |
| | | </ul> |
| | | <Divider left="30px" text="excelæä»¶ï¼éæ©æä»¶åä¼èªå¨ä¸ä¼ "></Divider> |
| | | <Divider left="30px" text="éæ©æä»¶åä¼èªå¨ä¸ä¼ "></Divider> |
| | | <el-upload |
| | | :before-upload="beforeUpload" |
| | | :data="fileData" |
| | | :headers="uploadHeaders" |
| | | :on-change="uploadChange" |
| | | :on-error="onError" |
| | | :on-success="onSuccess" |
| | | :show-file-list="false" |
| | | accept=".xlsx, .xls" |
| | | action="/api/ubcs-code/codeClassify/importClassify" |
| | | action="/api/vciFileUploadController/uploadFile" |
| | | class="upload-demo"> |
| | | <el-button size="small" style="margin: 15px 35px" type="primary">æµè§æä»¶</el-button> |
| | | </el-upload> |
| | | <template #footer> |
| | | <el-button |
| | | :loading="downloadLoading" |
| | | size="small" |
| | | type="primary" |
| | | @click="downloadTemplateFun" |
| | | >ä¸è½½å¯¼å
¥æ¨¡æ¿ |
| | | </el-button |
| | | > |
| | | <el-button size="small" @click="visible = false">å
³é</el-button> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | flga: true, |
| | | pageLoading: null, |
| | | downloadLoading: false, |
| | | visible:false, |
| | | visible: false, |
| | | } |
| | | }, |
| | | created() { |
| | | console.log(this.sourceData); |
| | | }, |
| | | watch: { |
| | | visible: { |
| | |
| | | computed: { |
| | | uploadHeaders() { |
| | | return { |
| | | "Blade-Auth": "bearer " + getToken(), |
| | | "Authorizationtoken": getToken(), |
| | | }; |
| | | }, |
| | | fileData() { |
| | | return { |
| | | ownbizOid: this.sourceData.oid, |
| | | ownBtmName: this.sourceData.btmname, |
| | | secretGrade: -1, |
| | | fileDocClassify: '', |
| | | updateFileFlag: true, |
| | | } |
| | | }, |
| | | width() { |
| | | if (!validatenull(this.paramVOS.width)) { |
| | |
| | | return this.paramVOS.width + "px"; |
| | | } |
| | | } else { |
| | | return "60%"; |
| | | return "40%"; |
| | | } |
| | | }, |
| | | fullscreen(){ |
| | | fullscreen() { |
| | | console.log(this.paramVOS) |
| | | if(this.paramVOS.width || this.paramVOS.height){ |
| | | if (this.paramVOS.width || this.paramVOS.height) { |
| | | return false; |
| | | }else if(this.paramVOS.form){ |
| | | } else if (this.paramVOS.form) { |
| | | return false; |
| | | } |
| | | return true; |
| | |
| | | methods: { |
| | | //æä»¶ä¸ä¼ å |
| | | async beforeUpload(file) { |
| | | const fileType = file.name.split(".").pop(); |
| | | if (fileType !== "xlsx" && fileType !== "xls") { |
| | | // ä¸ä¼ æ ¼å¼ä¸ç¬¦åè¦æ±ï¼æç¤ºé误信æ¯å¹¶åæ¶ä¸ä¼ |
| | | this.$message.error("åªå
许ä¸ä¼ xlsxãxlsæ ¼å¼çæä»¶"); |
| | | return Promise.reject(false); |
| | | // è·åæä»¶æ©å±å |
| | | const fileExtension = file.name.split(".").pop().toLowerCase(); // 转æ¢ä¸ºå°å以é¿å
大å°åä¸å¹é
çé®é¢ |
| | | |
| | | if(this.paramVOS.fileType){ |
| | | if (!this.paramVOS.fileType.includes(fileExtension)) { |
| | | // ä¸ä¼ æ ¼å¼ä¸ç¬¦åè¦æ±ï¼æç¤ºé误信æ¯å¹¶åæ¶ä¸ä¼ |
| | | this.$message.error(`åªå
许ä¸ä¼ ${this.paramVOS.fileType.toString()}æ ¼å¼çæä»¶`); |
| | | return Promise.reject(false); |
| | | } |
| | | } |
| | | |
| | | this.pageLoading = this.$loading({ |
| | | lock: true, |
| | | text: "æä»¶ä¸ä¼ ä¸", |
| | | spinner: "el-icon-loading", |
| | | background: "rgba(0, 0, 0, 0.7)", |
| | | }); |
| | | |
| | | return true; |
| | | }, |
| | | // æä»¶ä¸ä¼ æå |
| | | onSuccess(resbonse) { |
| | | if (Object.keys(resbonse.data).length === 0) { |
| | | if (resbonse.code === 200) { |
| | | this.$message.success("ä¸ä¼ æåï¼"); |
| | | this.dialogVisible = false; |
| | | return; |
| | | }else { |
| | | this.$message.error(resbonse.msg); |
| | | } |
| | | if (resbonse.data.fileOid) { |
| | | const fileName = resbonse.data.filePath.split("/").pop(); |
| | | this.$message.error("请ä¸è½½éè¯¯ä¿¡æ¯æä»¶è¿è¡æ¥çï¼"); |
| | | downloadErrorFile({uuid: resbonse.data.fileOid}).then((res) => { |
| | | func.downloadFileByBlobHandler(res); |
| | | }); |
| | | } |
| | | }, |
| | | //ç¹å»ä¸è½½æ¨¡æ¿ |
| | | downloadTemplateFun() { |
| | | this.downloadLoading = true; |
| | | downloadBatchImportApplyTemplate({codeClassifyOid: this.codeClassifyOid}).then(res => { |
| | | this.$utilFunc.downloadFileByBlob(res.data, "æ¨¡æ¿æä»¶.xls"); |
| | | this.downloadLoading = false; |
| | | }).catch((res) => { |
| | | this.$message.warning(res) |
| | | this.downloadLoading = false; |
| | | }) |
| | | }, |
| | | //æä»¶ä¸ä¼ 失败 |
| | | onError(res) { |
| | | this.pageLoading.close(); |
| | | this.$message.error(res); |
| | | }, |
| | | //æä»¶ç¶ææ¹å |
| | | uploadChange(file) { |
| | |
| | | import {validatenull} from "@/util/validate"; |
| | | import Vue from "vue"; |
| | | import uploadFileDialog from "@/components/actions/base/uploadFile" |
| | | import func from "@/util/func"; |
| | | |
| | | |
| | | export const doAction = (options,callback) => { |
| | | options.sourceData = options.sourceData || {}; |
| | | options.dataStore = options.dataStore || []; |
| | | |
| | | if (func.isEmptyObject(options.sourceData)) { |
| | | Vue.prototype.$message.error("è¯·éæ©è¦ä¸ä¼ çåç±»ï¼"); |
| | | return false; |
| | | } |
| | | callPreEvent(options, doBefore, function (options) { |
| | | showStartWindow(options, function () { |
| | | callPostEvent(options, doAfter, callback,type); |
| | |
| | | uploadfile: () => {import("@/components/actions/base/uploadFileAction").then(module => { |
| | | module.doAction(options,callback); |
| | | })}, |
| | | //ä¸ä¼ æä»¶ |
| | | //ä¸è½½æä»¶ |
| | | downloadfile: () => {import("@/components/actions/base/downloadFileAction").then(module => { |
| | | module.doAction(options,callback); |
| | | })}, |
| | |
| | | // 坿æ¬ç»ä»¶ |
| | | import richText from '@/components/PLT-basic-component/richText' |
| | | // ä¸ä¼ æä»¶ç»ä»¶ |
| | | import UploadFiles from '@/components/PLT-basic-component/Upload-files' |
| | | import uploadFile from '@/components/PLT-basic-component/upload-file' |
| | | // 表åä¸ä¼ æä»¶ç»ä»¶ |
| | | import formUpload from "@/components/PLT-basic-component/formUpload"; |
| | | // ç©¿æ¢æ¡ç»ä»¶ |
| | |
| | | Vue.component('dynamicTableForm', dynamicTableForm); |
| | | Vue.component('dynamicForm', dynamicForm); |
| | | Vue.component('richText', richText); |
| | | Vue.component('UploadFiles', UploadFiles); |
| | | Vue.component('uploadFile', uploadFile); |
| | | Vue.component('formUpload', formUpload); |
| | | Vue.component('Divider', Divider); |
| | | Vue.component('transfer', transfer); |
| | |
| | | searchIcon:true, |
| | | selection:true, |
| | | stripe:true, |
| | | headerAlign: 'center', |
| | | align: 'center', |
| | | // selection æ¯å¦æéæ©æ¡ |
| | | // indexFixed:true/left/right, åºå®å |
| | | // menu:false, æ¯å¦ææä½æ |
| | | // menuTitle:xxx, æä½æ æ é¢ |
| | | // stripe æ¡çº¹ |
| | | } |
| | |
| | | <basic-container> |
| | | <avue-crud |
| | | ref="userCrud" |
| | | :before-open="beforeOpen" |
| | | :data="tableData" |
| | | :option="option" |
| | | :page.sync="page" |
| | |
| | | @current-change="currentChange" |
| | | @selection-change="selectChange" |
| | | @row-click="rowClickHandler" |
| | | @row-save="rowSaveHandler" |
| | | @row-update="rowUpdateHandler" |
| | | > |
| | | <!-- é¨é¨å¤´é¨æç´¢ææ§½ --> |
| | | <template slot-scope="{disabled,size}" slot="pkDepartmentNameSearch"> |
| | | <div style="display: flex;gap: 5px"> |
| | | <el-select v-model="departSearchValue" clearable placeholder="è¯·éæ©é¨é¨"> |
| | | <el-option :label="departSearchObj.name" :value="departSearchObj.oid"></el-option> |
| | | </el-select> |
| | | <el-button size="small" type="success" @click="dialogDepartSearchHandler">éæ©é¨é¨</el-button> |
| | | </div> |
| | | </template> |
| | | |
| | | <!-- å¯¹è¯æ¡é¨é¨ææ§½ --> |
| | | <template slot="pkDepartmentNameForm" slot-scope="scope"> |
| | | <div style="display: flex;gap: 5px"> |
| | | <el-select v-model="departValue" clearable placeholder="è¯·éæ©é¨é¨"> |
| | | <el-option :label="departObj.name" :value="departObj.oid"></el-option> |
| | | </el-select> |
| | | <el-button size="small" type="success" @click="dialogDepartHandler">éæ©é¨é¨</el-button> |
| | | </div> |
| | | </template> |
| | | |
| | | <template slot="status" slot-scope="{row}"> |
| | | <el-tag v-if="row.status === 0" type="success">å¯ç¨</el-tag> |
| | | <el-tag v-if="row.status === 1" type="danger">åç¨</el-tag> |
| | |
| | | </template> |
| | | |
| | | <template #menu="{row,index,size}"> |
| | | <el-button size="small" type="text" @click="stopUserHandler(row)"> |
| | | <el-button icon="el-icon-edit" size="small" type="text" @click.stop="rowEditHandler(row,index)">ç¼è¾</el-button> |
| | | <el-button icon="el-icon-delete" size="small" type="text" @click.stop="rowDeleteHandler(row)">å é¤</el-button> |
| | | <el-button size="small" type="text" @click.stop="stopUserHandler(row)"> |
| | | <span v-if="row.status === 0" style="color: #fa3434"><i class="el-icon-video-pause"></i> åç¨</span> |
| | | <span v-if="row.status === 1" style="color: #55b61d"><i class="el-icon-video-pause"></i> å¯ç¨</span> |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger">å é¤</el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger" @click="allDelHandler">å é¤</el-button> |
| | | <el-button icon="el-icon-user" plain size="small" type="primary" @click="roleHandler">åé
è§è²</el-button> |
| | | <el-button icon="el-icon-school" plain size="small" type="primary">åé
é¨é¨</el-button> |
| | | <el-button icon="el-icon-key" plain size="small" type="success">设置å¯ç çç¥</el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary">导å
¥äººå</el-button> |
| | | <el-button icon="el-icon-download" plain size="small" type="primary">ä¸è½½å¯¼å
¥æ¨¡æ¿</el-button> |
| | | <el-button icon="el-icon-school" plain size="small" type="primary" @click="departmentHandler">åé
é¨é¨</el-button> |
| | | <el-button icon="el-icon-key" plain size="small" type="success" @click="setPwsHandler">设置å¯ç çç¥</el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadRole">导å
¥äººå</el-button> |
| | | <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadHandler">ä¸è½½å¯¼å
¥æ¨¡æ¿</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <transfer ref="transfer" :left-role-data="leftRoleData" :right-role-data="rightRoleData" title="åé
è§è²" |
| | | @transferSend="roleSendHandler"></transfer> |
| | | |
| | | <!-- åé
è§è²ç©¿æ¢æ¡ --> |
| | | <transfer ref="transfer" :left-role-data="leftRoleData" :right-role-data="rightRoleData" |
| | | :transferTitle="transferTitle" title="åé
è§è²" |
| | | @transferSend="roleSendHandler"> |
| | | </transfer> |
| | | |
| | | <!-- 设置å¯ç çç¥å¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | v-loading="pwdLoading" |
| | | :destroy-on-close="true" |
| | | :visible.sync="pwdVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | style="margin-top: -15vh !important;" |
| | | title="设置å¯ç çç¥" |
| | | width="30%" |
| | | > |
| | | |
| | | <div class="password-strategy-container"> |
| | | <div><i class="el-icon-setting"/>设置å¯ç çç¥ï¼</div> |
| | | <el-select v-model="pwdValue" placeholder="è¯·éæ©å¯ç çç¥"> |
| | | <el-option v-for="(item,index) in pwdList" :key="index" :label="item.name" :value="item.id"></el-option> |
| | | </el-select> |
| | | </div> |
| | | |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button size="small" @click="pwdVisible = false">å æ¶</el-button> |
| | | <el-button size="small" type="primary" @click="savePwdHandler">ç¡® å®</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <!-- 导å
¥äººå --> |
| | | <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" title="导å
¥äººå"></upload-file> |
| | | |
| | | <!-- åé
é¨é¨å¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | v-loading="departLoading" |
| | | :destroy-on-close="true" |
| | | :visible.sync="departVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="åé
é¨é¨" |
| | | width="50%" |
| | | > |
| | | <avue-crud |
| | | ref="departCrud" |
| | | :data="departData" |
| | | :option="departOption" |
| | | @current-row-change="handleCurrentRowChange" |
| | | > |
| | | </avue-crud> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button size="small" @click="departVisible = false">å æ¶</el-button> |
| | | <el-button size="small" type="primary" @click="saveDepartHandler">ç¡® å®</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import basicOption from '@/util/basic-option' |
| | | import {getDataUsers, stopUser, gridRoles, listRoleByUserOid, saveRights, addUser, updateUser, deleteUser} from '@/api/system/user/api' |
| | | import { |
| | | getDataUsers, |
| | | stopUser, |
| | | gridRoles, |
| | | listRoleByUserOid, |
| | | saveRights, |
| | | addUser, |
| | | updateUser, |
| | | deleteUser, |
| | | selectPwdStrategyMap, |
| | | saveUserPasswordStrateg, |
| | | download, |
| | | departmentQueryController, |
| | | saveUsersDepts |
| | | } from '@/api/system/user/api' |
| | | import {column} from "./option" |
| | | import func from '@/util/func' |
| | | |
| | | export default { |
| | | name: "userManage", |
| | | data() { |
| | | data: function () { |
| | | return { |
| | | departSearchObj:{}, |
| | | departSearchValue:'', |
| | | loadKey: 0, |
| | | departStatus: '', // åºåä¸åæ¹å¼æå¼é¨é¨å¯¹è¯æ¡ |
| | | departValue: '', // é¨é¨å¯¹è¯æ¡ä¸ææ¡ç»å®å¼ |
| | | departObj: {}, // é¨é¨å¯¹è¯æ¡ä¸ææ¡é项ç»å®å¼ |
| | | departCurrenRow: {}, |
| | | departOption: { |
| | | ...basicOption, |
| | | rowKey: 'oid', |
| | | rowParentKey: 'parentId', |
| | | selection: false, |
| | | highlightCurrentRow: true, |
| | | stripe: false, |
| | | menu: false, |
| | | refreshBtn: false, |
| | | gridBtn: false, |
| | | column: [ |
| | | { |
| | | label: 'åç§°', |
| | | prop: 'name', |
| | | }, |
| | | { |
| | | label: 'ç¼å·', |
| | | prop: 'id', |
| | | }, |
| | | { |
| | | label: 'æè¿°', |
| | | prop: 'description', |
| | | }, |
| | | ] |
| | | }, |
| | | departData: [], |
| | | departLoading: false, |
| | | departVisible: false, |
| | | upFileType: ['xls', 'xlsx'], |
| | | fileUrl: 'api/userQueryController/importUser', |
| | | pwdVisible: false, |
| | | pwdLoading: false, |
| | | pwdValue: '', |
| | | pwdList: [], |
| | | tableLoading: false, |
| | | tableData: [], |
| | | option: { |
| | | ...basicOption, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | dialogWidth: '50%', |
| | | calcHeight: -60, |
| | | column: column |
| | | }, |
| | |
| | | }, |
| | | searchParams: {}, |
| | | selectList: [], |
| | | leftRoleData: [], // åé
è§è²ç©¿æ¢æ¡å·¦ä¾§é»è®¤æ°æ® |
| | | rightRoleData: [], // åé
è§è²ç©¿æ¢æ¡å³ä¾§é»è®¤æ°æ® |
| | | leftRoleData: [], // åé
è§è²ç©¿æ¢æ¡å·¦ä¾§åå§æ°æ® |
| | | rightRoleData: [], // åé
è§è²ç©¿æ¢æ¡å³ä¾§åå§æ°æ® |
| | | transferTitle: ['ç°æè§è²', 'æ¥æè§è²'] |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | // æ°å¢æä¿®æ¹å¯¹è¯æ¡æå¼å |
| | | beforeOpen(done, type) { |
| | | if(type == 'add'){ |
| | | this.departObj = {}; |
| | | this.departValue = ""; |
| | | } |
| | | done(); |
| | | }, |
| | | // è¡¨æ ¼è¯·æ± |
| | | getTableList() { |
| | | this.tableLoading = true; |
| | |
| | | |
| | | // æç´¢æ¥è¯¢ |
| | | handleSearch(params, done) { |
| | | this.searchParams = {}; |
| | | if(this.departSearchObj && this.departSearchValue){ |
| | | this.searchParams['conditionMap["pkDepartment"]'] = this.departSearchValue; |
| | | } |
| | | |
| | | if (!func.isEmptyObject(params)) { |
| | | for (let key in params) { |
| | | if (params.hasOwnProperty(key)) { |
| | |
| | | this.searchParams[`conditionMap["${newKey}"]`] = params[key]; |
| | | } |
| | | } |
| | | } else { |
| | | } |
| | | |
| | | if (func.isEmptyObject(params) && !this.departSearchValue) { |
| | | this.searchParams = {}; |
| | | } |
| | | |
| | | this.getTableList(); |
| | | done(); |
| | | }, |
| | | |
| | | // éç½®æç´¢æ¡ä»¶ |
| | | handleReset() { |
| | | this.departSearchObj = {}; |
| | | this.departSearchValue = ""; |
| | | this.searchParams = {}; |
| | | this.getTableList(); |
| | | }, |
| | |
| | | // ç©¿æ¢æ¡ç»ä»¶åå¡« |
| | | roleSendHandler(row) { |
| | | let params = { |
| | | userOid: this.selectList[0].oid, |
| | | userOids: this.selectList[0].oid, |
| | | roleIds: row.join(',') |
| | | } |
| | | saveRights(params).then(res => { |
| | |
| | | }).catch(err => { |
| | | this.$message.error(err) |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // 设置å¯ç çç¥ |
| | | setPwsHandler() { |
| | | if (this.selectList.length <= 0) { |
| | | this.$message.warning('æ¸
å
éæ©äººååè¿è¡æä½ï¼') |
| | | return; |
| | | } |
| | | this.pwdLoading = false; |
| | | selectPwdStrategyMap().then(res => { |
| | | if (res.data.code === 200) { |
| | | this.pwdList = res.data.data; |
| | | this.pwdValue = res.data.data[0].id; |
| | | console.log(res.data) |
| | | this.pwdVisible = true; |
| | | this.pwdLoading = false; |
| | | } else { |
| | | this.$message.error(res.data.msg); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // ä¿åå¯ç çç¥ |
| | | savePwdHandler() { |
| | | let params = { |
| | | userIds: this.selectList.map(item => item.oid).join(','), |
| | | passwordStrategId: this.pwdValue |
| | | } |
| | | saveUserPasswordStrateg(params).then(res => { |
| | | this.pwdVisible = false; |
| | | this.$message.success(res.data.obj) |
| | | }).catch(err => { |
| | | this.$message.error(err) |
| | | }) |
| | | }, |
| | | |
| | | // æ°å¢ |
| | | rowSaveHandler(row, done) { |
| | | if (row.password != row.confirmPassword) { |
| | | this.$message.error('è¯·æ£æ¥ä¸¤æ¬¡å¯ç æ¯å¦è¾å
¥ä¸è´ï¼') |
| | | return this.$refs.userCrud.$refs.dialogForm.$refs.tableForm.allDisabled = false; |
| | | } |
| | | row.pkDepartment = this.departValue; // å°å½åè¡çé¨é¨åæ°pkDepartment èµå¼ä¸ºä¸ææ¡ç»å®çå¼ |
| | | addUser(row).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTableList(); |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | done() |
| | | }, |
| | | |
| | | // æä½æ ç¼è¾ |
| | | rowEditHandler(row, index) { |
| | | let obj = { name: row.pkDepartmentName, oid: row.pkDepartment, rowOid: row.oid }; |
| | | this.departValue = row.pkDepartment; |
| | | this.departObj = obj; |
| | | |
| | | if (this.departObj.rowOid) { |
| | | this.$refs.userCrud.rowEdit(row, index); |
| | | } |
| | | |
| | | }, |
| | | |
| | | // ç¼è¾ |
| | | rowUpdateHandler(row, index, done) { |
| | | if (row.password != row.confirmPassword) { |
| | | this.$message.error('è¯·æ£æ¥ä¸¤æ¬¡å¯ç æ¯å¦è¾å
¥ä¸è´ï¼') |
| | | return this.$refs.userCrud.$refs.dialogForm.$refs.tableForm.allDisabled = false; |
| | | } |
| | | row.pkDepartment = this.departValue; // å°å½åè¡çé¨é¨åæ°pkDepartment èµå¼ä¸ºä¸ææ¡ç»å®çå¼ |
| | | updateUser(row).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTableList(); |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }); |
| | | done() |
| | | }, |
| | | |
| | | // å é¤ |
| | | rowDeleteHandler(row) { |
| | | let params = { |
| | | ids: row.oid |
| | | } |
| | | deleteUser(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTableList(); |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | }, |
| | | |
| | | // å¤éå é¤ |
| | | allDelHandler() { |
| | | let params = { |
| | | ids: this.selectList.map(item => item.oid).join(',') |
| | | } |
| | | if (this.selectList.length <= 0) { |
| | | this.$message.warning('请è³å°éæ©ä¸æ¡æ°æ®è¿è¡å é¤ï¼') |
| | | return; |
| | | } |
| | | this.$confirm('æ¨ç¡®å®è¦å 餿鿩çæååï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteUser(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTableList(); |
| | | } |
| | | }); |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // ä¸è½½å¯¼å
¥æ¨¡æ¿ |
| | | downloadHandler() { |
| | | download().then(res => { |
| | | console.log(res); |
| | | func.downloadFileByBlobHandler(res); |
| | | this.$message.success('ä¸è½½æå') |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | | }, |
| | | |
| | | // 导å
¥äººå |
| | | uploadRole() { |
| | | this.$refs.upload.visible = true; |
| | | }, |
| | | |
| | | // åé
é¨é¨ |
| | | departmentHandler() { |
| | | if (this.selectList.length <= 0) { |
| | | this.$message.warning('æ¸
å
éæ©äººååè¿è¡æä½ï¼') |
| | | return; |
| | | } |
| | | this.departStatus = 'default'; // åºåä¸åæ¹å¼æå¼é¨é¨å¯¹è¯æ¡ |
| | | this.departmentQueryOnLoad(); |
| | | }, |
| | | |
| | | // åé
é¨é¨è¡¨æ ¼åå§åè¯·æ± |
| | | departmentQueryOnLoad() { |
| | | departmentQueryController({queryAllLevel: true}).then(res => { |
| | | const data = res.data.treeData; |
| | | this.departData = this.departDtaFormAtter(data); |
| | | this.departVisible = true; |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | | }, |
| | | |
| | | // åé
é¨é¨æ°æ®è½¬æ¢ |
| | | departDtaFormAtter(items) { |
| | | return items.map(item => { |
| | | // 转æ¢å½åèç¹ç屿§ |
| | | const formList = { |
| | | oid: item.oid, |
| | | id: item.attributes.id, |
| | | name: item.attributes.name, |
| | | description: item.attributes.description, |
| | | parentId: item.parentId, |
| | | parentName: item.parentName, |
| | | parentBtmName: item.parentBtmName, |
| | | // 妿childrenåå¨ä¸ä¸ä¸ºç©ºï¼åéå½è½¬æ¢children |
| | | children: item.children && item.children.length > 0 ? this.departDtaFormAtter(item.children) : undefined |
| | | }; |
| | | return formList; |
| | | }); |
| | | }, |
| | | |
| | | // åé
é¨é¨ è¡åé |
| | | handleCurrentRowChange(row) { |
| | | this.departCurrenRow = row; |
| | | }, |
| | | |
| | | // åé
é¨é¨ ä¿å |
| | | saveDepartHandler() { |
| | | if (func.isEmptyObject(this.departCurrenRow)) { |
| | | this.$message.warning('è¯·éæ©é¨é¨èç¹ï¼') |
| | | return; |
| | | } |
| | | |
| | | if (this.departStatus == 'default') { |
| | | let params = { |
| | | userOIds: this.selectList.map(item => item.oid).join(','), |
| | | deptId: this.departCurrenRow.oid, |
| | | }; |
| | | saveUsersDepts(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.departVisible = false; |
| | | this.getTableList(); |
| | | this.$message.success('åé
æåï¼') |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | return; |
| | | } |
| | | |
| | | if (this.departStatus == 'handle') { |
| | | this.departObj = this.departCurrenRow; |
| | | this.departValue = this.departCurrenRow.oid; |
| | | this.departVisible = false; |
| | | return;; |
| | | } |
| | | |
| | | if(this.departStatus == 'search'){ |
| | | this.departSearchObj = this.departCurrenRow; |
| | | this.departSearchValue = this.departCurrenRow.oid; |
| | | this.departVisible = false; |
| | | return; |
| | | } |
| | | }, |
| | | |
| | | // å¯¹è¯æ¡åé
é¨é¨æé® |
| | | dialogDepartHandler() { |
| | | this.departmentQueryOnLoad(); |
| | | this.departStatus = 'handle'; // åºåä¸åæ¹å¼æå¼é¨é¨å¯¹è¯æ¡ |
| | | }, |
| | | |
| | | // æç´¢å¯¹è¯æ¡åé
é¨é¨æé® |
| | | dialogDepartSearchHandler(){ |
| | | this.departmentQueryOnLoad(); |
| | | this.departStatus = 'search'; // åºåä¸åæ¹å¼æå¼é¨é¨å¯¹è¯æ¡ |
| | | }, |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | <style lang="scss" scoped> |
| | | .password-strategy-container { |
| | | padding-left: 20px; |
| | | display: flex; |
| | | //justify-content: center; |
| | | align-items: center; |
| | | gap: 10px; |
| | | } |
| | | |
| | | </style> |
| | |
| | | export const column = [ |
| | | export let column = [ |
| | | { |
| | | label: 'è´¦å·', |
| | | prop: 'id', |
| | | search:true, |
| | | sortable:true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请è¾å
¥å§å', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: 'å§å', |
| | | prop: 'name', |
| | | align:'center', |
| | | search:true, |
| | | sortable:true |
| | | }, { |
| | | label: 'è´¦å·', |
| | | prop: 'id', |
| | | align:'center', |
| | | search:true, |
| | | sortable:true |
| | | sortable:true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请è¾å
¥å§å', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: 'å¯ç ', |
| | | prop: 'password', |
| | | hide:true, |
| | | type:'password', |
| | | change: (val)=>{ |
| | | const confirmPasswordColumn = column.find(item => item.prop === 'confirmPassword'); |
| | | confirmPasswordColumn.disabled = val.value === ""; |
| | | }, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请è¾å
¥å¯ç ', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: '确认å¯ç ', |
| | | prop: 'confirmPassword', |
| | | hide:true, |
| | | type:'password', |
| | | disabled:true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: 'è¯·åæ¬¡ç¡®è®¤å¯ç ', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: 'ç¶æ', |
| | | prop: 'status', |
| | | align: 'center', |
| | | display:false, |
| | | sortable:true, |
| | | slot: true, |
| | |
| | | { |
| | | label: 'éå®ç¶æ', |
| | | prop: 'lockFlag', |
| | | align:'center', |
| | | sortable:true, |
| | | display:false, |
| | | }, |
| | |
| | | search:true, |
| | | sortable:true, |
| | | searchslot:true, |
| | | formslot:true, |
| | | }, |
| | | { |
| | | label: 'ä¸ä¸', |
| | | prop: 'specialties', |
| | | align:'center', |
| | | sortable:true, |
| | | }, |
| | | { |
| | | label: 'è§è²', |
| | | prop: 'pkPersonName', |
| | | align:'center', |
| | | type:'select', |
| | | dicUrl: 'api/roleQueryController/gridRoles', |
| | | dicUrl: 'api/roleQueryController/refDataGrid', |
| | | props: { |
| | | label: 'name', |
| | | value: 'oid' |
| | |
| | | { |
| | | label: 'çµåé®ä»¶', |
| | | prop: 'email', |
| | | align:'center', |
| | | sortable:true, |
| | | overHidden: true, |
| | | row:true |
| | | }, |
| | | { |
| | | label: 'æè¿°', |
| | | type:'textarea', |
| | | prop: 'description', |
| | | align:'center', |
| | | sortable:true, |
| | | overHidden: true, |
| | | }, |
| | | { |
| | | label: 'é¨é¨é¢å¯¼', |
| | | prop: 'isDeptLeader', |
| | | align:'center', |
| | | sortable:true, |
| | | display:false, |
| | | }, |
| | | { |
| | | label: 'æå±å¯çº§', |
| | | prop: 'secretGradeText', |
| | | align:'center', |
| | | sortable:true, |
| | | display:false, |
| | | } |
| | | }, |
| | | ]; |
| | |
| | | proxy: { |
| | | '/api': { |
| | | //æ¬å°æå¡æ¥å£å°å |
| | | target: 'http://localhost:12000/web', |
| | | // target: 'http://localhost:12000/web', |
| | | target: 'http://192.168.0.105:12005/web', // yxc |
| | | // target: 'http://192.168.0.103:12005/web', // ldc |
| | | // target: 'http://dev.vci-tech.com:37000', |
| | | //è¿ç¨æ¼ç¤ºæå¡å°å,å¯ç¨äºç´æ¥å¯å¨é¡¹ç® |
| | | //target: 'https://saber.bladex.vip/api/', |