Răsfoiți Sursa

Merge branch 'dev_zyh' of United_Software/k_online_ui into dev

Jack Zhou 1 an în urmă
părinte
comite
b360bb48af

+ 1 - 0
.env.development

@@ -0,0 +1 @@
+VITE_API_HOST = 'http://192.168.0.161'

+ 1 - 1
.env.test

@@ -1 +1 @@
-VITE_API_HOST = 'http://192.168.0.161'
+VITE_API_HOST = 'https://ra.kerryapex.com/'

+ 2 - 0
package.json

@@ -6,10 +6,12 @@
   "scripts": {
     "dev": "vite",
     "dev:test": "vite --host --mode test",
+    "dev:dev": "vite --host --mode development",
     "build": "run-p type-check \"build-only {@}\" --",
     "preview": "vite preview",
     "build-only": "vite build",
     "build:test": "vite build --mode test",
+    "build:dev": "vite build --mode development",
     "type-check": "vue-tsc --build --force",
     "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
     "format": "prettier --write src/"

+ 1 - 3
src/views/Layout/src/LayoutView.vue

@@ -30,9 +30,7 @@ const handleMenuCollapse = (val: boolean) => {
       </el-header>
       <!-- 主体内容 -->
       <el-main class="layout-content">
-        <el-scrollbar>
-          <router-view />
-        </el-scrollbar>
+        <router-view />
       </el-main>
     </el-container>
     <ScoringGrade></ScoringGrade>

+ 1 - 1
src/views/Layout/src/components/Header/HeaderView.vue

@@ -11,7 +11,7 @@ const userStore = useUserStore()
 const router = useRouter()
 const headerSearch = useHeaderSearch()
 
-const searchValue = ref('A1703530062')
+const searchValue = ref('')
 const handleSearch = () => {
   // 先判断是否登录
   // 未登录

+ 11 - 2
src/views/Login/src/components/ChangePasswordCard.vue

@@ -3,12 +3,21 @@ import { useRouter } from 'vue-router'
 
 const router = useRouter()
 const loginForm = ref({
-  username: 'ra.admin',
+  username: '',
   oldPassword: '',
   newPassword: '',
   confirmPassword: ''
 })
-
+loginForm.value.username = localStorage.getItem('username') || ''
+if (!loginForm.value.username) {
+  router.push({
+    name: 'Login',
+    query: {
+      status: 'login'
+    }
+  })
+  ElMessage.error('Please login first')
+}
 const newPwdErrTips = ref('')
 const loginError: any = ref({
   oldPassword: false,

+ 4 - 4
src/views/Login/src/loginView.vue

@@ -7,8 +7,8 @@ import ScoringSystem from '@/views/Dashboard/src/components/ScoringSystem.vue'
 const router = useRouter()
 const route = useRoute()
 const loginForm = ref({
-  username: 'ra.admin',
-  password: 'abc123456789',
+  username: '',
+  password: '',
   email: '',
   code: ''
 })
@@ -16,8 +16,8 @@ const loginForm = ref({
 const status = ref(route.query.status || 'login')
 watch(status, () => {
   loginForm.value = {
-    username: 'ra.admin',
-    password: 'abc123456789',
+    username: '',
+    password: '',
     email: '',
     code: ''
   }

+ 1 - 1
src/views/Tracking/src/components/PublicTracking/src/PublicTrackingSearch.vue

@@ -8,7 +8,7 @@ const route = useRoute()
 const headerSearch = useHeaderSearch()
 const searchResult = ref('')
 
-const inputVModel = ref('A170353006211')
+const inputVModel = ref('')
 // 从 store 中获取数据并绑定到输入框
 const headerSearchdData = computed(() => headerSearch.searchValue)
 

+ 31 - 4
src/views/Tracking/src/components/TrackingTable/src/TrackingTable.vue

@@ -74,11 +74,10 @@ const getTableColumns = async (isInit: boolean) => {
   tableLoading.value = true
   await $api.getTrackingTableColumns().then((res: any) => {
     if (res.code === 200) {
-      trackingTable.value.columns = [
+      trackingTable.value.columns = trackingTable.value.columns.concat([
         { type: 'checkbox', width: 50, fixed: 'left' },
-        ...handleColumns(res.data.TrackingTableColumns),
-        { title: 'Action', fixed: 'right', width: 80, slots: { default: 'action' } }
-      ]
+        ...handleColumns(res.data.TrackingTableColumns)
+      ])
       tableOriginColumnsField.value = res.data.TrackingTableColumns
     }
   })
@@ -100,10 +99,22 @@ const getSharedTableData = () => {
     pageInfo.value.total = Number(trackingData.rc)
     TransportListItem.value = trackingData.TransportList
     TagsList.value = trackingData.tagsList
+    console.log(trackingData.canEdiVgm)
+    if (trackingData.canEdiVgm) {
+      console.log('canEdiVgm')
+      trackingTable.value.columns.push({
+        title: 'Action',
+        fixed: 'right',
+        width: 80,
+        slots: { default: 'action' }
+      })
+    }
 
+    console.log(trackingTable.value.columns)
     // 拥有所有字段的表格
     setTimeout(() => {
       allTable.value.columns = handleColumns(trackingData.allColums, 'all')
+
       allTable.value.data = trackingData.searchData
       nextTick(() => {
         allTableRef.value && autoWidth(allTable.value, allTableRef.value)
@@ -130,6 +141,14 @@ const getTableData = async (isInit: boolean, isPageChange?: boolean) => {
     pageInfo.value.total = Number(data.rc)
     TransportListItem.value = data.TransportList
     TagsList.value = data.tagsList
+    if (data.canEdiVgm) {
+      trackingTable.value.columns.push({
+        title: 'Action',
+        fixed: 'right',
+        width: 80,
+        slots: { default: 'action' }
+      })
+    }
 
     // 拥有所有字段的表格
     setTimeout(() => {
@@ -157,6 +176,14 @@ const getTableData = async (isInit: boolean, isPageChange?: boolean) => {
           pageInfo.value.total = Number(res.data.rc)
           TransportListItem.value = res.data.TransportList
           TagsList.value = res.data.tagsList
+          if (res.data.canEdiVgm) {
+            trackingTable.value.columns.push({
+              title: 'Action',
+              fixed: 'right',
+              width: 80,
+              slots: { default: 'action' }
+            })
+          }
 
           // 拥有所有字段的表格
           setTimeout(() => {

+ 5 - 2
src/views/Tracking/src/components/TrackingTable/src/components/VGMView.vue

@@ -241,6 +241,8 @@ const getData = () => {
             }
           })
         })
+      } else if (res.code === 400) {
+        ElMessage.error('No access')
       }
     })
     .finally(() => {
@@ -283,7 +285,6 @@ const handleSave = () => {
       [item]: tableRowData.map((row) => row[item])
     })
   })
-  console.log({ ...tableInfo, ...generalData })
   $api
     .saveVGMData({
       serial_no: allData.value.serial_no,
@@ -292,9 +293,11 @@ const handleSave = () => {
       ...tableInfo
     })
     .then((res) => {
-      console.log(res, '数据')
       if (res.code === 200) {
         // router.push({ name: 'Tracking' })
+        ElMessage.success('Save success')
+      } else if (res.code === 400) {
+        ElMessage.error('No access')
       }
     })
 }