Forráskód Böngészése

Merge branch 'xf_dev' of jiaxiaoqiang/JG-CLIENT-TEMP into master

jiaxiaoqiang 10 hónapja
szülő
commit
6f9b739631

+ 1 - 1
.env.development

@@ -11,7 +11,7 @@ VITE_APP_BASE_API = '/dev-api'
 VITE_APP_UPLOAD_URL = 'http://192.168.101.4:9000'
 
 # 开发接口地址
-VITE_APP_API_URL = 'http://121.41.179.41:8079'
+VITE_APP_API_URL = 'http://192.168.101.4:8079'
 # Websocket地址
 VITE_WEBSOCKET_URL = 'ws://192.168.101.4:8079'
 ``

+ 0 - 1
index.html

@@ -17,7 +17,6 @@
 
   <body>
     <div id="app">
-      <div class="loader"></div>
     </div>
   </body>
   <script src="/src/main.ts" type="module"></script>

+ 1 - 0
package.json

@@ -45,6 +45,7 @@
     "@smallwei/avue": "^3.3.3",
     "@types/smallwei__avue": "^3.0.5",
     "@types/uuid": "^9.0.8",
+    "@vue/runtime-core": "^3.4.27",
     "@vueuse/core": "^10.9.0",
     "@wangeditor/editor": "^5.1.23",
     "@wangeditor/editor-for-vue": "5.1.10",

+ 3 - 2
src/App.vue

@@ -11,7 +11,7 @@
     </el-watermark>
     <!-- 关闭水印 -->
     <router-view v-else />
-    <Waves />
+    <Waves v-if="userStore.user.notice" />
   </el-config-provider>
 </template>
 
@@ -19,10 +19,11 @@
 import { useAppStore, useSettingsStore } from "@/store";
 import defaultSettings from "@/settings";
 import { ThemeEnum } from "@/enums/ThemeEnum";
+import { useUserStore } from "@/store";
 
+const userStore = useUserStore();
 const appStore = useAppStore();
 const settingsStore = useSettingsStore();
