lex 1 year ago
parent
commit
552a0dacd8
87 changed files with 604 additions and 293 deletions
  1. 3 3
      config/index.js
  2. 5 1
      dist/index.html
  3. 0 0
      dist/static/css/app.238ed995561a314ca817abc2cd4cea69.css
  4. 0 0
      dist/static/css/app.238ed995561a314ca817abc2cd4cea69.css.map
  5. 0 0
      dist/static/js/0.3a2211b19c3ef303deb9.js
  6. 0 0
      dist/static/js/0.3a2211b19c3ef303deb9.js.map
  7. 0 0
      dist/static/js/10.b53e4d307ef9bd37ac19.js
  8. 0 0
      dist/static/js/10.b53e4d307ef9bd37ac19.js.map
  9. 0 0
      dist/static/js/11.d21339cb2e7be6a743ca.js
  10. 0 0
      dist/static/js/11.d21339cb2e7be6a743ca.js.map
  11. 1 0
      dist/static/js/12.8f385410994d9e5a2b72.js
  12. 1 0
      dist/static/js/12.8f385410994d9e5a2b72.js.map
  13. 1 0
      dist/static/js/13.8f77f8ee344e545ae71c.js
  14. 0 0
      dist/static/js/13.8f77f8ee344e545ae71c.js.map
  15. 1 0
      dist/static/js/13.ace212faa3bf4922cb3f.js
  16. 1 0
      dist/static/js/13.ace212faa3bf4922cb3f.js.map
  17. 0 0
      dist/static/js/14.15dc65250bedd435a021.js
  18. 0 0
      dist/static/js/14.15dc65250bedd435a021.js.map
  19. 1 0
      dist/static/js/14.95648340f6b8f3862329.js
  20. 0 0
      dist/static/js/14.95648340f6b8f3862329.js.map
  21. 1 0
      dist/static/js/29.ff9d61dc1ab83ae2196a.js
  22. 1 0
      dist/static/js/29.ff9d61dc1ab83ae2196a.js.map
  23. 0 0
      dist/static/js/30.4e283fca4526c6695bbe.js
  24. 1 0
      dist/static/js/30.4e283fca4526c6695bbe.js.map
  25. 1 0
      dist/static/js/30.86b164ed57e0ddc9f99b.js
  26. 0 0
      dist/static/js/30.86b164ed57e0ddc9f99b.js.map
  27. 1 0
      dist/static/js/31.570186a44517701f6f45.js
  28. 1 0
      dist/static/js/31.570186a44517701f6f45.js.map
  29. 0 0
      dist/static/js/31.a6210857050cc66ca707.js.map
  30. 0 0
      dist/static/js/32.2d85f931dd01be292834.js
  31. 1 0
      dist/static/js/32.2d85f931dd01be292834.js.map
  32. 1 0
      dist/static/js/32.3b404c4902284576dbb8.js
  33. 0 0
      dist/static/js/32.3b404c4902284576dbb8.js.map
  34. 0 0
      dist/static/js/33.12aa6aa6a0b24ef7376a.js.map
  35. 0 0
      dist/static/js/33.2afc73d60ac4d28387c8.js
  36. 1 0
      dist/static/js/33.2afc73d60ac4d28387c8.js.map
  37. 0 0
      dist/static/js/34.119f01e0e1e311e03175.js.map
  38. 1 0
      dist/static/js/34.b2033fe78f6800a89bfe.js
  39. 1 0
      dist/static/js/34.b2033fe78f6800a89bfe.js.map
  40. 1 0
      dist/static/js/35.19d70f1cc158da93901f.js
  41. 0 0
      dist/static/js/35.19d70f1cc158da93901f.js.map
  42. 2 0
      dist/static/js/35.4cddf48d9844d5108522.js
  43. 0 0
      dist/static/js/35.4cddf48d9844d5108522.js.map
  44. 1 0
      dist/static/js/36.d2a14666100493c8f295.js
  45. 1 0
      dist/static/js/36.d2a14666100493c8f295.js.map
  46. 1 0
      dist/static/js/37.01f5b3dddfd8e9ac5f1a.js
  47. 1 0
      dist/static/js/37.01f5b3dddfd8e9ac5f1a.js.map
  48. 1 0
      dist/static/js/37.2fde28d9cad3067bb003.js
  49. 0 0
      dist/static/js/37.2fde28d9cad3067bb003.js.map
  50. 1 0
      dist/static/js/38.0ab2a14be560e065fbce.js
  51. 0 0
      dist/static/js/38.0ab2a14be560e065fbce.js.map
  52. 7 0
      dist/static/js/38.64fd05f4fb2c0573f4c7.js
  53. 1 0
      dist/static/js/38.64fd05f4fb2c0573f4c7.js.map
  54. 6 1
      dist/static/js/39.51ff10781ce3d90cdd79.js
  55. 0 0
      dist/static/js/39.51ff10781ce3d90cdd79.js.map
  56. 0 0
      dist/static/js/39.b32262dd0ea1f3541c39.js
  57. 1 0
      dist/static/js/39.b32262dd0ea1f3541c39.js.map
  58. 0 0
      dist/static/js/40.125944018490de683523.js
  59. 1 0
      dist/static/js/40.125944018490de683523.js.map
  60. 0 0
      dist/static/js/40.c37f830e03b298b3affc.js.map
  61. 1 0
      dist/static/js/41.a3baf0358c2830e8f042.js
  62. 1 0
      dist/static/js/41.a3baf0358c2830e8f042.js.map
  63. 0 0
      dist/static/js/41.f4f1a9bad12e99979c83.js.map
  64. 1 0
      dist/static/js/42.7954870b5c838e89baf8.js
  65. 1 0
      dist/static/js/42.7954870b5c838e89baf8.js.map
  66. 1 0
      dist/static/js/42.b28e875f9381da4e6584.js
  67. 0 0
      dist/static/js/42.b28e875f9381da4e6584.js.map
  68. 2 0
      dist/static/js/43.5321557d8148394dab44.js
  69. 0 0
      dist/static/js/43.5321557d8148394dab44.js.map
  70. 1 0
      dist/static/js/43.bdbe7385b3e96b83918f.js
  71. 0 0
      dist/static/js/43.bdbe7385b3e96b83918f.js.map
  72. 0 0
      dist/static/js/app.744d452477ac7dfb33cd.js
  73. 0 0
      dist/static/js/app.744d452477ac7dfb33cd.js.map
  74. 0 0
      dist/static/js/manifest.1f85ac9193a39cfcec4b.js
  75. 1 0
      dist/static/js/manifest.1f85ac9193a39cfcec4b.js.map
  76. 0 0
      dist/static/js/manifest.252d6537df6e41fd4154.js.map
  77. 96 107
      package-lock.json
  78. 1 0
      package.json
  79. 59 20
      src/components/Tinymce/components/editorImage.vue
  80. 28 14
      src/components/Upload/multiUpload.vue
  81. 32 17
      src/components/Upload/singleUpload.vue
  82. 219 0
      src/utils/oss-file-upload.js
  83. 19 44
      src/views/oms/order/index.vue
  84. 9 9
      src/views/pms/product/add.vue
  85. 42 61
      src/views/pms/product/components/ProductAttrDetail.vue
  86. 17 14
      src/views/pms/product/components/ProductDetail.vue
  87. 23 2
      src/views/pms/product/components/ProductInfoDetail.vue

+ 3 - 3
config/index.js

@@ -3,13 +3,13 @@
 // see http://vuejs-templates.github.io/webpack for documentation.
 
 const path = require('path')
