浏览代码

环境变量

zhangliang2 3 年之前
父节点
当前提交
04cae6074f
共有 4 个文件被更改,包括 45 次插入1 次删除
  1. 7 0
      .env
  2. 7 0
      .env.dev
  3. 1 1
      package.json
  4. 30 0
      src/views/sceneLibrary/naturalDrivingScenarioList.vue

+ 7 - 0
.env

@@ -0,0 +1,7 @@
+# 用于标记打包的环境
+NODE_ENV = production
+
+# 使用 process.env.VUE_APP_GET_HOST
+
+# 域名
+VUE_APP_GET_HOST = ''

+ 7 - 0
.env.dev

@@ -0,0 +1,7 @@
+# 用于标记打包的环境
+NODE_ENV = DEV
+
+# 使用 process.env.VUE_APP_GET_HOST
+
+# 域名
+VUE_APP_GET_HOST = 'http://10.15.12.72:8001'

+ 1 - 1
package.json

@@ -3,7 +3,7 @@
   "version": "0.1.0",
   "private": true,
   "scripts": {
-    "serve": "vue-cli-service serve",
+    "serve": "vue-cli-service serve --mode dev",
     "build": "vue-cli-service build",
     "test:unit": "vue-cli-service test:unit",
     "test:e2e": "vue-cli-service test:e2e",

+ 30 - 0
src/views/sceneLibrary/naturalDrivingScenarioList.vue

@@ -154,6 +154,12 @@
                         title="查看"
                     >
                     </i>
+                    <i
+                        @click="delRow(scope.row)"
+                        class="el-icon-delete elIcon"
+                        title="删除"
+                    >
+                    </i>
                 </template>
             </el-table-column>
         </tableList>
@@ -307,6 +313,28 @@ export default {
             //     }
             // });
         },
+        delRow(row) {
+            this.$confirm("确认是否删除?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            }).then(() => {
+                this.$axios({
+                    method: "post",
+                    url: this.$api.sceneLibrary.deleteScoringRules,
+                    data: {
+                        rulesId: row.rulesId,
+                    },
+                }).then((res) => {
+                    if (res.code == 200) {
+                        this.$message.success("删除成功");
+                    } else {
+                        this.$message.error(res.message || "删除失败");
+                    }
+                    this.doSearch();
+                });
+            });
+        },
         diaClose(done) {
             this.autoplay = false;
             this.videoSrc = "";
@@ -323,6 +351,8 @@ export default {
     },
 
     async mounted() {
+        console.log(process.env.GET_HOST);
+        console.log(process.env);
         await this.$dicsTreesInit({
             roadList: "road",
             infrastructureList: "infrastructure",