# cg-web **Repository Path**: wss90/smc-cg-web ## Basic Information - **Project Name**: cg-web - **Description**: 采购前端 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-30 - **Last Updated**: 2026-01-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 开发 ```bash # 克隆项目 git clone https://gitee.com/zhongnongpi/smc-cg-web.git # 安装依赖 npm install # 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题 npm install --registry=https://registry.npmmirror.com # 启动服务 npm run dev ``` 浏览器访问 http://localhost:80 ## 发布 ```bash # 构建测试环境 npm run build:stage # 构建生产环境 npm run build:prod ``` ## 注意事项 **1. 页面跳转 和 关闭页面 请使用 this.$tab /plugins/tab 文件内的方法,涉及到 页面缓存和取消页面缓存 请不要使用 this.$router 进行打开新页面或者关闭** **2. 设置页面缓存:1. 页面设置 name 属性;2. 路由表设置name属性,必须一致** **3. 公用接口放到 vuex cachePublicApiData, 如果公用接口需要传参数请单独调用该接口这种情况不需要缓存逻辑** cachePublicApiData 使用方法 参考询价列表页面:src/views/purchaseManagement/laqManagement/rfqList/index.vue ``` 在 cachePublicApiData 文件引入 接口 并 添加到 apiNames 中 并且 加上注释说明是什么接口 this.$store.dispatch("cachePublicApiData/queryData", { api: "businessOrggListNoPage", label: "id", value: "groupName", }).then(res=>{ // res数据: [{label:"",value:"",raw:{}}] }) ``` ## 接口命名规范 api+场景+模块名 获取列表: apiQueryXXXXList 更新数据: apiUpdateXXXXData 删除数据: apiDelXXXXData ### 自定义公用组件 | name | 说明 | 路径 | 是否全局注册 | | ------------------ | -------------- | ---------------------------------------------------- | ------------ | | PublicListPage | 公用列表页面 | src/components/PublicListPage/index.vue | 是 | | tableOperateCloumn | 表格操作列组件 | src/components/PublicListPage/tableOperateCloumn.vue | 否 | | UploadAttachments | 附件上传 | src/components/UploadAttachments/index.vue | 否 |