浏览代码

Merge branch 'xj' of http://192.168.0.115:3000/bill/public-fuse into xj

gemercheung 1 年之前
父节点
当前提交
35c4fe25a1

+ 4 - 0
src/app/fire/view/dispatch/index.vue

@@ -13,6 +13,7 @@
         </el-button>
       </template>
       <template v-else>
+        <el-button type="primary" @click="openMap"> 查看地图案件分布 </el-button>
         <el-button type="primary" @click="addHandler" v-pdpath="'add'">
           新增火调项目
         </el-button>
@@ -132,4 +133,7 @@ const editHandler = async (row: Fire) => {
 const addHandler = async () => {
   (await addFire({})) && pagging.refresh();
 };
+const openMap = () => {
+  window.open("./map.html");
+};
 </script>

+ 16 - 5
src/view/case/addPhotoFile.vue

@@ -59,7 +59,7 @@ import { maxFileSize } from "@/constant/caseFile";
 import { useUpload } from "@/hook/upload";
 import { saveOrUpdate, CaseImg } from "@/store/case";
 import { ElMessage } from "element-plus";
-import { computed, ref, watchEffect } from "vue";
+import { computed, ref, watch, watchEffect } from "vue";
 import { QuiskExpose } from "@/helper/mount";
 
 const props = defineProps<{
@@ -83,10 +83,20 @@ const { size, fileList, upload, removeFile, previewFile, file, accept } = useUpl
 const formatDesc = computed(() =>
 DrawFormatDesc
 );
-
+watch(props, newValue => {
+  caseFile.value.id = newValue.data.id;
+  caseFile.value.imgInfo = newValue.data.imgInfo;
+  caseFile.value.imgUrl = newValue.data.imgUrl;
+  caseFile.value.sort = newValue.data.sort;
+  if(newValue.data.imgUrl){
+    file.value = [{
+    name: newValue.data.imgInfo,
+    url: newValue.data.imgUrl,
+  }]
+  }
+},{ immediate: true })
 watchEffect(() => {
   if (file.value?.name) {
-    caseFile.value.imgUrl = file.value && file.value[0]?.url;
     caseFile.value.imgInfo = file.value?.name.substring(0, 50);
   }
 });
@@ -111,8 +121,9 @@ defineExpose<QuiskExpose>({
       ElMessage.error("附件标题不能为空!");
       throw "附件标题不能为空!";
     }
-    console.log('defineExpose', caseFile.value, file.value.value[0]?.url)
-    await saveOrUpdate({ ...caseFile.value, imgUrl: file.value && file.value.value && file.value.value[0]?.url });
+    console.log('defineExpose', caseFile.value, file.value)
+    let imgUrl = file.value && file.value.value ? file.value.value[0]?.url : file.value[0]?.url
+    await saveOrUpdate({ ...caseFile.value, imgUrl });
     return caseFile.value;
   },
 });

+ 1 - 1
src/view/case/caseFile.vue

