fix: 状态码使用常量避免后续变更
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
} from '@/api/configManage/neManage';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
|
||||
@@ -271,7 +272,7 @@ function fnModalVisibleByEdit(row?: Record<string, any>) {
|
||||
getNeInfo(row.id).then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === 1) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
modalState.from = Object.assign(modalState.from, res.data);
|
||||
modalState.title = '修改网元';
|
||||
modalState.visibleByEdit = true;
|
||||
@@ -296,7 +297,7 @@ function fnModalOk() {
|
||||
const hide = message.loading({ content: t('common.loading') });
|
||||
result
|
||||
.then(res => {
|
||||
if (res.code === 1) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: t('common.msgSuccess', { msg: modalState.title }),
|
||||
duration: 3,
|
||||
@@ -367,7 +368,7 @@ function fnGetList() {
|
||||
if (tableState.loading) return;
|
||||
tableState.loading = true;
|
||||
listNeInfo(toRaw(queryParams)).then(res => {
|
||||
if (res.code === 1 && Array.isArray(res.rows)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
} from '@/api/configManage/neManage';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
|
||||
@@ -237,7 +238,7 @@ function fnModalVisibleByEdit(row?: Record<string, any>) {
|
||||
getNeInfo(row.id).then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === 1) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
modalState.from = Object.assign(modalState.from, res.data);
|
||||
modalState.title = '修改网元';
|
||||
modalState.visibleByEdit = true;
|
||||
@@ -262,7 +263,7 @@ function fnModalOk() {
|
||||
const hide = message.loading({ content: t('common.loading') });
|
||||
result
|
||||
.then(res => {
|
||||
if (res.code === 1) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: t('common.msgSuccess', { msg: modalState.title }),
|
||||
duration: 3,
|
||||
@@ -333,7 +334,7 @@ function fnGetList() {
|
||||
if (tableState.loading) return;
|
||||
tableState.loading = true;
|
||||
listNeInfo(toRaw(queryParams)).then(res => {
|
||||
if (res.code === 1 && Array.isArray(res.rows)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
|
||||
Reference in New Issue
Block a user