gaoluyang
7 天以前 644f9b827ac28d39f32c626712d5c574fe9acbf1
src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue
@@ -29,7 +29,9 @@
          :tableLoading="tableLoading"
          :isSelection="true"
          @selection-change="handleSelectionChange"
          height="600"
          height="500"
               :page="page"
               @pagination="pagination"
      >
      </PIMTable>
      <template #footer>
@@ -38,18 +40,13 @@
        </div>
      </template>
    </el-dialog>
      <filePreview ref="filePreviewRef" />
  </div>
</template>
<script setup>
import {ref} from "vue";
import {getStaffJoinInfo, staffJoinAdd, staffJoinUpdate} from "@/api/personnelManagement/onboarding.js";
import {Search} from "@element-plus/icons-vue";
import {
  qualityInspectParamDel,
  qualityInspectParamInfo,
  qualityInspectParamUpdate
} from "@/api/qualityManagement/qualityInspectParam.js";
import filePreview from '@/components/filePreview/index.vue'
import {ElMessageBox} from "element-plus";
import {getToken} from "@/utils/auth.js";
import {
@@ -68,14 +65,6 @@
    label: "文件名称",
    prop: "name",
  },
  // {
  //   label: "上传人",
  //   prop: "createUser",
  // },
  // {
  //   label: "上传时间",
  //   prop: "createTime",
  // },
  {
    dataType: "action",
    label: "操作",
@@ -87,13 +76,27 @@
        clickFun: (row) => {
          downLoadFile(row);
        },
      }
      },
         {
            name: "预览",
            type: "text",
            clickFun: (row) => {
               lookFile(row);
            },
         }
    ],
  },
]);
const page = reactive({
   current: 1,
   size: 100,
   total: 0
});
const total = ref(0);
const tableData = ref([]);
const fileList = ref([]);
const tableLoading = ref(false);
const filePreviewRef = ref()
const headers = ref({
  Authorization: "Bearer " + getToken(),
});
@@ -105,9 +108,16 @@
  currentId.value = row.id;
  getList()
}
const pagination = (obj) => {
   page.current = obj.page;
   page.size = obj.limit;
   getList();
};
const getList = () => {
  qualityInspectFileListPage({inspectId: currentId.value}).then(res => {
  qualityInspectFileListPage({inspectId: currentId.value, ...page}).then(res => {
    tableData.value = res.data.records;
      page.total = res.data.total;
  })
}
// 表格选择数据
@@ -147,6 +157,10 @@
const downLoadFile = (row) => {
  proxy.$download.name(row.url);
}
// 预览附件
const lookFile = (row) => {
   filePreviewRef.value.open(row.url)
}
// 删除
const handleDelete = () => {
  let ids = [];