@@ -130,7 +130,7 @@ const refresh = async () => {
 watchEffect(() => caseId.value && currentTypeId.value && refresh());
 
 const query = (file: CaseFile) => {
-  const ext = file.filesUrl.substring(file.filesUrl.lastIndexOf("."));
+  const ext = file.filesUrl.substring(file.filesUrl.lastIndexOf(".")).toLocaleLowerCase();
   if (ext === ".raw") {
     window.open(`/xfile-viewer/index.html?file=${file.filesUrl}&time=` + Date.now());
   } else {

+ 20 - 100
src/view/case/photos/draggable.vue

@@ -4,10 +4,10 @@
       <div class="item" v-for="(item, index) in list" :key="item.id" @click="handleItem(index)">
         <img class="itemImg" :src="item.imgUrl" alt="" />
         <div class="text">
-          {{ item.imgInfo }}
+            <div :title="item.imgInfo">{{ item.imgInfo }}</div>
            <EditPen @click.stop="handleEdit(item)" class="EditPen" />
         </div>
-        <CircleCloseFilled @click.stop="handleDet(index)" class="itemIcon" />
+        <CircleCloseFilled @click.stop="handleDet(index, item.id)" class="itemIcon" />
       </div>
     </VueDraggable>
     <el-empty class="empty" v-else description="请上传现场照片" />
@@ -16,106 +16,16 @@
 
 <script setup lang="ts">
 import { ref, onMounted, watch } from 'vue'
-import { caseImgList, CaseImg } from "@/store/case";
+import { caseImgList, CaseImg, caseDel } from "@/store/case";
 import { VueDraggable } from 'vue-draggable-plus'
 import { addCaseImgFile } from "../quisk";
 // import { IconRabbish } from '@element-plus/icons-vue'
 const props = defineProps({ sortType: Boolean, caseId: Number });
 const emit = defineEmits<{
-  (e: "changeList", value: Case[] | null): void;
+  (e: "changeList", value: CaseImg[] | null): void;
   (e: "handleItem", value: Number | null): void;
 }>();
-const list = ref([
-  {
-  name: 'Joao1',
-  id: 1
-},
-{
-  name: 'Jean2',
-  id: 2
-},
-{
-  name: 'Johanna3',
-  id: 3
-},
-{
-  name: 'Juan4',
-  id: 4
-},
-{
-  name: 'Joao5',
-  id: 5
-},
-{
-  name: 'Jean6',
-  id: 6
-},
-{
-  name: 'Johanna7',
-  id: 7
-},
-{
-  name: 'Juan8',
-  id: 8
-},{
-  name: 'Juan4',
-  id: 4
-},
-{
-  name: 'Joao5',
-  id: 5
-},
-{
-  name: 'Jean6',
-  id: 6
-},
-{
-  name: 'Johanna7',
-  id: 7
-},
-{
-  name: 'Juan8',
-  id: 8
-},{
-  name: 'Juan4',
-  id: 4
-},
-{
-  name: 'Joao5',
-  id: 5
-},
-{
-  name: 'Jean6',
-  id: 6
-},
-{
-  name: 'Johanna7',
-  id: 7
-},
-{
-  name: 'Juan8',
-  id: 8
-},{
-  name: 'Juan4',
-  id: 4
-},
-{
-  name: 'Joao5',
-  id: 5
-},
-{
-  name: 'Jean6',
-  id: 6
-},
-{
-  name: 'Johanna7',
-  id: 7
-},
-{
-  name: 'Juan8',
-  id: 8
-}
-])
+const list = ref<CaseImg[]>([])
 
 watch(()=>props.sortType,(newValue, oldValue)=>{
     console.log('sum is changed',newValue,oldValue);
@@ -135,10 +45,12 @@ async function getList () {
   emit("changeList", list.value);
 
 }
-function handleDet(index: Number) {
-  list.value.splice(index, 1)
-  emit("changeList", list.value);
-  console.log('handleDet', list.value);
+function handleDet(index: Number, id: Number) {
+  caseDel(id).then(res=>{
+    list.value.splice(index, 1)
+    emit("changeList", list.value);
+    console.log('handleDet', list.value);
+  })
 }
 function handleEdit(params) {
   addCaseImgFile({ caseId: props.caseId, data: {
@@ -171,10 +83,18 @@ onMounted(() => {
       object-fit: cover;
     }
     .text{
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      div{
+        width: calc(100% - 20px);
+        white-space: nowrap;
+        text-overflow: ellipsis;
+        overflow: hidden;
+      }
       .EditPen{
         width: 20px;
         height: 20px;
-        float: right;
       }
     }
     .itemIcon{

+ 5 - 2
src/view/case/photos/index.vue

@@ -10,7 +10,7 @@
           >{{ sortType ? "横排" : "竖排" }}</el-button
         >
       </div>
-      <draggable :caseId="caseId" :sortType="sortType" @changeList="changeList" @handleItem="handleItem" />
+      <draggable ref="draggableRef" :caseId="caseId" :sortType="sortType" @changeList="changeList" @handleItem="handleItem" />
     </div>
     <div class="right">
       <swiper
@@ -59,9 +59,9 @@ import draggable from './draggable.vue';
 const props = defineProps({ caseId: Number });
 const newlist = ref([]);
 const swiperRef = ref(null);
+const draggableRef = ref(null);
 const caseId = ref(props.caseId);
 const sortType = ref(false);
-console.log(props);
 const addCaseFileHandler = async () => {
   await addCaseImgFile({ caseId: caseId.value, data: {
     imgUrl: '',
@@ -71,6 +71,9 @@ const addCaseFileHandler = async () => {
   } });
   refresh();
 };
+function refresh() {
+  console.log("changeList", draggableRef.value);
+}
 const changeList = (list) => {
   let newList = [];
   list.map((item, index) => {

+ 3 - 3
src/view/system/imageCropper.vue

@@ -22,10 +22,10 @@
       />
     </div>
     <div class="control">
-      <div class="slider-demo-block">
+      <!-- <div class="slider-demo-block">
         <span class="demonstration">色相调整</span>
         <el-slider v-model="hue" :max="360" :min="0" show-input />
-      </div>
+      </div> -->
       <el-button type="primary" @click="cropperRef.rotateRight()"> 旋转 </el-button>
     </div>
   </div>
@@ -45,7 +45,7 @@ type CropperProps = {
 };
 const props = defineProps<CropperProps>();
 
-const hue = ref(90);
+const hue = ref(0);
 // 样式控制
 const sWidth = 500;
 const sHeight = (props.fixed[1] / props.fixed[0]) * sWidth;

+ 7 - 0
vite.config.ts

@@ -16,6 +16,13 @@ export default defineConfig({
   },
   base: "./",
   build: {
+    rollupOptions: {
+      input: {
+        index: resolve(__dirname, "index.html"),
+        map: resolve(__dirname, "map.html"),
+        // 在这里继续添加更多页面
+      },
+    },
     outDir: `dist/${app}`,
   },
   resolve: {