GitBucket
4.6.0
Toggle navigation
Sign in
Files
Branches
1
Tags
Issues
Pull Requests
Labels
Milestones
Wiki
08335
/
hivui-platform-template
hivui平台项目模板
Browse code
add
master
1 parent
22b6032
commit
5be3e23ee630cd28258bad0a3632c6fa005fac89
caibinghong
authored
on 29 Jul 2021
Showing
3 changed files
build/bin/create.sh
project/hivuiLogin/index.html
project/hivuiMain/index.html
Ignore Space
Show notes
View
build/bin/create.sh
h#!/bin/bash ## 权限问题,用 chmod u+x *.sh ## eg: ## cd /mobileproject/$1/XcxProject hivui create $1 if [ $# != 3 ] ; then echo "创建项目的参数不正确,请输入(用户ID,项目名,预览端口)" exit 1 fi basePath='/opt/eap5/desktop' tagPath=$basePath'/preview' tmpPath=$basePath'/project-template' workName=$1 projectName=$2 port=$3 source='<script src="\/'$projectName'\/setting\/desktop\/appsetting\/js\/1.0.0\/appsetting.js" type="text\/javascript"><\/script>' #echo 's/<\/head>/'${source}'<\/head>/g' #exit 1; ## 参数 工号$1 项目名$2 端口$3 ## 工号=工作空间 ## 1、判断工作空间 没有就创建 if [ ! -d "${tagPath}/${workName}" ];then mkdir "${tagPath}/${workName}" fi ## 2、判断项目名 if [ -d "${tagPath}/${workName}/${projectName}" ];then ## 项目名存在,退出 echo "项目名存在" exit 1 fi ## 3、下载模板 ,如果很多用户同时下载到同一目录 git clone http://192.168.4.105:8080/gitbucket/git/08335/hivui-platform-template.git "${tagPath}/${workName}/${projectName}/deploy" ## 复制 node_modules cp -a ${tmpPath}/node_modules ${tagPath}/${workName}/${projectName}/deploy/node_modules cd ${tagPath}/${workName}/${projectName}/deploy/ ## 重命名 mv project ${projectName} rm -rf oldPackage build/oldWebpack ## 替换 package.json 的 name 值 sed -i 's#\("name": \?"\).*#\1'"${projectName}"'",#g' package.json ## 替换 processes.json 的 args 值 sed -i '4s#\("name": \?"\).*#\1'"vite-${workName}-${projectName}"'",#g' processes.json sed -i '7s#\("args": \?"\).*#\1'"--host --port ${port}"'",#g' processes.json cd ${tagPath}/${workName}/${projectName}/deploy/${projectName}/hivuiLogin sed -i 's/<\/head>/'"$source"'<\/head>/g' index.html cd ${tagPath}/${workName}/${projectName}/deploy/${projectName}/hivuiMain sed -i 's/<\/head>/'"$source"'<\/head>/g' index.html cd ${tagPath}/${workName}/${projectName}/deploy/${projectName}/setting/desktop/appsetting/js/1.0.0 sed -i 's#\(projectName: \?\).*#\1"'"${projectName}"'",#g' appsetting.js exit 1; ## 返回预览目录 cd ${tagPath}/${workName}/${projectName}/deploy ### 启动 用yarn 可以把 --host --port 带入 script dev ## yarn run dev --host --port $port npm run pm2:start
h#!/bin/bash ## 权限问题,用 chmod u+x *.sh ## eg: ## cd /mobileproject/$1/XcxProject hivui create $1 if [ $# != 3 ] ; then echo "创建项目的参数不正确,请输入(用户ID,项目名,预览端口)" exit 1 fi basePath='/opt/eap5/desktop' tagPath=$basePath'/preview' tmpPath=$basePath'/project-template' workName=$1 projectName=$2 port=$3 source='<script src="\/'$projectName'\/setting\/desktop\/appsetting\/js\/1.0.0\/appsetting.js" type="text\/javascript"><\/script>' #echo 's/<\/head>/'${source}'<\/head>/g' #exit 1; ## 参数 工号$1 项目名$2 端口$3 ## 工号=工作空间 ## 1、判断工作空间 没有就创建 if [ ! -d "${tagPath}/${workName}" ];then mkdir "${tagPath}/${workName}" fi ## 2、判断项目名 if [ -d "${tagPath}/${workName}/${projectName}" ];then ## 项目名存在,退出 echo "项目名存在" exit 1 fi ## 3、下载模板 ,如果很多用户同时下载到同一目录 git clone http://192.168.4.105:8080/gitbucket/git/08335/hivui-platform-template.git "${tagPath}/${workName}/${projectName}/deploy" ## 复制 node_modules cp -a ${tmpPath}/node_modules ${tagPath}/${workName}/${projectName}/deploy/node_modules cd ${tagPath}/${workName}/${projectName}/deploy/ ## 重命名 mv project ${projectName} rm -rf oldPackage build/oldWebpack ## 替换 package.json 的 name 值 sed -i 's#\("name": \?"\).*#\1'"${projectName}"'",#g' package.json ## 替换 processes.json 的 args 值 sed -i '4s#\("name": \?"\).*#\1'"vite-${workName}-${projectName}"'",#g' processes.json sed -i '7s#\("args": \?"\).*#\1'"--host --port ${port}"'",#g' processes.json cd ${tagPath}/${workName}/${projectName}/deploy/${projectName}/hivuiLogin sed -i 's/<\/head>/'"$source"'<\/head>/g' index.html cd ${tagPath}/${workName}/${projectName}/deploy/${projectName}/hivuiMain sed -i 's/<\/head>/'"$source"'<\/head>/g' index.html cd ${tagPath}/${workName}/${projectName}/deploy/${projectName}/setting/desktop/appsetting/js/1.0.0 sed -i 's#\("projectName": \?"\).*#\1'"${projectName}"'",#g' appsetting.js exit 1; ## 返回预览目录 cd ${tagPath}/${workName}/${projectName}/deploy ### 启动 用yarn 可以把 --host --port 带入 script dev ## yarn run dev --host --port $port npm run pm2:start
Ignore Space
Show notes
View
project/hivuiLogin/index.html
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <title>EAP5-Admin-Login</title> <link rel="stylesheet" href="/assets_platform/element-ui2.15.3/index.css"> <script src="/assets_platform/vue2.6.14/vue.min.js"></script> <script src="/assets_platform/element-ui2.15.3/index.js"></script> <% if(!htmlWebpackPlugin.vite){%> <!--发布时 公共库--> <script src="/assets_platform/vendor_dll/vuelibs.dll.js"></script> <script src="/assets_platform/vendor_dll/vendor.dll.js"></script> <%}%> <!-- <script src="/assets_platform/eap/eap.umd.min.js"></script> <script src="/项目名/setting/desktop/appsetting/js/1.0.0/appsetting.js" type="text/javascript"></script> --> </head> <body> <div id="app"></div> <% if(htmlWebpackPlugin.vite==true){%> <script type="module" src="./index.js"></script> <%}%> <!-- built files will be auto injected --> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <title>EAP5-Admin-Login</title> <link rel="stylesheet" href="/assets_platform/element-ui2.15.3/index.css"> <script src="/assets_platform/vue2.6.14/vue.min.js"></script> <script src="/assets_platform/element-ui2.15.3/index.js"></script> <% if(!htmlWebpackPlugin.vite){%> <!--发布时 公共库--> <script src="/assets_platform/vendor_dll/vuelibs.dll.js"></script> <script src="/assets_platform/vendor_dll/vendor.dll.js"></script> <%}%> <!-- <script src="/assets_platform/eap/eap.umd.min.js"></script> --> <script src="/project/setting/desktop/appsetting/js/1.0.0/appsetting.js" type="text/javascript"></script> </head> <body> <div id="app"></div> <% if(htmlWebpackPlugin.vite==true){%> <script type="module" src="./index.js"></script> <%}%> <!-- built files will be auto injected --> </body> </html>
Ignore Space
Show notes
View
project/hivuiMain/index.html
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <title>EAP5-Admin-Main</title> <link rel="stylesheet" href="/assets_platform/element-ui/index.css"> <script src="/assets_platform/vue/vue.min.js"></script> <script src="/assets_platform/element-ui/index.js"></script> <% if(!htmlWebpackPlugin.vite){%> <!--发布时 公共库--> <script src="/assets_platform/vendor_dll/vuelibs.dll.js"></script> <script src="/assets_platform/vendor_dll/vendor.dll.js"></script> <%}%> <!-- <script src="/项目名/setting/desktop/appsetting/js/1.0.0/appsetting.js" type="text/javascript"></script> --> </head> <body> <div id="app"></div> <script> function changeLayout(name) { window.localStorage.setItem('layout', name) window.location.reload(); } var Scp = { User: { id: "admin", name: "管理员", deptId: "", deptName: "", positionId: "GLY", postionName: "管理员", bzId: "admin_3", bzName: "管理员岗位3", bzDeptId: ".WLDJT.DGS", bzDeptName: "D公司", bzPositionId: "HQRY", bzPositionName: "后勤人员", orgId: "admin_3", defOrgId: "admin_3" } } var __guid = new Date().valueOf(); var __sysConfig = { events: { onLoad1: function () { } }, projectName: "eaptpl", sysProjectMange: { id: __guid++, name: '工程树', iconClass: 'icon-tree', uri: 'amreport/designer/tree/design.do', url: '/amrept-web/amreport/designer/tree/design.do' }, sysLoadLogo: { src: '', title: '中海创科技' }, sysLogo: { src: '', title: '中海创科技' }, //默认门户 对应自定义门户功能 sysSetTabs: [ { title: '首页', id: __guid++, close: false, type: 'home', actived: true //默认选中 } // ,{ // title:'工作台', // id: __guid++, // close:false, // type:'work' // } ], //默认 打开功能 sysDefTabs: [ // { // id: __guid++, // title:"设计", // url:'http://192.168.7.109:9090/#/design', // close:true, // }, // { // id: __guid++, // title:"百度功能测试", // url:'http://www.baidu.com', // close:true // }, // { // id: __guid++, // title:"bing", // url:'https://cn.bing.com/', // close:true // } ], sysList: [ ], sysFuncMenus: [ { id: __guid++, name: '<font color=red>邮件系统</font>', url: 'http://hcmail.histron.cn:8001/webmail/index.do?osName=windows', iconClass: 'icon-mail', target: '_blank', }, { type: 'split' }, { id: __guid++, name: '布局', type: 'layout', iconClass: 'icon-user', children: [ { id: 'vertical', name: '上下布局', handler: function () { changeLayout(this.id) } }, { id: 'level', name: '左右布局', handler: function () { changeLayout(this.id) } } ] }, { type: 'split' }, { id: __guid++, name: '用户信息', type: 'userInfo', iconClass: 'icon-user', children: [ { id: __guid++, name: '部门:AF10', iconClass: 'icon-user', actived: true }, { id: __guid++, html: '<font color=red>访问下属111</font>', name: '<font color=red>访问下属</font>', iconClass: 'icon-user', children: [ { name: "张三", id: __guid++ }, { name: "李四", id: __guid++ }, ] }, { id: __guid++, name: '修改密码', iconClass: '', handler: function () { alert('访问下属'); } } ] }, { type: 'split' } ], } </script> <% if(htmlWebpackPlugin.vite==true){%> <script type="module" src="./index.js"></script> <%}%> <!-- built files will be auto injected --> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <title>EAP5-Admin-Main</title> <link rel="stylesheet" href="/assets_platform/element-ui/index.css"> <script src="/assets_platform/vue/vue.min.js"></script> <script src="/assets_platform/element-ui/index.js"></script> <% if(!htmlWebpackPlugin.vite){%> <!--发布时 公共库--> <script src="/assets_platform/vendor_dll/vuelibs.dll.js"></script> <script src="/assets_platform/vendor_dll/vendor.dll.js"></script> <%}%> <script src="/project/setting/desktop/appsetting/js/1.0.0/appsetting.js" type="text/javascript"></script> </head> <body> <div id="app"></div> <script> function changeLayout(name) { window.localStorage.setItem('layout', name) window.location.reload(); } var Scp = { User: { id: "admin", name: "管理员", deptId: "", deptName: "", positionId: "GLY", postionName: "管理员", bzId: "admin_3", bzName: "管理员岗位3", bzDeptId: ".WLDJT.DGS", bzDeptName: "D公司", bzPositionId: "HQRY", bzPositionName: "后勤人员", orgId: "admin_3", defOrgId: "admin_3" } } var __guid = new Date().valueOf(); var __sysConfig = { events: { onLoad1: function () { } }, projectName: "eaptpl", sysProjectMange: { id: __guid++, name: '工程树', iconClass: 'icon-tree', uri: 'amreport/designer/tree/design.do', url: '/amrept-web/amreport/designer/tree/design.do' }, sysLoadLogo: { src: '', title: '中海创科技' }, sysLogo: { src: '', title: '中海创科技' }, //默认门户 对应自定义门户功能 sysSetTabs: [ { title: '首页', id: __guid++, close: false, type: 'home', actived: true //默认选中 } // ,{ // title:'工作台', // id: __guid++, // close:false, // type:'work' // } ], //默认 打开功能 sysDefTabs: [ // { // id: __guid++, // title:"设计", // url:'http://192.168.7.109:9090/#/design', // close:true, // }, // { // id: __guid++, // title:"百度功能测试", // url:'http://www.baidu.com', // close:true // }, // { // id: __guid++, // title:"bing", // url:'https://cn.bing.com/', // close:true // } ], sysList: [ ], sysFuncMenus: [ { id: __guid++, name: '<font color=red>邮件系统</font>', url: 'http://hcmail.histron.cn:8001/webmail/index.do?osName=windows', iconClass: 'icon-mail', target: '_blank', }, { type: 'split' }, { id: __guid++, name: '布局', type: 'layout', iconClass: 'icon-user', children: [ { id: 'vertical', name: '上下布局', handler: function () { changeLayout(this.id) } }, { id: 'level', name: '左右布局', handler: function () { changeLayout(this.id) } } ] }, { type: 'split' }, { id: __guid++, name: '用户信息', type: 'userInfo', iconClass: 'icon-user', children: [ { id: __guid++, name: '部门:AF10', iconClass: 'icon-user', actived: true }, { id: __guid++, html: '<font color=red>访问下属111</font>', name: '<font color=red>访问下属</font>', iconClass: 'icon-user', children: [ { name: "张三", id: __guid++ }, { name: "李四", id: __guid++ }, ] }, { id: __guid++, name: '修改密码', iconClass: '', handler: function () { alert('访问下属'); } } ] }, { type: 'split' } ], } </script> <% if(htmlWebpackPlugin.vite==true){%> <script type="module" src="./index.js"></script> <%}%> <!-- built files will be auto injected --> </body> </html>
Show line notes below