代码更新
This commit is contained in:
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
* @Description: 日志监控
|
||||
* @Date: 2022-08-15
|
||||
*/
|
||||
//@RestController
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "日志监控")
|
||||
@RequestMapping("/api/loki")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.modules.loki.service.impl;
|
||||
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -14,7 +15,7 @@ import org.springframework.stereotype.Service;
|
||||
* @Description: 实现类
|
||||
* @Date: 2022-08-15
|
||||
*/
|
||||
//@Service
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class LokiServiceImpl implements LokiService {
|
||||
|
||||
@@ -72,21 +73,12 @@ public class LokiServiceImpl implements LokiService {
|
||||
*/
|
||||
@Override
|
||||
public JSONArray getLabelsValues() {
|
||||
/**
|
||||
* [{
|
||||
* label:
|
||||
* value:
|
||||
* children:[{
|
||||
* label
|
||||
* value
|
||||
* }]
|
||||
* }]
|
||||
*/
|
||||
JSONArray result = new JSONArray();
|
||||
// 获取所有标签
|
||||
String labelString = HttpUtil.get(lokiUrl + "/labels", CharsetUtil.CHARSET_UTF_8);
|
||||
JSONObject parse = (JSONObject) JSONObject.parse(labelString);
|
||||
JSONArray labels = parse.getJSONArray("data");
|
||||
if (ObjectUtil.isEmpty(labels)) return null;
|
||||
for (int i=0; i<labels.size(); i++) {
|
||||
// 获取标签下的所有值
|
||||
String valueString = HttpUtil.get(lokiUrl + "/label/" + labels.getString(i) + "/values", CharsetUtil.CHARSET_UTF_8);
|
||||
|
||||
@@ -52,7 +52,7 @@ public class UserRelateServiceImpl implements UserRelateService {
|
||||
if (!CollectionUtils.isEmpty(userIds)){
|
||||
String collect = userIds.stream().map(a -> String.valueOf(a)).collect(Collectors.joining("','"));
|
||||
String sql="user_id in ('"+collect+"')";
|
||||
WQLObject.getWQLObject("sys_users_roles").delete(sql);
|
||||
WQLObject.getWQLObject("sys_user_dept").delete(sql);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -539,6 +539,7 @@ export default {
|
||||
crudDept.getDeptTree().then(res => {
|
||||
this.deptsDatas = res.content
|
||||
})
|
||||
console.log(row)
|
||||
this.nodeKey = 'dept_id'
|
||||
this.openDrawer()
|
||||
this.drawerTitle = '分配部门权限'
|
||||
@@ -552,8 +553,8 @@ export default {
|
||||
getAll().then(res => {
|
||||
this.rolesDatas = res
|
||||
// 回显默认选中
|
||||
console.log(res)
|
||||
console.log(row.roles)
|
||||
// console.log(res)
|
||||
// console.log(row)
|
||||
this.$nextTick(function() {
|
||||
for (let i = 0; i < this.rolesDatas.length; i++) {
|
||||
for (let j = 0; j < row.roles.length; j++) {
|
||||
@@ -578,7 +579,7 @@ export default {
|
||||
this.depCheckedId = row.user_id
|
||||
},
|
||||
clearCheck() {
|
||||
this.$refs.deptUser.setCheckedKeys([])
|
||||
if (this.flag) this.$refs.deptUser.setCheckedKeys([])
|
||||
},
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
@@ -600,9 +601,6 @@ export default {
|
||||
} else {
|
||||
user.roles = this.crud.selections.map(item => (item.role_id))
|
||||
}
|
||||
console.log('user', user)
|
||||
console.log(this.flag)
|
||||
console.log(this.crud.selections)
|
||||
crudUser.edit(user).then(res => {
|
||||
this.cancelForm()
|
||||
this.crud.notify('保存成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
@@ -611,7 +609,7 @@ export default {
|
||||
},
|
||||
// 覆盖原有勾选功能,父与子关联,子与父不关联
|
||||
handCheck(data, node) {
|
||||
this.hanleCheck(data, node, 'tree')
|
||||
this.hanleCheck(data, node, 'deptUser')
|
||||
},
|
||||
hanleCheck(data, node, treeName) {
|
||||
const _this = this
|
||||
@@ -637,7 +635,7 @@ export default {
|
||||
const _this = this
|
||||
// console.log(data, checked, indeterminate);
|
||||
// 选中全部子节点,父节点也默认选中,但是子节点再次取消勾选或者全部子节点取消勾选也不会影响父节点勾选状态
|
||||
const checkNode = _this.$refs.tree.getNode(data)// 获取当前节点
|
||||
const checkNode = _this.$refs.deptUser.getNode(data)// 获取当前节点
|
||||
// 勾选部分子节点,父节点变为半选状态
|
||||
if (checkNode.parent && checkNode.parent.childNodes.some(ele => ele.checked)) {
|
||||
checkNode.parent.indeterminate = true
|
||||
|
||||
Reference in New Issue
Block a user