-const proxyUrl = 'https://dev.colexiu.com'
+const proxyUrl = 'https://test.colexiu.com'
 module.exports = {
   dev: {
-
+    host:'0.0.0.0',
     // Paths
     assetsSubDirectory: 'static',
-    assetsPublicPath: './',
+    assetsPublicPath: '/',
     proxyTable: {
       '/api-mall-admin': {
         target: proxyUrl,

+ 5 - 1
dist/index.html

@@ -7,4 +7,8 @@
         hm.src = "https://hm.baidu.com/hm.js?8b02a318fde5831da10426656a43d03c";
         var s = document.getElementsByTagName("script")[0];
         s.parentNode.insertBefore(hm, s);
-      })();</script><script src=./static/ks3jssdk/plupload.full.min.js></script><script src=./static/ks3jssdk/ks3jssdk.min.js></script><link href=./static/css/app.9d2d2210a791a712e6d37f92d9014c77.css rel=stylesheet></head><body><script src=https://unpkg.com/tinymce@4.7.5/tinymce.min.js></script><div id=app></div><script type=text/javascript src=./static/js/manifest.252d6537df6e41fd4154.js></script><script type=text/javascript src=./static/js/vendor.3a8d2e3245c66a69b2a4.js></script><script type=text/javascript src=./static/js/app.529d7471a25ddb1ca654.js></script></body></html>
+<<<<<<< HEAD
+      })();</script><script src=./static/ks3jssdk/plupload.full.min.js></script><script src=./static/ks3jssdk/ks3jssdk.min.js></script><link href=./static/css/app.9d2d2210a791a712e6d37f92d9014c77.css rel=stylesheet></head><body><script src=https://unpkg.com/tinymce@4.7.5/tinymce.min.js></script><div id=app></div><script type=text/javascript src=./static/js/manifest.252d6537df6e41fd4154.js></script><script type=text/javascript src=./static/js/vendor.3a8d2e3245c66a69b2a4.js></script><script type=text/javascript src=./static/js/app.529d7471a25ddb1ca654.js></script></body></html>
+=======
+      })();</script><script src=./static/ks3jssdk/plupload.full.min.js></script><script src=./static/ks3jssdk/ks3jssdk.min.js></script><link href=./static/css/app.238ed995561a314ca817abc2cd4cea69.css rel=stylesheet></head><body><script src=https://unpkg.com/tinymce@4.7.5/tinymce.min.js></script><div id=app></div><script type=text/javascript src=./static/js/manifest.1f85ac9193a39cfcec4b.js></script><script type=text/javascript src=./static/js/vendor.3a8d2e3245c66a69b2a4.js></script><script type=text/javascript src=./static/js/app.744d452477ac7dfb33cd.js></script></body></html>
+>>>>>>> iteration-oss-upload

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.238ed995561a314ca817abc2cd4cea69.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.238ed995561a314ca817abc2cd4cea69.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/0.3a2211b19c3ef303deb9.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/0.3a2211b19c3ef303deb9.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/10.b53e4d307ef9bd37ac19.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/10.b53e4d307ef9bd37ac19.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/11.d21339cb2e7be6a743ca.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/11.d21339cb2e7be6a743ca.js.map


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/12.8f385410994d9e5a2b72.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/12.8f385410994d9e5a2b72.js.map


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/13.8f77f8ee344e545ae71c.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/13.8f77f8ee344e545ae71c.js.map


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/13.ace212faa3bf4922cb3f.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/13.ace212faa3bf4922cb3f.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/14.15dc65250bedd435a021.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/14.15dc65250bedd435a021.js.map


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/14.95648340f6b8f3862329.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/14.95648340f6b8f3862329.js.map


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/29.ff9d61dc1ab83ae2196a.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/29.ff9d61dc1ab83ae2196a.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/30.4e283fca4526c6695bbe.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/30.4e283fca4526c6695bbe.js.map


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/30.86b164ed57e0ddc9f99b.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/30.86b164ed57e0ddc9f99b.js.map


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/31.570186a44517701f6f45.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/31.570186a44517701f6f45.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/31.a6210857050cc66ca707.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/32.2d85f931dd01be292834.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/32.2d85f931dd01be292834.js.map


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/32.3b404c4902284576dbb8.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/32.3b404c4902284576dbb8.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/33.12aa6aa6a0b24ef7376a.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/33.2afc73d60ac4d28387c8.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/33.2afc73d60ac4d28387c8.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/34.119f01e0e1e311e03175.js.map


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/34.b2033fe78f6800a89bfe.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/34.b2033fe78f6800a89bfe.js.map


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/35.19d70f1cc158da93901f.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/35.19d70f1cc158da93901f.js.map


+ 2 - 0
dist/static/js/35.4cddf48d9844d5108522.js

@@ -0,0 +1,2 @@
+webpackJsonp([35],{KIeN:function(e,t){},jHNE:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={name:"updateProduct",components:{ProductDetail:n("CmKi").a}},u={render:function(){var e=this.$createElement;return(this._self._c||e)("product-detail",{attrs:{"is-edit":!0}})},staticRenderFns:[]};var a=n("VU/8")(r,u,!1,function(e){n("KIeN")},null,null);t.default=a.exports}});
+//# sourceMappingURL=35.4cddf48d9844d5108522.js.map

File diff suppressed because it is too large
+ 0 - 0
dist/static/js/35.4cddf48d9844d5108522.js.map


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/36.d2a14666100493c8f295.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/36.d2a14666100493c8f295.js.map


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/37.01f5b3dddfd8e9ac5f1a.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/37.01f5b3dddfd8e9ac5f1a.js.map


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/37.2fde28d9cad3067bb003.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/37.2fde28d9cad3067bb003.js.map


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/38.0ab2a14be560e065fbce.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/38.0ab2a14be560e065fbce.js.map


+ 7 - 0
dist/static/js/38.64fd05f4fb2c0573f4c7.js

