feat:【代码优化】减少部分模块的 import * 的 API
This commit is contained in:
@@ -22,6 +22,7 @@ export namespace IoTOtaTaskRecordApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO @AI:这里应该拿到 IoTOtaTaskRecordApi 里
|
||||||
/** IoT OTA 升级任务记录 */
|
/** IoT OTA 升级任务记录 */
|
||||||
export interface OtaTaskRecord {
|
export interface OtaTaskRecord {
|
||||||
id?: number;
|
id?: number;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import {
|
|||||||
} from 'ant-design-vue';
|
} from 'ant-design-vue';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
import * as FormApi from '#/api/bpm/form';
|
import { getForm } from '#/api/bpm/form';
|
||||||
import {
|
import {
|
||||||
HttpRequestSetting,
|
HttpRequestSetting,
|
||||||
parseFormFields,
|
parseFormFields,
|
||||||
@@ -229,7 +229,7 @@ watch(
|
|||||||
() => modelData.value.formId,
|
() => modelData.value.formId,
|
||||||
async (newFormId) => {
|
async (newFormId) => {
|
||||||
if (newFormId && modelData.value.formType === BpmModelFormType.NORMAL) {
|
if (newFormId && modelData.value.formType === BpmModelFormType.NORMAL) {
|
||||||
const data = await FormApi.getForm(newFormId);
|
const data = await getForm(newFormId);
|
||||||
const result: Array<{ field: string; title: string }> = [];
|
const result: Array<{ field: string; title: string }> = [];
|
||||||
if (data.fields) {
|
if (data.fields) {
|
||||||
unParsedFormFields.value = data.fields;
|
unParsedFormFields.value = data.fields;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import type { FormInstance } from 'ant-design-vue';
|
|||||||
import type { Rule } from 'ant-design-vue/es/form';
|
import type { Rule } from 'ant-design-vue/es/form';
|
||||||
|
|
||||||
import type { BpmProcessInstanceApi } from '#/api/bpm/processInstance';
|
import type { BpmProcessInstanceApi } from '#/api/bpm/processInstance';
|
||||||
|
import type { SystemUserApi } from '#/api/system/user';
|
||||||
|
|
||||||
import { computed, nextTick, reactive, ref, watch } from 'vue';
|
import { computed, nextTick, reactive, ref, watch } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
@@ -42,8 +43,17 @@ import {
|
|||||||
cancelProcessInstanceByStartUser,
|
cancelProcessInstanceByStartUser,
|
||||||
getNextApprovalNodes,
|
getNextApprovalNodes,
|
||||||
} from '#/api/bpm/processInstance';
|
} from '#/api/bpm/processInstance';
|
||||||
import * as TaskApi from '#/api/bpm/task';
|
import {
|
||||||
import * as UserApi from '#/api/system/user';
|
approveTask,
|
||||||
|
copyTask,
|
||||||
|
delegateTask,
|
||||||
|
getTaskListByReturn,
|
||||||
|
rejectTask,
|
||||||
|
returnTask,
|
||||||
|
signCreateTask,
|
||||||
|
signDeleteTask,
|
||||||
|
transferTask,
|
||||||
|
} from '#/api/bpm/task';
|
||||||
import { setConfAndFields2 } from '#/components/form-create';
|
import { setConfAndFields2 } from '#/components/form-create';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
@@ -57,7 +67,7 @@ const props = defineProps<{
|
|||||||
normalFormApi: any; // 流程表单 formCreate Api
|
normalFormApi: any; // 流程表单 formCreate Api
|
||||||
processDefinition: any; // 流程定义信息
|
processDefinition: any; // 流程定义信息
|
||||||
processInstance: any; // 流程实例信息
|
processInstance: any; // 流程实例信息
|
||||||
userOptions: UserApi.SystemUserApi.User[];
|
userOptions: SystemUserApi.User[];
|
||||||
writableFields: string[]; // 流程表单可以编辑的字段
|
writableFields: string[]; // 流程表单可以编辑的字段
|
||||||
}>(); // 当前登录的编号
|
}>(); // 当前登录的编号
|
||||||
const emit = defineEmits(['success']);
|
const emit = defineEmits(['success']);
|
||||||
@@ -249,7 +259,7 @@ async function openPopover(type: string) {
|
|||||||
}
|
}
|
||||||
if (type === 'return') {
|
if (type === 'return') {
|
||||||
// 获取退回节点
|
// 获取退回节点
|
||||||
returnList.value = await TaskApi.getTaskListByReturn(runningTask.value.id);
|
returnList.value = await getTaskListByReturn(runningTask.value.id);
|
||||||
if (returnList.value.length === 0) {
|
if (returnList.value.length === 0) {
|
||||||
message.warning('当前没有可退回的节点');
|
message.warning('当前没有可退回的节点');
|
||||||
return;
|
return;
|
||||||
@@ -375,7 +385,7 @@ async function handleAudit(pass: boolean, formRef: FormInstance | undefined) {
|
|||||||
await formCreateApi.validate();
|
await formCreateApi.validate();
|
||||||
data.variables = approveForm.value.value;
|
data.variables = approveForm.value.value;
|
||||||
}
|
}
|
||||||
await TaskApi.approveTask(data);
|
await approveTask(data);
|
||||||
popOverVisible.value.approve = false;
|
popOverVisible.value.approve = false;
|
||||||
nextAssigneesActivityNode.value = [];
|
nextAssigneesActivityNode.value = [];
|
||||||
// 清理 Timeline 组件中的自定义审批人数据
|
// 清理 Timeline 组件中的自定义审批人数据
|
||||||
@@ -389,7 +399,7 @@ async function handleAudit(pass: boolean, formRef: FormInstance | undefined) {
|
|||||||
id: runningTask.value.id,
|
id: runningTask.value.id,
|
||||||
reason: rejectReasonForm.reason,
|
reason: rejectReasonForm.reason,
|
||||||
};
|
};
|
||||||
await TaskApi.rejectTask(data);
|
await rejectTask(data);
|
||||||
popOverVisible.value.reject = false;
|
popOverVisible.value.reject = false;
|
||||||
message.success('审批不通过成功');
|
message.success('审批不通过成功');
|
||||||
}
|
}
|
||||||
@@ -415,7 +425,7 @@ async function handleCopy() {
|
|||||||
reason: copyForm.copyReason,
|
reason: copyForm.copyReason,
|
||||||
copyUserIds: copyForm.copyUserIds,
|
copyUserIds: copyForm.copyUserIds,
|
||||||
};
|
};
|
||||||
await TaskApi.copyTask(data);
|
await copyTask(data);
|
||||||
copyFormRef.value.resetFields();
|
copyFormRef.value.resetFields();
|
||||||
popOverVisible.value.copy = false;
|
popOverVisible.value.copy = false;
|
||||||
message.success($t('ui.actionMessage.operationSuccess'));
|
message.success($t('ui.actionMessage.operationSuccess'));
|
||||||
@@ -439,7 +449,7 @@ async function handleTransfer() {
|
|||||||
reason: transferForm.reason,
|
reason: transferForm.reason,
|
||||||
assigneeUserId: transferForm.assigneeUserId,
|
assigneeUserId: transferForm.assigneeUserId,
|
||||||
};
|
};
|
||||||
await TaskApi.transferTask(data);
|
await transferTask(data);
|
||||||
transferFormRef.value.resetFields();
|
transferFormRef.value.resetFields();
|
||||||
popOverVisible.value.transfer = false;
|
popOverVisible.value.transfer = false;
|
||||||
message.success($t('ui.actionMessage.operationSuccess'));
|
message.success($t('ui.actionMessage.operationSuccess'));
|
||||||
@@ -463,7 +473,7 @@ async function handleDelegate() {
|
|||||||
reason: delegateForm.reason,
|
reason: delegateForm.reason,
|
||||||
delegateUserId: delegateForm.delegateUserId,
|
delegateUserId: delegateForm.delegateUserId,
|
||||||
};
|
};
|
||||||
await TaskApi.delegateTask(data);
|
await delegateTask(data);
|
||||||
popOverVisible.value.delegate = false;
|
popOverVisible.value.delegate = false;
|
||||||
delegateFormRef.value.resetFields();
|
delegateFormRef.value.resetFields();
|
||||||
message.success($t('ui.actionMessage.operationSuccess'));
|
message.success($t('ui.actionMessage.operationSuccess'));
|
||||||
@@ -488,7 +498,7 @@ async function handlerAddSign(type: string) {
|
|||||||
reason: addSignForm.reason,
|
reason: addSignForm.reason,
|
||||||
userIds: addSignForm.addSignUserIds,
|
userIds: addSignForm.addSignUserIds,
|
||||||
};
|
};
|
||||||
await TaskApi.signCreateTask(data);
|
await signCreateTask(data);
|
||||||
message.success($t('ui.actionMessage.operationSuccess'));
|
message.success($t('ui.actionMessage.operationSuccess'));
|
||||||
addSignFormRef.value.resetFields();
|
addSignFormRef.value.resetFields();
|
||||||
popOverVisible.value.addSign = false;
|
popOverVisible.value.addSign = false;
|
||||||
@@ -512,7 +522,7 @@ async function handleReturn() {
|
|||||||
reason: returnForm.returnReason,
|
reason: returnForm.returnReason,
|
||||||
targetTaskDefinitionKey: returnForm.targetTaskDefinitionKey,
|
targetTaskDefinitionKey: returnForm.targetTaskDefinitionKey,
|
||||||
};
|
};
|
||||||
await TaskApi.returnTask(data);
|
await returnTask(data);
|
||||||
popOverVisible.value.return = false;
|
popOverVisible.value.return = false;
|
||||||
returnFormRef.value.resetFields();
|
returnFormRef.value.resetFields();
|
||||||
message.success($t('ui.actionMessage.operationSuccess'));
|
message.success($t('ui.actionMessage.operationSuccess'));
|
||||||
@@ -574,7 +584,7 @@ async function handlerDeleteSign() {
|
|||||||
id: deleteSignForm.deleteSignTaskId,
|
id: deleteSignForm.deleteSignTaskId,
|
||||||
reason: deleteSignForm.reason,
|
reason: deleteSignForm.reason,
|
||||||
};
|
};
|
||||||
await TaskApi.signDeleteTask(data);
|
await signDeleteTask(data);
|
||||||
message.success('减签成功');
|
message.success('减签成功');
|
||||||
deleteSignFormRef.value.resetFields();
|
deleteSignFormRef.value.resetFields();
|
||||||
popOverVisible.value.deleteSign = false;
|
popOverVisible.value.deleteSign = false;
|
||||||
|
|||||||
@@ -5,11 +5,18 @@ import { Page } from '@vben/common-ui';
|
|||||||
|
|
||||||
import { Badge, Card, List } from 'ant-design-vue';
|
import { Badge, Card, List } from 'ant-design-vue';
|
||||||
|
|
||||||
import * as ClueApi from '#/api/crm/clue';
|
import { getFollowClueCount } from '#/api/crm/clue';
|
||||||
import * as ContractApi from '#/api/crm/contract';
|
import {
|
||||||
import * as CustomerApi from '#/api/crm/customer';
|
getAuditContractCount,
|
||||||
import * as ReceivableApi from '#/api/crm/receivable';
|
getRemindContractCount,
|
||||||
import * as ReceivablePlanApi from '#/api/crm/receivable/plan';
|
} from '#/api/crm/contract';
|
||||||
|
import {
|
||||||
|
getFollowCustomerCount,
|
||||||
|
getPutPoolRemindCustomerCount,
|
||||||
|
getTodayContactCustomerCount,
|
||||||
|
} from '#/api/crm/customer';
|
||||||
|
import { getAuditReceivableCount } from '#/api/crm/receivable';
|
||||||
|
import { getReceivablePlanRemindCount } from '#/api/crm/receivable/plan';
|
||||||
|
|
||||||
import { useLeftSides } from './data';
|
import { useLeftSides } from './data';
|
||||||
import ClueFollowList from './modules/clue-follow-list.vue';
|
import ClueFollowList from './modules/clue-follow-list.vue';
|
||||||
@@ -64,17 +71,14 @@ function sideClick(item: { menu: string }) {
|
|||||||
|
|
||||||
/** 获取数量 */
|
/** 获取数量 */
|
||||||
async function getCount() {
|
async function getCount() {
|
||||||
customerTodayContactCount.value =
|
customerTodayContactCount.value = await getTodayContactCustomerCount();
|
||||||
await CustomerApi.getTodayContactCustomerCount();
|
customerPutPoolRemindCount.value = await getPutPoolRemindCustomerCount();
|
||||||
customerPutPoolRemindCount.value =
|
customerFollowCount.value = await getFollowCustomerCount();
|
||||||
await CustomerApi.getPutPoolRemindCustomerCount();
|
clueFollowCount.value = await getFollowClueCount();
|
||||||
customerFollowCount.value = await CustomerApi.getFollowCustomerCount();
|
contractAuditCount.value = await getAuditContractCount();
|
||||||
clueFollowCount.value = await ClueApi.getFollowClueCount();
|
contractRemindCount.value = await getRemindContractCount();
|
||||||
contractAuditCount.value = await ContractApi.getAuditContractCount();
|
receivableAuditCount.value = await getAuditReceivableCount();
|
||||||
contractRemindCount.value = await ContractApi.getRemindContractCount();
|
receivablePlanRemindCount.value = await getReceivablePlanRemindCount();
|
||||||
receivableAuditCount.value = await ReceivableApi.getAuditReceivableCount();
|
|
||||||
receivablePlanRemindCount.value =
|
|
||||||
await ReceivablePlanApi.getReceivablePlanRemindCount();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 激活时 */
|
/** 激活时 */
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import { formatDate } from '@vben/utils';
|
|||||||
|
|
||||||
import { Card, Col, Descriptions, Row } from 'ant-design-vue';
|
import { Card, Col, Descriptions, Row } from 'ant-design-vue';
|
||||||
|
|
||||||
import * as IoTOtaFirmwareApi from '#/api/iot/ota/firmware';
|
import { getOtaFirmware } from '#/api/iot/ota/firmware';
|
||||||
import * as IoTOtaTaskRecordApi from '#/api/iot/ota/task/record';
|
import { getOtaTaskRecordStatusStatistics } from '#/api/iot/ota/task/record';
|
||||||
import { IoTOtaTaskRecordStatusEnum } from '#/views/iot/utils/constants';
|
import { IoTOtaTaskRecordStatusEnum } from '#/views/iot/utils/constants';
|
||||||
|
|
||||||
import OtaTaskList from '../task/OtaTaskList.vue';
|
import OtaTaskList from '../task/OtaTaskList.vue';
|
||||||
@@ -30,7 +30,7 @@ const firmwareStatistics = ref<Record<string, number>>({});
|
|||||||
async function getFirmwareInfo() {
|
async function getFirmwareInfo() {
|
||||||
firmwareLoading.value = true;
|
firmwareLoading.value = true;
|
||||||
try {
|
try {
|
||||||
firmware.value = await IoTOtaFirmwareApi.getOtaFirmware(firmwareId.value);
|
firmware.value = await getOtaFirmware(firmwareId.value);
|
||||||
} finally {
|
} finally {
|
||||||
firmwareLoading.value = false;
|
firmwareLoading.value = false;
|
||||||
}
|
}
|
||||||
@@ -40,10 +40,9 @@ async function getFirmwareInfo() {
|
|||||||
async function getStatistics() {
|
async function getStatistics() {
|
||||||
firmwareStatisticsLoading.value = true;
|
firmwareStatisticsLoading.value = true;
|
||||||
try {
|
try {
|
||||||
firmwareStatistics.value =
|
firmwareStatistics.value = await getOtaTaskRecordStatusStatistics(
|
||||||
await IoTOtaTaskRecordApi.getOtaTaskRecordStatusStatistics(
|
firmwareId.value,
|
||||||
firmwareId.value,
|
);
|
||||||
);
|
|
||||||
} finally {
|
} finally {
|
||||||
firmwareStatisticsLoading.value = false;
|
firmwareStatisticsLoading.value = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import { formatDate } from '@vben/utils';
|
|||||||
|
|
||||||
import { Card, Col, Descriptions, Row } from 'ant-design-vue';
|
import { Card, Col, Descriptions, Row } from 'ant-design-vue';
|
||||||
|
|
||||||
import * as IoTOtaFirmwareApi from '#/api/iot/ota/firmware';
|
import { getOtaFirmware } from '#/api/iot/ota/firmware';
|
||||||
import * as IoTOtaTaskRecordApi from '#/api/iot/ota/task/record';
|
import { getOtaTaskRecordStatusStatistics } from '#/api/iot/ota/task/record';
|
||||||
import { IoTOtaTaskRecordStatusEnum } from '#/views/iot/utils/constants';
|
import { IoTOtaTaskRecordStatusEnum } from '#/views/iot/utils/constants';
|
||||||
|
|
||||||
import OtaTaskList from '../task/OtaTaskList.vue';
|
import OtaTaskList from '../task/OtaTaskList.vue';
|
||||||
@@ -30,7 +30,7 @@ const firmwareStatistics = ref<Record<string, number>>({});
|
|||||||
async function getFirmwareInfo() {
|
async function getFirmwareInfo() {
|
||||||
firmwareLoading.value = true;
|
firmwareLoading.value = true;
|
||||||
try {
|
try {
|
||||||
firmware.value = await IoTOtaFirmwareApi.getOtaFirmware(firmwareId.value);
|
firmware.value = await getOtaFirmware(firmwareId.value);
|
||||||
} finally {
|
} finally {
|
||||||
firmwareLoading.value = false;
|
firmwareLoading.value = false;
|
||||||
}
|
}
|
||||||
@@ -40,10 +40,9 @@ async function getFirmwareInfo() {
|
|||||||
async function getStatistics() {
|
async function getStatistics() {
|
||||||
firmwareStatisticsLoading.value = true;
|
firmwareStatisticsLoading.value = true;
|
||||||
try {
|
try {
|
||||||
firmwareStatistics.value =
|
firmwareStatistics.value = await getOtaTaskRecordStatusStatistics(
|
||||||
await IoTOtaTaskRecordApi.getOtaTaskRecordStatusStatistics(
|
firmwareId.value,
|
||||||
firmwareId.value,
|
);
|
||||||
);
|
|
||||||
} finally {
|
} finally {
|
||||||
firmwareStatisticsLoading.value = false;
|
firmwareStatisticsLoading.value = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,8 +21,12 @@ import {
|
|||||||
Tag,
|
Tag,
|
||||||
} from 'ant-design-vue';
|
} from 'ant-design-vue';
|
||||||
|
|
||||||
import * as IoTOtaTaskApi from '#/api/iot/ota/task';
|
import { getOtaTask } from '#/api/iot/ota/task';
|
||||||
import * as IoTOtaTaskRecordApi from '#/api/iot/ota/task/record';
|
import {
|
||||||
|
cancelOtaTaskRecord,
|
||||||
|
getOtaTaskRecordPage,
|
||||||
|
getOtaTaskRecordStatusStatistics,
|
||||||
|
} from '#/api/iot/ota/task/record';
|
||||||
import { IoTOtaTaskRecordStatusEnum } from '#/views/iot/utils/constants';
|
import { IoTOtaTaskRecordStatusEnum } from '#/views/iot/utils/constants';
|
||||||
|
|
||||||
/** OTA 任务详情组件 */
|
/** OTA 任务详情组件 */
|
||||||
@@ -119,7 +123,7 @@ async function getTaskInfo() {
|
|||||||
}
|
}
|
||||||
taskLoading.value = true;
|
taskLoading.value = true;
|
||||||
try {
|
try {
|
||||||
task.value = await IoTOtaTaskApi.getOtaTask(taskId.value);
|
task.value = await getOtaTask(taskId.value);
|
||||||
} finally {
|
} finally {
|
||||||
taskLoading.value = false;
|
taskLoading.value = false;
|
||||||
}
|
}
|
||||||
@@ -132,11 +136,10 @@ async function getStatistics() {
|
|||||||
}
|
}
|
||||||
taskStatisticsLoading.value = true;
|
taskStatisticsLoading.value = true;
|
||||||
try {
|
try {
|
||||||
taskStatistics.value =
|
taskStatistics.value = await getOtaTaskRecordStatusStatistics(
|
||||||
await IoTOtaTaskRecordApi.getOtaTaskRecordStatusStatistics(
|
undefined,
|
||||||
undefined,
|
taskId.value,
|
||||||
taskId.value,
|
);
|
||||||
);
|
|
||||||
} finally {
|
} finally {
|
||||||
taskStatisticsLoading.value = false;
|
taskStatisticsLoading.value = false;
|
||||||
}
|
}
|
||||||
@@ -150,7 +153,7 @@ async function getRecordList() {
|
|||||||
recordLoading.value = true;
|
recordLoading.value = true;
|
||||||
try {
|
try {
|
||||||
queryParams.taskId = taskId.value;
|
queryParams.taskId = taskId.value;
|
||||||
const data = await IoTOtaTaskRecordApi.getOtaTaskRecordPage(queryParams);
|
const data = await getOtaTaskRecordPage(queryParams);
|
||||||
recordList.value = data.list || [];
|
recordList.value = data.list || [];
|
||||||
recordTotal.value = data.total || 0;
|
recordTotal.value = data.total || 0;
|
||||||
} finally {
|
} finally {
|
||||||
@@ -181,7 +184,7 @@ async function handleCancelUpgrade(record: OtaTaskRecord) {
|
|||||||
content: '确认要取消该设备的升级任务吗?',
|
content: '确认要取消该设备的升级任务吗?',
|
||||||
async onOk() {
|
async onOk() {
|
||||||
try {
|
try {
|
||||||
await IoTOtaTaskRecordApi.cancelOtaTaskRecord(record.id!);
|
await cancelOtaTaskRecord(record.id!);
|
||||||
message.success('取消成功');
|
message.success('取消成功');
|
||||||
await getRecordList();
|
await getRecordList();
|
||||||
await getStatistics();
|
await getStatistics();
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import { useVbenModal } from '@vben/common-ui';
|
|||||||
|
|
||||||
import { Form, Input, message, Select, Spin } from 'ant-design-vue';
|
import { Form, Input, message, Select, Spin } from 'ant-design-vue';
|
||||||
|
|
||||||
import * as DeviceApi from '#/api/iot/device/device';
|
import { getDeviceListByProductId } from '#/api/iot/device/device';
|
||||||
import * as IoTOtaTaskApi from '#/api/iot/ota/task';
|
import { createOtaTask } from '#/api/iot/ota/task';
|
||||||
import { IoTOtaTaskDeviceScopeEnum } from '#/views/iot/utils/constants';
|
import { IoTOtaTaskDeviceScopeEnum } from '#/views/iot/utils/constants';
|
||||||
|
|
||||||
/** IoT OTA 升级任务表单 */
|
/** IoT OTA 升级任务表单 */
|
||||||
@@ -82,7 +82,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
try {
|
try {
|
||||||
await formRef.value.validate();
|
await formRef.value.validate();
|
||||||
modalApi.lock();
|
modalApi.lock();
|
||||||
await IoTOtaTaskApi.createOtaTask(formData.value);
|
await createOtaTask(formData.value);
|
||||||
message.success('创建成功');
|
message.success('创建成功');
|
||||||
await modalApi.close();
|
await modalApi.close();
|
||||||
emit('success');
|
emit('success');
|
||||||
@@ -98,8 +98,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
// 加载设备列表
|
// 加载设备列表
|
||||||
formLoading.value = true;
|
formLoading.value = true;
|
||||||
try {
|
try {
|
||||||
devices.value =
|
devices.value = (await getDeviceListByProductId(props.productId)) || [];
|
||||||
(await DeviceApi.getDeviceListByProductId(props.productId)) || [];
|
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false;
|
formLoading.value = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import {
|
|||||||
Tag,
|
Tag,
|
||||||
} from 'ant-design-vue';
|
} from 'ant-design-vue';
|
||||||
|
|
||||||
import * as IoTOtaTaskApi from '#/api/iot/ota/task';
|
import { getOtaTaskPage } from '#/api/iot/ota/task';
|
||||||
import { IoTOtaTaskStatusEnum } from '#/views/iot/utils/constants';
|
import { IoTOtaTaskStatusEnum } from '#/views/iot/utils/constants';
|
||||||
|
|
||||||
import OtaTaskDetail from './OtaTaskDetail.vue';
|
import OtaTaskDetail from './OtaTaskDetail.vue';
|
||||||
@@ -52,7 +52,7 @@ const taskDetailRef = ref(); // 任务详情引用
|
|||||||
async function getTaskList() {
|
async function getTaskList() {
|
||||||
taskLoading.value = true;
|
taskLoading.value = true;
|
||||||
try {
|
try {
|
||||||
const data = await IoTOtaTaskApi.getOtaTaskPage(queryParams);
|
const data = await getOtaTaskPage(queryParams);
|
||||||
taskList.value = data.list;
|
taskList.value = data.list;
|
||||||
taskTotal.value = data.total;
|
taskTotal.value = data.total;
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { computed, onMounted, ref } from 'vue';
|
|||||||
|
|
||||||
import { handleTree } from '@vben/utils';
|
import { handleTree } from '@vben/utils';
|
||||||
|
|
||||||
import * as ProductCategoryApi from '#/api/mall/product/category';
|
import { getCategoryList } from '#/api/mall/product/category';
|
||||||
|
|
||||||
/** 商品分类选择组件 */
|
/** 商品分类选择组件 */
|
||||||
defineOptions({ name: 'ProductCategorySelect' });
|
defineOptions({ name: 'ProductCategorySelect' });
|
||||||
@@ -43,7 +43,7 @@ const selectCategoryId = computed({
|
|||||||
const categoryList = ref<any[]>([]); // 分类树
|
const categoryList = ref<any[]>([]); // 分类树
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
// 获得分类树
|
// 获得分类树
|
||||||
const data = await ProductCategoryApi.getCategoryList({
|
const data = await getCategoryList({
|
||||||
parentId: props.parentId,
|
parentId: props.parentId,
|
||||||
});
|
});
|
||||||
categoryList.value = handleTree(data, 'id', 'parentId');
|
categoryList.value = handleTree(data, 'id', 'parentId');
|
||||||
|
|||||||
@@ -6,7 +6,10 @@ import { useRoute } from 'vue-router';
|
|||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import * as DiyPageApi from '#/api/mall/promotion/diy/page';
|
import {
|
||||||
|
getDiyPageProperty,
|
||||||
|
updateDiyPageProperty,
|
||||||
|
} from '#/api/mall/promotion/diy/page';
|
||||||
import { DiyEditor, PAGE_LIBS } from '#/views/mall/promotion/components';
|
import { DiyEditor, PAGE_LIBS } from '#/views/mall/promotion/components';
|
||||||
|
|
||||||
/** 装修页面表单 */
|
/** 装修页面表单 */
|
||||||
@@ -23,7 +26,7 @@ async function getPageDetail(id: any) {
|
|||||||
duration: 0,
|
duration: 0,
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
formData.value = await DiyPageApi.getDiyPageProperty(id);
|
formData.value = await getDiyPageProperty(id);
|
||||||
} finally {
|
} finally {
|
||||||
hideLoading();
|
hideLoading();
|
||||||
}
|
}
|
||||||
@@ -36,7 +39,7 @@ async function submitForm() {
|
|||||||
duration: 0,
|
duration: 0,
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
await DiyPageApi.updateDiyPageProperty(unref(formData)!);
|
await updateDiyPageProperty(unref(formData)!);
|
||||||
message.success('保存成功');
|
message.success('保存成功');
|
||||||
} finally {
|
} finally {
|
||||||
hideLoading();
|
hideLoading();
|
||||||
|
|||||||
@@ -13,8 +13,11 @@ import { isEmpty } from '@vben/utils';
|
|||||||
|
|
||||||
import { message, Radio, RadioGroup, Tooltip } from 'ant-design-vue';
|
import { message, Radio, RadioGroup, Tooltip } from 'ant-design-vue';
|
||||||
|
|
||||||
import * as DiyPageApi from '#/api/mall/promotion/diy/page';
|
import { updateDiyPageProperty } from '#/api/mall/promotion/diy/page';
|
||||||
import * as DiyTemplateApi from '#/api/mall/promotion/diy/template';
|
import {
|
||||||
|
getDiyTemplateProperty,
|
||||||
|
updateDiyTemplateProperty,
|
||||||
|
} from '#/api/mall/promotion/diy/template';
|
||||||
import { DiyEditor, PAGE_LIBS } from '#/views/mall/promotion/components';
|
import { DiyEditor, PAGE_LIBS } from '#/views/mall/promotion/components';
|
||||||
|
|
||||||
/** 装修模板表单 */
|
/** 装修模板表单 */
|
||||||
@@ -54,7 +57,7 @@ async function getPageDetail(id: any) {
|
|||||||
duration: 0,
|
duration: 0,
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
formData.value = await DiyTemplateApi.getDiyTemplateProperty(id);
|
formData.value = await getDiyTemplateProperty(id);
|
||||||
|
|
||||||
// 拼接手机预览链接
|
// 拼接手机预览链接
|
||||||
const domain = import.meta.env.VITE_MALL_H5_DOMAIN;
|
const domain = import.meta.env.VITE_MALL_H5_DOMAIN;
|
||||||
@@ -112,20 +115,18 @@ async function submitForm() {
|
|||||||
// 情况一:基础设置
|
// 情况一:基础设置
|
||||||
if (i === 0) {
|
if (i === 0) {
|
||||||
// 提交模板属性
|
// 提交模板属性
|
||||||
await DiyTemplateApi.updateDiyTemplateProperty(
|
await updateDiyTemplateProperty(isEmpty(data) ? formData.value! : data);
|
||||||
isEmpty(data) ? formData.value! : data,
|
|
||||||
);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 提交页面属性
|
// 提交页面属性
|
||||||
// 情况二:提交当前正在编辑的页面
|
// 情况二:提交当前正在编辑的页面
|
||||||
if (currentFormData.value?.name.includes(templateItem.name)) {
|
if (currentFormData.value?.name.includes(templateItem.name)) {
|
||||||
await DiyPageApi.updateDiyPageProperty(currentFormData.value!);
|
await updateDiyPageProperty(currentFormData.value!);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 情况三:提交页面编辑缓存
|
// 情况三:提交页面编辑缓存
|
||||||
if (!isEmpty(data)) {
|
if (!isEmpty(data)) {
|
||||||
await DiyPageApi.updateDiyPageProperty(data!);
|
await updateDiyPageProperty(data!);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
message.success('保存成功');
|
message.success('保存成功');
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { formatDateTime } from '@vben/utils';
|
|||||||
import { Card } from 'ant-design-vue';
|
import { Card } from 'ant-design-vue';
|
||||||
|
|
||||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import * as ProductStatisticsApi from '#/api/mall/statistics/product';
|
import { getProductStatisticsRankPage } from '#/api/mall/statistics/product';
|
||||||
import ShortcutDateRangePicker from '#/components/shortcut-date-range-picker/shortcut-date-range-picker.vue';
|
import ShortcutDateRangePicker from '#/components/shortcut-date-range-picker/shortcut-date-range-picker.vue';
|
||||||
|
|
||||||
/** 商品排行 */
|
/** 商品排行 */
|
||||||
@@ -104,7 +104,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
proxyConfig: {
|
proxyConfig: {
|
||||||
ajax: {
|
ajax: {
|
||||||
query: async ({ page, sorts }) => {
|
query: async ({ page, sorts }) => {
|
||||||
return await ProductStatisticsApi.getProductStatisticsRankPage({
|
return await getProductStatisticsRankPage({
|
||||||
pageNo: page.currentPage,
|
pageNo: page.currentPage,
|
||||||
pageSize: page.pageSize,
|
pageSize: page.pageSize,
|
||||||
times: searchTimes.value.length > 0 ? searchTimes.value : undefined,
|
times: searchTimes.value.length > 0 ? searchTimes.value : undefined,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { $t } from '@vben/locales';
|
|||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import * as AfterSaleApi from '#/api/mall/trade/afterSale/index';
|
import { disagreeAfterSale } from '#/api/mall/trade/afterSale';
|
||||||
|
|
||||||
import { useDisagreeFormSchema } from '../data';
|
import { useDisagreeFormSchema } from '../data';
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
try {
|
try {
|
||||||
const data =
|
const data =
|
||||||
(await formApi.getValues()) as MallAfterSaleApi.DisagreeRequest;
|
(await formApi.getValues()) as MallAfterSaleApi.DisagreeRequest;
|
||||||
await AfterSaleApi.disagreeAfterSale(data);
|
await disagreeAfterSale(data);
|
||||||
// 关闭并提示
|
// 关闭并提示
|
||||||
await modalApi.close();
|
await modalApi.close();
|
||||||
emit('success');
|
emit('success');
|
||||||
|
|||||||
@@ -18,9 +18,13 @@ import { useTabs } from '@vben/hooks';
|
|||||||
import { Card, message, Tag } from 'ant-design-vue';
|
import { Card, message, Tag } from 'ant-design-vue';
|
||||||
|
|
||||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import * as DeliveryExpressApi from '#/api/mall/trade/delivery/express';
|
import { getSimpleDeliveryExpressList } from '#/api/mall/trade/delivery/express';
|
||||||
import * as DeliveryPickUpStoreApi from '#/api/mall/trade/delivery/pickUpStore';
|
import { getDeliveryPickUpStore } from '#/api/mall/trade/delivery/pickUpStore';
|
||||||
import * as TradeOrderApi from '#/api/mall/trade/order';
|
import {
|
||||||
|
getExpressTrackList,
|
||||||
|
getOrder,
|
||||||
|
pickUpOrder,
|
||||||
|
} from '#/api/mall/trade/order';
|
||||||
import { useDescription } from '#/components/description';
|
import { useDescription } from '#/components/description';
|
||||||
import { DictTag } from '#/components/dict-tag';
|
import { DictTag } from '#/components/dict-tag';
|
||||||
import { TableAction } from '#/components/table-action';
|
import { TableAction } from '#/components/table-action';
|
||||||
@@ -157,7 +161,7 @@ const [PriceFormModal, priceFormModalApi] = useVbenModal({
|
|||||||
async function getDetail() {
|
async function getDetail() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
const res = await TradeOrderApi.getOrder(orderId.value);
|
const res = await getOrder(orderId.value);
|
||||||
if (res === null) {
|
if (res === null) {
|
||||||
message.error('交易订单不存在');
|
message.error('交易订单不存在');
|
||||||
handleBack();
|
handleBack();
|
||||||
@@ -169,12 +173,9 @@ async function getDetail() {
|
|||||||
|
|
||||||
// 如果配送方式为快递,则查询物流公司
|
// 如果配送方式为快递,则查询物流公司
|
||||||
if (res.deliveryType === DeliveryTypeEnum.EXPRESS.type) {
|
if (res.deliveryType === DeliveryTypeEnum.EXPRESS.type) {
|
||||||
deliveryExpressList.value =
|
deliveryExpressList.value = await getSimpleDeliveryExpressList();
|
||||||
await DeliveryExpressApi.getSimpleDeliveryExpressList();
|
|
||||||
if (res.logisticsId) {
|
if (res.logisticsId) {
|
||||||
expressTrackList.value = await TradeOrderApi.getExpressTrackList(
|
expressTrackList.value = await getExpressTrackList(res.id!);
|
||||||
res.id!,
|
|
||||||
);
|
|
||||||
expressTrackGridApi.setGridOptions({
|
expressTrackGridApi.setGridOptions({
|
||||||
data: expressTrackList.value || [],
|
data: expressTrackList.value || [],
|
||||||
});
|
});
|
||||||
@@ -183,9 +184,7 @@ async function getDetail() {
|
|||||||
res.deliveryType === DeliveryTypeEnum.PICK_UP.type &&
|
res.deliveryType === DeliveryTypeEnum.PICK_UP.type &&
|
||||||
res.pickUpStoreId
|
res.pickUpStoreId
|
||||||
) {
|
) {
|
||||||
pickUpStore.value = await DeliveryPickUpStoreApi.getDeliveryPickUpStore(
|
pickUpStore.value = await getDeliveryPickUpStore(res.pickUpStoreId);
|
||||||
res.pickUpStoreId,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
@@ -217,7 +216,7 @@ const handlePickUp = async () => {
|
|||||||
duration: 0,
|
duration: 0,
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
await TradeOrderApi.pickUpOrder(order.value.id!);
|
await pickUpOrder(order.value.id!);
|
||||||
message.success('核销成功');
|
message.success('核销成功');
|
||||||
await getDetail();
|
await getDetail();
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -6,7 +6,10 @@ import { useRoute } from 'vue-router';
|
|||||||
|
|
||||||
import { ElLoading, ElMessage } from 'element-plus';
|
import { ElLoading, ElMessage } from 'element-plus';
|
||||||
|
|
||||||
import * as DiyPageApi from '#/api/mall/promotion/diy/page';
|
import {
|
||||||
|
getDiyPageProperty,
|
||||||
|
updateDiyPageProperty,
|
||||||
|
} from '#/api/mall/promotion/diy/page';
|
||||||
import { DiyEditor, PAGE_LIBS } from '#/views/mall/promotion/components';
|
import { DiyEditor, PAGE_LIBS } from '#/views/mall/promotion/components';
|
||||||
|
|
||||||
/** 装修页面表单 */
|
/** 装修页面表单 */
|
||||||
@@ -22,7 +25,7 @@ async function getPageDetail(id: any) {
|
|||||||
text: '加载中...',
|
text: '加载中...',
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
formData.value = await DiyPageApi.getDiyPageProperty(id);
|
formData.value = await getDiyPageProperty(id);
|
||||||
} finally {
|
} finally {
|
||||||
loadingInstance.close();
|
loadingInstance.close();
|
||||||
}
|
}
|
||||||
@@ -34,7 +37,7 @@ async function submitForm() {
|
|||||||
text: '保存中...',
|
text: '保存中...',
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
await DiyPageApi.updateDiyPageProperty(unref(formData)!);
|
await updateDiyPageProperty(unref(formData)!);
|
||||||
ElMessage.success('保存成功');
|
ElMessage.success('保存成功');
|
||||||
} finally {
|
} finally {
|
||||||
loadingInstance.close();
|
loadingInstance.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user