-
 const locale = computed(() => appStore.locale);
 const size = computed(
   () => appStore.size as "default" | "small" | "large" | undefined

+ 1 - 0
src/api/user/types.ts

@@ -12,6 +12,7 @@ export interface UserInfo {
   perms: string[];
   deptId?: string;
   stationType?: string;
+  notice?: boolean;
 }
 
 /**

+ 17 - 0
src/components/FullLoading/index.ts

@@ -0,0 +1,17 @@
+// /components/Loading/index.ts
+import type { App, VNode } from "vue";
+import { createVNode, render } from "vue";
+import Loading from "./index.vue";
+
+export default {
+  install(app: App) {
+    const Vnode: VNode = createVNode(Loading);
+    render(Vnode, document.body);
+    app.provide("isShow", Vnode.component?.exposed?.isShow);
+    app.config.globalProperties.$loading = {
+      show: Vnode.component?.exposed?.show,
+      hide: Vnode.component?.exposed?.hide,
+      isShow: Vnode.component?.exposed?.isShow,
+    };
+  },
+};

+ 58 - 0
src/components/FullLoading/index.vue

@@ -0,0 +1,58 @@
+<template>
+  <!--  components/Loading/index.vue-->
+  <div v-show="isShow" class="loading">
+    <div>
+      <div class="loading-content">
+        <img src="/logo.png" object-fit="cover" />
+      </div>
+      <div class="titleText">正在加载...</div>
+    </div>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { ref } from "vue";
+const isShow = ref(false); //定位loading 的开关
+
+const show = () => {
+  isShow.value = true;
+};
+const hide = () => {
+  isShow.value = false;
+};
+//对外暴露 当前组件的属性和方法
+defineExpose({
+  isShow,
+  show,
+  hide,
+});
+</script>
+
+<style scoped lang="scss">
+.loading {
+  position: fixed;
+  z-index: 999999;
+  inset: 0;
+  background: #f1f3f5;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  width: 100vw;
+  height: 100vh;
+  @include flex;
+  .loading-content {
+    animation: rotate 4s linear infinite;
+  }
+  .titleText {
+    margin-top: 10px;
+  }
+  @keyframes rotate {
+    from {
+      transform: rotate(0deg);
+    }
+    to {
+      transform: rotate(360deg);
+    }
+  }
+}
+</style>

+ 20 - 1
src/layout/components/header.vue

@@ -57,6 +57,9 @@
               <!--              <el-dropdown-item command="a">Action 1</el-dropdown-item>-->
               <el-dropdown-item command="b">退出登录</el-dropdown-item>
               <!--              <el-dropdown-item command="c" divided>Action 3</el-dropdown-item>-->
+              <el-dropdown-item command="c"
+                >{{ notice ? "关闭" : "打开" }}触摸提示</el-dropdown-item
+              >
             </el-dropdown-menu>
           </template>
         </el-dropdown>
@@ -79,7 +82,7 @@ const route = useRoute();
 const routeMeta = computed(() => {
   return route.meta;
 });
-
+const notice = ref(true);
 const dropdown1 = ref<DropdownInstance>();
 
 const date = dayjs().format("YYYY-MM-DD");
@@ -93,6 +96,16 @@ const headUrl = ref("");
 let timer: any = -1;
 
 onMounted(() => {
+  //获取触摸提示
+  //@ts-ignore
+  if (localStorage.getItem("notice") == true) {
+    notice.value = true;
+  } else {
+    notice.value = false;
+  }
+  //@ts-ignore
+  localStorage.setItem("notice", notice.value);
+  userStore.user.notice = notice.value;
   timer = setInterval(() => {
     time.value = dayjs().format("HH:mm:ss");
   }, 1000);
@@ -120,6 +133,12 @@ const handleCommand = (command: string | number | object) => {
       location.reload();
     });
   }
+  if (command === "c") {
+    notice.value = !notice.value;
+    localStorage.setItem("notice", notice.value);
+    userStore.user.notice = notice.value;
+    ElMessage.success("设置成功!");
+  }
 };
 </script>
 

+ 13 - 2
src/main.ts

@@ -4,6 +4,7 @@ import router from "@/router";
 import { setupStore } from "@/store";
 import { setupDirective } from "@/directive";
 import { setupElIcons, setupI18n, setupPermission } from "@/plugins";
+import Loading from "./components/FullLoading/index";
 
 // 本地SVG图标
 import "virtual:svg-icons-register";
@@ -18,6 +19,17 @@ import "animate.css";
 import { setupEleAvue } from "@/plugins";
 
 const app = createApp(App);
+type Lod = {
+  show: () => void;
+  hide: () => void;
+  isShow: boolean;
+};
+declare module "@vue/runtime-core" {
+  export interface ComponentCustomProperties {
+    $loading: Lod;
+  }
+}
+
 // 全局注册 自定义指令(directive)
 setupDirective(app);
 // 全局注册 状态管理(store)
@@ -30,5 +42,4 @@ setupI18n(app);
 setupPermission();
 
 setupEleAvue(app);
-
-app.use(router).mount("#app");
+app.use(Loading).use(router).mount("#app");

+ 19 - 1
src/plugins/permission.ts

@@ -2,13 +2,24 @@ import router from "@/router";
 import NProgress from "@/utils/nprogress";
 import { useDictionaryStore } from "@/store/modules/dictionary";
 import { getUserDicts } from "@/api/auth";
-
 export function setupPermission() {
   // 白名单路由
   const whiteList: string[] = ["client-traceability"]; //由于包含动态路由,这里面存储的是路由的name而不是path
 
   router.beforeEach(async (to, from, next) => {
     NProgress.start();
+    //在路由跳转前判断是否为不需要全屏加载的二级路由界面(目前项目中只有pro-step界面涉及)
+    const isShow = inject("isShow");
+    const route = useRoute();
+    if (
+      !(
+        route.fullPath.substr(0, 11) == "/pro-steps/" &&
+        to.fullPath.substr(0, 11) == "/pro-steps/"
+      )
+    ) {
+      //@ts-ignore
+      isShow.value = true;
+    }
     const hasToken = localStorage.getItem("token");
     if (hasToken) {
       if (to.path === "/login") {
@@ -50,6 +61,13 @@ export function setupPermission() {
   });
 
   router.afterEach(() => {
+    const isShow = inject("isShow");
+    const route = useRoute();
+    //@ts-ignore
+    if (isShow.value == true) {
+      //@ts-ignore
+      isShow.value = false;
+    }
     NProgress.done();
   });
 }

+ 0 - 1
src/router/modules/process.ts

@@ -164,7 +164,6 @@ export default {
   ],
   beforeEnter: (to, from, next) => {
     const store = useUserStore();
-    console.log(store.user.stationType, "222");
     if (store.user.stationType == "5") {
       next({ path: "/prepare" });
     } else {

+ 1 - 0
src/store/modules/user.ts

@@ -12,6 +12,7 @@ export const useUserStore = defineStore(
     const user = ref<UserInfo>({
       roles: [],
       perms: [],
+      notice: true,
     });
 
     const isGetAuth = ref(false); //是否已经请求过auth接口活的role和menus了

+ 10 - 1
src/styles/index.scss

@@ -3,7 +3,16 @@
 .app-container {
   padding: 10px;
 }
-
+.el-button-big {
+  height: 80px !important;
+  border-radius: 40px !important;
+  font-size: $f24 !important;
+}
+.el-button-update {
+  height: 80px !important;
+  border-radius: 16px !important;
+  font-size: $f24 !important;
+}
 .search-container {
   padding: 18px 0 0 10px;
   margin-bottom: 10px;

+ 2 - 1
src/views/material-flow/creatTask.vue

@@ -94,7 +94,7 @@
             </div>
           </el-scrollbar>
         </div>
-        <el-button class="sureBtn" type="primary" @click="createTask"
+        <el-button class="sureBtn el-button-big" type="primary" @click="createTask"
           >创建任务
         </el-button>
       </el-col>
@@ -347,6 +347,7 @@ const createTask = () => {
   border-radius: 76px 76px 76px 76px;
   width: 100%;
   margin-top: 10px;
+  font-size: $f24;
 }
 
 .number {

+ 10 - 2
src/views/pro-operation/appoint-out/applyFor.vue

@@ -98,8 +98,13 @@
         </el-form-item>
       </el-form>
       <div class="bottom-btns">
-        <el-button class="cancelBtn" @click="cancelClick">重置</el-button>
-        <el-button class="sureBtn" type="primary" @click="confirmClick"
+        <el-button class="cancelBtn el-button-big" @click="cancelClick"
+          >重置</el-button
+        >
+        <el-button
+          class="sureBtn el-button-big"
+          type="primary"
+          @click="confirmClick"
           >发起申请
         </el-button>
       </div>
@@ -180,6 +185,9 @@ const confirmClick = () => {
 </script>
 
 <style lang="scss" scoped>
+:deep(.el-form-item__label) {
+  font-size: $f20;
+}
 #drawContent {
   width: 100%;
   //:deep(.el-form--large.el-form--label-top .el-form-item .el-form-item__label) {

+ 4 - 2
src/views/pro-operation/report-work/index.vue

@@ -84,10 +84,12 @@
     </template>
     <template #footer>
       <div class="bottom-btns">
-        <el-button class="cancelBtn" @click="cancelClick">取消</el-button>
+        <el-button class="cancelBtn el-button-big" @click="cancelClick"
+          >取消</el-button
+        >
         <el-button
           v-if="!formDisabled"
-          class="sureBtn"
+          class="sureBtn el-button-big"
           type="primary"
           @click="confirmClick"
           >报工

+ 1 - 1
src/views/process/components/operate.vue

@@ -3,7 +3,7 @@
   <div class="body">
     <ScanCode />
     <div class="btnBox">
-      <el-button class="btn" color="#0A59F7" round @click="call">
+      <el-button class="btn el-button-big" color="#0A59F7" round @click="call">
         <span class="btnText">叫料</span>
       </el-button>
     </div>

+ 3 - 1
src/views/process/components/scanCode.vue

@@ -56,9 +56,11 @@ const toProSteps = () => {
   getScanData();
 };
 const getScanData = async () => {
+  const value = inputValue.value;
+  inputValue.value = "";
   const { code, data, msg } = await getScan({
     operationId: Number(store.odersData.operationId),
-    qrCode: inputValue.value,
+    qrCode: value,
     workOrderCode: store.odersData.workOrderCode,
     //stationId暂时随便传一个
     stationId: 1,

+ 27 - 8
src/views/process/popUpView/checkPop.vue

@@ -5,12 +5,20 @@
       <div class="title describeText">(需填完后开工)</div>
       <el-scrollbar class="listBody">
         <el-form ref="formRef" :model="checkListArray" label-width="aotu">
-          <div class="item" v-for="(item, index) in checkListArray.array" :key="item.key">
-            <el-form-item :label="`${index + 1}.` + item.deviceName + '-' + item.deviceNo" :rules="{
-              required: true,
-              message: '该选项为必选',
-              trigger: 'change',
-            }" :prop="'array.' + index + '.result'">
+          <div
+            class="item"
+            v-for="(item, index) in checkListArray.array"
+            :key="item.key"
+          >
+            <el-form-item
+              :label="`${index + 1}.` + item.deviceName + '-' + item.deviceNo"
+              :rules="{
+                required: true,
+                message: '该选项为必选',
+                trigger: 'change',
+              }"
+              :prop="'array.' + index + '.result'"
+            >
               <div class="showInfo">
                 <span class="remark">&nbsp;( {{ item.showremark }} ) :</span>
                 <el-radio-group v-model="item.result">
@@ -19,12 +27,23 @@
                 </el-radio-group>
               </div>
             </el-form-item>
-            <el-input v-if="item.result == 1" v-model="item.remark" type="textarea" placeholder="请输入异常原因" />
+            <el-input
+              v-if="item.result == 1"
+              v-model="item.remark"
+              type="textarea"
+              placeholder="请输入异常原因"
+            />
           </div>
         </el-form>
       </el-scrollbar>
       <div class="btns">
-        <el-button size="large" type="primary" @click="validate" class="titleText">提交
+        <el-button
+          size="large"
+          type="primary"
+          @click="validate"
+          class="titleText el-button-update"
+          style="width: 292px"
+          >提 交
         </el-button>
       </div>
     </div>