Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周远喜
mes-ui
Commits
852498c6
Commit
852498c6
authored
Sep 30, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文档分类树封装组件
parent
a4285b5c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
147 additions
and
115 deletions
+147
-115
api.js
components/page/api.js
+4
-1
wordTree.vue
components/page/wordTree.vue
+129
-0
index.vue
pages/word/document/index.vue
+11
-113
iview.js
plugins/iview.js
+3
-1
No files found.
components/page/api.js
View file @
852498c6
...
@@ -7,5 +7,8 @@ export default {
...
@@ -7,5 +7,8 @@ export default {
serialcode
(
params
)
{
serialcode
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/cache/generate_serialcode`
,
params
);
return
Api
.
post
(
`
${
systemUrl
}
/cache/generate_serialcode`
,
params
);
},
},
//文档分类列表
list
(
params
){
return
Api
.
post
(
`
${
material
}
/documentcategory/list`
,
params
);
},
}
}
\ No newline at end of file
components/page/wordTree.vue
0 → 100644
View file @
852498c6
<
template
>
<div
class=
"word-tree"
>
<div
class=
"search"
>
<Input
search
placeholder=
"关键字"
v-model=
"keys"
clearable
/>
</div>
<Tree
:data=
"data"
ref=
"tree"
@
on-select-change=
"change"
:render=
"renderContent"
></Tree>
</div>
</
template
>
<
script
>
import
Api
from
"./api"
;
export
default
{
data
()
{
return
{
keys
:
""
,
list
:
[],
};
},
computed
:
{
data
()
{
let
items
=
this
.
$u
.
clone
(
this
.
list
);
let
expand
=
this
.
expand
;
let
result
=
[];
search
(
this
.
keys
,
items
);
function
search
(
keys
,
data
)
{
data
.
map
((
u
)
=>
{
if
(
keys
.
length
<
u
.
title
)
{
u
.
expand
=
expand
;
result
.
push
(
u
);
}
else
{
u
.
expand
=
expand
;
if
(
u
.
title
.
indexOf
(
keys
)
>
-
1
)
{
result
.
push
(
u
);
}
else
if
(
u
.
children
)
{
search
(
keys
,
u
.
children
);
}
}
});
}
return
result
;
},
},
mounted
()
{
this
.
loadTree
();
},
methods
:
{
loadTree
()
{
let
data
=
{
conditions
:
[
{
fieldName
:
"status"
,
fieldValue
:
"1"
,
conditionalType
:
"Equal"
,
},
],
};
Api
.
list
(
data
).
then
((
r
)
=>
{
var
data
=
this
.
$u
.
toTree
(
r
.
result
,
0
,
(
u
)
=>
{
u
.
title
=
u
.
name
;
u
.
value
=
u
.
id
;
u
.
expand
=
true
;
},
"upId"
);
this
.
list
=
this
.
$u
.
clone
(
data
);
// console.log(this.list);
});
},
change
(
a
,
b
)
{
// console.log(a)
console
.
log
(
b
);
// if (b.children.length == 0) { //判断最底层才能添加文档
// this.addShow = true;
// this.$refs.dataTable.$refs.grid.reload(this.easySearch);
// } else {
// this.addShow = false;
// }
let
ids
=
[];
ids
.
push
(
b
.
value
);
if
(
b
.
children
)
{
addId
(
b
.
children
);
function
addId
(
data
)
{
data
.
map
((
u
)
=>
{
ids
.
push
(
u
.
value
);
if
(
u
.
children
)
{
addId
(
u
.
children
);
}
});
}
}
this
.
$emit
(
"change"
,
b
,
ids
);
},
renderContent
(
h
,
{
root
,
node
,
data
})
{
let
type
=
""
;
if
(
data
.
type
==
0
)
{
type
=
"md-folder"
;
}
else
if
(
data
.
type
==
1
)
{
type
=
"ios-copy"
;
}
else
{
type
=
"ios-book"
;
}
return
h
(
"span"
,
[
h
(
"Icon"
,
{
props
:
{
type
:
type
,
},
style
:
{
marginRight
:
"8px"
,
},
}),
h
(
"span"
,
data
.
title
),
]);
},
},
};
</
script
>
\ No newline at end of file
pages/word/document/index.vue
View file @
852498c6
...
@@ -21,18 +21,15 @@
...
@@ -21,18 +21,15 @@
</ButtonGroup>
</ButtonGroup>
</div>
</div>
</h3>
</h3>
<div
class=
"search"
>
<Input
search
placeholder=
"关键字"
v-model=
"keys"
clearable
/>
</div>
<div
class=
"fg"
>
<div
class=
"fg"
>
<div
class=
"tree"
>
<!--
<Tree
<Tree
:data=
"data"
:data=
"data"
ref=
"tree"
ref=
"tree"
@
on-select-change=
"change"
@
on-select-change=
"change"
:render=
"renderContent"
:render=
"renderContent"
></Tree>
></Tree>
-->
<
/div
>
<
WordTree
@
change=
"change"
/
>
</div>
</div>
</div>
</div>
</Sider>
</Sider>
...
@@ -71,7 +68,6 @@ export default {
...
@@ -71,7 +68,6 @@ export default {
list
:
[],
list
:
[],
showMenu
:
true
,
showMenu
:
true
,
model8
:
""
,
model8
:
""
,
keys
:
""
,
expand
:
false
,
expand
:
false
,
treeId
:
0
,
treeId
:
0
,
addShow
:
false
,
addShow
:
false
,
...
@@ -79,64 +75,18 @@ export default {
...
@@ -79,64 +75,18 @@ export default {
workFlowIds
:
""
,
workFlowIds
:
""
,
};
};
},
},
mounted
()
{
mounted
()
{},
this
.
loadTree
();
},
async
fetch
({
store
,
params
})
{
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
},
computed
:
{
data
()
{
let
items
=
this
.
$u
.
clone
(
this
.
list
);
let
expand
=
this
.
expand
;
let
result
=
[];
search
(
this
.
keys
,
items
);
function
search
(
keys
,
data
)
{
data
.
map
((
u
)
=>
{
if
(
keys
.
length
<
u
.
title
)
{
u
.
expand
=
expand
;
result
.
push
(
u
);
}
else
{
u
.
expand
=
expand
;
if
(
u
.
title
.
indexOf
(
keys
)
>
-
1
)
{
result
.
push
(
u
);
}
else
if
(
u
.
children
)
{
search
(
keys
,
u
.
children
);
}
}
});
}
return
result
;
},
},
methods
:
{
methods
:
{
loadTree
()
{
change
(
item
,
ids
)
{
let
data
=
{
this
.
treeId
=
item
.
id
;
conditions
:
[
this
.
workFlowIds
=
item
.
workFlowIds
;
{
this
.
ids
=
ids
;
fieldName
:
"status"
,
fieldValue
:
"1"
,
conditionalType
:
"Equal"
,
},
],
// sortBy: "code",
// isDesc: false,
};
Api
.
list
(
data
).
then
((
r
)
=>
{
var
data
=
this
.
$u
.
toTree
(
r
.
result
,
0
,
(
u
)
=>
{
u
.
title
=
u
.
name
;
u
.
value
=
u
.
id
;
u
.
expand
=
true
;
},
"upId"
);
this
.
list
=
this
.
$u
.
clone
(
data
);
// console.log(this.list);
});
},
},
toggle
()
{
toggle
()
{
if
(
this
.
model8
)
{
if
(
this
.
model8
)
{
this
.
expand
=
!
this
.
expand
;
this
.
expand
=
!
this
.
expand
;
...
@@ -147,58 +97,6 @@ export default {
...
@@ -147,58 +97,6 @@ export default {
hide
()
{
hide
()
{
this
.
showMenu
=
false
;
this
.
showMenu
=
false
;
},
},
change
(
a
,
b
)
{
// console.log(a)
console
.
log
(
b
);
this
.
treeId
=
b
.
id
;
this
.
workFlowIds
=
b
.
workFlowIds
;
//流程id
// if (b.children.length == 0) { //判断最底层才能添加文档
// this.addShow = true;
// this.$refs.dataTable.$refs.grid.reload(this.easySearch);
// } else {
// this.addShow = false;
// }
let
ids
=
[];
ids
.
push
(
b
.
value
);
if
(
b
.
children
)
{
addId
(
b
.
children
);
function
addId
(
data
)
{
data
.
map
((
u
)
=>
{
ids
.
push
(
u
.
value
);
if
(
u
.
children
)
{
addId
(
u
.
children
);
}
});
}
}
// console.log(ids)
this
.
ids
=
ids
;
},
renderContent
(
h
,
{
root
,
node
,
data
})
{
let
type
=
""
;
if
(
data
.
type
==
0
)
{
type
=
"md-folder"
;
}
else
if
(
data
.
type
==
1
)
{
type
=
"ios-copy"
;
}
else
{
type
=
"ios-book"
;
}
return
h
(
"span"
,
[
h
(
"Icon"
,
{
props
:
{
type
:
type
,
},
style
:
{
marginRight
:
"8px"
,
},
}),
h
(
"span"
,
data
.
title
),
]);
},
showMenuFn
()
{
showMenuFn
()
{
//this.$Message.info("展开左侧树")
//this.$Message.info("展开左侧树")
...
...
plugins/iview.js
View file @
852498c6
...
@@ -67,7 +67,7 @@ import ImportExcel from '@/components/page/import/process.vue'
...
@@ -67,7 +67,7 @@ import ImportExcel from '@/components/page/import/process.vue'
import
CustomProperties
from
'@/components/page/customProperties.vue'
import
CustomProperties
from
'@/components/page/customProperties.vue'
import
InputCode
from
'@/components/page/inputCode.vue'
import
InputCode
from
'@/components/page/inputCode.vue'
import
Pictrue
from
'@/components/page/pictrue.vue'
import
Pictrue
from
'@/components/page/pictrue.vue'
import
WordTree
from
'@/components/page/wordTree.vue'
...
@@ -141,6 +141,8 @@ Vue.component("ImportExcel",ImportExcel)
...
@@ -141,6 +141,8 @@ Vue.component("ImportExcel",ImportExcel)
Vue
.
component
(
"CustomProperties"
,
CustomProperties
)
Vue
.
component
(
"CustomProperties"
,
CustomProperties
)
Vue
.
component
(
"InputCode"
,
InputCode
)
Vue
.
component
(
"InputCode"
,
InputCode
)
Vue
.
component
(
"Pictrue"
,
Pictrue
)
Vue
.
component
(
"Pictrue"
,
Pictrue
)
Vue
.
component
(
"WordTree"
,
WordTree
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment