diff --git a/src/api/ai/ollama.ts b/src/api/ai/ollama.ts index 03aaf41..48316bc 100644 --- a/src/api/ai/ollama.ts +++ b/src/api/ai/ollama.ts @@ -48,7 +48,9 @@ export async function listOllamaModels(opts?: { baseURL?: string }) { if (!res.ok) { const text = await res.text().catch(() => ''); throw new Error( - `listOllamaModels failed: ${res.status} ${res.statusText}${text ? ` - ${text}` : ''}` + `listOllamaModels failed: ${res.status} ${res.statusText}${ + text ? ` - ${text}` : '' + }` ); } return (await res.json()) as OllamaTagsResponse; @@ -68,7 +70,9 @@ export async function ollamaChat( if (!res.ok) { const text = await res.text().catch(() => ''); throw new Error( - `ollamaChat failed: ${res.status} ${res.statusText}${text ? ` - ${text}` : ''}` + `ollamaChat failed: ${res.status} ${res.statusText}${ + text ? ` - ${text}` : '' + }` ); } return (await res.json()) as OllamaChatResponseChunk; @@ -97,7 +101,9 @@ export async function ollamaChatStream( if (!res.ok || !res.body) { const text = await res.text().catch(() => ''); throw new Error( - `ollamaChatStream failed: ${res.status} ${res.statusText}${text ? ` - ${text}` : ''}` + `ollamaChatStream failed: ${res.status} ${res.statusText}${ + text ? ` - ${text}` : '' + }` ); } @@ -143,4 +149,3 @@ export async function ollamaChatStream( opts.onDone?.(); } - diff --git a/src/api/ai/openai.ts b/src/api/ai/openai.ts index 4ada4fa..59368ca 100644 --- a/src/api/ai/openai.ts +++ b/src/api/ai/openai.ts @@ -71,7 +71,9 @@ export async function listModels(opts?: { apiKey?: string; baseURL?: string }) { if (!res.ok) { const text = await res.text().catch(() => ''); throw new Error( - `listModels failed: ${res.status} ${res.statusText}${text ? ` - ${text}` : ''}` + `listModels failed: ${res.status} ${res.statusText}${ + text ? ` - ${text}` : '' + }` ); } return (await res.json()) as OpenAIListModelsResponse; @@ -91,7 +93,9 @@ export async function chatCompletions( if (!res.ok) { const text = await res.text().catch(() => ''); throw new Error( - `chatCompletions failed: ${res.status} ${res.statusText}${text ? ` - ${text}` : ''}` + `chatCompletions failed: ${res.status} ${res.statusText}${ + text ? ` - ${text}` : '' + }` ); } return (await res.json()) as OpenAIChatCompletionResponse; @@ -124,7 +128,9 @@ export async function chatCompletionsStream( if (!res.ok || !res.body) { const text = await res.text().catch(() => ''); throw new Error( - `chatCompletionsStream failed: ${res.status} ${res.statusText}${text ? ` - ${text}` : ''}` + `chatCompletionsStream failed: ${res.status} ${res.statusText}${ + text ? ` - ${text}` : '' + }` ); } diff --git a/src/views/ai/index.vue b/src/views/ai/index.vue index 372bb75..de84085 100644 --- a/src/views/ai/index.vue +++ b/src/views/ai/index.vue @@ -1,7 +1,6 @@ diff --git a/src/views/shop/shopDealerOrder2/components/search.vue b/src/views/shop/shopDealerOrder2/components/search.vue index a47cc62..74cd0e5 100644 --- a/src/views/shop/shopDealerOrder2/components/search.vue +++ b/src/views/shop/shopDealerOrder2/components/search.vue @@ -14,14 +14,17 @@ diff --git a/src/views/shop/shopDealerOrder2/index.vue b/src/views/shop/shopDealerOrder2/index.vue index c24b12c..dea769b 100644 --- a/src/views/shop/shopDealerOrder2/index.vue +++ b/src/views/shop/shopDealerOrder2/index.vue @@ -21,7 +21,6 @@ /> - - - - - - - - - - - + + + + + + + + + + + - - 删除 - + 删除 @@ -119,363 +122,384 @@ - + diff --git a/src/views/shop/shopDealerUser/components/shopDealerUserEdit.vue b/src/views/shop/shopDealerUser/components/shopDealerUserEdit.vue index 7a995b6..992a6fc 100644 --- a/src/views/shop/shopDealerUser/components/shopDealerUserEdit.vue +++ b/src/views/shop/shopDealerUser/components/shopDealerUserEdit.vue @@ -40,7 +40,7 @@ 经销商 门店 - + @@ -65,20 +65,20 @@ /> - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -144,44 +144,44 @@ /> - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -190,7 +190,10 @@ import { computed, ref, reactive, watch } from 'vue'; import { Form, message } from 'ant-design-vue'; import { assignObject, toDateString, uuid } from 'ele-admin-pro'; - import { addShopDealerUser, updateShopDealerUser } from '@/api/shop/shopDealerUser'; + import { + addShopDealerUser, + updateShopDealerUser + } from '@/api/shop/shopDealerUser'; import { ShopDealerUser } from '@/api/shop/shopDealerUser/model'; import { useThemeStore } from '@/store/modules/theme'; import { storeToRefs } from 'pinia'; @@ -260,11 +263,15 @@ }; const createTimeText = computed(() => { - return form.createTime ? toDateString(form.createTime, 'yyyy-MM-dd HH:mm:ss') : ''; + return form.createTime + ? toDateString(form.createTime, 'yyyy-MM-dd HH:mm:ss') + : ''; }); const updateTimeText = computed(() => { - return form.updateTime ? toDateString(form.updateTime, 'yyyy-MM-dd HH:mm:ss') : ''; + return form.updateTime + ? toDateString(form.updateTime, 'yyyy-MM-dd HH:mm:ss') + : ''; }); const selectedUserText = ref(''); @@ -369,13 +376,7 @@ .then(() => { loading.value = true; // 不在弹窗里编辑的字段不提交,避免误更新(如自增ID、删除标识等) - const { - isDelete, - tenantId, - createTime, - updateTime, - ...rest - } = form; + const { isDelete, tenantId, createTime, updateTime, ...rest } = form; const formData: ShopDealerUser = { ...rest }; // userId 新增需要,编辑不允许修改 if (isUpdate.value) { @@ -385,7 +386,9 @@ if (isUpdate.value && !formData.payPassword) { delete formData.payPassword; } - const saveOrUpdate = isUpdate.value ? updateShopDealerUser : addShopDealerUser; + const saveOrUpdate = isUpdate.value + ? updateShopDealerUser + : addShopDealerUser; saveOrUpdate(formData) .then((msg) => { loading.value = false; @@ -412,12 +415,12 @@ // 不回显密码,避免误操作 form.payPassword = ''; selectedUserText.value = ''; - if(props.data.image){ + if (props.data.image) { images.value.push({ uid: uuid(), url: props.data.image, status: 'done' - }) + }); } isUpdate.value = true; } else { diff --git a/src/views/shop/shopDealerUser/index.vue b/src/views/shop/shopDealerUser/index.vue index 029b225..b4afa0b 100644 --- a/src/views/shop/shopDealerUser/index.vue +++ b/src/views/shop/shopDealerUser/index.vue @@ -1,85 +1,100 @@