Merge remote-tracking branch 'origin/master'
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æ°æ®æéæä½ä¿¡æ¯ä¼ è¾å¯¹è±¡ |
| | | * @author yuxc |
| | | * @date 2024/12/4 |
| | | */ |
| | | @Data |
| | | public class AuthResultDTO implements java.io.Serializable { |
| | | |
| | | /** |
| | | * ç¦æ¢ä¿®æ¹è¿ä¸ªå¼ |
| | | */ |
| | | private static final long serialVersionUID = 814342725285373312L; |
| | | |
| | | // 设置Tableåå¤´ä¿¡æ¯ |
| | | List<String> tableHeader; |
| | | |
| | | //åè¡¨æ°æ® |
| | | List<Object> tableValues; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.pagemodel; |
| | | |
| | | /** |
| | | * æä½å¯¹è±¡ |
| | | */ |
| | | public class OpItemVO extends Object{ |
| | | private String name; |
| | | private Object value; |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | public Object getValue() { |
| | | return value; |
| | | } |
| | | public void setValue(Object value) { |
| | | this.value = value; |
| | | } |
| | | public boolean equals(Object obj) { |
| | | if (obj != null) { |
| | | if (((OpItemVO) obj).name == this.name) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | public String toString() { |
| | | return name+" , "+value; |
| | | } |
| | | |
| | | } |
| | |
| | | import java.io.IOException; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * é¨é¨çæ¥è¯¢æ§å¶å¨ |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·ä¸»é®è·åå
³èçé¨é¨ |
| | | * @param userOid ç¨æ·ä¸»é® |
| | | * @param queryMap æ¥è¯¢æ¡ä»¶ï¼å¦æéè¦ä½¿ç¨ç¨æ·ç屿§æ¥æ¥è¯¢å¯ä»¥ä½¿ç¨pkUser.xxxx |
| | | * @return é¨é¨çæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @RequestMapping(value = "/listDeptByUserOid",method = RequestMethod.GET) |
| | | public BaseResult listDeptByUserOid(String userOid, Map<String, String> queryMap){ |
| | | List<OrgDepartmentVO> listData=deptQueryService.listDeptByUserOid(userOid, queryMap); |
| | | return BaseResult.dataList(listData); |
| | | } |
| | | } |
| | |
| | | * @throws VciBaseException |
| | | */ |
| | | @RequestMapping(value = "/listUserByUserType",method = RequestMethod.GET) |
| | | public BaseResult<List<SmUserVO>> listUserByUserType() throws VciBaseException{ |
| | | public BaseResult<List<SmUserVO>> listUserByUserType(Integer type) throws VciBaseException{ |
| | | try { |
| | | List<SmUserVO> smUserVOList = userQueryService.listUserByUserType(); |
| | | List<SmUserVO> smUserVOList = userQueryService.listUserByUserType(type); |
| | | return BaseResult.dataList(smUserVOList); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | List<SmUserVO> listUserByUserType() throws PLException; |
| | | List<SmUserVO> listUserByUserType(Integer type) throws PLException; |
| | | } |
| | |
| | | * @throws VciBaseException |
| | | */ |
| | | @Override |
| | | public List<SmUserVO> listUserByUserType() throws PLException { |
| | | public List<SmUserVO> listUserByUserType(Integer type) throws PLException { |
| | | try { |
| | | UserInfo[] userInfo = platformClientUtil.getFrameworkService().fetchUserInfoByType(Short.parseShort(WebUtil.getCurrentUserSessionInfo().getUsertype())); |
| | | UserInfo[] userInfo = platformClientUtil.getFrameworkService().fetchUserInfoByType(type != null ? type.shortValue() :Short.parseShort(WebUtil.getCurrentUserSessionInfo().getUsertype())); |
| | | return userInfoArr2VO(userInfo); |
| | | } catch (PLException e) { |
| | | throw new VciBaseException("ç»å½æ¶ï¼è·åç¨æ·ä¿¡æ¯å¤±è´¥ï¼"+e.getMessage()); |
| | |
| | | package com.vci.web.controller; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.framework.data.CheckValue; |
| | | import com.vci.corba.framework.data.GrandValue; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ææç»æ |
| | | * @param params æ¥è¯¢å¯¹è±¡ |
| | | * @return ææç»æ |
| | | */ |
| | | @GetMapping("/authResult") |
| | | public BaseResult authResult(@RequestBody CheckValue params){ |
| | | try { |
| | | return osDataAuthServiceI.authResult(params); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "æ¥è¯¢ææç»ææ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¸å¡å¯¹è±¡ |
| | | * @param btmName ä¸å¡ç±»ååç§° |
| | | * @param boFlag æ¯å¦ä¸ºboç±»åï¼true为btmï¼false为link |
| | | * @param btmType ä¸å¡ç±»å |
| | | * @return æ¥è¯¢åºçæ°æ® |
| | | */ |
| | | @GetMapping("/queryBusiness") |
| | | public BaseResult queryBusiness(String btmName, boolean boFlag, String btmType){ |
| | | try { |
| | | return osDataAuthServiceI.queryBusiness(btmName, boFlag, btmType); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "æ¥è¯¢ä¸å¡å¯¹è±¡æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.vci.web.service; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.framework.data.CheckValue; |
| | | import com.vci.corba.framework.data.GrandValue; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | |
| | |
| | | * @return å é¤ç»æ |
| | | */ |
| | | BaseResult deleteTypeRuleGrand(String typeName, String ruleName) throws PLException; |
| | | /** |
| | | * æ¥è¯¢ææç»æ |
| | | * @param params æ¥è¯¢å¯¹è±¡ |
| | | * @return ææç»æ |
| | | */ |
| | | BaseResult authResult(CheckValue params); |
| | | /** |
| | | * æ¥è¯¢ä¸å¡å¯¹è±¡ |
| | | * @param btmName ä¸å¡ç±»ååç§° |
| | | * @param boFlag æ¯å¦ä¸ºboç±»åï¼true为btmï¼false为link |
| | | * @param btmType ä¸å¡ç±»å |
| | | * @return æ¥è¯¢åºçæ°æ® |
| | | */ |
| | | BaseResult queryBusiness(String btmName, boolean boFlag, String btmType); |
| | | } |
| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import com.vci.client.common.oq.OQTool; |
| | | import com.vci.common.qt.object.QueryTemplate; |
| | | import com.vci.common.qt.object.Symbol; |
| | | import com.vci.constant.IRightConstant; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.framework.data.CheckValue; |
| | | import com.vci.corba.framework.data.GrandValue; |
| | | import com.vci.corba.omd.btm.BizType; |
| | | import com.vci.corba.omd.data.AttributeValue; |
| | | import com.vci.corba.omd.data.BusinessObject; |
| | | import com.vci.corba.omd.data.LinkObject; |
| | | import com.vci.corba.omd.lcm.LifeCycle; |
| | | import com.vci.corba.omd.lcm.TransitionVO; |
| | | import com.vci.corba.omd.ltm.LinkType; |
| | | import com.vci.corba.portal.data.PLAction; |
| | | import com.vci.dto.AuthResultDTO; |
| | | import com.vci.dto.OsDataAuthDTO; |
| | | import com.vci.pagemodel.OpItemVO; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.web.service.OsDataAuthServiceI; |
| | | import com.vci.web.util.PlatformClientUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | } |
| | | return BaseResult.success("å 餿åï¼"); |
| | | } |
| | | /** |
| | | * æ¥è¯¢ææç»æ |
| | | * @param params æ¥è¯¢å¯¹è±¡ |
| | | * @return ææç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult authResult(CheckValue params) { |
| | | // CheckValue params = new CheckValue(); |
| | | params.opname = IRightConstant.OPS; |
| | | if(StringUtils.isBlank(params.objectoid)){ |
| | | params.objectoid = "22385E82-485C-549D-E2F4-91278E9E0A76"; |
| | | } |
| | | List<String> tableHeaders = new ArrayList<>(); |
| | | List<Object> tableValues = new ArrayList<>(); |
| | | // æä½ |
| | | List<OpItemVO> opitems = new ArrayList<OpItemVO>(); |
| | | try { |
| | | String where = platformClientUtil.getFrameworkService().checkRight(params); |
| | | String[] ops = where.split(":"); |
| | | //å¤çå表头 |
| | | for (String s : ops) { |
| | | if (s != null && !s.equals("")) { |
| | | OpItemVO item = new OpItemVO(); |
| | | String[] op = s.split(","); |
| | | item.setName(op[0]); |
| | | item.setValue(op[1]); |
| | | tableHeaders.add(op[0]); |
| | | opitems.add(item); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new VciBaseException("é´æåºé\n" |
| | | + e.getLocalizedMessage()); |
| | | } |
| | | //å¤çæ°æ® |
| | | for (int n = 0; n < opitems.size(); n++) { |
| | | tableValues.add(opitems.get(n).getValue().equals("1") ? true : false); |
| | | } |
| | | AuthResultDTO authResultDTO = new AuthResultDTO(); |
| | | authResultDTO.setTableValues(tableValues); |
| | | authResultDTO.setTableHeader(tableHeaders); |
| | | return BaseResult.success(authResultDTO); |
| | | } |
| | | /** |
| | | * æ¥è¯¢ä¸å¡å¯¹è±¡ |
| | | * @param btmName ä¸å¡ç±»ååç§° |
| | | * @param boFlag æ¯å¦ä¸ºboç±»åï¼true为btmï¼false为link |
| | | * @param btmType ä¸å¡ç±»å |
| | | * @return æ¥è¯¢åºçæ°æ® |
| | | */ |
| | | @Override |
| | | public BaseResult queryBusiness(String btmName, boolean boFlag, String btmType) { |
| | | QueryTemplate qt = new QueryTemplate(); |
| | | qt.setBtmType(btmName); |
| | | List<String> clauseList = new ArrayList<String>(); |
| | | clauseList.add("*"); |
| | | qt.setClauseList(clauseList); |
| | | qt.setType(btmType);// 龿¥link |
| | | qt.setCondition(null); |
| | | qt.setId("qt1"); |
| | | List<Object> tableValues = new ArrayList<>(); |
| | | try { |
| | | clauseList = new ArrayList<>(Arrays.asList(platformClientUtil.getBtmService().getSysAttributeNames())); |
| | | clauseList.addAll(Arrays.asList(platformClientUtil.getBtmService().getAttributeNames(btmName))); |
| | | |
| | | if (boFlag) { |
| | | BusinessObject[] result = platformClientUtil.getQueryService().findBTMObjects(qt.getId(), OQTool.qtTOXMl(qt).asXML()); |
| | | for (int i = 0; i < result.length; i++) { |
| | | List<Object> lineData = new ArrayList<>(); |
| | | BusinessObject bo = result[i]; |
| | | AttributeValue[] attList = bo.hisAttrValList; |
| | | for (int j = 0; j < clauseList.size(); j++) { |
| | | lineData.add(attList[j].attrVal); |
| | | // qrTable.setValueAt(attList[j].attrVal, i, j); |
| | | } |
| | | tableValues.add(lineData); |
| | | } |
| | | } else { |
| | | List<Object> lineData = new ArrayList<>(); |
| | | LinkObject[] loResult = platformClientUtil.getQueryService().findLTObjects(qt.getId(), OQTool.qtTOXMl(qt).asXML()); |
| | | for (int i = 0; i < loResult.length; i++) { |
| | | LinkObject lo = loResult[i]; |
| | | AttributeValue[] attList = lo.hisAttrValList; |
| | | for (int j = 0; j < attList.length; j++) { |
| | | lineData.add(attList[j].attrVal); |
| | | // qrTable.setValueAt(attList[j], i, j); |
| | | } |
| | | tableValues.add(lineData); |
| | | } |
| | | } |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | Map<String, Object> resultData = new HashMap<>(); |
| | | resultData.put("tableHeader", clauseList); |
| | | resultData.put("tableValues", tableValues); |
| | | return BaseResult.success(resultData); |
| | | } |
| | | |
| | | //add by caill start 2015 12.18 å°æ¥è¯¢åºæ¥çactionæ¾å
¥å°mapä¸ |
| | | private Map<String, String> getAllActionsByType2(String typeName, String type) throws PLException { |
| | |
| | | Map<Object, Object> columnData = new HashMap<>(); |
| | | // å¢å 页é¢ç¼å |
| | | // ruleModel.setConditionValue(row, rules); |
| | | columnData.put("rules",rules.get(0)); |
| | | columnData.put("rules",rules); |
| | | // add by caill start 2015 12.18 å°æ¥åºçactionæ¾å°mapä¸ï¼æ³¨æä¸è¦è½ä¸âæ¥è¯¢â |
| | | Map<String, String> actionMap = new HashMap<String, String>(); |
| | | actionMap.put("query", "æ¥è¯¢"); // å°æä½ä¸çqueryæ¾å
¥actionMapä¸ |
| | |
| | | for (int j = 0; j < rules.size(); j++) { |
| | | // è§åååç±»å |
| | | // ruleModel.setValueAt(rules.get(j).ruleName, row, 0); |
| | | columnData.put(0, rules.get(j).ruleName); |
| | | columnData.put("0", rules.get(j).ruleName); |
| | | if (rules.get(j).ruleType.equals(IRightConstant.RULETYPE__HAS)) { |
| | | columnData.put(1, "å
许è§å"); |
| | | columnData.put("1", "å
许è§å"); |
| | | } else if (rules.get(j).ruleType.equals(IRightConstant.RULETYPE__NOTHAS)) { |
| | | columnData.put(1, "æç»è§å"); |
| | | columnData.put("1", "æç»è§å"); |
| | | } else if (rules.get(j).ruleType.equals(IRightConstant.RULETYPE_ALL_HAS)) { |
| | | columnData.put(1, "å
¨é¨ææ"); |
| | | columnData.put("1", "å
¨é¨ææ"); |
| | | } else { |
| | | columnData.put(1, "å
¨é¨æ æ"); |
| | | columnData.put("1", "å
¨é¨æ æ"); |
| | | } |
| | | // æå®çæä½èµå¼ |
| | | // TableColumnModel columnModel = funclet.getRightMainPanel().getRuleTable().getColumnModel(); |
| | |
| | | // int columnIndex = columnModel.getColumnIndex(op); |
| | | if (columnIndex >= 0) { |
| | | // ruleModel.setValueAt(rules.get(j).isGrand == '1' ? true : false, row, columnIndex); |
| | | columnData.put(columnIndex, rules.get(j).isGrand == '1' ? true : false); |
| | | columnData.put(String.valueOf(columnIndex), rules.get(j).isGrand == '1' ? true : false); |
| | | } |
| | | |
| | | } |
| | |
| | | return request({ |
| | | url: '/api/dataAuthController/saveGrand', |
| | | method: 'post', |
| | | params: params |
| | | data: params |
| | | }) |
| | | } |
| | | // å é¤ |
| | | export function delGrand(params) { |
| | | return request({ |
| | | url: "/api/dataAuthController/delGrand", |
| | | url: "/api/dataAuthController/deleteTypeRuleGrand", |
| | | method: "delete", |
| | | params |
| | | }) |
| | | } |
| | | |
| | | // æ¥çææç»æ |
| | | export function authResult(params) { |
| | | return request({ |
| | | url: "/api/dataAuthController/authResult", |
| | | method: "get", |
| | | params |
| | | }); |
| | | } |
| | |
| | | } |
| | | }); |
| | | } |
| | | // æ¥è¯¢å½åç¨æ·æå¨é¨é¨ |
| | | export function listDeptByUserOid(userOid) { |
| | | return request({ |
| | | url: "/api/departmentQueryController/listDeptByUserOid", |
| | | method: "get", |
| | | params:{ |
| | | userOid |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // ä¿åè§è² |
| | | export function saveRights(params) { |
| | |
| | | btmName: this.currentDefineVO.btmType, |
| | | btmType: this.currentDefineVO.btmType, |
| | | formDefineId: this.currentDefineVO.id, |
| | | formDefineOid: this.currentDefineVO.oid |
| | | formDefineOid: this.currentDefineVO.oid, |
| | | componentOid: this.componentVO.oid, |
| | | uiDefineId: this.uiContext, |
| | | }; |
| | | if (this.dataStore[0] && this.dataStore[0].oid) { |
| | | formParams.oid = this.dataStore[0].oid; |
| | |
| | | departmentQueryController({queryAllLevel: true}).then(res => { |
| | | const data = res.data.treeData; |
| | | this.departData = this.departDtaFormAtter(data); |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | | }, |
| | | watch: { |
| | | selectRow:{ |
| | | handler(val,oldval) { |
| | | this.authData=[]; |
| | | if(val && val.rules){ |
| | | this.form=JSON.parse(JSON.stringify(val.rules)); |
| | | //this.getTemp(true); |
| | | //this.getTemp(false) |
| | | //æå»ºææä¸»ä½æ°æ® |
| | | if(val.rules.users){ |
| | | val.rules.users.split(',').forEach((item,i)=>{ |
| | | if(item){ |
| | | this.authData.push({ |
| | | name:'{'+item+', '+item+', user}' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | if(val.rules.roles){ |
| | | val.rules.roles.split(',').forEach((item,i)=>{ |
| | | if(item){ |
| | | this.authData.push({ |
| | | name:'{'+item+', '+item+', role}' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | if(val.rules.userGroups){ |
| | | val.rules.userGroups.split(',').forEach((item,i)=>{ |
| | | if(item){ |
| | | this.authData.push({ |
| | | name:'{'+item+', '+item+', userGroup}' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }else { |
| | | this.form={}; |
| | | } |
| | | }, |
| | | immediate: true, |
| | | deep: true |
| | | }, |
| | | actionMap:{ |
| | | handler(val) { |
| | | this.actionDic=[]; |
| | |
| | | immediate: true, |
| | | deep: true |
| | | }, |
| | | selectRow:{ |
| | | handler(val,oldval) { |
| | | this.authData=[]; |
| | | if(val && val.rules &&val.rules.length>0) { |
| | | this.form = JSON.parse(JSON.stringify(val.rules[0])); |
| | | //this.getTemp(true); |
| | | //this.getTemp(false) |
| | | //æå»ºææä¸»ä½æ°æ® |
| | | if (val.rules[0].users) { |
| | | val.rules[0].users.split(',').forEach((item, i) => { |
| | | if (item) { |
| | | this.authData.push({ |
| | | name: '{' + item + ', ' + item + ', user}' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | if (val.rules[0].roles) { |
| | | val.rules[0].roles.split(',').forEach((item, i) => { |
| | | if (item) { |
| | | this.authData.push({ |
| | | name: '{' + item + ', ' + item + ', role}' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | if (val.rules[0].userGroups) { |
| | | val.rules[0].userGroups.split(',').forEach((item, i) => { |
| | | if (item) { |
| | | this.authData.push({ |
| | | name: '{' + item + ', ' + item + ', userGroup}' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | //è§£ææä½æé®éä¸å¼ |
| | | if (this.actionDic.length > 0) { |
| | | let actionDicStr = JSON.stringify(this.actionDic); |
| | | val.rules.forEach(item => { |
| | | if (item.isGrand == 49) { |
| | | let identifier = item.identifier.replace(this.btmNode.attributes.name + '_', '') |
| | | if (actionDicStr.indexOf('"value":"'+identifier+'"}') != -1) { |
| | | this.actionForm.push(identifier) |
| | | } else { |
| | | this.linkactionForm.push(identifier); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }else { |
| | | this.form={ |
| | | ruleName:'', |
| | | ruleType:'0' |
| | | }; |
| | | this.actionForm=[]; |
| | | this.linkactionForm=[]; |
| | | } |
| | | }, |
| | | immediate: true, |
| | | deep: true |
| | | }, |
| | | }, |
| | | methods: { |
| | | //éä¸ç¨æ· |
| | |
| | | </template> |
| | | </avue-crud> |
| | | <div style="margin-top: 15px;"> |
| | | <data-view key="dataView" :btmNode="nodeRow" :selectRow="selectRow" :actionMap="actionMap" :readOnly="true" :height="clientHeight-260-220"></data-view> |
| | | <data-view key="dataView" :btmNode="nodeRow" :actionMap="actionMap" :selectRow="selectRow" :readOnly="true" :height="clientHeight-260-220"></data-view> |
| | | </div> |
| | | <!-- æ°å¢ && ç¼è¾ --> |
| | | <el-dialog |
| | |
| | | width="70%" |
| | | @close="addDialogClose"> |
| | | <div> |
| | | <data-view ref="editView" key="editView" :btmNode="nodeRow" :selectRow="title === 'add'?{}:selectRow" :actionMap="actionMap" :readOnly="false" :height="clientHeight-260"></data-view> |
| | | <data-view ref="editView" key="editView" :btmNode="nodeRow" :actionMap="actionMap" :selectRow="title === 'add'?{}:selectRow" :readOnly="false" :height="clientHeight-260"></data-view> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button size="small" type="primary" @click="addDialogSavaHandler">ä¿ å</el-button> |
| | |
| | | <!-- æ¥çææç»æ --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | v-loading="checkViewLoading" |
| | | :visible.sync="checkViewVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="æ¥ç使ç¨èå´" |
| | | width="60%" |
| | | > |
| | | <avue-crud |
| | | ref="checkViewCrud" |
| | | :data="checkViewData" |
| | | :option="checkViewOption" |
| | | @search-change="checkHandleSearch" |
| | | @search-reset="checkHandleReset" |
| | | > |
| | | <el-form ref="form" :inline="true" size="mini" :model="form" label-width="80px"> |
| | | <el-form-item label="ä¸å¡å¯¹è±¡" prop="btmType"> |
| | | <el-input v-model="form.btmType"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" size="mini" @click="onSubmit">æ¥è¯¢ä¸å¡å¯¹è±¡</el-button> |
| | | </el-form-item> |
| | | <fieldset style="width: 99.5%"> |
| | | <legend> ç¨æ·ä¿¡æ¯ </legend> |
| | | <div> |
| | | <el-form-item label="ç¨æ·"> |
| | | <el-select v-model="form.userOid"> |
| | | <el-option v-for="item in userDic" :label="item.name+'('+item.id+')'" :value="item.oid"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="è§è²"> |
| | | <el-select v-model="form.roleOid"> |
| | | <el-option v-for="item in roleDic" :label="item.name" :value="item.oid"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç¨æ·ç»"> |
| | | <el-select v-model="form.deptOid"> |
| | | <el-option v-for="item in deptDic" :label="item.name" :value="item.oid"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | </avue-crud> |
| | | </el-form> |
| | | <fieldset style="width: 99.5%;margin-top: 10px;"> |
| | | <legend> ææç»æï¼ </legend> |
| | | <div> |
| | | <avue-crud |
| | | ref="checkViewCrud" |
| | | :data="checkViewData" |
| | | :option="checkViewOption" |
| | | > |
| | | |
| | | </avue-crud> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | </el-dialog> |
| | | </basic-container> |
| | | </el-main> |
| | |
| | | import {getBizTree} from "@/api/UI/uiDefine"; |
| | | import basicOption from "@/util/basic-option"; |
| | | import dataView from "./dataView"; |
| | | import {getData,saveGrand,delGrand} from "@/api/authority/ui/dataAuthor"; |
| | | import {getData,saveGrand,delGrand,authResult} from "@/api/authority/ui/dataAuthor"; |
| | | import {listUserByUserType, listRoleByUserOid, listDeptByUserOid} from "@/api/system/user/api"; |
| | | import func from "@/util/func"; |
| | | import {getUsedEnumList} from "@/api/modeling/enumType/api"; |
| | | export default { |
| | | name: "index", |
| | | components:{dataView}, |
| | |
| | | data: [], |
| | | title: '', |
| | | visible: false, |
| | | form:{}, |
| | | form:{ |
| | | btmType:'', |
| | | userOid:'', |
| | | roleOid:'', |
| | | deptOid:'' |
| | | }, |
| | | userDic:[], |
| | | roleDic:[], |
| | | deptDic:[], |
| | | actionMap:{}, |
| | | switchDic:[{ |
| | | label:'', |
| | |
| | | },{ |
| | | label:'', |
| | | value:true |
| | | }] |
| | | }], |
| | | checkViewVisible:false, |
| | | |
| | | } |
| | | }, |
| | | created() { |
| | | this.getTreeList(); |
| | | }, |
| | | watch:{ |
| | | 'form.userOid':{ |
| | | handler(val) { |
| | | if(val){ |
| | | listRoleByUserOid(val).then(res => { |
| | | // ç»è£
å¥½ç©¿æ¢æ¡å¯ç¨æ°æ® |
| | | this.roleDic = res.data.data; |
| | | if(this.roleDic.length>0){ |
| | | this.form.roleOid=this.roleDic[0].oid |
| | | }else{ |
| | | this.form.roleOid='' |
| | | } |
| | | }) |
| | | listDeptByUserOid(val).then(res => { |
| | | this.deptDic = res.data.data; |
| | | if(this.deptDic.length>0){ |
| | | this.form.deptOid=this.deptDic[0].oid |
| | | }else { |
| | | this.form.deptOid=''; |
| | | } |
| | | }) |
| | | }else{ |
| | | this.roleDic=[]; |
| | | this.deptDic=[]; |
| | | this.form.roleOid='' |
| | | this.form.deptOid=''; |
| | | } |
| | | }, |
| | | immediate: true, |
| | | deep: true |
| | | } |
| | | }, |
| | | methods: { |
| | | //æ 表æ¥è¯¢ |
| | |
| | | }) |
| | | } |
| | | this.data = res.data.obj.rowList; |
| | | this.$refs.crud.clearSelection(); |
| | | this.tableLoading = false; |
| | | this.actionMap=res.data.obj.actionMap; |
| | | this.selectRow={} |
| | | this.$refs.crud.setCurrentRow( ); |
| | | }) |
| | | }, |
| | | handleRefresh() { |
| | |
| | | // è¡ç¹å» |
| | | rowClickHandler(row) { |
| | | this.selectRow=row |
| | | }, |
| | | // æ¥çææç»æ |
| | | chekView() { |
| | | if (this.selectRow=={}) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡æ°æ®'); |
| | | return; |
| | | } |
| | | |
| | | getUsedEnumList({enumName: this.selectRow.id}).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.checkViewVisible = true; |
| | | this.checkViewData = res.data.data; |
| | | this.checkViewDataSearch = res.data.data; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // æ¥çææç»ææ¥è¯¢ |
| | | checkHandleSearch(params, done) { |
| | | const {source} = params; |
| | | |
| | | if (!params.source) { |
| | | this.checkViewData = this.checkViewDataSearch; |
| | | return done(); |
| | | } |
| | | |
| | | this.checkViewData = this.checkViewData.filter(item => { |
| | | return item.source && item.source.includes(source); |
| | | }); |
| | | |
| | | done(); |
| | | |
| | | }, |
| | | //å建 |
| | | addHandler(){ |
| | |
| | | }, |
| | | // æ°å¢ç¼è¾ä¿å |
| | | addDialogSavaHandler() { |
| | | let form=this.$refs.editView.form; |
| | | form.users='' |
| | | form.userGroups=''; |
| | | form.roles='' |
| | | this.$refs.editView.authData.forEach(item=>{ |
| | | let infos=item.name.split(', '); |
| | | infos[0]=infos[0].replace('{','') |
| | | if(infos[2]=='user}'){ |
| | | form.users+=infos[0]+',' |
| | | let form = this.$refs.editView.form; |
| | | if (form.ruleName == '') { |
| | | this.$message.error('客ä½è¯·è¾å
¥è§ååç§°'); |
| | | return; |
| | | } |
| | | form.users = '' |
| | | form.userGroups = ''; |
| | | form.roles = '' |
| | | this.$refs.editView.authData.forEach(item => { |
| | | let infos = item.name.split(', '); |
| | | infos[0] = infos[0].replace('{', '') |
| | | if (infos[2] == 'user}') { |
| | | form.users += infos[0] + ',' |
| | | } |
| | | if(infos[2]=='userGroup}'){ |
| | | form.userGroups+=infos[0]+',' |
| | | if (infos[2] == 'userGroup}') { |
| | | form.userGroups += infos[0] + ',' |
| | | } |
| | | if(infos[2]=='role}'){ |
| | | form.roles+=infos[0]+',' |
| | | if (infos[2] == 'role}') { |
| | | form.roles += infos[0] + ',' |
| | | } |
| | | }); |
| | | console.log(form) |
| | | //saveGrand(this.viewData).then(res => { |
| | | //if (res.data.code === 200) { |
| | | //this.$message.success(res.data.obj); |
| | | let data = []; |
| | | for (var i in this.actionMap) { |
| | | data.push({ |
| | | ...form, |
| | | identifier: this.nodeRow.attributes.name + '_' + this.actionMap[i], |
| | | isGrand: this.$refs.editView.actionForm.some(item => { |
| | | return item == this.actionMap[i] |
| | | }) ? 49 : 48 |
| | | }) |
| | | } |
| | | |
| | | saveGrand(data).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTableList(); |
| | | this.addDialogClose(); |
| | | //} |
| | | //}) |
| | | } |
| | | }) |
| | | }, |
| | | // æ°å¢ç¼è¾å¯¹è¯æ¡åæ¶ |
| | | addDialogClose() { |
| | |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delGrand({name:this.templateForm}).then(res => { |
| | | delGrand({typeName:this.nodeRow.attributes.name,ruleName:this.selectRow.rules[0].ruleName}).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTableList(); |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | // æ¥ç使ç¨èå´éç½® |
| | | checkHandleReset() { |
| | | this.checkViewData = this.checkViewDataSearch; |
| | | |
| | | // æ¥çææç»æ |
| | | chekView() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.warning('è¯·éæ©ç±»åæ ä¿¡æ¯'); |
| | | return; |
| | | } |
| | | this.checkViewVisible = true; |
| | | listUserByUserType({type:1}).then(res => { |
| | | // ç»è£
å¥½ç©¿æ¢æ¡å¯ç¨æ°æ® |
| | | this.userDic = res.data.data; |
| | | if(this.userDic.length>0){ |
| | | this.form.userOid=this.userDic[0].oid |
| | | }else{ |
| | | this.form.userOid='' |
| | | } |
| | | }) |
| | | |
| | | authResult({biztype: this.nodeRow.attributes.name,objectoid:''}).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.checkViewData = res.data.data; |
| | | } |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | |
| | | overflow: auto !important; |
| | | } |
| | | } |
| | | |
| | | fieldset { |
| | | padding: 10px 6px; |
| | | margin: 0; |
| | | border: 1px solid #EBEEF5; |
| | | } |
| | | </style> |