Преглед на файлове

Merge branch 'dev-furffico'

furffico преди 1 година
родител
ревизия
2093841bc7

+ 1 - 1
.env.production

@@ -2,7 +2,7 @@
 ENV = 'production'
 
 // api接口请求地址
-VUE_APP_BASE_API = 'http://127.0.0.1:8085'
+VUE_APP_BASE_API = ''
 
 # 静态资源文件url
 VUE_APP_RESOURCES_URL = 'https://img.mall4j.com/'

+ 4 - 2
package.json

@@ -5,7 +5,8 @@
   "scripts": {
     "build": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build",
     "lint": "eslint --ext .js,.vue src",
-    "dev": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve"
+    "dev": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
+    "analyze": "NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=production ANALYZER=true vue-cli-service build"
   },
   "dependencies": {
     "@smallwei/avue": "2.8.27",
@@ -54,7 +55,8 @@
     "script-ext-html-webpack-plugin": "^2.1.3",
     "typescript": "~4.5.5",
     "vue-loader": "^15.10.0",
-    "vue-template-compiler": "2.7.14"
+    "vue-template-compiler": "2.7.14",
+    "webpack-bundle-analyzer": "^4.9.0"
   },
   "browserslist": [
     "> 1%",

+ 86 - 0
pnpm-lock.yaml

@@ -142,6 +142,9 @@ devDependencies:
   vue-template-compiler:
     specifier: 2.7.14
     version: registry.npmmirror.com/vue-template-compiler@2.7.14
+  webpack-bundle-analyzer:
+    specifier: ^4.9.0
+    version: registry.npmmirror.com/webpack-bundle-analyzer@4.9.0
 
 packages:
 
@@ -1731,6 +1734,13 @@ packages:
       minimist: registry.npmmirror.com/minimist@1.2.8
     dev: true
 
+  registry.npmmirror.com/@discoveryjs/json-ext@0.5.7:
+    resolution: {integrity: sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz}
+    name: '@discoveryjs/json-ext'
+    version: 0.5.7
+    engines: {node: '>=10.0.0'}
+    dev: true
+
   registry.npmmirror.com/@hapi/address@2.1.4:
     resolution: {integrity: sha512-QD1PhQk+s31P1ixsX0H0Suoupp3VMXzIVMSwobR3F3MSUO2YCV0B7xqLcUw/Bh8yuvd3LhpyqLQWTNcRmp6IdQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@hapi/address/-/address-2.1.4.tgz}
     name: '@hapi/address'
@@ -2052,6 +2062,12 @@ packages:
     engines: {node: '>= 6'}
     dev: true
 
+  registry.npmmirror.com/@polka/url@1.0.0-next.21:
+    resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@polka/url/-/url-1.0.0-next.21.tgz}
+    name: '@polka/url'
+    version: 1.0.0-next.21
+    dev: true
+
   registry.npmmirror.com/@smallwei/avue@2.8.27:
     resolution: {integrity: sha512-qRENOs91FIJ6nUdaAoKUt9rDr7DabvRsk5vMF/ZtmvBcw3x8xeR5LVhpnpTdSTkOGI5nfHKT0AT8fLrL9DMQ8w==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@smallwei/avue/-/avue-2.8.27.tgz}
     name: '@smallwei/avue'
@@ -3255,6 +3271,13 @@ packages:
     engines: {node: '>=0.4.0'}
     dev: true
 
+  registry.npmmirror.com/acorn-walk@8.2.0:
+    resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/acorn-walk/-/acorn-walk-8.2.0.tgz}
+    name: acorn-walk
+    version: 8.2.0
+    engines: {node: '>=0.4.0'}
+    dev: true
+
   registry.npmmirror.com/acorn@5.7.4:
     resolution: {integrity: sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/acorn/-/acorn-5.7.4.tgz}
     name: acorn
@@ -4969,6 +4992,13 @@ packages:
     version: 2.20.3
     dev: true
 
+  registry.npmmirror.com/commander@7.2.0:
+    resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/commander/-/commander-7.2.0.tgz}
+    name: commander
+    version: 7.2.0
+    engines: {node: '>= 10'}
+    dev: true
+
   registry.npmmirror.com/commondir@1.0.1:
     resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/commondir/-/commondir-1.0.1.tgz}
     name: commondir
@@ -7775,6 +7805,15 @@ packages:
       pify: registry.npmmirror.com/pify@4.0.1
     dev: true
 
