fix: lint
This commit is contained in:
@@ -90,7 +90,7 @@ export const useMallKefuStore = defineStore('mall-kefu', {
|
||||
},
|
||||
conversationSort() {
|
||||
// 按置顶属性和最后消息时间排序
|
||||
this.conversationList.sort((a, b) => {
|
||||
this.conversationList.toSorted((a, b) => {
|
||||
// 按照置顶排序,置顶的会在前面
|
||||
if (a.adminPinned !== b.adminPinned) {
|
||||
return a.adminPinned ? -1 : 1;
|
||||
|
||||
@@ -90,7 +90,7 @@ async function getChatConversationList() {
|
||||
// 1.1 获取 对话数据
|
||||
conversationList.value = await getChatConversationMyList();
|
||||
// 1.2 排序
|
||||
conversationList.value.sort((a, b) => {
|
||||
conversationList.value.toSorted((a, b) => {
|
||||
return Number(b.createTime) - Number(a.createTime);
|
||||
});
|
||||
// 1.3 没有任何对话情况
|
||||
|
||||
@@ -13,7 +13,6 @@ import {
|
||||
getChatRole,
|
||||
updateChatRole,
|
||||
} from '#/api/ai/model/chatRole';
|
||||
import {} from '#/api/bpm/model';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
@@ -9,7 +9,6 @@ import { message } from 'ant-design-vue';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { createModel, getModel, updateModel } from '#/api/ai/model/model';
|
||||
import {} from '#/api/bpm/model';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
@@ -17,7 +17,7 @@ const currentSong = ref({}); // 当前音乐
|
||||
const mySongList = ref<Recordable<any>[]>([]);
|
||||
const squareSongList = ref<Recordable<any>[]>([]);
|
||||
|
||||
function generateMusic(formData: Recordable<any>) {
|
||||
function generateMusic(_formData: Recordable<any>) {
|
||||
loading.value = true;
|
||||
setTimeout(() => {
|
||||
mySongList.value = Array.from({ length: 20 }, (_, index) => {
|
||||
|
||||
@@ -257,7 +257,7 @@ defineExpose({ validate });
|
||||
</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">
|
||||
<h3>运行结果</h3>
|
||||
|
||||
@@ -62,16 +62,16 @@ const resetElement = () => {
|
||||
bpmnInstances().moddle.create('bpmn:ExtensionElements', { values: [] });
|
||||
|
||||
// 是否开启自定义用户任务超时处理
|
||||
boundaryEventType.value = elExtensionElements.value.values?.filter(
|
||||
boundaryEventType.value = elExtensionElements.value.values?.find(
|
||||
(ex: any) => ex.$type === `${prefix}:BoundaryEventType`,
|
||||
)?.[0];
|
||||
);
|
||||
if (boundaryEventType.value && boundaryEventType.value.value === 1) {
|
||||
timeoutHandlerEnable.value = true;
|
||||
configExtensions.value.push(boundaryEventType.value);
|
||||
}
|
||||
|
||||
// 执行动作
|
||||
timeoutHandlerType.value = elExtensionElements.value.values?.filter(
|
||||
timeoutHandlerType.value = elExtensionElements.value.values?.find(
|
||||
(ex: any) => ex.$type === `${prefix}:TimeoutHandlerType`,
|
||||
)?.[0];
|
||||
if (timeoutHandlerType.value) {
|
||||
|
||||
@@ -112,7 +112,7 @@ const resetCustomConfigList = () => {
|
||||
|
||||
// 审批类型
|
||||
approveType.value =
|
||||
elExtensionElements.value.values?.filter(
|
||||
elExtensionElements.value.values?.find(
|
||||
(ex: any) => ex.$type === `${prefix}:ApproveType`,
|
||||
)?.[0] ||
|
||||
bpmnInstances().moddle.create(`${prefix}:ApproveType`, {
|
||||
@@ -121,7 +121,7 @@ const resetCustomConfigList = () => {
|
||||
|
||||
// 审批人与提交人为同一人时
|
||||
assignStartUserHandlerTypeEl.value =
|
||||
elExtensionElements.value.values?.filter(
|
||||
elExtensionElements.value.values?.find(
|
||||
(ex: any) => ex.$type === `${prefix}:AssignStartUserHandlerType`,
|
||||
)?.[0] ||
|
||||
bpmnInstances().moddle.create(`${prefix}:AssignStartUserHandlerType`, {
|
||||
@@ -131,13 +131,13 @@ const resetCustomConfigList = () => {
|
||||
|
||||
// 审批人拒绝时
|
||||
rejectHandlerTypeEl.value =
|
||||
elExtensionElements.value.values?.filter(
|
||||
elExtensionElements.value.values?.find(
|
||||
(ex: any) => ex.$type === `${prefix}:RejectHandlerType`,
|
||||
)?.[0] ||
|
||||
bpmnInstances().moddle.create(`${prefix}:RejectHandlerType`, { value: 1 });
|
||||
rejectHandlerType.value = rejectHandlerTypeEl.value.value;
|
||||
returnNodeIdEl.value =
|
||||
elExtensionElements.value.values?.filter(
|
||||
elExtensionElements.value.values?.find(
|
||||
(ex: any) => ex.$type === `${prefix}:RejectReturnTaskId`,
|
||||
)?.[0] ||
|
||||
bpmnInstances().moddle.create(`${prefix}:RejectReturnTaskId`, {
|
||||
@@ -147,7 +147,7 @@ const resetCustomConfigList = () => {
|
||||
|
||||
// 审批人为空时
|
||||
assignEmptyHandlerTypeEl.value =
|
||||
elExtensionElements.value.values?.filter(
|
||||
elExtensionElements.value.values?.find(
|
||||
(ex: any) => ex.$type === `${prefix}:AssignEmptyHandlerType`,
|
||||
)?.[0] ||
|
||||
bpmnInstances().moddle.create(`${prefix}:AssignEmptyHandlerType`, {
|
||||
@@ -155,7 +155,7 @@ const resetCustomConfigList = () => {
|
||||
});
|
||||
assignEmptyHandlerType.value = assignEmptyHandlerTypeEl.value.value;
|
||||
assignEmptyUserIdsEl.value =
|
||||
elExtensionElements.value.values?.filter(
|
||||
elExtensionElements.value.values?.find(
|
||||
(ex: any) => ex.$type === `${prefix}:AssignEmptyUserIds`,
|
||||
)?.[0] ||
|
||||
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`,
|
||||
);
|
||||
if (buttonsSettingEl.value.length === 0) {
|
||||
@@ -189,7 +189,7 @@ const resetCustomConfigList = () => {
|
||||
|
||||
// 字段权限
|
||||
if (formType.value === BpmModelFormType.NORMAL) {
|
||||
const fieldsPermissionList = elExtensionElements.value.values?.filter(
|
||||
const fieldsPermissionList = elExtensionElements.value.values?.find(
|
||||
(ex: any) => ex.$type === `${prefix}:FieldsPermission`,
|
||||
);
|
||||
fieldsPermissionEl.value = [];
|
||||
@@ -206,21 +206,21 @@ const resetCustomConfigList = () => {
|
||||
|
||||
// 是否需要签名
|
||||
signEnable.value =
|
||||
elExtensionElements.value.values?.filter(
|
||||
elExtensionElements.value.values?.find(
|
||||
(ex: any) => ex.$type === `${prefix}:SignEnable`,
|
||||
)?.[0] ||
|
||||
) ||
|
||||
bpmnInstances().moddle.create(`${prefix}:SignEnable`, { value: false });
|
||||
|
||||
// 审批意见
|
||||
reasonRequire.value =
|
||||
elExtensionElements.value.values?.filter(
|
||||
elExtensionElements.value.values?.find(
|
||||
(ex: any) => ex.$type === `${prefix}:ReasonRequire`,
|
||||
)?.[0] ||
|
||||
) ||
|
||||
bpmnInstances().moddle.create(`${prefix}:ReasonRequire`, { value: false });
|
||||
|
||||
// 保留剩余扩展元素,便于后面更新该元素对应属性
|
||||
otherExtensions.value =
|
||||
elExtensionElements.value.values?.filter(
|
||||
elExtensionElements.value.values?.find(
|
||||
(ex: any) =>
|
||||
ex.$type !== `${prefix}:AssignStartUserHandlerType` &&
|
||||
ex.$type !== `${prefix}:RejectHandlerType` &&
|
||||
|
||||
@@ -118,10 +118,10 @@ const resetTaskForm = () => {
|
||||
const extensionElements =
|
||||
businessObject?.extensionElements ??
|
||||
bpmnInstances().moddle.create('bpmn:ExtensionElements', { values: [] });
|
||||
userTaskForm.value.candidateStrategy = extensionElements.values?.filter(
|
||||
userTaskForm.value.candidateStrategy = extensionElements.values?.find(
|
||||
(ex: any) => ex.$type === `${prefix}:CandidateStrategy`,
|
||||
)?.[0]?.value;
|
||||
const candidateParamStr = extensionElements.values?.filter(
|
||||
const candidateParamStr = extensionElements.values?.find(
|
||||
(ex: any) => ex.$type === `${prefix}:CandidateParam`,
|
||||
)?.[0]?.value;
|
||||
if (candidateParamStr && candidateParamStr.length > 0) {
|
||||
|
||||
@@ -112,7 +112,7 @@ function setDuration(type, val) {
|
||||
// 组装ISO 8601字符串
|
||||
let d = isoDuration.value;
|
||||
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 {
|
||||
d += val + type;
|
||||
}
|
||||
|
||||
@@ -82,10 +82,12 @@ export function updateElementExtensions(element, extensionList) {
|
||||
}
|
||||
|
||||
// 创建一个id
|
||||
export function uuid(length = 8, chars?) {
|
||||
export function uuid(
|
||||
length = 8,
|
||||
charsString = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
||||
) {
|
||||
let result = '';
|
||||
const charsString =
|
||||
chars || '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
|
||||
for (let i = length; i > 0; --i) {
|
||||
result += charsString[Math.floor(Math.random() * charsString.length)];
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
|
||||
return {
|
||||
dataset: {
|
||||
dimensions: ['nickname', 'count'],
|
||||
source: cloneDeep(res).reverse(),
|
||||
source: cloneDeep(res).toReversed(),
|
||||
},
|
||||
grid: {
|
||||
left: 20,
|
||||
@@ -54,7 +54,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
|
||||
return {
|
||||
dataset: {
|
||||
dimensions: ['nickname', 'count'],
|
||||
source: cloneDeep(res).reverse(),
|
||||
source: cloneDeep(res).toReversed(),
|
||||
},
|
||||
grid: {
|
||||
left: 20,
|
||||
@@ -102,7 +102,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
|
||||
return {
|
||||
dataset: {
|
||||
dimensions: ['nickname', 'count'],
|
||||
source: cloneDeep(res).reverse(),
|
||||
source: cloneDeep(res).toReversed(),
|
||||
},
|
||||
grid: {
|
||||
left: 20,
|
||||
@@ -150,7 +150,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
|
||||
return {
|
||||
dataset: {
|
||||
dimensions: ['nickname', 'count'],
|
||||
source: cloneDeep(res).reverse(),
|
||||
source: cloneDeep(res).toReversed(),
|
||||
},
|
||||
grid: {
|
||||
left: 20,
|
||||
@@ -198,7 +198,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
|
||||
return {
|
||||
dataset: {
|
||||
dimensions: ['nickname', 'count'],
|
||||
source: cloneDeep(res).reverse(),
|
||||
source: cloneDeep(res).toReversed(),
|
||||
},
|
||||
grid: {
|
||||
left: 20,
|
||||
@@ -246,7 +246,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
|
||||
return {
|
||||
dataset: {
|
||||
dimensions: ['nickname', 'count'],
|
||||
source: cloneDeep(res).reverse(),
|
||||
source: cloneDeep(res).toReversed(),
|
||||
},
|
||||
grid: {
|
||||
left: 20,
|
||||
@@ -294,7 +294,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
|
||||
return {
|
||||
dataset: {
|
||||
dimensions: ['nickname', 'count'],
|
||||
source: cloneDeep(res).reverse(),
|
||||
source: cloneDeep(res).toReversed(),
|
||||
},
|
||||
grid: {
|
||||
left: 20,
|
||||
@@ -342,7 +342,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
|
||||
return {
|
||||
dataset: {
|
||||
dimensions: ['nickname', 'count'],
|
||||
source: cloneDeep(res).reverse(),
|
||||
source: cloneDeep(res).toReversed(),
|
||||
},
|
||||
grid: {
|
||||
left: 20,
|
||||
|
||||
@@ -154,6 +154,7 @@ function handleOpenSaleReturn() {
|
||||
}
|
||||
|
||||
function handleAddSaleReturn(rows: ErpSaleReturnApi.SaleReturn[]) {
|
||||
// TODO 芋艿
|
||||
rows.forEach((row) => {
|
||||
const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = {
|
||||
bizId: row.id,
|
||||
|
||||
@@ -47,7 +47,7 @@ const { status, data, send, close, open } = useWebSocket(server.value, {
|
||||
const messageList = ref(
|
||||
[] as { text: string; time: number; type?: string; userId?: string }[],
|
||||
); // 消息列表
|
||||
const messageReverseList = computed(() => [...messageList.value].reverse());
|
||||
const messageReverseList = computed(() => [...messageList.value].toReversed());
|
||||
watchEffect(() => {
|
||||
if (!data.value) {
|
||||
return;
|
||||
|
||||
@@ -22,8 +22,7 @@ import {
|
||||
|
||||
import { getLatestDeviceProperties } from '#/api/iot/device/device';
|
||||
|
||||
import DeviceDetailsThingModelPropertyHistory
|
||||
from './device-details-thing-model-property-history.vue';
|
||||
import DeviceDetailsThingModelPropertyHistory from './device-details-thing-model-property-history.vue';
|
||||
|
||||
const props = defineProps<{ deviceId: number }>();
|
||||
|
||||
@@ -168,13 +167,13 @@ onMounted(() => {
|
||||
>
|
||||
<!-- 添加渐变背景层 -->
|
||||
<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 class="relative p-4">
|
||||
<!-- 标题区域 -->
|
||||
<div class="mb-3 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 class="flex-1 text-base font-bold">{{ item.name }}</div>
|
||||
<!-- 标识符 -->
|
||||
@@ -198,7 +197,7 @@ onMounted(() => {
|
||||
>
|
||||
<IconifyIcon
|
||||
icon="ep:data-line"
|
||||
class="text-primary text-lg"
|
||||
class="text-lg text-primary"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -206,14 +205,14 @@ onMounted(() => {
|
||||
<!-- 信息区域 -->
|
||||
<div class="text-sm">
|
||||
<div class="mb-2.5 last:mb-0">
|
||||
<span class="text-muted-foreground mr-2.5">属性值</span>
|
||||
<span class="text-foreground font-bold">
|
||||
<span class="mr-2.5 text-muted-foreground">属性值</span>
|
||||
<span class="font-bold text-foreground">
|
||||
{{ formatValueWithUnit(item) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb-2.5 last:mb-0">
|
||||
<span class="text-muted-foreground mr-2.5">更新时间</span>
|
||||
<span class="text-foreground text-sm">
|
||||
<span class="mr-2.5 text-muted-foreground">更新时间</span>
|
||||
<span class="text-sm text-foreground">
|
||||
{{ item.updateTime ? formatDate(item.updateTime) : '-' }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
<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 DeviceStateCountCard from './modules/device-state-count-card.vue';
|
||||
import MessageTrendCard from './modules/message-trend-card.vue';
|
||||
|
||||
@@ -135,7 +135,8 @@ function handleDeviceChange(_: any) {
|
||||
|
||||
/**
|
||||
* 处理属性变化事件
|
||||
* @param propertyInfo 属性信息对象
|
||||
* @param propertyInfo.config 属性配置
|
||||
* @param propertyInfo.type 属性类型
|
||||
*/
|
||||
function handlePropertyChange(propertyInfo: { config: any; type: string }) {
|
||||
propertyType.value = propertyInfo.type;
|
||||
|
||||
@@ -126,7 +126,8 @@ function validateSku() {
|
||||
/**
|
||||
* 选择时触发
|
||||
*
|
||||
* @param records 传递过来的选中的 sku 是一个数组
|
||||
* @param {object} param0 参数对象
|
||||
* @param {MallSpuApi.Sku[]} param0.records 传递过来的选中的 sku 是一个数组
|
||||
*/
|
||||
function handleSelectionChange({ records }: { records: MallSpuApi.Sku[] }) {
|
||||
emit('selectionChange', records);
|
||||
|
||||
@@ -99,8 +99,8 @@ function handleAppLinkSelected(appLink: AppLink) {
|
||||
/**
|
||||
* 处理右侧链接列表滚动
|
||||
*
|
||||
* @param {object} param0 滚动事件参数
|
||||
* @param {number} param0.scrollTop 滚动条的位置
|
||||
* @param {Event} event 滚动事件
|
||||
* @param {number} event.target.scrollTop 滚动条的位置
|
||||
*/
|
||||
function handleScroll(event: Event) {
|
||||
const scrollTop = (event.target as HTMLDivElement).scrollTop;
|
||||
|
||||
@@ -57,10 +57,10 @@ export function isContains(hotArea: Rect, point: Point): boolean {
|
||||
*/
|
||||
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;
|
||||
left2 = left2 ?? 0;
|
||||
let [top, top2] = [a.y, b.y].sort();
|
||||
let [top, top2] = [a.y, b.y].toSorted();
|
||||
top = top ?? 0;
|
||||
top2 = top2 ?? 0;
|
||||
const right = left2 + 1;
|
||||
|
||||
@@ -111,20 +111,22 @@ const [Modal, modalApi] = useVbenModal({
|
||||
if (data.row?.id) {
|
||||
// 编辑:加载数据
|
||||
const rowData = data.row;
|
||||
const formValues: any = { ...rowData };
|
||||
formValues.reply = {
|
||||
type: rowData.responseMessageType,
|
||||
accountId: data.accountId || -1,
|
||||
content: rowData.responseContent,
|
||||
mediaId: rowData.responseMediaId,
|
||||
url: rowData.responseMediaUrl,
|
||||
title: rowData.responseTitle,
|
||||
description: rowData.responseDescription,
|
||||
thumbMediaId: rowData.responseThumbMediaId,
|
||||
thumbMediaUrl: rowData.responseThumbMediaUrl,
|
||||
articles: rowData.responseArticles,
|
||||
musicUrl: rowData.responseMusicUrl,
|
||||
hqMusicUrl: rowData.responseHqMusicUrl,
|
||||
const formValues: any = {
|
||||
...rowData,
|
||||
reply: {
|
||||
type: rowData.responseMessageType,
|
||||
accountId: data.accountId || -1,
|
||||
content: rowData.responseContent,
|
||||
mediaId: rowData.responseMediaId,
|
||||
url: rowData.responseMediaUrl,
|
||||
title: rowData.responseTitle,
|
||||
description: rowData.responseDescription,
|
||||
thumbMediaId: rowData.responseThumbMediaId,
|
||||
thumbMediaUrl: rowData.responseThumbMediaUrl,
|
||||
articles: rowData.responseArticles,
|
||||
musicUrl: rowData.responseMusicUrl,
|
||||
hqMusicUrl: rowData.responseHqMusicUrl,
|
||||
},
|
||||
};
|
||||
await formApi.setValues(formValues);
|
||||
} else {
|
||||
|
||||
@@ -106,7 +106,7 @@ async function getPage(page: any, params: any = null) {
|
||||
|
||||
const scrollHeight = msgDivRef.value?.scrollHeight ?? 0;
|
||||
// 处理数据
|
||||
const data = dataTemp.list.reverse();
|
||||
const data = dataTemp.list.toReversed();
|
||||
list.value = [...data, ...list.value];
|
||||
loading.value = false;
|
||||
if (data.length < queryParams.pageSize || data.length === 0) {
|
||||
|
||||
@@ -134,20 +134,20 @@ function menuListToFrontend(list: any[]) {
|
||||
list.forEach((item: RawMenu) => {
|
||||
const menu: any = {
|
||||
...item,
|
||||
};
|
||||
menu.reply = {
|
||||
type: item.replyMessageType,
|
||||
accountId: item.accountId,
|
||||
content: item.replyContent,
|
||||
mediaId: item.replyMediaId,
|
||||
url: item.replyMediaUrl,
|
||||
title: item.replyTitle,
|
||||
description: item.replyDescription,
|
||||
thumbMediaId: item.replyThumbMediaId,
|
||||
thumbMediaUrl: item.replyThumbMediaUrl,
|
||||
articles: item.replyArticles,
|
||||
musicUrl: item.replyMusicUrl,
|
||||
hqMusicUrl: item.replyHqMusicUrl,
|
||||
reply: {
|
||||
type: item.replyMessageType,
|
||||
accountId: item.accountId,
|
||||
content: item.replyContent,
|
||||
mediaId: item.replyMediaId,
|
||||
url: item.replyMediaUrl,
|
||||
title: item.replyTitle,
|
||||
description: item.replyDescription,
|
||||
thumbMediaId: item.replyThumbMediaId,
|
||||
thumbMediaUrl: item.replyThumbMediaUrl,
|
||||
articles: item.replyArticles,
|
||||
musicUrl: item.replyMusicUrl,
|
||||
hqMusicUrl: item.replyHqMusicUrl,
|
||||
},
|
||||
};
|
||||
result.push(menu as RawMenu);
|
||||
});
|
||||
@@ -275,23 +275,22 @@ function menuListToBackend() {
|
||||
/** 将前端的 menu,转换成后端接收的 menu */
|
||||
// TODO: @芋艿,需要根据后台 API 删除不需要的字段
|
||||
function menuToBackend(menu: any) {
|
||||
const result = {
|
||||
return {
|
||||
...menu,
|
||||
children: 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>
|
||||
|
||||
|
||||
@@ -258,9 +258,7 @@ export function useAppFormSchema(): VbenFormSchema[] {
|
||||
|
||||
/** 渠道新增/修改的表单 */
|
||||
export function useChannelFormSchema(formType: string = ''): VbenFormSchema[] {
|
||||
const schema: VbenFormSchema[] = [];
|
||||
// 添加通用字段
|
||||
schema.push(
|
||||
const schema: VbenFormSchema[] = [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'id',
|
||||
@@ -309,7 +307,8 @@ export function useChannelFormSchema(formType: string = ''): VbenFormSchema[] {
|
||||
optionType: 'button',
|
||||
},
|
||||
},
|
||||
);
|
||||
];
|
||||
// 添加通用字段
|
||||
// 根据类型添加特定字段
|
||||
if (formType.includes('alipay_')) {
|
||||
schema.push(
|
||||
|
||||
@@ -80,7 +80,7 @@ export const useMallKefuStore = defineStore('mall-kefu', {
|
||||
},
|
||||
conversationSort() {
|
||||
// 按置顶属性和最后消息时间排序
|
||||
this.conversationList.sort((a, b) => {
|
||||
this.conversationList.toSorted((a, b) => {
|
||||
// 按照置顶排序,置顶的会在前面
|
||||
if (a.adminPinned !== b.adminPinned) {
|
||||
return a.adminPinned ? -1 : 1;
|
||||
|
||||
@@ -97,7 +97,7 @@ async function getChatConversationList() {
|
||||
// 1.1 获取 对话数据
|
||||
conversationList.value = await getChatConversationMyList();
|
||||
// 1.2 排序
|
||||
conversationList.value.sort((a, b) => {
|
||||
conversationList.value.toSorted((a, b) => {
|
||||
return Number(b.createTime) - Number(a.createTime);
|
||||
});
|
||||
// 1.3 没有任何对话情况
|
||||
|
||||
@@ -13,7 +13,6 @@ import {
|
||||
getChatRole,
|
||||
updateChatRole,
|
||||
} from '#/api/ai/model/chatRole';
|
||||
import {} from '#/api/bpm/model';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
@@ -9,7 +9,6 @@ import { ElMessage } from 'element-plus';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { createModel, getModel, updateModel } from '#/api/ai/model/model';
|
||||
import {} from '#/api/bpm/model';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
@@ -17,7 +17,7 @@ const currentSong = ref({}); // 当前音乐
|
||||
const mySongList = ref<Recordable<any>[]>([]);
|
||||
const squareSongList = ref<Recordable<any>[]>([]);
|
||||
|
||||
function generateMusic(formData: Recordable<any>) {
|
||||
function generateMusic(_formData: Recordable<any>) {
|
||||
loading.value = true;
|
||||
setTimeout(() => {
|
||||
mySongList.value = Array.from({ length: 20 }, (_, index) => {
|
||||
|
||||
@@ -6,7 +6,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
|
||||
return {
|
||||
dataset: {
|
||||
dimensions: ['nickname', 'count'],
|
||||
source: cloneDeep(res).reverse(),
|
||||
source: cloneDeep(res).toReversed(),
|
||||
},
|
||||
grid: {
|
||||
left: 20,
|
||||
@@ -54,7 +54,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
|
||||
return {
|
||||
dataset: {
|
||||
dimensions: ['nickname', 'count'],
|
||||
source: cloneDeep(res).reverse(),
|
||||
source: cloneDeep(res).toReversed(),
|
||||
},
|
||||
grid: {
|
||||
left: 20,
|
||||
@@ -102,7 +102,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
|
||||
return {
|
||||
dataset: {
|
||||
dimensions: ['nickname', 'count'],
|
||||
source: cloneDeep(res).reverse(),
|
||||
source: cloneDeep(res).toReversed(),
|
||||
},
|
||||
grid: {
|
||||
left: 20,
|
||||
@@ -150,7 +150,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
|
||||
return {
|
||||
dataset: {
|
||||
dimensions: ['nickname', 'count'],
|
||||
source: cloneDeep(res).reverse(),
|
||||
source: cloneDeep(res).toReversed(),
|
||||
},
|
||||
grid: {
|
||||
left: 20,
|
||||
@@ -198,7 +198,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
|
||||
return {
|
||||
dataset: {
|
||||
dimensions: ['nickname', 'count'],
|
||||
source: cloneDeep(res).reverse(),
|
||||
source: cloneDeep(res).toReversed(),
|
||||
},
|
||||
grid: {
|
||||
left: 20,
|
||||
@@ -246,7 +246,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
|
||||
return {
|
||||
dataset: {
|
||||
dimensions: ['nickname', 'count'],
|
||||
source: cloneDeep(res).reverse(),
|
||||
source: cloneDeep(res).toReversed(),
|
||||
},
|
||||
grid: {
|
||||
left: 20,
|
||||
@@ -294,7 +294,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
|
||||
return {
|
||||
dataset: {
|
||||
dimensions: ['nickname', 'count'],
|
||||
source: cloneDeep(res).reverse(),
|
||||
source: cloneDeep(res).toReversed(),
|
||||
},
|
||||
grid: {
|
||||
left: 20,
|
||||
@@ -342,7 +342,7 @@ export function getChartOptions(activeTabName: any, res: any): any {
|
||||
return {
|
||||
dataset: {
|
||||
dimensions: ['nickname', 'count'],
|
||||
source: cloneDeep(res).reverse(),
|
||||
source: cloneDeep(res).toReversed(),
|
||||
},
|
||||
grid: {
|
||||
left: 20,
|
||||
|
||||
@@ -86,6 +86,7 @@ watch(
|
||||
|
||||
/** 处理新增 */
|
||||
function handleAdd() {
|
||||
// TODO @芋艿
|
||||
const newRow = {
|
||||
id: undefined,
|
||||
warehouseId: undefined,
|
||||
|
||||
@@ -105,6 +105,7 @@ function handleAdd() {
|
||||
|
||||
/** 处理删除 */
|
||||
function handleDelete(row: ErpStockOutApi.StockOutItem) {
|
||||
// TODO @芋艿
|
||||
const index = tableData.value.findIndex((item) => item.seq === row.seq);
|
||||
if (index !== -1) {
|
||||
tableData.value.splice(index, 1);
|
||||
@@ -271,7 +272,7 @@ onMounted(async () => {
|
||||
</template>
|
||||
|
||||
<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">
|
||||
<span class="text-foreground font-medium">合计:</span>
|
||||
<div class="flex space-x-4">
|
||||
|
||||
@@ -47,7 +47,7 @@ const { status, data, send, close, open } = useWebSocket(server.value, {
|
||||
const messageList = ref(
|
||||
[] as { text: string; time: number; type?: string; userId?: string }[],
|
||||
); // 消息列表
|
||||
const messageReverseList = computed(() => [...messageList.value].reverse());
|
||||
const messageReverseList = computed(() => [...messageList.value].toReversed());
|
||||
watchEffect(() => {
|
||||
if (!data.value) {
|
||||
return;
|
||||
|
||||
@@ -57,10 +57,10 @@ export function isContains(hotArea: Rect, point: Point): boolean {
|
||||
*/
|
||||
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;
|
||||
left2 = left2 ?? 0;
|
||||
let [top, top2] = [a.y, b.y].sort();
|
||||
let [top, top2] = [a.y, b.y].toSorted();
|
||||
top = top ?? 0;
|
||||
top2 = top2 ?? 0;
|
||||
const right = left2 + 1;
|
||||
|
||||
@@ -111,20 +111,22 @@ const [Modal, modalApi] = useVbenModal({
|
||||
if (data.row?.id) {
|
||||
// 编辑:加载数据
|
||||
const rowData = data.row;
|
||||
const formValues: any = { ...rowData };
|
||||
formValues.reply = {
|
||||
type: rowData.responseMessageType,
|
||||
accountId: data.accountId || -1,
|
||||
content: rowData.responseContent,
|
||||
mediaId: rowData.responseMediaId,
|
||||
url: rowData.responseMediaUrl,
|
||||
title: rowData.responseTitle,
|
||||
description: rowData.responseDescription,
|
||||
thumbMediaId: rowData.responseThumbMediaId,
|
||||
thumbMediaUrl: rowData.responseThumbMediaUrl,
|
||||
articles: rowData.responseArticles,
|
||||
musicUrl: rowData.responseMusicUrl,
|
||||
hqMusicUrl: rowData.responseHqMusicUrl,
|
||||
const formValues: any = {
|
||||
...rowData,
|
||||
reply: {
|
||||
type: rowData.responseMessageType,
|
||||
accountId: data.accountId || -1,
|
||||
content: rowData.responseContent,
|
||||
mediaId: rowData.responseMediaId,
|
||||
url: rowData.responseMediaUrl,
|
||||
title: rowData.responseTitle,
|
||||
description: rowData.responseDescription,
|
||||
thumbMediaId: rowData.responseThumbMediaId,
|
||||
thumbMediaUrl: rowData.responseThumbMediaUrl,
|
||||
articles: rowData.responseArticles,
|
||||
musicUrl: rowData.responseMusicUrl,
|
||||
hqMusicUrl: rowData.responseHqMusicUrl,
|
||||
},
|
||||
};
|
||||
await formApi.setValues(formValues);
|
||||
} else {
|
||||
|
||||
@@ -106,7 +106,7 @@ async function getPage(page: any, params: any = null) {
|
||||
|
||||
const scrollHeight = msgDivRef.value?.scrollHeight ?? 0;
|
||||
// 处理数据
|
||||
const data = dataTemp.list.reverse();
|
||||
const data = dataTemp.list.toReversed();
|
||||
list.value = [...data, ...list.value];
|
||||
loading.value = false;
|
||||
if (data.length < queryParams.pageSize || data.length === 0) {
|
||||
|
||||
@@ -134,20 +134,20 @@ function menuListToFrontend(list: any[]) {
|
||||
list.forEach((item: RawMenu) => {
|
||||
const menu: any = {
|
||||
...item,
|
||||
};
|
||||
menu.reply = {
|
||||
type: item.replyMessageType,
|
||||
accountId: item.accountId,
|
||||
content: item.replyContent,
|
||||
mediaId: item.replyMediaId,
|
||||
url: item.replyMediaUrl,
|
||||
title: item.replyTitle,
|
||||
description: item.replyDescription,
|
||||
thumbMediaId: item.replyThumbMediaId,
|
||||
thumbMediaUrl: item.replyThumbMediaUrl,
|
||||
articles: item.replyArticles,
|
||||
musicUrl: item.replyMusicUrl,
|
||||
hqMusicUrl: item.replyHqMusicUrl,
|
||||
reply: {
|
||||
type: item.replyMessageType,
|
||||
accountId: item.accountId,
|
||||
content: item.replyContent,
|
||||
mediaId: item.replyMediaId,
|
||||
url: item.replyMediaUrl,
|
||||
title: item.replyTitle,
|
||||
description: item.replyDescription,
|
||||
thumbMediaId: item.replyThumbMediaId,
|
||||
thumbMediaUrl: item.replyThumbMediaUrl,
|
||||
articles: item.replyArticles,
|
||||
musicUrl: item.replyMusicUrl,
|
||||
hqMusicUrl: item.replyHqMusicUrl,
|
||||
},
|
||||
};
|
||||
result.push(menu as RawMenu);
|
||||
});
|
||||
@@ -277,18 +277,18 @@ function menuToBackend(menu: any) {
|
||||
...menu,
|
||||
children: 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;
|
||||
}
|
||||
// TODO @hw:antd 和 ele 版本,基本没用自定义组件,他们的 tindwind 需要进一步对齐么?(主要还是考虑维护性哈。)
|
||||
|
||||
@@ -256,9 +256,7 @@ export function useAppFormSchema(): VbenFormSchema[] {
|
||||
|
||||
/** 渠道新增/修改的表单 */
|
||||
export function useChannelFormSchema(formType: string = ''): VbenFormSchema[] {
|
||||
const schema: VbenFormSchema[] = [];
|
||||
// 添加通用字段
|
||||
schema.push(
|
||||
const schema: VbenFormSchema[] = [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'id',
|
||||
@@ -307,7 +305,8 @@ export function useChannelFormSchema(formType: string = ''): VbenFormSchema[] {
|
||||
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
|
||||
},
|
||||
},
|
||||
);
|
||||
];
|
||||
// 添加通用字段
|
||||
// 根据类型添加特定字段
|
||||
if (formType.includes('alipay_')) {
|
||||
schema.push(
|
||||
@@ -402,7 +401,10 @@ export function useChannelFormSchema(formType: string = ''): VbenFormSchema[] {
|
||||
fieldName: 'config.appCertContent',
|
||||
component: h(InputUpload, {
|
||||
inputType: 'textarea',
|
||||
textareaProps: { rows: 3, placeholder: '请上传商户公钥应用证书' },
|
||||
textareaProps: {
|
||||
rows: 3,
|
||||
placeholder: '请上传商户公钥应用证书',
|
||||
},
|
||||
fileUploadProps: {
|
||||
accept: ['crt'],
|
||||
},
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
<script lang="ts" setup>
|
||||
import type { UploadRawFile } from 'element-plus';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { downloadFileFromBlobPart } from '@vben/utils';
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ getDetail();
|
||||
|
||||
<template>
|
||||
<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">
|
||||
<NStep v-for="step in steps" :key="step.key" :title="step.title" />
|
||||
</NSteps>
|
||||
|
||||
@@ -48,7 +48,7 @@ const { status, data, send, close, open } = useWebSocket(server.value, {
|
||||
const messageList = ref(
|
||||
[] as { text: string; time: number; type?: string; userId?: string }[],
|
||||
); // 消息列表
|
||||
const messageReverseList = computed(() => [...messageList.value].reverse());
|
||||
const messageReverseList = computed(() => [...messageList.value].toReversed());
|
||||
watchEffect(() => {
|
||||
if (!data.value) {
|
||||
return;
|
||||
|
||||
@@ -47,7 +47,7 @@ const { status, data, send, close, open } = useWebSocket(server.value, {
|
||||
const messageList = ref(
|
||||
[] as { text: string; time: number; type?: string; userId?: string }[],
|
||||
); // 消息列表
|
||||
const messageReverseList = computed(() => [...messageList.value].reverse());
|
||||
const messageReverseList = computed(() => [...messageList.value].toReversed());
|
||||
watchEffect(() => {
|
||||
if (!data.value) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user