Merge remote-tracking branch 'origin/master'
| | |
| | | int pageNo; |
| | | //页面条数 |
| | | int pageSize; |
| | | //查询类型(管理员日志,普通日志) |
| | | //查询类型(管理员日志1,普通日志2) |
| | | String roleType; |
| | | |
| | | /** |
| | | * 根绝roleType查询出来的用户名,后续根据这个参数查询指定的日志 |
| | | * 根据roleType查询出来的用户名,后续根据这个参数查询指定的日志 |
| | | */ |
| | | private List<String> userNameList; |
| | | |
| | |
| | | import com.vci.starter.web.annotation.log.VciBusinessLog; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.util.ControllerUtil; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.web.service.LogBasicServiceI; |
| | | import com.vci.web.util.Func; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 平台日志控制器 |
| | |
| | | throw new VciBaseException(errorMsg); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 导出日志 |
| | | * @param dto 导出查询传参数对象 |
| | | * @param response |
| | | */ |
| | | @PostMapping( "/exportLogs") |
| | | @VciBusinessLog(operateName = "导出日志") |
| | | public void exportLogs(@RequestBody LogQueryCriteriaDTO dto, HttpServletResponse response){ |
| | | try { |
| | | String excelPath = logBasicServiceI.exportLogs(dto); |
| | | ControllerUtil.writeFileToResponse(response,excelPath); |
| | | } catch (Exception e) { |
| | | String msg = "导出日志时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | try { |
| | | //出错时 |
| | | e.printStackTrace(); |
| | | ControllerUtil.writeDataToResponse(response,"error_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss") + ".txt", StringUtils.isNotBlank(msg)?msg.getBytes():new byte[0],null); |
| | | } catch (IOException ioException) { |
| | | ioException.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | String excelPath = attributeService.exportAttributes(exportFileName,attrNames,false); |
| | | ControllerUtil.writeFileToResponse(response,excelPath); |
| | | } catch (Exception e) { |
| | | String msg = "导出枚举时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | String msg = "导出属性时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | try { |
| | | //出错时 |
| | | e.printStackTrace(); |
| | |
| | | * @return 查询结果 |
| | | */ |
| | | BaseResult getPeroid() throws PLException; |
| | | |
| | | /** |
| | | * 保存期限设置 |
| | | * period 期限编码 |
| | | * @return 保存结果 |
| | | */ |
| | | BaseResult savePeriod(String period) throws PLException; |
| | | |
| | | /** |
| | | * 删除日志 |
| | | * period 期限编码 |
| | | * @return 保存结果 |
| | | */ |
| | | BaseResult deleteLog(String deleteDate) throws PLException; |
| | | |
| | | /** |
| | | * 查询日志 |
| | | * @param dto 查询条件传输对象 |
| | |
| | | * @throws PLException |
| | | */ |
| | | BaseResult getLogListByContion(LogQueryCriteriaDTO dto) throws PLException; |
| | | |
| | | /** |
| | | * 操作用户获取 |
| | | */ |
| | | BaseResult getOperatingUsers() throws PLException; |
| | | |
| | | String exportLogs(LogQueryCriteriaDTO dto) throws PLException; |
| | | |
| | | } |
| | |
| | | import com.vci.dto.LogPeriodInfoDTO; |
| | | import com.vci.dto.LogQueryCriteriaDTO; |
| | | import com.vci.frameworkcore.compatibility.SmUserQueryServiceI; |
| | | import com.vci.starter.poi.bo.WriteExcelData; |
| | | import com.vci.starter.poi.bo.WriteExcelOption; |
| | | import com.vci.starter.poi.util.ExcelUtil; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.util.LangBaseUtil; |
| | | import com.vci.starter.web.util.LocalFileUtil; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.web.service.*; |
| | | import com.vci.web.util.*; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.io.File; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public BaseResult getLogListByContion(LogQueryCriteriaDTO queryDto) throws PLException { |
| | | VciBaseUtil.alertNotNull(queryDto,"日志查询参数对象"); |
| | | List<String> userNameList = userQueryServiceI.queryUserNameByRoleType(queryDto.getRoleType()); |
| | | queryDto.setUserNameList(userNameList); |
| | | String querySql = getSQL(queryDto); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 导出日志 |
| | | * @param dto 导出的文件名 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String exportLogs(LogQueryCriteriaDTO dto) throws PLException{ |
| | | BaseResult logListByContion = this.getLogListByContion(dto); |
| | | Collection<LogInfoDTO> logList = logListByContion.getData(); |
| | | |
| | | //界面没传名称,使用默认导出名称 |
| | | String exportFileName = "日志导出_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"); |
| | | //设置列名 |
| | | List<String> columns = new ArrayList<>( |
| | | Arrays.asList("用户名", "姓名", "用户ip","模块", "操作", "时间", "操作结果","描述") |
| | | ); |
| | | |
| | | //写excel |
| | | String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName + ".xls"; |
| | | try { |
| | | new File(excelPath).createNewFile(); |
| | | } catch (Throwable e) { |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e), new String[]{excelPath}, e); |
| | | } |
| | | //设置列 |
| | | List<WriteExcelData> excelDataList = new ArrayList<>(); |
| | | //设置列头 |
| | | for (int index = 0; index < columns.size(); index++) { |
| | | excelDataList.add(new WriteExcelData(0,index, columns.get(index))); |
| | | } |
| | | |
| | | if(Func.isEmpty(logList)){ |
| | | excelDataList.add(new WriteExcelData(1,1, "导出的日志列表为空!")); |
| | | }else{ |
| | | //先按照属性类型排序,不同属性类型导出的数据乱的效果 |
| | | AtomicInteger i = new AtomicInteger(); |
| | | logList.stream().forEach(log->{ |
| | | excelDataList.add(new WriteExcelData(i.get() +1,0, log.getUsername())); |
| | | excelDataList.add(new WriteExcelData(i.get() +1,1, log.getTruename())); |
| | | excelDataList.add(new WriteExcelData(i.get() +1,2, log.getUserIp())); |
| | | excelDataList.add(new WriteExcelData(i.get() +1,3, log.getModuleName())); |
| | | excelDataList.add(new WriteExcelData(i.get() +1,4, log.getType())); |
| | | excelDataList.add(new WriteExcelData(i.get() +1,5, log.getDate())); |
| | | excelDataList.add(new WriteExcelData(i.get() +1,6, log.getLogType())); |
| | | excelDataList.add(new WriteExcelData(i.get() +1,7, log.getResult())); |
| | | i.getAndIncrement(); |
| | | }); |
| | | } |
| | | WriteExcelOption excelOption = new WriteExcelOption(excelDataList); |
| | | ExcelUtil.writeDataToFile(excelPath, excelOption); |
| | | return excelPath; |
| | | } |
| | | |
| | | /** |
| | | * 获取用户信息 |
| | | * @param userNames 用户名称 |
| | | * @return 用户信息 |
| | | * @throws PLException |
| | | */ |
| | | private List<UserObject> getUsersByUserNames(List<String> userNames) throws PLException { |
| | | List<UserObject> userList = new ArrayList<UserObject>(); |
| | | List<UserObject> userList = new ArrayList<>(); |
| | | for(String userName : userNames){ |
| | | UserInfo userInfo = platformClientUtil.getFrameworkService().fetchUserInfoByName(userName); |
| | | UserObject user = new UserObject(); |
| | |
| | | public String getSQL(LogQueryCriteriaDTO dto) throws PLException { |
| | | StringBuffer sql = new StringBuffer(""); |
| | | // int period = getPeriod(LOG_SAVE_PERIOD);//获取保存期限,以月为单位 |
| | | int period = platformClientUtil.getLogService().getCurPeriod();;//获取保存期限,以月为单位 |
| | | int period = platformClientUtil.getLogService().getCurPeriod();//获取保存期限,以月为单位 |
| | | //下面是拼出SQL |
| | | if(period != 0){ |
| | | sql.append(" to_date(PLDATE) >= add_months(to_date(sysdate),"+(-period)+")"); |
| | |
| | | res = true; |
| | | return res; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.vci.common.utility.ObjectUtility; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.common.data.UserEntityInfo; |
| | |
| | | convertTreeDOO2Map(treeList,allTreeMap); |
| | | List<RoleRightDTO> roleRightDTOList = new ArrayList<>(); |
| | | List<Tree> selectTreeList = uiAuthorDTO.getSelectTreeList(); |
| | | List<Tree> selectTreeList2 = this.authTreeListConvert(selectTreeList); |
| | | getSelectedRoleRightObjs_old(uiAuthorDTO.getRoleId(),selectTreeList2,allTreeMap,roleRightDTOList); |
| | | List<Tree> filterSelectTreeList = this.authTreeListConvert(selectTreeList); |
| | | //过滤出选择的按钮 |
| | | List<String> checkButtonList = selectTreeList.stream() |
| | | .filter(item -> item.getData() instanceof PLTabButton || item.isLeaf()) |
| | | .map(item -> item.getOid()).collect(Collectors.toList()); |
| | | |
| | | getSelectedRoleRightObjs(uiAuthorDTO.getRoleId(),filterSelectTreeList,checkButtonList,allTreeMap,roleRightDTOList); |
| | | SessionInfo sessionInfo = WebThreadLocalUtil.getCurrentUserSessionInfoInThread(); |
| | | String currentUserName = sessionInfo.getUserId(); |
| | | //boolean isDeveloper = rightControlUtil.isDeveloper(currentUserName); |
| | |
| | | * @param selectTreeList |
| | | */ |
| | | private List<Tree> authTreeListConvert(List<Tree> selectTreeList){ |
| | | |
| | | // 创建一个包含另一个集合中满足条件的 oid 的集合 |
| | | List<String> validOids = selectTreeList.stream() |
| | | .filter(Tree::isChecked) // checked 为 true |
| | |
| | | * @param allTreeMap |
| | | * @param roleRightDTOList |
| | | */ |
| | | private void getSelectedRoleRightObjs_old(String roleOid, List<Tree> selectTreeList, HashMap<String,Tree> allTreeMap, List<RoleRightDTO> roleRightDTOList){ |
| | | private void getSelectedRoleRightObjs(String roleOid, List<Tree> selectTreeList, List<String> checkButtonList, HashMap<String,Tree> allTreeMap, List<RoleRightDTO> roleRightDTOList){ |
| | | Map<String,RoleRightDTO> roleRightDTOMap = new HashMap<>(); |
| | | |
| | | if(!CollectionUtil.isEmpty(selectTreeList)){ |
| | | selectTreeList.stream().forEach(tree -> { |
| | | String oid = tree.getOid(); |
| | | if(allTreeMap.containsKey(oid)){ |
| | | tree = allTreeMap.get(oid); |
| | | Object data = tree.getData(); |
| | | Object data = tree.getData(); |
| | | if (data instanceof String) { |
| | | getRightValue(roleOid, tree, allTreeMap, false, roleRightDTOMap);//向下获取所有模块的权限值 |
| | | getRightValue(roleOid, tree, allTreeMap, checkButtonList,false, roleRightDTOMap);//向下获取所有模块的权限值 |
| | | } else if (!(data instanceof PLTabButton)) {//业务类型 |
| | | getRightValue(roleOid, tree, allTreeMap, true, roleRightDTOMap);//向上处理 |
| | | getRightValue(roleOid, tree, allTreeMap, false, roleRightDTOMap);//向下处理(包含当前节点) |
| | | getRightValue(roleOid, tree, allTreeMap, checkButtonList, true, roleRightDTOMap);//向上处理 |
| | | getRightValue(roleOid, tree, allTreeMap, checkButtonList, false, roleRightDTOMap);//向下处理(包含当前节点) |
| | | } else if (data instanceof PLTabButton) {//按钮 |
| | | String parrentId=tree.getParentId(); |
| | | if(allTreeMap.containsKey(parrentId)){ |
| | |
| | | boolean isDeveloper = rightControlUtil.isDeveloper(currentUserName); |
| | | Tree parentNode= allTreeMap.get(parrentId); |
| | | String funcId = parentNode.getOid(); |
| | | getRightValue(roleOid, tree, allTreeMap, true, roleRightDTOMap);//向上处理该操作父级的上级模块权限(不包含父节点) |
| | | getRightValue(roleOid, parentNode, allTreeMap, checkButtonList, true, roleRightDTOMap);//向上处理该操作父级的上级模块权限(不包含父节点) |
| | | if(!roleRightDTOMap.containsKey(funcId)){ |
| | | RoleRightDTO roleRightDTO = new RoleRightDTO(); |
| | | roleRightDTO.setId(ObjectUtility.getNewObjectID36());//主键 |
| | |
| | | }else{ |
| | | roleRightDTO.setRightType((short) 2); |
| | | } |
| | | roleRightDTO.setRightValue(countRightValue(parentNode,false));// 权限值,没有操作的模块权限值存储为0 |
| | | roleRightDTO.setRightValue(countRightValue(parentNode,checkButtonList,false));// 权限值,没有操作的模块权限值存储为0 |
| | | roleRightDTO.setRoleId(roleOid);//角色ID |
| | | roleRightDTO.setCreateUser(currentUserName);//创建者 |
| | | roleRightDTO.setCreateTime(VciDateUtil.date2Str(new Date(),""));//创建时间 |
| | |
| | | * 获取权限 |
| | | * @param isUp 是否是向上获取,如果是向上获取,传进来的必然是模块节点,且上级模块必然是没有选中 |
| | | */ |
| | | private void getRightValue(String roleId,Tree node,HashMap<String,Tree> allTreeMap,boolean isUp,Map<String,RoleRightDTO> rightMap){ |
| | | private void getRightValue(String roleId,Tree node,Map<String,Tree> allTreeMap,List<String> checkButton,boolean isUp,Map<String,RoleRightDTO> rightMap){ |
| | | SessionInfo sessionInfo = WebThreadLocalUtil.getCurrentUserSessionInfoInThread(); |
| | | String currentUserName = sessionInfo.getUserId(); |
| | | boolean isDeveloper= rightControlUtil.isDeveloper(currentUserName); |
| | | String id=ObjectUtility.getNewObjectID36(); |
| | | Object data=node.getData(); |
| | | if(isUp) {//向上获取,存储每个上级模块的权限值 |
| | | while (!"root".equals(node.getData())){ |
| | | data=node.getData(); |
| | | String oid=node.getOid(); |
| | | String parentId = node.getParentId(); |
| | | Tree parentNode = allTreeMap.get(parentId); |
| | | while (!"root".equals(parentNode.getData())){ |
| | | data=parentNode.getData(); |
| | | String oid=parentNode.getOid(); |
| | | if(allTreeMap.containsKey(oid)){ |
| | | String funcId = ""; |
| | | if (data instanceof BizType) { |
| | |
| | | if(!rightMap.containsKey(funcId)){ |
| | | rightMap.put(funcId, roleRightDTO); |
| | | } |
| | | oid= node.getParentId(); |
| | | oid = parentNode.getParentId(); |
| | | if(allTreeMap.containsKey(oid)) { |
| | | node=allTreeMap.get(oid); |
| | | parentNode = allTreeMap.get(oid); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | for (int i = 0; i < node.getChildren().size(); i++) { |
| | | //对每个子向下递归遍历 |
| | | getRightValue(roleId, node.getChildren().get(i), allTreeMap, false, rightMap); |
| | | getRightValue(roleId, node.getChildren().get(i), allTreeMap, checkButton,false, rightMap); |
| | | } |
| | | } else { |
| | | if (!rightMap.containsKey(funcId)) { |
| | | RoleRightDTO roleRightDTO = new RoleRightDTO(); |
| | | roleRightDTO.setFuncId(funcId); |
| | | roleRightDTO.setRightType((short) 2); // 设置UI权限 |
| | | roleRightDTO.setRightValue(countRightValue(node, true));//没有操作的模块权限值存储为0 |
| | | roleRightDTO.setRightValue(countRightValue(node, checkButton,true));//没有操作的模块权限值存储为0 |
| | | roleRightDTO.setRoleId(roleId); |
| | | |
| | | roleRightDTO.setCreateUser(currentUserName); |
| | |
| | | * @param isAll 是否子级全部选中 |
| | | * @return |
| | | */ |
| | | private long countRightValue(Tree node,boolean isAll){ |
| | | private long countRightValue(Tree node,List<String> checkButton,boolean isAll){ |
| | | long value = 0; |
| | | for(int i = 0; i < node.getChildren().size(); i++){ |
| | | Tree childNode = (Tree)node.getChildren().get(i); |
| | | if(isAll || node.getData() instanceof PLTabButton ){ |
| | | //node.getData() instanceof PLTabButton这儿应该换成是否是选中的按钮节点 |
| | | if(isAll || checkButton.contains(node.getOid())){ |
| | | PLTabButton obj = (PLTabButton)childNode.getData(); |
| | | value += (long)Math.pow(2, obj.plSeq);//累计加上各个操作的权限值 |
| | | } |
| | |
| | | checked: true, |
| | | expanded: true, |
| | | data:item.data, |
| | | parentId:item.parentId, |
| | | level: item.level, |
| | | leaf:item.leaf, |
| | | oid: item.oid, |
| | | text: item.text |
| | | } |
| | | }) |
| | | |
| | | // const parentData = selectParentList.map(item => { |
| | | // return { |
| | | // checked: false, |
| | | // expanded: true, |
| | | // data:item.data, |
| | | // level: item.level, |
| | | // oid: item.oid, |
| | | // text: item.text |
| | | // } |
| | | // }) |
| | | // // 在半选状态中过滤掉顶级节点 oid 为 root |
| | | // const filterSelectTreeData = parentData.filter(item => item.oid !== 'root'); |
| | | const parentData = selectParentList.map(item => { |
| | | return { |
| | | checked: false, |
| | | expanded: true, |
| | | data:item.data, |
| | | parentId:item.parentId, |
| | | level: item.level, |
| | | leaf:item.leaf, |
| | | oid: item.oid, |
| | | text: item.text |
| | | } |
| | | }) |
| | | // 在半选状态中过滤掉顶级节点 oid 为 root |
| | | const filterSelectTreeData = parentData.filter(item => item.oid !== 'root'); |
| | | |
| | | const data = [...selectTreeData]; |
| | | const data = [...selectTreeData,...filterSelectTreeData]; |
| | | const formData = { |
| | | roleId: this.nodeRow.oid, |
| | | type: this.type, |
| | | context: this.context, |
| | | selectTreeList: selectTreeList |
| | | selectTreeList: data |
| | | } |
| | | authorizedUI(formData).then(res => { |
| | | if (res.data.success) { |
| | |
| | | </el-button> |
| | | <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addCustomClickHandler">添加自定义组件 |
| | | </el-button> |
| | | <el-button icon="el-icon-zoom-in" plain size="small" type="primary">预览</el-button> |
| | | <el-button icon="el-icon-zoom-in" plain size="small" type="primary" @click="checkViewHandler" >预览</el-button> |
| | | </div> |
| | | </basic-container> |
| | | </el-main> |
| | |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="表单" |
| | | width="40%" |
| | | width="50%" |
| | | @close="closeCustomDialog"> |
| | | <el-form ref="form" :model="customForm" :rules="rules" label-position="left" label-width="85px"> |
| | | <el-row style="border-bottom: 1px solid #878585;padding-bottom: 10px"> |
| | |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item class="rightLabel" label="显示类型"> |
| | | <el-select v-model="customForm.itemType" placeholder="请选择类型" size="mini"> |
| | | <el-select v-model="customForm.itemType" placeholder="请选择类型" size="mini" @change="customItemTypeChange"> |
| | | <el-option v-for="(item,index) in showSelectList" :key="index" :label="item.label" |
| | | :value="item.value"></el-option> |
| | | </el-select> |
| | |
| | | <el-button type="primary" @click="customSaveHandler">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="checkViewVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="预览" |
| | | width="80%"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="100px"> |
| | | <el-row> |
| | | <el-col v-for="(item,index) in formList" :key="index" :span="topForm.columnNumber"> |
| | | <el-form-item :class="['hiddenLabel', { 'active-border': activeItem.text === item.text }]" |
| | | :label="item.itemName + ':'" |
| | | style="padding-left: 5px" @click.native="formItemClick(item,index)"> |
| | | <el-input |
| | | v-if="item.itemType === 'text' || |
| | | item.itemType === 'custom' || |
| | | item.itemType === 'customform'|| |
| | | item.itemType === 'hidden' || |
| | | item.itemType === 'specialCharacter'" |
| | | v-model="item.value" :placeholder="item.text" |
| | | size="mini"></el-input> |
| | | |
| | | <div v-if="item.itemType === 'textbtn'" style="display: flex;align-items: center"> |
| | | <el-input v-model="item.value" :placeholder="item.text" size="mini"></el-input> |
| | | <el-button icon="el-icon-edit" plain size="mini" style="height: 28px;" |
| | | type="primary"></el-button> |
| | | </div> |
| | | |
| | | <el-input |
| | | v-if="item.itemType === 'textarea' || item.itemType === 'richtext' || item.itemType === 'webeditor'" |
| | | v-model="item.value" |
| | | :placeholder="item.text" |
| | | :rows="2" |
| | | type="textarea"> |
| | | </el-input> |
| | | |
| | | <el-input-number v-if="item.itemType === 'number'" v-model="item.value" :max="99999" |
| | | :min="1"></el-input-number> |
| | | <el-input v-if="item.itemType === 'password'" v-model="input" placeholder="请输入密码" |
| | | show-password></el-input> |
| | | <el-radio v-if="item.itemType === 'radio'" v-model="item.value"></el-radio> |
| | | <el-checkbox v-if="item.itemType === 'checkbox'" v-model="item.value"></el-checkbox> |
| | | <el-select v-if="item.itemType === 'select' || item.itemType === 'multiselect'" |
| | | v-model="item.value" :disabled="true" placeholder="请选择" size="mini"> |
| | | </el-select> |
| | | <el-date-picker |
| | | v-if="item.itemType === 'date' || item.itemType === 'datetime'" |
| | | v-model="item.value" |
| | | :placeholder="item.itemType === 'date' ? '请选择日期' : '请选择日期时间'" |
| | | type="date"> |
| | | </el-date-picker> |
| | | |
| | | <el-time-select |
| | | v-if="item.itemType === 'time'" |
| | | v-model="item.value" |
| | | :picker-options="{ |
| | | start: '08:30', |
| | | step: '00:15', |
| | | end: '18:30' |
| | | }" |
| | | placeholder="选择时间"> |
| | | </el-time-select> |
| | | <el-button v-if="item.itemType === 'file'" |
| | | v-model="item.value" plain size="mini" type="primary"> |
| | | 上传文件 |
| | | </el-button> |
| | | <el-button v-if="item.itemType === 'multiFile'" |
| | | v-model="item.value" plain size="mini" type="primary"> |
| | | 多文件上传 |
| | | </el-button> |
| | | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </el-dialog> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | checkViewVisible: false, |
| | | optionObj: { |
| | | optionName: '', |
| | | optionValue: '' |
| | |
| | | this.activeItem = item; |
| | | this.activeItemIndex = index; |
| | | this.form = {...item}; |
| | | |
| | | // console.log(item,index); |
| | | this.topForm.position = index += 1; |
| | | }, |
| | |
| | | prmItemList: this.formList |
| | | }, |
| | | } |
| | | console.log(params); |
| | | savePortalVI(params).then(res => { |
| | | console.log(res); |
| | | if(res.data.code === 200){ |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.visible = false; |
| | | this.closeDialog(); |
| | |
| | | this.$message.error('请在右侧选择数据后进行操作!'); |
| | | return; |
| | | } |
| | | const targetObject = this.formList.find(item => item.text === this.form.text); |
| | | |
| | | if (targetObject) { |
| | | targetObject.itemType = val; |
| | | }, |
| | | |
| | | // 自定义组件修改显示类型 |
| | | customItemTypeChange(val) { |
| | | if (val) { |
| | | this.customClearFormBottom(); |
| | | } |
| | | this.form.itemType = val; |
| | | }, |
| | | |
| | | // 自定义组件保存 |
| | |
| | | } |
| | | if (!this.customForm.itemType) { |
| | | this.$message.error('请选择显示类型'); |
| | | return; |
| | | } |
| | | const status = this.formList.some(item => item.text === this.customForm.text); |
| | | if(status){ |
| | | this.$message.error('请检查是否添加相同项'); |
| | | return; |
| | | } |
| | | this.formList.push(this.customForm); |
| | |
| | | this.form.itemListTable = this.form.itemListTxt = this.form.itemListVal = this.form.itemStyle = ""; |
| | | }, |
| | | |
| | | // 自定义组件清空不同类型表单下方绑定值 |
| | | customClearFormBottom() { |
| | | this.customOptionObj = {}; |
| | | this.customForm.itemKeyValueList = []; |
| | | this.customForm.itemListTable = this.customForm.itemListTxt = this.customForm.itemListVal = this.customForm.itemStyle = ""; |
| | | }, |
| | | |
| | | // 自定义表单使用字段选择 |
| | | customTextHandler() { |
| | | |
| | |
| | | |
| | | // 右侧表单应用按钮 |
| | | asideFormHandler() { |
| | | if(!this.form.text){ |
| | | this.$message.error('请添加一条数据进行保存!'); |
| | | return; |
| | | } |
| | | this.formList = this.formList.map(item => |
| | | item.text === this.form.text ? this.form : item |
| | | ); |
| | | |
| | | this.$message.success('应用成功'); |
| | | }, |
| | | |
| | | customClearFormBottom() { |
| | | this.optionObj = {}; |
| | | this.form.itemKeyValueList = []; |
| | | this.form.itemListTable = ""; |
| | | this.form.itemListTxt = ""; |
| | | this.form.itemListVal = ""; |
| | | this.form.itemStyle = ""; |
| | | // 预览按钮 |
| | | checkViewHandler(){ |
| | | this.checkViewVisible = true; |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <el-col :span="24"> |
| | | <el-form-item label="查询模板"> |
| | | <el-select v-model="form.itemQtName" placeholder="请选择查询模板" size="mini"> |
| | | <el-option v-for="(item,index) in searchQtNameList" :key="index" :label="item.qtName" :value="item.qtName"></el-option> |
| | | <el-option v-for="(item,index) in searchQtNameList" :key="index" :label="item.qtName" |
| | | :value="item.qtName"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | searchQtNameList:[], |
| | | searchQtNameList: [], |
| | | formLoading: false, |
| | | itemImgHeight: '', |
| | | itemImgWidth: '', |
| | |
| | | }, |
| | | |
| | | // 查询模板下拉接口查询 |
| | | getSearchSelectList(){ |
| | | getSearchSelectList() { |
| | | getObjTypeQTs({btName: this.treeRadio === '0' ? this.TreeNodeRow.id : this.TreeNodeRow.name}).then(res => { |
| | | this.searchQtNameList = res.data.data; |
| | | }) |
| | |
| | | this.$message.error('请选择一条数据'); |
| | | return; |
| | | } |
| | | |
| | | |
| | | const onlyFlag = this.form.itemOutFieldList.some(item => item.id === this.showLabelLeftRow.id); |
| | | |
| | | if (onlyFlag) { |
| | | this.$message.error('请检查是否有重复项'); |
| | | this.form.itemSelectOutFieldList = this.form.itemSelectOutFieldList.filter(selectItem => |
| | | !this.form.itemOutFieldList.some(outItem => outItem.id === selectItem.id) |
| | | ) |
| | | return; |
| | | } |
| | | |
| | | this.form.itemOutFieldList.push(this.showLabelLeftRow); |
| | | this.form.itemSearchFieldList = this.form.itemOutFieldList; |
| | | |
| | |
| | | |
| | | // 查询模板添加 |
| | | searchAddClickHandler() { |
| | | if(!this.form.searchLabel){ |
| | | if (!this.form.searchLabel) { |
| | | this.$message.error('查询字段不能为空!'); |
| | | return; |
| | | } |
| | |
| | | |
| | | // 左侧树点击 |
| | | nodeClick(row) { |
| | | console.log(row); |
| | | this.tableRadio = null; |
| | | this.nodeRow = row; |
| | | this.getRightPortalVIDatas(row); |