Browse Source

调整分页器

lisiyan 2 years ago
parent
commit
8f98dbad17

+ 2 - 0
src/views/Device.vue

@@ -20,6 +20,7 @@ export default {
       status: '',
       queryString: '',
       tableData: [],
+      total: 0,
       teamList: [],
       dialogVisible: false,
       deviceId: '',
@@ -54,6 +55,7 @@ export default {
           this.size
       ).then((res) => {
         this.tableData = res.data.result.list
+        this.total = res.data.result.total
       })
     },
     //取消设备授权

+ 32 - 25
src/views/LicenseManage.vue

@@ -3,11 +3,13 @@ import { onMounted, ref } from 'vue'
 import Download from '@/components/icon/download.vue'
 import Warning from '@/components/icon/warning.vue'
 import Search from '@/components/icon/search.vue'
-import { get } from '../../utils/request'
+import { get, post } from '../../utils/request'
 
 const currentPage = ref(1)
 const size = ref(5)
 const search = ref('')
+const total = ref(0)
+const linceseId = ref('')
 const tableData = ref([])
 const dialogVisible = ref(false)
 const cancelEmail = ref('')
@@ -16,21 +18,25 @@ onMounted(() => {
   if (pageText) {
     pageText.childNodes[0].nodeValue = '跳至'
   }
-  //获取分页数据
+  pagingQuery()
+})
+const pagingQuery = (val) => {
   get(
-    'http://81.68.234.235:8032/pdf-tech/vppLicenseCode/page?' +
+    'http://81.68.234.235:8032/pdf-tech/vppDevice/page?page=' +
       currentPage.value +
       '&' +
       'pageSize=' +
       size.value
   ).then((res) => {
     tableData.value = res.data.result.list
+    total.value = res.data.result.total
   })
-})
+}
 //打开对话框
 const handleClick = (val) => {
   dialogVisible.value = true
   cancelEmail.value = val.email
+  linceseId.value = val.licenseCodeId
 }
 //导出序列码
 const download = () => {
@@ -40,24 +46,27 @@ const download = () => {
     }
   )
 }
+//取消授权序列码
+const cancelAssign = () => {
+  post(
+    'http://81.68.234.235:8032/pdf-tech/vppLicenseCode/cancelLicenceAssign',
+    { licenceId: linceseId.value }
+  ).then((res) => {
+    console.log(res)
+  })
+}
 //切换每页条数