+  registry.npmmirror.com/gzip-size@6.0.0:
+    resolution: {integrity: sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/gzip-size/-/gzip-size-6.0.0.tgz}
+    name: gzip-size
+    version: 6.0.0
+    engines: {node: '>=10'}
+    dependencies:
+      duplexer: registry.npmmirror.com/duplexer@0.1.2
+    dev: true
+
   registry.npmmirror.com/handle-thing@2.0.1:
     resolution: {integrity: sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/handle-thing/-/handle-thing-2.0.1.tgz}
     name: handle-thing
@@ -10439,6 +10478,13 @@ packages:
       run-queue: registry.npmmirror.com/run-queue@1.0.3
     dev: true
 
+  registry.npmmirror.com/mrmime@1.0.1:
+    resolution: {integrity: sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/mrmime/-/mrmime-1.0.1.tgz}
+    name: mrmime
+    version: 1.0.1
+    engines: {node: '>=10'}
+    dev: true
+
   registry.npmmirror.com/ms@2.0.0:
     resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz}
     name: ms
@@ -13036,6 +13082,17 @@ packages:
       is-arrayish: registry.npmmirror.com/is-arrayish@0.3.2
     dev: true
 
+  registry.npmmirror.com/sirv@1.0.19:
+    resolution: {integrity: sha512-JuLThK3TnZG1TAKDwNIqNq6QA2afLOCcm+iE8D1Kj3GA40pSPsxQjjJl0J8X3tsR7T+CP1GavpzLwYkgVLWrZQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/sirv/-/sirv-1.0.19.tgz}
+    name: sirv
+    version: 1.0.19
+    engines: {node: '>= 10'}
+    dependencies:
+      '@polka/url': registry.npmmirror.com/@polka/url@1.0.0-next.21
+      mrmime: registry.npmmirror.com/mrmime@1.0.1
+      totalist: registry.npmmirror.com/totalist@1.1.0
+    dev: true
+
   registry.npmmirror.com/sisteransi@1.0.5:
     resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/sisteransi/-/sisteransi-1.0.5.tgz}
     name: sisteransi
@@ -13972,6 +14029,13 @@ packages:
     version: 1.0.7
     dev: true
 
+  registry.npmmirror.com/totalist@1.1.0:
+    resolution: {integrity: sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/totalist/-/totalist-1.1.0.tgz}
+    name: totalist
+    version: 1.1.0
+    engines: {node: '>=6'}
+    dev: true
+
   registry.npmmirror.com/tough-cookie@2.5.0:
     resolution: {integrity: sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/tough-cookie/-/tough-cookie-2.5.0.tgz}
     name: tough-cookie
@@ -14918,6 +14982,28 @@ packages:
       - utf-8-validate
     dev: true
 
+  registry.npmmirror.com/webpack-bundle-analyzer@4.9.0:
+    resolution: {integrity: sha512-+bXGmO1LyiNx0i9enBu3H8mv42sj/BJWhZNFwjz92tVnBa9J3JMGo2an2IXlEleoDOPn/Hofl5hr/xCpObUDtw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.9.0.tgz}
+    name: webpack-bundle-analyzer
+    version: 4.9.0
+    engines: {node: '>= 10.13.0'}
+    hasBin: true
+    dependencies:
+      '@discoveryjs/json-ext': registry.npmmirror.com/@discoveryjs/json-ext@0.5.7
+      acorn: registry.npmmirror.com/acorn@8.10.0
+      acorn-walk: registry.npmmirror.com/acorn-walk@8.2.0
+      chalk: registry.npmmirror.com/chalk@4.1.2
+      commander: registry.npmmirror.com/commander@7.2.0
+      gzip-size: registry.npmmirror.com/gzip-size@6.0.0
+      lodash: registry.npmmirror.com/lodash@4.17.20
+      opener: registry.npmmirror.com/opener@1.5.2
+      sirv: registry.npmmirror.com/sirv@1.0.19
+      ws: registry.npmmirror.com/ws@7.5.9
+    transitivePeerDependencies:
+      - bufferutil
+      - utf-8-validate
+    dev: true
+
   registry.npmmirror.com/webpack-chain@6.5.1:
     resolution: {integrity: sha512-7doO/SRtLu8q5WM0s7vPKPWX580qhi0/yBHkOxNkv50f6qB76Zy9o2wRTrrPULqYTvQlVHuvbA8v+G5ayuUDsA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/webpack-chain/-/webpack-chain-6.5.1.tgz}
     name: webpack-chain

+ 30 - 0
src/assets/scss/custom.scss

