This commit is contained in:
fan 2020-05-22 11:09:07 +08:00
commit efbdea79e8
12 changed files with 89 additions and 110 deletions

View File

@ -1,5 +1,5 @@
# just a flag # just a flag
NODE_ENV = 'Local' NODE_ENV = 'production'
VUE_APP_PRO = 'local' VUE_APP_PRO = 'local'
# base api # base api

View File

@ -1,5 +1,5 @@
# just a flag # just a flag
NODE_ENV = 'test' NODE_ENV = 'production'
# base api # base api
VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud' VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud'

View File

@ -82,7 +82,7 @@ export default {
}, },
subscribeMessage(res) { subscribeMessage(res) {
if (this.$refs.deomonTopic && !window.location.href.includes('trainroom')) { if (this.$refs.deomonTopic && !window.location.href.includes('trainroom')) {
if (getSessionStorage('project') != 'refereeJsxt') { if (getSessionStorage('project') != 'refereeJsxt' && getSessionStorage('project') != 'jsxt') {
this.$refs.deomonTopic.doShow(res); this.$refs.deomonTopic.doShow(res);
} }
this.$store.dispatch('socket/setRoomInvite'); this.$store.dispatch('socket/setRoomInvite');

View File

@ -143,20 +143,18 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
this.modelmanager = new ModelManager(); this.modelmanager = new ModelManager();
getPublish3dMapDetail(skinCode).then(netdata => { getPublish3dMapDetail(skinCode).then(netdata => {
console.log(JSON.parse(netdata.data.stands));
setpsdstationmap(JSON.parse(netdata.data.stands)); setpsdstationmap(JSON.parse(netdata.data.stands));
Standtextureload(scope,JSON.parse(netdata.data.assets)); Standtextureload(scope,JSON.parse(netdata.data.assets));
console.log(scope.stationtexture);
scope.modelmanager.loadpromise(Staticmodel, scope.mixers).then(function (data) { scope.modelmanager.loadpromise(Staticmodel, scope.mixers).then(function (data) {
moveanima.initlistnew(scope.modelmanager.switchmodel.mesh); moveanima.initlistnew(scope.modelmanager.switchmodel.mesh);
daochamodel = scope.modelmanager.switchmodel.mesh.getObjectByName("DAOCHA"); daochamodel = scope.modelmanager.switchmodel.mesh.getObjectByName("DAOCHA");
scope.modelmanager.standmodel.mesh.getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"]; scope.modelmanager.standmodel.mesh.getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"];
scope.modelmanager.standmodel.mesh.getObjectByName("zhantailiebiao").material.map.needsUpdate = true; scope.modelmanager.standmodel.mesh.getObjectByName("zhantailiebiao").material.map.needsUpdate = true;
scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map =scope.stationtexture["pingbimen"]; scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map =scope.stationtexture["pingbimen"];
scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map.needsUpdate = true; scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map.needsUpdate = true;
console.log(scope.modelmanager);
// scope.stationtexture
animate(); animate();
}) })
}); });

View File

@ -34,8 +34,8 @@ export function Standtextureload(jlmap3dedit,assettype){
} }
if(assettype.stationtexture == "haerbin1"){ if(assettype.stationtexture == "haerbin1"){
if(jlmap3dedit.stationtexture){ if(jlmap3dedit.stationtexture){
setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/xian3/devicelist.jpg'); setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/heb/devicelist.jpg');
setstationtexture(jlmap3dedit.stationtexture,"pingbimen",'../../static/texture/xian3/pingbimen.jpg'); setstationtexture(jlmap3dedit.stationtexture,"pingbimen",'../../static/texture/heb/pingbimen.png');
setstationtexture(jlmap3dedit.stationtexture,"Station5361",'../../static/texture/heb/Station5361.jpg'); setstationtexture(jlmap3dedit.stationtexture,"Station5361",'../../static/texture/heb/Station5361.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station11094",'../../static/texture/heb/Station11094.jpg'); setstationtexture(jlmap3dedit.stationtexture,"Station11094",'../../static/texture/heb/Station11094.jpg');
@ -91,7 +91,6 @@ function settexture(materiallist,name,textureurl){
} }
function setstationtexture(stationtexture,name,textureurl){ function setstationtexture(stationtexture,name,textureurl){
var loader = new THREE.TextureLoader(); var loader = new THREE.TextureLoader();
// 加载一个资源 // 加载一个资源
loader.load( loader.load(
// 资源URL // 资源URL

View File

@ -32,6 +32,9 @@ function handle(state, data) {
case 'Competition_Practical': // 竞赛裁判系统裁判员开始考试推送消息 case 'Competition_Practical': // 竞赛裁判系统裁判员开始考试推送消息
state.competitionStart++; // 竞赛裁判系统裁判员开始考试推送消息 state.competitionStart++; // 竞赛裁判系统裁判员开始考试推送消息
break; break;
case 'Simulation_Over': // 用户退出仿真推送消息
state.simulationOver++; // 用户退出仿真推送消息
break;
case 'Simulation_Script_Finish': // 剧本执行完成推送消息 case 'Simulation_Script_Finish': // 剧本执行完成推送消息
state.scriptFinish++; // 剧本执行完成推送消息 state.scriptFinish++; // 剧本执行完成推送消息
break; break;
@ -208,6 +211,7 @@ const socket = {
trainStationList: [], // 仿真-列车实际到发车站消息 trainStationList: [], // 仿真-列车实际到发车站消息
simulationError: '', // 仿真-异常消息 simulationError: '', // 仿真-异常消息
simulationStart: '', // 仿真-开始消息 simulationStart: '', // 仿真-开始消息
simulationOver:0, // 退出仿真推送消息
simulationReset: '', // 仿真-异常消息 simulationReset: '', // 仿真-异常消息
simulationText: {}, // 仿真-用户交互消息(聊天/命令) simulationText: {}, // 仿真-用户交互消息(聊天/命令)
// coversitionList:{}, // 历史仿真-用户消息列表 // coversitionList:{}, // 历史仿真-用户消息列表

View File

@ -155,6 +155,7 @@ export default {
} catch (error) { } catch (error) {
if (error.code == 30001) { if (error.code == 30001) {
const url = localStore.get('orignalTrainingPlatformRoute' + this.$store.state.user.id); const url = localStore.get('orignalTrainingPlatformRoute' + this.$store.state.user.id);
localStore.remove();
if (url) { if (url) {
this.$router.push(url); this.$router.push(url);
} }

View File

@ -13,7 +13,7 @@
<!-- <el-button :disabled="!jsStart" type="success" @click="startCompetition">开始</el-button> --> <!-- <el-button :disabled="!jsStart" type="success" @click="startCompetition">开始</el-button> -->
<el-button type="danger" @click="endCompetition">结束</el-button> <el-button type="danger" @click="endCompetition">结束</el-button>
</template> </template>
<el-button v-if="project==='refereeJsxt'" type="danger" @click="refeeEndCompetition">结束</el-button> <el-button v-if="project==='refereeJsxt'" type="success" @click="refeeEndCompetition">返回</el-button>
<el-button v-if="project!=='jsxt'&&project!=='refereeJsxt'" type="primary" :loading="backLoading" @click="back">{{ $t('global.back') }}</el-button> <el-button v-if="project!=='jsxt'&&project!=='refereeJsxt'" type="primary" :loading="backLoading" @click="back">{{ $t('global.back') }}</el-button>
</el-button-group> </el-button-group>
</div> </div>
@ -130,6 +130,11 @@ export default {
if (val) { if (val) {
this.startCompetition(); this.startCompetition();
} }
},
'$store.state.socket.simulationOver':function(val) {
if (val && this.project === 'refereeJsxt') {
this.$router.go(-1);
}
} }
}, },
async mounted() { async mounted() {

View File

@ -41,6 +41,9 @@ export default {
if (val) { if (val) {
this.initData(); this.initData();
} }
},
'$store.state.map.runPlanStatus':function (val) {
this.initData();
} }
}, },
mounted() { mounted() {

View File

@ -19,7 +19,7 @@
v-model="node.deviceCode" v-model="node.deviceCode"
size="mini" size="mini"
:placeholder="$t('global.choose')" :placeholder="$t('global.choose')"
:disabled="isDisable" :disabled="isDisable || starting"
:options="deviceList" :options="deviceList"
@change="handleUpdUser(node, index)" @change="handleUpdUser(node, index)"
/> />
@ -28,8 +28,7 @@
v-model="node.deviceCode" v-model="node.deviceCode"
:placeholder="$t('global.choose')" :placeholder="$t('global.choose')"
size="mini" size="mini"
:disabled="isDisable" :disabled="isDisable || starting"
s
@change="handleUpdUser(node, index)" @change="handleUpdUser(node, index)"
> >
<el-option <el-option
@ -95,6 +94,9 @@ export default {
} else { } else {
return false; return false;
} }
},
starting() {
return this.room.state == '02';
} }
}, },
methods: { methods: {

View File

@ -311,7 +311,11 @@ export default {
}]; }];
if (this.drawWay === 'true') { if (this.drawWay === 'true') {
params[0].userRole = 'AUDIENCE'; params[0].userRole = 'AUDIENCE';
try {
await putUserRolesNew(params, this.group); await putUserRolesNew(params, this.group);
} catch (error) {
this.$message(error.message);
}
} else { } else {
await putUserRoles(params, this.group); await putUserRoles(params, this.group);
} }
@ -340,7 +344,12 @@ export default {
} else if (roleType === 'Repair') { } else if (roleType === 'Repair') {
params[0].userRole = 'MAINTAINER'; params[0].userRole = 'MAINTAINER';
} }
try {
await putUserRolesNew(params, this.group); await putUserRolesNew(params, this.group);
} catch (error) {
this.$message(error.message);
}
} else { } else {
await putUserRoles(params, this.group); await putUserRoles(params, this.group);
} }
@ -366,7 +375,12 @@ export default {
} else { } else {
list = userList.map(elem => { return { id: elem.id, nickName: elem.nickName, userRole: roleType.toUpperCase() }; }); list = userList.map(elem => { return { id: elem.id, nickName: elem.nickName, userRole: roleType.toUpperCase() }; });
} }
try {
await putUserRolesNew(list, this.group); await putUserRolesNew(list, this.group);
} catch (error) {
this.$message(error.message);
}
} else { } else {
list = userList.map(elem => { return { id: elem.id, nickName: elem.nickName, userRole: roleType }; }); list = userList.map(elem => { return { id: elem.id, nickName: elem.nickName, userRole: roleType }; });
await putUserRoles(list, this.group); await putUserRoles(list, this.group);

View File

@ -6,12 +6,8 @@ const defaultSettings = require('./src/settings.js');
const CopyWebpackPlugin = require('copy-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin');
const webpack = require('webpack'); const webpack = require('webpack');
// const CompressionPlugin = require('compression-webpack-plugin'); // const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
// const productionGzipExtensions = ['js', 'css']; // http://127.0.0.1:8888/ 分析打包模块可视化
// const isProduction = process.env.NODE_ENV === 'production';
// let { version } = require('./package.json');
// version = version.replace(/\./g, '_');
const name = defaultSettings.title; // page title const name = defaultSettings.title; // page title
const port = 9527; // dev port const port = 9527; // dev port
@ -29,7 +25,6 @@ module.exports = {
outputDir: 'dist', outputDir: 'dist',
assetsDir: 'static', // 相对于outputDir的静态资源(js、css、img、fonts)目录 assetsDir: 'static', // 相对于outputDir的静态资源(js、css、img、fonts)目录
lintOnSave: false, lintOnSave: false,
// filenameHashing: true,
productionSourceMap: false, // 项目打包后是否压缩 productionSourceMap: false, // 项目打包后是否压缩
devServer: { devServer: {
port: port, port: port,
@ -61,44 +56,35 @@ module.exports = {
// }, // },
// parallel: require('os').cpus().length > 1, // 是否为 Babel 或 TypeScript 使用 thread-loader。该选项在系统的 CPU 有多于一个内核时自动启用,仅作用于生产构建。 // parallel: require('os').cpus().length > 1, // 是否为 Babel 或 TypeScript 使用 thread-loader。该选项在系统的 CPU 有多于一个内核时自动启用,仅作用于生产构建。
configureWebpack: config => { configureWebpack: config => {
// if (process.env.NODE_ENV === 'production') { const appTarget = process.env.VUE_APP_PRO == 'local' ? 'HYD' : 'Common'; // 其他环境变量 区分配置
// // 为生产环境修改配置...
// config.mode = 'production';
// Object.assign(config, {
// output:{
// ...config.output,
// filename: `static/js/[name].[chunkhash].${version}.js`,
// chunkFilename: `static/js/[name].[chunkhash].${version}.js`
// }
// });
// // config.plugins = [
// // ...config.plugins,
// // new CompressionPlugin({
// // test:/\.js$|\.html$|.\css/, // 匹配文件名
// // threshold: 10240, // 对超过10k的数据压缩
// // deleteOriginalAssets: false // 不删除源文件
// // })
// // ];
// } else {
// // 为开发环境修改配置...
// config.mode = 'development';
// }
config.name = name;
config.resolve = {
extensions: ['.js', '.vue', '.json'],
// modules: [path.resolve(__dirname, './node_modules')],
alias: { // 添加别名
'@': path.resolve('src')
}
};
const appTarget = process.env.NODE_ENV === 'Local' || process.env.VUE_APP_PRO === 'local' ? 'HYD' : 'Common';
config.plugins.push(new webpack.NormalModuleReplacementPlugin(/(.*)_APP_TARGET(\.*)/, config.plugins.push(new webpack.NormalModuleReplacementPlugin(/(.*)_APP_TARGET(\.*)/,
function (resourse) { function (resourse) {
resourse.request = resourse.request.replace(/APP_TARGET/, `${appTarget}`); resourse.request = resourse.request.replace(/APP_TARGET/, `${appTarget}`);
}) })
); );
if (process.env.NODE_ENV != 'development') {
config.mode = 'production';
Object.assign(config, {
output:{
...config.output,
filename: `static/js/[name].[hash:6].js`,
chunkFilename: `static/js/[name].[chunkhash:6].js`
}
});
} else {
// 为开发环境修改配置...
config.mode = 'development';
config.name = name;
}
config.resolve = {
extensions: ['.js', '.vue', '.json'],
alias: { // 添加别名
'@': path.resolve('src')
}
};
config.plugins.push(new CopyWebpackPlugin([ config.plugins.push(new CopyWebpackPlugin([
{ {
from: path.resolve(__dirname, './static'), from: path.resolve(__dirname, './static'),
@ -106,15 +92,8 @@ module.exports = {
ignore: ['.*'] ignore: ['.*']
} }
])); ]));
const externalsConfig = { // config.plugins.push(new BundleAnalyzerPlugin());
// 'vue': 'Vue', config.externals = {}; // 配置CDN使用
// 'vuex': 'Vuex',
// 'vue-router': 'VueRouter',
// 'nprogress': 'NProgress',
// 'echarts': 'echarts',
// 'element-ui': 'ELEMENT'
};
config.externals = process.env.NODE_ENV === 'Local' || process.env.VUE_APP_PRO === 'local' ? {} : externalsConfig; // 配置CDN使用
}, },
// webpack配置 // webpack配置
chainWebpack(config) { chainWebpack(config) {
@ -171,64 +150,38 @@ module.exports = {
config config
.optimization.splitChunks({ .optimization.splitChunks({
chunks: 'all', // async表示抽取异步模块all表示对所有模块生效initial表示对同步模块生效 chunks: 'all', // async表示抽取异步模块all表示对所有模块生效initial表示对同步模块生效
maxInitialRequests: Infinity,
minSize: 300000, // 依赖包超过300000bit将被单独打包 当模块 大于30kb
minChunks: 1, // 打包⽣生成的chunk⽂文件最少有⼏几个chunk引⽤用了了这个模块
automaticNameDelimiter:'-', // 打包分割符号
cacheGroups: { cacheGroups: {
// libs: {
// name: 'chunk-libs',
// test: /[\\/]node_modules[\\/]/,
// priority: -10,
// chunks: 'initial' // only package third parties that are initially dependent
// },
vendors: { vendors: {
test: /[\\/]node_modules[\\/]/, test: /[\\/]node_modules[\\/]/,
name: 'vendor', // 要缓存的 分隔出来的 chunk 名称 name(module) {
priority: -10 // 缓存组优先级 数字越⼤大,优先级越⾼高 const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
return `split-chunk.${packageName.replace('@', '')}`;
}, },
elementUI: { priority: 10, // 缓存组优先级 数字越⼤大,优先级越⾼高
name: 'elementUI', reuseExistingChunk: true // 如果当前代码块包含的模块已经有了,就不在产生一个新的代码块
test: /element-ui/,
// minChunks: 1,
priority: -10,
chunks: 'all'
}, },
xlsx: { jlmap: {
name: 'xlsx', name: 'split-jlmap',
test: /xlsx/,
// minChunks: 1,
priority: -10,
chunks: 'all'
},
zrender: {
name: 'zrender',
test: /zrender/,
// minChunks: 1,
priority: -10,
chunks: 'all'
},
jmap: {
name: 'jmap',
test: path.resolve(__dirname, './src/jmap'), test: path.resolve(__dirname, './src/jmap'),
priority: -10, priority: 8,
minChunks: 1, minChunks: 1,
reuseExistingChunk: true // 可设置是否重⽤用该chunk reuseExistingChunk: true
}, },
jmapNew: { jmapNew: {
name: 'jmapNew', name: 'split-jmapNew',
test: path.resolve(__dirname, './src/jmapNew'), test: path.resolve(__dirname, './src/jmapNew'),
priority: -20, priority: 9,
minChunks: 1, minChunks: 1,
reuseExistingChunk: true reuseExistingChunk: true
}, },
jlmap3d: { jlmap3d: {
name: 'jlmap3d', name: 'split-jlmap3d',
test: path.resolve(__dirname, './src/jlmap3d'), test: path.resolve(__dirname, './src/jlmap3d'),
priority: -10, priority: 7,
minChunks: 1,
reuseExistingChunk: true
},
ibp: {
name: 'ibp',
test: path.resolve(__dirname, './src/ibp'),
priority: -10,
minChunks: 1, minChunks: 1,
reuseExistingChunk: true reuseExistingChunk: true
} }