-const handleSizeChange = () => {
-  console.log(`每页条`)
+const handleSizeChange = (val) => {
+  size.value = val
+  pagingQuery()
 }
 //切换分页
-const handleCurrentChange = () => {
-  console.log(`当前页:`)
-}
-//按产品筛选
-const product = (val) => {
-  console.log(`当前页:`)
+const handleCurrentChange = (val) => {
+  currentPage.value = val
+  pagingQuery()
 }
-//按分配筛选
-const assigned = (val) => {
-  console.log(`当前页:`)
-}
-//按团队筛选
-const team = (val) => {
+//筛选
+const queryString = (val) => {
   console.log(`当前页:`)
 }
 </script>
@@ -151,6 +160,8 @@ const team = (val) => {
           <button class="absolute top-8px right-8px"><Search /></button>
         </div>
         <button
+          type="button"
+          @click="queryString()"
           class="
             w-70px
             h-28px
@@ -189,11 +200,7 @@ const team = (val) => {
             >
               Cancel
             </button>
-            <el-dialog
-              title=""
-              :visible.sync="dialogVisible"
-              width="376"
-            >
+            <el-dialog title="" :visible.sync="dialogVisible" width="376">
               <Warning />
               <p class="mt-16px">Sure cancel the license?</p>
               <p>
@@ -203,7 +210,7 @@ const team = (val) => {
               </p>
               <span slot="footer" class="dialog-footer">
                 <el-button @click="dialogVisible = false">No</el-button>
-                <el-button type="primary" @click="dialogVisible = false">
+                <el-button type="primary" @click="cancelAssign()">
                   Yes
                 </el-button>
               </span>
@@ -219,7 +226,7 @@ const team = (val) => {
         :page-size="size"
         :background="true"
         layout="sizes, prev, pager, next, jumper"
-        :total="tableData.length"
+        :total="total"
         class="px-24px !rounded-0 rounded-b-8px mt-20px flex justify-end"
       >
       </el-pagination>

+ 18 - 11
src/views/ManageAdmin.vue

@@ -9,6 +9,7 @@ const currentPage = ref(1)
 const size = ref(5)
 const search = ref('')
 const tableData = ref([])
+const total = ref(0)
 const dialogVisible = ref(false)
 const cancelEmail = ref('')
 onMounted(() => {
@@ -16,7 +17,15 @@ onMounted(() => {
   if (pageText) {
     pageText.childNodes[0].nodeValue = '跳至'
   }
-  //获取分页数据
+  pagingQuery()
+})
+//打开对话框
+const handleClick = (val) => {
+  dialogVisible.value = true
+  cancelEmail.value = val.email
+}
+//获取分页数据
+const pagingQuery = () => {
   get(
     'http://81.68.234.235:8032/pdf-tech/vppRTeamMemberRole/pageForAdmin/?page=' +
       currentPage.value +
@@ -25,12 +34,8 @@ onMounted(() => {
       size.value
   ).then((res) => {
     tableData.value = res.data.result.list
+    total.value = res.data.result.total
   })
-})
-//打开对话框
-const handleClick = (val) => {
-  dialogVisible.value = true
-  cancelEmail.value = val.email
 }
 //
 const deleteAdmin = (val) => {
@@ -42,12 +47,14 @@ const deleteAdmin = (val) => {
   })
 }
 //切换每页条数
-const handleSizeChange = () => {
-  console.log(`每页条`)
+const handleSizeChange = (val) => {
+  size.value = val
+  pagingQuery()
 }
 //切换分页
-const handleCurrentChange = () => {
-  console.log(`当前页:`)
+const handleCurrentChange = (val) => {
+  currentPage.value = val
+  pagingQuery()
 }
 </script>
 
@@ -185,7 +192,7 @@ const handleCurrentChange = () => {
         :page-size="size"
         :background="true"
         layout="sizes, prev, pager, next, jumper"
-        :total="tableData.length"
+        :total="total"
         class="px-24px !rounded-0 rounded-b-8px mt-20px flex justify-end"
       >
       </el-pagination>

+ 1 - 1
src/views/ProductManagement.vue

@@ -12,7 +12,7 @@ const tableData = ref([])
 const dialogVisible = ref(false)
 const cancelEmail = ref('')
 const cancelUniqueSn = ref('')
-const total = ref("")
+const total = ref(0)
 
 onMounted(() => {
   let pageText = document.getElementsByClassName('el-pagination__jump')[0]

+ 11 - 33
src/views/Settings.vue

@@ -50,7 +50,10 @@ export default {
             newPassword: this.ruleFormPass.newPassword,
             newPasswordConfirm: this.ruleFormPass.confirmPassword
           }).then((res) => {
-            if (res.data.code === 200 && res.data.msg === 'Password updated successfully') {
+            if (
+              res.data.code === 200 &&
+              res.data.msg === 'Password updated successfully'
+            ) {
               this.$message({
                 message: 'Change Success',
                 type: 'success'
@@ -176,12 +179,7 @@ export default {
               class="username"
               placeholder="User Name"
             >
-            </el-input
-            ><img
-              src="@/assets/images/warning.png"
-              alt=""
-              class="w-14px h-14px hidden"
-            />
+            </el-input>
           </div>
         </el-form-item>
         <el-form-item label="Email" prop="email" class="w-600px">
@@ -192,12 +190,7 @@ export default {
               disabled
               placeholder="Email address confirmation"
             >
-            </el-input
-            ><img
-              src="@/assets/images/warning.png"
-              alt=""
-              class="w-14px h-14px hidden"
-            />
+            </el-input>
           </div>
         </el-form-item>
         <el-form-item label="Area">
@@ -251,12 +244,7 @@ export default {
               v-model.trim="ruleFormPass.oldPassword"
               placeholder="Old Password"
             >
-            </el-input
-            ><img
-              src="@/assets/images/warning.png"
-              alt=""
-              class="w-14px h-14px hidden"
-            />
+            </el-input>
           </div>
         </el-form-item>
         <el-form-item prop="newPassword">
@@ -270,12 +258,7 @@ export default {
               v-model.trim="ruleFormPass.newPassword"
               placeholder="New Password"
             >
-            </el-input
-            ><img
-              src="@/assets/images/warning.png"
-              alt=""
-              class="w-14px h-14px hidden"
-            />
+            </el-input>
           </div>
         </el-form-item>
         <el-form-item prop="confirmPassword">
@@ -289,12 +272,7 @@ export default {
               v-model.trim="ruleFormPass.confirmPassword"
               placeholder="Confirm Password"
             >
-            </el-input
-            ><img
-              src="@/assets/images/warning.png"
-              alt=""
-              class="w-14px h-14px hidden"
-            />
+            </el-input>
           </div>
         </el-form-item>
         <router-link
@@ -363,11 +341,11 @@ export default {
 <style lang="scss">
 .el-message--success {
   margin-top: 90px !important;
-  background-color: #373A47 !important;
+  background-color: #373a47 !important;
   height: 36px;
   min-width: auto !important;
   padding: 12px !important;
-  p{
+  p {
     color: #fff !important;
   }
 }

+ 4 - 2
src/views/TeamManagement/ManageMember.vue

@@ -29,10 +29,12 @@ function deleteMember(){
 }
 
 function handleSizeChange(val) {
-  console.log(`每页 ${val} 条`)
+  size.value = val
+  getManageMemberList()
 }
 function handleCurrentChange(val) {
-  console.log(`当前页: ${val}`)
+  currentPage.value = val
+  getManageMemberList()
 }
 // 获取团队管理列表
 function getManageMemberList() {

+ 1 - 1
src/views/TeamManagement/ManageTeam.vue

@@ -140,7 +140,7 @@ onMounted(() => {
           label="Operate"
           min-width="10%">
           <template slot-scope="scope">
-            <div>{{ scope.row }}
+            <div>
               <router-link :to="{ name: 'EditManageTeam', params: { flag: 'edit', teamId: scope.row.id, teamName: scope.row.name, teamDescription: scope.row.description, licenseAmount: scope.row.licenseAmount  } }">
                 <div class="w-61px h-20px border-1 border-[#1460F3] rounded-4px text-center text-14px leading-20px text-[#1460F3] cursor-pointer mb-8px">Edit</div>
               </router-link>

+ 4 - 13
src/views/forgotpassword.vue

@@ -86,12 +86,7 @@ export default {
               clearable
               placeholder="Email address"
             >
-            </el-input
-            ><img
-              src="@/assets/images/warning.png"
-              alt=""
-              class="w-14px h-14px hidden"
-            />
+            </el-input>
           </div>
         </el-form-item>
         <el-form-item prop="confirmation">
@@ -101,12 +96,7 @@ export default {
               clearable
               placeholder="Email address confirmation"
             >
-            </el-input
-            ><img
-              src="@/assets/images/warning.png"
-              alt=""
-              class="w-14px h-14px hidden"
-            />
+            </el-input>
           </div>
         </el-form-item>
         <el-form-item>
@@ -131,7 +121,8 @@ export default {
 
 <style lang="scss" scoped>
 .bg {
-  background: #e7eaee url('@/assets/images/background.png') center center no-repeat;
+  background: #e7eaee url('@/assets/images/background.png') center center
+    no-repeat;
 }
 .loginBox {
   box-shadow: 0px 0px 12px rgba(35, 97, 169, 0.05);