|
@@ -23,12 +23,18 @@
|
|
:name="sub.value"
|
|
:name="sub.value"
|
|
>
|
|
>
|
|
<div class="media-list" v-if="files.length">
|
|
<div class="media-list" v-if="files.length">
|
|
- <div
|
|
|
|
- v-for="file in files"
|
|
|
|
- class="cover"
|
|
|
|
- @click="handerPhotoEdit(file)"
|
|
|
|
- >
|
|
|
|
- <img :src="file.filesUrl" />
|
|
|
|
|
|
+ <div v-for="file in files" class="cover">
|
|
|
|
+ <div class="img">
|
|
|
|
+ <img :src="file.filesUrl" />
|
|
|
|
+ <div class="actions">
|
|
|
|
+ <el-button type="text" @click="handerPhotoEdit(file)">
|
|
|
|
+ 编辑</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button type="text" @click="handerPhotoDelete(file)">
|
|
|
|
+ 删除</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
<span class="title">{{ file.filesTitle }}</span>
|
|
<span class="title">{{ file.filesTitle }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -42,7 +48,7 @@
|
|
import { onMounted, ref, computed, watchEffect, watch } from "vue";
|
|
import { onMounted, ref, computed, watchEffect, watch } from "vue";
|
|
import comHead from "@/components/head/index.vue";
|
|
import comHead from "@/components/head/index.vue";
|
|
import { title, desc } from "@/store/system";
|
|
import { title, desc } from "@/store/system";
|
|
-
|
|
|
|
|
|
+import { confirm } from "@/helper/message";
|
|
import {
|
|
import {
|
|
CaseFile,
|
|
CaseFile,
|
|
CaseFileType,
|
|
CaseFileType,
|
|
@@ -85,6 +91,14 @@ const handerPhotoEdit = (file: CaseFile) => {
|
|
query: { filesTypeId: file.filesTypeId },
|
|
query: { filesTypeId: file.filesTypeId },
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+const handerPhotoDelete = async (file: CaseFile) => {
|
|
|
|
+ console.log("handerPhotoDelete", file);
|
|
|
|
+ if (await confirm("确定要删除此数据?")) {
|
|
|
|
+ await delCaseFile({ caseId: caseId.value!, filesId: file.filesId });
|
|
|
|
+ refresh();
|
|
|
|
+ }
|
|
|
|
+};
|
|
const initDefaultData = async () => {
|
|
const initDefaultData = async () => {
|
|
const data = await getCaseFileTypesQuery("library");
|
|
const data = await getCaseFileTypesQuery("library");
|
|
const rootList = data.map((item) => {
|
|
const rootList = data.map((item) => {
|