浏览代码

数据样例改成随机生成

liling 1 周之前
父节点
当前提交
bc43f7468a
共有 2 个文件被更改,包括 12 次插入6 次删除
  1. 10 4
      src/views/biz/algo/index.vue
  2. 2 2
      vite.config.js

+ 10 - 4
src/views/biz/algo/index.vue

@@ -159,7 +159,7 @@
                 <el-checkbox :key="item.dataId" :label="item.dataName" @change="selecedData(item)"></el-checkbox>
               </div>
             </div>
-            <div v-if="activeTabsName=='200'"><el-button @click="selectDataExp">选择数据样例</el-button><el-button type="primary" @click="checkJS">验 证</el-button></div>       
+            <div v-if="activeTabsName=='200'"><el-button @click="selectDataExp">生成数据样例</el-button><el-button type="primary" @click="checkJS">验 证</el-button></div>       
         </el-form-item>
         <el-form-item label="算法验证结果" label-width="100px">
           <div class="width:100%;height:50px">{{ jsCheckResult }}</div>
@@ -254,8 +254,13 @@ const handleTabClick=()=>{
 }
 
 const selectDataExp=()=>{
-  showExpList.value = !showExpList.value;
-  if(showExpList.value) getDataExp();
+  //选择数据样例
+  //showExpList.value = !showExpList.value;
+  //if(showExpList.value) getDataExp();
+  //生成随机数据样例
+  let cnt=50;
+  lastweek_value.value = "[" + Array.from({ length: cnt }, () => Math.floor(Math.random() * 1000) + 1) + "]";
+  currweek_value.value = "[" + Array.from({ length: cnt }, () => Math.floor(Math.random() * 1000) + 1) + "]";
 }
 
 const selecedData=(item)=>{
@@ -407,9 +412,10 @@ function handleAdd() {
   reset();
   open.value = true;
   title.value = "添加算法管理";
+  modelValue.value = '';
   setTimeout(() => {
     initEditor();
-  }, 100);  
+  }, 300);  
 }
 
 /** 修改按钮操作 */

+ 2 - 2
vite.config.js

@@ -25,13 +25,13 @@ export default defineConfig(({ mode, command }) => {
     },
     // vite 相关配置
     server: {
-      port: 80,
+      port: 8080,
       host: true,
       open: true,
       proxy: {
         // https://cn.vitejs.dev/config/#server-proxy
         '/dev-api': {
-          target: 'http://localhost:18081',
+          target: 'http://192.168.1.66:18080',
           changeOrigin: true,
           rewrite: (p) => p.replace(/^\/dev-api/, '')
         }