研发图纸文件管理系统-前端项目
longyvfengyun
2023-12-22 6e6cd9532e4b997fc88ab42fab1420b4f2629ab5
软件删除
2个文件已修改
72 ■■■■ 已修改文件
src/pages/resourceManage/software/apis.js 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/software/list.vue 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/software/apis.js
@@ -2,7 +2,7 @@
/**
 * 查询所有的软件 列表
 * @returns
 * @returns
 */
export const getList = (pageCurr, pageSize, data) => {
  return axios({
@@ -13,7 +13,7 @@
}
/**
 * 产品软件审批提交
 * @returns
 * @returns
 */
// export const productSoftwareSubmit = (data) => {
//   return axios({
@@ -27,7 +27,7 @@
// }
/**
 * 软件下载
 * @returns
 * @returns
 */
export const downLoadSoftware = (id) => {
  return axios({
@@ -41,7 +41,7 @@
}
/**
 * 软件说明文档解析
 * @returns
 * @returns
 */
export const excelParse = (data) => {
  return axios({
@@ -55,7 +55,7 @@
}
/**
 * 软件上传
 * @returns
 * @returns
 */
export const productSoftwareSubmit = (data) => {
  return axios({
@@ -69,8 +69,8 @@
}
/**
 *
 * @returns
 *
 * @returns
 */
export const applyModel = (data) => {
  return axios({
@@ -81,7 +81,7 @@
}
/**
 * 软件锁定
 * @returns
 * @returns
 */
export const updateSoftwareLock = (params) => {
  return axios({
@@ -90,3 +90,20 @@
    params
  })
}
/**
 * 删除指定的软件
 * @return {AxiosPromise}
 * @param fileName 文件名称
 * @param version   文件版本
 */
export const deleteSoftwareApi = (fileName, version)=>{
  return axios({
    method: "GET",
    url: "software/deleteSoftware",
    params: {
      fileName,
      version
    }
  })
}
src/pages/resourceManage/software/list.vue
@@ -86,9 +86,8 @@
                  <a-button
                    v-if="canUploadSoftware"
                    type="primary"
                    @click="handleEmailShow(record)"
                    >邮件通知</a-button
                  >
                    @click="handleEmailShow(record)">邮件通知</a-button>
                    <a-button type="primary" :disabled="!isTester" @click="handleConfirmDelete(record)">删除</a-button>
                </a-space>
                <a>更多</a>
              </a-popover>
@@ -219,13 +218,15 @@
import moment from "moment";
import { getUserList } from "../../permission/apis";
import {message, Modal} from "ant-design-vue";
import {
  getList,
  downLoadSoftware,
  excelParse,
  productSoftwareSubmit,
  applyModel,
  updateSoftwareLock,
    getList,
    downLoadSoftware,
    excelParse,
    productSoftwareSubmit,
    applyModel,
    updateSoftwareLock, deleteSoftwareApi,
} from "./apis";
import { mapGetters } from "vuex";
import EmailCard from "../../components/emailCard";
@@ -847,6 +848,26 @@
          console.log(err);
        });
    },
      handleConfirmDelete(obj) {
          Modal.confirm({
              content: () => '删除当前软件,删除后无法恢复,请注意!!!',
              onOk: async ()=>{
                    try {
                        const res = await deleteSoftwareApi(obj.soft.fileName, obj.soft.version);
                        const rs = res.data;
                        if(rs.code ===1 && rs.data) {
                            this.$message.success("删除成功。");
                        }else {
                            this.$message.error("删除失败!!!")
                        }
                        this.searchData();
                    }catch (e) {
                        this.$message.error("删除失败,请联系开发人员!!!")
                        console.log(e);
                    }
              }
          });
      }
  },
  watch: {
    update(n) {