|
@@ -14,6 +14,9 @@
|
|
|
<el-input v-model="item.name" :disabled="true" placeholder="短剧名称" style="width:300px;"
|
|
|
class="input-with-select">
|
|
|
</el-input>
|
|
|
+ <el-icon class="ml-3 cursor-pointer" @click="chooseDel(item, index)">
|
|
|
+ <Delete />
|
|
|
+ </el-icon>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
@@ -33,7 +36,7 @@
|
|
|
@change="handleCascaderChange" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="微信审核状态" prop="wechatPass">
|
|
|
- <el-select v-model="query.wechatPass" disabled filterable clearable placeholder="请选择微信审核状态">
|
|
|
+ <el-select v-model="query.wechatPass" filterable clearable placeholder="请选择微信审核状态">
|
|
|
<el-option v-for="item in wxstatusOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -123,14 +126,14 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { downloadImage } from '@/utils/index'
|
|
|
-import { InfoFilled } from '@element-plus/icons-vue';
|
|
|
+import { InfoFilled, Delete } from '@element-plus/icons-vue';
|
|
|
import { provide } from 'vue'
|
|
|
import { useGetList } from '@/hook/curd/useGetList';
|
|
|
import { useDestroy } from '@/hook/curd/useDestroy';
|
|
|
import { useOpen } from '@/hook/curd/useOpen';
|
|
|
import { videoStockVideoCategoryList, videoStockVideoList } from '@/api/video/index'
|
|
|
const api = 'videoStock/video/list';
|
|
|
-const multipleTableRef = ref()
|
|
|
+const multipleTableRef = ref(null); // 初始化为 null
|
|
|
const multipleSelection = ref([]);
|
|
|
const { data, query, search, reset, loading } = useGetList(api);
|
|
|
const selectType = ref([])
|
|
@@ -156,7 +159,7 @@ const handleCascaderChange = (val: any) => {
|
|
|
}
|
|
|
|
|
|
const resetQuery = () => {
|
|
|
- query.value = Object.assign({ page: query.value.page, limit: query.value.limit, shelfType: 2, wechatPass: 1 });
|
|
|
+ query.value = Object.assign({ page: query.value.page, limit: query.value.limit, shelfType: 2 });
|
|
|
search()
|
|
|
selectType.value = []
|
|
|
}
|
|
@@ -197,8 +200,14 @@ const validateData = () => {
|
|
|
};
|
|
|
|
|
|
const tableData = computed(() => data.value?.data);
|
|
|
+const chooseDel = (row: object, idx: number) => {
|
|
|
+ console.log(row, idx, 'row: object, idx: number', multipleSelection.value[idx]);
|
|
|
+ multipleSelection.value.splice(idx, 1);
|
|
|
+ setRowSelected(false)
|
|
|
+}
|
|
|
|
|
|
const handleSelectionChange = (val: []) => {
|
|
|
+ console.log(val, 'handleSelectionChangehandleSelectionChange');
|
|
|
if (rowSelectFlag.value) return
|
|
|
multipleSelection.value = val;
|
|
|
};
|
|
@@ -228,11 +237,16 @@ if (props.primary) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const setRowSelected = () => {
|
|
|
+const setRowSelected = (status: boolean = true) => {
|
|
|
rowSelectFlag.value = true
|
|
|
- Object.keys(multipleSelection.value).forEach(key => {
|
|
|
- multipleSelection.value[key] && multipleTableRef.value.toggleRowSelection(multipleSelection.value[key], true)
|
|
|
- })
|
|
|
+ if (multipleTableRef.value) { // 确保 multipleTableRef 有有效的值
|
|
|
+ multipleTableRef.value.clearSelection(); // 清除之前的选中状态
|
|
|
+ multipleSelection.value.forEach((item) => {
|
|
|
+ multipleTableRef.value.toggleRowSelection(item, status);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ ElMessage.error('表格实例未找到');
|
|
|
+ }
|
|
|
rowSelectFlag.value = false
|
|
|
}
|
|
|
onMounted(() => {
|
|
@@ -252,7 +266,6 @@ onMounted(() => {
|
|
|
overflow: auto;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
.table-default {
|
|
|
.set-warpper {
|
|
|
height: 60px;
|