Browse Source

add vconfole packages

xutongzee 1 year ago
parent
commit
65f8a4cef2

+ 31 - 0
package-lock.json

@@ -36,6 +36,7 @@
         "postcss": "^8.4.31",
         "postcss": "^8.4.31",
         "postcss-loader": "^4.3.0",
         "postcss-loader": "^4.3.0",
         "postcss-pxtorem": "^5.1.1",
         "postcss-pxtorem": "^5.1.1",
+        "vconsole": "^3.15.1",
         "vue-template-compiler": "^2.6.11"
         "vue-template-compiler": "^2.6.11"
       }
       }
     },
     },
@@ -5063,6 +5064,18 @@
         "node": ">=0.10.0"
         "node": ">=0.10.0"
       }
       }
     },
     },
+    "node_modules/copy-text-to-clipboard": {
+      "version": "3.2.0",
+      "resolved": "https://registry.npmjs.org/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.0.tgz",
+      "integrity": "sha512-RnJFp1XR/LOBDckxTib5Qjr/PMfkatD0MUCQgdpqS8MdKiNUzBjAQBEN6oUy+jW7LI93BBG3DtMB2KOOKpGs2Q==",
+      "dev": true,
+      "engines": {
+        "node": ">=12"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
     "node_modules/copy-webpack-plugin": {
     "node_modules/copy-webpack-plugin": {
       "version": "5.1.2",
       "version": "5.1.2",
       "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-5.1.2.tgz",
       "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-5.1.2.tgz",
@@ -10360,6 +10373,12 @@
       "integrity": "sha512-cnAsSVxIDsYt0v7HmC0hWZFwwXSh+E6PgCrREDuN/EsjgLwA5XRmlMHhSiDPrt6HxY1gTivEa/Zh7GtODoLevQ==",
       "integrity": "sha512-cnAsSVxIDsYt0v7HmC0hWZFwwXSh+E6PgCrREDuN/EsjgLwA5XRmlMHhSiDPrt6HxY1gTivEa/Zh7GtODoLevQ==",
       "dev": true
       "dev": true
     },
     },
+    "node_modules/mutation-observer": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/mutation-observer/-/mutation-observer-1.0.3.tgz",
+      "integrity": "sha512-M/O/4rF2h776hV7qGMZUH3utZLO/jK7p8rnNgGkjKUw8zCGjRQPxB8z6+5l8+VjRUQ3dNYu4vjqXYLr+U8ZVNA==",
+      "dev": true
+    },
     "node_modules/mute-stream": {
     "node_modules/mute-stream": {
       "version": "0.0.8",
       "version": "0.0.8",
       "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz",
       "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz",
@@ -15798,6 +15817,18 @@
         "node": ">= 0.8"
         "node": ">= 0.8"
       }
       }
     },
     },