@@ -0,0 +1,30 @@
+.icon-button .el-button {
+  padding: 6px 10px;
+  font-size: medium;
+  border-radius: 10px;
+}
+
+.site-navbar__brand {
+  padding: 0 20px;
+}
+
+.site-sidebar--fold {
+  .site-navbar__brand {
+    padding: 0;
+  }
+}
+
+
+.icon-svg {
+  width: 1em;
+  height: 1em;
+  fill: currentColor;
+  overflow: hidden;
+}
+
+.navbar-fold-icon{
+  &.folded{
+    rotate: 180deg;
+  }
+  transition: rotate .3s ease-in-out;
+}

+ 1 - 0
src/assets/scss/index.scss

@@ -1,3 +1,4 @@
 @import "normalize";       // api: https://github.com/necolas/normalize.css/
 @import "variables";       // 站点变量
 @import "base";
+@import "custom.scss";

+ 29 - 42
src/components/icon-svg/index.vue

@@ -1,51 +1,38 @@
 <template>
-  <svg
-    :class="getClassName"
-    :width="width"
-    :height="height"
-    aria-hidden="true">
+  <svg :class="getClassName" :width="width" :height="height" aria-hidden="true">
     <use :xlink:href="getName"></use>
   </svg>
 </template>
 
 <script>
