From 03bf2153a1be362b3b77a2e4b105d18f76a02716 Mon Sep 17 00:00:00 2001 From: dongzeliang <2746733890@qq.com> Date: Fri, 12 Apr 2024 18:58:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B2=97=E4=BD=8D=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/post/index.vue | 119 ++++++++++++++++++++++++-------- 1 file changed, 90 insertions(+), 29 deletions(-) diff --git a/src/views/system/post/index.vue b/src/views/system/post/index.vue index d6f9159..5afb34e 100644 --- a/src/views/system/post/index.vue +++ b/src/views/system/post/index.vue @@ -220,11 +220,70 @@ export default { /** 查询岗位列表 */ getList() { this.loading = true; - listPost(this.queryParams).then(response => { - this.postList = response.data.rows; - this.total = response.data.total; - this.loading = false; - }); + let response = { + "code": 200, + "msg": "查询成功", + "data": { + "total": 4, + "rows": [ + { + "createBy": 1, + "createTime": "2023-09-29 11:47:27", + "updateBy": null, + "updateTime": null, + "postId": 1, + "postCode": "ceo", + "postName": "董事长", + "postSort": 1, + "status": "0", + "flag": false, + "remark": "" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:27", + "updateBy": null, + "updateTime": null, + "postId": 2, + "postCode": "se", + "postName": "项目经理", + "postSort": 2, + "status": "0", + "flag": false, + "remark": "" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:27", + "updateBy": null, + "updateTime": null, + "postId": 3, + "postCode": "hr", + "postName": "人力资源", + "postSort": 3, + "status": "0", + "flag": false, + "remark": "" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:27", + "updateBy": null, + "updateTime": null, + "postId": 4, + "postCode": "user", + "postName": "普通员工", + "postSort": 4, + "status": "0", + "flag": false, + "remark": "" + } + ] + } + } + this.postList = response.data.rows; + this.total = response.data.total; + this.loading = false; }, // 取消按钮 cancel() { @@ -268,29 +327,37 @@ export default { /** 修改按钮操作 */ handleUpdate(row) { this.reset(); - const postId = row.postId || this.ids - getPost(postId).then(response => { - this.form = response.data; - this.open = true; - this.title = "修改岗位"; - }); + let response = { + "code": 200, + "msg": "操作成功", + "data": { + "createBy": 1, + "createTime": "2023-09-29 11:47:27", + "updateBy": null, + "updateTime": null, + "postId": 1, + "postCode": "ceo", + "postName": "董事长", + "postSort": 1, + "status": "0", + "flag": false, + "remark": "" + } + } + this.form = response.data; + this.open = true; + this.title = "修改岗位"; }, /** 提交按钮 */ submitForm: function () { this.$refs["form"].validate(valid => { if (valid) { if (this.form.postId != undefined) { - updatePost(this.form).then(response => { - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); - }); + this.$modal.msgSuccess("修改成功"); + this.open = false; } else { - addPost(this.form).then(response => { - this.$modal.msgSuccess("新增成功"); - this.open = false; - this.getList(); - }); + this.$modal.msgSuccess("新增成功"); + this.open = false; } } }); @@ -298,19 +365,13 @@ export default { /** 删除按钮操作 */ handleDelete(row) { const postIds = row.postId || this.ids; - this.$modal.confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?').then(function () { - return delPost(postIds); - }).then(() => { - this.getList(); + this.$modal.confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?').then(() => { this.$modal.msgSuccess("删除成功"); - }).catch(() => { }); }, /** 导出按钮操作 */ handleExport() { - this.download('system/post/export', { - ...this.queryParams - }, `post_${new Date().getTime()}.xlsx`) + this.$modal.msgSuccess("导入成功"); } } };