+    "node_modules/vconsole": {
+      "version": "3.15.1",
+      "resolved": "https://registry.npmjs.org/vconsole/-/vconsole-3.15.1.tgz",
+      "integrity": "sha512-KH8XLdrq9T5YHJO/ixrjivHfmF2PC2CdVoK6RWZB4yftMykYIaXY1mxZYAic70vADM54kpMQF+dYmvl5NRNy1g==",
+      "dev": true,
+      "dependencies": {
+        "@babel/runtime": "^7.17.2",
+        "copy-text-to-clipboard": "^3.0.1",
+        "core-js": "^3.11.0",
+        "mutation-observer": "^1.0.3"
+      }
+    },
     "node_modules/vendors": {
     "node_modules/vendors": {
       "version": "1.0.4",
       "version": "1.0.4",
       "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.4.tgz",
       "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.4.tgz",

+ 1 - 0
package.json

@@ -36,6 +36,7 @@
     "postcss": "^8.4.31",
     "postcss": "^8.4.31",
     "postcss-loader": "^4.3.0",
     "postcss-loader": "^4.3.0",
     "postcss-pxtorem": "^5.1.1",
     "postcss-pxtorem": "^5.1.1",
+    "vconsole": "^3.15.1",
     "vue-template-compiler": "^2.6.11"
     "vue-template-compiler": "^2.6.11"
   },
   },
   "eslintConfig": {
   "eslintConfig": {

+ 0 - 9
public/index.html

@@ -13,14 +13,5 @@
     </noscript>
     </noscript>
     <div id="app"></div>
     <div id="app"></div>
     <!-- built files will be auto injected -->
     <!-- built files will be auto injected -->
-
-
-
-    <!-- TEMPORARY: vconsole -->
-    <script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
-    <script>
-      // VConsole 会自动挂载到 `window.VConsole`
-      var vConsole = new window.VConsole();
-    </script>
   </body>
   </body>
 </html>
 </html>

+ 4 - 0
src/main.js

@@ -1,3 +1,4 @@
+import vConsole from 'vconsole'
 import Vue from 'vue'
 import Vue from 'vue'
 import router from './router'
 import router from './router'
 import store from './store'
 import store from './store'
@@ -14,6 +15,9 @@ import App from './App.vue'
 import 'amfe-flexible'
 import 'amfe-flexible'
 
 
 if (process.env.NODE_ENV == 'development') {
 if (process.env.NODE_ENV == 'development') {
+  // https://www.npmjs.com/package/vconsole
+  // 可以添加`options`进行配置项目
+  new vConsole()
   // console.log('%c 开发环境 CONF >>>', 'background: blue; color: #fff', );
   // console.log('%c 开发环境 CONF >>>', 'background: blue; color: #fff', );
   // import VConsole from 'vconsole'
   // import VConsole from 'vconsole'
   // TODO: 配置开发环境 辅助工具
   // TODO: 配置开发环境 辅助工具

+ 11 - 12
src/views/applyfor/components/CProductStore.vue

@@ -36,7 +36,8 @@
                 {{ item.goods_name }}
                 {{ item.goods_name }}
               </div>
               </div>
               <div class="prow-header__right">
               <div class="prow-header__right">
-                <span class="update" @click="handleUpdateRow(item, idx)">更改</span>
+                <!-- NOTE: flag == 2 不可以修改 -->
+                <span class="update" v-show="item.flag != 2" @click="handleUpdateRow(item, idx)">更改</span>
                 <span class="remove" @click="handleRemoveRow(item, idx)">删除</span>
                 <span class="remove" @click="handleRemoveRow(item, idx)">删除</span>
               </div>
               </div>
             </div>
             </div>
@@ -408,7 +409,6 @@ export default {
           ]
           ]
         }
         }
         console.log('%c printlog >>>', 'background: blue; color: #fff', _template_);
         console.log('%c printlog >>>', 'background: blue; color: #fff', _template_);
-
         this.list = [...this.list, _template_]
         this.list = [...this.list, _template_]
       }
       }
     },
     },
@@ -464,18 +464,18 @@ export default {
         // post import file
         // post import file
         const result = await postImportFile({
         const result = await postImportFile({
           module: this.type,
           module: this.type,
-          url: fileHref.url
+          file: fileHref.url
         })
         })
 
 
         if (result.code === 1) {
         if (result.code === 1) {
-          const { error_list = [], success_list = [] } = result.data
-          if (error_list.length) {
+          const { error_data = [], apply_goods_data = [] } = result.data
+          if (error_data.length) {
             // error_list => { msg: String }[]
             // error_list => { msg: String }[]
-            this.handleTipsImport(error_list, success_list)
-          } else if (success_list.length) {
+            this.handleTipsImport(error_data, apply_goods_data)
+          } else if (apply_goods_data.length) {
             this.list = [
             this.list = [
               ...this.list,
               ...this.list,
-              ...success_list
+              ...apply_goods_data
             ]
             ]
           }
           }
         }
         }
@@ -485,12 +485,11 @@ export default {
 
 
     },
     },
 
 
-    // TODO: 批量导入模板说明
-    // 下载批量导入说明
+    // NOTE: 下载批量导入说明
+    // Useless. 功能忽略
     handleDownloadHelp() {
     handleDownloadHelp() {
-      this.$toast('下载批量导入说明')
-      console.log('%c printlog >>>', 'background: blue; color: #fff',);
       // util/downloadFileUseATarget
       // util/downloadFileUseATarget
+      this.$toast('点击下载模板进行编辑上传')
     },
     },
 
 
     // NOTE: 提醒某某商品库存不足。让用户选择是否申领/采购
     // NOTE: 提醒某某商品库存不足。让用户选择是否申领/采购

+ 1 - 0
src/views/applyfor/goods-specifications.vue

@@ -33,6 +33,7 @@
             <!-- <van-icon v-show="closeable" @click="handleClose(item, idx)" name="delete-o" :size="18" color="#b8b8b8" /> -->
             <!-- <van-icon v-show="closeable" @click="handleClose(item, idx)" name="delete-o" :size="18" color="#b8b8b8" /> -->
           </div>
           </div>
           <div class="row__main">
           <div class="row__main">
+            <!-- NOTE: 价格展示只在 申购出入库才有 -->
             <c-input title="价格" :maxlength="9" :showWordLimit="false" input-type="number" v-model="item.price" />
             <c-input title="价格" :maxlength="9" :showWordLimit="false" input-type="number" v-model="item.price" />
             <c-input title="数量" :maxlength="5" :showWordLimit="false" input-type="digit" v-model="item.stock" />
             <c-input title="数量" :maxlength="5" :showWordLimit="false" input-type="digit" v-model="item.stock" />
           </div>
           </div>