Merge pull request 'v1.1.0' (#6) from dev into master
Reviewed-on: #6
This commit was merged in pull request #6.
This commit is contained in:
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "gao-customer-h5",
|
"name": "gao-customer-h5",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.0.3",
|
"version": "1.1.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite --host",
|
"dev": "vite --host",
|
||||||
@@ -30,9 +30,9 @@
|
|||||||
"less": "^4.3.0",
|
"less": "^4.3.0",
|
||||||
"pinia": "^3.0.2",
|
"pinia": "^3.0.2",
|
||||||
"tdesign-mobile-vue": "^1.17.1",
|
"tdesign-mobile-vue": "^1.17.1",
|
||||||
"timi-tdesign-mobile": "^1.0.1",
|
"timi-tdesign-mobile": "^1.0.2",
|
||||||
"timi-ts": "^1.0.0",
|
"timi-ts": "^1.0.0",
|
||||||
"timi-web": "^1.0.1",
|
"timi-web": "^1.0.2",
|
||||||
"timi-web-api": "^1.0.2",
|
"timi-web-api": "^1.0.2",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"vconsole": "^3.15.1",
|
"vconsole": "^3.15.1",
|
||||||
|
|||||||
Generated
+16
-15
@@ -47,17 +47,17 @@ importers:
|
|||||||
specifier: ^1.17.1
|
specifier: ^1.17.1
|
||||||
version: 1.17.1(patch_hash=c98db305008fbfd00046666ca890e1c6cb88257c0619418694689cddf8cd78c3)(vue@3.5.40(typescript@5.8.3))
|
version: 1.17.1(patch_hash=c98db305008fbfd00046666ca890e1c6cb88257c0619418694689cddf8cd78c3)(vue@3.5.40(typescript@5.8.3))
|
||||||
timi-tdesign-mobile:
|
timi-tdesign-mobile:
|
||||||
specifier: ^1.0.1
|
specifier: ^1.0.2
|
||||||
version: 1.0.1(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue-router@4.5.1(vue@3.5.40(typescript@5.8.3)))(vue@3.5.40(typescript@5.8.3))
|
version: 1.0.2(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue-router@4.5.1(vue@3.5.40(typescript@5.8.3)))(vue@3.5.40(typescript@5.8.3))
|
||||||
timi-ts:
|
timi-ts:
|
||||||
specifier: ^1.0.0
|
specifier: ^1.0.0
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
timi-web:
|
timi-web:
|
||||||
specifier: ^1.0.1
|
specifier: ^1.0.2
|
||||||
version: 1.0.1(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3))
|
version: 1.0.2(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3))
|
||||||
timi-web-api:
|
timi-web-api:
|
||||||
specifier: ^1.0.2
|
specifier: ^1.0.2
|
||||||
version: 1.0.2(timi-web@1.0.1(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3)))(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3))
|
version: 1.0.2(timi-web@1.0.2(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3)))(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3))
|
||||||
ts-node:
|
ts-node:
|
||||||
specifier: ^10.9.2
|
specifier: ^10.9.2
|
||||||
version: 10.9.2(@types/node@24.13.3)(typescript@5.8.3)
|
version: 10.9.2(@types/node@24.13.3)(typescript@5.8.3)
|
||||||
@@ -1979,6 +1979,7 @@ packages:
|
|||||||
image-size@0.5.5:
|
image-size@0.5.5:
|
||||||
resolution: {integrity: sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==}
|
resolution: {integrity: sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==}
|
||||||
engines: {node: '>=0.10.0'}
|
engines: {node: '>=0.10.0'}
|
||||||
|
deprecated: Please migrate to image-size@2.x
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
import-fresh@3.3.1:
|
import-fresh@3.3.1:
|
||||||
@@ -2747,8 +2748,8 @@ packages:
|
|||||||
through2@4.0.2:
|
through2@4.0.2:
|
||||||
resolution: {integrity: sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==}
|
resolution: {integrity: sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==}
|
||||||
|
|
||||||
timi-tdesign-mobile@1.0.1:
|
timi-tdesign-mobile@1.0.2:
|
||||||
resolution: {integrity: sha512-HFBENjEw1+zymyaDU7u9ZNZjIqzA8J+9eZHNMGyPd8/zSSsGb9bS1a1r3zDA0Zq7g6WwqQctwaQUO4xkU4gyAw==}
|
resolution: {integrity: sha512-7qjwUUqIjMB9TJbOWguK61JfQ15PLf3gnfUDU1gY2eS4cjbgo/PD2U/eHNV6CZ0VB/hBjPNp84xKZ0qr03tsmw==}
|
||||||
engines: {node: '>=20.0.0'}
|
engines: {node: '>=20.0.0'}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
vue: ^3.5.0
|
vue: ^3.5.0
|
||||||
@@ -2765,8 +2766,8 @@ packages:
|
|||||||
timi-web: ^1.0.0
|
timi-web: ^1.0.0
|
||||||
vue: ^3.5.26
|
vue: ^3.5.26
|
||||||
|
|
||||||
timi-web@1.0.1:
|
timi-web@1.0.2:
|
||||||
resolution: {integrity: sha512-FVPQuqTc3DurS3Gfty9ZQoNZ7vyQ0v6xj0g/iouFgxFqNuzjzUNn3PA/Tl58nJcRrUNv3S/uofMMkNRmw/cUYg==}
|
resolution: {integrity: sha512-CXyWEeGTjrExnrAwstdWPc3qK5Lfyp7ipD8p7+WYcm4mcnJOS48k6SkVnrAIADAImeJAr/1e5JEV8wk+8AcvxQ==}
|
||||||
engines: {node: '>=20.0.0'}
|
engines: {node: '>=20.0.0'}
|
||||||
|
|
||||||
tinycolor2@1.6.0:
|
tinycolor2@1.6.0:
|
||||||
@@ -3125,7 +3126,7 @@ snapshots:
|
|||||||
'@babel/helper-module-imports@7.29.7':
|
'@babel/helper-module-imports@7.29.7':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/traverse': 7.29.13
|
'@babel/traverse': 7.29.13
|
||||||
'@babel/types': 7.29.7
|
'@babel/types': 7.29.11
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
@@ -5848,10 +5849,10 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
readable-stream: 3.6.2
|
readable-stream: 3.6.2
|
||||||
|
|
||||||
timi-tdesign-mobile@1.0.1(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue-router@4.5.1(vue@3.5.40(typescript@5.8.3)))(vue@3.5.40(typescript@5.8.3)):
|
timi-tdesign-mobile@1.0.2(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue-router@4.5.1(vue@3.5.40(typescript@5.8.3)))(vue@3.5.40(typescript@5.8.3)):
|
||||||
dependencies:
|
dependencies:
|
||||||
tdesign-mobile-vue: 1.17.1(patch_hash=c98db305008fbfd00046666ca890e1c6cb88257c0619418694689cddf8cd78c3)(vue@3.5.40(typescript@5.8.3))
|
tdesign-mobile-vue: 1.17.1(patch_hash=c98db305008fbfd00046666ca890e1c6cb88257c0619418694689cddf8cd78c3)(vue@3.5.40(typescript@5.8.3))
|
||||||
timi-web: 1.0.1(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3))
|
timi-web: 1.0.2(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3))
|
||||||
vue: 3.5.40(typescript@5.8.3)
|
vue: 3.5.40(typescript@5.8.3)
|
||||||
vue-router: 4.5.1(vue@3.5.40(typescript@5.8.3))
|
vue-router: 4.5.1(vue@3.5.40(typescript@5.8.3))
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
@@ -5864,18 +5865,18 @@ snapshots:
|
|||||||
|
|
||||||
timi-ts@1.0.0: {}
|
timi-ts@1.0.0: {}
|
||||||
|
|
||||||
timi-web-api@1.0.2(timi-web@1.0.1(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3)))(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3)):
|
timi-web-api@1.0.2(timi-web@1.0.2(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3)))(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3)):
|
||||||
dependencies:
|
dependencies:
|
||||||
axios: 1.21.0
|
axios: 1.21.0
|
||||||
pinia: 3.0.4(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3))
|
pinia: 3.0.4(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3))
|
||||||
timi-web: 1.0.1(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3))
|
timi-web: 1.0.2(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3))
|
||||||
vue: 3.5.40(typescript@5.8.3)
|
vue: 3.5.40(typescript@5.8.3)
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- debug
|
- debug
|
||||||
- supports-color
|
- supports-color
|
||||||
- typescript
|
- typescript
|
||||||
|
|
||||||
timi-web@1.0.1(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3)):
|
timi-web@1.0.2(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3)):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@marsio/vue-split-pane': 1.0.0(typescript@5.8.3)
|
'@marsio/vue-split-pane': 1.0.0(typescript@5.8.3)
|
||||||
'@tiptap/extension-code-block': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0)
|
'@tiptap/extension-code-block': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0)
|
||||||
|
|||||||
@@ -40,6 +40,18 @@ watch(
|
|||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => globalUIStore.backdropBlur,
|
||||||
|
(enabled) => {
|
||||||
|
if (enabled) {
|
||||||
|
document.documentElement.style.removeProperty("--tui-backdrop-blur");
|
||||||
|
} else {
|
||||||
|
document.documentElement.style.setProperty("--tui-backdrop-blur", "0px");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
settingStore.loadSoundPlayers();
|
settingStore.loadSoundPlayers();
|
||||||
window.addEventListener("pointerdown", unlockSoundOnUserGesture, { once: true });
|
window.addEventListener("pointerdown", unlockSoundOnUserGesture, { once: true });
|
||||||
|
|||||||
@@ -291,8 +291,8 @@ html.theme-dark body {
|
|||||||
|
|
||||||
mask: linear-gradient(to top, transparent 0%, #000 60%);
|
mask: linear-gradient(to top, transparent 0%, #000 60%);
|
||||||
-webkit-mask: linear-gradient(to top, transparent 0%, #000 60%);
|
-webkit-mask: linear-gradient(to top, transparent 0%, #000 60%);
|
||||||
backdrop-filter: blur(10px);
|
backdrop-filter: blur(var(--tui-backdrop-blur, 10px));
|
||||||
-webkit-backdrop-filter: blur(10px);
|
-webkit-backdrop-filter: blur(var(--tui-backdrop-blur, 10px));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,8 +309,8 @@ html.theme-dark body {
|
|||||||
|
|
||||||
mask: linear-gradient(to bottom, transparent 0%, #000 60%);
|
mask: linear-gradient(to bottom, transparent 0%, #000 60%);
|
||||||
-webkit-mask: linear-gradient(to bottom, transparent 0%, #000 60%);
|
-webkit-mask: linear-gradient(to bottom, transparent 0%, #000 60%);
|
||||||
backdrop-filter: blur(10px);
|
backdrop-filter: blur(var(--tui-backdrop-blur, 10px));
|
||||||
-webkit-backdrop-filter: blur(10px);
|
-webkit-backdrop-filter: blur(var(--tui-backdrop-blur, 10px));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,18 +3,19 @@
|
|||||||
<t-tag
|
<t-tag
|
||||||
v-for="tag in tagList"
|
v-for="tag in tagList"
|
||||||
:key="tag.key"
|
:key="tag.key"
|
||||||
size="small"
|
:size="props.size"
|
||||||
theme="primary"
|
theme="primary"
|
||||||
variant="light-outline"
|
variant="light-outline"
|
||||||
:content="tag.content"
|
:content="tag.content"
|
||||||
/>
|
/>
|
||||||
<t-tag v-if="unitText" size="small" :content="unitText" />
|
<t-tag v-if="unitText" :size="props.size" :content="unitText" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ProductSkuSpecSnapshot } from "@/types/Product";
|
import type { TagProps } from "tdesign-mobile-vue";
|
||||||
import { getProductSkuSnapshotText } from "@/utils/product";
|
import type { ProductSkuSpecSnapshot, ProductSkuTagSelection } from "@/types/Product";
|
||||||
|
import { getProductSkuSnapshotText, getProductSkuSpecEntries } from "@/utils/product";
|
||||||
|
|
||||||
defineOptions({ name: "ProductSkuTags" });
|
defineOptions({ name: "ProductSkuTags" });
|
||||||
|
|
||||||
@@ -23,11 +24,24 @@ interface Props {
|
|||||||
snapshot?: ProductSkuSpecSnapshot[];
|
snapshot?: ProductSkuSpecSnapshot[];
|
||||||
fallback?: string;
|
fallback?: string;
|
||||||
unit?: string | null;
|
unit?: string | null;
|
||||||
|
selection?: ProductSkuTagSelection;
|
||||||
|
size?: TagProps["size"];
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<Props>();
|
const props = withDefaults(defineProps<Props>(), { size: "small" });
|
||||||
|
|
||||||
const tagList = computed(() => {
|
const tagList = computed(() => {
|
||||||
|
if (props.selection) {
|
||||||
|
const { product, sku } = props.selection;
|
||||||
|
const entries = getProductSkuSpecEntries(sku, product.specList || []);
|
||||||
|
const name = product.name?.trim() || "未命名产品";
|
||||||
|
const skuText = getProductSkuSnapshotText(name, sku.name, sku.specSummary);
|
||||||
|
return [
|
||||||
|
{ key: "product", content: name },
|
||||||
|
...entries.map((entry, index) => ({ key: `spec-${index}`, content: entry.valueName })),
|
||||||
|
...(!entries.length && skuText ? [{ key: "sku", content: skuText }] : [])
|
||||||
|
];
|
||||||
|
}
|
||||||
const result = (props.snapshot || []).flatMap((item, index) => {
|
const result = (props.snapshot || []).flatMap((item, index) => {
|
||||||
const content = item.specValueName?.trim() || item.specName?.trim();
|
const content = item.specValueName?.trim() || item.specName?.trim();
|
||||||
return content ? [{ key: `${item.specId || "spec"}-${item.specValueId || index}`, content }] : [];
|
return content ? [{ key: `${item.specId || "spec"}-${item.specValueId || index}`, content }] : [];
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ onBeforeUnmount(() => {
|
|||||||
background: rgba(255, 255, 255, .86);
|
background: rgba(255, 255, 255, .86);
|
||||||
border-radius: .75rem;
|
border-radius: .75rem;
|
||||||
box-shadow: 0 .25rem 1rem rgba(15, 23, 42, .1);
|
box-shadow: 0 .25rem 1rem rgba(15, 23, 42, .1);
|
||||||
backdrop-filter: blur(8px);
|
backdrop-filter: blur(var(--tui-backdrop-blur, 10px));
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
user-select: text;
|
user-select: text;
|
||||||
|
|||||||
@@ -760,7 +760,7 @@ onMounted(() => {
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-radius: 1.75rem;
|
border-radius: 1.75rem;
|
||||||
backdrop-filter: blur(10px);
|
backdrop-filter: blur(var(--tui-backdrop-blur, 10px));
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
.total {
|
.total {
|
||||||
|
|||||||
@@ -82,6 +82,7 @@
|
|||||||
:key="item.id"
|
:key="item.id"
|
||||||
class="item"
|
class="item"
|
||||||
:order="item"
|
:order="item"
|
||||||
|
:fulfillable-sku-id="appliedFilter.fulfillableSkuId"
|
||||||
:can-receive="canReceive"
|
:can-receive="canReceive"
|
||||||
:can-fulfill="canCreateFulfillment"
|
:can-fulfill="canCreateFulfillment"
|
||||||
:can-cancel="canCancel"
|
:can-cancel="canCancel"
|
||||||
@@ -459,6 +460,7 @@ function buildPageFilter(index = pageIndex.value): SalesOrderPage {
|
|||||||
return {
|
return {
|
||||||
customerId: customerId.value || undefined,
|
customerId: customerId.value || undefined,
|
||||||
packageConfigId: currentPackageConfigId || undefined,
|
packageConfigId: currentPackageConfigId || undefined,
|
||||||
|
fulfillableSkuId: filter.fulfillableSkuId || undefined,
|
||||||
keyword: keyword.value || undefined,
|
keyword: keyword.value || undefined,
|
||||||
orderTypeList: currentPackageConfigId ? ["PACKAGE"] : getEffectiveList(filter.orderTypeList, orderTypeOptions.map(item => item.value)),
|
orderTypeList: currentPackageConfigId ? ["PACKAGE"] : getEffectiveList(filter.orderTypeList, orderTypeOptions.map(item => item.value)),
|
||||||
statusList: getEffectiveList(filter.statusList, statusOptions.map(item => item.value)),
|
statusList: getEffectiveList(filter.statusList, statusOptions.map(item => item.value)),
|
||||||
|
|||||||
@@ -9,6 +9,15 @@
|
|||||||
@reset="reset"
|
@reset="reset"
|
||||||
@confirm="confirm"
|
@confirm="confirm"
|
||||||
>
|
>
|
||||||
|
<template #group-fulfillableSku>
|
||||||
|
<t-cell title="选择 SKU" arrow @click="productSelectorVisible = true">
|
||||||
|
<template #note>
|
||||||
|
<product-sku-tags v-if="draftFilter.fulfillableSkuId" :selection="draftFilter.fulfillableSkuSelection" :fallback="draftFilter.fulfillableSkuName" />
|
||||||
|
<span v-else>全部</span>
|
||||||
|
</template>
|
||||||
|
</t-cell>
|
||||||
|
<t-button v-if="draftFilter.fulfillableSkuId" size="small" variant="text" content="清除 SKU" @click="clearSku" />
|
||||||
|
</template>
|
||||||
<template #group-date-after>
|
<template #group-date-after>
|
||||||
<t-cell-group
|
<t-cell-group
|
||||||
v-if="draftFilter.dateFilterType === 'custom'"
|
v-if="draftFilter.dateFilterType === 'custom'"
|
||||||
@@ -31,6 +40,7 @@
|
|||||||
</t-cell-group>
|
</t-cell-group>
|
||||||
</template>
|
</template>
|
||||||
</filter-popup>
|
</filter-popup>
|
||||||
|
<product-select-popup v-model:visible="productSelectorVisible" @select="selectSku" />
|
||||||
<t-popup v-model="startVisible" placement="bottom">
|
<t-popup v-model="startVisible" placement="bottom">
|
||||||
<t-date-time-picker
|
<t-date-time-picker
|
||||||
v-if="startVisible"
|
v-if="startVisible"
|
||||||
@@ -60,6 +70,9 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Time } from "timi-web";
|
import { Time } from "timi-web";
|
||||||
import FilterPopup from "@/components/filter-popup/FilterPopup.vue";
|
import FilterPopup from "@/components/filter-popup/FilterPopup.vue";
|
||||||
|
import ProductSelectPopup from "@/components/productSelector/ProductSelectPopup.vue";
|
||||||
|
import ProductSkuTags from "@/components/ProductSkuTags.vue";
|
||||||
|
import type { ProductSelection } from "@/types/Product";
|
||||||
import type { FilterGroup, FilterModel, FilterValueList } from "@/components/filter-popup/FilterPopup";
|
import type { FilterGroup, FilterModel, FilterValueList } from "@/components/filter-popup/FilterPopup";
|
||||||
import { buildPresetDateRange } from "@/utils/date";
|
import { buildPresetDateRange } from "@/utils/date";
|
||||||
import { DATE_FILTER_OPTIONS as dateOptions } from "@/utils/dateFilter";
|
import { DATE_FILTER_OPTIONS as dateOptions } from "@/utils/dateFilter";
|
||||||
@@ -67,6 +80,7 @@ import type { GaoSalesOrderStatus, GaoSalesOrderType, GaoSalesRefundStatus } fro
|
|||||||
import {
|
import {
|
||||||
cloneSalesOrderFilter,
|
cloneSalesOrderFilter,
|
||||||
createDefaultSalesOrderFilter,
|
createDefaultSalesOrderFilter,
|
||||||
|
getFulfillableSkuSelection,
|
||||||
type SalesOrderDateFilterType,
|
type SalesOrderDateFilterType,
|
||||||
type SalesOrderFilterGroupKey,
|
type SalesOrderFilterGroupKey,
|
||||||
type SalesOrderListFilter,
|
type SalesOrderListFilter,
|
||||||
@@ -94,6 +108,7 @@ const popupVisible = computed({
|
|||||||
const draftFilter = ref<SalesOrderListFilter>(cloneSalesOrderFilter(props.modelValue));
|
const draftFilter = ref<SalesOrderListFilter>(cloneSalesOrderFilter(props.modelValue));
|
||||||
const startVisible = ref(false);
|
const startVisible = ref(false);
|
||||||
const endVisible = ref(false);
|
const endVisible = ref(false);
|
||||||
|
const productSelectorVisible = ref(false);
|
||||||
const startDraft = ref("");
|
const startDraft = ref("");
|
||||||
const endDraft = ref("");
|
const endDraft = ref("");
|
||||||
let resetRequested = false;
|
let resetRequested = false;
|
||||||
@@ -119,6 +134,13 @@ const refundOptions: Array<{ label: string; value: GaoSalesRefundStatus }> = [
|
|||||||
{ label: "已退款", value: "REFUNDED" }
|
{ label: "已退款", value: "REFUNDED" }
|
||||||
];
|
];
|
||||||
const filterGroups = computed<FilterGroup[]>(() => [
|
const filterGroups = computed<FilterGroup[]>(() => [
|
||||||
|
{
|
||||||
|
key: "fulfillableSku",
|
||||||
|
title: "可履约 SKU",
|
||||||
|
options: [],
|
||||||
|
multiple: false,
|
||||||
|
columns: 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: "date",
|
key: "date",
|
||||||
title: "下单时间",
|
title: "下单时间",
|
||||||
@@ -306,6 +328,11 @@ function reset(): void {
|
|||||||
|
|
||||||
function resetFilterGroup(target: SalesOrderListFilter, source: SalesOrderListFilter, filterKey: SalesOrderFilterGroupKey): void {
|
function resetFilterGroup(target: SalesOrderListFilter, source: SalesOrderListFilter, filterKey: SalesOrderFilterGroupKey): void {
|
||||||
switch (filterKey) {
|
switch (filterKey) {
|
||||||
|
case "fulfillableSku":
|
||||||
|
target.fulfillableSkuId = source.fulfillableSkuId;
|
||||||
|
target.fulfillableSkuName = source.fulfillableSkuName;
|
||||||
|
target.fulfillableSkuSelection = source.fulfillableSkuSelection;
|
||||||
|
break;
|
||||||
case "date":
|
case "date":
|
||||||
target.dateFilterType = source.dateFilterType;
|
target.dateFilterType = source.dateFilterType;
|
||||||
target.dateRange = [...source.dateRange];
|
target.dateRange = [...source.dateRange];
|
||||||
@@ -325,6 +352,18 @@ function resetFilterGroup(target: SalesOrderListFilter, source: SalesOrderListFi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function selectSku(selection: ProductSelection): void {
|
||||||
|
draftFilter.value.fulfillableSkuId = selection.sku.id || "";
|
||||||
|
draftFilter.value.fulfillableSkuName = [selection.product.name, selection.sku.specSummary || selection.sku.name].filter(Boolean).join(" · ");
|
||||||
|
draftFilter.value.fulfillableSkuSelection = getFulfillableSkuSelection(selection);
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearSku(): void {
|
||||||
|
draftFilter.value.fulfillableSkuId = "";
|
||||||
|
draftFilter.value.fulfillableSkuName = "";
|
||||||
|
draftFilter.value.fulfillableSkuSelection = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
function confirm(): void {
|
function confirm(): void {
|
||||||
if ((!props.filterKey || props.filterKey === "date")
|
if ((!props.filterKey || props.filterKey === "date")
|
||||||
&& draftFilter.value.dateFilterType === "custom"
|
&& draftFilter.value.dateFilterType === "custom"
|
||||||
|
|||||||
@@ -7,9 +7,18 @@
|
|||||||
@click="openFilterPopup('date')"
|
@click="openFilterPopup('date')"
|
||||||
/>
|
/>
|
||||||
<t-cell v-if="props.filter.dateFilterType === 'custom'" :note="filterDateRangeText" />
|
<t-cell v-if="props.filter.dateFilterType === 'custom'" :note="filterDateRangeText" />
|
||||||
<t-cell title="状态" class="filter-cell" arrow @click="openFilterPopup('statusList')">
|
<t-cell title="可履约 SKU" class="cell" arrow @click="productSelectorVisible = true">
|
||||||
<template #note>
|
<template #note>
|
||||||
<div class="filter-tags">
|
<div v-if="props.filter.fulfillableSkuId" class="tags">
|
||||||
|
<product-sku-tags size="medium" :selection="props.filter.fulfillableSkuSelection" :fallback="props.filter.fulfillableSkuName" />
|
||||||
|
<t-button size="extra-small" content="清除" @click.stop="clearSku" />
|
||||||
|
</div>
|
||||||
|
<span v-else>全部</span>
|
||||||
|
</template>
|
||||||
|
</t-cell>
|
||||||
|
<t-cell title="状态" class="cell roll-note" arrow @click="openFilterPopup('statusList')">
|
||||||
|
<template #note>
|
||||||
|
<div class="tags">
|
||||||
<t-tag
|
<t-tag
|
||||||
v-for="item in selectedStatusTags"
|
v-for="item in selectedStatusTags"
|
||||||
:key="item"
|
:key="item"
|
||||||
@@ -20,9 +29,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</t-cell>
|
</t-cell>
|
||||||
<t-cell title="订单条件" class="filter-cell" arrow @click="openFilterPopup('orderTypeList')">
|
<t-cell title="订单条件" class="cell roll-note" arrow @click="openFilterPopup('orderTypeList')">
|
||||||
<template #note>
|
<template #note>
|
||||||
<div class="filter-tags">
|
<div class="tags">
|
||||||
<t-tag
|
<t-tag
|
||||||
v-for="item in selectedOrderTypeTags"
|
v-for="item in selectedOrderTypeTags"
|
||||||
:key="item"
|
:key="item"
|
||||||
@@ -33,9 +42,23 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</t-cell>
|
</t-cell>
|
||||||
<t-cell title="资金条件" class="filter-cell" arrow @click="openFilterPopup('paymentStatusList')">
|
<t-cell title="资金条件" class="cell roll-note" arrow @click="openFilterPopup('paymentStatusList')">
|
||||||
<template #note>
|
<template #note>
|
||||||
<div class="filter-tags">
|
<div class="tags">
|
||||||
|
<t-tag
|
||||||
|
v-for="item in selectedPaymentTags"
|
||||||
|
:key="item"
|
||||||
|
theme="primary"
|
||||||
|
variant="light-outline"
|
||||||
|
:content="item"
|
||||||
|
/>
|
||||||
|
<t-tag
|
||||||
|
v-for="item in selectedPaymentTags"
|
||||||
|
:key="item"
|
||||||
|
theme="primary"
|
||||||
|
variant="light-outline"
|
||||||
|
:content="item"
|
||||||
|
/>
|
||||||
<t-tag
|
<t-tag
|
||||||
v-for="item in selectedPaymentTags"
|
v-for="item in selectedPaymentTags"
|
||||||
:key="item"
|
:key="item"
|
||||||
@@ -46,9 +69,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</t-cell>
|
</t-cell>
|
||||||
<t-cell title="退款条件" class="filter-cell" arrow @click="openFilterPopup('refundStatusList')">
|
<t-cell title="退款条件" class="cell roll-note" arrow @click="openFilterPopup('refundStatusList')">
|
||||||
<template #note>
|
<template #note>
|
||||||
<div class="filter-tags">
|
<div class="tags">
|
||||||
<t-tag
|
<t-tag
|
||||||
v-for="item in selectedRefundTags"
|
v-for="item in selectedRefundTags"
|
||||||
:key="item"
|
:key="item"
|
||||||
@@ -68,13 +91,18 @@
|
|||||||
:package-config-id="props.packageConfigId"
|
:package-config-id="props.packageConfigId"
|
||||||
@confirm="confirmFilter"
|
@confirm="confirmFilter"
|
||||||
/>
|
/>
|
||||||
|
<product-select-popup v-model:visible="productSelectorVisible" @select="selectSku" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import SalesOrderFilterPopup from "@/pages/salesOrder/component/SalesOrderFilterPopup.vue";
|
import SalesOrderFilterPopup from "@/pages/salesOrder/component/SalesOrderFilterPopup.vue";
|
||||||
|
import ProductSelectPopup from "@/components/productSelector/ProductSelectPopup.vue";
|
||||||
|
import ProductSkuTags from "@/components/ProductSkuTags.vue";
|
||||||
|
import type { ProductSelection } from "@/types/Product";
|
||||||
import type { GaoSalesOrderStatus, GaoSalesOrderType, GaoSalesRefundStatus } from "@/types/SalesOrder";
|
import type { GaoSalesOrderStatus, GaoSalesOrderType, GaoSalesRefundStatus } from "@/types/SalesOrder";
|
||||||
import { DATE_FILTER_OPTIONS } from "@/utils/dateFilter";
|
import { DATE_FILTER_OPTIONS } from "@/utils/dateFilter";
|
||||||
import {
|
import {
|
||||||
|
getFulfillableSkuSelection,
|
||||||
type SalesOrderFilterGroupKey,
|
type SalesOrderFilterGroupKey,
|
||||||
type SalesOrderListFilter,
|
type SalesOrderListFilter,
|
||||||
type SalesOrderPaymentFilter
|
type SalesOrderPaymentFilter
|
||||||
@@ -124,8 +152,22 @@ const selectedOrderTypeTags = computed(() => getSelectedOptionLabels(props.filte
|
|||||||
const selectedPaymentTags = computed(() => getSelectedOptionLabels(props.filter.paymentStatusList, paymentOptions));
|
const selectedPaymentTags = computed(() => getSelectedOptionLabels(props.filter.paymentStatusList, paymentOptions));
|
||||||
const selectedRefundTags = computed(() => getSelectedOptionLabels(props.filter.refundStatusList, refundOptions));
|
const selectedRefundTags = computed(() => getSelectedOptionLabels(props.filter.refundStatusList, refundOptions));
|
||||||
const filterPopupVisible = ref(false);
|
const filterPopupVisible = ref(false);
|
||||||
|
const productSelectorVisible = ref(false);
|
||||||
const activeFilterKey = ref<SalesOrderFilterGroupKey>();
|
const activeFilterKey = ref<SalesOrderFilterGroupKey>();
|
||||||
|
|
||||||
|
function selectSku(selection: ProductSelection): void {
|
||||||
|
emit("confirm", {
|
||||||
|
...props.filter,
|
||||||
|
fulfillableSkuId: selection.sku.id || "",
|
||||||
|
fulfillableSkuName: [selection.product.name, selection.sku.specSummary || selection.sku.name].filter(Boolean).join(" · "),
|
||||||
|
fulfillableSkuSelection: getFulfillableSkuSelection(selection)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearSku(): void {
|
||||||
|
emit("confirm", { ...props.filter, fulfillableSkuId: "", fulfillableSkuName: "", fulfillableSkuSelection: undefined });
|
||||||
|
}
|
||||||
|
|
||||||
function getSelectedOptionLabels<T extends string>(valueList: T[], options: Array<{ label: string; value: T }>): string[] {
|
function getSelectedOptionLabels<T extends string>(valueList: T[], options: Array<{ label: string; value: T }>): string[] {
|
||||||
const labels = options.filter(item => valueList.includes(item.value)).map(item => item.label);
|
const labels = options.filter(item => valueList.includes(item.value)).map(item => item.label);
|
||||||
return labels.length ? labels : ["未选择"];
|
return labels.length ? labels : ["未选择"];
|
||||||
@@ -152,28 +194,32 @@ function confirmFilter(value: SalesOrderListFilter): void {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.t-cell__title) {
|
.cell {
|
||||||
flex: 0 0 4.5rem;
|
|
||||||
margin-right: .75rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.t-cell__note) {
|
&.roll-note {
|
||||||
flex: 1 1 0;
|
|
||||||
min-width: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
text-align: right;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.filter-cell {
|
:deep(.t-cell__title) {
|
||||||
.filter-tags {
|
flex: 0 0 4.5rem;
|
||||||
|
margin-right: .75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.t-cell__note) {
|
||||||
|
flex: 1 1 0;
|
||||||
|
min-width: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
text-align: right;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tags {
|
||||||
gap: .4rem;
|
gap: .4rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
justify-content: flex-start;
|
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
|
||||||
&::-webkit-scrollbar {
|
&::-webkit-scrollbar {
|
||||||
display: none;
|
display: none;
|
||||||
|
|||||||
@@ -50,13 +50,13 @@
|
|||||||
<div class="product">
|
<div class="product">
|
||||||
<div class="items">
|
<div class="items">
|
||||||
<t-tag
|
<t-tag
|
||||||
v-for="(item, index) in itemList"
|
v-for="(item, index) in displayItemList"
|
||||||
:key="item.id || `${item.skuId}-${item.skuUnitId}-${index}`"
|
:key="item.id || `${item.skuId}-${item.skuUnitId}-${index}`"
|
||||||
:content="getProductText(item)"
|
:content="getProductText(item)"
|
||||||
theme="primary"
|
:theme="props.fulfillableSkuId ? 'warning' : 'primary'"
|
||||||
variant="light"
|
variant="light"
|
||||||
/>
|
/>
|
||||||
<t-tag v-if="!itemList.length" content="暂无产品" />
|
<t-tag v-if="!displayItemList.length" :content="props.fulfillableSkuId ? '暂无可履约产品' : '暂无产品'" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary">
|
<div class="summary">
|
||||||
@@ -142,7 +142,7 @@
|
|||||||
import { TimeLabel } from "timi-web";
|
import { TimeLabel } from "timi-web";
|
||||||
import type { GaoSalesPaymentStatus, SalesOrder } from "@/types/SalesOrder";
|
import type { GaoSalesPaymentStatus, SalesOrder } from "@/types/SalesOrder";
|
||||||
import { getCustomerPhotoURL } from "@/utils/customer";
|
import { getCustomerPhotoURL } from "@/utils/customer";
|
||||||
import { formatPackageAmount, getPackageQuantityText } from "@/utils/package";
|
import { comparePackageQuantity, formatPackageAmount, getPackageQuantityText } from "@/utils/package";
|
||||||
import { getSalesOrderStatusText, getSalesOrderTypeText, getSalesPaymentStatusText, getStatusTheme } from "@/utils/salesOrder";
|
import { getSalesOrderStatusText, getSalesOrderTypeText, getSalesPaymentStatusText, getStatusTheme } from "@/utils/salesOrder";
|
||||||
import { getProductSkuSnapshotText } from "@/utils/product";
|
import { getProductSkuSnapshotText } from "@/utils/product";
|
||||||
|
|
||||||
@@ -150,6 +150,7 @@ defineOptions({ name: "SalesOrderListCell" });
|
|||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
order: SalesOrder;
|
order: SalesOrder;
|
||||||
|
fulfillableSkuId?: string;
|
||||||
canReceive: boolean;
|
canReceive: boolean;
|
||||||
canFulfill: boolean;
|
canFulfill: boolean;
|
||||||
canCancel: boolean;
|
canCancel: boolean;
|
||||||
@@ -166,6 +167,9 @@ const emit = defineEmits<{
|
|||||||
}>();
|
}>();
|
||||||
const moreVisible = ref(false);
|
const moreVisible = ref(false);
|
||||||
const itemList = computed(() => props.order.itemList || []);
|
const itemList = computed(() => props.order.itemList || []);
|
||||||
|
const displayItemList = computed(() => props.fulfillableSkuId
|
||||||
|
? itemList.value.filter(item => item.skuId === props.fulfillableSkuId && 0 < comparePackageQuantity(item.availableBaseQuantity ?? "0", "0"))
|
||||||
|
: itemList.value);
|
||||||
const customerName = computed(() => props.order.customer?.name || props.order.customer?.code || props.order.customerId || "未知客户");
|
const customerName = computed(() => props.order.customer?.name || props.order.customer?.code || props.order.customerId || "未知客户");
|
||||||
const avatarText = computed(() => customerName.value.slice(0, 1) || "客");
|
const avatarText = computed(() => customerName.value.slice(0, 1) || "客");
|
||||||
const photoURL = computed(() => getCustomerPhotoURL(props.order.customer, 64));
|
const photoURL = computed(() => getCustomerPhotoURL(props.order.customer, 64));
|
||||||
@@ -230,9 +234,13 @@ function sumProductQuantity(field: "quantity" | "fulfilledBaseQuantity"): string
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getProductText(item: NonNullable<SalesOrder["itemList"]>[number]): string {
|
function getProductText(item: NonNullable<SalesOrder["itemList"]>[number]): string {
|
||||||
const quantity = getPackageQuantityText(item.quantity);
|
|
||||||
const skuText = getProductSkuSnapshotText(item.productNameSnapshot, item.skuNameSnapshot, item.specSummarySnapshot);
|
const skuText = getProductSkuSnapshotText(item.productNameSnapshot, item.skuNameSnapshot, item.specSummarySnapshot);
|
||||||
const giftText = item.gifted ? "赠送 · " : "";
|
const giftText = item.gifted ? "赠送 · " : "";
|
||||||
|
if (props.fulfillableSkuId) {
|
||||||
|
const quantity = getPackageQuantityText(item.availableBaseQuantity);
|
||||||
|
return `${giftText}${item.productNameSnapshot || "未命名产品"}${skuText ? `(${skuText})` : ""} · ${quantity} ${item.baseUnitName || "基础单位"}`;
|
||||||
|
}
|
||||||
|
const quantity = getPackageQuantityText(item.quantity);
|
||||||
return `${giftText}${item.productNameSnapshot || "未命名产品"}${skuText ? `(${skuText})` : " "}${quantity}${item.unitSnapshot ? ` ${item.unitSnapshot}` : ""}`;
|
return `${giftText}${item.productNameSnapshot || "未命名产品"}${skuText ? `(${skuText})` : " "}${quantity}${item.unitSnapshot ? ` ${item.unitSnapshot}` : ""}`;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
<section class="brand" v-entrance-transition>
|
<section class="brand" v-entrance-transition>
|
||||||
<logo @click="handleLogoClick" />
|
<logo @click="handleLogoClick" />
|
||||||
<h1 v-text="appName" />
|
<h1 v-text="appName" />
|
||||||
|
<p v-text="`版本 ${displayVersion}`" />
|
||||||
<p v-text="appDescription" />
|
<p v-text="appDescription" />
|
||||||
</section>
|
</section>
|
||||||
<t-cell-group v-if="agreementItemList.length" theme="card" v-entrance-transition>
|
<t-cell-group v-if="agreementItemList.length" theme="card" v-entrance-transition>
|
||||||
@@ -32,6 +33,13 @@
|
|||||||
v-else
|
v-else
|
||||||
:description="isLoading ? '正在加载协议配置' : '暂无可用协议'"
|
:description="isLoading ? '正在加载协议配置' : '暂无可用协议'"
|
||||||
/>
|
/>
|
||||||
|
<t-cell-group v-if="updateSupported" theme="card" v-entrance-transition>
|
||||||
|
<t-cell title="版本更新" arrow hover @click="router.push({ name: 'AppUpdate' })">
|
||||||
|
<template #leftIcon>
|
||||||
|
<t-icon name="download" size="1.75rem" />
|
||||||
|
</template>
|
||||||
|
</t-cell>
|
||||||
|
</t-cell-group>
|
||||||
<footer class="footer" v-entrance-transition>
|
<footer class="footer" v-entrance-transition>
|
||||||
<p>技术支持:夜雨</p>
|
<p>技术支持:夜雨</p>
|
||||||
<p>联系技术:imyeyu@qq.com</p>
|
<p>联系技术:imyeyu@qq.com</p>
|
||||||
@@ -44,6 +52,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { version } from "../../../package.json";
|
||||||
|
import { useAppUpdate } from "@/composables/useAppUpdate";
|
||||||
import { SettingAPI } from "timi-web-api";
|
import { SettingAPI } from "timi-web-api";
|
||||||
import Logo from "@/pages/user/component/Logo.vue";
|
import Logo from "@/pages/user/component/Logo.vue";
|
||||||
import { getErrorMessage } from "@/utils/error";
|
import { getErrorMessage } from "@/utils/error";
|
||||||
@@ -63,6 +73,8 @@ defineOptions({
|
|||||||
const appName = "糕店客户管理";
|
const appName = "糕店客户管理";
|
||||||
const appDescription = "面向门店的客户、登记、积分与经营管理工具";
|
const appDescription = "面向门店的客户、登记、积分与经营管理工具";
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const { supported: updateSupported, currentVersion, loadCurrent } = useAppUpdate();
|
||||||
|
const displayVersion = computed(() => currentVersion.value && currentVersion.value !== "builtin" ? currentVersion.value : version);
|
||||||
|
|
||||||
const agreementItemList = ref<AgreementItem[]>([]);
|
const agreementItemList = ref<AgreementItem[]>([]);
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
@@ -127,7 +139,7 @@ async function loadSettings(): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await loadSettings();
|
await Promise.all([loadSettings(), loadCurrent()]);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -192,3 +204,4 @@ onMounted(async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,11 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</t-cell>
|
</t-cell>
|
||||||
|
<t-cell title="背景模糊特效">
|
||||||
|
<template #right-icon>
|
||||||
|
<t-switch :model-value="globalUIStore.backdropBlur" @change="value => globalUIStore.setBackdropBlur(value === true)" />
|
||||||
|
</template>
|
||||||
|
</t-cell>
|
||||||
</t-cell-group>
|
</t-cell-group>
|
||||||
<t-cell-group title="声音" theme="card" v-entrance-transition>
|
<t-cell-group title="声音" theme="card" v-entrance-transition>
|
||||||
<t-cell title="扫码成功">
|
<t-cell title="扫码成功">
|
||||||
@@ -46,52 +51,6 @@
|
|||||||
</template>
|
</template>
|
||||||
</t-cell>
|
</t-cell>
|
||||||
</t-cell-group>
|
</t-cell-group>
|
||||||
<t-cell-group v-if="updateSupported" title="版本更新" theme="card" v-entrance-transition>
|
|
||||||
<t-cell title="外壳版本" :note="nativeVersion || '—'" />
|
|
||||||
<t-cell title="系统版本" :note="currentVersion || '—'" />
|
|
||||||
<t-cell v-if="latestVersionText" title="最新版本" :note="latestVersionText" />
|
|
||||||
<t-cell title="自动更新">
|
|
||||||
<template #right-icon>
|
|
||||||
<t-switch :model-value="autoUpdate" @change="handleAutoUpdateChange" />
|
|
||||||
</template>
|
|
||||||
</t-cell>
|
|
||||||
</t-cell-group>
|
|
||||||
<div v-if="updateSupported" class="update-panel" v-entrance-transition>
|
|
||||||
<center-tips v-if="updateHint" v-text="updateHint" />
|
|
||||||
<t-button
|
|
||||||
v-if="updateStage === 'check'"
|
|
||||||
class="cell-button"
|
|
||||||
theme="primary"
|
|
||||||
size="large"
|
|
||||||
:loading="checking"
|
|
||||||
@click="handleCheck"
|
|
||||||
>
|
|
||||||
检查更新
|
|
||||||
</t-button>
|
|
||||||
<t-button
|
|
||||||
v-else-if="updateStage === 'download'"
|
|
||||||
class="cell-button"
|
|
||||||
theme="primary"
|
|
||||||
size="large"
|
|
||||||
@click="handleDownload"
|
|
||||||
>
|
|
||||||
下载更新
|
|
||||||
</t-button>
|
|
||||||
<template v-else-if="updateStage === 'downloading'">
|
|
||||||
<t-progress class="progress" stroke-width=".5rem" :percentage="percent" /> <t-button theme="primary" size="large" block disabled>
|
|
||||||
下载中 {{ percent }}%
|
|
||||||
</t-button>
|
|
||||||
</template>
|
|
||||||
<t-button
|
|
||||||
v-else-if="updateStage === 'apply'"
|
|
||||||
class="cell-button"
|
|
||||||
theme="primary"
|
|
||||||
size="large"
|
|
||||||
@click="handleApply"
|
|
||||||
>
|
|
||||||
现在更新
|
|
||||||
</t-button>
|
|
||||||
</div>
|
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -101,8 +60,6 @@ import type { ThemeMode } from "@/store/globalUI";
|
|||||||
import { useGlobalUIStore } from "@/store/globalUI";
|
import { useGlobalUIStore } from "@/store/globalUI";
|
||||||
import SegmentedSlider from "@/components/SegmentedSlider.vue";
|
import SegmentedSlider from "@/components/SegmentedSlider.vue";
|
||||||
import { useSettingStore } from "@/store/settingStore";
|
import { useSettingStore } from "@/store/settingStore";
|
||||||
import { setAutoUpdate, useAppUpdate } from "@/composables/useAppUpdate";
|
|
||||||
import { Message } from "@/utils/message";
|
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "AppSettings"
|
name: "AppSettings"
|
||||||
@@ -159,97 +116,7 @@ async function playSettingSoundPreview(type: "scanSuccess" | "registerSuccess"):
|
|||||||
await settingStore.playRegisterSuccessSound();
|
await settingStore.playRegisterSuccessSound();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- 版本更新 ----------
|
|
||||||
|
|
||||||
const {
|
|
||||||
supported: updateSupported,
|
|
||||||
currentVersion,
|
|
||||||
nativeVersion,
|
|
||||||
latest,
|
|
||||||
checking,
|
|
||||||
downloading,
|
|
||||||
percent,
|
|
||||||
ready,
|
|
||||||
error: updateError,
|
|
||||||
autoUpdate,
|
|
||||||
loadCurrent,
|
|
||||||
check,
|
|
||||||
hasUpdate,
|
|
||||||
download,
|
|
||||||
apply,
|
|
||||||
restorePending
|
|
||||||
} = useAppUpdate();
|
|
||||||
|
|
||||||
/** 有更新时展示目标版本号 */
|
|
||||||
const latestVersionText = computed<string>(() => (hasUpdate() ? `v${latest.value?.version ?? ""}` : ""));
|
|
||||||
|
|
||||||
/** 当前所处的更新阶段 */
|
|
||||||
const updateStage = computed<"check" | "download" | "downloading" | "apply">(() => {
|
|
||||||
if (downloading.value) {
|
|
||||||
return "downloading";
|
|
||||||
}
|
|
||||||
if (ready.value) {
|
|
||||||
return "apply";
|
|
||||||
}
|
|
||||||
if (latest.value && hasUpdate()) {
|
|
||||||
return "download";
|
|
||||||
}
|
|
||||||
return "check";
|
|
||||||
});
|
|
||||||
|
|
||||||
/** 阶段说明文案 */
|
|
||||||
const updateHint = computed<string>(() => {
|
|
||||||
if (!updateSupported) {
|
|
||||||
return "仅在 App 内可用";
|
|
||||||
}
|
|
||||||
if (ready.value) {
|
|
||||||
return `v${ready.value.version} 已下载,点击下方按钮重启生效`;
|
|
||||||
}
|
|
||||||
if (latest.value && hasUpdate()) {
|
|
||||||
return `发现新版本 v${latest.value.version}`;
|
|
||||||
}
|
|
||||||
if (latest.value && !checking.value) {
|
|
||||||
return "当前已是最新版本";
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
});
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
await loadCurrent();
|
|
||||||
await restorePending();
|
|
||||||
});
|
|
||||||
|
|
||||||
function handleAutoUpdateChange(value: boolean | string | number): void {
|
|
||||||
setAutoUpdate(value === true);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleCheck(): Promise<void> {
|
|
||||||
const result = await check();
|
|
||||||
if (!result) {
|
|
||||||
Message.error(updateError.value || "检查更新失败");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!hasUpdate()) {
|
|
||||||
Message.info("已是最新版本");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleDownload(): Promise<void> {
|
|
||||||
const bundle = await download();
|
|
||||||
if (!bundle) {
|
|
||||||
Message.error(updateError.value || "下载失败");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Message.success(`v${bundle.version} 已下载`);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleApply(): Promise<void> {
|
|
||||||
const bundle = ready.value;
|
|
||||||
if (!bundle) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
await apply(bundle);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
@@ -286,15 +153,6 @@ async function handleApply(): Promise<void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.update-panel {
|
|
||||||
gap: .75rem;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
.progress {
|
|
||||||
margin: 0 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:global(html.theme-dark) {
|
:global(html.theme-dark) {
|
||||||
@@ -302,10 +160,6 @@ async function handleApply(): Promise<void> {
|
|||||||
.volume-field span {
|
.volume-field span {
|
||||||
color: #94a3b8;
|
color: #94a3b8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.update-hint {
|
|
||||||
color: #94a3b8;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -0,0 +1,169 @@
|
|||||||
|
<template>
|
||||||
|
<div class="tui-page-layout tui-navbar">
|
||||||
|
<t-navbar fixed :z-index="20" title="版本更新" left-arrow @left-click="$router.back()" />
|
||||||
|
<main class="tui-page-content scroll column">
|
||||||
|
<center-tips v-if="!updateSupported" content="仅在 App 内可用" />
|
||||||
|
<t-cell-group v-if="updateSupported" title="版本更新" theme="card" v-entrance-transition>
|
||||||
|
<t-cell title="外壳版本" :note="nativeVersion || '—'" />
|
||||||
|
<t-cell title="系统版本" :note="currentVersion || '—'" />
|
||||||
|
<t-cell v-if="latestVersionText" title="最新版本" :note="latestVersionText" />
|
||||||
|
<t-cell title="自动更新">
|
||||||
|
<template #right-icon>
|
||||||
|
<t-switch :model-value="autoUpdate" @change="handleAutoUpdateChange" />
|
||||||
|
</template>
|
||||||
|
</t-cell>
|
||||||
|
</t-cell-group>
|
||||||
|
<div v-if="updateSupported" class="update-panel" v-entrance-transition>
|
||||||
|
<center-tips v-if="updateHint"><span v-text="updateHint" /></center-tips>
|
||||||
|
<t-button
|
||||||
|
v-if="updateStage === 'check'"
|
||||||
|
class="cell-button"
|
||||||
|
theme="primary"
|
||||||
|
size="large"
|
||||||
|
:loading="checking"
|
||||||
|
@click="handleCheck"
|
||||||
|
>
|
||||||
|
检查更新
|
||||||
|
</t-button>
|
||||||
|
<t-button
|
||||||
|
v-else-if="updateStage === 'download'"
|
||||||
|
class="cell-button"
|
||||||
|
theme="primary"
|
||||||
|
size="large"
|
||||||
|
@click="handleDownload"
|
||||||
|
>
|
||||||
|
下载更新
|
||||||
|
</t-button>
|
||||||
|
<template v-else-if="updateStage === 'downloading'">
|
||||||
|
<t-progress class="progress" stroke-width=".5rem" :percentage="percent" />
|
||||||
|
<t-button theme="primary" size="large" block disabled>
|
||||||
|
<span v-text="`下载中 ${percent}%`" />
|
||||||
|
</t-button>
|
||||||
|
</template>
|
||||||
|
<t-button
|
||||||
|
v-else-if="updateStage === 'apply'"
|
||||||
|
class="cell-button"
|
||||||
|
theme="primary"
|
||||||
|
size="large"
|
||||||
|
@click="handleApply"
|
||||||
|
>
|
||||||
|
现在更新
|
||||||
|
</t-button>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { setAutoUpdate, useAppUpdate } from "@/composables/useAppUpdate";
|
||||||
|
import { Message } from "@/utils/message";
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: "AppUpdate"
|
||||||
|
});
|
||||||
|
|
||||||
|
// ---------- 版本更新 ----------
|
||||||
|
|
||||||
|
const {
|
||||||
|
supported: updateSupported,
|
||||||
|
currentVersion,
|
||||||
|
nativeVersion,
|
||||||
|
latest,
|
||||||
|
checking,
|
||||||
|
downloading,
|
||||||
|
percent,
|
||||||
|
ready,
|
||||||
|
error: updateError,
|
||||||
|
autoUpdate,
|
||||||
|
loadCurrent,
|
||||||
|
check,
|
||||||
|
hasUpdate,
|
||||||
|
download,
|
||||||
|
apply,
|
||||||
|
restorePending
|
||||||
|
} = useAppUpdate();
|
||||||
|
|
||||||
|
/** 有更新时展示目标版本号 */
|
||||||
|
const latestVersionText = computed<string>(() => (hasUpdate() ? `v${latest.value?.version ?? ""}` : ""));
|
||||||
|
|
||||||
|
/** 当前所处的更新阶段 */
|
||||||
|
const updateStage = computed<"check" | "download" | "downloading" | "apply">(() => {
|
||||||
|
if (downloading.value) {
|
||||||
|
return "downloading";
|
||||||
|
}
|
||||||
|
if (ready.value) {
|
||||||
|
return "apply";
|
||||||
|
}
|
||||||
|
if (latest.value && hasUpdate()) {
|
||||||
|
return "download";
|
||||||
|
}
|
||||||
|
return "check";
|
||||||
|
});
|
||||||
|
|
||||||
|
/** 阶段说明文案 */
|
||||||
|
const updateHint = computed<string>(() => {
|
||||||
|
if (!updateSupported) {
|
||||||
|
return "仅在 App 内可用";
|
||||||
|
}
|
||||||
|
if (ready.value) {
|
||||||
|
return `v${ready.value.version} 已下载,点击下方按钮重启生效`;
|
||||||
|
}
|
||||||
|
if (latest.value && hasUpdate()) {
|
||||||
|
return `发现新版本 v${latest.value.version}`;
|
||||||
|
}
|
||||||
|
if (latest.value && !checking.value) {
|
||||||
|
return "当前已是最新版本";
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
});
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await loadCurrent();
|
||||||
|
await restorePending();
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleAutoUpdateChange(value: boolean | string | number): void {
|
||||||
|
setAutoUpdate(value === true);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleCheck(): Promise<void> {
|
||||||
|
const result = await check();
|
||||||
|
if (!result) {
|
||||||
|
Message.error(updateError.value || "检查更新失败");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!hasUpdate()) {
|
||||||
|
Message.info("已是最新版本");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleDownload(): Promise<void> {
|
||||||
|
const bundle = await download();
|
||||||
|
if (!bundle) {
|
||||||
|
Message.error(updateError.value || "下载失败");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Message.success(`v${bundle.version} 已下载`);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleApply(): Promise<void> {
|
||||||
|
const bundle = ready.value;
|
||||||
|
if (!bundle) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await apply(bundle);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.update-panel {
|
||||||
|
gap: .75rem;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.progress {
|
||||||
|
margin: 0 1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
@@ -174,10 +174,14 @@ async function openAiChat(): Promise<void> {
|
|||||||
.items {
|
.items {
|
||||||
--td-button-border-radius: 1.75rem;
|
--td-button-border-radius: 1.75rem;
|
||||||
|
|
||||||
// 按最小宽度铺排:手机刚好吃下 3 列,平板自动加列而不是把卡片放大
|
// 窄屏至少显示 3 列,宽屏按最小宽度自动增加列数
|
||||||
gap: .875rem;
|
gap: .875rem;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(min(6.5rem, calc(33.3333% - .5834rem)), 1fr));
|
||||||
|
|
||||||
|
.item-wrap {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
--entry-color: #0f766e;
|
--entry-color: #0f766e;
|
||||||
@@ -207,7 +211,7 @@ async function openAiChat(): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.body {
|
.body {
|
||||||
inset: 1rem;
|
inset: .5rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: .5rem;
|
gap: .5rem;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
@@ -137,6 +137,17 @@ export const managementSettingRoutes: RouteRecordRaw[] = [
|
|||||||
darkBodyBackground: "#10161f"
|
darkBodyBackground: "#10161f"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/management/about/update",
|
||||||
|
name: "AppUpdate",
|
||||||
|
component: () => import("@/pages/setting/AppUpdate.vue"),
|
||||||
|
meta: {
|
||||||
|
depth: 4,
|
||||||
|
tabBarVisible: false,
|
||||||
|
bodyBackground: "#F5F5F8",
|
||||||
|
darkBodyBackground: "#10161f"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "/management/about/agreement/:id",
|
path: "/management/about/agreement/:id",
|
||||||
name: "Agreement",
|
name: "Agreement",
|
||||||
|
|||||||
+10
-1
@@ -3,6 +3,7 @@ import { defineStore } from "pinia";
|
|||||||
|
|
||||||
export const DEFAULT_BODY_BACKGROUND = "#FFF";
|
export const DEFAULT_BODY_BACKGROUND = "#FFF";
|
||||||
const THEME_STORAGE_KEY = "gao-customer-h5:theme-mode";
|
const THEME_STORAGE_KEY = "gao-customer-h5:theme-mode";
|
||||||
|
const BACKDROP_BLUR_STORAGE_KEY = "gao-customer-h5:backdrop-blur";
|
||||||
|
|
||||||
export type ThemeMode = "light" | "dark" | "system";
|
export type ThemeMode = "light" | "dark" | "system";
|
||||||
|
|
||||||
@@ -18,6 +19,7 @@ function readStoredThemeMode(): ThemeMode {
|
|||||||
const store = defineStore("globalUI", () => {
|
const store = defineStore("globalUI", () => {
|
||||||
const bodyBackground = ref<string>(DEFAULT_BODY_BACKGROUND);
|
const bodyBackground = ref<string>(DEFAULT_BODY_BACKGROUND);
|
||||||
const themeMode = ref<ThemeMode>(readStoredThemeMode());
|
const themeMode = ref<ThemeMode>(readStoredThemeMode());
|
||||||
|
const backdropBlur = ref(localStorage.getItem(BACKDROP_BLUR_STORAGE_KEY) !== "false");
|
||||||
|
|
||||||
function setBodyBackground(color?: string): void {
|
function setBodyBackground(color?: string): void {
|
||||||
bodyBackground.value = color || DEFAULT_BODY_BACKGROUND;
|
bodyBackground.value = color || DEFAULT_BODY_BACKGROUND;
|
||||||
@@ -28,11 +30,18 @@ const store = defineStore("globalUI", () => {
|
|||||||
localStorage.setItem(THEME_STORAGE_KEY, mode);
|
localStorage.setItem(THEME_STORAGE_KEY, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setBackdropBlur(enabled: boolean): void {
|
||||||
|
backdropBlur.value = enabled;
|
||||||
|
localStorage.setItem(BACKDROP_BLUR_STORAGE_KEY, String(enabled));
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
bodyBackground,
|
bodyBackground,
|
||||||
themeMode,
|
themeMode,
|
||||||
|
backdropBlur,
|
||||||
setBodyBackground,
|
setBodyBackground,
|
||||||
setThemeMode
|
setThemeMode,
|
||||||
|
setBackdropBlur
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -116,6 +116,12 @@ export type ProductSelection = {
|
|||||||
unit: ProductSkuUnit;
|
unit: ProductSkuUnit;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** 产品 SKU 标签所需的产品与规格信息。 */
|
||||||
|
export type ProductSkuTagSelection = {
|
||||||
|
product: Pick<Product, "name" | "specList">;
|
||||||
|
sku: Pick<ProductSku, "name" | "specSummary" | "specValueIdList">;
|
||||||
|
};
|
||||||
|
|
||||||
export type ProductCategoryPage = {
|
export type ProductCategoryPage = {
|
||||||
storeId?: string;
|
storeId?: string;
|
||||||
status?: ProductCategoryStatus;
|
status?: ProductCategoryStatus;
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ export type SalesOrderPage = {
|
|||||||
storeId?: string;
|
storeId?: string;
|
||||||
customerId?: string;
|
customerId?: string;
|
||||||
packageConfigId?: string;
|
packageConfigId?: string;
|
||||||
|
fulfillableSkuId?: string;
|
||||||
orderType?: GaoSalesOrderType;
|
orderType?: GaoSalesOrderType;
|
||||||
orderTypeList?: GaoSalesOrderType[];
|
orderTypeList?: GaoSalesOrderType[];
|
||||||
status?: GaoSalesOrderStatus;
|
status?: GaoSalesOrderStatus;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import type {
|
|||||||
GaoSalesRefundStatus
|
GaoSalesRefundStatus
|
||||||
} from "@/types/SalesOrder";
|
} from "@/types/SalesOrder";
|
||||||
import type { DateTimeRange } from "@/utils/date";
|
import type { DateTimeRange } from "@/utils/date";
|
||||||
|
import type { ProductSelection, ProductSkuTagSelection } from "@/types/Product";
|
||||||
import { DATE_FILTER_OPTIONS, type DateFilterType } from "@/utils/dateFilter";
|
import { DATE_FILTER_OPTIONS, type DateFilterType } from "@/utils/dateFilter";
|
||||||
|
|
||||||
/** 销售订单筛选类型别名,保持现有导入路径兼容。 */
|
/** 销售订单筛选类型别名,保持现有导入路径兼容。 */
|
||||||
@@ -14,7 +15,7 @@ export type SalesOrderDateFilterType = DateFilterType;
|
|||||||
export type SalesOrderPaymentFilter = GaoSalesPaymentStatus | "PENDING_RECEIVE";
|
export type SalesOrderPaymentFilter = GaoSalesPaymentStatus | "PENDING_RECEIVE";
|
||||||
|
|
||||||
/** 销售订单筛选组。 */
|
/** 销售订单筛选组。 */
|
||||||
export type SalesOrderFilterGroupKey = "date" | "orderTypeList" | "statusList" | "paymentStatusList" | "refundStatusList";
|
export type SalesOrderFilterGroupKey = "date" | "orderTypeList" | "statusList" | "paymentStatusList" | "refundStatusList" | "fulfillableSku";
|
||||||
|
|
||||||
/** 销售订单列表筛选条件。 */
|
/** 销售订单列表筛选条件。 */
|
||||||
export type SalesOrderListFilter = {
|
export type SalesOrderListFilter = {
|
||||||
@@ -24,8 +25,19 @@ export type SalesOrderListFilter = {
|
|||||||
statusList: GaoSalesOrderStatus[];
|
statusList: GaoSalesOrderStatus[];
|
||||||
paymentStatusList: SalesOrderPaymentFilter[];
|
paymentStatusList: SalesOrderPaymentFilter[];
|
||||||
refundStatusList: GaoSalesRefundStatus[];
|
refundStatusList: GaoSalesRefundStatus[];
|
||||||
|
fulfillableSkuId: string;
|
||||||
|
fulfillableSkuName: string;
|
||||||
|
fulfillableSkuSelection?: ProductSkuTagSelection;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** 提取筛选回显需要的产品和 SKU 信息。 */
|
||||||
|
export function getFulfillableSkuSelection(selection: ProductSelection): ProductSkuTagSelection {
|
||||||
|
return {
|
||||||
|
product: { name: selection.product.name, specList: selection.product.specList },
|
||||||
|
sku: { name: selection.sku.name, specSummary: selection.sku.specSummary, specValueIdList: selection.sku.specValueIdList }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/** 创建销售订单筛选默认值。 */
|
/** 创建销售订单筛选默认值。 */
|
||||||
export function createDefaultSalesOrderFilter(): SalesOrderListFilter {
|
export function createDefaultSalesOrderFilter(): SalesOrderListFilter {
|
||||||
return {
|
return {
|
||||||
@@ -34,7 +46,9 @@ export function createDefaultSalesOrderFilter(): SalesOrderListFilter {
|
|||||||
orderTypeList: ["PACKAGE", "DIRECT_PRODUCT"],
|
orderTypeList: ["PACKAGE", "DIRECT_PRODUCT"],
|
||||||
statusList: ["ACTIVE"],
|
statusList: ["ACTIVE"],
|
||||||
paymentStatusList: ["UNPAID", "PARTIALLY_PAID", "PAID"],
|
paymentStatusList: ["UNPAID", "PARTIALLY_PAID", "PAID"],
|
||||||
refundStatusList: ["NOT_REQUIRED", "PENDING", "REFUNDED"]
|
refundStatusList: ["NOT_REQUIRED", "PENDING", "REFUNDED"],
|
||||||
|
fulfillableSkuId: "",
|
||||||
|
fulfillableSkuName: ""
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,7 +60,10 @@ export function cloneSalesOrderFilter(filter: SalesOrderListFilter): SalesOrderL
|
|||||||
orderTypeList: [...filter.orderTypeList],
|
orderTypeList: [...filter.orderTypeList],
|
||||||
statusList: [...filter.statusList],
|
statusList: [...filter.statusList],
|
||||||
paymentStatusList: [...filter.paymentStatusList],
|
paymentStatusList: [...filter.paymentStatusList],
|
||||||
refundStatusList: [...filter.refundStatusList]
|
refundStatusList: [...filter.refundStatusList],
|
||||||
|
fulfillableSkuId: filter.fulfillableSkuId,
|
||||||
|
fulfillableSkuName: filter.fulfillableSkuName,
|
||||||
|
fulfillableSkuSelection: filter.fulfillableSkuSelection
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +90,24 @@ export function normalizeSalesOrderFilter(value: unknown): SalesOrderListFilter
|
|||||||
orderTypeList: normalizeList(source.orderTypeList, defaultFilter.orderTypeList),
|
orderTypeList: normalizeList(source.orderTypeList, defaultFilter.orderTypeList),
|
||||||
statusList: normalizeList(source.statusList, defaultFilter.statusList),
|
statusList: normalizeList(source.statusList, defaultFilter.statusList),
|
||||||
paymentStatusList: normalizeList(source.paymentStatusList, defaultFilter.paymentStatusList),
|
paymentStatusList: normalizeList(source.paymentStatusList, defaultFilter.paymentStatusList),
|
||||||
refundStatusList: normalizeList(source.refundStatusList, defaultFilter.refundStatusList)
|
refundStatusList: normalizeList(source.refundStatusList, defaultFilter.refundStatusList),
|
||||||
|
fulfillableSkuId: typeof source.fulfillableSkuId === "string" ? source.fulfillableSkuId : "",
|
||||||
|
fulfillableSkuName: typeof source.fulfillableSkuName === "string" ? source.fulfillableSkuName : "",
|
||||||
|
fulfillableSkuSelection: normalizeSkuSelection(source.fulfillableSkuSelection)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeSkuSelection(value: unknown): ProductSkuTagSelection | undefined {
|
||||||
|
if (!value || typeof value !== "object") return undefined;
|
||||||
|
const selection = value as ProductSkuTagSelection;
|
||||||
|
if (!selection.product || typeof selection.product.name !== "string" || !selection.sku || typeof selection.sku.name !== "string") return undefined;
|
||||||
|
return {
|
||||||
|
product: { name: selection.product.name, specList: Array.isArray(selection.product.specList) ? selection.product.specList : [] },
|
||||||
|
sku: {
|
||||||
|
name: selection.sku.name,
|
||||||
|
specSummary: typeof selection.sku.specSummary === "string" ? selection.sku.specSummary : "",
|
||||||
|
specValueIdList: normalizeList(selection.sku.specValueIdList, [])
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user