|
@@ -16,7 +16,7 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { ref, onMounted, watch } from 'vue'
|
|
|
-import { caseImgList, CaseImg, caseDel } from "@/store/case";
|
|
|
+import { caseImgList, CaseImg, caseDel, caseUpdateSort } from "@/store/case";
|
|
|
import { VueDraggable } from 'vue-draggable-plus'
|
|
|
import { addCaseImgFile } from "../quisk";
|
|
|
// import { IconRabbish } from '@element-plus/icons-vue'
|
|
@@ -31,15 +31,19 @@ watch(()=>props.sortType,(newValue, oldValue)=>{
|
|
|
emit("changeList", list.value);
|
|
|
},{ deep: true, immediate:true})
|
|
|
|
|
|
-function onChange(event: any) {
|
|
|
- emit("changeList", list.value);
|
|
|
+async function onChange() {
|
|
|
+ let apiList = list.value.map((item, index) => {
|
|
|
+ return {...item, sort: index + 1}
|
|
|
+ })
|
|
|
+ await caseUpdateSort(apiList)
|
|
|
+ emit("changeList", apiList);
|
|
|
}
|
|
|
function handleItem(index) {
|
|
|
emit("handleItem", index);
|
|
|
|
|
|
}
|
|
|
async function getList () {
|
|
|
- let lists = await caseImgList(props.caseId)
|
|
|
+ let lists = await caseImgList(props.caseId, '')
|
|
|
list.value = lists.data
|
|
|
emit("changeList", list.value);
|
|
|
|