wukai 2 месяцев назад
Родитель
Сommit
e0283f5230
2 измененных файлов с 39 добавлено и 35 удалено
  1. 12 8
      src/views/event/index.vue
  2. 27 27
      src/views/index.vue

+ 12 - 8
src/views/event/index.vue

@@ -19,8 +19,12 @@ onMounted(() => {
 const handleUserLogin = async () => {
   try {
     // 调用POST接口传user_id=86
-    const response = await axios.post('https://smp.quanmate.com.cn/api/v4/user_login_token', {
-      user_id: 86
+   const response = await axios.post('https://smp.quanmate.com.cn/api/v4/user_login_token', {
+      user_id: 42
+    }, {
+      headers: {
+        'Authorization': '8078053d8eee5920be02edf274c7b7fdf1af9fb9a30464cffd461c819dbcab62:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lc3BhY2VfaWQiOjN9.oIuSZM4OVq0CoFsinS8ajzWj-U7-vrDWlGfI0uygnnM'
+      }
     })
 
     // 检查响应是否包含user_login_token
@@ -28,22 +32,22 @@ const handleUserLogin = async () => {
       const userLoginToken = response.data.user_login_token
 
       // 组装目标URL (这里假设url是固定的,如果需要从某处获取,请相应调整)
-      const targetUrl = `https://smp.quanmate.com.cn?_user_login_token=${userLoginToken}`
+      const targetUrl = `https://smp.quanmate.com.cn/admin/yet_another_workflow/flows?page=1&per_page=24&status=active&_user_login_token=${userLoginToken}`
+      console.log(targetUrl)
       // 使用window.open打开链接
       window.open(targetUrl, '_blank')
     }
-   const targetUrl = "https://smp.quanmate.com.cn/admin/yet_another_workflow/flows?page=1&per_page=24&status=active";
-    // 使用window.open打开链接
-    window.open(targetUrl, '_blank')
+   // const targetUrl = "https://smp.quanmate.com.cn/admin/yet_another_workflow/flows?page=1&per_page=24&status=active";
+   //  // 使用window.open打开链接
+   //  window.open(targetUrl, '_blank')
     // 页面路由返回到/index
     const router = useRouter()
     await router.push('/index')
   } catch (error) {
     console.error('Error during user login process:', error)
-
     // 即使出错也返回首页
     const router = useRouter()
-    router.push('/index')
+    await router.push('/index')
   }
 }
 </script>

+ 27 - 27
src/views/index.vue

@@ -43,17 +43,17 @@
     </div>
     <el-dialog title="流程列表" v-model="open" width="1024px" append-to-body>
       <el-table v-loading="loading" :data="fcList" height="460px">
-        <el-table-column label="发起时间" align="center" prop="createTime" />
-        <el-table-column label="流程名称" align="center" prop="flowsName" />
-        <el-table-column label="仓库名称标识" align="center" show-overflow-tooltip prop="house" width="150px"/>
-        <el-table-column label="区域/位置标识" align="center" show-overflow-tooltip prop="area"  width="150px"/>
+        <el-table-column label="发起时间" align="center" prop="createTime" width="160px"/>
+<!--        <el-table-column label="流程名称" align="center" prop="flowsName" />-->
+        <el-table-column label="仓库名称标识" align="center" show-overflow-tooltip prop="house" width="350px"/>
+        <el-table-column label="区域/位置标识" align="center" show-overflow-tooltip prop="area"  width="200px"/>
         <el-table-column label="状态" align="center" prop="status" />
         <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
           <template #default="scope">
             <el-button link type="primary" @click="handleJump(scope.row.journeyUrl)" >详情</el-button>
           </template>
         </el-table-column>
-      </el-table>     
+      </el-table>
       <pagination
         :total="total"
         v-model:page="queryParams.page"
@@ -61,7 +61,7 @@
         @pagination="getFcList"
       />
       <template #footer>
-        <div class="dialog-footer"> 
+        <div class="dialog-footer">
           <el-button @click="open=false">关 闭</el-button>
         </div>
       </template>
@@ -105,11 +105,11 @@ let geocoder = null;
 let districtSearch = null;
 const typeMapping={
   "-1":"home",
-  "0":"none",  
+  "0":"none",
   "201":"smoke",
   "195":"fire",
   "189":"person",
-  "191":"temp"  
+  "191":"temp"
 }
 const alarm_type=ref({
   "home":{
@@ -193,7 +193,7 @@ const getFcList=()=>{
     loading.value = false;
     fcList.value = res.rows;
     total.value = res.total;
-  })  
+  })
 }
 
 const handleJump=(url)=>{
@@ -226,7 +226,7 @@ const addMarker=(houseinfo,lnglat) =>{
     map: map.value, // 添加到哪个地图实例
     extData:houseinfo,
   });
-  marker.on('click',function(e){    
+  marker.on('click',function(e){
     if(currentHouseCode.value!='' && currentHouseCode.value!=e.target.dom.firstChild.id){
       document.getElementById(currentHouseCode.value).className = "custom-marker";
     }
@@ -302,7 +302,7 @@ const initMap = () => {
         userinfo = JSON.parse(userinfo);
         drawAreaBorder(userinfo.dept.deptName);
       }
-      initData();      
+      initData();
     })
     .catch((e) => {
       console.log('error', e)
@@ -346,7 +346,7 @@ const initData = ()=>{
       let tmplst =[];
       for (let index = 0; index <  res.length; index++) {
         let element =  res[index];
-        
+
           element["lnglat"] = [element.lat||0,element.lng||0];
           element["alarmtype"] = 'none';
           element["code"] = element.simpleName;
@@ -506,7 +506,7 @@ const loadEchars01=()=>{
         itemStyle: {
            color: (param) => {
               let i = param.dataIndex;
-              return  chartData.colorArr[i] 
+              return  chartData.colorArr[i]
            },
            opacity: .9
         },
@@ -604,7 +604,7 @@ const loadEchars02=()=>{
               color: '#2084fa'
            },
            lineStyle: {
-              width: 2, // 线的宽度              
+              width: 2, // 线的宽度
            },
            tooltip: {
               valueFormatter: function (value) {
@@ -700,7 +700,7 @@ const loadEchars03=()=>{
       }
     ],
     yAxis: {
-      type: 'value',      
+      type: 'value',
       nameTextStyle: {
         color: '#ffffff',
         fontSize: 12
@@ -769,7 +769,7 @@ const loadEchars03=()=>{
 }
 onMounted(() => {
   loadStat();
-  initMap();  
+  initMap();
 })
 </script>
 <style>
@@ -779,7 +779,7 @@ onMounted(() => {
 .custom-marker{
       display: grid;
       color: #fff;
-      font-size: 11px;      
+      font-size: 11px;
       .icon1,.icon2{
         display: none;
       }
@@ -807,7 +807,7 @@ onMounted(() => {
         border : 1px solid #fff;
         width: 32px;
         height: 32px;
-        border-radius: 50%;  
+        border-radius: 50%;
         display: flex;
         justify-content: center;
         justify-items: center;
@@ -817,16 +817,16 @@ onMounted(() => {
           width: 24px;
           height: 24px;
           margin-top: 4px;
-        }         
+        }
       }
       .none{
-        background-color: #2287fe;     
+        background-color: #2287fe;
       }
       .home{
-        background-color: #2287fe;     
+        background-color: #2287fe;
       }
       .fire{
-        background-color: #dd4949;  
+        background-color: #dd4949;
       }
       .smoke{
         background-color: #ef911c;
@@ -889,7 +889,7 @@ onMounted(() => {
         border : 1px solid #fff;
         width: 32px;
         height: 32px;
-        border-radius: 50%;  
+        border-radius: 50%;
         display: flex;
         justify-content: center;
         justify-items: center;
@@ -899,13 +899,13 @@ onMounted(() => {
           width: 24px;
           height: 24px;
           margin-top: 4px;
-        }         
+        }
       }
       .none{
-        background-color: #2287fe;     
+        background-color: #2287fe;
       }
       .fire{
-        background-color: #dd4949;  
+        background-color: #dd4949;
       }
       .smoke{
         background-color: #ef911c;
@@ -944,7 +944,7 @@ onMounted(() => {
     width: 10px;
     height: 10px;
     position: absolute;
-    border: 3px solid #fff;    
+    border: 3px solid #fff;
     z-index: 1;
     border-radius: 50%;
   }