@@ -0,0 +1,7 @@
+<<<<<<<< HEAD:dist/static/js/39.51ff10781ce3d90cdd79.js
+webpackJsonp([39],{hL1P:function(e,t){},lfyr:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("c/Tr"),a=n.n(r),i=n("lHA8"),l=n.n(i),s=n("bUp0"),c=n("STSY"),o={name:"allocMenu",data:function(){return{menuTreeList:[],defaultProps:{children:"children",label:"title"},roleId:null}},created:function(){this.roleId=this.$route.query.roleId,this.treeList(),this.getRoleMenu(this.roleId)},methods:{treeList:function(){var e=this;Object(s.d)().then(function(t){e.menuTreeList=t.data})},getRoleMenu:function(e){var t=this;Object(c.g)(e).then(function(e){var n=e.data,r=[];if(null!=n&&n.length>0)for(var a=0;a<n.length;a++){var i=n[a];0!==i.parentId&&r.push(i.id)}t.$refs.tree.setCheckedKeys(r)})},handleSave:function(){var e=this,t=this.$refs.tree.getCheckedNodes(),n=new l.a;if(null!=t&&t.length>0)for(var r=0;r<t.length;r++){var i=t[r];n.add(i.id),0!==i.parentId&&n.add(i.parentId)}this.$confirm("是否分配菜单?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){var t={menuIds:a()(n).join(","),roleId:e.roleId};Object(c.a)(t).then(function(t){e.$message({message:"分配成功",type:"success",duration:1e3}),e.$router.back()})})},handleClear:function(){this.$refs.tree.setCheckedKeys([])}}},d={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-card",{staticClass:"form-container",attrs:{shadow:"never"}},[n("el-tree",{ref:"tree",attrs:{data:e.menuTreeList,"show-checkbox":"","default-expand-all":"","node-key":"id","highlight-current":"",props:e.defaultProps}}),e._v(" "),n("div",{staticStyle:{"margin-top":"20px"},attrs:{align:"center"}},[n("el-button",{attrs:{type:"primary"},on:{click:function(t){e.handleSave()}}},[e._v("保存")]),e._v(" "),n("el-button",{on:{click:function(t){e.handleClear()}}},[e._v("清空")])],1)],1)},staticRenderFns:[]};var u=n("VU/8")(o,d,!1,function(e){n("hL1P")},"data-v-69c4c24c",null);t.default=u.exports}});
+//# sourceMappingURL=39.51ff10781ce3d90cdd79.js.map
+========
+webpackJsonp([38],{hL1P:function(e,t){},lfyr:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("c/Tr"),a=n.n(r),i=n("lHA8"),l=n.n(i),s=n("bUp0"),c=n("STSY"),o={name:"allocMenu",data:function(){return{menuTreeList:[],defaultProps:{children:"children",label:"title"},roleId:null}},created:function(){this.roleId=this.$route.query.roleId,this.treeList(),this.getRoleMenu(this.roleId)},methods:{treeList:function(){var e=this;Object(s.d)().then(function(t){e.menuTreeList=t.data})},getRoleMenu:function(e){var t=this;Object(c.g)(e).then(function(e){var n=e.data,r=[];if(null!=n&&n.length>0)for(var a=0;a<n.length;a++){var i=n[a];0!==i.parentId&&r.push(i.id)}t.$refs.tree.setCheckedKeys(r)})},handleSave:function(){var e=this,t=this.$refs.tree.getCheckedNodes(),n=new l.a;if(null!=t&&t.length>0)for(var r=0;r<t.length;r++){var i=t[r];n.add(i.id),0!==i.parentId&&n.add(i.parentId)}this.$confirm("是否分配菜单?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){var t={menuIds:a()(n).join(","),roleId:e.roleId};Object(c.a)(t).then(function(t){e.$message({message:"分配成功",type:"success",duration:1e3}),e.$router.back()})})},handleClear:function(){this.$refs.tree.setCheckedKeys([])}}},d={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-card",{staticClass:"form-container",attrs:{shadow:"never"}},[n("el-tree",{ref:"tree",attrs:{data:e.menuTreeList,"show-checkbox":"","default-expand-all":"","node-key":"id","highlight-current":"",props:e.defaultProps}}),e._v(" "),n("div",{staticStyle:{"margin-top":"20px"},attrs:{align:"center"}},[n("el-button",{attrs:{type:"primary"},on:{click:function(t){e.handleSave()}}},[e._v("保存")]),e._v(" "),n("el-button",{on:{click:function(t){e.handleClear()}}},[e._v("清空")])],1)],1)},staticRenderFns:[]};var u=n("VU/8")(o,d,!1,function(e){n("hL1P")},"data-v-69c4c24c",null);t.default=u.exports}});
+//# sourceMappingURL=38.64fd05f4fb2c0573f4c7.js.map
+>>>>>>>> iteration-oss-upload:dist/static/js/38.64fd05f4fb2c0573f4c7.js

File diff suppressed because it is too large
+ 1 - 0
dist/static/js/38.64fd05f4fb2c0573f4c7.js.map


+ 6 - 1
dist/static/js/39.51ff10781ce3d90cdd79.js

@@ -1,2 +1,7 @@
+<<<<<<<< HEAD:dist/static/js/39.51ff10781ce3d90cdd79.js
 webpackJsonp([39],{hL1P:function(e,t){},lfyr:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("c/Tr"),a=n.n(r),i=n("lHA8"),l=n.n(i),s=n("bUp0"),c=n("STSY"),o={name:"allocMenu",data:function(){return{menuTreeList:[],defaultProps:{children:"children",label:"title"},roleId:null}},created:function(){this.roleId=this.$route.query.roleId,this.treeList(),this.getRoleMenu(this.roleId)},methods:{treeList:function(){var e=this;Object(s.d)().then(function(t){e.menuTreeList=t.data})},getRoleMenu:function(e){var t=this;Object(c.g)(e).then(function(e){var n=e.data,r=[];if(null!=n&&n.length>0)for(var a=0;a<n.length;a++){var i=n[a];0!==i.parentId&&r.push(i.id)}t.$refs.tree.setCheckedKeys(r)})},handleSave:function(){var e=this,t=this.$refs.tree.getCheckedNodes(),n=new l.a;if(null!=t&&t.length>0)for(var r=0;r<t.length;r++){var i=t[r];n.add(i.id),0!==i.parentId&&n.add(i.parentId)}this.$confirm("是否分配菜单?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){var t={menuIds:a()(n).join(","),roleId:e.roleId};Object(c.a)(t).then(function(t){e.$message({message:"分配成功",type:"success",duration:1e3}),e.$router.back()})})},handleClear:function(){this.$refs.tree.setCheckedKeys([])}}},d={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-card",{staticClass:"form-container",attrs:{shadow:"never"}},[n("el-tree",{ref:"tree",attrs:{data:e.menuTreeList,"show-checkbox":"","default-expand-all":"","node-key":"id","highlight-current":"",props:e.defaultProps}}),e._v(" "),n("div",{staticStyle:{"margin-top":"20px"},attrs:{align:"center"}},[n("el-button",{attrs:{type:"primary"},on:{click:function(t){e.handleSave()}}},[e._v("保存")]),e._v(" "),n("el-button",{on:{click:function(t){e.handleClear()}}},[e._v("清空")])],1)],1)},staticRenderFns:[]};var u=n("VU/8")(o,d,!1,function(e){n("hL1P")},"data-v-69c4c24c",null);t.default=u.exports}});
-//# sourceMappingURL=39.51ff10781ce3d90cdd79.js.map
+//# sourceMappingURL=39.51ff10781ce3d90cdd79.js.map
+========
+webpackJsonp([38],{hL1P:function(e,t){},lfyr:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("c/Tr"),a=n.n(r),i=n("lHA8"),l=n.n(i),s=n("bUp0"),c=n("STSY"),o={name:"allocMenu",data:function(){return{menuTreeList:[],defaultProps:{children:"children",label:"title"},roleId:null}},created:function(){this.roleId=this.$route.query.roleId,this.treeList(),this.getRoleMenu(this.roleId)},methods:{treeList:function(){var e=this;Object(s.d)().then(function(t){e.menuTreeList=t.data})},getRoleMenu:function(e){var t=this;Object(c.g)(e).then(function(e){var n=e.data,r=[];if(null!=n&&n.length>0)for(var a=0;a<n.length;a++){var i=n[a];0!==i.parentId&&r.push(i.id)}t.$refs.tree.setCheckedKeys(r)})},handleSave:function(){var e=this,t=this.$refs.tree.getCheckedNodes(),n=new l.a;if(null!=t&&t.length>0)for(var r=0;r<t.length;r++){var i=t[r];n.add(i.id),0!==i.parentId&&n.add(i.parentId)}this.$confirm("是否分配菜单?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){var t={menuIds:a()(n).join(","),roleId:e.roleId};Object(c.a)(t).then(function(t){e.$message({message:"分配成功",type:"success",duration:1e3}),e.$router.back()})})},handleClear:function(){this.$refs.tree.setCheckedKeys([])}}},d={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-card",{staticClass:"form-container",attrs:{shadow:"never"}},[n("el-tree",{ref:"tree",attrs:{data:e.menuTreeList,"show-checkbox":"","default-expand-all":"","node-key":"id","highlight-current":"",props:e.defaultProps}}),e._v(" "),n("div",{staticStyle:{"margin-top":"20px"},attrs:{align:"center"}},[n("el-button",{attrs:{type:"primary"},on:{click:function(t){e.handleSave()}}},[e._v("保存")]),e._v(" "),n("el-button",{on:{click:function(t){e.handleClear()}}},[e._v("清空")])],1)],1)},staticRenderFns:[]};var u=n("VU/8")(o,d,!1,function(e){n("hL1P")},"data-v-69c4c24c",null);t.default=u.exports}});
+//# sourceMappingURL=38.64fd05f4fb2c0573f4c7.js.map
+>>>>>>>> iteration-oss-upload:dist/static/js/38.64fd05f4fb2c0573f4c7.js

