Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
a95b67ce
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
12 个月 前同步成功
通知
11
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zentaoatf
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a95b67ce
编写于
3月 23, 2022
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cache filter
上级
ee97958e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
42 addition
and
30 deletion
+42
-30
ui/src/utils/cache.ts
ui/src/utils/cache.ts
+22
-22
ui/src/views/script/index.vue
ui/src/views/script/index.vue
+20
-8
未找到文件。
ui/src/utils/cache.ts
浏览文件 @
a95b67ce
...
...
@@ -33,28 +33,28 @@ export const setCurrProductIdBySite = async (currSiteId, currProductId) => {
}
// script filters
//
export const getScriptFilters = async () => {
//
const mp = await getCache(settings.scriptFilters);
//
//
if (!mp) {
//
return {by: 'workspace', val: ''}
//
}
//
// const by = mp.by
// const val =
mp[by]
//
//
return {by: by, val: val}
//
}
//
export const setScriptFilters = async (by, val) => {
//
let mp = await getCache(settings.scriptFilters);
//
if (!mp) mp = {}
//
//
mp.by = by
//
//
if (val) mp[by] = val
//
//
await setCache(settings.scriptFilters, mp);
//
}
export
const
getScriptFilters
=
async
()
=>
{
const
mp
=
await
getCache
(
settings
.
scriptFilters
);
if
(
!
mp
)
{
return
{
by
:
'
workspace
'
,
val
:
''
}
}
const
by
=
mp
.
by
?
mp
.
by
:
'
workspace
'
const
val
=
''
//
mp[by]
return
{
by
:
by
,
val
:
val
}
}
export
const
setScriptFilters
=
async
(
by
,
val
)
=>
{
let
mp
=
await
getCache
(
settings
.
scriptFilters
);
if
(
!
mp
)
mp
=
{}
mp
.
by
=
by
//
if (val) mp[by] = val
await
setCache
(
settings
.
scriptFilters
,
mp
);
}
export
const
cacheExpandedKeys
=
async
(
keys
)
=>
{
console
.
log
(
'
cacheExpandedKeys
'
,
keys
)
...
...
ui/src/views/script/index.vue
浏览文件 @
a95b67ce
...
...
@@ -19,7 +19,7 @@
<a-select
v-model:value=
"filerValue"
@
change=
"selectFilerValue"
style=
"width:
16
0px"
style=
"width:
20
0px"
:dropdownMatchSelectWidth=
"false"
>
<a-select-option
value=
""
></a-select-option>
...
...
@@ -39,6 +39,7 @@
<div
class=
"tree-panel"
>
<a-tree
v-if=
"treeData.children"
ref=
"tree"
:tree-data=
"treeData"
:replace-fields=
"replaceFields"
...
...
@@ -55,6 +56,8 @@
<FileOutlined
v-if=
"slotProps.type==='file'"
/>
</
template
>
</a-tree>
<a-empty
v-if=
"!treeData.children"
:image=
"simpleImage"
/>
</div>
</div>
...
...
@@ -96,7 +99,7 @@ import {Empty, message, notification} from "ant-design-vue";
import
{
MonacoOptions
}
from
"
@/utils/const
"
;
import
MonacoEditor
from
"
@/components/Editor/MonacoEditor.vue
"
;
import
{
ZentaoData
}
from
"
@/store/zentao
"
;
import
{
cacheExpandedKeys
,
retrieveExpandedKey
s
}
from
"
@/utils/cache
"
;
import
{
cacheExpandedKeys
,
getScriptFilters
,
retrieveExpandedKeys
,
setScriptFilter
s
}
from
"
@/utils/cache
"
;
import
{
listFilterItems
}
from
"
@/views/script/service
"
;
interface
ListScriptPageSetupData
{
...
...
@@ -156,11 +159,7 @@ export default defineComponent({
watch
(
currProduct
,
()
=>
{
console
.
log
(
'
watch currProduct
'
,
currProduct
.
value
.
id
)
filerType
.
value
=
''
filerValue
.
value
=
''
loadScripts
()
init
()
},
{
deep
:
true
})
watch
(
treeData
,
(
currConfig
)
=>
{
...
...
@@ -187,6 +186,11 @@ export default defineComponent({
loadScripts
()
const
loadFilterItems
=
async
()
=>
{
if
(
!
filerType
.
value
)
{
const
data
=
await
getScriptFilters
()
filerType
.
value
=
data
.
by
}
filerValue
.
value
=
''
if
(
!
filerType
.
value
)
{
filerItems
.
value
=
[]
...
...
@@ -197,8 +201,16 @@ export default defineComponent({
filerItems
.
value
=
result
.
data
}
const
init
=
async
()
=>
{
console
.
log
(
'
init
'
)
loadFilterItems
()
loadScripts
()
}
init
()
const
selectFilerType
=
async
(
val
)
=>
{
console
.
log
(
'
selectFilerType
'
,
val
)
await
setScriptFilters
(
val
,
''
)
await
loadFilterItems
()
await
loadScripts
()
}
...
...
@@ -342,7 +354,7 @@ export default defineComponent({
}
.right {
width:
7
0px;
width:
4
0px;
text-align: right;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录