|
@@ -70,8 +70,8 @@
|
|
|
<div v-for="(item, index) in dialogListData" :key="index" class="video-box" @click="selectItem(item)">
|
|
|
<div style="width: 100%; height: 100%; display: flex; align-items: center; justify-content: center">
|
|
|
<div v-if="editVideo">
|
|
|
- <div v-if="item.isUserVideos" class="active-tag" />
|
|
|
- <div :class="item.isUserVideos ? 'common-checked-active' : 'common-checked'" />
|
|
|
+ <div v-if="item.edit" class="active-tag" />
|
|
|
+ <div :class="item.edit ? 'common-checked-active' : 'common-checked'" />
|
|
|
<div class="img" />
|
|
|
<div class="video-label">
|
|
|
<span class="label">{{ item.name }}</span>
|
|
@@ -160,6 +160,9 @@ const getList = (flag?: boolean) => {
|
|
|
...queryParams
|
|
|
};
|
|
|
getVideoListNew(newParams).then((res) => {
|
|
|
+ res.data.forEach((item) => {
|
|
|
+ item.edit = item.isUserVideos;
|
|
|
+ });
|
|
|
dialogListData.value = res.data;
|
|
|
total.value = res.total;
|
|
|
});
|
|
@@ -168,14 +171,27 @@ const getVideoInfoList = () => {
|
|
|
mapStore.setPointParams(queryParams.video_tag);
|
|
|
};
|
|
|
const selectItem = (item) => {
|
|
|
+ let checked = !item.edit;
|
|
|
if (editVideo.value) {
|
|
|
- if (editData.value.length >= 6) {
|
|
|
- showTip.value = true;
|
|
|
- setTimeout(() => {
|
|
|
- showTip.value = false;
|
|
|
- }, 2500);
|
|
|
+ if (checked) {
|
|
|
+ if (editData.value.length >= 6) {
|
|
|
+ showTip.value = true;
|
|
|
+ setTimeout(() => {
|
|
|
+ showTip.value = false;
|
|
|
+ }, 2500);
|
|
|
+ } else {
|
|
|
+ item.edit = true;
|
|
|
+ editData.value.push({
|
|
|
+ name: item.name,
|
|
|
+ video_code_int: item.video_code
|
|
|
+ });
|
|
|
+ }
|
|
|
} else {
|
|
|
- editData.value.push(item);
|
|
|
+ item.edit = false;
|
|
|
+ const index = editData.value.findIndex((item2) => item2.video_code_int === item.video_code);
|
|
|
+ if (index > -1) {
|
|
|
+ editData.value.splice(index, 1);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|