liyongli před 1 rokem
rodič
revize
558a76fd5e

+ 119 - 0
src/api/plagiarismCheck.js

@@ -0,0 +1,119 @@
+import ajax from '../utils/request.js';
+import config from '../config/index.js';
+
+/**
+ * 创建对比项目
+ * @param {object} ori
+ * @returns
+ */
+export function createPlag(ori) {
+  return ajax({
+    api: '/bid/project/create',
+    base: 'plagiarismCheck',
+    data: ori,
+    method: 'POST',
+    headers: {
+      Authorization: localStorage.getItem('token')
+    }
+  });
+}
+
+/**
+ * 对比项目列表
+ * @param {object} ori
+ * @returns
+ */
+export function getList(ori) {
+  return ajax({
+    api: '/bid/project/list',
+    base: 'plagiarismCheck',
+    data: ori,
+    method: 'POST',
+    headers: {
+      Authorization: localStorage.getItem('token')
+    }
+  });
+}
+
+/**
+ * 删除项目
+ * @param {object} ori
+ * @returns
+ */
+export function delList(ori) {
+  return ajax({
+    api: '/bid/project/delete/' + ori.id,
+    base: 'plagiarismCheck',
+    method: 'GET',
+    headers: {
+      Authorization: localStorage.getItem('token')
+    }
+  });
+}
+
+/**
+ * 更新项目
+ * @param {object} ori
+ * @returns
+ */
+export function upList(ori) {
+  return ajax({
+    api: '/bid/project/update',
+    base: 'plagiarismCheck',
+    method: 'POST',
+    headers: {
+      Authorization: localStorage.getItem('token')
+    }
+  });
+}
+
+/**
+ * 导入项目文件
+ * @param {object} ori
+ * @returns
+ */
+export function importFiles(ori) {
+  return ajax({
+    api: '/bid/files/create',
+    base: 'plagiarismCheck',
+    method: 'POST',
+    data: ori,
+    headers: {
+      Authorization: localStorage.getItem('token')
+    }
+  });
+}
+
+/**
+ * 上传项目文件
+ * @param {object} ori
+ * @returns
+ */
+export function upFiles(ori) {
+  return new Promise((resolve, reject) => {
+    // 创建XMLHttpRequest对象
+    var xhr = new XMLHttpRequest();
+    // 配置请求
+    xhr.open('POST', config.base['plagiarismCheck'] + '/bid/files/uploads', true);
+
+    xhr.onreadystatechange = function() {
+      if (this.readyState !== 4) return;
+      var data = JSON.parse(this.responseText || '{}');
+      if (this.status !== 200) {
+        // 网络错误
+        return reject({ ...data, status: this.status });
+      }
+      if (data.code !== 0) {
+        // 业务错误
+        return reject({ ...data, status: this.status });
+      }
+
+      return resolve(data.data);
+    };
+
+    xhr.setRequestHeader('Authorization', localStorage.getItem('token'));
+
+    // 发送请求
+    xhr.send(ori);
+  });
+}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 0
src/config/index.js


+ 6 - 0
src/router/allMedia.js

@@ -146,6 +146,12 @@ export default [
         component: () =>
           import(/* webpackChunkName: "kimigpt" */ '../view/allMedia/kimigpt/index.vue'),
       },
+      {
+        path: 'plagiarismCheck',
+        name: 'plagiarismCheck',
+        component: () =>
+          import(/* webpackChunkName: "plagiarismCheck" */ '../view/plagiarismCheck/index.vue'),
+      },
     ],
   },
 ];

+ 245 - 0
src/view/plagiarismCheck/index.vue