-  export default {
-    name: 'icon-svg',
-    props: {
-      name: {
-        type: String,
-        required: true
-      },
-      className: {
-        type: String
-      },
-      width: {
-        type: String
-      },
-      height: {
-        type: String
-      }
+export default {
+  name: 'icon-svg',
+  props: {
+    name: {
+      type: String,
+      required: true
     },
-    computed: {
-      getName () {
-        return `#icon-${this.name}`
-      },
-      getClassName () {
-        return [
-          'icon-svg',
-          `icon-svg__${this.name}`,
-          this.className && /\S/.test(this.className) ? `${this.className}` : ''
-        ]
-      }
+    className: {
+      type: String
+    },
+    width: {
+      type: String
+    },
+    height: {
+      type: String
+    }
+  },
+  computed: {
+    getName() {
+      return `#icon-${this.name}`
+    },
+    getClassName() {
+      return [
+        'icon-svg',
+        `icon-svg__${this.name}`,
+        this.className && /\S/.test(this.className) ? `${this.className}` : ''
+      ]
     }
   }
-</script>
-
-<style>
-  .icon-svg {
-    width: 1em;
-    height: 1em;
-    fill: currentColor;
-    overflow: hidden;
-  }
-</style>
+}
+</script>

+ 47 - 47
src/element-ui.js → src/element-ui.ts

@@ -9,15 +9,15 @@
  */
 import 'element-ui/lib/theme-chalk/index.css';
 import {
-  Scrollbar,
+  // Scrollbar,
   Pagination,
   Dialog,
-  Autocomplete,
+  // Autocomplete,
   Dropdown,
   DropdownMenu,
   DropdownItem,
   Menu,
-  Submenu,
+  // Submenu,
   MenuItem,
   MenuItemGroup,
   Input,
@@ -25,9 +25,9 @@ import {
   Radio,
   RadioGroup,
   RadioButton,
-  Checkbox,
-  CheckboxButton,
-  CheckboxGroup,
+  // Checkbox,
+  // CheckboxButton,
+  // CheckboxGroup,
   Switch,
   Select,
   Option,
@@ -37,36 +37,37 @@ import {
   Table,
   TableColumn,
   DatePicker,
-  TimeSelect,
-  TimePicker,
+  // TimeSelect,
+  // TimePicker,
   Popover,
   Tooltip,
-  Breadcrumb,
-  BreadcrumbItem,
+  // Breadcrumb,
+  // BreadcrumbItem,
   Form,
   FormItem,
   Tabs,
   TabPane,
   Tag,
-  Tree,
-  Alert,
-  Slider,
+  // Tree,
+  // Alert,
+  // Slider,
   Icon,
   Row,
   Col,
   Upload,
-  Progress,
-  Badge,
+  // Progress,
+  // Badge,
   Card,
-  Rate,
-  Steps,
-  Step,
-  Carousel,
-  CarouselItem,
+  // Rate,
+  // Steps,
+  // Step,
+  // Carousel,
+  // CarouselItem,
   Collapse,
   CollapseItem,
-  Cascader,
-  ColorPicker,
+  // Cascader,
+  // ColorPicker,
+  Drawer,
   Transfer,
   Container,
   Header,
@@ -79,19 +80,19 @@ import {
   Notification,
   Descriptions,
   DescriptionsItem,
-  Drawer,
 } from 'element-ui'
 
 export default {
-  install(Vue, options) {
+  install(Vue: any, options: any) {
+    // Vue.use(Scrollbar)
     Vue.use(Pagination)
     Vue.use(Dialog)
-    Vue.use(Autocomplete)
+    // Vue.use(Autocomplete)
     Vue.use(Dropdown)
     Vue.use(DropdownMenu)
     Vue.use(DropdownItem)
     Vue.use(Menu)
-    Vue.use(Submenu)
+    // Vue.use(Submenu)
     Vue.use(MenuItem)
     Vue.use(MenuItemGroup)
     Vue.use(Input)
@@ -99,9 +100,9 @@ export default {
     Vue.use(Radio)
     Vue.use(RadioGroup)
     Vue.use(RadioButton)
-    Vue.use(Checkbox)
-    Vue.use(CheckboxButton)
-    Vue.use(CheckboxGroup)
+    // Vue.use(Checkbox)
+    // Vue.use(CheckboxButton)
+    // Vue.use(CheckboxGroup)
     Vue.use(Switch)
     Vue.use(Select)
     Vue.use(Option)
@@ -111,36 +112,37 @@ export default {
     Vue.use(Table)
     Vue.use(TableColumn)
     Vue.use(DatePicker)
-    Vue.use(TimeSelect)
-    Vue.use(TimePicker)
+    // Vue.use(TimeSelect)
+    // Vue.use(TimePicker)
     Vue.use(Popover)
     Vue.use(Tooltip)
-    Vue.use(Breadcrumb)
-    Vue.use(BreadcrumbItem)
+    // Vue.use(Breadcrumb)
+    // Vue.use(BreadcrumbItem)
     Vue.use(Form)
     Vue.use(FormItem)
     Vue.use(Tabs)
     Vue.use(TabPane)
     Vue.use(Tag)
-    Vue.use(Tree)
-    Vue.use(Alert)
-    Vue.use(Slider)
+    // Vue.use(Tree)
+    // Vue.use(Alert)
+    // Vue.use(Slider)
     Vue.use(Icon)
     Vue.use(Row)
     Vue.use(Col)
     Vue.use(Upload)
-    Vue.use(Progress)
-    Vue.use(Badge)
+    // Vue.use(Progress)
+    // Vue.use(Badge)
     Vue.use(Card)
-    Vue.use(Rate)
-    Vue.use(Steps)
-    Vue.use(Step)
-    Vue.use(Carousel)
-    Vue.use(CarouselItem)
+    // Vue.use(Rate)
+    // Vue.use(Steps)
+    // Vue.use(Step)
+    // Vue.use(Carousel)
+    // Vue.use(CarouselItem)
     Vue.use(Collapse)
     Vue.use(CollapseItem)
-    Vue.use(Cascader)
-    Vue.use(ColorPicker)
+    // Vue.use(Cascader)
+    // Vue.use(ColorPicker)
+    Vue.use(Drawer)
     Vue.use(Transfer)
     Vue.use(Container)
     Vue.use(Header)
@@ -149,8 +151,6 @@ export default {
     Vue.use(Footer)
     Vue.use(Descriptions)
     Vue.use(DescriptionsItem)
-    Vue.use(Drawer)
-    Vue.use(Scrollbar)
     Vue.use(Loading.directive)
 
     Vue.prototype.$loading = Loading.service

+ 1 - 0
src/icons/svg/icon-anglesleft.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"/></svg>

+ 1 - 0
src/icons/svg/icon-arrowleft.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"/></svg>

+ 5 - 4
src/main.ts

@@ -4,18 +4,19 @@ import router from '@/router'                 // api: https://github.com/vuejs/v
 import store from '@/store'                   // api: https://github.com/vuejs/vuex
 import VueCookie from 'vue-cookie'            // api: https://github.com/alfhen/vue-cookie
 import '@/icons'                              // api: http://www.iconfont.cn/
-import element from './element-ui'
 import '@/assets/scss/index.scss'
-import httpRequest from '@/utils/httpRequest' // api: https://github.com/axios/axios
 import { isAuth } from '@/utils'
 
 Vue.use(VueCookie)
-Vue.use(element)
 Vue.config.productionTip = false
 
 // 挂载全局
-Vue.prototype.$http = httpRequest // ajax请求方法
 Vue.prototype.isAuth = isAuth     // 权限方法
+Vue.prototype.$shortcut = {
+  notFound() {
+    router.push({ name: "404" })
+  }
+}
 
 // 保存整站vuex本地储存初始状态
 // process.env.VUE_APP_RESOURCES_URL['storeState'] = cloneDeep(store.state)

+ 6 - 1
src/router/index.ts

@@ -71,11 +71,16 @@ export const pages = [
     component: _import("modules/liveroom/liveroomEdit"),
     name: "liveroomEdit",
     meta: { title: "直播间信息", sidebar: false, icon: "", isTab: false }
-  },{
+  }, {
     path: "/liveroom/liveroom-product-jump-record/:id",
     component: _import("modules/liveroom/liveroomProductJumpRecord"),
     name: "liveroomProductJumpRecord",
     meta: { title: "商品跳转记录", sidebar: false, icon: "", isTab: false }
+  }, {
+    path: "/liveroom/product/:id",
+    component: _import("modules/liveroom/liveroomProd"),
+    name: "liveroomProd",
+    meta: { title: "直播间产品", sidebar: false, icon: "", isTab: false }
   },
 ]
 

+ 2 - 1
src/utils/debounce.ts

@@ -10,11 +10,12 @@ export const Debounce = (fn: Function, t: number) => {
 
     let callNow = !timer
 
+    //@ts-ignore
     timer = setTimeout(() => {
       timer = null
     }, delay)
 
     // @ts-ignore
-    if(callNow) fn.apply(this, args)
+    if (callNow) fn.apply(this, args)
   }
 }

+ 49 - 41
src/views/common/404.vue

@@ -12,50 +12,58 @@
 </template>
 
 <script>
-  export default {
-  }
+import { Button } from 'element-ui/lib/button';
+export default {
+  components: { Button }
+}
 </script>
 
 <style lang="scss">
-  .site-wrapper.site-page--not-found {
-    position: absolute;
-    top: 0;
-    right: 0;
-    bottom: 0;
-    left: 0;
-    overflow: hidden;
-    .site-content__wrapper {
-      padding: 0;
-      margin: 0;
-      background-color: #fff;
-    }
-    .site-content {
-      position: fixed;
-      top: 15%;
-      left: 50%;
-      z-index: 2;
-      padding: 30px;
-      text-align: center;
-      transform: translate(-50%, 0);
-    }
-    .not-found-title {
-      margin: 20px 0 15px;
-      font-size: 10em;
-      font-weight: 400;
-      color: rgb(55, 71, 79);
-    }
-    .not-found-desc {
-      margin: 0 0 30px;
-      font-size: 26px;
-      text-transform: uppercase;
-      color: rgb(118, 131, 143);
-      > em {
-        font-style: normal;
-        color: #ee8145;
-      }
-    }
-    .not-found-btn-gohome {
-      margin-left: 30px;
+.site-wrapper.site-page--not-found {
+  position: absolute;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  overflow: hidden;
+
+  .site-content__wrapper {
+    padding: 0;
+    margin: 0;
+    background-color: #fff;
+  }
+
+  .site-content {
+    position: fixed;
+    top: 15%;
+    left: 50%;
+    z-index: 2;
+    padding: 30px;
+    text-align: center;
+    transform: translate(-50%, 0);
+  }
+
+  .not-found-title {
+    margin: 20px 0 15px;
+    font-size: 10em;
+    font-weight: 400;
+    color: rgb(55, 71, 79);
+  }
+
+  .not-found-desc {
+    margin: 0 0 30px;
+    font-size: 26px;
+    text-transform: uppercase;
+    color: rgb(118, 131, 143);
+
+    >em {
+      font-style: normal;
+      color: #ee8145;
     }
   }
+
+  .not-found-btn-gohome {
+    margin-left: 30px;
+  }
+}
 </style>

+ 2 - 9
src/views/common/home.vue

@@ -1,16 +1,9 @@
 <template>
-  <div class="mod-home">
+  <div>
     首页
   </div>
 </template>
 
 <script>
 export default {}
-</script>
-
-<style>
-.mod-home {
-  line-height: 1.5;
-}
-</style>
-
+</script>

+ 4 - 1
src/views/common/login.vue

@@ -43,9 +43,12 @@
 import { getUUID } from '@/utils'
 import Verify from '@/components/verifition/Verify'
 import { encrypt } from '@/utils/crypto'
+import { Form } from "element-ui/lib/form"
+import { FormItem } from "element-ui/lib/form-item"
+
 export default {
   components: {
-    Verify
+    Verify, Form, FormItem
   },
   data() {
     return {

+ 11 - 16
src/views/main-navbar.vue

@@ -12,9 +12,16 @@
     </div>
     <div class="site-navbar__body clearfix">
       <el-menu class="site-navbar__menu" mode="horizontal">
-        <el-menu-item class="site-navbar__switch" index="0" @click="sidebarFold = !sidebarFold">
-          <icon-svg name="zhedie"></icon-svg>
-        </el-menu-item>
+        <el-tooltip effect="dark" :content="sidebarFold ? '展开菜单' : '折叠菜单'" placement="bottom" :enterable="false">
+          <el-menu-item class="site-navbar__switch" index="0" @click="sidebarFold = !sidebarFold">
+            <icon-svg :class="'navbar-fold-icon ' + (sidebarFold ? 'folded' : '')" name="anglesleft"></icon-svg>
+          </el-menu-item>
+        </el-tooltip>
+        <el-tooltip effect="dark" content="返回上一页" placement="bottom" :enterable="false">
+          <el-menu-item class="site-navbar__switch" index="1" @click="$router.back()">
+            <icon-svg name="arrowleft"></icon-svg>
+          </el-menu-item>
+        </el-tooltip>
       </el-menu>
       <el-menu class="site-navbar__menu site-navbar__menu--right" mode="horizontal">
         <el-menu-item class="site-navbar__avatar" index="3">
@@ -90,16 +97,4 @@ export default {
     }
   }
 }
-</script>
-
-<style lang="scss">
-.site-navbar__brand {
-  padding: 0 20px;
-}
-
-.site-sidebar--fold {
-  .site-navbar__brand {
-    padding: 0;
-  }
-}
-</style>
+</script>

+ 0 - 42
src/views/main-sidebar-sub-menu.vue

@@ -1,42 +0,0 @@
-<template>
-  <!--el-submenu v-if="menu.list && menu.list.length >= 1" :index="menu.menuId + ''"
-    :popper-class="'site-sidebar--' + sidebarLayoutSkin + '-popper'">
-    <template slot="title">
-      <icon-svg :name="menu.icon || ''" class="site-sidebar__menu-icon"></icon-svg>
-      <span>{{ menu.name }}</span>
-    </template>
-    <sub-menu v-for="item in menu.list" :key="item.menuId" :menu="item">
-    </sub-menu>
-  </el-submenu-->
-  <el-menu-item :index="menu.index + ''" @click="gotoRouteHandle()">
-    <icon-svg :name="menu.icon || ''" class="site-sidebar__menu-icon"></icon-svg>
-    <span>{{ menu.name }}</span>
-  </el-menu-item>
-</template>
-
-<script lang="ts">
-import Vue from 'vue'
-// import SubMenu from './main-sidebar-sub-menu'
-export default Vue.extend({
-  name: 'sub-menu',
-  props: {
-    menu: {
-      type: Object,
-      required: true
-    },
-  },
-  // components: {
-  //   SubMenu
-  // },
-  // computed: {
-  //   sidebarLayoutSkin: {
-  //     get() { return this.$store.state.common.sidebarLayoutSkin }
-  //   }
-  // },
-  methods: {
-    gotoRouteHandle() {
-      this.$router.push(this.menu.url)
-    }
-  }
-})
-</script>

+ 4 - 3
src/views/main-sidebar.vue

@@ -7,14 +7,16 @@
           <icon-svg name="index" class="site-sidebar__menu-icon"></icon-svg>
           <span slot="title">首页</span>
         </el-menu-item>
-        <sub-menu v-for="menu in menuList" :key="menu.index" :menu="menu"></sub-menu>
+        <el-menu-item v-for="menu in menuList" :key="menu.index" :index="menu.index + ''" @click="$router.push(menu.url)">
+          <icon-svg :name="menu.icon || ''" class="site-sidebar__menu-icon"></icon-svg>
+          <span slot="title">{{ menu.name }}</span>
+        </el-menu-item>
       </el-menu>
     </div>
   </aside>
 </template>
 
 <script>
-import SubMenu from './main-sidebar-sub-menu'
 import { isURL } from '@/utils/validate'
 import { pages } from "@/router"
 
@@ -33,7 +35,6 @@ export default {
     })
     return { menuList }
   },
-  components: { SubMenu },
   computed: {
     sidebarLayoutSkin() {
       return this.$store.state.common.sidebarLayoutSkin

+ 7 - 0
src/views/main.vue

@@ -13,9 +13,16 @@
 
 <script>
 import '@/avue'
+import Vue from 'vue'
 import MainNavbar from './main-navbar'
 import MainSidebar from './main-sidebar'
 import MainContent from './main-content'
+import element from '@/element-ui'
+
+import httpRequest from '@/utils/httpRequest' // api: https://github.com/axios/axios
+Vue.prototype.$http = httpRequest // ajax请求方法
+
+Vue.use(element)
 
 export default {
   data() {

+ 1 - 0
src/views/modules/liveroom/liveroomEdit.vue

@@ -51,6 +51,7 @@ export default Vue.extend({
 
   computed: {
     option() {
+      //@ts-ignore
       return formOption(this.new)
     }
   },

+ 3 - 1
src/views/modules/liveroom/liveroomList-opbar.vue

@@ -8,7 +8,9 @@
         <el-button type="warning" size="small" disabled><icon-svg name="playback" /></el-button>
       </el-tooltip>
       <el-tooltip effect="dark" content="商品库" placement="top" :enterable="false">
-        <el-button type="primary" size="small" disabled><icon-svg name="product" /></el-button>
+        <el-button type="primary" size="small"
+          @click="$router.push({ name: 'liveroomProd', params: { id: id.toString() } })">
+          <icon-svg name="product" /></el-button>
       </el-tooltip>
       <el-tooltip effect="dark" content="客户咨询" placement="top" :enterable="false">
         <el-button type="primary" size="small" disabled><icon-svg name="question" /></el-button>

+ 5 - 12
src/views/modules/liveroom/liveroomList.vue

@@ -7,12 +7,13 @@
       </template>
 
       <template slot-scope="scope" slot="showInList">
-        <el-switch :value="scope.row.showInList" @change="(e) => { updateShowStatus(scope.row.id, e) }" />
+        <el-switch :value="scope.row.showInList" @change="(e) => updateShowStatus(scope.row.id, e)" />
       </template>
 
       <template slot-scope="{row}" slot="startup">
         <div class="icon-button">
-          <el-button type="primary" size="small" @click="startLiveRoom(row.id)"><icon-svg name="play" /></el-button>
+          <el-button type="primary" size="small" @click="startLiveRoom(row.id)" disabled><icon-svg
+              name="play" /></el-button>
         </div>
       </template>
 
@@ -89,7 +90,7 @@ export default Vue.extend({
       this.$confirm(`确定删除直播间 “${room.title}”?`, '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
-        type: 'warning'
+        type: 'warning',
       }).then(() => {
         console.log(id)
         httpx.post("/rooms/deleteRoom", { id }
@@ -105,12 +106,4 @@ export default Vue.extend({
     }
   }
 })
-</script>
-
-<style>
-.icon-button .el-button {
-  padding: 6px 10px;
-  font-size: medium;
-  border-radius: 10px;
-}
-</style>
+</script>

+ 74 - 0
src/views/modules/liveroom/liveroomProd.vue

@@ -0,0 +1,74 @@
+<template>
+  <avue-crud ref="crud" :page="page" :data="dataList" :table-loading="dataListLoading" :option="tableOption">
+    <template slot-scope="scope" slot="kind">
+      <el-tag v-if="scope.row.kind" size="small" :type="scope.row.kind === '自营' ? 'primary' : 'success'">
+        {{ scope.row.kind }}
+      </el-tag>
+    </template>
+
+    <template slot-scope="{row,index}" slot="menu">
+      <el-button type="primary" icon="el-icon-edit" size="small"
+        @click="$router.push({ name: 'prodInfo', params: { id: row.id.toString() } })">修改</el-button>
+    </template>
+  </avue-crud>
+</template>
+
+<script lang="ts">
+import Vue from 'vue'
+import { tableOption } from '@/avue/crud/prodList.js'
+import httpx from '@/utils/httpx'
+import { IPage } from '@/utils/vo'
+import { isInteger } from 'lodash'
+
+export default Vue.extend({
+  data() {
+    return {
+      dataForm: {
+        prodName: ''
+      },
+      dataList: [],
+      page: {
+        total: 0, // 总页数
+        currentPage: 1, // 当前页数
+        pageSize: 10 // 每页显示多少条
+      },
+      dataListSelections: [],
+      dataListLoading: false,
+      tableOption: tableOption,
+      resourcesUrl: process.env.VUE_APP_RESOURCES_URL,
+      id: 0,
+    }
+  },
+
+  mounted() {
+    const id_str = this.$route.params.id
+    const id = parseInt(id_str)
+    if (isNaN(id) || !isInteger(id)) {
+      //@ts-ignore
+      this.$shortcut.notFound()
+    } else {
+      this.id = id
+      this.getDataList()
+    }
+  },
+
+  methods: {
+    // 获取数据列表
+    getDataList(page?: IPage, params?: null, done?: Function) {
+      this.dataListLoading = true
+      httpx.post(httpx.makeurl('/rooms/roomGoods'), {
+        id: this.id,
+        limit: page == null ? this.page.pageSize : page.pageSize,
+        page: page == null ? this.page.currentPage : page.currentPage,
+      }).then(({ data }) => {
+        this.dataList = data.goodsEntityList
+        this.page.total = data.total
+        this.dataListLoading = false
+        if (done) {
+          done()
+        }
+      })
+    },
+  }
+})
+</script>

+ 1 - 3
src/views/modules/order/order-BaseTable.vue

@@ -193,6 +193,4 @@ export default {
     }
   },
 };
-</script>
-
-<style lang="scss" scoped></style>
+</script>

+ 0 - 1
src/views/modules/order/order.vue

@@ -51,4 +51,3 @@ export default {
   }
 }
 </script>
-<style lang="scss"></style>

+ 3 - 9
src/views/modules/order/showDialog.vue

@@ -1,7 +1,8 @@
 <template>
     <el-dialog title="订单详情" :visible.sync="dialogVisible" width="50%" top="7vh" v-loading="loading"
         :destroy-on-close="true">
-        <el-form :model="form" :label-position="formLabelWidth" label-width="120px" size="mini" class="form-wrap">
+        <el-form :model="form" :label-position="formLabelWidth" label-width="120px" size="mini"
+            style="max-height: 66vh; overflow-y: scroll;">
             <el-form-item label="下单时间">
                 <el-input v-model="form.paidAt" disabled></el-input>
             </el-form-item>
@@ -100,11 +101,4 @@ export default {
         }
     }
 }
-</script>
-
-<style>
-.form-wrap {
-    max-height: 66vh;
-    overflow-y: scroll;
-}
-</style>
+</script>

+ 4 - 3
src/views/modules/prod/category.vue

@@ -1,6 +1,7 @@
 <template>
   <avue-crud ref="crud" :page="page" :data="dataList" :table-loading="dataListLoading" :option="tableOption"
-    @on-load="getDataList" @row-update="updateItem" @row-del="deleteItem" @row-save="addItem" @search-change="searchChange">
+    @on-load="getDataList" @row-update="updateItem" @row-del="deleteItem" @row-save="addItem"
+    @search-change="searchChange">
   </avue-crud>
 </template>
 
@@ -84,7 +85,7 @@ export default Vue.extend({
       })
     },
 
-    searchChange (params: ICategory, done?: Function) {
+    searchChange(params: ICategory, done?: Function) {
       this.getDataList(this.page, params, done)
     },
 
@@ -106,4 +107,4 @@ export default Vue.extend({
     }
   }
 })
-</script>@/avue/crud/category
+</script>

+ 28 - 23
vue.config.js

@@ -1,5 +1,6 @@
 'use strict'
 const path = require('path')
+const fs = require('fs')
 
 function resolve(dir) {
   return path.join(__dirname, dir)
@@ -80,6 +81,16 @@ module.exports = {
       .loader('svg-sprite-loader')
       .end()
 
+    config
+      .when(process.env.ANALYZER == 'true', config => {
+        const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
+        config.plugin('webpack-bundle-analyzer').use(BundleAnalyzerPlugin).tap(() => [
+          {
+            analyzerPort: "auto"
+          }
+        ])
+      })
+
     config
       .when(process.env.NODE_ENV !== 'development',
         config => {
@@ -96,40 +107,34 @@ module.exports = {
               chunks: 'all',
               cacheGroups: {
                 libs: {
-                  name: 'chunk-libs',
-                  test: /[\\/]node_modules[\\/]/,
-                  priority: 10,
-                  chunks: 'initial', // only package third parties that are initially dependent
-                  reuseExistingChunk: true
+                  name: 'libs',
+                  priority: 50,
+                  chunks: 'initial',
                 },
                 elementUI: {
-                  name: 'chunk-elementUI', // split elementUI into a single package
-                  priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
-                  test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
+                  name: 'elementUI', // split elementUI into a single package
+                  priority: 40,
+                  test: /[\\/]node_modules[\\/]_?element-ui(.*)/,
                 },
                 avue: {
-                  name: 'chunk-avue',
-                  priority: 15,
+                  name: 'avue', // split avue into a single package
+                  priority: 41,
                   test: /[\\/]node_modules[\\/]@smallwei(.*)/,
                   reuseExistingChunk: true
                 },
-                commons: {
-                  name: 'chunk-commons',
-                  test: resolve('src/components'), // can customize your rules
-                  minChunks: 3, //  minimum common number
-                  priority: 5,
-                  reuseExistingChunk: true
+                utils: {
+                  name: 'utils',
+                  test: /([\\/]src[\\/]utils)|lodash|axios|crypto-js/,
+                  priority: 30,
                 },
                 styles: {
-                  name: 'styles',
-                  test: /.(css|scss)$/,
-                  chunks: 'all',
-                  priority: 50
-                }
+                  name: 'styles',  // pack all remaining style files
+                  test: /\.(css|scss)$/,
+                  priority: 45,
+                  reuseExistingChunk: true
+                },
               }
             })
-          // https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
-          config.optimization.runtimeChunk('single')
         }
       )
   }