Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzlite
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzlite
提交
3587e60e
提交
3587e60e
编写于
9月 21, 2020
作者:
lzlhxj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
首页导航栏树形下拉框组件:选中树叶子节点全局刷新
上级
8a853f04
变更
7
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
194 行增加
和
24 行删除
+194
-24
app-treeselect-refreshview.less
...pp-treeselect-refreshview/app-treeselect-refreshview.less
+0
-0
app-treeselect-refreshview.vue
...app-treeselect-refreshview/app-treeselect-refreshview.vue
+188
-0
lite-index-base.vue
app_web/src/pages/lite/lite-index/lite-index-base.vue
+3
-0
getters.ts
app_web/src/store/getters.ts
+0
-10
mutations.ts
app_web/src/store/mutations.ts
+0
-12
user-register.ts
app_web/src/user-register.ts
+2
-0
auth-guard.ts
app_web/src/utils/auth-guard/auth-guard.ts
+1
-2
未找到文件。
app_web/src/components/app-treeselect-refreshview/app-treeselect-refreshview.less
0 → 100644
浏览文件 @
3587e60e
app_web/src/components/app-treeselect-refreshview/app-treeselect-refreshview.vue
0 → 100644
浏览文件 @
3587e60e
<
template
>
<div
style=
"margin-right: 16px;"
>
<!--树形下拉框-->
<el-select
:value=
"valueTitle"
:clearable=
"clearable"
@
clear=
"clearHandle"
>
<el-option
:value=
"valueTitle"
:label=
"valueTitle"
:key=
"valueId"
>
<el-tree
id=
"tree-option"
ref=
"selectTree"
:accordion=
"accordion"
:data=
"options"
:props=
"props"
:node-key=
"props.value"
:default-expanded-keys=
"defaultExpandedKey"
@
node-click=
"handleNodeClick"
>
</el-tree>
</el-option>
</el-select>
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
Vue
,
Component
,
Prop
,
Model
,
Emit
,
Inject
}
from
"vue-property-decorator"
;
import
{
Subject
}
from
"rxjs"
;
@
Component
({})
export
default
class
AppTreeselectRefreshview
extends
Vue
{
// 树数据
public
options
:
any
=
[];
// 树显示说明
public
props
:
any
=
{
value
:
'id'
,
// ID字段名
label
:
'label'
,
// 显示名称
children
:
'apps'
// 子级字段名
};
// 下拉框初始值key
public
valueId
:
any
=
null
;
// 下拉框初始值
public
valueTitle
:
any
=
''
;
// 默认展开节点key
public
defaultExpandedKey
:
any
=
[];
// 是否每次只打开一个同级树节点展开
public
accordion
:
boolean
=
false
;
// 可清空选项
public
clearable
:
boolean
=
true
;
/**
* vue创建
*/
created
():
void
{
}
/**
* vue挂载
*/
mounted
():
void
{
// 初始化数据
this
.
initHandle
();
}
/**
* 获取初始化数据
*/
public
initHandle
()
{
let
url
:
any
=
'/lite/sysapps'
;
this
.
$http
.
get
(
url
).
then
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
==
200
)
{
const
data
:
any
=
response
.
data
;
if
(
data
&&
data
.
length
>
0
)
{
// 处理数据,生成有相同结构的父子节点结构
let
tempData
:
any
=
[];
data
.
forEach
((
item
:
any
)
=>
{
let
tempItem
:
any
=
item
;
if
(
tempItem
.
pssystemid
)
{
tempItem
.
id
=
tempItem
.
pssystemid
;
tempItem
.
systemId
=
tempItem
.
pssystemid
;
}
if
(
tempItem
.
pssystemname
)
{
tempItem
.
label
=
tempItem
.
pssystemname
;
}
tempData
.
push
(
tempItem
);
});
// 给树赋值
this
.
options
=
tempData
;
this
.
$nextTick
(()
=>
{
// 树
let
tree
:
any
=
this
.
$refs
.
selectTree
;
// 第一个叶子节点
let
firstNode
:
any
=
{};
if
(
tempData
[
0
].
apps
)
{
firstNode
=
tempData
[
0
].
apps
;
}
else
{
firstNode
=
tempData
[
0
];
}
// 设置树当前选中值
tree
.
setCurrentKey
(
firstNode
[
0
].
id
);
// 从local中拿刷新前选中值
if
(
localStorage
.
getItem
(
'localdata'
))
{
const
localdata
:
any
=
JSON
.
parse
(
localStorage
.
getItem
(
'localdata'
)
as
string
);
this
.
valueId
=
localdata
.
dstappid
;
this
.
valueTitle
=
localdata
.
title
;
this
.
defaultExpandedKey
.
push
(
localdata
.
dstappid
);
}
else
{
// 设置下拉框默认值
this
.
valueId
=
firstNode
[
0
].
id
;
this
.
valueTitle
=
firstNode
[
0
].
systemId
+
"-"
+
firstNode
[
0
].
label
;
this
.
defaultExpandedKey
.
push
(
firstNode
[
0
].
id
);
}
});
}
}
else
{
console
.
warn
(
"加载数据错误"
);
}
}).
catch
((
error
:
any
)
=>
{
console
.
warn
(
"加载数据错误,"
+
error
);
})
}
/**
* 注入加载行为
*/
@
Inject
(
"reload"
)
reload
!
:
any
;
/**
* 处理下拉框选中项
*/
public
handleNodeClick
(
node
:
any
)
{
// 父级节点不进行处理
if
(
node
.
apps
)
{
return
;
}
// 从local中拿刷新前选中值
if
(
localStorage
.
getItem
(
'localdata'
))
{
const
localdata
:
any
=
JSON
.
parse
(
localStorage
.
getItem
(
'localdata'
)
as
string
);
if
(
localdata
.
dstappid
==
node
[
this
.
props
.
value
])
{
return
;
}
}
// 重新赋值
this
.
valueId
=
node
[
this
.
props
.
value
];
const
dstsystemid
:
any
=
node
.
systemId
;
this
.
valueTitle
=
dstsystemid
+
"-"
+
node
[
this
.
props
.
label
];
// 添加本地应用数据
const
localdata
:
any
=
{
'dstsystemid'
:
dstsystemid
,
'dstappid'
:
this
.
valueId
,
'title'
:
this
.
valueTitle
};
this
.
$store
.
commit
(
'addLocalData'
,
localdata
);
// 调用App.vue的加载行为
// this.reload();
// 浏览器window的加载行为
window
.
location
.
reload
();
}
/**
* 清空选中项
*/
public
clearHandle
()
{
this
.
valueId
=
null
;
this
.
valueTitle
=
''
;
this
.
defaultExpandedKey
=
[];
// 清空当前选中节点
let
tree
:
any
=
this
.
$refs
.
selectTree
;
tree
.
setCurrentKey
(
null
);
// 收缩所有节点
this
.
$nextTick
(()
=>
{
for
(
let
i
=
0
;
i
<
this
.
options
.
length
;
i
++
)
{
tree
.
store
.
nodesMap
[
this
.
options
[
i
].
id
].
expanded
=
false
;
}
});
}
/**
* 销毁之前
*/
beforeDestroy
():
void
{
this
.
valueId
=
null
;
this
.
valueTitle
=
''
;
this
.
defaultExpandedKey
=
[];
this
.
options
=
[];
}
}
</
script
>
<
style
lang=
'less'
>
@import "app-treeselect-refreshview.less";
</
style
>
\ No newline at end of file
app_web/src/pages/lite/lite-index/lite-index-base.vue
浏览文件 @
3587e60e
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
</div>
</div>
</div>
</div>
<div
class=
"header-right"
style=
"display: flex;align-items: center;justify-content: space-between;"
>
<div
class=
"header-right"
style=
"display: flex;align-items: center;justify-content: space-between;"
>
<app-treeselect-refreshview/>
<app-header-menus
/>
<app-header-menus
/>
<app-lang
style=
'font-size: 15px;padding: 0 10px;'
></app-lang>
<app-lang
style=
'font-size: 15px;padding: 0 10px;'
></app-lang>
<app-orgsector></app-orgsector>
<app-orgsector></app-orgsector>
...
@@ -73,10 +74,12 @@ import { Subject,Subscription } from 'rxjs';
...
@@ -73,10 +74,12 @@ import { Subject,Subscription } from 'rxjs';
import
{
appConfig
}
from
'@/config/appConfig'
;
import
{
appConfig
}
from
'@/config/appConfig'
;
import
AppTreeselectRefreshview
from
"@components/app-treeselect-refreshview/app-treeselect-refreshview.vue"
;
@
Component
({
@
Component
({
components
:
{
components
:
{
AppTreeselectRefreshview
},
},
})
})
export
default
class
LiteIndexBase
extends
Vue
{
export
default
class
LiteIndexBase
extends
Vue
{
...
...
app_web/src/store/getters.ts
浏览文件 @
3587e60e
...
@@ -110,14 +110,4 @@ export const getOrgData = (state: any) => (srfkey: string) => {
...
@@ -110,14 +110,4 @@ export const getOrgData = (state: any) => (srfkey: string) => {
export
const
getDepData
=
(
state
:
any
)
=>
(
srfkey
:
string
)
=>
{
export
const
getDepData
=
(
state
:
any
)
=>
(
srfkey
:
string
)
=>
{
let
depData
=
state
.
depDataMap
[
srfkey
];
let
depData
=
state
.
depDataMap
[
srfkey
];
return
depData
;
return
depData
;
}
/**
* 获取视图信息
*
* @param state
*/
export
const
getViewMessage
=
(
state
:
any
)
=>
(
tag
:
string
)
=>
{
let
id
=
state
.
viewMessage
[
tag
];
return
id
;
}
}
\ No newline at end of file
app_web/src/store/mutations.ts
浏览文件 @
3587e60e
...
@@ -291,16 +291,4 @@ export const addDepData = (state: any, args: {srfkey: string,depData: any}) => {
...
@@ -291,16 +291,4 @@ export const addDepData = (state: any, args: {srfkey: string,depData: any}) => {
if
(
args
&&
args
.
srfkey
&&
args
.
depData
){
if
(
args
&&
args
.
srfkey
&&
args
.
depData
){
state
.
depDataMap
[
args
.
srfkey
]
=
JSON
.
parse
(
JSON
.
stringify
(
args
.
depData
));
state
.
depDataMap
[
args
.
srfkey
]
=
JSON
.
parse
(
JSON
.
stringify
(
args
.
depData
));
}
}
}
/**
* 添加视图信息
*
* @param state
* @param args
*/
export
const
addViewMessage
=
(
state
:
any
,
args
:
{
tag
:
string
,
id
:
any
})
=>
{
if
(
args
&&
args
.
tag
&&
args
.
id
)
{
state
.
viewMessage
[
args
.
tag
]
=
args
.
id
;
}
}
}
\ No newline at end of file
app_web/src/user-register.ts
浏览文件 @
3587e60e
import
AvueComponent
from
'./components/avue-component/avue-component.vue'
import
AvueComponent
from
'./components/avue-component/avue-component.vue'
import
AppAvueCrud
from
'./components/app-avue-crud/app-avue-crud.vue'
import
AppAvueCrud
from
'./components/app-avue-crud/app-avue-crud.vue'
import
AppTreeselectRefreshview
from
'./components/app-treeselect-refreshview/app-treeselect-refreshview.vue'
export
const
UserComponent
=
{
export
const
UserComponent
=
{
install
(
v
:
any
,
opt
:
any
)
{
install
(
v
:
any
,
opt
:
any
)
{
v
.
component
(
'avue-component'
,
AvueComponent
);
v
.
component
(
'avue-component'
,
AvueComponent
);
v
.
component
(
'app-avue-crud'
,
AppAvueCrud
);
v
.
component
(
'app-avue-crud'
,
AppAvueCrud
);
v
.
component
(
'app-treeselect-refreshview'
,
AppTreeselectRefreshview
);
}
}
};
};
\ No newline at end of file
app_web/src/utils/auth-guard/auth-guard.ts
浏览文件 @
3587e60e
...
@@ -41,11 +41,10 @@ export class AuthGuard {
...
@@ -41,11 +41,10 @@ export class AuthGuard {
private
constructor
()
{
}
private
constructor
()
{
}
/**
/**
*
获取应用数据
*
post请求
*
*
* @param {string} url url 请求路径
* @param {string} url url 请求路径
* @param {*} [params={}] 请求参数
* @param {*} [params={}] 请求参数
* @param {*} [router] 路由对象
* @returns {Promise<any>} 请求相响应对象
* @returns {Promise<any>} 请求相响应对象
* @memberof AuthGuard
* @memberof AuthGuard
*/
*/
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录