From 6654e916079eec19d0556d279dc66c73b4b30d7e Mon Sep 17 00:00:00 2001
From: sws <1141121512@qq.com>
Date: Mon, 12 Aug 2024 10:50:50 +0800
Subject: [PATCH 1/6] =?UTF-8?q?1.shopxo-diy=E8=A3=85=E4=BF=AE=E9=A1=B9?=
=?UTF-8?q?=E7=9B=AE=EF=BC=8C=E4=BB=A3=E7=A0=81=E5=BC=95=E5=85=A5=20sws=20?=
=?UTF-8?q?2024-08-12?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.development | 9 +
.env.production | 8 +
.env.staging | 6 +
.eslintignore | 16 +
.eslintrc-auto-import.json | 290 ++
.eslintrc.cjs | 48 +
.prettierignore | 12 +
.prettierrc.cjs | 37 +
package.json | 2 +-
src/types/auto-imports.d.ts | 279 --
yarn-error.log | 5920 -----------------------------------
11 files changed, 427 insertions(+), 6200 deletions(-)
create mode 100644 .env.development
create mode 100644 .env.production
create mode 100644 .env.staging
create mode 100644 .eslintignore
create mode 100644 .eslintrc-auto-import.json
create mode 100644 .eslintrc.cjs
create mode 100644 .prettierignore
create mode 100644 .prettierrc.cjs
delete mode 100644 yarn-error.log
diff --git a/.env.development b/.env.development
new file mode 100644
index 00000000..1c4d07ed
--- /dev/null
+++ b/.env.development
@@ -0,0 +1,9 @@
+## 开发环境
+
+# 变量必须以 VITE_ 为前缀才能暴露给外部读取
+NODE_ENV='dev'
+
+VITE_APP_TITLE = 'shopxo'
+VITE_APP_PORT = 3000
+VITE_APP_BASE_API = '/dev-api'
+VITE_APP_BASE_API_URL = 'http://shopxo.com/'
\ No newline at end of file
diff --git a/.env.production b/.env.production
new file mode 100644
index 00000000..fd5b37f3
--- /dev/null
+++ b/.env.production
@@ -0,0 +1,8 @@
+## 生产环境
+# 变量必须以 VITE_ 为前缀才能暴露给外部读取
+NODE_ENV='pro'
+
+VITE_APP_TITLE = 'shopxo'
+VITE_APP_PORT = 3000
+VITE_APP_BASE_API = '/prod-api'
+VITE_APP_BASE_API_URL = 'http://localhost:3000'
\ No newline at end of file
diff --git a/.env.staging b/.env.staging
new file mode 100644
index 00000000..7a0b3d37
--- /dev/null
+++ b/.env.staging
@@ -0,0 +1,6 @@
+## 模拟环境
+NODE_ENV='staging'
+
+VITE_APP_TITLE = 'vue3-element-admin'
+VITE_APP_PORT = 3000
+VITE_APP_BASE_API = '/prod--api'
diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 00000000..1d7fd6ca
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,16 @@
+dist
+node_modules
+public
+types/auto-imports.d.ts
+types/components.d.ts
+.husky
+.vscode
+.idea
+*.sh
+*.md
+
+src/assets
+
+.eslintrc.cjs
+.prettierrc.cjs
+.stylelintrc.cjs
\ No newline at end of file
diff --git a/.eslintrc-auto-import.json b/.eslintrc-auto-import.json
new file mode 100644
index 00000000..48212252
--- /dev/null
+++ b/.eslintrc-auto-import.json
@@ -0,0 +1,290 @@
+{
+ "globals": {
+ "Component": true,
+ "ComponentPublicInstance": true,
+ "ComputedRef": true,
+ "EffectScope": true,
+ "ExtractDefaultPropTypes": true,
+ "ExtractPropTypes": true,
+ "ExtractPublicPropTypes": true,
+ "InjectionKey": true,
+ "PropType": true,
+ "Ref": true,
+ "VNode": true,
+ "WritableComputedRef": true,
+ "asyncComputed": true,
+ "autoResetRef": true,
+ "computed": true,
+ "computedAsync": true,
+ "computedEager": true,
+ "computedInject": true,
+ "computedWithControl": true,
+ "controlledComputed": true,
+ "controlledRef": true,
+ "createApp": true,
+ "createEventHook": true,
+ "createGlobalState": true,
+ "createInjectionState": true,
+ "createReactiveFn": true,
+ "createReusableTemplate": true,
+ "createSharedComposable": true,
+ "createTemplatePromise": true,
+ "createUnrefFn": true,
+ "customRef": true,
+ "debouncedRef": true,
+ "debouncedWatch": true,
+ "defineAsyncComponent": true,
+ "defineComponent": true,
+ "eagerComputed": true,
+ "effectScope": true,
+ "extendRef": true,
+ "getCurrentInstance": true,
+ "getCurrentScope": true,
+ "h": true,
+ "ignorableWatch": true,
+ "inject": true,
+ "injectLocal": true,
+ "isDefined": true,
+ "isProxy": true,
+ "isReactive": true,
+ "isReadonly": true,
+ "isRef": true,
+ "makeDestructurable": true,
+ "markRaw": true,
+ "nextTick": true,
+ "onActivated": true,
+ "onBeforeMount": true,
+ "onBeforeUnmount": true,
+ "onBeforeUpdate": true,
+ "onClickOutside": true,
+ "onDeactivated": true,
+ "onErrorCaptured": true,
+ "onKeyStroke": true,
+ "onLongPress": true,
+ "onMounted": true,
+ "onRenderTracked": true,
+ "onRenderTriggered": true,
+ "onScopeDispose": true,
+ "onServerPrefetch": true,
+ "onStartTyping": true,
+ "onUnmounted": true,
+ "onUpdated": true,
+ "pausableWatch": true,
+ "provide": true,
+ "provideLocal": true,
+ "reactify": true,
+ "reactifyObject": true,
+ "reactive": true,
+ "reactiveComputed": true,
+ "reactiveOmit": true,
+ "reactivePick": true,
+ "readonly": true,
+ "ref": true,
+ "refAutoReset": true,
+ "refDebounced": true,
+ "refDefault": true,
+ "refThrottled": true,
+ "refWithControl": true,
+ "resolveComponent": true,
+ "resolveRef": true,
+ "resolveUnref": true,
+ "shallowReactive": true,
+ "shallowReadonly": true,
+ "shallowRef": true,
+ "syncRef": true,
+ "syncRefs": true,
+ "templateRef": true,
+ "throttledRef": true,
+ "throttledWatch": true,
+ "toRaw": true,
+ "toReactive": true,
+ "toRef": true,
+ "toRefs": true,
+ "toValue": true,
+ "triggerRef": true,
+ "tryOnBeforeMount": true,
+ "tryOnBeforeUnmount": true,
+ "tryOnMounted": true,
+ "tryOnScopeDispose": true,
+ "tryOnUnmounted": true,
+ "unref": true,
+ "unrefElement": true,
+ "until": true,
+ "useActiveElement": true,
+ "useAnimate": true,
+ "useArrayDifference": true,
+ "useArrayEvery": true,
+ "useArrayFilter": true,
+ "useArrayFind": true,
+ "useArrayFindIndex": true,
+ "useArrayFindLast": true,
+ "useArrayIncludes": true,
+ "useArrayJoin": true,
+ "useArrayMap": true,
+ "useArrayReduce": true,
+ "useArraySome": true,
+ "useArrayUnique": true,
+ "useAsyncQueue": true,
+ "useAsyncState": true,
+ "useAttrs": true,
+ "useBase64": true,
+ "useBattery": true,
+ "useBluetooth": true,
+ "useBreakpoints": true,
+ "useBroadcastChannel": true,
+ "useBrowserLocation": true,
+ "useCached": true,
+ "useClipboard": true,
+ "useClipboardItems": true,
+ "useCloned": true,
+ "useColorMode": true,
+ "useConfirmDialog": true,
+ "useCounter": true,
+ "useCssModule": true,
+ "useCssVar": true,
+ "useCssVars": true,
+ "useCurrentElement": true,
+ "useCycleList": true,
+ "useDark": true,
+ "useDateFormat": true,
+ "useDebounce": true,
+ "useDebounceFn": true,
+ "useDebouncedRefHistory": true,
+ "useDeviceMotion": true,
+ "useDeviceOrientation": true,
+ "useDevicePixelRatio": true,
+ "useDevicesList": true,
+ "useDisplayMedia": true,
+ "useDocumentVisibility": true,
+ "useDraggable": true,
+ "useDropZone": true,
+ "useElementBounding": true,
+ "useElementByPoint": true,
+ "useElementHover": true,
+ "useElementSize": true,
+ "useElementVisibility": true,
+ "useEventBus": true,
+ "useEventListener": true,
+ "useEventSource": true,
+ "useEyeDropper": true,
+ "useFavicon": true,
+ "useFetch": true,
+ "useFileDialog": true,
+ "useFileSystemAccess": true,
+ "useFocus": true,
+ "useFocusWithin": true,
+ "useFps": true,
+ "useFullscreen": true,
+ "useGamepad": true,
+ "useGeolocation": true,
+ "useIdle": true,
+ "useImage": true,
+ "useInfiniteScroll": true,
+ "useIntersectionObserver": true,
+ "useInterval": true,
+ "useIntervalFn": true,
+ "useKeyModifier": true,
+ "useLastChanged": true,
+ "useLocalStorage": true,
+ "useMagicKeys": true,
+ "useManualRefHistory": true,
+ "useMediaControls": true,
+ "useMediaQuery": true,
+ "useMemoize": true,
+ "useMemory": true,
+ "useMounted": true,
+ "useMouse": true,
+ "useMouseInElement": true,
+ "useMousePressed": true,
+ "useMutationObserver": true,
+ "useNavigatorLanguage": true,
+ "useNetwork": true,
+ "useNow": true,
+ "useObjectUrl": true,
+ "useOffsetPagination": true,
+ "useOnline": true,
+ "usePageLeave": true,
+ "useParallax": true,
+ "useParentElement": true,
+ "usePerformanceObserver": true,
+ "usePermission": true,
+ "usePointer": true,
+ "usePointerLock": true,
+ "usePointerSwipe": true,
+ "usePreferredColorScheme": true,
+ "usePreferredContrast": true,
+ "usePreferredDark": true,
+ "usePreferredLanguages": true,
+ "usePreferredReducedMotion": true,
+ "usePrevious": true,
+ "useRafFn": true,
+ "useRefHistory": true,
+ "useResizeObserver": true,
+ "useScreenOrientation": true,
+ "useScreenSafeArea": true,
+ "useScriptTag": true,
+ "useScroll": true,
+ "useScrollLock": true,
+ "useSessionStorage": true,
+ "useShare": true,
+ "useSlots": true,
+ "useSorted": true,
+ "useSpeechRecognition": true,
+ "useSpeechSynthesis": true,
+ "useStepper": true,
+ "useStorage": true,
+ "useStorageAsync": true,
+ "useStyleTag": true,
+ "useSupported": true,
+ "useSwipe": true,
+ "useTemplateRefsList": true,
+ "useTextDirection": true,
+ "useTextSelection": true,
+ "useTextareaAutosize": true,
+ "useThrottle": true,
+ "useThrottleFn": true,
+ "useThrottledRefHistory": true,
+ "useTimeAgo": true,
+ "useTimeout": true,
+ "useTimeoutFn": true,
+ "useTimeoutPoll": true,
+ "useTimestamp": true,
+ "useTitle": true,
+ "useToNumber": true,
+ "useToString": true,
+ "useToggle": true,
+ "useTransition": true,
+ "useUrlSearchParams": true,
+ "useUserMedia": true,
+ "useVModel": true,
+ "useVModels": true,
+ "useVibrate": true,
+ "useVirtualList": true,
+ "useWakeLock": true,
+ "useWebNotification": true,
+ "useWebSocket": true,
+ "useWebWorker": true,
+ "useWebWorkerFn": true,
+ "useWindowFocus": true,
+ "useWindowScroll": true,
+ "useWindowSize": true,
+ "watch": true,
+ "watchArray": true,
+ "watchAtMost": true,
+ "watchDebounced": true,
+ "watchDeep": true,
+ "watchEffect": true,
+ "watchIgnorable": true,
+ "watchImmediate": true,
+ "watchOnce": true,
+ "watchPausable": true,
+ "watchPostEffect": true,
+ "watchSyncEffect": true,
+ "watchThrottled": true,
+ "watchTriggerable": true,
+ "watchWithFilter": true,
+ "whenever": true,
+ "ElMessageBox": true,
+ "ElMessage": true
+ }
+}
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
new file mode 100644
index 00000000..70e3f89b
--- /dev/null
+++ b/.eslintrc.cjs
@@ -0,0 +1,48 @@
+// /* eslint-env node */
+// require('@rushstack/eslint-patch/modern-module-resolution')
+
+// module.exports = {
+// root: true,
+// 'extends': [
+// 'plugin:vue/vue3-essential',
+// 'eslint:recommended',
+// '@vue/eslint-config-typescript',
+// '@vue/eslint-config-prettier/skip-formatting',
+// "./.eslintrc-auto-import.json"
+// ],
+// parserOptions: {
+// ecmaVersion: 'latest'
+// }
+// }
+module.exports = {
+ env: {
+ browser: true,
+ es2021: true,
+ node: true,
+ },
+ parser: "vue-eslint-parser",
+ extends: [
+ // 参考vuejs官方的eslint配置: https://eslint.vuejs.org/user-guide/#usage
+ "plugin:vue/vue3-recommended",
+ "./.eslintrc-auto-import.json",
+ "prettier",
+ ],
+ parserOptions: {
+ ecmaVersion: "latest",
+ sourceType: "module",
+ parser: "@typescript-eslint/parser",
+ },
+ plugins: ["vue", "@typescript-eslint"],
+ rules: {
+ "vue/multi-word-component-names": "off", // 关闭组件名必须多字: https://eslint.vuejs.org/rules/multi-word-component-names.html
+ "@typescript-eslint/no-empty-function": "off", // 关闭空方法检查
+ "@typescript-eslint/no-explicit-any": "off", // 关闭any类型的警告
+ "vue/no-v-model-argument": "off",
+ "@typescript-eslint/no-non-null-assertion": "off",
+ },
+ // https://eslint.org/docs/latest/use/configure/language-options#specifying-globals
+ globals: {
+ DialogOption: "readonly",
+ OptionType: "readonly",
+ },
+ };
\ No newline at end of file
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 00000000..ad7cb516
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,12 @@
+dist
+node_modules
+public
+types/auto-imports.d.ts
+types/components.d.ts
+.husky
+.vscode
+.idea
+*.sh
+*.md
+
+src/assets
diff --git a/.prettierrc.cjs b/.prettierrc.cjs
new file mode 100644
index 00000000..3eae6fa5
--- /dev/null
+++ b/.prettierrc.cjs
@@ -0,0 +1,37 @@
+module.exports = {
+ // (x)=>{},单个参数箭头函数是否显示小括号。(always:始终显示;avoid:省略括号。默认:always)
+ arrowParens: "always",
+ // 开始标签的右尖括号是否跟随在最后一行属性末尾,默认false
+ bracketSameLine: false,
+ // 对象字面量的括号之间打印空格 (true - Example: { foo: bar } ; false - Example: {foo:bar})
+ bracketSpacing: true,
+ // 是否格式化一些文件中被嵌入的代码片段的风格(auto|off;默认auto)
+ embeddedLanguageFormatting: "auto",
+ // 指定 HTML 文件的空格敏感度 (css|strict|ignore;默认css)
+ htmlWhitespaceSensitivity: "css",
+ // 当文件已经被 Prettier 格式化之后,是否会在文件顶部插入一个特殊的 @format 标记,默认false
+ insertPragma: false,
+ // 在 JSX 中使用单引号替代双引号,默认false
+ jsxSingleQuote: false,
+ // 每行最多字符数量,超出换行(默认80)
+ printWidth: 180000000,
+ // 超出打印宽度 (always | never | preserve )
+ proseWrap: "preserve",
+ // 对象属性是否使用引号(as-needed | consistent | preserve;默认as-needed:对象的属性需要加引号才添加;)
+ quoteProps: "as-needed",
+ // 是否只格式化在文件顶部包含特定注释(@prettier| @format)的文件,默认false
+ requirePragma: false,
+ // 结尾添加分号
+ semi: true,
+ // 使用单引号 (true:单引号;false:双引号)
+ singleQuote: true,
+ // 缩进空格数,默认2个空格
+ tabWidth: 4,
+ // 元素末尾是否加逗号,默认es5: ES5中的 objects, arrays 等会添加逗号,TypeScript 中的 type 后不加逗号
+ trailingComma: "es5",
+ // 指定缩进方式,空格或tab,默认false,即使用空格
+ useTabs: false,
+ // vue 文件中是否缩进
diff --git a/src/components/model-hot-zone/model-hot-zone-content.vue b/src/components/model-hot-zone/model-hot-zone-content.vue
index bc166e46..591f8496 100644
--- a/src/components/model-hot-zone/model-hot-zone-content.vue
+++ b/src/components/model-hot-zone/model-hot-zone-content.vue
@@ -29,6 +29,7 @@ const update_hot_data = (val: any) => {
} else {
form.value.hot.img = '';
}
+ form.value.hot.hot = [];
};
diff --git a/src/components/model-hot-zone/model-hot-zone-content.vue b/src/components/model-hot-zone/model-hot-zone-content.vue
index 591f8496..c463f30a 100644
--- a/src/components/model-hot-zone/model-hot-zone-content.vue
+++ b/src/components/model-hot-zone/model-hot-zone-content.vue
@@ -4,7 +4,7 @@
内容设置
-
+
@@ -23,13 +23,13 @@ const props = defineProps({
});
const form = ref(props.value);
-const update_hot_data = (val: any) => {
+const update_upload_data = (val: any) => {
if (val.length > 0) {
form.value.hot.img = val[0].url;
} else {
form.value.hot.img = '';
}
- form.value.hot.hot = [];
+ form.value.hot.data = [];
};