Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
K
knowledgeServiceAdmin
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
quanlili
knowledgeServiceAdmin
Commits
7abfad24
提交
7abfad24
authored
12月 31, 2019
作者:
王腾飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
12.31
上级
daf19ee6
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
156 行增加
和
27 行删除
+156
-27
index.scss
src/views/submission/resourcecommit/index.scss
+10
-0
index.vue
src/views/submission/resourcecommit/index.vue
+146
-27
没有找到文件。
src/views/submission/resourcecommit/index.scss
浏览文件 @
7abfad24
...
...
@@ -45,3 +45,13 @@
}
}
}
.has-gutter
{
tr
{
th
:nth-of-type
(
1
)
{
.el-checkbox__inner
{
display
:none
;
}
}
}
}
src/views/submission/resourcecommit/index.vue
浏览文件 @
7abfad24
...
...
@@ -189,7 +189,7 @@
<div
class=
"name"
>
{{
item
.
value
}}
</div>
</
template
>
</el-autocomplete>
<el-table
:data=
"gridData"
:row-key=
"getRowKeys
"
@
selection-change=
"handleSelectionChange"
ref=
"multipleTable"
>
<el-table
:data=
"gridData"
@
filter-method=
"filterChange"
:row-key=
"getRowKeys"
@
select=
"selectItem
"
@
selection-change=
"handleSelectionChange"
ref=
"multipleTable"
>
<el-table-column
type=
"selection"
:reserve-selection=
"true"
...
...
@@ -242,6 +242,7 @@ export default {
},
data
()
{
return
{
pages
:
null
,
//资源标签分页的页数
delArr
:[],
selectItemArr
:
[],
restaurants
:
[],
...
...
@@ -389,7 +390,6 @@ export default {
this
.
getSearchPageLable
();
//this.formSixBtn();
this
.
getMetaDataPlanList
();
console
.
log
(
this
.
formData
.
fieldJsonArr
,
'XXeeeeeeeeeee'
)
},
watch
:
{
$route
:
{
...
...
@@ -412,6 +412,9 @@ export default {
}
},
methods
:
{
filterChange
(
row
,
value
)
{
console
.
log
(
row
,
"123456+++++++++++++++++++++"
)
},
showMark
()
{
this
.
isShowMark
=
true
;
},
...
...
@@ -628,6 +631,7 @@ export default {
}
},
getLookContent
()
{
//查看
//this.dialogTableVisible = true;
let
_this
=
this
;
if
(
this
.
$route
.
query
.
oid
&&
this
.
$route
.
query
.
flag
)
{
this
.
isShowSavaBtn1
=
true
;
...
...
@@ -658,26 +662,31 @@ export default {
if
(
res
.
data
.
data
.
longitude
)
{
this
.
location
=
'经度:'
+
res
.
data
.
data
.
longitude
+
','
+
'维度:'
+
res
.
data
.
data
.
latitude
+
','
+
res
.
data
.
data
.
address
;
}
console
.
log
(
this
.
gridData
,
'123OP'
)
_this
.
$nextTick
(()
=>
{
res
.
data
.
data
.
label
.
map
((
item
,
index
)
=>
{
_this
.
$set
(
item
,
'value'
,
item
.
labelId
);
_this
.
resourceLabel
.
push
(
item
)
})
console
.
log
(
_this
.
resourceLabel
,
'KLlll'
)
_this
.
resourceLabel
.
map
(
itemX
=>
{
console
.
log
(
itemX
,
"123"
)
_this
.
gridData
.
map
((
itemY
,
index
)
=>
{
console
.
log
(
itemY
,
'HJHJHj'
)
if
(
itemX
.
labelId
==
itemY
.
id
)
{
_this
.
$nextTick
(
function
()
{
// DOM 更新了
_this
.
$refs
.
multipleTable
.
toggleRowSelection
(
_this
.
gridData
[
index
],
true
);
})
}
})
})
res
.
data
.
data
.
label
.
map
((
item
,
index
)
=>
{
_this
.
$set
(
item
,
'value'
,
item
.
labelId
);
_this
.
resourceLabel
.
push
(
item
)
})
// console.log(this.gridData, '123OP')
// _this.$nextTick(function() {
// res.data.data.label.map((item, index) => {
// _this.$set(item, 'value', item.labelId);
// _this.resourceLabel.push(item)
// })
// console.log(_this.resourceLabel, 'KLlll')
// _this.resourceLabel.map(itemX => {
// console.log(itemX, "123")
// _this.gridData.map((itemY, index) => {
// console.log(itemY, 'HJHJHj')
// if (itemX.labelId == itemY.id) {
// _this.$nextTick(function () {
// // DOM 更新了
// console.log(_this.$refs.multipleTable, '123456789')
// _this.$refs.multipleTable.toggleRowSelection(_this.gridData[index], true);
// })
// }
// })
// })
// })
res
.
data
.
data
.
diyType
.
map
((
item
,
index
)
=>
{
this
.
$set
(
item
,
'value'
,
item
.
dtId
);
this
.
$set
(
item
,
'label'
,
item
.
typeName
);
...
...
@@ -693,6 +702,15 @@ export default {
}
},
saveEdit
()
{
//保存编辑
let
optIdArr
=
[];
this
.
resourceLabel
.
map
((
item
,
index
)
=>
{
var
obj
=
{
labelId
:
item
.
labelId
}
optIdArr
.
push
(
obj
)
})
this
.
formData
.
label
=
optIdArr
;
console
.
log
(
optIdArr
,
'312312312'
)
this
.
formData
.
fieldJson
=
JSON
.
stringify
(
this
.
fieldJsonData
)
const
formOne
=
new
Promise
((
resolve
,
reject
)
=>
{
this
.
$refs
[
'formOne'
].
validate
(
valid
=>
{
...
...
@@ -794,10 +812,11 @@ export default {
getSearchPageLable
()
{
searchPageLableAPI
(
this
.
searchPageLableForm
)
.
then
(
res
=>
{
console
.
log
(
res
,
'21312'
)
console
.
log
(
res
,
'21312
ttttt
'
)
if
(
res
.
data
.
code
===
0
)
{
this
.
gridData
=
res
.
data
.
data
.
list
this
.
totalCount
=
res
.
data
.
data
.
total
this
.
totalCount
=
res
.
data
.
data
.
total
;
this
.
pages
=
res
.
data
.
data
.
pages
;
for
(
let
[
index
,
ele
]
of
this
.
gridData
.
entries
()
)
{
this
.
$set
(
ele
,
'value'
,
ele
.
name
)
};
...
...
@@ -806,13 +825,47 @@ export default {
})
},
showLableDia
()
{
let
_this
=
this
;
this
.
dialogTableVisible
=
true
;
if
(
this
.
$route
.
query
.
flag
===
'look'
)
{
_this
.
resourceLabel
.
map
(
itemX
=>
{
if
(
_this
.
gridData
.
length
>
0
)
{
_this
.
gridData
.
map
((
itemY
,
index
)
=>
{
if
(
itemX
.
labelId
==
itemY
.
id
)
{
_this
.
$nextTick
(
function
()
{
// DOM 更新了
_this
.
$refs
.
multipleTable
.
toggleRowSelection
(
_this
.
gridData
[
index
],
true
);
})
}
})
}
})
}
this
.
setDelData
();
},
handleSelectionChange
(
val
)
{
// multipleSelection
console
.
log
(
val
,
'123123'
)
console
.
log
(
val
,
'valvalvalval'
)
val
.
map
(
item
=>
{
this
.
$set
(
item
,
'labelId'
,
item
.
id
)
})
this
.
multipleSelection
=
val
;
if
(
this
.
$route
.
query
.
flag
===
'look'
)
{
console
.
log
(
this
.
resourceLabel
,
"&*&*&*"
)
//val.length = 0;
this
.
multipleSelection
=
this
.
resourceLabel
;
// this.multipleSelection = [...this.multipleSelection, ...val];//需要去重
// //数组对象去重
// let obj = {};
// let peon = this.multipleSelection.reduce((cur,next) => {
// obj[next.labelId] ? "" : obj[next.labelId] = true && cur.push(next);
// return cur;
// },[]) //设置cur默认类型为数组,并且初始值为空的数组
// this.multipleSelection = peon;
// console.log(val, '123123ttttttttttt')
}
// let arr = [...this.multipleSelection, ...val];
// console.log(arr,123)
// //数组对象去重
...
...
@@ -831,17 +884,66 @@ export default {
// })
// this.formData.label = optIdArr;
},
// selectAll(selection) {
// if (selection.length != 0) {
// this.multipleSelection = [...this.multipleSelection, ...selection];
// }
// },
selectItem
(
selection
,
row
)
{
console
.
log
(
selection
,
"KKKKKKKKKKKKK"
)
console
.
log
(
row
,
"LLLLLLLLLLLLLLLLL"
)
console
.
log
(
this
.
resourceLabel
,
"66666666666666"
)
let
ids
=
[];
this
.
resourceLabel
.
map
(
item
=>
{
ids
.
push
(
item
.
labelId
)
})
//判断selection中有没有row,若果有true,没有false;
if
(
selection
.
length
!=
0
)
{
selection
.
map
(
item
=>
{
if
(
item
.
id
===
row
.
id
&&
ids
.
includes
(
row
.
id
)
===
false
)
{
//如果二者相等说明点击的row是一开始没有被选中的需要返显到resourceLabel
this
.
resourceLabel
.
unshift
(
row
)
}
else
{
//剩下最后一个再点的时候selection是个空数组,没有元素,没有对应的item.id,所以下边的代码不跑
console
.
log
(
this
.
resourceLabel
,
"88888888888"
)
//没有666说明二者不相等,不相等就删除resourceLabel中的对应项
this
.
resourceLabel
.
map
((
item2
,
index
)
=>
{
if
(
!
item2
.
labelId
)
{
this
.
$set
(
item2
,
'labelId'
,
item2
.
id
)
}
if
(
row
.
id
===
item2
.
labelId
)
{
this
.
resourceLabel
.
splice
(
index
,
1
)
}
})
}
})
}
else
{
this
.
resourceLabel
.
map
((
item2
,
index
)
=>
{
if
(
!
item2
.
labelId
)
{
this
.
$set
(
item2
,
'labelId'
,
item2
.
id
)
}
if
(
row
.
id
===
item2
.
labelId
)
{
this
.
resourceLabel
.
splice
(
index
,
1
)
}
})
}
},
sureLable
()
{
// this.multipleSelection.map((item, index) => {
// if (!this.resourceLabel.includes(item.name)) {
// this.resourceLabel.push(item.name)
// }
// })
console
.
log
(
this
.
multipleSelection
,
"789OOO"
)
this
.
resourceLabel
=
this
.
multipleSelection
;
let
optIdArr
=
[];
this
.
resourceLabel
.
map
((
item
,
index
)
=>
{
var
obj
=
{
labelId
:
item
.
i
d
labelId
:
item
.
labelI
d
}
optIdArr
.
push
(
obj
)
})
...
...
@@ -857,8 +959,25 @@ export default {
this
.
getSearchPageLable
()
},
handleCurrentChange
(
val
)
{
let
_this
=
this
;
this
.
searchPageLableForm
.
pageNum
=
val
this
.
getSearchPageLable
();
setTimeout
(()
=>
{
if
(
_this
.
$route
.
query
.
flag
===
'look'
)
{
_this
.
resourceLabel
.
map
(
itemX
=>
{
if
(
_this
.
gridData
.
length
>
0
)
{
_this
.
gridData
.
map
((
itemY
,
index
)
=>
{
if
(
itemX
.
labelId
==
itemY
.
id
)
{
_this
.
$nextTick
(
function
()
{
// DOM 更新了
_this
.
$refs
.
multipleTable
.
toggleRowSelection
(
_this
.
gridData
[
index
],
true
);
})
}
})
}
})
}
},
100
)
},
closeLableDia
()
{
console
.
log
(
this
.
resourceLabel
,
'88888'
)
...
...
@@ -903,7 +1022,7 @@ export default {
let
optIdArr
=
[];
this
.
resourceLabel
.
map
((
item
,
index
)
=>
{
var
obj
=
{
labelId
:
item
.
i
d
labelId
:
item
.
labelI
d
}
optIdArr
.
push
(
obj
)
})
...
...
@@ -938,7 +1057,7 @@ export default {
},
getRowKeys
(
row
)
{
return
row
.
id
},
},
},
beforeRouteLeave
(
to
,
from
,
next
)
{
from
.
meta
.
keepAlive
=
false
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论