Initial commit
This commit is contained in:
commit
1b95cb1fbd
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"presets": [ "env", "react", "stage-2" ],
|
||||
"plugins": [
|
||||
"jsx-control-statements",
|
||||
[
|
||||
"import-bee",
|
||||
{
|
||||
"style": true
|
||||
}
|
||||
],
|
||||
"transform-decorators-legacy",
|
||||
[
|
||||
"import",
|
||||
{
|
||||
"libraryName": "antd-mobile",
|
||||
"style": "css"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# Typescript v1 declaration files
|
||||
typings/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
|
||||
dist
|
||||
|
||||
# package-lock.json
|
||||
|
||||
yarn.lock
|
||||
|
||||
.DS_Store
|
||||
.vscode
|
||||
|
||||
src/uapbd
|
||||
src/uapbd_front
|
||||
src/uap
|
||||
src/platform
|
||||
src/ic
|
||||
src/so
|
||||
src/uap_bak
|
|
@ -0,0 +1,17 @@
|
|||
## 分支说明:
|
||||
|
||||
### NCC1903、NCC1909、 NCC2005 脚手架分支为: master
|
||||
|
||||
|
||||
### 其余版本 脚手架分支为: develop-ncc3.0
|
||||
|
||||
|
||||
## 使用说明:
|
||||
|
||||
脚手架使用说明文档 [点击此处查看](http://git.yonyou.com/nc-pub/Public_Document/blob/master/%E5%89%8D%E7%AB%AF%E6%A1%86%E6%9E%B6/PC%E7%AB%AF%E6%A1%86%E6%9E%B6/%E5%BF%AB%E9%80%9F%E5%BC%80%E5%8F%91%E6%8C%87%E5%AF%BC/1.%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/%E6%AD%A5%E9%AA%A4%E7%BB%86%E5%88%99/2.%E5%89%8D%E7%AB%AF%E5%B7%A5%E7%A8%8B%E9%A1%B9%E7%9B%AE%E6%90%AD%E5%BB%BA.md)
|
||||
|
||||
## 注意
|
||||
npm版本太高可能导致npm i失败,需要降至6版本
|
||||
```
|
||||
npm i npm@6 -g
|
||||
```
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"buildEntryPath": ["./src/domain/module/node/page/index.js"],
|
||||
"proxy1": "http://10.16.5.112:1909",
|
||||
"proxy": "http://10.11.115.119:8080",
|
||||
"buildWithoutHTML": ["uapbd/refer", "uap/refer"],
|
||||
"devPort": 3006,
|
||||
"patch": {
|
||||
"path": [],
|
||||
"provider": "",
|
||||
"department": "",
|
||||
"project": "",
|
||||
"branch": ""
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
class OutputSourcePlugin {
|
||||
constructor({ output }) {
|
||||
this.output = output;
|
||||
}
|
||||
apply(compiler) {
|
||||
compiler.hooks.done.tap(
|
||||
'OutputSourcePlugin',
|
||||
({ compilation }) => {
|
||||
let outputPath = compilation.compiler.outputPath,
|
||||
configJSONs = [];
|
||||
|
||||
for (let index = 0; index < compilation.entries.length; index++) {
|
||||
const resource = compilation.entries[index].resource;
|
||||
if (fs.existsSync(path.join(resource, '../config.json'))) {
|
||||
configJSONs.push(path.join(resource, '../config.json'))
|
||||
}
|
||||
}
|
||||
|
||||
[...compilation.fileDependencies, ...configJSONs].forEach(file => {
|
||||
if (!file.includes('node_modules')) {
|
||||
let targetPath = path.resolve(
|
||||
path.resolve(outputPath, typeof this.output === 'function' ? this.output(file) : this.output),
|
||||
path.relative(path.resolve(__dirname, '../'), file),
|
||||
), targetDir = path.resolve(targetPath, '../');
|
||||
|
||||
mkdir(targetDir);
|
||||
|
||||
fs.copyFileSync(file, targetPath);
|
||||
// fs.writeFileSync(targetPath, fs.readFileSync(file));
|
||||
}
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function mkdir(dir) {
|
||||
if (!fs.existsSync(dir)) {
|
||||
let parentDir = path.resolve(dir, '../');
|
||||
mkdir(parentDir);
|
||||
fs.mkdirSync(dir);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = OutputSourcePlugin;
|
|
@ -0,0 +1,224 @@
|
|||
/*
|
||||
* @Author: liyxt
|
||||
* @Date: 2019-04-23 09:37:04
|
||||
* @LastEditors: liyxt
|
||||
* @LastEditTime: 2020-05-19 16:43:33
|
||||
* @Description: file content
|
||||
*/
|
||||
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
||||
const glob = require('glob');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const fs = require('fs');
|
||||
const webpack = require('webpack');
|
||||
|
||||
module.exports = function buildEntry({ buildPath, buildWithoutHTML, hash, mode, client, fse }) {
|
||||
fse = fse === 'true' || fse === true || false;
|
||||
Array.isArray(buildWithoutHTML) && buildWithoutHTML.unshift('refer');
|
||||
let projects = [],
|
||||
plugins = [],
|
||||
entries = {},
|
||||
externals = {};
|
||||
// 遍历src下的js
|
||||
(function(callback) {
|
||||
if (Array.isArray(buildPath)) {
|
||||
buildPath.forEach(_buildPath => {
|
||||
callback(_buildPath);
|
||||
});
|
||||
} else {
|
||||
callback(buildPath);
|
||||
}
|
||||
})(function(buildPath) {
|
||||
getFiles(buildPath);
|
||||
});
|
||||
|
||||
projects.forEach(e => {
|
||||
if (e === 'uapbd') {
|
||||
// guozhq让弄的,供应链特殊
|
||||
fs.existsSync('./src/uapbd/scmbase/public') &&
|
||||
plugins.push(
|
||||
new CopyWebpackPlugin([{ from: `./src/uapbd/scmbase/public`, to: `./uapbd/scmbase/public` }])
|
||||
);
|
||||
// wanghxm让弄的,hr特殊
|
||||
fs.existsSync('./src/uapbd/hrbase/public') &&
|
||||
plugins.push(
|
||||
new CopyWebpackPlugin([{ from: `./src/uapbd/hrbase/public`, to: `./uapbd/hrbase/public` }])
|
||||
);
|
||||
}
|
||||
fs.existsSync(`./src/${e}/public`) &&
|
||||
plugins.push(
|
||||
new CopyWebpackPlugin([
|
||||
// {output}/to/file.txt
|
||||
{ from: `./src/${e}/public`, to: `./${e}/public` }
|
||||
])
|
||||
);
|
||||
});
|
||||
|
||||
function getFiles(buildPath) {
|
||||
glob.sync(buildPath).forEach(path => {
|
||||
// path ---为加载的每个index.js文件:./src/reva_demo/module/apply/list/index.js
|
||||
// chunk = 节点+list/card: reva_demo/module/apply/list
|
||||
if (
|
||||
(client === 'mobile' && path.includes('/mobile_')) ||
|
||||
(client !== 'mobile' && !path.includes('/mobile_'))
|
||||
) {
|
||||
// 移动端 || web端
|
||||
let chunk = path.split('./src/')[1].split('/index.js')[0],
|
||||
project = chunk.split('/')[0]; // reva_demo
|
||||
|
||||
//把src自定义命名下的文件层级减掉,更改第二层级,把领域名改为 extend_领域名 by bbqin
|
||||
if (fse) {
|
||||
let chunkarr = chunk.split('/');
|
||||
chunkarr[0] = 'NCCExtend';
|
||||
chunkarr[1] = `extend_${chunkarr[1]}`;
|
||||
chunk = chunkarr.join('/');
|
||||
}
|
||||
|
||||
projects.includes(project) || projects.push(project);
|
||||
// 生成webpack.config.js的入口
|
||||
let configJSONPath = './src/' + chunk + '/config.json',
|
||||
isExists = fs.existsSync(configJSONPath),
|
||||
_hash;
|
||||
if (isExists) {
|
||||
// 特殊处理的
|
||||
_hash = require('.' + configJSONPath).hash;
|
||||
}
|
||||
|
||||
if (hash === 'false') {
|
||||
hash = false;
|
||||
} else if (hash === 'true') {
|
||||
hash = true;
|
||||
}
|
||||
|
||||
let _chunk = ('/' + chunk + '/').toLowerCase();
|
||||
if (mode === 'development') {
|
||||
entries[`${chunk}/index`] = path;
|
||||
} else {
|
||||
if (hash) {
|
||||
// 筛选出带hash的
|
||||
if (_hash) {
|
||||
// config.json里的hash优先级高
|
||||
entries[`${chunk}/index`] = path;
|
||||
} else if (_hash !== false) {
|
||||
// 非参照页面生成hash
|
||||
!(
|
||||
_chunk.includes('/refer/') ||
|
||||
_chunk.includes('/ref/') ||
|
||||
_chunk.includes('/refers/') ||
|
||||
_chunk.includes('/mobile_refer/') ||
|
||||
fse
|
||||
) && (entries[`${chunk}/index`] = path);
|
||||
}
|
||||
} else {
|
||||
// 筛选出不带hash的
|
||||
if (_hash === false) {
|
||||
// config.json里的hash优先级高
|
||||
entries[`${chunk}/index`] = path;
|
||||
} else if (_hash !== true) {
|
||||
// 参照页面不生成hash
|
||||
(_chunk.includes('/refer/') ||
|
||||
_chunk.includes('/ref/') ||
|
||||
_chunk.includes('/refers/') ||
|
||||
_chunk.includes('/mobile_refer/') ||
|
||||
_hash === false ||
|
||||
fse) &&
|
||||
(entries[`${chunk}/index`] = path);
|
||||
}
|
||||
}
|
||||
}
|
||||
// buildWithoutHTML中的页面不生成html
|
||||
if (entries[`${chunk}/index`]) {
|
||||
let templatePath = client === 'mobile' ? './template/mobileTemplate.html' : './template/index.html';
|
||||
let configjs = ''; //额外配置的js文件
|
||||
let configcss = ''; //额外配置的css文件
|
||||
if (isExists) {
|
||||
let {
|
||||
template,
|
||||
output,
|
||||
dependjs,
|
||||
dependcss,
|
||||
dependModuleName,
|
||||
report,
|
||||
echarts,
|
||||
prodProxy
|
||||
} = require('.' + configJSONPath);
|
||||
|
||||
// template: HTML模板路径
|
||||
if (template) {
|
||||
templatePath = template;
|
||||
}
|
||||
|
||||
// output: 单独输出的文件配置
|
||||
if (output) {
|
||||
entries[`${output}/index`] = path;
|
||||
}
|
||||
|
||||
// report: 报表依赖
|
||||
if (report) {
|
||||
configjs += `<script src="../../../../lappreportrt/nc-report/public/vendor.js"></script>`;
|
||||
configjs += `<script src="../../../../lappreportrt/nc-report/index.js"></script>`;
|
||||
configcss += `<link rel="stylesheet" href="../../../../lappreportrt/nc-report/public/vendor.css" />`;
|
||||
configcss += `<link rel="stylesheet" href="../../../../lappreportrt/nc-report/index.css" />`;
|
||||
}
|
||||
if (echarts) {
|
||||
configjs += `<script src="../../../../platform/echarts.js"></script>`;
|
||||
}
|
||||
|
||||
// dependjs: 依赖的js文件配置
|
||||
if (Array.isArray(dependjs)) {
|
||||
configjs += dependjs.map(src => `<script src="${src}?v=${Date.now()}"></script>`).join('');
|
||||
}
|
||||
|
||||
// dependcss: 依赖的css文件配置
|
||||
if (Array.isArray(dependcss)) {
|
||||
configcss += dependcss
|
||||
.map(item => `<link rel="stylesheet" href=${item}?v=${Date.now()}>`)
|
||||
.join('');
|
||||
}
|
||||
|
||||
// dependModuleName: 依赖的模块名
|
||||
if (Array.isArray(dependModuleName)) {
|
||||
// 打包时排除
|
||||
dependModuleName.forEach(item => (externals[`${item}`] = `${item}/index`));
|
||||
}
|
||||
|
||||
plugins.push(
|
||||
new webpack.DefinePlugin({
|
||||
PROD_PROXY: JSON.stringify((mode !== 'development' && prodProxy) || '')
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
if (!(buildWithoutHTML || []).some(e => path.includes(e))) {
|
||||
const htmlConf = {
|
||||
filename: `${chunk}/index.html`, // 生成的html文件名,可加目录/.../.../index.html
|
||||
template: `${templatePath}`, // 模板html路径
|
||||
inject: true, //允许插件修改哪些内容,包括head与body
|
||||
chunks: [`${chunk}/index`], // 生成的html文件引入哪些js,不传的话引入所有js
|
||||
cache: true,
|
||||
templateParameters: {
|
||||
configjs: configjs, //为模板添加js
|
||||
configcss: configcss //为模板添加css
|
||||
}
|
||||
};
|
||||
plugins.push(new HtmlWebpackPlugin(htmlConf));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
let cleanOnceBeforeBuildPatterns = Object.values(entries).map(e => e.replace('index.js', '').replace('./src/', ''));
|
||||
plugins.push(
|
||||
new CleanWebpackPlugin({
|
||||
cleanOnceBeforeBuildPatterns,
|
||||
cleanAfterEveryBuildPatterns: [],
|
||||
verbose: true
|
||||
})
|
||||
);
|
||||
return {
|
||||
plugins,
|
||||
entries,
|
||||
externals
|
||||
};
|
||||
};
|
|
@ -0,0 +1,93 @@
|
|||
/*
|
||||
* @Author: liyxt
|
||||
* @Date: 2018-09-17 11:10:21
|
||||
* @LastEditors: liyxt
|
||||
* @LastEditTime: 2020-04-08 09:34:15
|
||||
* @Description: file content
|
||||
*/
|
||||
const configJSON = require('../config.json');
|
||||
const buildEntry = require('./buildEntry');
|
||||
const { spawn } = require('child_process');
|
||||
|
||||
// buildPath是npm参数
|
||||
let buildParam,
|
||||
paramMap = {};
|
||||
if (process.env.npm_config_argv) {
|
||||
[, , ...buildParam] = JSON.parse(process.env.npm_config_argv).original;
|
||||
} else {
|
||||
[, , , ...buildParam] = process.argv;
|
||||
}
|
||||
|
||||
buildParam.forEach(param => {
|
||||
let key = param.split('=')[0],
|
||||
value = param.split('=')[1];
|
||||
paramMap[key] ? paramMap[key].push(value) : (paramMap[key] = [value]);
|
||||
});
|
||||
let buildEntryPath = (paramMap['--env.buildPath'] || []).filter(e => e),
|
||||
buildOutputPath = paramMap['--env.buildOutputPath'] || [];
|
||||
|
||||
if (!buildEntryPath.length) {
|
||||
buildEntryPath = configJSON.buildEntryPath || './src/*/*/*/*/index.js';
|
||||
}
|
||||
let buildWithoutHTML = configJSON.buildWithoutHTML;
|
||||
buildWithoutHTML && typeof buildWithoutHTML === 'string' && (buildWithoutHTML = [buildWithoutHTML]);
|
||||
|
||||
// mode是nodeJs参数
|
||||
let [, , mode, client] = process.argv;
|
||||
|
||||
let { entries: hashEntries } = buildEntry({ buildPath: buildEntryPath, buildWithoutHTML, hash: true, client });
|
||||
let { entries } = buildEntry({ buildPath: buildEntryPath, buildWithoutHTML, hash: false, client });
|
||||
|
||||
// 加载打包二开相关文件
|
||||
let extendBuildEntryPath = configJSON.extendBuildEntryPath || [];
|
||||
let { entries: extendEntries } = buildEntry({
|
||||
buildPath: extendBuildEntryPath,
|
||||
buildWithoutHTML,
|
||||
hash: false,
|
||||
client,
|
||||
fse: true
|
||||
});
|
||||
|
||||
if (Object.keys(hashEntries).length) {
|
||||
runSpawn(buildEntryPath, mode, true, false);
|
||||
}
|
||||
if (Object.keys(entries).length) {
|
||||
runSpawn(buildEntryPath, mode, false, false);
|
||||
}
|
||||
|
||||
if (Object.keys(extendEntries).length) {
|
||||
runSpawn(extendBuildEntryPath, mode, false, true);
|
||||
}
|
||||
|
||||
function runSpawn(buildEntryPath, mode, hash, fse) {
|
||||
const ls = spawn('node', [
|
||||
'--max_old_space_size=8192',
|
||||
'node_modules/webpack/bin/webpack.js',
|
||||
'--progress',
|
||||
'--colors',
|
||||
'--config',
|
||||
'./config/webpack.prod.config.js',
|
||||
`--env.mode=${mode}`,
|
||||
`--env.hash=${hash}`,
|
||||
`--env.client=${client}`,
|
||||
`--env.fse=${fse}`,
|
||||
`--env.outputPath=${buildOutputPath.join('/')}`,
|
||||
...buildEntryPath.map(e => '--env.buildPath=' + e)
|
||||
]);
|
||||
|
||||
ls.stdout.on('data', data => {
|
||||
if (data.includes('ERROR')) {
|
||||
throw new Error(data);
|
||||
} else {
|
||||
data && console.log(`${data}`);
|
||||
}
|
||||
});
|
||||
|
||||
ls.stderr.on('data', data => {
|
||||
if (data.includes('ERROR')) {
|
||||
throw new Error(data);
|
||||
} else {
|
||||
data && console.log(`${data}`);
|
||||
}
|
||||
});
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<packmetadata>
|
||||
<!-- provider -->
|
||||
<!-- department -->
|
||||
<!-- time -->
|
||||
<!-- id -->
|
||||
<!-- needRecreatedLoginJar -->
|
||||
<!-- needDeploy -->
|
||||
<!-- patchKey -->
|
||||
<canAppliedMiddleware>Weblogic,Websphere 7.0,Yonyou Middleware V5,Yonyou Middleware V6</canAppliedMiddleware>
|
||||
<canAppliedDB>DB2 V9.7,SQL Server 2008 R2,Oracle 10,Oracle 11</canAppliedDB>
|
||||
<patchType>BUG修复补丁</patchType>
|
||||
<modifiedJavaClasses></modifiedJavaClasses>
|
||||
<description/>
|
||||
<modifiedModules/>
|
||||
<applyVersion>5.0,5.01,5.011,5.02,5.3,5.5,5.6,5.7,5.75,6.0,6.1,6.3</applyVersion>
|
||||
<patchName></patchName>
|
||||
<bugs/>
|
||||
<patchPriority>高危补丁</patchPriority>
|
||||
<patchVersion/>
|
||||
<dependInfo/>
|
||||
<canAppliedOS>Linux,Windows,AIX,Solaris</canAppliedOS>
|
||||
<searchKeys/>
|
||||
</packmetadata>
|
|
@ -0,0 +1,145 @@
|
|||
/*
|
||||
* @Author: liyxt
|
||||
* @Date: 2019-12-09 19:54:41
|
||||
* @LastEditors : liyxt
|
||||
* @LastEditTime : 2019-12-31 09:44:54
|
||||
* @Description: file content
|
||||
*/
|
||||
const configJSON = require('../config.json');
|
||||
const fs = require('fs');
|
||||
const { resolve, join, sep } = require('path');
|
||||
const { spawn } = require('child_process');
|
||||
const yazl = require('yazl');
|
||||
|
||||
var zipfile = new yazl.ZipFile();
|
||||
var patchConfig = configJSON.patch || {};
|
||||
|
||||
// 先删除dist目录
|
||||
delDir('./dist');
|
||||
delDir('./patch');
|
||||
|
||||
let folderSet = new Set();
|
||||
|
||||
// windows下npm执行名不同
|
||||
const ls = spawn(process.platform === 'win32' ? 'npm.cmd' : 'npm', [
|
||||
'run',
|
||||
'test',
|
||||
'--isPatch',
|
||||
...(patchConfig.path || []).map(e => '--env.buildPath=' + e)
|
||||
]);
|
||||
ls.stdout.on('data', data => {
|
||||
if (data.includes('ERROR')) {
|
||||
throw new Error(data);
|
||||
} else {
|
||||
data && console.log(`${data}`);
|
||||
}
|
||||
});
|
||||
|
||||
ls.stderr.on('data', data => {
|
||||
if (data.includes('ERROR')) {
|
||||
throw new Error(data);
|
||||
} else {
|
||||
data && console.log(`${data}`);
|
||||
}
|
||||
});
|
||||
|
||||
ls.on('close', code => {
|
||||
folderSet.clear();
|
||||
// 加入到zip入口
|
||||
addEntry(resolve(__dirname, '../dist'));
|
||||
// 动态修改xml
|
||||
let xmlconfig = {
|
||||
id: uuid(),
|
||||
provider: patchConfig.provider,
|
||||
department: patchConfig.department,
|
||||
needRecreatedLoginJar: false,
|
||||
needDeploy: false,
|
||||
time: dateFormat('YYYY-mm-dd HH:MM:SS', new Date()),
|
||||
patchKey: [...folderSet].join(',')
|
||||
};
|
||||
let xml = fs.readFileSync(resolve(__dirname, '../config/packmetadata.xml'), 'utf-8');
|
||||
|
||||
Object.entries(xmlconfig).forEach(([key, value]) => {
|
||||
xml = xml.replace(`<!-- ${key} -->`, `<${key}>${value}</${key}>`);
|
||||
});
|
||||
|
||||
fs.writeFileSync(resolve(__dirname, '../dist/packmetadata.xml'), xml, 'utf-8');
|
||||
zipfile.addFile('./dist/packmetadata.xml', 'packmetadata.xml');
|
||||
|
||||
zipfile.outputStream.pipe(fs.createWriteStream(`patch_${new Date().getTime()}.zip`)).on('close', function() {
|
||||
console.log('补丁已出!');
|
||||
});
|
||||
zipfile.end();
|
||||
});
|
||||
|
||||
function delDir(path) {
|
||||
let files = [];
|
||||
if (fs.existsSync(path)) {
|
||||
files = fs.readdirSync(path);
|
||||
files.forEach(file => {
|
||||
let curPath = path + '/' + file;
|
||||
if (fs.statSync(curPath).isDirectory()) {
|
||||
delDir(curPath); //递归删除文件夹
|
||||
} else {
|
||||
fs.unlinkSync(curPath); //删除文件
|
||||
}
|
||||
});
|
||||
fs.rmdirSync(path);
|
||||
}
|
||||
}
|
||||
|
||||
function uuid() {
|
||||
var s = [];
|
||||
var hexDigits = '0123456789abcdef';
|
||||
for (var i = 0; i < 36; i++) {
|
||||
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
|
||||
}
|
||||
s[14] = '4'; // bits 12-15 of the time_hi_and_version field to 0010
|
||||
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
|
||||
s[8] = s[13] = s[18] = s[23] = '-';
|
||||
|
||||
var uuid = s.join('');
|
||||
return uuid;
|
||||
}
|
||||
|
||||
function addEntry(prefix = './dist') {
|
||||
//读取目录
|
||||
var paths = fs.readdirSync(prefix);
|
||||
paths.forEach(function(path) {
|
||||
var from = join(prefix, path);
|
||||
var st = fs.statSync(from);
|
||||
if (st.isFile()) {
|
||||
let folder = '/hotwebs/nccloud/resources/' + prefix.split(`${sep}dist${sep}`)[1];
|
||||
if (!folder.includes('__SOURCE__CODE__')) {
|
||||
folderSet.add(folder);
|
||||
}
|
||||
folder = join('replacement', folder);
|
||||
zipfile.addFile(from, join(folder, path));
|
||||
if (!folder.includes('__SOURCE__CODE__')) {
|
||||
zipfile.addFile(resolve(__dirname, 'ncc_patch'), join(folder, 'ncc_patch'));
|
||||
}
|
||||
} else if (st.isDirectory()) {
|
||||
addEntry(from);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function dateFormat(fmt, date) {
|
||||
let ret;
|
||||
let opt = {
|
||||
'Y+': date.getFullYear().toString(), // 年
|
||||
'm+': (date.getMonth() + 1).toString(), // 月
|
||||
'd+': date.getDate().toString(), // 日
|
||||
'H+': date.getHours().toString(), // 时
|
||||
'M+': date.getMinutes().toString(), // 分
|
||||
'S+': date.getSeconds().toString() // 秒
|
||||
// 有其他格式化字符需求可以继续添加,必须转化成字符串
|
||||
};
|
||||
for (let k in opt) {
|
||||
ret = new RegExp('(' + k + ')').exec(fmt);
|
||||
if (ret) {
|
||||
fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0'));
|
||||
}
|
||||
}
|
||||
return fmt;
|
||||
}
|
|
@ -0,0 +1,130 @@
|
|||
/*
|
||||
* @Author: liyxt
|
||||
* @Date: 2019-09-12 10:17:44
|
||||
* @LastEditors: liyxt
|
||||
* @LastEditTime: 2020-03-25 13:52:00
|
||||
* @Description: file content
|
||||
*/
|
||||
/**
|
||||
* 公共配置
|
||||
*/
|
||||
const path = require('path');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
|
||||
//优化配置,对于使用CDN作为包资源的引用从外到内的配置
|
||||
const externals = {
|
||||
'nc-lightapp-mobile': 'nc-lightapp-mobile',
|
||||
'nc-lightapp-front': 'nc-lightapp-front',
|
||||
'platform-workbench': 'platform-workbench',
|
||||
'platform-report': 'platform-report',
|
||||
'platform-login': 'platform-login',
|
||||
'nc-report': 'nc-report',
|
||||
'babel-polyfill': 'babel-polyfill',
|
||||
'nc-graphic-report': 'nc-graphic-report',
|
||||
axios: {
|
||||
root: 'axios',
|
||||
var: 'axios',
|
||||
commonjs: 'axios',
|
||||
commonjs2: 'axios',
|
||||
amd: 'axios'
|
||||
},
|
||||
react: {
|
||||
root: 'React',
|
||||
var: 'React',
|
||||
commonjs: 'react',
|
||||
commonjs2: 'react',
|
||||
amd: 'react'
|
||||
},
|
||||
// redux: {
|
||||
// root: 'Redux',
|
||||
// var: 'Redux',
|
||||
// commonjs: 'redux',
|
||||
// commonjs2: 'redux',
|
||||
// amd: 'redux'
|
||||
// },
|
||||
// 'react-redux': {
|
||||
// root: 'ReactRedux',
|
||||
// var: 'ReactRedux',
|
||||
// commonjs: 'react-redux',
|
||||
// commonjs2: 'react-redux',
|
||||
// amd: 'react-redux'
|
||||
// },
|
||||
'react-router': {
|
||||
root: 'ReactRouter',
|
||||
var: 'ReactRouter',
|
||||
commonjs: 'react-router',
|
||||
commonjs2: 'react-router',
|
||||
amd: 'react-router'
|
||||
},
|
||||
'react-dom': {
|
||||
root: 'ReactDOM',
|
||||
var: 'ReactDOM',
|
||||
commonjs: 'react-dom',
|
||||
commonjs2: 'react-dom',
|
||||
amd: 'react-dom'
|
||||
}
|
||||
};
|
||||
|
||||
//默认加载扩展名、相对JS路径模块的配置
|
||||
const resolve = {
|
||||
extensions: ['.jsx', '.js', '.less', '.css', '.json'],
|
||||
alias: {
|
||||
src: path.resolve(__dirname, '../src/')
|
||||
}
|
||||
};
|
||||
|
||||
//Loader
|
||||
const rules = [
|
||||
{
|
||||
test: /\.js[x]?$/,
|
||||
exclude: /node_modules/,
|
||||
use: [
|
||||
{
|
||||
loader: 'babel-loader'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
// use: ExtractTextPlugin.extract({
|
||||
use: ['style-loader', 'css-loader', 'postcss-loader']
|
||||
// fallback: 'style-loader'
|
||||
// })
|
||||
},
|
||||
{
|
||||
test: /\.less$/,
|
||||
// use: ExtractTextPlugin.extract({
|
||||
use: ['style-loader', 'css-loader', 'postcss-loader', 'less-loader']
|
||||
// fallback: 'style-loader'
|
||||
// })
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpg|jpeg|gif|eot|ttf|woff|woff2|svg|svgz)(\?.+)?$/,
|
||||
exclude: /favicon\.png$/,
|
||||
use: [
|
||||
{
|
||||
loader: 'url-loader'
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
//webpack通用配置
|
||||
const commonConfig = {
|
||||
// 打包时排除
|
||||
externals,
|
||||
// loaders
|
||||
module: {
|
||||
rules
|
||||
},
|
||||
plugins: [
|
||||
// new ExtractTextPlugin({
|
||||
// filename: '[name].css',
|
||||
// allChunks: true
|
||||
// })
|
||||
],
|
||||
resolve
|
||||
};
|
||||
|
||||
module.exports = commonConfig;
|
|
@ -0,0 +1,114 @@
|
|||
/*
|
||||
* @Author: liyxt
|
||||
* @Date: 2019-09-26 09:50:38
|
||||
* @LastEditors: liyxt
|
||||
* @LastEditTime: 2019-10-30 17:28:12
|
||||
* @Description: file content
|
||||
*/
|
||||
/**
|
||||
* 开发环境配置
|
||||
*/
|
||||
const OpenBrowserPlugin = require('open-browser-webpack-plugin');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const webpack = require('webpack');
|
||||
const path = require('path');
|
||||
const common = require('./webpack.common');
|
||||
const merge = require('webpack-merge');
|
||||
const configJSON = require('../config.json');
|
||||
const buildEntry = require('./buildEntry');
|
||||
const port = configJSON.devPort || 3006;
|
||||
const host = 'localhost';
|
||||
const fs = require('fs');
|
||||
|
||||
module.exports = function(env, argv) {
|
||||
let { mode, buildPath, client = 'pc' } = env;
|
||||
if (client === 'mobile') {
|
||||
process.env.PROJECT_CLIENT = 'mobile';
|
||||
}
|
||||
buildPath = buildPath || configJSON.buildEntryPath || './src/*/*/*/*/index.js';
|
||||
let buildWithoutHTML = configJSON.buildWithoutHTML;
|
||||
buildWithoutHTML && typeof buildWithoutHTML === 'string' && (buildWithoutHTML = [buildWithoutHTML]);
|
||||
let devConfig = {
|
||||
mode,
|
||||
entry: {},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: path.resolve(__dirname, './dist'),
|
||||
publicPath: '/',
|
||||
library: '[name]',
|
||||
libraryTarget: 'umd',
|
||||
chunkFilename: '[name].js'
|
||||
},
|
||||
devtool: 'source-map',
|
||||
devServer: {
|
||||
contentBase: path.join(__dirname, '../src'),
|
||||
port, // 端口号
|
||||
host: '0.0.0.0', // 主机地址
|
||||
inline: false, // 控制台是否显示构建信息
|
||||
clientLogLevel: 'error', // 控制台显示什么log信息
|
||||
open: false, // 开始构建时是否打开浏览器,使用OpenBrowserPlugin在构建完成时打开浏览器
|
||||
hot: true, // 是否启用热替换
|
||||
lazy: false, // 是否请求时才编译包
|
||||
historyApiFallback: {
|
||||
// 404时的页面
|
||||
rewrites: { from: /./, to: '/404.html' }
|
||||
},
|
||||
overlay: {
|
||||
// 报错时浏览器是否显示错误信息
|
||||
warnings: true,
|
||||
errors: true
|
||||
},
|
||||
stats: 'errors-only', // 开启报错提示
|
||||
proxy: {
|
||||
// 请求代理
|
||||
'/nccloud': {
|
||||
target: configJSON.proxy
|
||||
},
|
||||
'/spr': {
|
||||
target: configJSON.proxy
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
NODE_ENV: JSON.stringify(mode),
|
||||
ISMA: configJSON.isMA,
|
||||
LOGIN_INFO: JSON.stringify(configJSON.directConnectInfo),
|
||||
MA_INFO: JSON.stringify(configJSON.maInfo)
|
||||
}),
|
||||
new webpack.NamedModulesPlugin(), // 当开启 HMR 的时候使用该插件会显示模块的相对路径
|
||||
new webpack.HotModuleReplacementPlugin(), // 模块热替换插件
|
||||
new OpenBrowserPlugin({ url: `http://${host}:${port}/nccloud` }) // 构建完成打开浏览器插件
|
||||
]
|
||||
};
|
||||
|
||||
// 二开相关
|
||||
let extendBuildEntryPath = configJSON.extendBuildEntryPath || [];
|
||||
let { entries: extendEntries, plugins: extendPlugins } = buildEntry({
|
||||
buildPath: extendBuildEntryPath,
|
||||
buildWithoutHTML,
|
||||
hash: false,
|
||||
mode,
|
||||
client,
|
||||
fse: true
|
||||
});
|
||||
// console.log(extendEntries);
|
||||
// let { entries = [], plugins = [], externals = [] } = {};
|
||||
|
||||
let { entries, plugins, externals } = buildEntry({
|
||||
buildPath,
|
||||
buildWithoutHTML,
|
||||
hash: true,
|
||||
mode,
|
||||
client
|
||||
});
|
||||
|
||||
// 合并 二开
|
||||
Object.assign(entries, extendEntries);
|
||||
|
||||
Object.assign(common.externals, externals);
|
||||
Object.assign(devConfig.entry, entries);
|
||||
devConfig.plugins.push(...plugins);
|
||||
devConfig = merge(common, devConfig);
|
||||
return devConfig;
|
||||
};
|
|
@ -0,0 +1,110 @@
|
|||
/*
|
||||
* @Author: liyxt
|
||||
* @Date: 2019-07-02 10:02:16
|
||||
* @LastEditors: liyxt
|
||||
* @LastEditTime: 2020-04-14 14:31:30
|
||||
* @Description: file content
|
||||
*/
|
||||
/**
|
||||
* 生产环境配置
|
||||
*/
|
||||
const webpack = require('webpack');
|
||||
const common = require('./webpack.common');
|
||||
const path = require('path');
|
||||
const merge = require('webpack-merge');
|
||||
const configJSON = require('../config.json');
|
||||
const buildEntry = require('./buildEntry');
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
const OutputSourcePlugin = require('./OutputSourcePlugin');
|
||||
// const Visualizer = require('webpack-visualizer-plugin');
|
||||
|
||||
let { patch } = configJSON;
|
||||
|
||||
let { project, branch, provider } = patch || {};
|
||||
|
||||
let isPatch = process.env.npm_config_isPatch;
|
||||
|
||||
module.exports = function(env, argv) {
|
||||
let { mode, hash, client, fse, buildPath, outputPath } = env;
|
||||
if (client === 'mobile') {
|
||||
process.env.PROJECT_CLIENT = 'mobile';
|
||||
}
|
||||
buildPath = buildPath || configJSON.buildEntryPath || './src/*/*/*/*/index.js';
|
||||
let buildWithoutHTML = configJSON.buildWithoutHTML;
|
||||
buildWithoutHTML && typeof buildWithoutHTML === 'string' && (buildWithoutHTML = [buildWithoutHTML]);
|
||||
let prodConfig = {
|
||||
mode: 'production',
|
||||
entry: {},
|
||||
output: {
|
||||
path: path.resolve(__dirname, `../${outputPath || 'dist'}`),
|
||||
publicPath: '../../../../',
|
||||
library: '[name]',
|
||||
libraryTarget: 'umd',
|
||||
chunkFilename: '[name].js'
|
||||
},
|
||||
devtool: false,
|
||||
plugins: [
|
||||
// new FileListPlugin(),
|
||||
// new ChunkListPlugin(),
|
||||
new webpack.BannerPlugin({
|
||||
banner:
|
||||
'@ncctag ' +
|
||||
JSON.stringify({
|
||||
project,
|
||||
branch,
|
||||
provider,
|
||||
date: new Date().toLocaleString()
|
||||
}), // 其值为字符串,将作为注释存在
|
||||
raw: false, // 如果值为 true,将直出,不会被作为注释
|
||||
entryOnly: false // 如果值为 true,将只在入口 chunks 文件中添加
|
||||
}),
|
||||
new webpack.DefinePlugin({
|
||||
NODE_ENV: JSON.stringify(mode),
|
||||
ISMA: configJSON.isMA,
|
||||
LOGIN_INFO: JSON.stringify(configJSON.directConnectInfo),
|
||||
MA_INFO: JSON.stringify(configJSON.maInfo)
|
||||
}),
|
||||
new OutputSourcePlugin({ output: '__SOURCE__CODE__' }),
|
||||
// new Visualizer()
|
||||
],
|
||||
optimization: {
|
||||
minimize: true, // 是否启用压缩
|
||||
splitChunks: {
|
||||
automaticNameDelimiter: '_'
|
||||
},
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
parallel: 4,
|
||||
sourceMap: true,
|
||||
extractComments: false,
|
||||
terserOptions: {
|
||||
// compress: {
|
||||
// drop_console: true
|
||||
// },
|
||||
output: {
|
||||
comments: /@ncctag/i
|
||||
}
|
||||
}
|
||||
})
|
||||
]
|
||||
}
|
||||
};
|
||||
if (hash === 'false') {
|
||||
hash = false;
|
||||
} else if (hash === 'true') {
|
||||
hash = true;
|
||||
}
|
||||
|
||||
// test模式,加source-map调试
|
||||
mode === 'test' && (prodConfig.devtool = 'source-map');
|
||||
// 节点加hash,参照不加hash
|
||||
prodConfig.output.filename = hash ? '[name].[hash:8].js' : '[name].js';
|
||||
// 获取入口
|
||||
let { entries, plugins, externals } = buildEntry({ buildPath, buildWithoutHTML, hash, client, mode, fse });
|
||||
Object.assign(common.externals, externals);
|
||||
Object.assign(prodConfig.entry, entries);
|
||||
prodConfig.plugins.push(...plugins);
|
||||
|
||||
prodConfig = merge(common, prodConfig);
|
||||
return prodConfig;
|
||||
};
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,99 @@
|
|||
{
|
||||
"name": "nc-multipage-demo",
|
||||
"version": "1.0.0",
|
||||
"description": "nc-multipage-demo",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"dev": "node --max_old_space_size=8192 node_modules/webpack-dev-server/bin/webpack-dev-server.js --progress --colors --config ./config/webpack.dev.config.js --env.mode=development",
|
||||
"dev-m": "node --max_old_space_size=8192 node_modules/webpack-dev-server/bin/webpack-dev-server.js --progress --colors --config ./config/webpack.dev.config.js --env.mode=development --env.client=mobile",
|
||||
"build": "node ./config/index.js production",
|
||||
"test": "node ./config/index.js test",
|
||||
"test-m": "node ./config/index.js test mobile",
|
||||
"component": "webpack --progress --colors --config ./config/webpack.component.config.js --env.mode=prod",
|
||||
"patch": "node ./config/patch.js"
|
||||
},
|
||||
"author": "liyxt@yonyou.com",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"ajv": "^6.0.0",
|
||||
"autoprefixer": "^7.1.2",
|
||||
"babel-core": "^6.24.1",
|
||||
"babel-loader": "^7.0.0",
|
||||
"babel-plugin-import": "^1.12.0",
|
||||
"babel-plugin-import-bee": "^1.0.2",
|
||||
"babel-plugin-jsx-control-statements": "^4.0.0",
|
||||
"babel-plugin-transform-decorators-legacy": "^1.3.5",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"babel-preset-react": "^6.24.1",
|
||||
"babel-preset-stage-2": "^6.24.1",
|
||||
"clean-webpack-plugin": "^3.0.0",
|
||||
"copy-webpack-plugin": "^4.5.1",
|
||||
"css-loader": "^0.28.3",
|
||||
"cssnano": "^4.0.0-rc.1",
|
||||
"extract-text-webpack-plugin": "^4.0.0-beta.0",
|
||||
"file-loader": "^1.1.11",
|
||||
"glob": "^7.1.2",
|
||||
"html-webpack-plugin": "3.2.0",
|
||||
"immutable": "^3.8.2",
|
||||
"less": "^2.7.2",
|
||||
"less-loader": "^4.0.5",
|
||||
"open-browser-webpack-plugin": "0.0.5",
|
||||
"postcss-loader": "^2.0.6",
|
||||
"react-router-dom": "4.2.2",
|
||||
"style-loader": "^0.18.1",
|
||||
"terser-webpack-plugin": "^2.0.1",
|
||||
"url-loader": "^0.5.8",
|
||||
"webpack": "^4.2.0",
|
||||
"webpack-cli": "3.1.1",
|
||||
"webpack-dev-server": "^3.1.1",
|
||||
"webpack-hot-middleware": "^2.18.0",
|
||||
"webpack-merge": "^4.1.2",
|
||||
"webpack-visualizer-plugin": "^0.1.11"
|
||||
},
|
||||
"dependencies": {
|
||||
"@antv/g6": "^2.1.0-beta.6",
|
||||
"@antv/g6-plugins": "^1.0.9",
|
||||
"@handsontable/react": "3.0.0",
|
||||
"antd": "^5.5.1",
|
||||
"antd-mobile": "^2.2.14",
|
||||
"bee-affix": "^1.0.4",
|
||||
"bee-complex-grid": "2.1.4",
|
||||
"bee-table": "^2.2.45",
|
||||
"braft-editor": "^2.3.7",
|
||||
"braft-utils": "^3.0.12",
|
||||
"classnames": "^2.2.6",
|
||||
"crypto-js": "^3.1.9-1",
|
||||
"d3-tip": "^0.9.1",
|
||||
"dom-helpers": "^3.3.1",
|
||||
"draftjs-utils": "^0.9.4",
|
||||
"echarts": "4.5.0",
|
||||
"echarts-for-react": "^2.0.15-beta.1",
|
||||
"esri-loader": "^3.3.0",
|
||||
"handsontable": "^6.2.2",
|
||||
"immutability-helper": "^2.9.0",
|
||||
"jquery": "^3.3.1",
|
||||
"lodash": "^4.17.21",
|
||||
"moment": "^2.22.2",
|
||||
"postcss-px-to-viewport": "^1.1.0",
|
||||
"prop-types": "^15.6.0",
|
||||
"pubsub-js": "^1.7.0",
|
||||
"qrcode.react": "^0.9.3",
|
||||
"rc-calendar": "^9.6.2",
|
||||
"re-resizable": "6.0.0",
|
||||
"react-codemirror": "^1.0.0",
|
||||
"react-color": "^2.18.0",
|
||||
"react-dnd": "^7.0.2",
|
||||
"react-dnd-html5-backend": "^7.0.2",
|
||||
"react-flip-move": "^3.0.2",
|
||||
"react-handsontable": "^0.3.1",
|
||||
"react-redux": "^7.2.6",
|
||||
"react-rnd": "^9.0.4",
|
||||
"react-router-cache-route": "^1.8.4",
|
||||
"redux": "^4.1.2",
|
||||
"redux-thunk": "^2.3.0",
|
||||
"redux-undo": "^1.0.0",
|
||||
"tinper-bee": "^2.0.7",
|
||||
"yazl": "^2.5.1"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
module.exports = ({ file, options, env }) => {
|
||||
const pluginsConfig = {
|
||||
autoprefixer: {}
|
||||
};
|
||||
if(process.env.PROJECT_CLIENT === 'mobile') {
|
||||
pluginsConfig["postcss-px-to-viewport"] = {
|
||||
viewportWidth: 350, // (Number) The width of the viewport.
|
||||
viewportHeight: 1334, // (Number) The height of the viewport.
|
||||
unitPrecision: 3, // (Number) The decimal numbers to allow the REM units to grow to.
|
||||
viewportUnit: 'vmin', // (String) Expected units.
|
||||
fontViewportUnit: 'vmin',
|
||||
exclude: [],
|
||||
selectorBlackList: ['.ignore', '.hairlines'], // (Array) The selectors to ignore and leave as px.
|
||||
minPixelValue: 1, // (Number) Set the minimum pixel value to replace.
|
||||
mediaQuery: false // (Boolean) Allow px to be converted in media queries.
|
||||
};
|
||||
}
|
||||
return {
|
||||
plugins: pluginsConfig
|
||||
};
|
||||
};
|
|
@ -0,0 +1,349 @@
|
|||
/* eslint-disable import/no-unresolved */
|
||||
/*
|
||||
* @Author: mikey.zhangchqf 价格审批单
|
||||
* @Date: 2018-06-26 15:34:46
|
||||
* @Last Modified by: CongKe
|
||||
* @Last Modified time: 2019-08-27 10:45:30
|
||||
*/
|
||||
|
||||
import React, { Component } from 'react';
|
||||
import { createPage, base } from 'nc-lightapp-front';
|
||||
|
||||
const { NCDiv: Div, NCAffix: Affix } = base;
|
||||
|
||||
class Base extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
// 合并生命周期
|
||||
let { constructor, ...lifecycles } = props.getLifecycle();
|
||||
Object.entries(lifecycles).forEach(([lifecycleName, callback]) => {
|
||||
let origin = this[lifecycleName];
|
||||
if (origin) {
|
||||
this[lifecycleName] = (...rest) => {
|
||||
callback.call(this, ...rest);
|
||||
origin.call(this, ...rest);
|
||||
};
|
||||
} else {
|
||||
this[lifecycleName] = callback.bind(this);
|
||||
}
|
||||
});
|
||||
this.getEvents = props.getEvents.bind(this);
|
||||
typeof constructor === 'function' && constructor.call(this, props);
|
||||
this.state = this.state || {};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this._initTemplate();
|
||||
}
|
||||
|
||||
// 根据pagecode请求模板数据
|
||||
_initTemplate = () => {
|
||||
let { pagecode, appcode } = this.props;
|
||||
this.props.createUIDom(
|
||||
{
|
||||
pagecode,
|
||||
appcode,
|
||||
// 扩展 mergeRequest
|
||||
reqData: []
|
||||
},
|
||||
data => {
|
||||
// this.initTemplate 来自 this.props.getLifecycle()
|
||||
// 自定义生命周期
|
||||
typeof this.initTemplate === 'function' && (data = this.initTemplate.call(this, data));
|
||||
data.template.layout = [
|
||||
// { id: 'header', type: 'button' },
|
||||
{ id: 'search', type: 'search' },
|
||||
{
|
||||
id: 'head',
|
||||
type: 'table',
|
||||
shoulderButton: { id: 'header', type: 'button' },
|
||||
operationButton: { id: 'header', type: 'button' }
|
||||
}
|
||||
];
|
||||
this.props.meta.setMeta(data.template);
|
||||
this.props.button.setButtons(data.button);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
// 渲染标题区
|
||||
renderTitle = ({ hasButton = false }) => {
|
||||
console.log('渲染标题区');
|
||||
return null;
|
||||
};
|
||||
|
||||
// 渲染按钮区
|
||||
renderButton = ({ id }) => {
|
||||
console.log('渲染按钮区');
|
||||
return null;
|
||||
};
|
||||
|
||||
// 渲染查询区
|
||||
renderSearch = ({ id }) => {
|
||||
console.log('渲染查询区');
|
||||
return null;
|
||||
};
|
||||
|
||||
// 渲染表格区
|
||||
renderTable = ({ id }) => {
|
||||
console.log('渲染表格区');
|
||||
return null;
|
||||
};
|
||||
|
||||
// 渲染 SimpleTable
|
||||
renderSimpleTable = ({ id }) => {
|
||||
console.log('渲染 SimpleTable');
|
||||
return null;
|
||||
};
|
||||
|
||||
// 渲染 EditTable
|
||||
renderEditTable = ({ id }) => {
|
||||
console.log('渲染 EditTable');
|
||||
return null;
|
||||
};
|
||||
|
||||
// 渲染 CardTable
|
||||
renderCardTable = ({ id }) => {
|
||||
console.log('渲染 CardTable');
|
||||
return null;
|
||||
};
|
||||
|
||||
render() {
|
||||
let { meta } = this.props,
|
||||
metaData = meta.getMeta(),
|
||||
{ layout } = metaData;
|
||||
let titleWithButton = false;
|
||||
try {
|
||||
titleWithButton = layout[0].type === 'button';
|
||||
} catch (e) {}
|
||||
// 第一个是按钮区时,和标题区绑定
|
||||
return [
|
||||
!titleWithButton && this.renderTitle(),
|
||||
Array.isArray(layout) &&
|
||||
layout.map(({ type, ...otherProps }) => {
|
||||
switch (type) {
|
||||
case 'button':
|
||||
if (titleWithButton) {
|
||||
// 带按钮的标题区
|
||||
return this.renderTitle({
|
||||
withButton: titleWithButton,
|
||||
buttonId: otherProps.id
|
||||
});
|
||||
} else {
|
||||
// 按钮区
|
||||
return this.renderButton(otherProps);
|
||||
}
|
||||
|
||||
case 'search':
|
||||
// 查询区
|
||||
return this.renderSearch(otherProps);
|
||||
case 'table':
|
||||
// 表格区
|
||||
return this.renderTable(otherProps);
|
||||
case 'simpleTable':
|
||||
// 表格区 - simpleTable
|
||||
return this.renderSimpleTable(otherProps);
|
||||
case 'editTable':
|
||||
// 表格区 - editTable
|
||||
return this.renderEditTable(otherProps);
|
||||
case 'cardTable':
|
||||
// 表格区 - cardTable
|
||||
return this.renderCardTable(otherProps);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
})
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
class List extends Base {
|
||||
// 渲染标题区
|
||||
renderTitle = ({ withButton = false, buttonId } = {}) => {
|
||||
console.log('渲染按钮区');
|
||||
let { BillHeadInfo, button } = this.props;
|
||||
let { createButtonApp } = button;
|
||||
let { createBillHeadInfo } = BillHeadInfo;
|
||||
let props = this.getEvents()[buttonId] || {};
|
||||
let titleInfo = this.getEvents().TITLE_AREA || {};
|
||||
return (
|
||||
<Div areaCode={Div.config.HEADER} className="nc-bill-header-area">
|
||||
<div className="header-title-search-area">{createBillHeadInfo(titleInfo)}</div>
|
||||
{/* 按钮区 */}
|
||||
{withButton && (
|
||||
<div className="header-button-area">
|
||||
{createButtonApp({
|
||||
area: buttonId,
|
||||
...props
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
</Div>
|
||||
);
|
||||
};
|
||||
|
||||
// 渲染按钮区
|
||||
renderButton = ({ id }) => {
|
||||
console.log('渲染按钮区');
|
||||
let { button } = this.props;
|
||||
let { createButtonApp } = button;
|
||||
let props = this.getEvents()[id] || {};
|
||||
return (
|
||||
<Div areaCode={Div.config.HEADER} className="nc-bill-header-area">
|
||||
{/* 按钮区 */}
|
||||
<div className="header-button-area">
|
||||
{createButtonApp({
|
||||
area: id,
|
||||
...props
|
||||
})}
|
||||
</div>
|
||||
</Div>
|
||||
);
|
||||
};
|
||||
|
||||
// 渲染查询区
|
||||
renderSearch = ({ id }) => {
|
||||
console.log('渲染查询区');
|
||||
let { search } = this.props,
|
||||
{ NCCreateSearch: createSearch } = search,
|
||||
props = this.getEvents.call(this)[id] || {};
|
||||
return <div className="nc-bill-search-area">{createSearch(id, props)}</div>;
|
||||
};
|
||||
|
||||
// 渲染列表表格
|
||||
renderTable = ({ id }) => {
|
||||
console.log('渲染列表表格');
|
||||
let { table } = this.props,
|
||||
{ createSimpleTable } = table,
|
||||
props = this.getEvents.call(this)[id] || {};
|
||||
return <div className="nc-bill-table-area">{createSimpleTable(id, props)}</div>;
|
||||
};
|
||||
}
|
||||
|
||||
class Card extends Base {
|
||||
// 渲染标题区
|
||||
renderTitle = ({ withButton = false, buttonId } = {}) => {
|
||||
console.log('渲染按钮区');
|
||||
let { BillHeadInfo, button, cardPagination } = this.props;
|
||||
let { createButtonApp } = button;
|
||||
let { createBillHeadInfo } = BillHeadInfo;
|
||||
let { createCardPagination } = cardPagination;
|
||||
let props = this.getEvents()[buttonId] || {};
|
||||
let titleInfo = this.getEvents().TITLE_AREA || {};
|
||||
let cardPaginationInfo = this.getEvents().CARD_PAGINATION || {};
|
||||
return (
|
||||
<Affix>
|
||||
<Div areaCode={Div.config.HEADER} className="nc-bill-header-area">
|
||||
<div className="header-title-search-area">{createBillHeadInfo(titleInfo)}</div>
|
||||
<div className="header-button-area">
|
||||
{withButton &&
|
||||
createButtonApp({
|
||||
area: buttonId,
|
||||
...props
|
||||
})}
|
||||
</div>
|
||||
<div className="header-cardPagination-area">{createCardPagination(cardPaginationInfo)}</div>
|
||||
</Div>
|
||||
</Affix>
|
||||
);
|
||||
};
|
||||
|
||||
// 渲染按钮区
|
||||
renderButton = ({ id }) => {
|
||||
console.log('渲染按钮区');
|
||||
let { button } = this.props;
|
||||
let { createButtonApp } = button;
|
||||
let props = this.getEvents()[id] || {};
|
||||
return (
|
||||
<Div areaCode={Div.config.HEADER} className="nc-bill-header-area">
|
||||
<div className="header-button-area">
|
||||
{createButtonApp({
|
||||
area: id,
|
||||
...props
|
||||
})}
|
||||
</div>
|
||||
</Div>
|
||||
);
|
||||
};
|
||||
|
||||
// 渲染查询区
|
||||
renderForm = ({ id }) => {
|
||||
console.log('渲染表单区');
|
||||
let { form } = this.props,
|
||||
{ createForm } = form,
|
||||
props = this.getEvents.call(this)[id] || {};
|
||||
return <div className="nc-bill-form-area">{createForm(id, props)}</div>;
|
||||
};
|
||||
|
||||
// 渲染卡片表格
|
||||
renderTable = ({ id, shoulderButton }) => {
|
||||
console.log('渲染卡片表格');
|
||||
let { cardTable, button } = this.props,
|
||||
{ createCardTable } = cardTable,
|
||||
{ createButtonApp } = button,
|
||||
props = this.getEvents.call(this)[id] || {};
|
||||
// 表格肩部按钮
|
||||
if (shoulderButton) {
|
||||
props = {
|
||||
tableHead: () => {
|
||||
return (
|
||||
<div className="shoulder-definition-area">
|
||||
<div className="definition-icons">
|
||||
{createButtonApp({
|
||||
area: shoulderButton.id,
|
||||
...(this.getEvents.call(this)[shoulderButton.id] || {})
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
...props
|
||||
};
|
||||
}
|
||||
return <div className="nc-bill-table-area">{createCardTable(id, props)}</div>;
|
||||
};
|
||||
}
|
||||
|
||||
List = createPage({})(List);
|
||||
Card = createPage({})(Card);
|
||||
|
||||
class Page extends Component {
|
||||
getEvents = () => ({});
|
||||
|
||||
getLifecycle = () => ({});
|
||||
|
||||
layout = () => {
|
||||
let props = {
|
||||
getEvents: this.getEvents,
|
||||
getLifecycle: this.getLifecycle,
|
||||
pagecode: this.pagecode,
|
||||
appcode: this.appcode,
|
||||
billinfo: this.billinfo
|
||||
};
|
||||
switch (this.pageType) {
|
||||
case Page.LIST:
|
||||
return (
|
||||
<div className="nc-bill-list">
|
||||
<List {...props} />
|
||||
</div>
|
||||
);
|
||||
case Page.CARD:
|
||||
return (
|
||||
<div className="nc-bill-card">
|
||||
<Card {...props} />
|
||||
</div>
|
||||
);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
return this.layout();
|
||||
}
|
||||
}
|
||||
|
||||
Page.LIST = 'list';
|
||||
Page.CARD = 'card';
|
||||
|
||||
export default Page;
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* @Author: liyxt
|
||||
* @Date: 2019-12-05 14:56:05
|
||||
* @LastEditors: liyxt
|
||||
* @LastEditTime: 2019-12-06 17:37:02
|
||||
* @Description: file content
|
||||
*/
|
||||
// import { register } from 'nc-lightapp-front';
|
||||
|
||||
// 方案一:export方式导出
|
||||
// 原理:依赖UMD格式,运行时根据命名空间获取变量
|
||||
// 优点:业务组写法简单、标准,既可支持一开(import)又可支持二开(script)
|
||||
// 缺点:
|
||||
export const lifecycle = {
|
||||
constructor,
|
||||
componentDidMount,
|
||||
componentWillUnmount
|
||||
};
|
||||
|
||||
// 将区域id作为导出的变量,以映射到具体区域
|
||||
// 这就要求区域id不能带特殊符号如:- @
|
||||
export const searchId = {
|
||||
onSearch,
|
||||
onAfterEvent
|
||||
};
|
||||
|
||||
// 方案二:
|
||||
|
||||
export default function() {
|
||||
return {
|
||||
lifecycle: {
|
||||
constructor,
|
||||
componentDidMount,
|
||||
componentWillUnmount
|
||||
},
|
||||
searchId: {
|
||||
onSearch,
|
||||
onAfterEvent
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export default function () {
|
||||
return <CustomerComponent type="text" value={this.state.text} onChange={this.handleChange} />
|
||||
}
|
||||
|
||||
class CustomerComponent extends Component {
|
||||
constructor() {
|
||||
|
||||
}
|
||||
render() {
|
||||
console.log(this);
|
||||
return <div></div>
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* @Author: liyxt
|
||||
* @Date: 2020-03-18 10:20:51
|
||||
* @LastEditors: liyxt
|
||||
* @LastEditTime: 2020-03-26 15:54:45
|
||||
* @Description: file content
|
||||
*/
|
||||
export function events() {
|
||||
// this即组件的this
|
||||
return {
|
||||
// 标题区
|
||||
TITLE_AREA: {
|
||||
title: this.state.title,
|
||||
initShowBackBtn: true
|
||||
},
|
||||
// 卡片分页区
|
||||
CARD_PAGINATION: {},
|
||||
// 按钮区
|
||||
header: {
|
||||
// ...others
|
||||
onButtonClick: (...rest) => {
|
||||
console.log(...rest, this);
|
||||
this.setState({
|
||||
title: '哈哈哈哈哈'
|
||||
});
|
||||
}
|
||||
},
|
||||
// 查询区
|
||||
search: {
|
||||
clickSearchBtn: (...rest) => {
|
||||
console.log(...rest, this);
|
||||
}
|
||||
},
|
||||
// 表格区
|
||||
head: {
|
||||
showIndex: true,
|
||||
showCheck: true
|
||||
},
|
||||
// 其他区域
|
||||
areaCode: {}
|
||||
};
|
||||
}
|
||||
|
||||
export function lifecycle() {
|
||||
// this即组件的this
|
||||
return {
|
||||
constructor() {
|
||||
this.state = {
|
||||
title: 'hhhhh'
|
||||
};
|
||||
},
|
||||
// react生命周期
|
||||
componentDidMount() {
|
||||
console.log('componentDidMount', this);
|
||||
},
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
console.log('componentDidUpdate');
|
||||
},
|
||||
// 业务生命周期
|
||||
initTemplate(data) {
|
||||
console.log('initTemplate', data);
|
||||
return data;
|
||||
}
|
||||
};
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* @Author: mikey.zhangchqf 价格审批单
|
||||
* @Date: 2018-06-26 15:34:46
|
||||
* @Last Modified by: CongKe
|
||||
* @Last Modified time: 2019-08-27 10:45:30
|
||||
*/
|
||||
import React from 'react';
|
||||
import { render } from 'react-dom';
|
||||
import { Page } from 'nc-lightapp-front';
|
||||
import { events, lifecycle } from './events';
|
||||
// import Page from './Page';
|
||||
|
||||
class PriceAuditList extends Page {
|
||||
// pagecode = '400400800_list'; // 页面唯一标识,请求模板数据
|
||||
|
||||
// appcode = '10140NAT'; // 页面唯一标识,请求模板数据
|
||||
|
||||
intl = ''; // 多语标识,请求多语资源
|
||||
|
||||
billinfo = {};
|
||||
|
||||
pageType = Page.LIST;
|
||||
|
||||
getEvents = events;
|
||||
|
||||
getLifecycle = lifecycle;
|
||||
}
|
||||
|
||||
render(<PriceAuditList />, document.getElementById('app'));
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* @Author: liyxt
|
||||
* @Date: 2020-01-04 14:21:39
|
||||
* @LastEditors : liyxt
|
||||
* @LastEditTime : 2020-01-06 10:37:21
|
||||
* @Description: file content
|
||||
*/
|
||||
|
||||
// 维度:区域、事件、时机
|
||||
export function area1() {
|
||||
return {
|
||||
beforeRunning: {},
|
||||
running: {},
|
||||
afterRunning: {}
|
||||
};
|
||||
}
|
||||
|
||||
export function area2() {
|
||||
return {
|
||||
onBeforeEvent,
|
||||
onAfterEvent,
|
||||
onRowClick
|
||||
};
|
||||
}
|
||||
|
||||
registerProps('area1', function() {
|
||||
return {
|
||||
onBeforeEvent,
|
||||
before_onBeforeEvent,
|
||||
onAfterEvent,
|
||||
onRowClick,
|
||||
status: 'browse'
|
||||
};
|
||||
});
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* @Author: liyxt
|
||||
* @Date: 2020-01-04 14:19:27
|
||||
* @LastEditors: liyxt
|
||||
* @LastEditTime: 2020-04-23 16:52:54
|
||||
* @Description: file content
|
||||
*/
|
||||
import React from 'react';
|
||||
|
||||
export default class Demo extends Page {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
render() {
|
||||
return this.layout();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* @Author: liyxt
|
||||
* @Date: 2020-01-04 14:19:58
|
||||
* @LastEditors : liyxt
|
||||
* @LastEditTime : 2020-01-06 14:17:40
|
||||
* @Description: file content
|
||||
*/
|
||||
export function componentDidMount() {}
|
||||
|
||||
export function componentWillUnmount() {}
|
||||
|
||||
registerLifecycle({});
|
|
@ -0,0 +1,41 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="referrer" content="no-referrer" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge"><meta http-equiv="Pragma" content="no-cache">
|
||||
<meta http-equiv="Cache-Control" content="no-cache">
|
||||
<meta http-equiv="Expires" content="0">
|
||||
<title> Application </title>
|
||||
<link rel="stylesheet" href="../../../../lappreportrt/nc-report/index.css" />
|
||||
<link rel="stylesheet" href="../../../../lappreportrt/nc-report/public/vendor.css" />
|
||||
<link rel="stylesheet" href="../../../../platform/nc-lightapp-front/nc-lightapp-front.css" />
|
||||
<link rel="stylesheet" href="../../../../graphicReport/nc-graphic-report/index.css" />
|
||||
<link rel="stylesheet" href="../../../../graphicReport/nc-graphic-report/public/vendor.css" />
|
||||
<script type="text/javascript" src="../../../../platform/yonyou-yyy.js"></script>
|
||||
<%= configcss %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="../../../../platform/axios.js"></script>
|
||||
<script src="../../../../platform/polyfill.js"></script>
|
||||
<script src="../../../../platform/react.js"></script>
|
||||
<script src="../../../../platform/react-dom.js"></script>
|
||||
<script src="../../../../platform/react-router.js"></script>
|
||||
<script src="../../../../platform/redux.js"></script>
|
||||
<script src="../../../../platform/react-redux.js"></script>
|
||||
<script src="../../../../platform/ca/ca0.js"></script>
|
||||
<script src="../../../../platform/ca/ca1.js"></script>
|
||||
<script src="../../../../platform/ca/ca2.js"></script>
|
||||
<script src="../../../../platform/ca/nccsign.js"></script>
|
||||
<script src="../../../../platform/ca/sha256.js"></script>
|
||||
<script src="../../../../platform/nc-lightapp-front/nc-lightapp-front.js"></script>
|
||||
<script src="../../../../lappreportrt/nc-report/public/vendor.js"></script>
|
||||
<script src="../../../../lappreportrt/nc-report/index.js"></script>
|
||||
<script src="../../../../graphicReport/nc-graphic-report/public/vendor.js"></script>
|
||||
<script src="../../../../graphicReport/nc-graphic-report/index.js"></script>
|
||||
<%= configjs %>
|
||||
</body>
|
|
@ -0,0 +1,50 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" id="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1, initial-scale=1.0,maximum-scale=1" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge"><meta http-equiv="Pragma" content="no-cache">
|
||||
<meta http-equiv="Cache-Control" content="no-cache">
|
||||
<meta http-equiv="Expires" content="0">
|
||||
<title> Application </title>
|
||||
<link rel="stylesheet" href="../../../../mobile_platform/loading.css" />
|
||||
<link rel="stylesheet" href="../../../../mobile_platform/nc-lightapp-mobile/nc-lightapp-mobile.css" />
|
||||
<script type="text/javascript" src="../../../../mobile_platform/yonyou-yyy.js"></script>
|
||||
<%= configcss %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="ncc-loading" class="Parent-loading">
|
||||
|
||||
<div class="loding-animation-container">
|
||||
<div class="loding-animation-holder">
|
||||
<div class="loading-animator"></div>
|
||||
<div class="loading-animator"></div>
|
||||
<div class="loading-animator"></div>
|
||||
<div class="loading-animator"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="app"></div>
|
||||
<script src="../../../../mobile_platform/polyfill.js"></script>
|
||||
<script src="../../../../mobile_platform/axios.js"></script>
|
||||
<script src="../../../../mobile_platform/react.js"></script>
|
||||
<script src="../../../../mobile_platform/react-dom.js"></script>
|
||||
<script src="../../../../mobile_platform/react-router-dom.js"></script>
|
||||
<script src="../../../../mobile_platform/redux.js"></script>
|
||||
<script src="../../../../mobile_platform/react-redux.js"></script>
|
||||
<!-- <script src="../../../../mobile_platform/echarts.js"></script> -->
|
||||
<script src="../../../../mobile_platform/ca/ca0.js"></script>
|
||||
<script src="../../../../mobile_platform/ca/ca1.js"></script>
|
||||
<script src="../../../../mobile_platform/ca/ca2.js"></script>
|
||||
<script src="../../../../mobile_platform/ca/nccsign.js"></script>
|
||||
<script src="../../../../mobile_platform/ca/sha256.js"></script>
|
||||
<script src="../../../../mobile_platform/mtl.js"></script>
|
||||
<script src="../../../../mobile_platform/ncc_mtl.js"></script>
|
||||
<script src="../../../../mobile_platform/nc-lightapp-mobile/nc-lightapp-mobile.js"></script>
|
||||
|
||||
<%= configjs %>
|
||||
</body>
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="referrer" content="no-referrer" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<meta http-equiv="Pragma" content="no-cache">
|
||||
<meta http-equiv="Cache-Control" content="no-cache">
|
||||
<meta http-equiv="Expires" content="0">
|
||||
<title> Application </title>
|
||||
<link rel="stylesheet" href="../../../../platform/nc-lightapp-front/nc-lightapp-front.css" />
|
||||
<script type="text/javascript" src="../../../../platform/yonyou-yyy.js"></script>
|
||||
<%= configcss %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="../../../../platform/axios.js"></script>
|
||||
<script src="../../../../platform/polyfill.js"></script>
|
||||
<script src="../../../../platform/react.js"></script>
|
||||
<script src="../../../../platform/react-dom.js"></script>
|
||||
<script src="../../../../platform/react-router.js"></script>
|
||||
<script src="../../../../platform/redux.js"></script>
|
||||
<script src="../../../../platform/react-redux.js"></script>
|
||||
<script src="../../../../platform/ca/ca0.js"></script>
|
||||
<script src="../../../../platform/ca/ca1.js"></script>
|
||||
<script src="../../../../platform/ca/ca2.js"></script>
|
||||
<script src="../../../../platform/ca/nccsign.js"></script>
|
||||
<script src="../../../../platform/ca/sha256.js"></script>
|
||||
<script src="../../../../platform/nc-lightapp-front/nc-lightapp-front.js"></script>
|
||||
<%= configjs %>
|
||||
</body>
|
|
@ -0,0 +1,55 @@
|
|||
<!--
|
||||
* @Author: liyxt
|
||||
* @Date: 2019-09-12 10:17:45
|
||||
* @LastEditors: liyxt
|
||||
* @LastEditTime: 2019-09-26 09:50:26
|
||||
* @Description: file content
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" id="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1, initial-scale=1.0,maximum-scale=1" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge"><meta http-equiv="Pragma" content="no-cache">
|
||||
<meta http-equiv="Cache-Control" content="no-cache">
|
||||
<meta http-equiv="Expires" content="0">
|
||||
<title> Application </title>
|
||||
<link rel="stylesheet" href="../../../../mobile_platform/loading.css" />
|
||||
<link rel="stylesheet" href="../../../../mobile_platform/nc-lightapp-mobile/nc-lightapp-mobile.css" />
|
||||
<script type="text/javascript" src="../../../../mobile_platform/yonyou-yyy.js"></script>
|
||||
<%= configcss %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="ncc-loading" class="Parent-loading">
|
||||
|
||||
<div class="loding-animation-container">
|
||||
<div class="loding-animation-holder">
|
||||
<div class="loading-animator"></div>
|
||||
<div class="loading-animator"></div>
|
||||
<div class="loading-animator"></div>
|
||||
<div class="loading-animator"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="app"></div>
|
||||
<script src="../../../../mobile_platform/axios.js"></script>
|
||||
<script src="../../../../mobile_platform/polyfill.js"></script>
|
||||
<script src="../../../../mobile_platform/react.js"></script>
|
||||
<script src="../../../../mobile_platform/react-dom.js"></script>
|
||||
<script src="../../../../mobile_platform/react-router-dom.js"></script>
|
||||
<script src="../../../../mobile_platform/redux.js"></script>
|
||||
<script src="../../../../mobile_platform/react-redux.js"></script>
|
||||
<script src="../../../../mobile_platform/mtl.js"></script>
|
||||
<script src="../../../../mobile_platform/ca/ca0.js"></script>
|
||||
<script src="../../../../mobile_platform/ca/ca1.js"></script>
|
||||
<script src="../../../../mobile_platform/ca/ca2.js"></script>
|
||||
<script src="../../../../mobile_platform/ca/nccsign.js"></script>
|
||||
<script src="../../../../mobile_platform/ca/sha256.js"></script>
|
||||
<script src="../../../../mobile_platform/ncc_mtl.js"></script>
|
||||
<script src="../../../../mobile_platform/nc-lightapp-mobile/nc-lightapp-mobile.js"></script>
|
||||
<%= configjs %>
|
||||
</body>
|
|
@ -0,0 +1,38 @@
|
|||
<!--
|
||||
* @Author: liyxt
|
||||
* @Date: 2019-09-18 18:21:01
|
||||
* @LastEditors: liyxt
|
||||
* @LastEditTime: 2019-09-18 18:22:54
|
||||
* @Description: file content
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="referrer" content="no-referrer" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<meta http-equiv="Pragma" content="no-cache">
|
||||
<meta http-equiv="Cache-Control" content="no-cache">
|
||||
<meta http-equiv="Expires" content="0">
|
||||
<title> Application </title>
|
||||
<link rel="stylesheet" href="../../../../platform/nc-lightapp-front/platform-report.css" />
|
||||
<script type="text/javascript" src="../../../../platform/yonyou-yyy.js"></script>
|
||||
<%= configcss %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="../../../../platform/axios.js"></script>
|
||||
<script src="../../../../platform/polyfill.js"></script>
|
||||
<script src="../../../../platform/react.js"></script>
|
||||
<script src="../../../../platform/react-dom.js"></script>
|
||||
<script src="../../../../platform/ca/ca0.js"></script>
|
||||
<script src="../../../../platform/ca/ca1.js"></script>
|
||||
<script src="../../../../platform/ca/ca2.js"></script>
|
||||
<script src="../../../../platform/ca/nccsign.js"></script>
|
||||
<script src="../../../../platform/ca/sha256.js"></script>
|
||||
<script src="../../../../platform/nc-lightapp-front/platform-report.js"></script>
|
||||
<%= configjs %>
|
||||
</body>
|
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="referrer" content="no-referrer" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title> Application </title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="../../../../platform/axios.min.js"></script>
|
||||
<script src="../../../../platform/react.production.min.js"></script>
|
||||
<script src="../../../../platform/react-dom.production.min.js"></script>
|
||||
</body>
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="referrer" content="no-referrer" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<meta http-equiv="Pragma" content="no-cache">
|
||||
<meta http-equiv="Cache-Control" content="no-cache">
|
||||
<meta http-equiv="Expires" content="0">
|
||||
<title> Application </title>
|
||||
<link rel="stylesheet" href="../../../../platform/nc-lightapp-front/nc-lightapp-front.css" />
|
||||
<script type="text/javascript" src="../../../../platform/yonyou-yyy.js"></script>
|
||||
<%= configcss %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<!-- <script src="../../../../platform/echarts.js"></script> -->
|
||||
<script src="../../../../platform/axios.js"></script>
|
||||
<script src="../../../../platform/polyfill.js"></script>
|
||||
<script src="../../../../platform/react.js"></script>
|
||||
<script src="../../../../platform/react-dom.js"></script>
|
||||
<script src="../../../../platform/react-router.js"></script>
|
||||
<script src="../../../../platform/redux.js"></script>
|
||||
<script src="../../../../platform/react-redux.js"></script>
|
||||
<script src="../../../../platform/ca/ca0.js"></script>
|
||||
<script src="../../../../platform/ca/ca1.js"></script>
|
||||
<script src="../../../../platform/ca/ca2.js"></script>
|
||||
<script src="../../../../platform/ca/nccsign.js"></script>
|
||||
<script src="../../../../platform/ca/sha256.js"></script>
|
||||
<script src="../../../../platform/nc-lightapp-front/nc-lightapp-front.js"></script>
|
||||
<%= configjs %>
|
||||
</body>
|
|
@ -0,0 +1,57 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="referrer" content="no-referrer" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge"><meta http-equiv="Pragma" content="no-cache">
|
||||
<meta http-equiv="Cache-Control" content="no-cache">
|
||||
<meta http-equiv="Expires" content="0">
|
||||
<title> Application </title>
|
||||
<link rel="stylesheet" href="../../../../lappreportrt/nc-report/index.css" />
|
||||
<link rel="stylesheet" href="../../../../platform/nc-lightapp-front/nc-lightapp-front.css" />
|
||||
<script type="text/javascript" src="../../../../platform/yonyou-yyy.js"></script>
|
||||
<!-- <%= configcss %> -->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="text/javascript" src="../../../../platform/polyfill.min.js"></script>
|
||||
<script type="text/javascript" src="../../../../platform/ca/ca0.js"></script>
|
||||
<script type="text/javascript" src="../../../../platform/ca/ca1.js"></script>
|
||||
<script type="text/javascript" src="../../../../platform/ca/ca2.js"></script>
|
||||
<script type="text/javascript" src="../../../../platform/ca/nccsign.js"></script>
|
||||
<script type="text/javascript" src="../../../../platform/ca/sha256.js"></script>
|
||||
<script>
|
||||
(function () {
|
||||
loadScripts([
|
||||
{ src: '../../../../platform/axios.min.js', root: 'axios' },
|
||||
{ src: '../../../../platform/react.production.min.js', root: 'React' },
|
||||
{ src: '../../../../platform/react-dom.production.min.js', root: 'ReactDOM' },
|
||||
{ src: '../../../../platform/ReactRouter.min.js', root: 'ReactRouter' },
|
||||
{ src: '../../../../platform/nc-lightapp-front/nc-lightapp-front.js', root: 'nc-lightapp-front' }
|
||||
])
|
||||
function loadScripts(scripts) {
|
||||
// scripts = [{ src, root }]
|
||||
scripts.forEach(function (e) {
|
||||
var src = e.src, root = e.root
|
||||
if (window.top[root]) {
|
||||
window[root] = window.top[root];
|
||||
if (root === 'nc-lightapp-front') {
|
||||
if (window['platform-login']) {
|
||||
window[root].pageTo = window['platform-login'].pageTo;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// document.body.appendChild(script)是异步加载script
|
||||
// 直接创建sciprt标签是同步加载script
|
||||
// 分开script,防止html认为是闭合标签
|
||||
document.write('<scr' + 'ipt type="text/javascript" src="' + src + '"></scr' + 'ipt>');
|
||||
}
|
||||
})
|
||||
}
|
||||
})()
|
||||
</script>
|
||||
<!-- <%= configjs %> -->
|
||||
</body>
|
Loading…
Reference in New Issue