File diff suppressed because it is too large
+ 0 - 0
dist/static/js/39.51ff10781ce3d90cdd79.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/39.b32262dd0ea1f3541c39.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/39.b32262dd0ea1f3541c39.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/40.125944018490de683523.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/40.125944018490de683523.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/40.c37f830e03b298b3affc.js.map


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/41.a3baf0358c2830e8f042.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/41.a3baf0358c2830e8f042.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/41.f4f1a9bad12e99979c83.js.map


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/42.7954870b5c838e89baf8.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/42.7954870b5c838e89baf8.js.map


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/42.b28e875f9381da4e6584.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/42.b28e875f9381da4e6584.js.map


+ 2 - 0
dist/static/js/43.5321557d8148394dab44.js

@@ -0,0 +1,2 @@
+webpackJsonp([43],{GmD0:function(e,t){},N3DD:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={name:"addProduct",components:{ProductDetail:n("CmKi").a}},a={render:function(){var e=this.$createElement;return(this._self._c||e)("product-detail",{attrs:{"is-edit":!0,"is-add":!0}})},staticRenderFns:[]};var i=n("VU/8")(r,a,!1,function(e){n("GmD0")},null,null);t.default=i.exports}});
+//# sourceMappingURL=43.5321557d8148394dab44.js.map

File diff suppressed because it is too large
+ 0 - 0
dist/static/js/43.5321557d8148394dab44.js.map


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/43.bdbe7385b3e96b83918f.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/43.bdbe7385b3e96b83918f.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.744d452477ac7dfb33cd.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.744d452477ac7dfb33cd.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.1f85ac9193a39cfcec4b.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/manifest.1f85ac9193a39cfcec4b.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.252d6537df6e41fd4154.js.map


File diff suppressed because it is too large
+ 96 - 107
package-lock.json


+ 1 - 0
package.json

