一、根目录(dciwebui)操作
*以下命令都需要在dciwebui目录下执行
1、安装依赖包
第一步:
npm config set registry http://open.chinadci.com/nexus/repository/all/ --global
npm config set disturl http://open.chinadci.com/nexus/repository/all/ --global
npm login -registry http://open.chinadci.com/nexus/repository/me/
username:admin
password:admin123
第二步:
yarn
2、删除node_modules 下面对应的dci-开头的包(除了dci-form-design)
3、软链接
- windows 执行 ./linkv3.bat 里面的上半部分:
mklink /J .\node_modules\dci-editor .\lib\common\dci-editor
mklink /J .\node_modules\dci-common .\lib\common\dci-common
mklink /J .\node_modules\dci-base .\lib\common\dci-base
mklink /J .\node_modules\dci-net-service .\lib\common\dci-net-service
mklink /J .\node_modules\dci-baseui .\lib\webui\dci-baseui
mklink /J .\node_modules\dci-affix .\lib\webui\dci-affix
mklink /J .\node_modules\dci-common-store .\lib\store\dci-common-store
mklink /J .\node_modules\dci-charts .\lib\lib\dci-charts
mklink /J .\node_modules\dci-customization .\lib\lib\dci-customization
mklink /J .\node_modules\dci-form .\lib\lib\dci-form
mklink /J .\node_modules\dci-maps .\lib\lib\dci-maps
mklink /J .\node_modules\dci-workflows .\lib\lib\dci-workflows
mklink /J .\node_modules\dci-vocabulary .\lib\lib\dci-vocabulary
mklink /J .\node_modules\dci-components .\lib\lib\dci-components
mklink /J .\node_modules\dci-mobile .\lib\lib\dci-mobile
- mac 执行 :(TODO)
sudo sh ./link.sh
二、lib/lib/dci-components 和 lib/lib/dci-customization 目录操作
yarn
三、dci-oa目录操作(lib/projects/dci-oa)
*以下命令都需要在dci-oa目录下执行
1、安装依赖包
npm install dci-form-design --registry=http://open.chinadci.com/nexus/repository/all/
yarn
2、删除node_modules 下面对应的dci-开头的包(除了dci-form-design)
3、软链接
- windows 执行 ./linkv3.bat 里面的下半部分:
mklink /J .\node_modules\dci-editor ..\..\common\dci-editor
mklink /J .\node_modules\dci-common ..\..\common\dci-common
mklink /J .\node_modules\dci-net-service ..\..\common\dci-net-service
mklink /J .\node_modules\dci-baseui ..\..\webui\dci-baseui
mklink /J .\node_modules\dci-affix ..\..\webui\dci-affix
mklink /J .\node_modules\dci-common-store ..\..\store\dci-common-store
mklink /J .\node_modules\dci-charts ..\..\lib\dci-charts
mklink /J .\node_modules\dci-customization ..\..\lib\dci-customization
mklink /J .\node_modules\dci-form ..\..\lib\dci-form
mklink /J .\node_modules\dci-maps ..\..\lib\dci-maps
mklink /J .\node_modules\dci-workflows ..\..\lib\dci-workflows
mklink /J .\node_modules\dci-vocabulary ..\..\lib\dci-vocabulary
mklink /J .\node_modules\dci-components ..\..\lib\dci-components
mklink /J .\node_modules\dci-mobile ..\..\lib\dci-mobile
- mac 执行 :(TODO)
sudo sh ./link.sh
link.sh如下:
#!/bin/bash
# cd ./lib/common/dci-common
# yarn link
# cd ../../../
# yarn link dci-common
# yarn unlink dci-common
CURRDIR=$(pwd)
echo "当前目录:${CURRDIR}"
# ln -s /Users/white/Desktop/Work/Geo/Sources/dciwebui/lib/lib/dci-components /Users/white/Desktop/Work/Geo/Sources/dciwebui/node_modules
# yarn add 必须放到最后,不然就会覆盖上面创建的软连接
# yarn add dci-form-design --registry=http://open.chinadci.com/nexus/repository/all/
packageNames="../../common/dci-editor"
packageNames="${packageNames} ../../common/dci-base"
packageNames="${packageNames} ../../common/dci-common"
packageNames="${packageNames} ../../common/dci-net-service"
packageNames="${packageNames} ../../webui/dci-baseui"
packageNames="${packageNames} ../../webui/dci-affix"
packageNames="${packageNames} ../../store/dci-common-store"
packageNames="${packageNames} ../../lib/dci-charts"
packageNames="${packageNames} ../../lib/dci-customization"
packageNames="${packageNames} ../../lib/dci-form"
packageNames="${packageNames} ../../lib/dci-maps"
packageNames="${packageNames} ../../lib/dci-workflows"
packageNames="${packageNames} ../../lib/dci-vocabulary"
packageNames="${packageNames} ../../lib/dci-components"
packageNames="${packageNames} ../../lib/dci-mobile"
# libDir=
# installLibDir=
nodeModulesDir=${CURRDIR}/node_modules
for item in $packageNames
do
if [ -n "$item" -a "$item" -a "${#item}" -gt 0 ]
then
lastName=$(basename $item)
libDir="${CURRDIR}/$item"
if [ -d "$libDir" -a -d "$nodeModulesDir" ]
then
installLibDir="$CURRDIR/node_modules/$lastName"
if [ -d "$installLibDir" ]
then
echo "移除: $installLibDir"
rm -rf "$installLibDir"
else
echo "新加: $installLibDir"
fi
echo "ln -s ${libDir} ${nodeModulesDir}"
ln -s "${libDir}" "${nodeModulesDir}"
fi
fi
done
4、运行
yarn run dev-server
*PS: 若报错,可能没有安装webpack-dev-server
yarn add webpack-dev-server
*PS: 若webpack报错
yarn add webpack
执行成功:浏览器地址栏输入:/testdev.html