Commit 53dd3b78 authored by 胡占生's avatar 胡占生 🇨🇳
Browse files

fix: 算法管理 版本切换功能增加

parent dcff8325
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -46,6 +46,14 @@ export function addFile(data) {
  })
}

// 使用当前版本算法文件
export function useCurrentFil(algorithmFileId) {
  return request({
    url: `/yunshou/aiAlgorithmFile/useCurrentFile/${algorithmFileId}`,
    method: 'post',
  })
}

// 修改算法文件
export function updateFile(data) {
    return request({
+10 −2
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@
            <template #default="scope">
              <!-- <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
                              >版本内容</el-button> -->
              <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">版本切换</el-button>
              <el-button link type="primary" icon="Delete" @click="useNewFile(scope.row.id)">版本切换</el-button>
            </template>
          </el-table-column>
        </el-table>
@@ -75,7 +75,7 @@

<script setup>
import { addAlg, updateMyAlg , detailAlg,detailMyAlg} from "@/api/algorithmList/index.js";
import { addFile, deleteFile, updateFile, listFile } from "@/api/algorithmList/algorithmFile.js";
import { addFile, deleteFile, updateFile, listFile,useCurrentFil } from "@/api/algorithmList/algorithmFile.js";
import { listAlgLevel} from "@/api/algorithmList/algorithmDown.js";
const { proxy } = getCurrentInstance();
const emit = defineEmits();
@@ -135,6 +135,13 @@ function getList(id) {
    wrapList.value = response.rows;
  });
}
/** 获取文件列表*/
function useNewFile(id) {
  useCurrentFil(id).then(response => {
    proxy.$modal.msgSuccess("变更成功");
    getList(ids.value)
  });
}


/** 新增按钮操作 */
@@ -148,6 +155,7 @@ function handleAdd() {
function handleUpdate(row) {
  console.log("🚀 ~ handleUpdate ~ row:", row)
  const id = row.userAlgorithmId || ids.value;
  ids.value=row.id
  getList(row.id)
  detailMyAlg(id).then(response => {
    form.value = response.data;
+3 −17
Original line number Diff line number Diff line
@@ -73,22 +73,6 @@
                     @click="handState('1')"
                  >已停用</el-button>
               </el-col>
               <el-col :span="1.5">
                  <el-button
                     type="primary"
                     plain
                     @click="handState('2')"
                     v-if="!listState"
                  >已下载</el-button>
               </el-col>
               <el-col :span="1.5">
                  <el-button
                     type="primary"
                     plain
                     @click="handState('3')"
                     v-if="!listState"
                  >已删除</el-button>
               </el-col>
            </el-row>
            <div class="alg-list">
              <el-card  v-for="item in algList" :key="item.name" class="alg-item" shadow="hover" @click="handDetails(item)">
@@ -228,7 +212,7 @@ import { el } from "element-plus/es/locales.mjs";
  }
  function handState(state) {
    queryParams.value.algorithmStatus=state
    getList()
    getMyList()
  }
  function handleUpdate(row) {  
   if(row.status=='0') addMyAlg({algorithmId:row.id}).then((res) => {
@@ -246,12 +230,14 @@ import { el } from "element-plus/es/locales.mjs";
  }
  
  function handMenuAllClick(row) {
    queryParams.value.algorithmStatus=''
    queryParams.value.applicationScenarios=''
    nowTopTitle.value='全部算法'
    getList()
  }
  
  function handMyMenuClick(row) {
    queryParams.value.algorithmStatus=''
    queryParams.value.applicationScenarios=''
    nowTopTitle.value=row.index
    getMyList()