Kaynağa Gözat

feat:修改system setting

AmandaG 9 ay önce
ebeveyn
işleme
34616270d6

BIN
dist.rar


+ 28 - 0
src/api/module/system.ts

@@ -45,4 +45,32 @@ export const DeleteAddedRules = (params: any, config: any) => {
     },
     config
   )
+}
+/**
+ * 收藏
+ */
+export const SubscribeShipments = (params: any, config: any) => {
+  return HttpAxios.post(
+    `${baseUrl}`,
+    {
+      action: 'system_setting',
+      operate: 'subscribe_shipment',
+      ...params
+    },
+    config
+  )
+}
+/**
+ * 收藏表格分页切换
+ */
+export const SubscribePagination = (params: any, config: any) => {
+  return HttpAxios.post(
+    `${baseUrl}`,
+    {
+      action: 'system_setting',
+      operate: 'subscribe_shipment_search',
+      ...params
+    },
+    config
+  )
 }

+ 3 - 2
src/components/AddRules/src/components/NotiMethods.vue

@@ -2,6 +2,7 @@
 import { ref, watch } from 'vue'
 
 const checkMethodList = ref()
+checkMethodList.value = []
 let savesubscribeobj: any = {}
 const props = defineProps({
   MethodsData: Object
@@ -18,7 +19,6 @@ watch(
 const emits = defineEmits(['ChangeMethodsAdd'])
 // 初始设置Methods
 const MethodsInit = () => {
-  checkMethodList.value = []
   if (methods_data.value?.method_display != undefined) {
     if (methods_data.value?.method_display.indexOf('Email') != -1) {
       checkMethodList.value.push('By Email')
@@ -29,6 +29,7 @@ const MethodsInit = () => {
       checkMethodList.value.push('By System Message')
     }
   }
+  console.log(checkMethodList.value)
   changeMethod(checkMethodList.value)
 }
 
@@ -60,7 +61,7 @@ const changeMethod = (val: any) => {
           <div>By Email</div>
           <div class="methos_image"><img src="../images/illustration_email@2x.png" /></div>
         </el-checkbox>
-        <el-checkbox class="methodcheckbox" value="By System Message ">
+        <el-checkbox class="methodcheckbox" value="By System Message">
           <div>By System Message</div>
           <div class="methos_image">
             <img src="../images/illustration_system massage@2x.png" />

+ 1 - 1
src/components/AutoSelect/src/AutoSelect.vue

@@ -101,7 +101,7 @@ const removeClass = () => {
       filterable
       remote
       @change="changeAutoSelect"
-      :reserve-keyword="false"
+      reserve-keyword
       :placeholder="props.ASPlaceholder"
       collapse-tags
       @focus="removeClass"

+ 21 - 6
src/views/Dashboard/src/components/RecentStatus.vue

@@ -7,7 +7,7 @@ interface RecentItem {
   Title: string
   name: string
   bookingNumber: string
-  IsSubscribe: boolean
+  is_subscribe: boolean
   shipperName: string
   consigneeName: string
   startStation: string
@@ -34,6 +34,21 @@ const RouteToDetail = (val: any) => {
     }
   })
 }
+
+// 订阅收藏
+const SubscribeShipments = (val: any) => {
+  val.is_subscribe = !val.is_subscribe
+  $api
+    .SubscribeShipments({
+      serial_no: val.a,
+      is_subscribe: val.is_subscribe
+    })
+    .then((res: any) => {
+      if (res.code === 200) {
+        console.log(res.data)
+      }
+    })
+}
 </script>
 <template>
   <div class="recent_route" v-for="(item, index) in props.RecentStatusList" :key="index">
@@ -68,13 +83,13 @@ const RouteToDetail = (val: any) => {
           <span>{{ item.bookingNumber }}</span>
         </div>
       </div>
-      <!-- <div class="recent-header-right">
+      <div class="recent-header-right">
         <el-button
           class="recent_button"
-          @click="item.IsSubscribe = !item.IsSubscribe"
-          :class="item.IsSubscribe ? 'IsSubscribe' : ''"
+          @click="SubscribeShipments(item)"
+          :class="item.is_subscribe ? 'IsSubscribe' : ''"
         >
-          <span v-if="item.IsSubscribe" class="iconfont_icon">
+          <span v-if="item.is_subscribe" class="iconfont_icon">
             <svg class="iconfont" aria-hidden="true">
               <use xlink:href="#icon-icon_marked_b"></use>
             </svg>
@@ -86,7 +101,7 @@ const RouteToDetail = (val: any) => {
           </span>
           <span class="Subscribe">Subscribe</span>
         </el-button>
-      </div> -->
+      </div>
     </div>
     <div class="recent_content">
       <!-- 左 -->

+ 11 - 6
src/views/SystemSettings/src/SystemSettings.vue

@@ -109,14 +109,14 @@ const SubShipmentsColumns = ref([
   {
     field: 'etd',
     title: 'ETD',
-    type: 'date',
-    formatter: ''
+    type: 'normal',
+    formatter: 'date'
   },
   {
     field: 'eta',
     title: 'ETA',
-    type: 'date',
-    formatter: ''
+    type: 'normal',
+    formatter: 'date'
   },
   {
     field: 'recent_milestone',
@@ -186,6 +186,11 @@ const deleteAddedRules = (val: any) => {
 
 onMounted(() => {
   getsubscribe()
+  console.log(sessionStorage.getItem('activeTab'))
+  if (sessionStorage.getItem('activeTab') != null) {
+    TabActive.value = sessionStorage.getItem('activeTab')
+    sessionStorage.removeItem('activeTab')
+  }
 })
 </script>
 <template>
@@ -313,7 +318,7 @@ onMounted(() => {
   padding: 21px 24px 13px 24px;
 }
 .subscribetitle {
-  padding-top: 7px;
+  padding-top: 30px;
 }
 .SubscribeCollapse {
   padding: 0 24px 24px 24px;
@@ -333,7 +338,7 @@ onMounted(() => {
   font-weight: 700;
   font-size: 18px;
   padding: 0 24px;
-  margin: 38px 0 20px 0;
+  margin: 23px 0 20px 0;
 }
 :deep(.el-collapse) {
   border: none;

+ 1 - 0
src/views/SystemSettings/src/components/MonitoringTable/src/MonitoringTable.vue

@@ -138,6 +138,7 @@ const ToCreateRule = () => {
     path: '/SystemSettings/createnewrule',
     query: {}
   })
+  sessionStorage.setItem('activeTab', 'Monitoring Settings')
 }
 
 onMounted(() => {

+ 58 - 17
src/views/SystemSettings/src/components/SettingTable/src/SettingTable.vue

@@ -16,7 +16,6 @@ const props = defineProps({
 
 const columnstest = ref(props.ColumnsList)
 
-const visible = ref(false)
 const tableData = ref<VxeGridProps<any>>({
   border: true,
   round: true,
@@ -35,6 +34,7 @@ const tableData = ref<VxeGridProps<any>>({
   columnConfig: { resizable: true, useKey: true },
   rowConfig: { isHover: true }
 })
+const pageInfo = ref({ pageNo: 1, pageSize: 10, total: 0 })
 
 const tableRef = ref<VxeGridInstance | null>(null)
 
@@ -71,20 +71,12 @@ const getTableColumns = async () => {
 // 获取表格数据
 const getTableData = (val: any) => {
   tableData.value.data = val.tableData
-  // 保存页长以及当前页码
-  // tableData.value.data = datatest.value
-  // await $api
-  //   .getBookingTableData({
-  //     other_filed: '',
-  //     ...filterdataobj.value
-  //   })
-  //   .then((res: any) => {
-  //     if (res.code === 200) {
-  //       tableData.value.data = res.data
-  //     }
-  //   })
-  //   .finally(() => {
-  //   })
+  if (!props.propsType) {
+    pageInfo.value.pageNo = val.cp
+    pageInfo.value.pageSize = val.ps
+    pageInfo.value.total = val.rc
+    console.log(pageInfo.value)
+  }
 }
 
 // 实现行点击样式
@@ -113,11 +105,31 @@ onMounted(() => {
 defineExpose({
   getTableData
 })
+const getpaginationTableData = () => {
+  $api
+    .SubscribePagination({
+      cp: pageInfo.value.pageNo,
+      ps: pageInfo.value.pageSize
+    })
+    .then((res: any) => {
+      if (res.code === 200) {
+        pageInfo.value.total = Number(res.data.rc)
+        pageInfo.value.pageNo = res.data.cp
+        pageInfo.value.pageSize = res.data.ps
+        tableData.value.data = res.data.tableData
+      }
+    })
+}
 </script>
 
 <template>
   <div class="SettingTable">
-    <vxe-grid class="radius-bottom" ref="tableRef" :style="{ border: 'none' }" v-bind="tableData">
+    <vxe-grid
+      :class="props.propsType ? 'radius-bottom' : ''"
+      ref="tableRef"
+      :style="{ border: 'none' }"
+      v-bind="tableData"
+    >
       <template #empty>
         <div class="empty">No data</div>
       </template>
@@ -146,11 +158,27 @@ defineExpose({
       </template>
     </vxe-grid>
   </div>
+  <div class="pagination" v-if="!props.propsType">
+    <span>Total {{ pageInfo.total }}</span>
+    <el-pagination
+      v-model:current-page="pageInfo.pageNo"
+      v-model:page-size="pageInfo.pageSize"
+      layout="prev, pager, next"
+      :total="pageInfo.total"
+      :pager-count="5"
+      @size-change="getpaginationTableData"
+      @current-change="getpaginationTableData"
+      background
+    />
+  </div>
 </template>
 
 <style lang="scss" scoped>
 .SettingTable {
-  padding: 0 24px 20px 24px;
+  padding: 0 24px 0 24px;
+}
+.radius-bottom {
+  border-radius: 6px 6px 0 0;
 }
 .font_family::before {
   color: var(--color-btn-danger-bg);
@@ -170,4 +198,17 @@ defineExpose({
   color: var(--color-neutral-1);
   padding: 15px 0 33px 37px;
 }
+.pagination {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  border: 1px solid var(--color-border);
+  border-top: none;
+  margin: 0 24px 20px 24px;
+  padding: 4px 8px;
+  border-radius: 0 0 6px 6px;
+}
+:deep(.el-icon svg) {
+  width: 1em !important;
+}
 </style>

+ 58 - 0
src/views/Tracking/src/components/TrackingDetail/src/TrackingDetail.vue

@@ -1,4 +1,5 @@
 <script setup lang="ts">
+import { ref } from 'vue'
 import { VueDraggable } from 'vue-draggable-plus'
 import BasicInformation from './components/BasicInformation.vue'
 import ContainersView from './components/ContainersView.vue'
@@ -87,6 +88,8 @@ const handleAMSISF = () => {
 
 const allData = ref()
 const loading = ref(false)
+const subscribe_a = ref()
+const is_subscribe = ref(false)
 const getData = () => {
   loading.value = true
   $api
@@ -96,6 +99,9 @@ const getData = () => {
     })
     .then((res: any) => {
       if (res.code === 200) {
+        console.log(res.data)
+        subscribe_a.value = res.data.a
+        is_subscribe.value = res.data.is_subscribe
         // 获取数据
         allData.value = res.data
       }
@@ -115,6 +121,19 @@ const dialogVModel = ref(false)
 const openShareDialog = () => {
   dialogVModel.value = true
 }
+const SubscribeShipments = () => {
+  is_subscribe.value = !is_subscribe.value
+  $api
+    .SubscribeShipments({
+      serial_no: subscribe_a.value,
+      is_subscribe: is_subscribe.value
+    })
+    .then((res: any) => {
+      if (res.code === 200) {
+        console.log(res.data)
+      }
+    })
+}
 </script>
 
 <template>
@@ -148,6 +167,24 @@ const openShareDialog = () => {
             <span class="font_family icon-icon_log_b" style="margin-right: 4px"></span
             >AMS/ISF</el-button
           >
+
+          <el-button
+            class="recent_button"
+            @click="SubscribeShipments"
+            :class="is_subscribe ? 'IsSubscribe' : ''"
+          >
+            <span v-if="is_subscribe" class="iconfont_icon">
+              <svg class="iconfont" aria-hidden="true">
+                <use xlink:href="#icon-icon_marked_b"></use>
+              </svg>
+            </span>
+            <span v-else class="iconfont_icon">
+              <svg class="iconfont" aria-hidden="true">
+                <use xlink:href="#icon-icon_unmark_b"></use>
+              </svg>
+            </span>
+            <span class="Subscribe">Subscribe</span>
+          </el-button>
         </div>
       </div>
       <div class="detail-info">
@@ -512,6 +549,27 @@ const openShareDialog = () => {
   overflow: hidden; /* 隐藏超出部分 */
   text-overflow: ellipsis; /* 超出部分显示省略号 */
 }
+
+.recent_button {
+  background-color: var(--color-white);
+  border: 1px solid var(--color-border);
+  &:hover {
+    border: 1px solid var(--color-btn-main-plain-bg-hover);
+    background-color: var(--color-btn-main-plain-bg-hover);
+    fill: var(--color-theme);
+    .Subscribe {
+      color: var(--color-theme);
+    }
+  }
+}
+.IsSubscribe {
+  border: 1px solid var(--color-theme);
+  background-color: var(--color-theme);
+  fill: white;
+  .Subscribe {
+    color: white;
+  }
+}
 </style>
 <style lang="scss">
 .is-show-tooltip {

+ 56 - 2
src/views/Tracking/src/components/TrackingTable/src/TrackingTable.vue

@@ -87,7 +87,7 @@ const getTableColumns = async () => {
         trackingTable.value.columns.push({
           title: 'Action',
           fixed: 'right',
-          width: 80,
+          width: 120,
           slots: { default: 'action' }
         })
       }
@@ -131,7 +131,7 @@ const assignTableData = (data: any) => {
       trackingTable.value.columns.push({
         title: 'Action',
         fixed: 'right',
-        width: 80,
+        width: 120,
         slots: { default: 'action' }
       })
     }
@@ -546,6 +546,21 @@ const handleRowClassName = ({ row }: any) => {
   return ''
 }
 
+// 点击订阅
+const SubscribeShipments = (row: any) => {
+  row.is_subscribe = !row.is_subscribe
+  $api
+    .SubscribeShipments({
+      serial_no: row.a,
+      is_subscribe: row.is_subscribe
+    })
+    .then((res: any) => {
+      if (res.code === 200) {
+        console.log(res.data)
+      }
+    })
+}
+
 defineExpose({
   searchTableData,
   getSharedTableData,
@@ -615,6 +630,23 @@ defineExpose({
           <span class="font_family icon-icon_vgm_b"></span>
           <span style="font-size: 12px">VGM</span>
         </el-button>
+
+        <el-button
+          class="recent_button el-button--blue"
+          @click="SubscribeShipments(row)"
+          :class="row.is_subscribe ? 'IsSubscribe' : ''"
+        >
+          <span v-if="row.is_subscribe" class="iconfont_icon">
+            <svg class="iconfont" aria-hidden="true">
+              <use xlink:href="#icon-icon_marked_b"></use>
+            </svg>
+          </span>
+          <span v-else class="iconfont_icon">
+            <svg class="iconfont" aria-hidden="true">
+              <use xlink:href="#icon-icon_unmark_b"></use>
+            </svg>
+          </span>
+        </el-button>
       </template>
       <!-- Transportation Mode字段的插槽 -->
       <template #mode="{ row, column }">
@@ -706,4 +738,26 @@ defineExpose({
     width: 20px;
   }
 }
+.recent_button {
+  height: 24px;
+  padding: 6px 3px 6px 6px;
+  .Subscribe {
+    color: var(--color-theme);
+  }
+  &:hover {
+    background-color: var(--color-btn-main-plain-bg-hover);
+    fill: var(--color-theme);
+    .Subscribe {
+      color: var(--color-theme);
+    }
+  }
+}
+.IsSubscribe {
+  border: 1px solid var(--color-theme);
+  background-color: var(--color-theme);
+  fill: white;
+  .Subscribe {
+    color: white;
+  }
+}
 </style>