fix: lint

This commit is contained in:
xingyu4j
2025-11-24 15:34:25 +08:00
parent c3a702efbf
commit f22b390380
42 changed files with 178 additions and 170 deletions

View File

@@ -90,7 +90,7 @@ export const useMallKefuStore = defineStore('mall-kefu', {
}, },
conversationSort() { conversationSort() {
// 按置顶属性和最后消息时间排序 // 按置顶属性和最后消息时间排序
this.conversationList.sort((a, b) => { this.conversationList.toSorted((a, b) => {
// 按照置顶排序,置顶的会在前面 // 按照置顶排序,置顶的会在前面
if (a.adminPinned !== b.adminPinned) { if (a.adminPinned !== b.adminPinned) {
return a.adminPinned ? -1 : 1; return a.adminPinned ? -1 : 1;

View File

@@ -90,7 +90,7 @@ async function getChatConversationList() {
// 1.1 获取 对话数据 // 1.1 获取 对话数据
conversationList.value = await getChatConversationMyList(); conversationList.value = await getChatConversationMyList();
// 1.2 排序 // 1.2 排序
conversationList.value.sort((a, b) => { conversationList.value.toSorted((a, b) => {
return Number(b.createTime) - Number(a.createTime); return Number(b.createTime) - Number(a.createTime);
}); });
// 1.3 没有任何对话情况 // 1.3 没有任何对话情况

View File

@@ -13,7 +13,6 @@ import {
getChatRole, getChatRole,
updateChatRole, updateChatRole,
} from '#/api/ai/model/chatRole'; } from '#/api/ai/model/chatRole';
import {} from '#/api/bpm/model';
import { $t } from '#/locales'; import { $t } from '#/locales';
import { useFormSchema } from '../data'; import { useFormSchema } from '../data';

View File

@@ -9,7 +9,6 @@ import { message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter/form'; import { useVbenForm } from '#/adapter/form';
import { createModel, getModel, updateModel } from '#/api/ai/model/model'; import { createModel, getModel, updateModel } from '#/api/ai/model/model';
import {} from '#/api/bpm/model';
import { $t } from '#/locales'; import { $t } from '#/locales';
import { useFormSchema } from '../data'; import { useFormSchema } from '../data';

View File

@@ -17,7 +17,7 @@ const currentSong = ref({}); // 当前音乐
const mySongList = ref<Recordable<any>[]>([]); const mySongList = ref<Recordable<any>[]>([]);
const squareSongList = ref<Recordable<any>[]>([]); const squareSongList = ref<Recordable<any>[]>([]);
function generateMusic(formData: Recordable<any>) { function generateMusic(_formData: Recordable<any>) {
loading.value = true; loading.value = true;
setTimeout(() => { setTimeout(() => {
mySongList.value = Array.from({ length: 20 }, (_, index) => { mySongList.value = Array.from({ length: 20 }, (_, index) => {

View File

@@ -257,7 +257,7 @@ defineExpose({ validate });
</fieldset> </fieldset>
<fieldset <fieldset
class="bg-card m-0 mt-10 rounded-lg border border-gray-200 px-3 py-4" class="m-0 mt-10 rounded-lg border border-gray-200 bg-card px-3 py-4"
> >
<legend class="ml-2 px-2.5 text-base font-semibold text-gray-600"> <legend class="ml-2 px-2.5 text-base font-semibold text-gray-600">
<h3>运行结果</h3> <h3>运行结果</h3>

View File

@@ -62,16 +62,16 @@ const resetElement = () => {
bpmnInstances().moddle.create('bpmn:ExtensionElements', { values: [] }); bpmnInstances().moddle.create('bpmn:ExtensionElements', { values: [] });
// 是否开启自定义用户任务超时处理 // 是否开启自定义用户任务超时处理
boundaryEventType.value = elExtensionElements.value.values?.filter( boundaryEventType.value = elExtensionElements.value.values?.find(
(ex: any) => ex.$type === `${prefix}:BoundaryEventType`, (ex: any) => ex.$type === `${prefix}:BoundaryEventType`,
)?.[0]; );
if (boundaryEventType.value && boundaryEventType.value.value === 1) { if (boundaryEventType.value && boundaryEventType.value.value === 1) {
timeoutHandlerEnable.value = true; timeoutHandlerEnable.value = true;
configExtensions.value.push(boundaryEventType.value); configExtensions.value.push(boundaryEventType.value);
} }
// 执行动作 // 执行动作
timeoutHandlerType.value = elExtensionElements.value.values?.filter( timeoutHandlerType.value = elExtensionElements.value.values?.find(
(ex: any) => ex.$type === `${prefix}:TimeoutHandlerType`, (ex: any) => ex.$type === `${prefix}:TimeoutHandlerType`,
)?.[0]; )?.[0];
if (timeoutHandlerType.value) { if (timeoutHandlerType.value) {

View File

@@ -112,7 +112,7 @@ const resetCustomConfigList = () => {
// 审批类型 // 审批类型
approveType.value = approveType.value =
elExtensionElements.value.values?.filter( elExtensionElements.value.values?.find(
(ex: any) => ex.$type === `${prefix}:ApproveType`, (ex: any) => ex.$type === `${prefix}:ApproveType`,
)?.[0] || )?.[0] ||
bpmnInstances().moddle.create(`${prefix}:ApproveType`, { bpmnInstances().moddle.create(`${prefix}:ApproveType`, {
@@ -121,7 +121,7 @@ const resetCustomConfigList = () => {
// 审批人与提交人为同一人时 // 审批人与提交人为同一人时
assignStartUserHandlerTypeEl.value = assignStartUserHandlerTypeEl.value =
elExtensionElements.value.values?.filter( elExtensionElements.value.values?.find(
(ex: any) => ex.$type === `${prefix}:AssignStartUserHandlerType`, (ex: any) => ex.$type === `${prefix}:AssignStartUserHandlerType`,
)?.[0] || )?.[0] ||
bpmnInstances().moddle.create(`${prefix}:AssignStartUserHandlerType`, { bpmnInstances().moddle.create(`${prefix}:AssignStartUserHandlerType`, {
@@ -131,13 +131,13 @@ const resetCustomConfigList = () => {
// 审批人拒绝时 // 审批人拒绝时
rejectHandlerTypeEl.value = rejectHandlerTypeEl.value =
elExtensionElements.value.values?.filter( elExtensionElements.value.values?.find(
(ex: any) => ex.$type === `${prefix}:RejectHandlerType`, (ex: any) => ex.$type === `${prefix}:RejectHandlerType`,
)?.[0] || )?.[0] ||
bpmnInstances().moddle.create(`${prefix}:RejectHandlerType`, { value: 1 }); bpmnInstances().moddle.create(`${prefix}:RejectHandlerType`, { value: 1 });
rejectHandlerType.value = rejectHandlerTypeEl.value.value; rejectHandlerType.value = rejectHandlerTypeEl.value.value;
returnNodeIdEl.value = returnNodeIdEl.value =
elExtensionElements.value.values?.filter( elExtensionElements.value.values?.find(
(ex: any) => ex.$type === `${prefix}:RejectReturnTaskId`, (ex: any) => ex.$type === `${prefix}:RejectReturnTaskId`,
)?.[0] || )?.[0] ||
bpmnInstances().moddle.create(`${prefix}:RejectReturnTaskId`, { bpmnInstances().moddle.create(`${prefix}:RejectReturnTaskId`, {
@@ -147,7 +147,7 @@ const resetCustomConfigList = () => {
// 审批人为空时 // 审批人为空时
assignEmptyHandlerTypeEl.value = assignEmptyHandlerTypeEl.value =
elExtensionElements.value.values?.filter( elExtensionElements.value.values?.find(
(ex: any) => ex.$type === `${prefix}:AssignEmptyHandlerType`, (ex: any) => ex.$type === `${prefix}:AssignEmptyHandlerType`,
)?.[0] || )?.[0] ||
bpmnInstances().moddle.create(`${prefix}:AssignEmptyHandlerType`, { bpmnInstances().moddle.create(`${prefix}:AssignEmptyHandlerType`, {
@@ -155,7 +155,7 @@ const resetCustomConfigList = () => {
}); });
assignEmptyHandlerType.value = assignEmptyHandlerTypeEl.value.value; assignEmptyHandlerType.value = assignEmptyHandlerTypeEl.value.value;
assignEmptyUserIdsEl.value = assignEmptyUserIdsEl.value =
elExtensionElements.value.values?.filter( elExtensionElements.value.values?.find(
(ex: any) => ex.$type === `${prefix}:AssignEmptyUserIds`, (ex: any) => ex.$type === `${prefix}:AssignEmptyUserIds`,
)?.[0] || )?.[0] ||
bpmnInstances().moddle.create(`${prefix}:AssignEmptyUserIds`, { bpmnInstances().moddle.create(`${prefix}:AssignEmptyUserIds`, {
@@ -172,7 +172,7 @@ const resetCustomConfigList = () => {
}); });
// 操作按钮 // 操作按钮
buttonsSettingEl.value = elExtensionElements.value.values?.filter( buttonsSettingEl.value = elExtensionElements.value.values?.find(
(ex: any) => ex.$type === `${prefix}:ButtonsSetting`, (ex: any) => ex.$type === `${prefix}:ButtonsSetting`,
); );
if (buttonsSettingEl.value.length === 0) { if (buttonsSettingEl.value.length === 0) {
@@ -189,7 +189,7 @@ const resetCustomConfigList = () => {
// 字段权限 // 字段权限
if (formType.value === BpmModelFormType.NORMAL) { if (formType.value === BpmModelFormType.NORMAL) {
const fieldsPermissionList = elExtensionElements.value.values?.filter( const fieldsPermissionList = elExtensionElements.value.values?.find(
(ex: any) => ex.$type === `${prefix}:FieldsPermission`, (ex: any) => ex.$type === `${prefix}:FieldsPermission`,
); );
fieldsPermissionEl.value = []; fieldsPermissionEl.value = [];
@@ -206,21 +206,21 @@ const resetCustomConfigList = () => {
// 是否需要签名 // 是否需要签名
signEnable.value = signEnable.value =
elExtensionElements.value.values?.filter( elExtensionElements.value.values?.find(
(ex: any) => ex.$type === `${prefix}:SignEnable`, (ex: any) => ex.$type === `${prefix}:SignEnable`,
)?.[0] || ) ||
bpmnInstances().moddle.create(`${prefix}:SignEnable`, { value: false }); bpmnInstances().moddle.create(`${prefix}:SignEnable`, { value: false });
// 审批意见 // 审批意见
reasonRequire.value = reasonRequire.value =
elExtensionElements.value.values?.filter( elExtensionElements.value.values?.find(
(ex: any) => ex.$type === `${prefix}:ReasonRequire`, (ex: any) => ex.$type === `${prefix}:ReasonRequire`,
)?.[0] || ) ||
bpmnInstances().moddle.create(`${prefix}:ReasonRequire`, { value: false }); bpmnInstances().moddle.create(`${prefix}:ReasonRequire`, { value: false });
// 保留剩余扩展元素,便于后面更新该元素对应属性 // 保留剩余扩展元素,便于后面更新该元素对应属性
otherExtensions.value = otherExtensions.value =
elExtensionElements.value.values?.filter( elExtensionElements.value.values?.find(
(ex: any) => (ex: any) =>
ex.$type !== `${prefix}:AssignStartUserHandlerType` && ex.$type !== `${prefix}:AssignStartUserHandlerType` &&
ex.$type !== `${prefix}:RejectHandlerType` && ex.$type !== `${prefix}:RejectHandlerType` &&

View File

@@ -118,10 +118,10 @@ const resetTaskForm = () => {
const extensionElements = const extensionElements =
businessObject?.extensionElements ?? businessObject?.extensionElements ??
bpmnInstances().moddle.create('bpmn:ExtensionElements', { values: [] }); bpmnInstances().moddle.create('bpmn:ExtensionElements', { values: [] });
userTaskForm.value.candidateStrategy = extensionElements.values?.filter( userTaskForm.value.candidateStrategy = extensionElements.values?.find(
(ex: any) => ex.$type === `${prefix}:CandidateStrategy`, (ex: any) => ex.$type === `${prefix}:CandidateStrategy`,
)?.[0]?.value; )?.[0]?.value;
const candidateParamStr = extensionElements.values?.filter( const candidateParamStr = extensionElements.values?.find(
(ex: any) => ex.$type === `${prefix}:CandidateParam`, (ex: any) => ex.$type === `${prefix}:CandidateParam`,
)?.[0]?.value; )?.[0]?.value;
if (candidateParamStr && candidateParamStr.length > 0) { if (candidateParamStr && candidateParamStr.length > 0) {

View File

@@ -112,7 +112,7 @@ function setDuration(type, val) {
// 组装ISO 8601字符串 // 组装ISO 8601字符串
let d = isoDuration.value; let d = isoDuration.value;
if (d.includes(type)) { if (d.includes(type)) {
d = d.replace(new RegExp(`\\d+${type}`), val + type); d = d.replace(new RegExp(String.raw`\d+${type}`), val + type);
} else { } else {
d += val + type; d += val + type;
} }

View File

@@ -82,10 +82,12 @@ export function updateElementExtensions(element, extensionList) {
} }
// 创建一个id // 创建一个id
export function uuid(length = 8, chars?) { export function uuid(
length = 8,
charsString = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
) {
let result = ''; let result = '';
const charsString =
chars || '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
for (let i = length; i > 0; --i) { for (let i = length; i > 0; --i) {
result += charsString[Math.floor(Math.random() * charsString.length)]; result += charsString[Math.floor(Math.random() * charsString.length)];
} }

View File

@@ -6,7 +6,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
return { return {
dataset: { dataset: {
dimensions: ['nickname', 'count'], dimensions: ['nickname', 'count'],
source: cloneDeep(res).reverse(), source: cloneDeep(res).toReversed(),
}, },
grid: { grid: {
left: 20, left: 20,
@@ -54,7 +54,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
return { return {
dataset: { dataset: {
dimensions: ['nickname', 'count'], dimensions: ['nickname', 'count'],
source: cloneDeep(res).reverse(), source: cloneDeep(res).toReversed(),
}, },
grid: { grid: {
left: 20, left: 20,
@@ -102,7 +102,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
return { return {
dataset: { dataset: {
dimensions: ['nickname', 'count'], dimensions: ['nickname', 'count'],
source: cloneDeep(res).reverse(), source: cloneDeep(res).toReversed(),
}, },
grid: { grid: {
left: 20, left: 20,
@@ -150,7 +150,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
return { return {
dataset: { dataset: {
dimensions: ['nickname', 'count'], dimensions: ['nickname', 'count'],
source: cloneDeep(res).reverse(), source: cloneDeep(res).toReversed(),
}, },
grid: { grid: {
left: 20, left: 20,
@@ -198,7 +198,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
return { return {
dataset: { dataset: {
dimensions: ['nickname', 'count'], dimensions: ['nickname', 'count'],
source: cloneDeep(res).reverse(), source: cloneDeep(res).toReversed(),
}, },
grid: { grid: {
left: 20, left: 20,
@@ -246,7 +246,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
return { return {
dataset: { dataset: {
dimensions: ['nickname', 'count'], dimensions: ['nickname', 'count'],
source: cloneDeep(res).reverse(), source: cloneDeep(res).toReversed(),
}, },
grid: { grid: {
left: 20, left: 20,
@@ -294,7 +294,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
return { return {
dataset: { dataset: {
dimensions: ['nickname', 'count'], dimensions: ['nickname', 'count'],
source: cloneDeep(res).reverse(), source: cloneDeep(res).toReversed(),
}, },
grid: { grid: {
left: 20, left: 20,
@@ -342,7 +342,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
return { return {
dataset: { dataset: {
dimensions: ['nickname', 'count'], dimensions: ['nickname', 'count'],
source: cloneDeep(res).reverse(), source: cloneDeep(res).toReversed(),
}, },
grid: { grid: {
left: 20, left: 20,

View File

@@ -154,6 +154,7 @@ function handleOpenSaleReturn() {
} }
function handleAddSaleReturn(rows: ErpSaleReturnApi.SaleReturn[]) { function handleAddSaleReturn(rows: ErpSaleReturnApi.SaleReturn[]) {
// TODO 芋艿
rows.forEach((row) => { rows.forEach((row) => {
const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = { const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = {
bizId: row.id, bizId: row.id,

View File

@@ -47,7 +47,7 @@ const { status, data, send, close, open } = useWebSocket(server.value, {
const messageList = ref( const messageList = ref(
[] as { text: string; time: number; type?: string; userId?: string }[], [] as { text: string; time: number; type?: string; userId?: string }[],
); // 消息列表 ); // 消息列表
const messageReverseList = computed(() => [...messageList.value].reverse()); const messageReverseList = computed(() => [...messageList.value].toReversed());
watchEffect(() => { watchEffect(() => {
if (!data.value) { if (!data.value) {
return; return;

View File

@@ -22,8 +22,7 @@ import {
import { getLatestDeviceProperties } from '#/api/iot/device/device'; import { getLatestDeviceProperties } from '#/api/iot/device/device';
import DeviceDetailsThingModelPropertyHistory import DeviceDetailsThingModelPropertyHistory from './device-details-thing-model-property-history.vue';
from './device-details-thing-model-property-history.vue';
const props = defineProps<{ deviceId: number }>(); const props = defineProps<{ deviceId: number }>();
@@ -168,13 +167,13 @@ onMounted(() => {
> >
<!-- 添加渐变背景层 --> <!-- 添加渐变背景层 -->
<div <div
class="from-muted pointer-events-none absolute left-0 right-0 top-0 h-12 bg-gradient-to-b to-transparent" class="pointer-events-none absolute left-0 right-0 top-0 h-12 bg-gradient-to-b from-muted to-transparent"
></div> ></div>
<div class="relative p-4"> <div class="relative p-4">
<!-- 标题区域 --> <!-- 标题区域 -->
<div class="mb-3 flex items-center"> <div class="mb-3 flex items-center">
<div class="mr-2.5 flex items-center"> <div class="mr-2.5 flex items-center">
<IconifyIcon icon="ep:cpu" class="text-primary text-lg" /> <IconifyIcon icon="ep:cpu" class="text-lg text-primary" />
</div> </div>
<div class="flex-1 text-base font-bold">{{ item.name }}</div> <div class="flex-1 text-base font-bold">{{ item.name }}</div>
<!-- 标识符 --> <!-- 标识符 -->
@@ -198,7 +197,7 @@ onMounted(() => {
> >
<IconifyIcon <IconifyIcon
icon="ep:data-line" icon="ep:data-line"
class="text-primary text-lg" class="text-lg text-primary"
/> />
</div> </div>
</div> </div>
@@ -206,14 +205,14 @@ onMounted(() => {
<!-- 信息区域 --> <!-- 信息区域 -->
<div class="text-sm"> <div class="text-sm">
<div class="mb-2.5 last:mb-0"> <div class="mb-2.5 last:mb-0">
<span class="text-muted-foreground mr-2.5">属性值</span> <span class="mr-2.5 text-muted-foreground">属性值</span>
<span class="text-foreground font-bold"> <span class="font-bold text-foreground">
{{ formatValueWithUnit(item) }} {{ formatValueWithUnit(item) }}
</span> </span>
</div> </div>
<div class="mb-2.5 last:mb-0"> <div class="mb-2.5 last:mb-0">
<span class="text-muted-foreground mr-2.5">更新时间</span> <span class="mr-2.5 text-muted-foreground">更新时间</span>
<span class="text-foreground text-sm"> <span class="text-sm text-foreground">
{{ item.updateTime ? formatDate(item.updateTime) : '-' }} {{ item.updateTime ? formatDate(item.updateTime) : '-' }}
</span> </span>
</div> </div>

View File

@@ -1,12 +1,16 @@
<script setup lang="ts"> <script setup lang="ts">
import {ComparisonCard, Page} from '@vben/common-ui'; // TODO @芋艿
import type { StatsData } from './data';
import {Col, Row} from 'ant-design-vue'; import { onMounted, ref } from 'vue';
import {onMounted, ref} from 'vue';
import {getStatisticsSummary} from '#/api/iot/statistics'; import { ComparisonCard, Page } from '@vben/common-ui';
import {defaultStatsData, type StatsData} from './data'; import { Col, Row } from 'ant-design-vue';
import { getStatisticsSummary } from '#/api/iot/statistics';
import { defaultStatsData } from './data';
import DeviceCountCard from './modules/device-count-card.vue'; import DeviceCountCard from './modules/device-count-card.vue';
import DeviceStateCountCard from './modules/device-state-count-card.vue'; import DeviceStateCountCard from './modules/device-state-count-card.vue';
import MessageTrendCard from './modules/message-trend-card.vue'; import MessageTrendCard from './modules/message-trend-card.vue';

View File

@@ -135,7 +135,8 @@ function handleDeviceChange(_: any) {
/** /**
* 处理属性变化事件 * 处理属性变化事件
* @param propertyInfo 属性信息对象 * @param propertyInfo.config 属性配置
* @param propertyInfo.type 属性类型
*/ */
function handlePropertyChange(propertyInfo: { config: any; type: string }) { function handlePropertyChange(propertyInfo: { config: any; type: string }) {
propertyType.value = propertyInfo.type; propertyType.value = propertyInfo.type;

View File

@@ -126,7 +126,8 @@ function validateSku() {
/** /**
* 选择时触发 * 选择时触发
* *
* @param records 传递过来的选中的 sku 是一个数组 * @param {object} param0 参数对象
* @param {MallSpuApi.Sku[]} param0.records 传递过来的选中的 sku 是一个数组
*/ */
function handleSelectionChange({ records }: { records: MallSpuApi.Sku[] }) { function handleSelectionChange({ records }: { records: MallSpuApi.Sku[] }) {
emit('selectionChange', records); emit('selectionChange', records);

View File

@@ -99,8 +99,8 @@ function handleAppLinkSelected(appLink: AppLink) {
/** /**
* 处理右侧链接列表滚动 * 处理右侧链接列表滚动
* *
* @param {object} param0 滚动事件参数 * @param {Event} event 滚动事件
* @param {number} param0.scrollTop 滚动条的位置 * @param {number} event.target.scrollTop 滚动条的位置
*/ */
function handleScroll(event: Event) { function handleScroll(event: Event) {
const scrollTop = (event.target as HTMLDivElement).scrollTop; const scrollTop = (event.target as HTMLDivElement).scrollTop;

View File

@@ -57,10 +57,10 @@ export function isContains(hotArea: Rect, point: Point): boolean {
*/ */
export function createRect(a: Point, b: Point): Rect { export function createRect(a: Point, b: Point): Rect {
// 计算矩形的范围 // 计算矩形的范围
let [left, left2] = [a.x, b.x].sort(); let [left, left2] = [a.x, b.x].toSorted();
left = left ?? 0; left = left ?? 0;
left2 = left2 ?? 0; left2 = left2 ?? 0;
let [top, top2] = [a.y, b.y].sort(); let [top, top2] = [a.y, b.y].toSorted();
top = top ?? 0; top = top ?? 0;
top2 = top2 ?? 0; top2 = top2 ?? 0;
const right = left2 + 1; const right = left2 + 1;

View File

@@ -111,20 +111,22 @@ const [Modal, modalApi] = useVbenModal({
if (data.row?.id) { if (data.row?.id) {
// 编辑:加载数据 // 编辑:加载数据
const rowData = data.row; const rowData = data.row;
const formValues: any = { ...rowData }; const formValues: any = {
formValues.reply = { ...rowData,
type: rowData.responseMessageType, reply: {
accountId: data.accountId || -1, type: rowData.responseMessageType,
content: rowData.responseContent, accountId: data.accountId || -1,
mediaId: rowData.responseMediaId, content: rowData.responseContent,
url: rowData.responseMediaUrl, mediaId: rowData.responseMediaId,
title: rowData.responseTitle, url: rowData.responseMediaUrl,
description: rowData.responseDescription, title: rowData.responseTitle,
thumbMediaId: rowData.responseThumbMediaId, description: rowData.responseDescription,
thumbMediaUrl: rowData.responseThumbMediaUrl, thumbMediaId: rowData.responseThumbMediaId,
articles: rowData.responseArticles, thumbMediaUrl: rowData.responseThumbMediaUrl,
musicUrl: rowData.responseMusicUrl, articles: rowData.responseArticles,
hqMusicUrl: rowData.responseHqMusicUrl, musicUrl: rowData.responseMusicUrl,
hqMusicUrl: rowData.responseHqMusicUrl,
},
}; };
await formApi.setValues(formValues); await formApi.setValues(formValues);
} else { } else {

View File

@@ -106,7 +106,7 @@ async function getPage(page: any, params: any = null) {
const scrollHeight = msgDivRef.value?.scrollHeight ?? 0; const scrollHeight = msgDivRef.value?.scrollHeight ?? 0;
// 处理数据 // 处理数据
const data = dataTemp.list.reverse(); const data = dataTemp.list.toReversed();
list.value = [...data, ...list.value]; list.value = [...data, ...list.value];
loading.value = false; loading.value = false;
if (data.length < queryParams.pageSize || data.length === 0) { if (data.length < queryParams.pageSize || data.length === 0) {

View File

@@ -134,20 +134,20 @@ function menuListToFrontend(list: any[]) {
list.forEach((item: RawMenu) => { list.forEach((item: RawMenu) => {
const menu: any = { const menu: any = {
...item, ...item,
}; reply: {
menu.reply = { type: item.replyMessageType,
type: item.replyMessageType, accountId: item.accountId,
accountId: item.accountId, content: item.replyContent,
content: item.replyContent, mediaId: item.replyMediaId,
mediaId: item.replyMediaId, url: item.replyMediaUrl,
url: item.replyMediaUrl, title: item.replyTitle,
title: item.replyTitle, description: item.replyDescription,
description: item.replyDescription, thumbMediaId: item.replyThumbMediaId,
thumbMediaId: item.replyThumbMediaId, thumbMediaUrl: item.replyThumbMediaUrl,
thumbMediaUrl: item.replyThumbMediaUrl, articles: item.replyArticles,
articles: item.replyArticles, musicUrl: item.replyMusicUrl,
musicUrl: item.replyMusicUrl, hqMusicUrl: item.replyHqMusicUrl,
hqMusicUrl: item.replyHqMusicUrl, },
}; };
result.push(menu as RawMenu); result.push(menu as RawMenu);
}); });
@@ -275,23 +275,22 @@ function menuListToBackend() {
/** 将前端的 menu转换成后端接收的 menu */ /** 将前端的 menu转换成后端接收的 menu */
// TODO: @芋艿,需要根据后台 API 删除不需要的字段 // TODO: @芋艿,需要根据后台 API 删除不需要的字段
function menuToBackend(menu: any) { function menuToBackend(menu: any) {
const result = { return {
...menu, ...menu,
children: undefined, // 不处理子节点 children: undefined, // 不处理子节点
reply: undefined, // 稍后复制 reply: undefined, // 稍后复制
replyMessageType: menu.reply.type,
replyContent: menu.reply.content,
replyMediaId: menu.reply.mediaId,
replyMediaUrl: menu.reply.url,
replyTitle: menu.reply.title,
replyDescription: menu.reply.description,
replyThumbMediaId: menu.reply.thumbMediaId,
replyThumbMediaUrl: menu.reply.thumbMediaUrl,
replyArticles: menu.reply.articles,
replyMusicUrl: menu.reply.musicUrl,
replyHqMusicUrl: menu.reply.hqMusicUrl,
}; };
result.replyMessageType = menu.reply.type;
result.replyContent = menu.reply.content;
result.replyMediaId = menu.reply.mediaId;
result.replyMediaUrl = menu.reply.url;
result.replyTitle = menu.reply.title;
result.replyDescription = menu.reply.description;
result.replyThumbMediaId = menu.reply.thumbMediaId;
result.replyThumbMediaUrl = menu.reply.thumbMediaUrl;
result.replyArticles = menu.reply.articles;
result.replyMusicUrl = menu.reply.musicUrl;
result.replyHqMusicUrl = menu.reply.hqMusicUrl;
return result;
} }
</script> </script>

View File

@@ -258,9 +258,7 @@ export function useAppFormSchema(): VbenFormSchema[] {
/** 渠道新增/修改的表单 */ /** 渠道新增/修改的表单 */
export function useChannelFormSchema(formType: string = ''): VbenFormSchema[] { export function useChannelFormSchema(formType: string = ''): VbenFormSchema[] {
const schema: VbenFormSchema[] = []; const schema: VbenFormSchema[] = [
// 添加通用字段
schema.push(
{ {
component: 'Input', component: 'Input',
fieldName: 'id', fieldName: 'id',
@@ -309,7 +307,8 @@ export function useChannelFormSchema(formType: string = ''): VbenFormSchema[] {
optionType: 'button', optionType: 'button',
}, },
}, },
); ];
// 添加通用字段
// 根据类型添加特定字段 // 根据类型添加特定字段
if (formType.includes('alipay_')) { if (formType.includes('alipay_')) {
schema.push( schema.push(

View File

@@ -80,7 +80,7 @@ export const useMallKefuStore = defineStore('mall-kefu', {
}, },
conversationSort() { conversationSort() {
// 按置顶属性和最后消息时间排序 // 按置顶属性和最后消息时间排序
this.conversationList.sort((a, b) => { this.conversationList.toSorted((a, b) => {
// 按照置顶排序,置顶的会在前面 // 按照置顶排序,置顶的会在前面
if (a.adminPinned !== b.adminPinned) { if (a.adminPinned !== b.adminPinned) {
return a.adminPinned ? -1 : 1; return a.adminPinned ? -1 : 1;

View File

@@ -97,7 +97,7 @@ async function getChatConversationList() {
// 1.1 获取 对话数据 // 1.1 获取 对话数据
conversationList.value = await getChatConversationMyList(); conversationList.value = await getChatConversationMyList();
// 1.2 排序 // 1.2 排序
conversationList.value.sort((a, b) => { conversationList.value.toSorted((a, b) => {
return Number(b.createTime) - Number(a.createTime); return Number(b.createTime) - Number(a.createTime);
}); });
// 1.3 没有任何对话情况 // 1.3 没有任何对话情况

View File

@@ -13,7 +13,6 @@ import {
getChatRole, getChatRole,
updateChatRole, updateChatRole,
} from '#/api/ai/model/chatRole'; } from '#/api/ai/model/chatRole';
import {} from '#/api/bpm/model';
import { $t } from '#/locales'; import { $t } from '#/locales';
import { useFormSchema } from '../data'; import { useFormSchema } from '../data';

View File

@@ -9,7 +9,6 @@ import { ElMessage } from 'element-plus';
import { useVbenForm } from '#/adapter/form'; import { useVbenForm } from '#/adapter/form';
import { createModel, getModel, updateModel } from '#/api/ai/model/model'; import { createModel, getModel, updateModel } from '#/api/ai/model/model';
import {} from '#/api/bpm/model';
import { $t } from '#/locales'; import { $t } from '#/locales';
import { useFormSchema } from '../data'; import { useFormSchema } from '../data';

View File

@@ -17,7 +17,7 @@ const currentSong = ref({}); // 当前音乐
const mySongList = ref<Recordable<any>[]>([]); const mySongList = ref<Recordable<any>[]>([]);
const squareSongList = ref<Recordable<any>[]>([]); const squareSongList = ref<Recordable<any>[]>([]);
function generateMusic(formData: Recordable<any>) { function generateMusic(_formData: Recordable<any>) {
loading.value = true; loading.value = true;
setTimeout(() => { setTimeout(() => {
mySongList.value = Array.from({ length: 20 }, (_, index) => { mySongList.value = Array.from({ length: 20 }, (_, index) => {

View File

@@ -6,7 +6,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
return { return {
dataset: { dataset: {
dimensions: ['nickname', 'count'], dimensions: ['nickname', 'count'],
source: cloneDeep(res).reverse(), source: cloneDeep(res).toReversed(),
}, },
grid: { grid: {
left: 20, left: 20,
@@ -54,7 +54,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
return { return {
dataset: { dataset: {
dimensions: ['nickname', 'count'], dimensions: ['nickname', 'count'],
source: cloneDeep(res).reverse(), source: cloneDeep(res).toReversed(),
}, },
grid: { grid: {
left: 20, left: 20,
@@ -102,7 +102,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
return { return {
dataset: { dataset: {
dimensions: ['nickname', 'count'], dimensions: ['nickname', 'count'],
source: cloneDeep(res).reverse(), source: cloneDeep(res).toReversed(),
}, },
grid: { grid: {
left: 20, left: 20,
@@ -150,7 +150,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
return { return {
dataset: { dataset: {
dimensions: ['nickname', 'count'], dimensions: ['nickname', 'count'],
source: cloneDeep(res).reverse(), source: cloneDeep(res).toReversed(),
}, },
grid: { grid: {
left: 20, left: 20,
@@ -198,7 +198,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
return { return {
dataset: { dataset: {
dimensions: ['nickname', 'count'], dimensions: ['nickname', 'count'],
source: cloneDeep(res).reverse(), source: cloneDeep(res).toReversed(),
}, },
grid: { grid: {
left: 20, left: 20,
@@ -246,7 +246,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
return { return {
dataset: { dataset: {
dimensions: ['nickname', 'count'], dimensions: ['nickname', 'count'],
source: cloneDeep(res).reverse(), source: cloneDeep(res).toReversed(),
}, },
grid: { grid: {
left: 20, left: 20,
@@ -294,7 +294,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
return { return {
dataset: { dataset: {
dimensions: ['nickname', 'count'], dimensions: ['nickname', 'count'],
source: cloneDeep(res).reverse(), source: cloneDeep(res).toReversed(),
}, },
grid: { grid: {
left: 20, left: 20,
@@ -342,7 +342,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
return { return {
dataset: { dataset: {
dimensions: ['nickname', 'count'], dimensions: ['nickname', 'count'],
source: cloneDeep(res).reverse(), source: cloneDeep(res).toReversed(),
}, },
grid: { grid: {
left: 20, left: 20,

View File

@@ -86,6 +86,7 @@ watch(
/** 处理新增 */ /** 处理新增 */
function handleAdd() { function handleAdd() {
// TODO @芋艿
const newRow = { const newRow = {
id: undefined, id: undefined,
warehouseId: undefined, warehouseId: undefined,

View File

@@ -105,6 +105,7 @@ function handleAdd() {
/** 处理删除 */ /** 处理删除 */
function handleDelete(row: ErpStockOutApi.StockOutItem) { function handleDelete(row: ErpStockOutApi.StockOutItem) {
// TODO @芋艿
const index = tableData.value.findIndex((item) => item.seq === row.seq); const index = tableData.value.findIndex((item) => item.seq === row.seq);
if (index !== -1) { if (index !== -1) {
tableData.value.splice(index, 1); tableData.value.splice(index, 1);
@@ -271,7 +272,7 @@ onMounted(async () => {
</template> </template>
<template #bottom> <template #bottom>
<div class="border-border bg-muted mt-2 rounded border p-2"> <div class="mt-2 rounded border border-border bg-muted p-2">
<div class="text-muted-foreground flex justify-between text-sm"> <div class="text-muted-foreground flex justify-between text-sm">
<span class="text-foreground font-medium">合计</span> <span class="text-foreground font-medium">合计</span>
<div class="flex space-x-4"> <div class="flex space-x-4">

View File

@@ -47,7 +47,7 @@ const { status, data, send, close, open } = useWebSocket(server.value, {
const messageList = ref( const messageList = ref(
[] as { text: string; time: number; type?: string; userId?: string }[], [] as { text: string; time: number; type?: string; userId?: string }[],
); // 消息列表 ); // 消息列表
const messageReverseList = computed(() => [...messageList.value].reverse()); const messageReverseList = computed(() => [...messageList.value].toReversed());
watchEffect(() => { watchEffect(() => {
if (!data.value) { if (!data.value) {
return; return;

View File

@@ -57,10 +57,10 @@ export function isContains(hotArea: Rect, point: Point): boolean {
*/ */
export function createRect(a: Point, b: Point): Rect { export function createRect(a: Point, b: Point): Rect {
// 计算矩形的范围 // 计算矩形的范围
let [left, left2] = [a.x, b.x].sort(); let [left, left2] = [a.x, b.x].toSorted();
left = left ?? 0; left = left ?? 0;
left2 = left2 ?? 0; left2 = left2 ?? 0;
let [top, top2] = [a.y, b.y].sort(); let [top, top2] = [a.y, b.y].toSorted();
top = top ?? 0; top = top ?? 0;
top2 = top2 ?? 0; top2 = top2 ?? 0;
const right = left2 + 1; const right = left2 + 1;

View File

@@ -111,20 +111,22 @@ const [Modal, modalApi] = useVbenModal({
if (data.row?.id) { if (data.row?.id) {
// 编辑:加载数据 // 编辑:加载数据
const rowData = data.row; const rowData = data.row;
const formValues: any = { ...rowData }; const formValues: any = {
formValues.reply = { ...rowData,
type: rowData.responseMessageType, reply: {
accountId: data.accountId || -1, type: rowData.responseMessageType,
content: rowData.responseContent, accountId: data.accountId || -1,
mediaId: rowData.responseMediaId, content: rowData.responseContent,
url: rowData.responseMediaUrl, mediaId: rowData.responseMediaId,
title: rowData.responseTitle, url: rowData.responseMediaUrl,
description: rowData.responseDescription, title: rowData.responseTitle,
thumbMediaId: rowData.responseThumbMediaId, description: rowData.responseDescription,
thumbMediaUrl: rowData.responseThumbMediaUrl, thumbMediaId: rowData.responseThumbMediaId,
articles: rowData.responseArticles, thumbMediaUrl: rowData.responseThumbMediaUrl,
musicUrl: rowData.responseMusicUrl, articles: rowData.responseArticles,
hqMusicUrl: rowData.responseHqMusicUrl, musicUrl: rowData.responseMusicUrl,
hqMusicUrl: rowData.responseHqMusicUrl,
},
}; };
await formApi.setValues(formValues); await formApi.setValues(formValues);
} else { } else {

View File

@@ -106,7 +106,7 @@ async function getPage(page: any, params: any = null) {
const scrollHeight = msgDivRef.value?.scrollHeight ?? 0; const scrollHeight = msgDivRef.value?.scrollHeight ?? 0;
// 处理数据 // 处理数据
const data = dataTemp.list.reverse(); const data = dataTemp.list.toReversed();
list.value = [...data, ...list.value]; list.value = [...data, ...list.value];
loading.value = false; loading.value = false;
if (data.length < queryParams.pageSize || data.length === 0) { if (data.length < queryParams.pageSize || data.length === 0) {

View File

@@ -134,20 +134,20 @@ function menuListToFrontend(list: any[]) {
list.forEach((item: RawMenu) => { list.forEach((item: RawMenu) => {
const menu: any = { const menu: any = {
...item, ...item,
}; reply: {
menu.reply = { type: item.replyMessageType,
type: item.replyMessageType, accountId: item.accountId,
accountId: item.accountId, content: item.replyContent,
content: item.replyContent, mediaId: item.replyMediaId,
mediaId: item.replyMediaId, url: item.replyMediaUrl,
url: item.replyMediaUrl, title: item.replyTitle,
title: item.replyTitle, description: item.replyDescription,
description: item.replyDescription, thumbMediaId: item.replyThumbMediaId,
thumbMediaId: item.replyThumbMediaId, thumbMediaUrl: item.replyThumbMediaUrl,
thumbMediaUrl: item.replyThumbMediaUrl, articles: item.replyArticles,
articles: item.replyArticles, musicUrl: item.replyMusicUrl,
musicUrl: item.replyMusicUrl, hqMusicUrl: item.replyHqMusicUrl,
hqMusicUrl: item.replyHqMusicUrl, },
}; };
result.push(menu as RawMenu); result.push(menu as RawMenu);
}); });
@@ -277,18 +277,18 @@ function menuToBackend(menu: any) {
...menu, ...menu,
children: undefined, // 不处理子节点 children: undefined, // 不处理子节点
reply: undefined, // 稍后复制 reply: undefined, // 稍后复制
replyMessageType: menu.reply.type,
replyContent: menu.reply.content,
replyMediaId: menu.reply.mediaId,
replyMediaUrl: menu.reply.url,
replyTitle: menu.reply.title,
replyDescription: menu.reply.description,
replyThumbMediaId: menu.reply.thumbMediaId,
replyThumbMediaUrl: menu.reply.thumbMediaUrl,
replyArticles: menu.reply.articles,
replyMusicUrl: menu.reply.musicUrl,
replyHqMusicUrl: menu.reply.hqMusicUrl,
}; };
result.replyMessageType = menu.reply.type;
result.replyContent = menu.reply.content;
result.replyMediaId = menu.reply.mediaId;
result.replyMediaUrl = menu.reply.url;
result.replyTitle = menu.reply.title;
result.replyDescription = menu.reply.description;
result.replyThumbMediaId = menu.reply.thumbMediaId;
result.replyThumbMediaUrl = menu.reply.thumbMediaUrl;
result.replyArticles = menu.reply.articles;
result.replyMusicUrl = menu.reply.musicUrl;
result.replyHqMusicUrl = menu.reply.hqMusicUrl;
return result; return result;
} }
// TODO @hwantd 和 ele 版本,基本没用自定义组件,他们的 tindwind 需要进一步对齐么?(主要还是考虑维护性哈。) // TODO @hwantd 和 ele 版本,基本没用自定义组件,他们的 tindwind 需要进一步对齐么?(主要还是考虑维护性哈。)

View File

@@ -256,9 +256,7 @@ export function useAppFormSchema(): VbenFormSchema[] {
/** 渠道新增/修改的表单 */ /** 渠道新增/修改的表单 */
export function useChannelFormSchema(formType: string = ''): VbenFormSchema[] { export function useChannelFormSchema(formType: string = ''): VbenFormSchema[] {
const schema: VbenFormSchema[] = []; const schema: VbenFormSchema[] = [
// 添加通用字段
schema.push(
{ {
component: 'Input', component: 'Input',
fieldName: 'id', fieldName: 'id',
@@ -307,7 +305,8 @@ export function useChannelFormSchema(formType: string = ''): VbenFormSchema[] {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
}, },
}, },
); ];
// 添加通用字段
// 根据类型添加特定字段 // 根据类型添加特定字段
if (formType.includes('alipay_')) { if (formType.includes('alipay_')) {
schema.push( schema.push(
@@ -402,7 +401,10 @@ export function useChannelFormSchema(formType: string = ''): VbenFormSchema[] {
fieldName: 'config.appCertContent', fieldName: 'config.appCertContent',
component: h(InputUpload, { component: h(InputUpload, {
inputType: 'textarea', inputType: 'textarea',
textareaProps: { rows: 3, placeholder: '请上传商户公钥应用证书' }, textareaProps: {
rows: 3,
placeholder: '请上传商户公钥应用证书',
},
fileUploadProps: { fileUploadProps: {
accept: ['crt'], accept: ['crt'],
}, },

View File

@@ -1,6 +1,4 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { UploadRawFile } from 'element-plus';
import { useVbenModal } from '@vben/common-ui'; import { useVbenModal } from '@vben/common-ui';
import { downloadFileFromBlobPart } from '@vben/utils'; import { downloadFileFromBlobPart } from '@vben/utils';

View File

@@ -123,7 +123,7 @@ getDetail();
<template> <template>
<Page auto-content-height v-loading="loading"> <Page auto-content-height v-loading="loading">
<div class="bg-card flex h-[95%] flex-col rounded-md p-4"> <div class="flex h-[95%] flex-col rounded-md bg-card p-4">
<NSteps :current="currentStep" class="mb-8 rounded shadow-sm"> <NSteps :current="currentStep" class="mb-8 rounded shadow-sm">
<NStep v-for="step in steps" :key="step.key" :title="step.title" /> <NStep v-for="step in steps" :key="step.key" :title="step.title" />
</NSteps> </NSteps>

View File

@@ -48,7 +48,7 @@ const { status, data, send, close, open } = useWebSocket(server.value, {
const messageList = ref( const messageList = ref(
[] as { text: string; time: number; type?: string; userId?: string }[], [] as { text: string; time: number; type?: string; userId?: string }[],
); // 消息列表 ); // 消息列表
const messageReverseList = computed(() => [...messageList.value].reverse()); const messageReverseList = computed(() => [...messageList.value].toReversed());
watchEffect(() => { watchEffect(() => {
if (!data.value) { if (!data.value) {
return; return;

View File

@@ -47,7 +47,7 @@ const { status, data, send, close, open } = useWebSocket(server.value, {
const messageList = ref( const messageList = ref(
[] as { text: string; time: number; type?: string; userId?: string }[], [] as { text: string; time: number; type?: string; userId?: string }[],
); // 消息列表 ); // 消息列表
const messageReverseList = computed(() => [...messageList.value].reverse()); const messageReverseList = computed(() => [...messageList.value].toReversed());
watchEffect(() => { watchEffect(() => {
if (!data.value) { if (!data.value) {
return; return;