diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f1554a7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +.vscode +nr-os +.DS_Store +node_modules/ +/dist/ +nvwa_dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +/test/unit/coverage/ +/test/e2e/reports/ +# /src/code/* +!/src/code/.gitkeep +selenium-debug.log + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/CODESTANDARD.md b/CODESTANDARD.md new file mode 100644 index 0000000..1fe33bb --- /dev/null +++ b/CODESTANDARD.md @@ -0,0 +1,218 @@ +## 命名规范 ++ 目录/文件命名: + 文件名为 aaa-bbb 格式 + 如: + + ``` + components-control + |- my-component.vue + ``` + ++ 方法命名: +方法名、参数名、成员变量、局部变量都统一遵从驼峰形式。 +如: localValue / getHttpMessage() / inputUserId + ++ 注释: + ├── 1.方法注释: + 关键方法建议写上参数说明,和方法功能说明 + 如: + + ``` + /** + * 以下是单元是否可编辑 + * @param {*} col 列数组 + * @param {*} rowIndex 行索引 + * 不分页的情况下最好是虚拟滚动,如果数量过大,公式有与后端交互这样会很卡 + */ + getColFormulasEditable(col,rowIndex){ + ... + } + ``` + + ├── 2.组件注释 + 注明组件的使用方式,尤其是父子组件传递的props、emit、watch等关键数据流处理的地方 + + + ++ 编写vue文件说明 + ├── 每新建一个vue文件,最外层的div都绑定一个与此vue文件名字相关的class名字,页面相关的样式都包裹到这个 class里面,防止出现样式冲突 + ├── 公共样式抽取到common.css里面,本vue文件单独的样式控制,写本界面即可 + ├── 标签节点上,尽量减少大量的逻辑处理,可以使用有返回值的函数 + ├── 必须为v-for 设置键值 key + ├── 尽量不要手动操作dom,尽量使用语义化标签,增强可读性 + ├──script 标签内部结构顺序 components > props > data > computed > watch > filter > 钩子函数(钩子函数按其执行顺序) > methods + +``` + 组织机构树组件 + <template> + <div class="orgTree"> + <el-tree ref="orgTree" class="filter-tree" + :expand-on-click-node="true" + :data="orgData" + :show-checkbox="ifShowBox" + :props="defaultProps" + :efault-expand-all = "true" + :filter-node-method = "filterNode" + :default-expanded-keys="defaultExpandedKey" + @node-click = "getNode" > + </el-tree> + </div> + </template> + + <script> + export default { + name: "orgTree",//组件名称 + components: {}, //引入的组件 + props: { + //是否需要进行过滤 + ifFilter: { + type: Boolean, + default: function() { + return true; + } + }, + //是否多选 + ifShowBox: { + type: Boolean, + default: function() { + return true; + } + }, + //默认展开哪一节点的数据,目前设置展示id为1的树节点 + defaultExpandedKey: { + type: Array, + default: function() { + return [1]; + } + } + }, + data() { + return { + orgData:[], + selecteTreeRow: "", + filterText: '', + defaultProps: { + children: 'children', + label: 'label' + }, + }; + }, + computed(){},//计算属性 + watch: { + selecteTreeRow: {// 检测点击的node节点发送给父组件 + handler() { + this.$emit("getVal", this.selecteTreeRow); //发送节点 + }, + deep: true + } + }, + filter(){},//过滤器 + mounted() {},//勾子函数 + methods: {} + }; + </script> + <style lang="scss" scoped> + .orgTree { + .filter-tree{ + + } + } + </style> + ``` + + + +## 目录结构以及说明 + +├── @gms 政府公共服务(有关单据、首页等公共插件部分写到此产品线下面) + +1.单据插件工程 + +工程名: gms-plugin-billexpand + +介绍:此工程记录了单据的相关动作、组件、公式、查询动作等功能。 + +app.config.json配置文件中"type": "gms-plugin" + +~~~ +├── public # 静态资源 +│ ├── favicon.ico # favicon图标 +│ └── index.html # html 模板 +├── src # 源代码 +│ ├── styles # 管理样式 +│ ├── assets # 记录图片、svg矢量图、video等系统引用的静态资源 +│ ├── actions # 单据动作 +│ │ └──xx.js # 具体动作js +│ ├── components-control # 扩展的动作里面使用的组件 +│ │ └── util # 工具类js +│ ├── formula # 公式:此文件夹里面存储所有的扩展公式 +│ │ └── util # 公式相关工具类js +│ │ └── xxx.js # 公式相关工具类js +│ ├── query-actions # 查询动作:此文件夹里面存储所有查询相关的动作 +│ ├── control # 扩展设计期组件 +│ │ └── util # 扩展组件的工具类js +│ ├── query-actions +│ ├── emcon.js # 配置动作、公式、控件的配置信息 +│ ├── mcon.js # 引入动作、公式、控件的信息 +│ ├── app.config.json # 女娲收集的配置文件 + +~~~ +2.工作流插件工程 + +工程名:gms-plugin-workflow + +介绍:此工程主要扩展工作流所使用的插件 + +app.config.json配置文件中"type": "gms-plugin" + +结构同上 + +2.扩展首页组件 + +工程名:gms-plugin-mainpage-业务名称 + +介绍:此工程主要扩展首页的拖拽组件 + +app.config.json配置文件中"type": "widget" + +``` +├── public # 静态资源 +│ ├── favicon.ico # favicon图标 +│ └── index.html # html 模板 +├── src # 源代码 +│ ├── assets # 记录图片、svg矢量图、video等系统引用的静态资源 +│ ├── components # 组件使用 +│ ├── views # +│ │ └── gms-app.vue # 组件内容 +│ │ └── property.vue # 组件属性 +│ ├── main.build.js # 入口js文件,记录模块使用的引用 +│ ├── app.config.json # 模块的配置文件 +│ ├── vue.config.js # vue 的配置文件,会被 @vue/cli-service 自动加载 +│ ├── app.config.json # 女娲收集的配置文件 +``` + +├── @rbc 云报销 (有关云报销项目的业务功能app模块,写到此产品线下面) + +app.config.json配置文件中"type": "false" + +1.control-strategy 控制策略 + +2.file-management 文件管理 + +3.voucher-center 凭证中心 + +``` +├── public # 静态资源 +│ ├── favicon.ico # favicon图标 +│ └── index.html # html 模板 +├── src # 源代码 +│ ├── assets # 记录图片、svg矢量图、video等系统引用的静态资源 +│ ├── components # 组件使用 +│ ├── views # +│ │ └── xxx.vue # vue文件内容 +│ ├── main.build.js # 入口js文件,记录模块使用的引用 +│ ├── app.config.json # 模块的配置文件 +│ ├── vue.config.js # vue 的配置文件,会被 @vue/cli-service 自动加载 +│ ├── app.config.json # 女娲收集的配置文件 +``` + diff --git a/README.md b/README.md index 94a435f..43b2bbf 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,60 @@ -# rbc-frontend +# rbc-frontend +将线上代码clone到本地 +## 1.环境准备 + ++ npm + +## 2.安装启动 +```sh +# 选择女娲仓库 +npm set registry http://nvwa.jiuqi.com.cn/nexus/repository/npm-gov-public/ +# 登陆 +npm login +# 用户密码 +govguest/p4tabg2q4p5w +# 安装os-cli最新版本 +# npm install -g nr.os-cli@latest +# 安装 os-cli 的 0.4.0 版本,最新版本有缺陷 +npm install -g nr.os-cli@0.4.0 +#安装nr.os-cli后,运行 os-cli -version 没有报错,即环境正常,如有报错请根据报错内容解决问题。 +``` +初始化开发环境 +``` bash +os-cli init dev +``` +修改nr-os目录下config文件夹下 os-config.js.templete 为 os-config.js +修改baseUrl字段为后端地址 +``` js +window.osConfig = { + baseUrl: 'http://10.2.9.10:8090', // 此处为连接的后端地址 + thin: false, + cookieExpires: 1, + storageMode: 'auto', + title: '', + mode: '', +} +``` +整体服务启动 在根目录下面执行 +``` bash +os-cli serve +``` + +## 3. 开发 +进入project目录 +``` bash +cd develop +cd @rbc +cd project +``` +安装依赖 +``` bash +npm i +``` +打包 +``` bash +npm run build +``` +## 4.注意 ++ 这种开发模式下,无法进行热更新,每次修改需要运行 npm run build 才能生效 + -云报销前端代码 \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..660f484 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,12 @@ +#基于oscli镜像 +FROM 10.2.24.210:18081/library/oscli-node:14.15.1 + +#维护人的信息 +MAINTAINER The rbc Project joincheer + +#添加资源文件 +COPY nr-os.tar.gz . +COPY run.sh . +RUN chmod 775 /run.sh +#当启动容器时执行的脚本文件 +CMD ["sh","/run.sh"] diff --git a/docker/run.sh b/docker/run.sh new file mode 100644 index 0000000..39bda60 --- /dev/null +++ b/docker/run.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +tar -zxvf nr-os.tar.gz +cp /nr-os/config/os.config.js.templete /nr-os/config/os.config.js +if [ $SERVER_HOST ]; +then +sed -i "s/location\.origin/\'http\:\/\/$SERVER_HOST\:$SERVER_PORT\'/g" /nr-os/config/os.config.js +fi +if [ $SYSTEM_NAME ]; +then +sed -i 1a\systemName:\'$SYSTEM_NAME\', /nr-os/config/os.config.js +fi + +# 启动os-cli +cd nr-os +os-cli serve --mode=prod \ No newline at end of file diff --git a/solution-version.md b/solution-version.md new file mode 100644 index 0000000..99b73ed --- /dev/null +++ b/solution-version.md @@ -0,0 +1,127 @@ +{ + "name": "nvwa", + "index": { + "name": "@gms/gms-entry", + "version": "0.2.56" + }, + "login": { + "name": "@gms/gms-login", + "version": "0.1.6" + }, + "apps": { + "@nvwa": [ + { + "name": "bap-web-starter", + "version": "~1.1.0" + }, + { + "name": "nvwa-glue-job-plugin", + "version": "0.0.2" + }, + { + "name": "97gg-homepage", + "version": "0.0.12" + }, + { + "name": "97gg-homepage-config", + "version": "0.0.13" + }, + { + "name": "login-manage-app", + "version": "0.3.1" + }, + { + "name": "organization-app", + "version": "1.0.27" + }, + { + "name": "basedata-app", + "version": "1.0.39" + }, + { + "name": "basedata-item-auth-plugin", + "version": "1.0.1" + }, + { + "name": "basedata-rule-auth-plugin", + "version": "1.0.4" + }, + { + "name": "multi-language-config", + "version": "1.1.3" + }, + { + "name": "data-model-manage", + "version": "latest" + }, + { + "name": "organization-auth-plugin", + "version": "1.1.9" + }, + { + "name": "role-manage-app", + "version": "latest" + }, + { + "name": "user-manage-app", + "version": "latest" + }, + { + "name": "system-options-app", + "version": "1.2.2" + } + ], + "@gms":[ + { + "name": "gms-app-runner-bill-form", + "version": "0.1.8" + }, + { + "name": "gms-app-runner-query", + "version": "0.1.10" + }, + { + "name": "icon", + "version": "0.0.9" + }, + { + "name": "gms-app-manage-staff", + "version": "0.1.2-build-latest-202107161013.0" + }, + { + "name": "gms-app-manage-department", + "version": "0.1.2-build-latest-202107161013.0" + }, + { + "name": "gms-app-manage-workflow", + "version": "0.1.20" + }, + { + "name": "gms-app-manage-metadata", + "version": "0.1.2" + }, + { + "name": "gms-plugin-billexpand", + "version": "latest" + }, + { + "name": "gms-plugin-mainpage-reimburseBill", + "version": "0.0.3" + }, + { + "name": "gms-plugin-mainpage-reimburseExpense", + "version": "latest" + } + ], + "@rbc":[ + { + "name": "control-strategy", + "version": "latest" + }, + { + "name": "voucher-center", + "version": "latest" + } + ] + } +} diff --git a/solution.json b/solution.json new file mode 100644 index 0000000..f254a0c --- /dev/null +++ b/solution.json @@ -0,0 +1,184 @@ +{ + "name": "nvwa", + "index": { + "name": "@gms/gms-entry", + "version": "0.2.90" + }, + "login": { + "name": "@rbc/rbc-login", + "version": "0.1.0" + }, + "apps": { + "@nvwa": [ + { + "name": "bap-web-starter", + "version": "2.1.0" + }, + { + "name": "nvwa-glue-job-plugin", + "version": "0.0.2" + }, + { + "name": "97gg-homepage", + "version": "0.0.12" + }, + { + "name": "97gg-homepage-config", + "version": "0.0.13" + }, + { + "name": "login-manage-app", + "version": "0.3.1" + }, + { + "name": "organization-app", + "version": "1.0.27" + }, + { + "name": "basedata-app", + "version": "1.0.39" + }, + { + "name": "basedata-item-auth-plugin", + "version": "1.0.1" + }, + { + "name": "basedata-rule-auth-plugin", + "version": "1.0.4" + }, + { + "name": "multi-language-config", + "version": "1.1.3" + }, + { + "name": "data-model-manage", + "version": "latest" + }, + { + "name": "organization-auth-plugin", + "version": "1.1.9" + }, + { + "name": "user-manage-app", + "version": "1.2.29" + }, + { + "name": "system-options-app", + "version": "1.2.10" + },{ + "name": "oss-system-option", + "version": "1.0.9" + } + ], + "@gms":[ + { + "name": "gms-app-runner-bill-form", + "version": "0.1.9" + }, + { + "name": "gms-app-runner-query", + "version": "0.1.10" + }, + { + "name": "icon", + "version": "latest" + }, + { + "name": "gms-app-manage-staff", + "version": "latest" + }, + { + "name": "gms-app-manage-department", + "version": "latest" + }, + { + "name": "gms-app-manage-workflow", + "version": "latest" + }, + { + "name": "gms-app-manage-metadata", + "version": "latest" + }, + { + "name": "gms-plugin-billexpand", + "version": "0.0.4-SNAPSHOT" + }, + { + "name": "gms-plugin-mainpage-reimburseBill", + "version": "latest" + }, + { + "name": "gms-plugin-mainpage-reimburseExpense", + "version": "latest" + }, + { + "name": "gms-plugin-mainpage-fileList", + "version": "latest" + }, + { + "name": "gms-plugin-mainpage-newsList", + "version": "latest" + }, + { + "name": "gms-plugin-mainpage-feedback", + "version": "latest" + }, + { + "name": "gms-plugin-workflow", + "version": "latest" + }, + { + "name": "gms-plugin-mainpage-workflowcard", + "version": "latest" + }, + { + "name": "gms-plugin-mainpage-mybill", + "version": "latest" + }, + { + "name": "gms-plugin-mainpage-commonfunctions", + "version": "latest" + } + ], + "@rbc":[ + { + "name": "control-strategy", + "version": "latest" + }, + { + "name": "voucher-center", + "version": "latest" + }, + { + "name": "file-management", + "version": "latest" + }, + { + "name": "workflow-job-view", + "version": "latest" + }, + { + "name": "runner-bill-form", + "version": "latest" + }, + { + "name": "icon", + "version": "latest" + }, + { + "name":"bill-runner-query", + "version": "latest" + }, + { + "name": "welcome-page", + "version": "latest" + } + ], + "@sedu":[ + { + "name": "sedu-news", + "version": "0.0.6" + } + ] + } +} diff --git "a/\346\265\213\350\257\225.txt" "b/\346\265\213\350\257\225.txt" deleted file mode 100644 index e69de29..0000000 --- "a/\346\265\213\350\257\225.txt" +++ /dev/null