@@ -0,0 +1,245 @@
+<template>
+  <!-- <object
+      :data="route.query.path || 'https://aidoc.sxtvs.net'" 
+      style="height:100%;height: 100%;"
+      type="text/html"
+    ></object> -->
+  <!-- <iframe :src="route.query.path" frameborder="0"></iframe> -->
+  <div>
+    <header_local />
+    <div style="padding: 1em">
+      <el-form
+        style="background: #f9fafc; padding-top: 10px"
+        size="default"
+        :inline="true"
+        :model="formInline"
+        class="demo-form-inline"
+      >
+        <el-form-item label="项目名称">
+          <el-input v-model="formInline.user" placeholder="项目名称" clearable />
+        </el-form-item>
+        <el-form-item label="创建日期">
+          <el-date-picker
+            v-model="formInline.date"
+            type="daterange"
+            range-separator="-"
+            start-placeholder="开始时间"
+            end-placeholder="结束时间"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="onSubmit">查询</el-button>
+          <el-button type="primary" @click="create">创建</el-button>
+        </el-form-item>
+      </el-form>
+      <el-table :data="tableData" style="width: 100%">
+        <el-table-column prop="projectName" label="项目名称" />
+        <el-table-column prop="createTime" label="创建时间" />
+        <el-table-column label="状态">
+          <template #default="scope">
+            <el-tag type="info" v-if="scope.row.status === 0">未开始</el-tag>
+            <el-tag type="primary" v-if="scope.row.status === 1">文件已导入</el-tag>
+            <el-tag type="success" v-if="scope.row.status === 3">审核成功</el-tag>
+            <el-tag type="warning" v-if="scope.row.status === 2">审核中</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column prop="address" label="操作">
+          <template #default="scope">
+            <el-button-group class="ml-4">
+              <el-button
+                type="primary"
+                v-if="scope.row.status < 1"
+                @click="() => importFilesFun(scope.row.id)"
+                >导入</el-button
+              >
+              <el-button type="warning" @click="() => getDetail(scope.row)">查看</el-button>
+              <el-popconfirm title="确定删除该项目?" @confirm="deleteProject(scope.row.id)">
+                <template #reference>
+                  <el-button type="danger">删除</el-button>
+                </template>
+              </el-popconfirm>
+            </el-button-group>
+          </template>
+        </el-table-column>
+      </el-table>
+      <br />
+      <el-pagination
+        @current-change="change"
+        background
+        layout="prev, pager, next"
+        :current-page="page"
+        :total="total"
+      />
+
+      <el-dialog v-model="dialogVisible" title="项目创建">
+        <el-form label-width="auto" style="max-width: 600px">
+          <el-form-item label="项目名称">
+            <el-input v-model="proName" />
+          </el-form-item>
+        </el-form>
+        <template #footer>
+          <div class="dialog-footer">
+            <el-button type="primary" @click="createPro"> 提交 </el-button>
+          </div>
+        </template>
+      </el-dialog>
+
+      <el-dialog v-model="showimport" title="导入文件">
+        <el-form label-width="auto" style="max-width: 600px">
+          <el-form-item label="标书文件">
+            <el-upload v-model:file-list="file" :auto-upload="false">
+              <el-button type="primary">选择</el-button>
+            </el-upload>
+          </el-form-item>
+          <el-form-item label="对比文件">
+            <el-upload v-model:file-list="file1" :auto-upload="false" multiple>
+              <el-button type="primary">选择</el-button>
+            </el-upload>
+          </el-form-item>
+        </el-form>
+        <template #footer>
+          <div class="dialog-footer">
+            <el-button type="primary" @click="subFiles"> 提交 </el-button>
+          </div>
+        </template>
+      </el-dialog>
+
+      <el-dialog v-model="showlook" title="查看结果">
+        <el-form label-width="auto" style="max-width: 600px">
+          <el-form-item :label="item.fname" v-for="item in look.bidFiles || []" :key="item.id">
+            与对标文件相似度{{ item.similarity }}%
+          </el-form-item>
+        </el-form>
+      </el-dialog>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import {
+  getList,
+  createPlag,
+  delList,
+  upList,
+  importFiles,
+  upFiles
+} from '../../api/plagiarismCheck';
+import header_local from '../allMedia/components/header.vue';
+import { ElMessage, ElLoading } from 'element-plus';
+import { ref } from 'vue';
+const dialogVisible = ref(false);
+const showimport = ref(false);
+const showlook = ref(false);
+const look = ref({});
+let importId = '';
+const tableData = ref([]);
+const formInline = ref({
+  user: '',
+  date: []
+});
+const page = ref(1);
+const total = ref(0);
+const proName = ref('');
+const file = ref([]);
+const file1 = ref([]);
+const onSubmit = () => {
+  getProList();
+};
+
+const create = () => {
+  dialogVisible.value = true;
+  file.value = [];
+  file1.value = [];
+};
+
+const change = e => {
+  page.value = e;
+  getProList();
+};
+
+const getProList = () => {
+  getList({
+    page: page.value,
+    pageSize: 10,
+    keyword: formInline.value.user
+  }).then(res => {
+    tableData.value = res.records || [];
+    total.value = res.total;
+  });
+};
+getProList();
+
+const deleteProject = id => {
+  delList({
+    id: id
+  }).then(res => {
+    getProList();
+  });
+};
+
+const createPro = () => {
+  createPlag({
+    projectName: proName.value
+  }).then(res => {
+    dialogVisible.value = false;
+    getProList();
+  });
+};
+
+const getDetail = data => {
+  showlook.value = true;
+  data.bidFiles.shift();
+  look.value = data;
+};
+
+const importFilesFun = id => {
+  showimport.value = true;
+  importId = id;
+};
+
+const subFiles = () => {
+  const data = new FormData();
+  const li = [...file.value, ...file1.value];
+  for (let i = 0; i < li.length; i++) {
+    data.append('files', li[i].raw);
+  }
+  data.append('id', importId);
+  let loading = ElLoading.service({
+    lock: true,
+    text: 'Loading',
+    background: 'rgba(0, 0, 0, 0.1)'
+  });
+  upFiles(data)
+    .then(res => {
+      const baseFile = res.shift();
+      importFiles({
+        projectId: importId,
+        baseFile,
+        compareFiles: res
+      })
+        .then(r => {
+          file.value = [];
+          file1.value = [];
+          showimport.value = false;
+          loading.close();
+          getProList();
+        })
+        .catch(e => {
+          ElMessage({
+            type: 'error',
+            message: '请稍后再试!'
+          });
+          loading.close();
+        });
+    })
+    .catch(e => {
+      ElMessage({
+        type: 'error',
+        message: '请稍后再试!'
+      });
+      loading.close();
+    });
+};
+</script>
+
+<style></style>

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů