修复问题

This commit is contained in:
WenG 2020-09-18 17:49:13 +08:00
parent a81c4f0986
commit 0e90165e9f
3 changed files with 28 additions and 3 deletions

View File

@ -125,7 +125,7 @@ public interface IApiConsts {
/**
* 职位zTree
*/
String LIST_ZTREE_POSITION = "%s/resource/role/listztreeposition";
String LIST_ZTREE_POSITION = "%s/resource/position/listztreeposition";
/**
* 获取所有用户列表通过上级区域ID
*/

View File

@ -8,6 +8,7 @@ import com.cm.common.exception.SearchException;
import com.cm.common.plugin.oauth.service.position.IPositionService;
import com.cm.common.result.ErrorResult;
import io.swagger.annotations.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -46,4 +47,19 @@ public class PositionController extends AbstractController {
return positionService.listUserPosition(params);
}
@ApiOperation(value = "zTree列表", notes = "zTree列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "上级ID", paramType = "query", dataType = "String")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listztreeposition")
public JSONArray listZTreePosition() throws SearchException {
Map<String, Object> params = requestParams();
String positionParentId = "0";
if (!StringUtils.isBlank(params.get("id") == null ? null : params.get("id").toString())) {
positionParentId = params.get("id").toString();
}
return positionService.listZTreePosition(positionParentId);
}
}

View File

@ -213,7 +213,16 @@
zTree.checkNode(item, false, true);
return;
} else {
selectedNodes.push(item);
var exist = false;
for(var j = 0, jItem; jItem = selectedNodes[j++];) {
if(item.id === jItem.id) {
exist = true;
break;
}
}
if(!exist) {
selectedNodes.push(item);
}
}
}
// if(treeNode[selectTree.primaryKey] == '0') {
@ -228,7 +237,7 @@
for(var i = 0, item; item = nodes[i++];) {
removeSelectNodes(item[selectTree.primaryKey]);
}
// removeSelectNodes(treeNode[selectTree.primaryKey]);
// removeSelectNodes(treeNode[selectTree.primaryKey]);
}
},
onAsyncSuccess: function(event, treeId, treeNode, msg) {