研发图纸文件管理系统-前端项目
he wei
2024-01-02 14a3a423147d31aae2a52e2cf7398ee64794e56f
U 初始筛选条件
2个文件已修改
46 ■■■■ 已修改文件
src/components/table/advance/SearchArea.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/sopFile/list.vue 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/table/advance/SearchArea.vue
@@ -85,6 +85,7 @@
    },
    created() {
      this.formatColumns(this.columns)
      this.setDefault(this.searchCols)
    },
    watch: {
      columns(newVal, oldVal) {
@@ -198,6 +199,14 @@
        this.searchOptions = getSearchOptions(this.searchCols)
        this.$emit('change', this.conditions, this.searchOptions, col)
      },
      setDefault(columns) {
        columns.filter(item => item.search.default != undefined)
          .forEach(col => {
            // const {value, default} = col.search
            col.search.value = col.search.default;
            this.backupAndEmitChange(col);
          });
      },
      getConditions(columns) {
        const conditions = {}
        columns.filter(item => item.search.value !== undefined && item.search.value !== '' && item.search.value !== null)
src/pages/resourceManage/sopFile/list.vue
@@ -60,8 +60,18 @@
              <a-tag v-else class="tag-all" color="#f50"> 适用全部 </a-tag>
              <template v-if="canDownload">
                <a-divider type="vertical"></a-divider>
                <a v-if="record.isCanPreview" :disabled="!record.status" @click="downloadFile(record)">预览</a>
                  <a v-else :disabled="!record.status" @click="downloadFile(record)">下载</a>
                <a
                  v-if="record.isCanPreview"
                  :disabled="!record.status"
                  @click="downloadFile(record)"
                  >预览</a
                >
                <a
                  v-else
                  :disabled="!record.status"
                  @click="downloadFile(record)"
                  >下载</a
                >
              </template>
              <a-divider type="vertical"></a-divider>
              <a-popover title="" trigger="hover">
@@ -228,11 +238,11 @@
          :width="960"
          title="文件预览"
          :destroyOnClose="true"
          @cancel="pdfCancel">
      @cancel="pdfCancel"
    >
          <div style="height:600px; overflow-y: auto">
              <iframe :src="pdfInfo.src"></iframe>
          </div>
      </a-modal>
  </div>
</template>
@@ -261,7 +271,6 @@
import getFileTypeAndName from "@/assets/js/tools/getFileTypeAndName";
import VuePdf from "vue-pdf";
export default {
  components: {
    AdvanceTable,
@@ -281,7 +290,7 @@
            numPages: 0,
            rotate: 0,
        },
      rowFileName: '',
      rowFileName: "",
      logList: [],
      logVisible: false,
      currentObj: null,
@@ -440,6 +449,9 @@
              align: "center",
              searchAble: true,
              width: 100,
          search: {
            default: true,
          },
              scopedSlots: { customRender: "status" },
          },
        {
@@ -628,7 +640,9 @@
        return false;
      }
      if (this.rowFileName.toLowerCase() != this.resObj.fileName.toLowerCase()) {
      if (
        this.rowFileName.toLowerCase() != this.resObj.fileName.toLowerCase()
      ) {
        this.$message.error("说明文件与该条记录可能不匹配");
        return false;
      }
@@ -835,6 +849,7 @@
      const { pageCurr, pageSize, conditions, columns } = this;
      let params = { pageCurr, pageSize };
      let data = {};
      console.log(this.conditions['status']);
      Object.keys(conditions).forEach((v) => {
        switch (v) {
          case "code":
@@ -861,7 +876,7 @@
            list = data2.list;
            total = data2.total;
          }
          this.dataSource = list.map(item=>{
          this.dataSource = list.map((item) => {
              const fileInfo = getFileTypeAndName(item.fileUrl);
                        item.isCanPreview = fileInfo.type === "pdf";
                        return item;
@@ -879,9 +894,11 @@
    downloadFile(record) {
            const fileInfo = getFileTypeAndName(record.fileUrl);
        let url = this.webUrl + record.fileUrl;
            if(fileInfo.type === 'pdf') {  // 预览
      if (fileInfo.type === "pdf") {
        // 预览
                window.open(url);
            }else {     // 下载
      } else {
        // 下载
                let loading = this.$layer.loading();
                let link = document.createElement("a");
                link.style.display = "none";