Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a42bffd7
authored
Mar 27, 2023
by
ext.wangyuman1
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
附件弹框优化
1 parent
3501ddfd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
21 deletions
linkwe-pc/src/components/ContentCenter/MaterialCenter/index.vue
linkwe-pc/src/components/ContentCenter/MaterialCenter/index.vue
View file @
a42bffd
...
@@ -57,7 +57,6 @@
...
@@ -57,7 +57,6 @@
</div>
</div>
<el-table
<el-table
:data=
"list"
:data=
"list"
@
selection-change=
"handleSelectionChange"
ref=
"multipleTable"
ref=
"multipleTable"
@
select=
"handleSelect"
@
select=
"handleSelect"
@
select-all=
"selectAll"
@
select-all=
"selectAll"
...
@@ -258,39 +257,58 @@ export default {
...
@@ -258,39 +257,58 @@ export default {
}
}
},
},
handleSelect
(
select
,
row
)
{
handleSelect
(
select
,
row
)
{
if
(
1
+
this
.
ids
.
length
+
this
.
talkListLength
>
this
.
maxlength
)
{
let
list
=
this
.
paneList
[
this
.
index
].
list
let
falg
=
false
if
(
list
.
length
)
{
list
.
forEach
((
obj
)
=>
{
if
(
obj
.
id
===
row
.
id
)
{
// 取消勾选
falg
=
true
}
})
}
if
(
!
falg
)
{
this
.
paneList
[
this
.
index
].
list
.
push
(
row
)
}
else
{
this
.
paneList
[
this
.
index
].
list
=
this
.
paneList
[
this
.
index
].
list
.
filter
((
item
)
=>
{
return
item
.
id
!=
row
.
id
})
}
this
.
getIds
()
if
(
this
.
ids
.
length
+
this
.
talkListLength
>
this
.
maxlength
)
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
if
(
this
.
index
)
this
.
$refs
.
multipleTable
[
this
.
inx
].
toggleRowSelection
(
row
,
false
)
if
(
this
.
index
)
this
.
$refs
.
multipleTable
[
this
.
inx
].
toggleRowSelection
(
row
,
false
)
})
})
this
.
$message
.
error
(
this
.
$message
.
error
(
'最多新建或选择'
+
this
.
maxlength
+
'个素材,已新建'
+
this
.
talkListLength
+
'个素材'
'最多新建或选择'
+
this
.
maxlength
+
'个素材,已新建'
+
this
.
talkListLength
+
'个素材'
)
)
this
.
paneList
[
this
.
index
].
list
=
this
.
paneList
[
this
.
index
].
list
.
filter
((
item
)
=>
{
return
item
.
id
!=
row
.
id
})
this
.
getIds
()
}
}
},
},
selectAll
(
select
)
{
selectAll
(
select
)
{
if
(
select
.
length
+
this
.
ids
.
length
+
this
.
talkListLength
>
this
.
maxlength
)
{
if
(
select
.
length
)
{
// 全选
this
.
paneList
[
this
.
index
].
list
=
select
}
else
{
// 取消全选
this
.
paneList
[
this
.
index
].
list
=
[]
}
this
.
getIds
()
if
(
this
.
ids
.
length
+
this
.
talkListLength
>
this
.
maxlength
)
{
select
.
forEach
((
item
)
=>
{
select
.
forEach
((
item
)
=>
{
this
.
$refs
.
multipleTable
[
this
.
inx
].
toggleAllSelection
(
item
,
false
)
this
.
$refs
.
multipleTable
[
this
.
inx
].
toggleAllSelection
(
item
,
false
)
})
})
this
.
$message
.
error
(
this
.
$message
.
error
(
'最多新建或选择'
+
this
.
maxlength
+
'个素材,已新建'
+
this
.
talkListLength
+
'个素材'
'最多新建或选择'
+
this
.
maxlength
+
'个素材,已新建'
+
this
.
talkListLength
+
'个素材'
)
)
this
.
paneList
[
this
.
index
].
list
=
[]
this
.
getIds
()
}
}
},
},
// 多选框选中数据
getIds
()
{
handleSelectionChange
(
selection
)
{
let
list
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
paneList
[
this
.
index
].
list
))
this
.
paneList
[
this
.
index
].
list
=
selection
this
.
ids
=
[]
this
.
paneList
.
forEach
((
item
)
=>
{
if
(
item
.
list
&&
item
.
list
.
length
)
{
item
.
list
.
forEach
((
item1
)
=>
{
this
.
ids
.
push
(
item1
)
})
}
})
if
(
this
.
ids
.
length
+
this
.
talkListLength
>
this
.
maxlength
)
{
this
.
paneList
[
this
.
index
].
list
=
list
this
.
ids
=
[]
this
.
ids
=
[]
this
.
paneList
.
forEach
((
item
)
=>
{
this
.
paneList
.
forEach
((
item
)
=>
{
if
(
item
.
list
&&
item
.
list
.
length
)
{
if
(
item
.
list
&&
item
.
list
.
length
)
{
...
@@ -299,8 +317,31 @@ export default {
...
@@ -299,8 +317,31 @@ export default {
})
})
}
}
})
})
}
},
},
// 多选框选中数据
// handleSelectionChange(selection) {
// let list = JSON.parse(JSON.stringify(this.paneList[this.index].list))
// this.paneList[this.index].list = selection
// this.ids = []
// this.paneList.forEach((item) => {
// if (item.list && item.list.length) {
// item.list.forEach((item1) => {
// this.ids.push(item1)
// })
// }
// })
// if (this.ids.length + this.talkListLength > this.maxlength) {
// this.paneList[this.index].list = list
// this.ids = []
// this.paneList.forEach((item) => {
// if (item.list && item.list.length) {
// item.list.forEach((item1) => {
// this.ids.push(item1)
// })
// }
// })
// }
// },
// 处理文件类型
// 处理文件类型
filType
(
file
)
{
filType
(
file
)
{
let
filecontent
=
JSON
.
parse
(
JSON
.
stringify
(
file
))
let
filecontent
=
JSON
.
parse
(
JSON
.
stringify
(
file
))
...
@@ -318,10 +359,11 @@ export default {
...
@@ -318,10 +359,11 @@ export default {
},
},
tabClick
(
v
)
{
tabClick
(
v
)
{
this
.
index
=
v
.
index
this
.
index
=
v
.
index
if
(
this
.
index
!==
0
)
{
let
index
=
+
this
.
index
this
.
inx
=
this
.
index
-
1
if
(
index
!==
0
)
{
this
.
inx
=
index
-
1
}
else
{
}
else
{
this
.
inx
=
this
.
index
this
.
inx
=
index
}
}
// if (this.picindex === 0) {
// if (this.picindex === 0) {
// // 不包含文本
// // 不包含文本
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment