diff --git a/.env.base b/.env.base deleted file mode 100644 index cf433822..00000000 --- a/.env.base +++ /dev/null @@ -1,19 +0,0 @@ -# 本地开发环境 -NODE_ENV=development - -VITE_DEV=true - -# 请求路径 -VITE_BASE_URL='http://127.0.0.1:48080' - -# 上传路径 -VITE_UPLOAD_URL='http://127.0.0.1:48080/admin-api/infra/file/upload' - -# 接口前缀 -VITE_API_BASEPATH=/dev-api - -# 接口地址 -VITE_API_URL=/admin-api - -# 打包路径 -VITE_BASE_PATH=/ diff --git a/.env.dev b/.env.dev index 9200ece2..21ffa920 100644 --- a/.env.dev +++ b/.env.dev @@ -1,13 +1,13 @@ -# 开发环境 +# 开发环境:本地只启动前端项目,依赖开发环境(后端、APP) NODE_ENV=development -VITE_DEV=false +VITE_DEV=true # 请求路径 -VITE_BASE_URL='http://localhost:48080' +VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn' # 上传路径 -VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' +VITE_UPLOAD_URL='http://api-dashboard.yudao.iocoder.cn/admin-api/infra/file/upload' # 接口前缀 VITE_API_BASEPATH=/dev-api @@ -15,17 +15,23 @@ VITE_API_BASEPATH=/dev-api # 接口地址 VITE_API_URL=/admin-api -# 打包路径 -VITE_BASE_PATH=/ - # 是否删除debugger -VITE_DROP_DEBUGGER=true +VITE_DROP_DEBUGGER=false # 是否删除console.log VITE_DROP_CONSOLE=false # 是否sourcemap -VITE_SOURCEMAP=false +VITE_SOURCEMAP=true + +# 打包路径 +VITE_BASE_PATH=/ # 输出路径 VITE_OUT_DIR=dist + +# 商城H5会员端域名 +VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn' + +# 验证码的开关 +VITE_APP_CAPTCHA_ENABLE=false diff --git a/.env.front b/.env.local-dev similarity index 53% rename from .env.front rename to .env.local-dev index 1629ff9f..2eb968c4 100644 --- a/.env.front +++ b/.env.local-dev @@ -1,13 +1,13 @@ -# 本地开发环境 +# 本地开发环境:本地启动所有项目(前端、后端、APP)时使用,不依赖外部环境 NODE_ENV=development VITE_DEV=true # 请求路径 -VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn' +VITE_BASE_URL='http://localhost:48080' # 上传路径 -VITE_UPLOAD_URL='http://api-dashboard.yudao.iocoder.cn/admin-api/infra/file/upload' +VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' # 接口前缀 VITE_API_BASEPATH=/dev-api @@ -15,12 +15,6 @@ VITE_API_BASEPATH=/dev-api # 接口地址 VITE_API_URL=/admin-api -# 打包路径 -VITE_BASE_PATH=/ - -# 项目本地运行端口号, 与.vscode/launch.json配合 -VITE_PORT=80 - # 是否删除debugger VITE_DROP_DEBUGGER=false @@ -28,7 +22,13 @@ VITE_DROP_DEBUGGER=false VITE_DROP_CONSOLE=false # 是否sourcemap -VITE_SOURCEMAP=true +VITE_SOURCEMAP=false + +# 打包路径 +VITE_BASE_PATH=/ + +# 商城H5会员端域名 +VITE_MALL_H5_DOMAIN='http://localhost:3000' # 验证码的开关 VITE_APP_CAPTCHA_ENABLE=false diff --git a/.env.pro b/.env.prod similarity index 75% rename from .env.pro rename to .env.prod index 8348e02e..070b43a7 100644 --- a/.env.pro +++ b/.env.prod @@ -1,4 +1,4 @@ -# 生产环境 +# 生产环境:只在打包时使用 NODE_ENV=production VITE_DEV=false @@ -28,4 +28,7 @@ VITE_SOURCEMAP=false VITE_BASE_PATH=/ # 输出路径 -VITE_OUT_DIR=dist-pro +VITE_OUT_DIR=dist-prod + +# 商城H5会员端域名 +VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn' diff --git a/.env.stage b/.env.stage index d7157fbb..c0edf340 100644 --- a/.env.stage +++ b/.env.stage @@ -1,4 +1,4 @@ -# 生产环境 +# 预发布环境:只在打包时使用 NODE_ENV=production VITE_DEV=false @@ -29,3 +29,6 @@ VITE_BASE_PATH='http://static-vue3.yudao.iocoder.cn/' # 输出路径 VITE_OUT_DIR=dist-stage + +# 商城H5会员端域名 +VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn' diff --git a/.env.static b/.env.test similarity index 76% rename from .env.static rename to .env.test index 034a7f4d..217ac6e2 100644 --- a/.env.static +++ b/.env.test @@ -1,4 +1,4 @@ -# 开发环境 +# 测试环境:只在打包时使用 NODE_ENV=production VITE_DEV=false @@ -28,4 +28,7 @@ VITE_SOURCEMAP=false VITE_BASE_PATH=/admin-ui-vue3/ # 输出路径 -VITE_OUT_DIR=dist-dev +VITE_OUT_DIR=dist-test + +# 商城H5会员端域名 +VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn' diff --git a/package.json b/package.json index bc01d35f..2bf975ca 100644 --- a/package.json +++ b/package.json @@ -6,18 +6,17 @@ "private": false, "scripts": { "i": "pnpm install", - "dev": "vite --mode base", - "front": "vite --mode front", + "local-dev": "vite --mode local-dev", + "dev": "vite --mode dev", "ts:check": "vue-tsc --noEmit", - "build:pro": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode pro", + "build:local-dev": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode local-dev", "build:dev": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode dev", - "build:base": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode base", + "build:test": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode test", "build:stage": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode stage", - "build:static": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode static", - "build:front": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode front", - "serve:pro": "vite preview --mode pro", + "build:prod": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode prod", "serve:dev": "vite preview --mode dev", - "preview": "pnpm build:base && vite preview", + "serve:prod": "vite preview --mode prod", + "preview": "pnpm build:local-dev && vite preview", "clean": "npx rimraf node_modules", "clean:cache": "npx rimraf node_modules/.cache", "lint:eslint": "eslint --fix --ext .js,.ts,.vue ./src", diff --git a/src/components/DiyEditor/components/ComponentLibrary.vue b/src/components/DiyEditor/components/ComponentLibrary.vue index e319a5c2..64b2febc 100644 --- a/src/components/DiyEditor/components/ComponentLibrary.vue +++ b/src/components/DiyEditor/components/ComponentLibrary.vue @@ -82,7 +82,9 @@ watch( // 克隆组件 const handleCloneComponent = (component: DiyComponent) => { - return cloneDeep(component) + const instance = cloneDeep(component) + instance.uid = new Date().getTime() + return instance } diff --git a/src/components/DiyEditor/components/mobile/Carousel/property.vue b/src/components/DiyEditor/components/mobile/Carousel/property.vue index 972ba507..c3a51542 100644 --- a/src/components/DiyEditor/components/mobile/Carousel/property.vue +++ b/src/components/DiyEditor/components/mobile/Carousel/property.vue @@ -39,87 +39,60 @@ - 拖动左上角的小圆点可对其排序 - diff --git a/src/components/DiyEditor/components/mobile/MenuGrid/property.vue b/src/components/DiyEditor/components/mobile/MenuGrid/property.vue index b92e2099..7940fd0f 100644 --- a/src/components/DiyEditor/components/mobile/MenuGrid/property.vue +++ b/src/components/DiyEditor/components/mobile/MenuGrid/property.vue @@ -9,72 +9,50 @@ - 菜单设置 - 拖动左侧的小圆点可以调整顺序 - diff --git a/src/components/DiyEditor/components/mobile/MenuList/property.vue b/src/components/DiyEditor/components/mobile/MenuList/property.vue index 0ed6035c..a5fb4603 100644 --- a/src/components/DiyEditor/components/mobile/MenuList/property.vue +++ b/src/components/DiyEditor/components/mobile/MenuList/property.vue @@ -5,55 +5,34 @@ -
- - - -
- - - 添加菜单 - - + + +
diff --git a/src/components/DiyEditor/components/mobile/MenuSwiper/property.vue b/src/components/DiyEditor/components/mobile/MenuSwiper/property.vue index 31e158ce..bb7f8ce1 100644 --- a/src/components/DiyEditor/components/mobile/MenuSwiper/property.vue +++ b/src/components/DiyEditor/components/mobile/MenuSwiper/property.vue @@ -22,63 +22,42 @@ - 菜单设置 - 拖动左侧的小圆点可以调整顺序 - diff --git a/src/components/DiyEditor/components/mobile/NoticeBar/config.ts b/src/components/DiyEditor/components/mobile/NoticeBar/config.ts index 03e7143a..b6b0860d 100644 --- a/src/components/DiyEditor/components/mobile/NoticeBar/config.ts +++ b/src/components/DiyEditor/components/mobile/NoticeBar/config.ts @@ -1,4 +1,4 @@ -import { DiyComponent } from '@/components/DiyEditor/util' +import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' /** 公告栏属性 */ export interface NoticeBarProperty { @@ -10,6 +10,8 @@ export interface NoticeBarProperty { backgroundColor: string // 文字颜色 textColor: string + // 组件样式 + style: ComponentStyle } /** 内容属性 */ @@ -34,6 +36,11 @@ export const component = { } ], backgroundColor: '#fff', - textColor: '#333' + textColor: '#333', + style: { + bgType: 'color', + bgColor: '#fff', + marginBottom: 8 + } as ComponentStyle } } as DiyComponent diff --git a/src/components/DiyEditor/components/mobile/NoticeBar/property.vue b/src/components/DiyEditor/components/mobile/NoticeBar/property.vue index a3eefebe..7129d7cb 100644 --- a/src/components/DiyEditor/components/mobile/NoticeBar/property.vue +++ b/src/components/DiyEditor/components/mobile/NoticeBar/property.vue @@ -1,58 +1,37 @@ diff --git a/src/components/DiyEditor/components/mobile/SearchBar/property.vue b/src/components/DiyEditor/components/mobile/SearchBar/property.vue index d121a1e3..90027027 100644 --- a/src/components/DiyEditor/components/mobile/SearchBar/property.vue +++ b/src/components/DiyEditor/components/mobile/SearchBar/property.vue @@ -1,81 +1,64 @@