Преглед на файлове

fix: Merge branch 'prod' into dev

bill преди 1 година
родител
ревизия
198edd5622
променени са 7 файла, в които са добавени 42 реда и са изтрити 13 реда
  1. 2 2
      .env.production
  2. 1 1
      package.json
  3. 1 2
      src/util/index.ts
  4. 1 1
      src/view/organization-edit.vue
  5. 1 1
      src/view/register/reset.vue
  6. 33 3
      src/view/step-tree-v2/example/example.vue
  7. 3 3
      src/view/step-tree-v2/example/step.vue

+ 2 - 2
.env.production

@@ -1,3 +1,3 @@
-VITE_QJ_URL=https://test.4dkankan.com/panorama
+VITE_QJ_URL=https://4dkankan.com/panorama
 VITE_LASER_URL=https://laser.4dkankan.com/4pc
-VITE_API=https://uat-sp.4dkankan.com/
+VITE_API=https://sp.4dkankan.com/

+ 1 - 1
package.json

@@ -5,7 +5,7 @@
   "type": "module",
   "scripts": {
     "dev": "vite",
-    "build": "vue-tsc && vite build",
+    "build": "vue-tsc && vite build --mode production",
     "build-uat": "vue-tsc && vite build --mode uat",
     "preview": "vite preview"
   },

+ 1 - 2
src/util/index.ts

@@ -74,8 +74,7 @@ export const toDegrees = (val: number, retain = 4) => {
   temps = numberSplice(temps[1] * 60);
   const m = temps[0];
   const s = round(temps[1] * 60, retain);
-
-  return `${d}°${m}'${s}"`;
+  return `${d}°${m}′${s.toFixed(retain)}″`;
 };
 
 export const copyText = async (

+ 1 - 1
src/view/organization-edit.vue

@@ -2,7 +2,7 @@
 
   <el-form label-width="100px" :model="data" :rules="rules" ref="baseFormRef">
     <el-form-item label="单位名称" prop="orgName" required>
-      <el-input v-model="data.orgName" style="width: 300px" :maxlength="50" placeholder="请输入" />
+      <el-input v-model.trim="data.orgName" style="width: 300px" :maxlength="50" placeholder="请输入" />
     </el-form-item>
     <el-form-item label="类型" prop="type" required>
       <!-- <el-input v-model="data.type" style="width: 300px" :maxlength="500" placeholder="请输入" /> -->

+ 1 - 1
src/view/register/reset.vue

@@ -232,7 +232,7 @@ const submitClick = async () => {
         phoneNum: form.userName,
       });
       console.log("result", result);
-      ElMessage.success("重置密码成功!");
+      // ElMessage.success("重置密码成功!");
       emit("done");
     }
   } else {

+ 33 - 3
src/view/step-tree-v2/example/example.vue

@@ -11,10 +11,10 @@
     </select>
   </div>
   <div class="tree-cont-wrap" ref="treeWrapRef">
-    <StepTree :data="items[activeNdx].steps" :margin="[85, 85]" lineColor="#89beb2">
+    <StepTree :data="treeData" :margin="[25, 25]" lineColor="#89beb2">
       <template #step="{ data, start }">
         <Step
-          :item="data"
+          :item="newData.find(({ raw }) => raw.name === data.name)?.raw || data"
           :start="start"
           @click="stepClickHandler(data)"
           @clickHost="stepHostClickHandler"
@@ -36,13 +36,43 @@ import data6 from "./data/6.json";
 import data7 from "./data/7.json";
 import data8 from "./data/8.json";
 import data9 from "./data/9.json";
-import { ref, nextTick, toRefs, watchEffect } from "vue";
+import { flatSteps } from "../helper-v2";
+import { ref, nextTick, toRaw, toRefs, watchEffect, computed, watch } from "vue";
 import { useRouter } from "vue-router";
 
 const treeWrapRef = ref();
 const $router = useRouter();
 const items = [data1, data2, data3, data4, data5, data6, data7, data8, data9];
 const activeNdx = ref("8");
+const treeData = computed(() => items[activeNdx.value].steps);
+
+const newData = ref();
+watch(
+  treeData,
+  () => {
+    newData.value = flatSteps(
+      JSON.parse(JSON.stringify(items[activeNdx.value].steps))
+    ).steps;
+  },
+  { immediate: true }
+);
+
+const status = ["success", "error", "running", "waiting"];
+watch(
+  newData,
+  (newData, _, onCleanup) => {
+    let c = 0;
+    const interval = setInterval(() => {
+      const s = status[c];
+      for (let i = 0; i < newData.length; i++) {
+        newData[i].raw.status = s;
+      }
+      c = (c + 1) % status.length;
+    }, 1000);
+    onCleanup(() => clearInterval(interval));
+  },
+  { immediate: true }
+);
 
 const stepClickHandler = (step) => {
   if (step.type === "startEnd") return;

+ 3 - 3
src/view/step-tree-v2/example/step.vue

@@ -53,9 +53,9 @@ const colorMap = {
   running: "#ecf752",
   waiting: "#89beb2",
 };
-const currentColor = computed(() =>
-  props.item.status in colorMap ? colorMap[props.item.status] : defaultColor
-);
+const currentColor = computed(() => {
+  return props.item.status in colorMap ? colorMap[props.item.status] : defaultColor;
+});
 </script>
 
 <style scoped lang="scss">