diff --git a/src/views/system/dict/data.vue b/src/views/system/dict/data.vue index 217a9dd..0416681 100644 --- a/src/views/system/dict/data.vue +++ b/src/views/system/dict/data.vue @@ -292,26 +292,208 @@ export default { methods: { /** 查询字典类型详细 */ getType(dictId) { - getType(dictId).then(response => { - this.queryParams.dictType = response.data.dictType; - this.defaultDictType = response.data.dictType; - this.getList(); - }); + let response = { + "code": 200, + "msg": "操作成功", + "data": { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 1, + "dictName": "用户性别", + "dictType": "sys_user_sex", + "status": "0", + "remark": "用户性别列表" + } + } + this.queryParams.dictType = response.data.dictType; + this.defaultDictType = response.data.dictType; + this.getList(); }, /** 查询字典类型列表 */ getTypeList() { - getDictOptionselect().then(response => { - this.typeOptions = response.data; - }); + let response = { + "code": 200, + "msg": "操作成功", + "data": [ + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 1, + "dictName": "用户性别", + "dictType": "sys_user_sex", + "status": "0", + "remark": "用户性别列表" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 2, + "dictName": "菜单状态", + "dictType": "sys_show_hide", + "status": "0", + "remark": "菜单状态列表" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 3, + "dictName": "系统开关", + "dictType": "sys_normal_disable", + "status": "0", + "remark": "系统开关列表" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 4, + "dictName": "任务状态", + "dictType": "sys_job_status", + "status": "0", + "remark": "任务状态列表" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 5, + "dictName": "任务分组", + "dictType": "sys_job_group", + "status": "0", + "remark": "任务分组列表" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 6, + "dictName": "系统是否", + "dictType": "sys_yes_no", + "status": "0", + "remark": "系统是否列表" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 7, + "dictName": "通知类型", + "dictType": "sys_notice_type", + "status": "0", + "remark": "通知类型列表" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 8, + "dictName": "通知状态", + "dictType": "sys_notice_status", + "status": "0", + "remark": "通知状态列表" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 9, + "dictName": "操作类型", + "dictType": "sys_oper_type", + "status": "0", + "remark": "操作类型列表" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 10, + "dictName": "系统状态", + "dictType": "sys_common_status", + "status": "0", + "remark": "登录状态列表" + } + ] + } + this.typeOptions = response.data; }, /** 查询字典数据列表 */ getList() { this.loading = true; - listData(this.queryParams).then(response => { - this.dataList = response.data.rows; - this.total = response.data.total; - this.loading = false; - }); + let response = { + "code": 200, + "msg": "查询成功", + "data": { + "total": 3, + "rows": [ + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictCode": 1, + "dictSort": 1, + "dictLabel": "男", + "dictValue": "0", + "dictType": "sys_user_sex", + "cssClass": "", + "listClass": "", + "isDefault": "Y", + "status": "0", + "remark": "性别男" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictCode": 2, + "dictSort": 2, + "dictLabel": "女", + "dictValue": "1", + "dictType": "sys_user_sex", + "cssClass": "", + "listClass": "", + "isDefault": "N", + "status": "0", + "remark": "性别女" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictCode": 3, + "dictSort": 3, + "dictLabel": "未知", + "dictValue": "2", + "dictType": "sys_user_sex", + "cssClass": "", + "listClass": "", + "isDefault": "N", + "status": "0", + "remark": "性别未知" + } + ] + } + } + this.dataList = response.data.rows; + this.total = response.data.total; + this.loading = false; }, // 取消按钮 cancel() { @@ -364,31 +546,40 @@ export default { /** 修改按钮操作 */ handleUpdate(row) { this.reset(); - const dictCode = row.dictCode || this.ids - getData(dictCode).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:28", + "updateBy": null, + "updateTime": null, + "dictCode": 1, + "dictSort": 1, + "dictLabel": "男", + "dictValue": "0", + "dictType": "sys_user_sex", + "cssClass": "", + "listClass": "", + "isDefault": "Y", + "status": "0", + "remark": "性别男" + } + } + this.form = response.data; + this.open = true; + this.title = "修改字典数据"; }, /** 提交按钮 */ submitForm: function () { this.$refs["form"].validate(valid => { if (valid) { if (this.form.dictCode != undefined) { - updateData(this.form).then(response => { - this.$store.dispatch('dict/removeDict', this.queryParams.dictType); - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); - }); + this.$modal.msgSuccess("修改成功"); + this.open = false; } else { - addData(this.form).then(response => { - this.$store.dispatch('dict/removeDict', this.queryParams.dictType); - this.$modal.msgSuccess("新增成功"); - this.open = false; - this.getList(); - }); + this.$modal.msgSuccess("新增成功"); + this.open = false; } } }); @@ -396,20 +587,13 @@ export default { /** 删除按钮操作 */ handleDelete(row) { const dictCodes = row.dictCode || this.ids; - this.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?').then(function () { - return delData(dictCodes); - }).then(() => { - this.getList(); + this.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?').then(() => { this.$modal.msgSuccess("删除成功"); - this.$store.dispatch('dict/removeDict', this.queryParams.dictType); - }).catch(() => { }); }, /** 导出按钮操作 */ handleExport() { - this.download('system/dict/data/export', { - ...this.queryParams - }, `data_${new Date().getTime()}.xlsx`) + this.$modal.msgSuccess("导出成功"); } } }; diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index feb5d8c..dd07e70 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -251,12 +251,128 @@ export default { /** 查询字典类型列表 */ getList() { this.loading = true; - listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => { - this.typeList = response.data.rows; - this.total = response.data.total; - this.loading = false; + let response = { + "code": 200, + "msg": "查询成功", + "data": { + "total": 10, + "rows": [ + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 1, + "dictName": "用户性别", + "dictType": "sys_user_sex", + "status": "0", + "remark": "用户性别列表" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 2, + "dictName": "菜单状态", + "dictType": "sys_show_hide", + "status": "0", + "remark": "菜单状态列表" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 3, + "dictName": "系统开关", + "dictType": "sys_normal_disable", + "status": "0", + "remark": "系统开关列表" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 4, + "dictName": "任务状态", + "dictType": "sys_job_status", + "status": "0", + "remark": "任务状态列表" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 5, + "dictName": "任务分组", + "dictType": "sys_job_group", + "status": "0", + "remark": "任务分组列表" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 6, + "dictName": "系统是否", + "dictType": "sys_yes_no", + "status": "0", + "remark": "系统是否列表" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 7, + "dictName": "通知类型", + "dictType": "sys_notice_type", + "status": "0", + "remark": "通知类型列表" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 8, + "dictName": "通知状态", + "dictType": "sys_notice_status", + "status": "0", + "remark": "通知状态列表" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 9, + "dictName": "操作类型", + "dictType": "sys_oper_type", + "status": "0", + "remark": "操作类型列表" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "dictId": 10, + "dictName": "系统状态", + "dictType": "sys_common_status", + "status": "0", + "remark": "登录状态列表" + } + ] } - ); + } + this.typeList = response.data.rows; + this.total = response.data.total; + this.loading = false; }, // 取消按钮 cancel() { @@ -301,28 +417,35 @@ export default { handleUpdate(row) { this.reset(); const dictId = row.dictId || this.ids - getType(dictId).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:28", + "updateBy": null, + "updateTime": null, + "dictId": 1, + "dictName": "用户性别", + "dictType": "sys_user_sex", + "status": "0", + "remark": "用户性别列表" + } + } + this.form = response.data; + this.open = true; + this.title = "修改字典类型"; }, /** 提交按钮 */ submitForm: function () { this.$refs["form"].validate(valid => { if (valid) { if (this.form.dictId != undefined) { - updateType(this.form).then(response => { - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); - }); + this.$modal.msgSuccess("修改成功"); + this.open = false; } else { - addType(this.form).then(response => { - this.$modal.msgSuccess("新增成功"); - this.open = false; - this.getList(); - }); + this.$modal.msgSuccess("新增成功"); + this.open = false; } } }); @@ -330,26 +453,17 @@ export default { /** 删除按钮操作 */ handleDelete(row) { const dictIds = row.dictId || this.ids; - this.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function () { - return delType(dictIds); - }).then(() => { - this.getList(); + this.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(() => { this.$modal.msgSuccess("删除成功"); - }).catch(() => { }); }, /** 导出按钮操作 */ handleExport() { - this.download('system/dict/type/export', { - ...this.queryParams - }, `type_${new Date().getTime()}.xlsx`) + this.$modal.msgSuccess("导出成功"); }, /** 刷新缓存按钮操作 */ handleRefreshCache() { - refreshCache().then(() => { - this.$modal.msgSuccess("刷新成功"); - this.$store.dispatch('dict/cleanDict'); - }); + this.$modal.msgSuccess("刷新成功"); } } };