@@ -12,6 +12,7 @@
   "dependencies": {
     "axios": "^0.18.0",
     "clean-deep": "^3.4.0",
+    "cos-js-sdk-v5": "^1.4.21",
     "dayjs": "^1.11.2",
     "echarts": "^4.2.0-rc.2",
     "element-ui": "^2.13.2",

+ 59 - 20
src/components/Tinymce/components/editorImage.vue

@@ -15,12 +15,12 @@
         class="editor-slide-upload"
         :action="ossUploadUrl"
         :data="dataObj"
-        :multiple="true"
+        :multiple="false"
         :file-list="fileList"
         :show-file-list="true"
         list-type="picture-card"
         :on-remove="handleRemove"
-        :on-success="handleSuccess"
+        :http-request="handleSuccess"
         :before-upload="beforeUpload"
       >
         <el-button size="small" type="primary">点击上传</el-button>
@@ -33,7 +33,7 @@
 
 <script>
 import { policy } from "@/api/oss";
-
+import { getUploadSign, onOnlyFileUpload } from "@/utils/oss-file-upload";
 export default {
   name: "editorSlideUpload",
   props: {
@@ -88,19 +88,37 @@ export default {
       this.fileList = [];
       this.dialogVisible = false;
     },
-    handleSuccess(response, file) {
-      const uid = file.uid;
-
-      const objKeyArr = Object.keys(this.listObj);
-      console.log(objKeyArr, "objKeyArr", this.listObj);
-      for (let i = 0, len = objKeyArr.length; i < len; i++) {
-        if (this.listObj[objKeyArr[i]].uid === uid) {
-          this.listObj[objKeyArr[i]].url =
-            this.ossUploadUrl + "/" + this.listObj[objKeyArr[i]].key;
-          this.listObj[objKeyArr[i]].hasSuccess = true;
-          return;
-        }
+    async handleSuccess(info, file) {
+      try {
+        const objInfo = {
+          policy: info.data.policy,
+          signature: info.data.signature,
+          key: info.data.key,
+          KSSAccessKeyId: info.data.kssAccessKeyId,
+          acl: "public-read",
+          name: info.data.key,
+          file: info.file
+        };
+        // console.log(objInfo, 'objInfo')
+        const uploadUrl = await onOnlyFileUpload(this.ossUploadUrl, objInfo)
+        // console.log(uploadUrl, 'uploadUrl')
+        this.listObj[info.file.uid].url = uploadUrl;
+        this.listObj[info.file.uid].hasSuccess = true;
+      } catch (err) {
+        console.log(err, 'err')
       }
+      // const uid = file.uid;
+
+      // const objKeyArr = Object.keys(this.listObj);
+      // console.log(objKeyArr, "objKeyArr", this.listObj);
+      // for (let i = 0, len = objKeyArr.length; i < len; i++) {
+      //   if (this.listObj[objKeyArr[i]].uid === uid) {
+      //     this.listObj[objKeyArr[i]].url =
+      //       this.ossUploadUrl + "/" + this.listObj[objKeyArr[i]].key;
+      //     this.listObj[objKeyArr[i]].hasSuccess = true;
+      //     return;
+      //   }
+      // }
     },
     handleRemove(file) {
       const uid = file.uid;
@@ -129,23 +147,44 @@ export default {
             unknowValueField: [],
           },
         };
-        policy(obj)
-          .then((response) => {
+        // policy(obj)
+        //   .then((response) => {
+        //     _self.dataObj.policy = response.data.policy;
+        //     _self.dataObj.signature = response.data.signature;
+        //     _self.dataObj.KSSAccessKeyId = response.data.kssAccessKeyId;
+        //     _self.dataObj.key = key;
+        //     _self.dataObj.name = file.name;
+        //     _self.dataObj.acl = "public-read";
+        //     _self.listObj[fileName] = {
+        //       hasSuccess: false,
+        //       uid: file.uid,
+        //       width: this.width,
+        //       height: this.height,
+        //       name: file.name,
+        //       key: key,
+        //     };
+
+        //     resolve(true);
+        //   })
+        //   .catch((err) => {
+        //     console.log(err);
+        //     reject(false);
+        //   });
+        getUploadSign(obj).then(response => {
             _self.dataObj.policy = response.data.policy;
             _self.dataObj.signature = response.data.signature;
             _self.dataObj.KSSAccessKeyId = response.data.kssAccessKeyId;
             _self.dataObj.key = key;
-            _self.dataObj.name = file.name;
+            _self.dataObj.name = key;
             _self.dataObj.acl = "public-read";
             _self.listObj[fileName] = {
               hasSuccess: false,
               uid: file.uid,
               width: this.width,
               height: this.height,
-              name: file.name,
+              name: key,
               key: key,
             };
-
             resolve(true);
           })
           .catch((err) => {

+ 28 - 14
src/components/Upload/multiUpload.vue

@@ -9,7 +9,7 @@
       :file-list="fileList"
       :before-upload="beforeUpload"
       :on-remove="handleRemove"
-      :on-success="handleUploadSuccess"
+      :http-request="handleUploadSuccess"
       :on-preview="handlePreview"
       :limit="maxCount"
       :on-exceed="handleExceed"
@@ -23,7 +23,7 @@
 </template>
 <script>
 import { policy } from "@/api/oss";
-
+import { getUploadSign, onOnlyFileUpload } from "@/utils/oss-file-upload";
 export default {
   name: "multiUpload",
   props: {
@@ -102,18 +102,15 @@ export default {
             filename: file.name,
             acl: "public-read",
             key: key,
-            unknowValueField: [],
           },
         };
-        policy(obj)
-          .then((response) => {
+        getUploadSign(obj).then(response => {
             _self.dataObj.policy = response.data.policy;
             _self.dataObj.signature = response.data.signature;
             _self.dataObj.KSSAccessKeyId = response.data.kssAccessKeyId;
             _self.dataObj.key = key;
-            _self.dataObj.name = file.name;
+            _self.dataObj.name = key;
             _self.dataObj.acl = "public-read";
-
             var ks3Options = {
               KSSAccessKeyId: response.data.kssAccessKeyId,
               policy: response.data.policy,
@@ -136,14 +133,31 @@ export default {
           });
       });
     },
-    handleUploadSuccess(res, file) {
-      let url = this.ossUploadUrl + "/" + this.dataObj.key;
-      if (!this.useOss) {
-        //不使用oss直接获取图片路径
-        url = res.data.url;
+    async handleUploadSuccess(info, file) {
+      // let url = this.ossUploadUrl + "/" + this.dataObj.key;
+      // if (!this.useOss) {
+      //   //不使用oss直接获取图片路径
+      //   url = res.data.url;
+      // }
+      // this.fileList.push({ name: file.name, url: url });
+      // this.emitInput(this.fileList);
+      try {
+        const objInfo = {
+          policy: info.data.policy,
+          signature: info.data.signature,
+          key: info.data.key,
+          KSSAccessKeyId: info.data.kssAccessKeyId,
+          acl: "public-read",
+          name: info.data.key,
+          file: info.file
+        };
+        console.log(objInfo, 'objInfo')
+        const uploadUrl = await onOnlyFileUpload(this.ossUploadUrl, objInfo)
+        this.fileList.push({ name: info.file.name, url: uploadUrl });
+        this.emitInput(this.fileList);
+      } catch (err) {
+        console.log(err, 'err')
       }
-      this.fileList.push({ name: file.name, url: url });
-      this.emitInput(this.fileList);
     },
     handleExceed(files, fileList) {
       this.$message({

+ 32 - 17
src/components/Upload/singleUpload.vue

@@ -11,7 +11,7 @@
       :file-list="fileList"
       :before-upload="beforeUpload"
       :on-remove="handleRemove"
-      :on-success="handleUploadSuccess"
+      :http-request="handleUploadSuccess"
       :on-preview="handlePreview"
     >
       <el-button size="small" type="primary">点击上传</el-button>
@@ -26,6 +26,7 @@
 </template>
 <script>
 import { policy } from "@/api/oss";
+import { getUploadSign, onOnlyFileUpload } from "@/utils/oss-file-upload";
 export default {
   name: "singleUpload",
   props: {
@@ -116,19 +117,13 @@ export default {
             unknowValueField: [],
           },
         };
-
-        policy(obj)
-          .then((response) => {
+        getUploadSign(obj).then(response => {
             _self.dataObj.policy = response.data.policy;
             _self.dataObj.signature = response.data.signature;
             _self.dataObj.KSSAccessKeyId = response.data.kssAccessKeyId;
             _self.dataObj.key = key;
-            _self.dataObj.name = file.name;
+            _self.dataObj.name = key;
             _self.dataObj.acl = "public-read";
-
-            // _self.dataObj.host = response.data.host;
-            // _self.dataObj.callback = response.data.callback;
-
             var ks3Options = {
               KSSAccessKeyId: response.data.kssAccessKeyId,
               policy: response.data.policy,
@@ -145,7 +140,6 @@ export default {
               drop_element: document.body,
             };
             var tempUpload = new ks3FileUploader(ks3Options);
-            //  tempUpload.uploader.start()
             resolve(true);
           })
           .catch((err) => {
@@ -154,16 +148,37 @@ export default {
           });
       });
     },
-    handleUploadSuccess(res, file) {
-      let url = this.ossUploadUrl + "/" + this.dataObj.key;
+    async handleUploadSuccess(info, file) {
+      // let url = this.ossUploadUrl + "/" + this.dataObj.key;
+      // this.showFileList = true;
+      // this.fileList.pop();
+      // if (!this.useOss) {
+      //   //不使用oss直接获取图片路径
+      //   url = res.data.url;
+      // }
+      // this.fileList.push({ name: file.name, url: url });
+      // this.emitInput(this.fileList[0].url);
+       try {
+        const objInfo = {
+          policy: info.data.policy,
+          signature: info.data.signature,
+          key: info.data.key,
+          KSSAccessKeyId: info.data.kssAccessKeyId,
+          acl: "public-read",
+          name: info.data.key,
+          file: info.file
+        };
+        console.log(objInfo, 'objInfo')
+        const uploadUrl = await onOnlyFileUpload(this.ossUploadUrl, objInfo)
+
       this.showFileList = true;
       this.fileList.pop();
-      if (!this.useOss) {
-        //不使用oss直接获取图片路径
-        url = res.data.url;
+      this.fileList.push({ name: info.file.name, url: uploadUrl });
+      this.emitInput(uploadUrl);
+      } catch (err) {
+        console.log(err, 'err')
       }
-      this.fileList.push({ name: file.name, url: url });
-      this.emitInput(this.fileList[0].url);
+
     },
   },
 };

+ 219 - 0
src/utils/oss-file-upload.js

@@ -0,0 +1,219 @@
+import request from "./request";
+import axios from "axios";
+// import umiRequest from "umi-request";
+import COS from "cos-js-sdk-v5";
+export const ossSwitch = "tencent"; //as 'ks3' | 'tencent'; // 上传文件服务商
+const tencentBucket = "daya-online-1303457149";
+
+/**
+ * 管乐团 gyt/
+ * 酷乐秀 klx/
+ * 课堂乐器 ktqy/
+ * 管乐迷 klx/
+ */
+
+// 定义一个cos 对象
+/**
+ * 获取上传文件签名
+ * @param params 上传对应参数
+ * { filename: fileName,
+     bucketName: props.bucketName,
+     postData: {
+      filename: fileName,
+      acl: 'public-read',
+      key: fileName,
+      unknowValueField: []
+    }}
+ * @param oss 服务商 ks3 tencent
+ * @returns ”{'signatur'':'',''kssAccessKeyI'':'',''policy': '' }“
+ */
+export const getUploadSign = async (params) => {
+  const { bucketName, filename, postData } = params;
+  const ossType = ossSwitch;
+  let bucket = bucketName;
+  let file = filename;
+  // const key = postData.key;
+  let tempPostData = {};
+  if (ossType === "tencent") {
+    bucket = tencentBucket;
+    file = "klx/" + filename;
+
+    tempPostData = {
+      key: "klx/" + postData.key,
+    };
+  } else {
+    tempPostData = postData;
+  }
+  return request.post("/api-admin/getUploadSign?pluginName=" + ossType, {
+    postData: tempPostData,
+    pluginName: ossType,
+    bucketName: bucket,
+    filename: file,
+  });
+};
+
+/**
+ * 使用组件上传时,调用方法
+ * @param param0
+ */
+export const onFileUpload = ({
+  file,
+  action,
+  data,
+  onProgress,
+  onFinish,
+  onError,
+}) => {
+  if (ossSwitch === "ks3") {
+    const fileParams = {
+      policy: data.policy,
+      signature: data.signature,
+      key: data.key,
+      acl: "public-read",
+      KSSAccessKeyId: data.KSSAccessKeyId,
+      name: data.name,
+    };
+    const formData = new FormData();
+    for (const key in fileParams) {
+      formData.append(key, fileParams[key]);
+    }
+    formData.append("file", data.file);
+    axios
+      .post(action, formData, {
+        onUploadProgress: ({ progress }) => {
+          onProgress({ percent: Math.ceil((progress || 0) * 100) });
+        },
+      })
+      .then(() => {
+        file.url = action + data.key;
+        onFinish();
+      })
+      .catch((error) => {
+        onError(error);
+      });
+  } else {
+    const cos = new COS({
+      Domain: "https://oss.dayaedu.com",
+      Protocol: "https",
+      // getAuthorization 必选参数
+      getAuthorization: async (options, callback) => {
+        callback({ Authorization: data.signature });
+      },
+    });
+    cos
+      .uploadFile({
+        Bucket: tencentBucket /* 填写自己的 bucket,必须字段 */,
+        Region: "ap-nanjing" /* 存储桶所在地域,必须字段 */,
+        Key: `klx/${data.name}`,
+        /* 存储在桶里的对象键(例如:1.jpg,a/b/test.txt,图片.jpg)支持中文,必须字段 */
+        Body: data.file.file, // 上传文件对象
+        SliceSize:
+          1024 *
+          1024 *
+          500 /* 触发分块上传的阈值,超过5MB使用分块上传,小于5MB使用简单上传。可自行设置,非必须 */,
+        onProgress: function (progressData) {
+          onProgress({ percent: Math.ceil((progressData.percent || 0) * 100) });
+        },
+      })
+      .then((res) => {
+        // file.url = 'https://' + res.Location;
+        if (res.Location && res.Location.indexOf("http") >= 0) {
+          file.url = res.Location;
+        } else {
+          file.url = "https://" + res.Location;
+        }
+        onFinish();
+      })
+      .catch(() => {
+        onError();
+      });
+  }
+};
+
+export const onOnlyFileUpload = async (action, params) => {
+  if (ossSwitch === "ks3") {
+    const fileParams = {
+      policy: params.policy,
+      signature: params.signature,
+      key: params.key,
+      acl: "public-read",
+      KSSAccessKeyId: params.KSSAccessKeyId,
+      name: params.name,
+    };
+    const formData = new FormData();
+    for (const key in fileParams) {
+      formData.append(key, fileParams[key]);
+    }
+    formData.append("file", params.file);
+    let file = "";
+    let errorObj = null;
+    await axios
+      .post(action, formData, {
+        // onUploadProgress: ({ progress }) => {
+        //   console.log(progress);
+        //   onProgress({ percent: Math.ceil((progress || 0) * 100) });
+        // }
+      })
+      .then(() => {
+        file = action + params.key;
+      })
+      .catch((error) => {
+        // onError(error);
+        errorObj = error;
+        // throw new Error(error);
+      });
+    if (file) {
+      return file;
+    } else {
+      throw new Error(errorObj);
+    }
+  } else {
+    let file = "";
+    let errorObj = null;
+    // console.log(params, "params");
+    const cos = new COS({
+      Domain: "https://oss.dayaedu.com",
+      // getAuthorization 必选参数
+      getAuthorization: async (options, callback) => {
+        callback({ Authorization: params.signature });
+      },
+    });
+
+    await cos
+      .uploadFile({
+        Bucket: tencentBucket /* 填写自己的 bucket,必须字段 */,
+        Region: "ap-nanjing" /* 存储桶所在地域,必须字段 */,
+        Key: `klx/${params.name}`,
+        /* 存储在桶里的对象键(例如:1.jpg,a/b/test.txt,图片.jpg)支持中文,必须字段 */
+        Body: params.file, // 上传文件对象
+        SliceSize:
+          1024 *
+          1024 *
+          500 /* 触发分块上传的阈值,超过5MB使用分块上传,小于5MB使用简单上传。可自行设置,非必须 */,
+        // onProgress: function (progressData) {
+        //   onProgress({ percent: Math.ceil((progressData.percent || 0) * 100) });
+        // }
+      })
+      .then((res) => {
+        // file.url = 'https://' + res.Location;
+        // file = 'https://' + res.Location;
+        if (res.Location && res.Location.indexOf("http") >= 0) {
+          file = res.Location;
+        } else {
+          file = "https://" + res.Location;
+        }
+        // onFinish();
+      })
+      .catch((error) => {
+        // console.log(error, 'error');
+        // onError();
+        // throw new Error(error);
+        errorObj = error;
+      });
+    if (file) {
+      return file;
+    } else {
+      throw new Error(errorObj);
+    }
+  }
+};

+ 19 - 44
src/views/oms/order/index.vue

@@ -22,12 +22,7 @@
         </el-button>
       </div>
       <div style="margin-top: 15px">
-        <el-form
-          :inline="true"
-          :model="listQuery"
-          size="small"
-          label-width="140px"
-        >
+        <el-form :inline="true" :model="listQuery" size="small" label-width="140px">
           <el-form-item label="输入搜索:">
             <el-input
               v-model="listQuery.orderSn"
@@ -116,11 +111,7 @@
         v-loading="listLoading"
         border
       >
-        <el-table-column
-          type="selection"
-          width="60"
-          align="center"
-        ></el-table-column>
+        <el-table-column type="selection" width="60" align="center"></el-table-column>
         <el-table-column label="编号" width="80" align="center">
           <template slot-scope="scope">{{ scope.row.id }}</template>
         </el-table-column>
@@ -136,6 +127,7 @@
           <template slot-scope="scope">
             <p v-if="scope.row.userType == 'STUDENT'">学生</p>
             <p v-else-if="scope.row.userType == 'TEACHER'">老师</p>
+            <p v-else-if="scope.row.userType == 'COOLESHOW_EDU'">课堂乐器</p>
             <p v-else-if="scope.row.userType == 'JMEDU'">管乐团</p>
             <p v-else>--</p>
           </template>
@@ -153,9 +145,7 @@
           <template slot-scope="scope">¥{{ scope.row.totalAmount }}</template>
         </el-table-column>
         <el-table-column label="支付方式" width="120" align="center">
-          <template slot-scope="scope">{{
-            scope.row.payType | formatPayType
-          }}</template>
+          <template slot-scope="scope">{{ scope.row.payType | formatPayType }}</template>
         </el-table-column>
         <el-table-column label="订单来源" width="120" align="center">
           <template slot-scope="scope">{{
@@ -163,15 +153,11 @@
           }}</template>
         </el-table-column>
         <el-table-column label="订单状态" width="120" align="center">
-          <template slot-scope="scope">{{
-            scope.row.status | formatStatus
-          }}</template>
+          <template slot-scope="scope">{{ scope.row.status | formatStatus }}</template>
         </el-table-column>
         <el-table-column label="操作" width="200" align="center">
           <template slot-scope="scope">
-            <el-button
-              size="mini"
-              @click="handleViewOrder(scope.$index, scope.row)"
+            <el-button size="mini" @click="handleViewOrder(scope.$index, scope.row)"
               >查看订单</el-button
             >
             <!-- <el-button
@@ -234,21 +220,14 @@
       >
       </el-pagination>
     </div>
-    <el-dialog
-      title="关闭订单"
-      :visible.sync="closeOrder.dialogVisible"
-      width="30%"
-    >
+    <el-dialog title="关闭订单" :visible.sync="closeOrder.dialogVisible" width="30%">
       <el-form :model="closeOrder" label-width="150px" ref="closeOrder">
         <el-form-item
           label="操作备注:"
           prop="content"
-          :rules="[
-            { required: true, message: '请填写操作备注', trigger: 'blur' },
-          ]"
+          :rules="[{ required: true, message: '请填写操作备注', trigger: 'blur' }]"
         >
-          <el-input v-model="closeOrder.content" type="textarea" rows="3">
-          </el-input>
+          <el-input v-model="closeOrder.content" type="textarea" rows="3"> </el-input>
         </el-form-item>
       </el-form>
 
@@ -264,9 +243,7 @@
       </el-input> -->
       <span slot="footer" class="dialog-footer">
         <el-button @click="closeOrder.dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="handleCloseOrderConfirm"
-          >确 定</el-button
-        >
+        <el-button type="primary" @click="handleCloseOrderConfirm">确 定</el-button>
       </span>
     </el-dialog>
     <logistics-dialog v-model="logisticsDialogVisible"></logistics-dialog>
@@ -367,8 +344,8 @@ export default {
     if (this.$route.params.status + "") {
       this.listQuery.status = this.$route.params.status;
     }
-    if(this.$route.query.orderSn){
-      this.listQuery.orderSn = this.$route.query.orderSn
+    if (this.$route.query.orderSn) {
+      this.listQuery.orderSn = this.$route.query.orderSn;
     }
   },
   filters: {
@@ -381,9 +358,9 @@ export default {
         return "支付宝";
       } else if (value === 2) {
         return "微信";
-      } else if(value ===3){
+      } else if (value === 3) {
         return "0元支付";
-      }else {
+      } else {
         return "未支付";
       }
     },
@@ -514,9 +491,9 @@ export default {
           // params.append("ids", this.closeOrder.orderIds);
           // params.append("note", this.closeOrder.content);
           let obj = {
-            ids:this.closeOrder.orderIds.join(','),
-            note: this.closeOrder.content
-          }
+            ids: this.closeOrder.orderIds.join(","),
+            note: this.closeOrder.content,
+          };
           closeOrder(obj).then((response) => {
             this.closeOrder.orderIds = [];
             // this.closeOrder.dialogVisible = false;
@@ -552,8 +529,8 @@ export default {
         // let params = new URLSearchParams();
         // params.append("ids", ids);
         let obj = {
-          ids:ids.join(',')
-        }
+          ids: ids.join(","),
+        };
         deleteOrder(obj).then((response) => {
           this.$message({
             message: "删除成功!",
@@ -590,5 +567,3 @@ export default {
   width: 203px;
 }
 </style>
-
-

+ 9 - 9
src/views/pms/product/add.vue

@@ -1,12 +1,12 @@
-<template> 
-  <product-detail :is-edit='true'></product-detail>
+<template>
+   
+  <product-detail :is-edit="true" :is-add="true"></product-detail>
 </template>
 <script>
-  import ProductDetail from './components/ProductDetail'
-  export default {
-    name: 'addProduct',
-    components: { ProductDetail }
-  }
+import ProductDetail from "./components/ProductDetail";
+export default {
+  name: "addProduct",
+  components: { ProductDetail },
+};
 </script>
-<style>
-</style>
+<style></style>

+ 42 - 61
src/views/pms/product/components/ProductAttrDetail.vue

@@ -25,9 +25,7 @@
       </el-form-item>
       <el-form-item
         label="商品规格:"
-        :rules="[
-          { required: true, message: '请选择商品规格', trigger: 'blur' },
-        ]"
+        :rules="[{ required: true, message: '请选择商品规格', trigger: 'blur' }]"
       >
         <el-card shadow="never" class="cardBg">
           <div v-for="(productAttr, idx) in selectProductAttr">
@@ -84,11 +82,7 @@
             </div>
           </div>
         </el-card>
-        <el-table
-          style="width: 100%; margin-top: 20px"
-          :data="skuStockList"
-          border
-        >
+        <el-table style="width: 100%; margin-top: 20px" :data="skuStockList" border>
           <el-table-column
             v-for="(item, index) in selectProductAttr"
             :label="item.name"
@@ -101,41 +95,31 @@
           </el-table-column>
           <el-table-column label="销售价格" width="80" align="center">
             <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.price"
-                :disabled="!isEdit"
-              ></el-input>
+              <el-input v-model="scope.row.price" :disabled="!isEdit"></el-input>
             </template>
           </el-table-column>
           <el-table-column label="商品库存" width="80" align="center">
             <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.stock"
-                :disabled="!isEdit"
-              ></el-input>
+              <el-input v-model="scope.row.stock" :disabled="!isEdit"></el-input>
             </template>
           </el-table-column>
           <el-table-column label="库存预警值" width="80" align="center">
             <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.lowStock"
-                :disabled="!isEdit"
-              ></el-input>
+              <el-input v-model="scope.row.lowStock" :disabled="!isEdit"></el-input>
             </template>
           </el-table-column>
           <el-table-column label="SKU编号" align="center">
             <template slot-scope="scope">
               <el-input
-
                 v-model="scope.row.skuCode"
-                :disabled="(scope.row.platformLock ||!isEdit )"
+                :disabled="scope.row.platformLock || !isEdit"
               ></el-input>
             </template>
           </el-table-column>
           <el-table-column label="操作" width="80" align="center">
             <template slot-scope="scope">
               <el-button
-              v-if="!scope.row.platformLock"
+                v-if="!scope.row.platformLock"
                 :disabled="!isEdit"
                 type="text"
                 @click="handleRemoveProductSku(scope.$index, scope.row)"
@@ -209,10 +193,7 @@
         </el-card>
       </el-form-item>
       <el-form-item label="商品相册:">
-        <multi-upload
-          v-model="selectProductPics"
-          :disabled="!isEdit"
-        ></multi-upload>
+        <multi-upload v-model="selectProductPics" :disabled="!isEdit"></multi-upload>
       </el-form-item>
       <el-form-item label="规格参数:">
         <el-tabs v-model="activeHtmlName" type="card">
@@ -235,9 +216,7 @@
         </el-tabs>
       </el-form-item>
       <el-form-item style="text-align: center">
-        <el-button size="medium" @click="handlePrev"
-          >上一步,填写商品促销</el-button
-        >
+        <el-button size="medium" @click="handlePrev">上一步,填写商品促销</el-button>
         <!-- <el-button type="primary" size="medium" @click="handleNext"
           >下一步,选择商品关联</el-button
         > -->
@@ -350,7 +329,7 @@ export default {
   },
   created() {},
   mounted() {
-    console.log(this.value.skuStockList,'skuStockList');
+    console.log(this.value.skuStockList, "skuStockList");
     this.handleEditCreated();
     this.getProductAttrCateList();
   },
@@ -412,7 +391,7 @@ export default {
           }
           if (this.isEdit) {
             //编辑模式下刷新商品属性图片
-            console.log('编辑模式刷新属性')
+            console.log("编辑模式刷新属性");
             this.refreshProductAttrPics();
           }
         } else {
@@ -542,15 +521,9 @@ export default {
         cancelButtonText: "取消",
         type: "warning",
       }).then(() => {
-        if (
-          this.value.skuStockList !== null &&
-          this.value.skuStockList.length > 0
-        ) {
+        if (this.value.skuStockList !== null && this.value.skuStockList.length > 0) {
           let tempSkuList = [];
-          tempSkuList = tempSkuList.concat(
-            tempSkuList,
-            this.value.skuStockList
-          );
+          tempSkuList = tempSkuList.concat(tempSkuList, this.value.skuStockList);
           let price = this.value.skuStockList[0].price;
           for (let i = 0; i < tempSkuList.length; i++) {
             tempSkuList[i].price = price;
@@ -569,15 +542,9 @@ export default {
         cancelButtonText: "取消",
         type: "warning",
       }).then(() => {
-        if (
-          this.value.skuStockList !== null &&
-          this.value.skuStockList.length > 0
-        ) {
+        if (this.value.skuStockList !== null && this.value.skuStockList.length > 0) {
           let tempSkuList = [];
-          tempSkuList = tempSkuList.concat(
-            tempSkuList,
-            this.value.skuStockList
-          );
+          tempSkuList = tempSkuList.concat(tempSkuList, this.value.skuStockList);
           let stock = this.value.skuStockList[0].stock;
           let lowStock = this.value.skuStockList[0].lowStock;
           for (let i = 0; i < tempSkuList.length; i++) {
@@ -609,9 +576,7 @@ export default {
         for (let i = 0; i < attr0.values.length; i++) {
           if (attr1.values.length === 0) {
             skuList.push({
-              spData: JSON.stringify([
-                { key: attr0.name, value: attr0.values[i] },
-              ]),
+              spData: JSON.stringify([{ key: attr0.name, value: attr0.values[i] }]),
             });
             continue;
           }
@@ -631,9 +596,7 @@ export default {
         for (let i = 0; i < attr0.values.length; i++) {
           if (attr1.values.length === 0) {
             skuList.push({
-              spData: JSON.stringify([
-                { key: attr0.name, value: attr0.values[i] },
-              ]),
+              spData: JSON.stringify([{ key: attr0.name, value: attr0.values[i] }]),
             });
             continue;
           }
@@ -689,11 +652,7 @@ export default {
       this.value.productAttributeValueList = [];
       for (let i = 0; i < this.selectProductAttr.length; i++) {
         let attr = this.selectProductAttr[i];
-        if (
-          attr.handAddStatus === 1 &&
-          attr.options != null &&
-          attr.options.length > 0
-        ) {
+        if (attr.handAddStatus === 1 && attr.options != null && attr.options.length > 0) {
           this.value.productAttributeValueList.push({
             productAttributeId: attr.id,
             value: this.getOptionStr(attr.options),
@@ -755,7 +714,18 @@ export default {
         this.$message.error("请编辑商品规格");
         return;
       }
-
+      let flag = false;
+      const reg = /(?!(^[0.]*$))((^[1-9]\d*$)|(?!(^0{2,}.))(?!(^0{1,}[1-9]+))(^[0-9]+.\d{1,2}$))/;
+      this.value.skuStockList.forEach((element) => {
+        console.log(element, "element.price", (element.price + "").match(reg));
+        if (!(element.price + "").match(reg)) {
+          flag = true;
+        }
+      });
+      if (flag) {
+        this.$message.error("请填写正确的销售价格");
+        return;
+      }
       this.mergeProductAttrValue();
       this.mergeProductAttrPics();
       this.$emit("nextStep");
@@ -773,7 +743,18 @@ export default {
         this.$message.error("请编辑商品规格");
         return;
       }
-
+      let flag = false;
+      const reg = /(?!(^[0.]*$))((^[1-9]\d*$)|(?!(^0{2,}.))(?!(^0{1,}[1-9]+))(^[0-9]+.\d{1,2}$))/;
+      this.value.skuStockList.forEach((element) => {
+        console.log(element, "element.price", (element.price + "").match(reg));
+        if (!(element.price + "").match(reg)) {
+          flag = true;
+        }
+      });
+      if (flag) {
+        this.$message.error("请填写正确的销售价格");
+        return;
+      }
       this.mergeProductAttrValue();
       this.mergeProductAttrPics();
       this.$emit("finishCommit", this.isEdit);

+ 17 - 14
src/views/pms/product/components/ProductDetail.vue

@@ -11,6 +11,7 @@
       v-show="showStatus[0]"
       v-model="productParam"
       :is-edit="isEdit"
+      :is-add="isAdd"
       @nextStep="nextStep"
     >
     </product-info-detail>
@@ -18,6 +19,7 @@
       v-if="showStatus[1]"
       v-model="productParam"
       :is-edit="isEdit"
+      :is-add="isAdd"
       @nextStep="nextStep"
       @prevStep="prevStep"
     >
@@ -26,9 +28,10 @@
       v-if="showStatus[2]"
       v-model="productParam"
       :is-edit="isEdit"
+      :is-add="isAdd"
       @nextStep="nextStep"
-       @prevStep="prevStep"
-       @finishCommit="finishCommit"
+      @prevStep="prevStep"
+      @finishCommit="finishCommit"
     >
     </product-attr-detail>
     <!-- <product-relation-detail
@@ -122,6 +125,10 @@ export default {
       type: Boolean,
       default: false,
     },
+    isAdd: {
+      type: Boolean,
+      default: false,
+    },
   },
   data() {
     return {
@@ -167,16 +174,14 @@ export default {
           cancelButtonText: "取消",
           type: "warning",
         }).then(() => {
-          updateProduct(this.$route.query.id, this.productParam).then(
-            (response) => {
-              this.$message({
-                type: "success",
-                message: "提交成功",
-                duration: 1000,
-              });
-              this.$router.back();
-            }
-          );
+          updateProduct(this.$route.query.id, this.productParam).then((response) => {
+            this.$message({
+              type: "success",
+              message: "提交成功",
+              duration: 1000,
+            });
+            this.$router.back();
+          });
         });
       } else if (!this.$route.query.id && isEdit) {
         this.$confirm("是否要提交该产品", "提示", {
@@ -205,5 +210,3 @@ export default {
   width: 800px;
 }
 </style>
-
-

+ 23 - 2
src/views/pms/product/components/ProductInfoDetail.vue

@@ -124,6 +124,10 @@ export default {
       type: Boolean,
       default: false,
     },
+    isAdd: {
+      type: Boolean,
+      default: false,
+    },
   },
   data() {
     return {
@@ -153,13 +157,30 @@ export default {
         //   { required: true, message: "请输入商品介绍", trigger: "blur" },
         // ],
         requiredProp: [{ required: true, message: "该项为必填项", trigger: "blur" }],
-        price: [{ required: true, message: "请输入商品售价", trigger: "blur" }],
-        originalPrice: [{ required: true, message: "请输入商品市场价", trigger: "blur" }],
+        price: [
+          {
+            required: true,
+            message: "请输入正确的商品售价",
+            trigger: "blur",
+            pattern: /(?!(^[0.]*$))((^[1-9]\d*$)|(?!(^0{2,}.))(?!(^0{1,}[1-9]+))(^[0-9]+.\d{1,2}$))/,
+          },
+        ],
+        originalPrice: [
+          {
+            required: true,
+            message: "请输入正确的商品市场价",
+            trigger: "blur",
+            pattern: /(?!(^[0.]*$))((^[1-9]\d*$)|(?!(^0{2,}.))(?!(^0{1,}[1-9]+))(^[0-9]+.\d{1,2}$))/,
+          },
+        ],
       },
       showCascader: false,
     };
   },
   async created() {
+    if (this.isAdd) {
+      this.showCascader = true;
+    }
     await this.getProductCateList();
     await this.getBrandList();
   },

Some files were not shown because too many files changed in this diff