Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
efbdea79e8
@ -1,5 +1,5 @@
|
||||
# just a flag
|
||||
NODE_ENV = 'Local'
|
||||
NODE_ENV = 'production'
|
||||
VUE_APP_PRO = 'local'
|
||||
|
||||
# base api
|
||||
|
@ -1,5 +1,5 @@
|
||||
# just a flag
|
||||
NODE_ENV = 'test'
|
||||
NODE_ENV = 'production'
|
||||
|
||||
# base api
|
||||
VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud'
|
||||
|
@ -82,7 +82,7 @@ export default {
|
||||
},
|
||||
subscribeMessage(res) {
|
||||
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.$store.dispatch('socket/setRoomInvite');
|
||||
|
@ -143,20 +143,18 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
|
||||
|
||||
this.modelmanager = new ModelManager();
|
||||
getPublish3dMapDetail(skinCode).then(netdata => {
|
||||
console.log(JSON.parse(netdata.data.stands));
|
||||
setpsdstationmap(JSON.parse(netdata.data.stands));
|
||||
Standtextureload(scope,JSON.parse(netdata.data.assets));
|
||||
console.log(scope.stationtexture);
|
||||
scope.modelmanager.loadpromise(Staticmodel, scope.mixers).then(function (data) {
|
||||
moveanima.initlistnew(scope.modelmanager.switchmodel.mesh);
|
||||
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.needsUpdate = true;
|
||||
|
||||
scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map =scope.stationtexture["pingbimen"];
|
||||
scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map.needsUpdate = true;
|
||||
|
||||
console.log(scope.modelmanager);
|
||||
// scope.stationtexture
|
||||
|
||||
animate();
|
||||
})
|
||||
});
|
||||
|
@ -34,8 +34,8 @@ export function Standtextureload(jlmap3dedit,assettype){
|
||||
}
|
||||
if(assettype.stationtexture == "haerbin1"){
|
||||
if(jlmap3dedit.stationtexture){
|
||||
setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/xian3/devicelist.jpg');
|
||||
setstationtexture(jlmap3dedit.stationtexture,"pingbimen",'../../static/texture/xian3/pingbimen.jpg');
|
||||
setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/heb/devicelist.jpg');
|
||||
setstationtexture(jlmap3dedit.stationtexture,"pingbimen",'../../static/texture/heb/pingbimen.png');
|
||||
|
||||
setstationtexture(jlmap3dedit.stationtexture,"Station5361",'../../static/texture/heb/Station5361.jpg');
|
||||
setstationtexture(jlmap3dedit.stationtexture,"Station11094",'../../static/texture/heb/Station11094.jpg');
|
||||
@ -91,7 +91,6 @@ function settexture(materiallist,name,textureurl){
|
||||
}
|
||||
function setstationtexture(stationtexture,name,textureurl){
|
||||
var loader = new THREE.TextureLoader();
|
||||
|
||||
// 加载一个资源
|
||||
loader.load(
|
||||
// 资源URL
|
||||
|
@ -32,6 +32,9 @@ function handle(state, data) {
|
||||
case 'Competition_Practical': // 竞赛裁判系统裁判员开始考试推送消息
|
||||
state.competitionStart++; // 竞赛裁判系统裁判员开始考试推送消息
|
||||
break;
|
||||
case 'Simulation_Over': // 用户退出仿真推送消息
|
||||
state.simulationOver++; // 用户退出仿真推送消息
|
||||
break;
|
||||
case 'Simulation_Script_Finish': // 剧本执行完成推送消息
|
||||
state.scriptFinish++; // 剧本执行完成推送消息
|
||||
break;
|
||||
@ -208,6 +211,7 @@ const socket = {
|
||||
trainStationList: [], // 仿真-列车实际到发车站消息
|
||||
simulationError: '', // 仿真-异常消息
|
||||
simulationStart: '', // 仿真-开始消息
|
||||
simulationOver:0, // 退出仿真推送消息
|
||||
simulationReset: '', // 仿真-异常消息
|
||||
simulationText: {}, // 仿真-用户交互消息(聊天/命令)
|
||||
// coversitionList:{}, // 历史仿真-用户消息列表
|
||||
|
@ -155,6 +155,7 @@ export default {
|
||||
} catch (error) {
|
||||
if (error.code == 30001) {
|
||||
const url = localStore.get('orignalTrainingPlatformRoute' + this.$store.state.user.id);
|
||||
localStore.remove();
|
||||
if (url) {
|
||||
this.$router.push(url);
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
<!-- <el-button :disabled="!jsStart" type="success" @click="startCompetition">开始</el-button> -->
|
||||
<el-button type="danger" @click="endCompetition">结束</el-button>
|
||||
</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-group>
|
||||
</div>
|
||||
@ -130,6 +130,11 @@ export default {
|
||||
if (val) {
|
||||
this.startCompetition();
|
||||
}
|
||||
},
|
||||
'$store.state.socket.simulationOver':function(val) {
|
||||
if (val && this.project === 'refereeJsxt') {
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
|
@ -41,6 +41,9 @@ export default {
|
||||
if (val) {
|
||||
this.initData();
|
||||
}
|
||||
},
|
||||
'$store.state.map.runPlanStatus':function (val) {
|
||||
this.initData();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -19,7 +19,7 @@
|
||||
v-model="node.deviceCode"
|
||||
size="mini"
|
||||
:placeholder="$t('global.choose')"
|
||||
:disabled="isDisable"
|
||||
:disabled="isDisable || starting"
|
||||
:options="deviceList"
|
||||
@change="handleUpdUser(node, index)"
|
||||
/>
|
||||
@ -28,8 +28,7 @@
|
||||
v-model="node.deviceCode"
|
||||
:placeholder="$t('global.choose')"
|
||||
size="mini"
|
||||
:disabled="isDisable"
|
||||
s
|
||||
:disabled="isDisable || starting"
|
||||
@change="handleUpdUser(node, index)"
|
||||
>
|
||||
<el-option
|
||||
@ -95,6 +94,9 @@ export default {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
starting() {
|
||||
return this.room.state == '02';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -311,7 +311,11 @@ export default {
|
||||
}];
|
||||
if (this.drawWay === 'true') {
|
||||
params[0].userRole = 'AUDIENCE';
|
||||
try {
|
||||
await putUserRolesNew(params, this.group);
|
||||
} catch (error) {
|
||||
this.$message(error.message);
|
||||
}
|
||||
} else {
|
||||
await putUserRoles(params, this.group);
|
||||
}
|
||||
@ -340,7 +344,12 @@ export default {
|
||||
} else if (roleType === 'Repair') {
|
||||
params[0].userRole = 'MAINTAINER';
|
||||
}
|
||||
try {
|
||||
await putUserRolesNew(params, this.group);
|
||||
} catch (error) {
|
||||
this.$message(error.message);
|
||||
}
|
||||
|
||||
} else {
|
||||
await putUserRoles(params, this.group);
|
||||
}
|
||||
@ -366,7 +375,12 @@ export default {
|
||||
} else {
|
||||
list = userList.map(elem => { return { id: elem.id, nickName: elem.nickName, userRole: roleType.toUpperCase() }; });
|
||||
}
|
||||
try {
|
||||
await putUserRolesNew(list, this.group);
|
||||
} catch (error) {
|
||||
this.$message(error.message);
|
||||
}
|
||||
|
||||
} else {
|
||||
list = userList.map(elem => { return { id: elem.id, nickName: elem.nickName, userRole: roleType }; });
|
||||
await putUserRoles(list, this.group);
|
||||
|
137
vue.config.js
137
vue.config.js
@ -6,12 +6,8 @@ const defaultSettings = require('./src/settings.js');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const webpack = require('webpack');
|
||||
|
||||
// const CompressionPlugin = require('compression-webpack-plugin');
|
||||
// const productionGzipExtensions = ['js', 'css'];
|
||||
// const isProduction = process.env.NODE_ENV === 'production';
|
||||
|
||||
// let { version } = require('./package.json');
|
||||
// version = version.replace(/\./g, '_');
|
||||
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
// http://127.0.0.1:8888/ 分析打包模块可视化
|
||||
|
||||
const name = defaultSettings.title; // page title
|
||||
const port = 9527; // dev port
|
||||
@ -29,7 +25,6 @@ module.exports = {
|
||||
outputDir: 'dist',
|
||||
assetsDir: 'static', // 相对于outputDir的静态资源(js、css、img、fonts)目录
|
||||
lintOnSave: false,
|
||||
// filenameHashing: true,
|
||||
productionSourceMap: false, // 项目打包后是否压缩
|
||||
devServer: {
|
||||
port: port,
|
||||
@ -61,44 +56,35 @@ module.exports = {
|
||||
// },
|
||||
// parallel: require('os').cpus().length > 1, // 是否为 Babel 或 TypeScript 使用 thread-loader。该选项在系统的 CPU 有多于一个内核时自动启用,仅作用于生产构建。
|
||||
configureWebpack: config => {
|
||||
// if (process.env.NODE_ENV === 'production') {
|
||||
// // 为生产环境修改配置...
|
||||
// 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';
|
||||
const appTarget = process.env.VUE_APP_PRO == 'local' ? 'HYD' : 'Common'; // 其他环境变量 区分配置
|
||||
config.plugins.push(new webpack.NormalModuleReplacementPlugin(/(.*)_APP_TARGET(\.*)/,
|
||||
function (resourse) {
|
||||
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([
|
||||
{
|
||||
from: path.resolve(__dirname, './static'),
|
||||
@ -106,15 +92,8 @@ module.exports = {
|
||||
ignore: ['.*']
|
||||
}
|
||||
]));
|
||||
const externalsConfig = {
|
||||
// 'vue': 'Vue',
|
||||
// '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使用
|
||||
// config.plugins.push(new BundleAnalyzerPlugin());
|
||||
config.externals = {}; // 配置CDN使用
|
||||
},
|
||||
// webpack配置
|
||||
chainWebpack(config) {
|
||||
@ -171,64 +150,38 @@ module.exports = {
|
||||
config
|
||||
.optimization.splitChunks({
|
||||
chunks: 'all', // async表示抽取异步模块,all表示对所有模块生效,initial表示对同步模块生效
|
||||
maxInitialRequests: Infinity,
|
||||
minSize: 300000, // 依赖包超过300000bit将被单独打包 当模块 大于30kb
|
||||
minChunks: 1, // 打包⽣生成的chunk⽂文件最少有⼏几个chunk引⽤用了了这个模块
|
||||
automaticNameDelimiter:'-', // 打包分割符号
|
||||
cacheGroups: {
|
||||
// libs: {
|
||||
// name: 'chunk-libs',
|
||||
// test: /[\\/]node_modules[\\/]/,
|
||||
// priority: -10,
|
||||
// chunks: 'initial' // only package third parties that are initially dependent
|
||||
// },
|
||||
vendors: {
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
name: 'vendor', // 要缓存的 分隔出来的 chunk 名称
|
||||
priority: -10 // 缓存组优先级 数字越⼤大,优先级越⾼高
|
||||
name(module) {
|
||||
const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
|
||||
return `split-chunk.${packageName.replace('@', '')}`;
|
||||
},
|
||||
elementUI: {
|
||||
name: 'elementUI',
|
||||
test: /element-ui/,
|
||||
// minChunks: 1,
|
||||
priority: -10,
|
||||
chunks: 'all'
|
||||
priority: 10, // 缓存组优先级 数字越⼤大,优先级越⾼高
|
||||
reuseExistingChunk: true // 如果当前代码块包含的模块已经有了,就不在产生一个新的代码块
|
||||
},
|
||||
xlsx: {
|
||||
name: 'xlsx',
|
||||
test: /xlsx/,
|
||||
// minChunks: 1,
|
||||
priority: -10,
|
||||
chunks: 'all'
|
||||
},
|
||||
zrender: {
|
||||
name: 'zrender',
|
||||
test: /zrender/,
|
||||
// minChunks: 1,
|
||||
priority: -10,
|
||||
chunks: 'all'
|
||||
},
|
||||
jmap: {
|
||||
name: 'jmap',
|
||||
jlmap: {
|
||||
name: 'split-jlmap',
|
||||
test: path.resolve(__dirname, './src/jmap'),
|
||||
priority: -10,
|
||||
priority: 8,
|
||||
minChunks: 1,
|
||||
reuseExistingChunk: true // 可设置是否重⽤用该chunk
|
||||
reuseExistingChunk: true
|
||||
},
|
||||
jmapNew: {
|
||||
name: 'jmapNew',
|
||||
name: 'split-jmapNew',
|
||||
test: path.resolve(__dirname, './src/jmapNew'),
|
||||
priority: -20,
|
||||
priority: 9,
|
||||
minChunks: 1,
|
||||
reuseExistingChunk: true
|
||||
},
|
||||
jlmap3d: {
|
||||
name: 'jlmap3d',
|
||||
name: 'split-jlmap3d',
|
||||
test: path.resolve(__dirname, './src/jlmap3d'),
|
||||
priority: -10,
|
||||
minChunks: 1,
|
||||
reuseExistingChunk: true
|
||||
},
|
||||
ibp: {
|
||||
name: 'ibp',
|
||||
test: path.resolve(__dirname, './src/ibp'),
|
||||
priority: -10,
|
||||
priority: 7,
|
||||
minChunks: 1,
|
||||
reuseExistingChunk: true
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user