From 79cfa071fadb4cc7476da51b23cd45279b0bcbdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=82=B3=E8=BC=B8=E5=8A=A9=E6=89=8B?= <1766219146@qq.com> Date: Wed, 24 Aug 2022 15:46:45 +0800 Subject: [PATCH 1/2] shl --- src/components/Manager/enterpriseManager.vue | 83 +++++++++++++++----- 1 file changed, 64 insertions(+), 19 deletions(-) diff --git a/src/components/Manager/enterpriseManager.vue b/src/components/Manager/enterpriseManager.vue index 39760e9..67c3ff2 100644 --- a/src/components/Manager/enterpriseManager.vue +++ b/src/components/Manager/enterpriseManager.vue @@ -86,7 +86,7 @@ @@ -143,13 +143,27 @@ width="250"> - + + + + + + @@ -167,7 +181,14 @@ export default { dialogFormVisibleExcel: false, dialogFormVisibleUpdate: false, form: {}, - updateForm: {} + updateForm: {}, + + totalPageData:[], + pageNum:1, + pageSize:5, + currentPage: 1, + total:1, + dataShow:[], } }, methods: { @@ -175,10 +196,31 @@ export default { const _this = this; axios.get("http://localhost:82/enterprise/getAllEnterprise").then(function (resp) { _this.tableData = resp.data; + _this.total = resp.data.length; + _this.calcPageDate(); }) }, - change() { - + calcPageDate(){ + if(this.tableData.length>1){ + this.pageNum = Math.ceil(this.tableData.length/this.pageSize) || 1 ; + } + for (let i = 0 ;i Date: Wed, 24 Aug 2022 16:07:06 +0800 Subject: [PATCH 2/2] shl --- src/components/ForUser/enterpriseList.vue | 47 ++- src/components/ForUser/stationList.vue | 367 ++++++++++++---------- src/components/ForUser/wikiList.vue | 205 +++++++----- src/components/Manager/roleManager.vue | 34 +- src/components/Manager/userManager.vue | 48 ++- 5 files changed, 456 insertions(+), 245 deletions(-) diff --git a/src/components/ForUser/enterpriseList.vue b/src/components/ForUser/enterpriseList.vue index 75c3844..8f905e0 100644 --- a/src/components/ForUser/enterpriseList.vue +++ b/src/components/ForUser/enterpriseList.vue @@ -6,7 +6,7 @@
+ + + + + +
@@ -57,7 +70,13 @@ export default { name: "enterpriseList", data() { return { - tableData: [] + tableData: [], + totalPageData:[], + pageNum:1, + pageSize:5, + currentPage: 1, + total:1, + dataShow:[], } }, methods:{ @@ -65,7 +84,31 @@ export default { const _this = this; axios.get("http://localhost:82/enterprise/getAllEnterprise").then(function (resp) { _this.tableData = resp.data; + _this.total = resp.data.length; + _this.calcPageDate(); }) + }, + calcPageDate(){ + if(this.tableData.length>1){ + this.pageNum = Math.ceil(this.tableData.length/this.pageSize) || 1 ; + } + for (let i = 0 ;i -
-

- 这是用户看到的岗位列表 -

-
- 添加 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 确定 - 取消 - 重置 - +
+

+ 这是用户看到的岗位列表 +

+
+ 添加 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 确定 + 取消 + 重置 + - - - - - - - - - - - + + + + + + + + + + + - - - + + + - + + + + + + +
+
@@ -148,82 +163,112 @@ import axios from "axios"; import qs from "qs"; export default { - name: "stationList", + name: "stationList", data() { return { tableData: [], - ruleForm:{}, + ruleForm: {}, dialogFormVisible: false, updateForm: false, rules: { sName: [ - { required: true, message: '请输入活动名称', trigger: 'blur' }, + {required: true, message: '请输入活动名称', trigger: 'blur'}, ], sWages: [ - { required: true, message: '请选择活动区域', trigger: 'blur' } + {required: true, message: '请选择活动区域', trigger: 'blur'} ], sWork: [ - {required: true, message: '请选择日期', trigger: 'blur' } + {required: true, message: '请选择日期', trigger: 'blur'} ], sDepartment: [ - {required: true, message: '请选择时间', trigger: 'blur' } + {required: true, message: '请选择时间', trigger: 'blur'} ], sNumber: [ - {required: true, message: '请至少选择一个活动性质', trigger: 'blur' } + {required: true, message: '请至少选择一个活动性质', trigger: 'blur'} ], sEducation: [ - { required: true, message: '学历', trigger: 'blur' } + {required: true, message: '学历', trigger: 'blur'} ], sWorkdays: [ - { required: true, message: '请填写活动形式', trigger: 'blur' } + {required: true, message: '请填写活动形式', trigger: 'blur'} ], sSubsidy: [ - { required: true, message: '请填写活动形式', trigger: 'change' } + {required: true, message: '请填写活动形式', trigger: 'change'} ], sGold: [ - { required: true, message: '请填写活动形式', trigger: 'change' } + {required: true, message: '请填写活动形式', trigger: 'change'} ] - } + }, + totalPageData: [], + pageNum: 1, + pageSize: 5, + currentPage: 1, + total: 1, + dataShow: [], } }, - methods:{ + methods: { getData() { const _this = this; axios.get("http://localhost:82/s" + "tation/getAllStation").then(function (resp) { _this.tableData = resp.data; + _this.total = resp.data.length; + _this.calcPageDate(); }) }, + calcPageDate() { + if (this.tableData.length > 1) { + this.pageNum = Math.ceil(this.tableData.length / this.pageSize) || 1; + } + for (let i = 0; i < this.pageNum; i++) { + this.totalPageData[i] = this.tableData.slice(this.pageSize * i, this.pageSize * (i + 1)); + } + this.dataShow = this.totalPageData[this.currentPage - 1]; + }, + handleSizeChange(val) { + this.pageSize = val; + this.calcPageDate(); + }, + handleCurrentChange(val) { + this.currentPage = val; + this.dataShow = this.totalPageData[val - 1]; + }, + reset() { + this.getData(); + this.pageSize = 5; + this.currentPage = 1; + }, deleteStation(obj) { const _this = this console.log(obj) - let qsdata = qs.stringify({"sId":obj}) + let qsdata = qs.stringify({"sId": obj}) _this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' - }).then(function(){ - axios.post("http://localhost:82/station/deleteStation",qsdata).then(function (){ + }).then(function () { + axios.post("http://localhost:82/station/deleteStation", qsdata).then(function () { window.location.reload() }) - }).catch(function(){ + }).catch(function () { this.$message({ type: 'info', message: '已取消删除' }); }); }, - updateStation(){ + updateStation() { const _this = this let updateStation = qs.stringify({ - sId:_this.ruleForm.sId, - sName:_this.ruleForm.sName, - sWages:_this.ruleForm.sWages + sId: _this.ruleForm.sId, + sName: _this.ruleForm.sName, + sWages: _this.ruleForm.sWages }) - axios.post("http://localhost:82/station/updateStation",updateStation).then(function (){ - _this.updateForm=false + axios.post("http://localhost:82/station/updateStation", updateStation).then(function () { + _this.updateForm = false window.location.reload() }) }, @@ -232,7 +277,7 @@ export default { _this.$refs[formName].validate((valid) => { let addS = qs.stringify(_this.ruleForm) if (valid) { - axios.post("http://localhost:82/station/addStation",addS).then(function (){ + axios.post("http://localhost:82/station/addStation", addS).then(function () { alert('submit!'); window.location.reload(); }) @@ -246,16 +291,16 @@ export default { this.$refs[formName].resetFields(); } }, mounted() { - const _this = this - var user = JSON.parse(sessionStorage.getItem("user")) - var q1 =user.jurisdictionRoleList.findIndex(item=>item.jId==='0'&&(item.jrStatus==='强制启用' || item.jrStatus === '启用')) - var q2 =user.jurisdictionRoleList.findIndex(item=>item.jId==='i2'&&(item.jrStatus==='强制启用' || item.jrStatus === '启用')) - if(q1===-1 && q2===-1){ - _this.$router.push("/JurisdictionWarning") - }else { - _this.getData(); + const _this = this + var user = JSON.parse(sessionStorage.getItem("user")) + var q1 = user.jurisdictionRoleList.findIndex(item => item.jId === '0' && (item.jrStatus === '强制启用' || item.jrStatus === '启用')) + var q2 = user.jurisdictionRoleList.findIndex(item => item.jId === 'i2' && (item.jrStatus === '强制启用' || item.jrStatus === '启用')) + if (q1 === -1 && q2 === -1) { + _this.$router.push("/JurisdictionWarning") + } else { + _this.getData(); + } } - } } diff --git a/src/components/ForUser/wikiList.vue b/src/components/ForUser/wikiList.vue index 4712d7d..526162d 100644 --- a/src/components/ForUser/wikiList.vue +++ b/src/components/ForUser/wikiList.vue @@ -1,91 +1,136 @@ diff --git a/src/components/Manager/roleManager.vue b/src/components/Manager/roleManager.vue index f292ed7..1841206 100644 --- a/src/components/Manager/roleManager.vue +++ b/src/components/Manager/roleManager.vue @@ -83,7 +83,7 @@
- + {{item.rName}} @@ -114,6 +114,14 @@ export default { data() { return { + //分页 + totalPageData:[], + pageNum:1, + pageSize:5, + currentPage: 1, + total:1, + dataShow:[], + tableData: [], updateTable1: false, updateTable2: false, @@ -151,8 +159,32 @@ export default { const _this = this; axios.get("http://localhost:82/role/roleList").then(function (resp){ _this.tableData = resp.data; + _this.total = resp.data.length; + _this.calcPageDate(); }) }, + calcPageDate(){ + if(this.tableData.length>1){ + this.pageNum = Math.ceil(this.tableData.length/this.pageSize) || 1 ; + } + for (let i = 0 ;i - + @@ -162,6 +175,15 @@ export default { inputVisible: false, inputValue: '', // 角色标签 + + + //分页 + totalPageData:[], + pageNum:1, + pageSize:5, + currentPage: 1, + total:1, + dataShow:[], } }, @@ -174,8 +196,32 @@ export default { const _this = this; axios.get("http://localhost:82/userList").then(function (resp) { _this.tableData = resp.data; + _this.total = resp.data.length; + _this.calcPageDate(); }) }, + calcPageDate(){ + if(this.tableData.length>1){ + this.pageNum = Math.ceil(this.tableData.length/this.pageSize) || 1 ; + } + for (let i = 0 ;i