代码调整

This commit is contained in:
fan 2022-10-25 18:02:23 +08:00
parent 205fce9512
commit c8d71db508
12 changed files with 348 additions and 65 deletions

View File

@ -0,0 +1,27 @@
import request from '@/utils/request';
/** 删除第三方配置 */
export function deleteThirdAccountConfig(id) {
return request({
url: `/api/thirdAccountConfig/${id}`,
method: 'delete'
});
}
/** 分页查询所有配置 */
export function queryThirdAccountConfig(params) {
return request({
url: `/api/thirdAccountConfig/paged`,
method: 'get',
params
});
}
/** 新增或更新第三方配置 */
export function updateThirdAccountConfig(data) {
return request({
url: `/api/thirdAccountConfig`,
method: 'post',
data
});
}

View File

@ -222,6 +222,7 @@ const PisScreen = () => import('@/views/pis/index');
const TransitionIndex = () => import('@/views/temporary/transitionIndex'); const TransitionIndex = () => import('@/views/temporary/transitionIndex');
const Temporary = () => import('@/views/temporary/index'); const Temporary = () => import('@/views/temporary/index');
const ThirdPartyAccounts = () => import('@/views/thirdPartyAccounts/index');
const FunctionManage = () => import('@/views/functionManage/index'); const FunctionManage = () => import('@/views/functionManage/index');
const PermissionManage = () => import('@/views/permissionManage/index'); const PermissionManage = () => import('@/views/permissionManage/index');
@ -1841,7 +1842,7 @@ export const asyncRouter = [
}, },
{ // 第三方账户配置 { // 第三方账户配置
path: 'ThirdPartyAccounts', path: 'ThirdPartyAccounts',
component: Temporary, component: ThirdPartyAccounts,
meta: { meta: {
i18n: 'newRouter.ThirdPartyAccounts' i18n: 'newRouter.ThirdPartyAccounts'
} }

View File

@ -23,13 +23,13 @@ export function handlerUrl() {
let OSS_URL; let OSS_URL;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// 开发分支 // 开发分支
BASE_API = 'http://192.168.3.233/rtss-server'; // BASE_API = 'http://192.168.3.233/rtss-server';
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://114.116.51.125/jlcloud'; // BASE_API = 'http://114.116.51.125/jlcloud';
// BASE_API = 'http://192.168.3.90:9000'; // 周寅 // BASE_API = 'http://192.168.3.90:9000'; // 周寅
// BASE_API = 'http://192.168.3.94:9000'; // 旭强 // BASE_API = 'http://192.168.3.94:9000'; // 旭强
// BASE_API = 'http://192.168.3.15:9000'; // 张赛 BASE_API = 'http://192.168.3.15:9000'; // 张赛
// BASE_API = 'http://192.168.3.5:9000'; // 夏增彬 // BASE_API = 'http://192.168.3.5:9000'; // 夏增彬
// BASE_API = 'http://192.168.3.37:9000'; // 卫志宏 // BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
// BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://b29z135112.zicp.vip';

View File

@ -1,6 +1,56 @@
<template> <template>
<el-dialog v-dialogDrag :title="this.$t('publish.copyMapAs')" :visible.sync="dialogVisible" width="30%" center> <el-dialog v-dialogDrag :title="this.$t('publish.copyMapAs')" :visible.sync="dialogVisible" width="30%" center>
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" /> <el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="100px">
<el-form-item label="地图名称:" prop="name">
<el-input v-model="formModel.name" />
</el-form-item>
<el-row>
<el-col :span="8">
<el-form-item label="地图数据:" prop="mapData">
<el-checkbox v-model="formModel.mapData" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="运行图数据:" prop="runPlan">
<el-checkbox v-model="formModel.runPlan" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="3d数据" prop="map3dData">
<el-checkbox v-model="formModel.map3dData" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="ibp数据" prop="ibp">
<el-checkbox v-model="formModel.ibp" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="iscs数据" prop="iscs">
<el-checkbox v-model="formModel.iscs" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="线路配置:" prop="realLineConfig">
<el-checkbox v-model="formModel.realLineConfig" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="子系统数据:" prop="mapSystem">
<el-checkbox v-model="formModel.mapSystem" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="实训数据:" prop="training">
<el-checkbox v-model="formModel.training" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button> <el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button> <el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
@ -17,23 +67,20 @@ export default {
dialogVisible: false, dialogVisible: false,
formModel: { formModel: {
name: '', name: '',
copyOtherData: false mapData: false,
runPlan: false,
map3dData: false,
ibp: false,
iscs: false,
realLineConfig: false,
mapSystem: false,
training: false
}, },
loading: false, loading: false,
mapId: '', mapId: '',
form:{
labelWidth: '100px',
items: [
{ prop: 'name', label: this.$t('publish.mapName'), type: 'text', required: true},
{ prop: 'copyOtherData', label: this.$t('publish.whetherToCopyData'), type: 'switch', required: true}
]
},
rules: { rules: {
name: [ name: [
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'blur' } { required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'blur' }
],
copyOtherData: [
{ required: true, message: this.$t('global.choose'), trigger: 'change' }
] ]
} }
}; };
@ -51,7 +98,20 @@ export default {
return; return;
} }
this.loading = true; this.loading = true;
copyMapAs(this.mapId, this.formModel).then(resp =>{ const data = {
name: this.formModel.name,
copyDataConfig: {
mapData: this.formModel.mapData,
runPlan: this.formModel.runPlan,
map3dData: this.formModel.map3dData,
ibp: this.formModel.ibp,
iscs: this.formModel.iscs,
realLineConfig: this.formModel.realLineConfig,
mapSystem: this.formModel.mapSystem,
training: this.formModel.training
}
};
copyMapAs(this.mapId, data).then(resp =>{
this.$message.success(this.$t('tip.copyMapSuccess')); this.$message.success(this.$t('tip.copyMapSuccess'));
this.loading = false; this.loading = false;
this.dialogVisible = false; this.dialogVisible = false;

View File

@ -27,9 +27,9 @@ export default {
{ label: '3d数据', value: 'MAP_3D_DATA' }, { label: '3d数据', value: 'MAP_3D_DATA' },
{ label: 'ibp数据', value: 'ibp' }, { label: 'ibp数据', value: 'ibp' },
{ label: 'iscs数据', value: 'iscs' }, { label: 'iscs数据', value: 'iscs' },
{ label: '指令定义', value: 'COMMAND_DEFINITION' }, { label: '线路配置', value: 'REAL_LINE_CONFIG'},
{ label: '剧本数据', value: 'script' }, { label: '子系统数据', value: 'mapSystem' },
{ label: '线路配置', value: 'REAL_LINE_CONFIG'} { label: '实训数据', value: 'training' }
] ]
}; };
}, },
@ -59,9 +59,9 @@ export default {
map3dData: this.checkList.includes('MAP_3D_DATA'), map3dData: this.checkList.includes('MAP_3D_DATA'),
ibp: this.checkList.includes('ibp'), ibp: this.checkList.includes('ibp'),
iscs: this.checkList.includes('iscs'), iscs: this.checkList.includes('iscs'),
script:this.checkList.includes('script'), realLineConfig: this.checkList.includes('REAL_LINE_CONFIG'),
commandDefinition: this.checkList.includes('COMMAND_DEFINITION'), mapSystem: this.checkList.includes('mapSystem'),
realLineConfig: this.checkList.includes('REAL_LINE_CONFIG') training: this.checkList.includes('training')
}; };
const res = await getPublishMapExportNew(this.row.id, data); const res = await getPublishMapExportNew(this.row.id, data);
const resultData = res.data; const resultData = res.data;

View File

@ -122,7 +122,7 @@ export default {
{ {
type: 'button', type: 'button',
title: this.$t('global.operate'), title: this.$t('global.operate'),
width: this.$i18n.locale == 'en' ? '650' : '650', width: '750',
buttons: [ buttons: [
{ {
name: '编辑信息', name: '编辑信息',

View File

@ -4,16 +4,6 @@
<el-form-item label="code" prop="code"> <el-form-item label="code" prop="code">
<el-input v-model="formModel.code" style="width: 200px;" /> <el-input v-model="formModel.code" style="width: 200px;" />
</el-form-item> </el-form-item>
<el-form-item label="地图" prop="mapId">
<el-select v-model="formModel.mapId" placeholder="请选择" @change="mapIdChange">
<el-option
v-for="item in mapList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="车站" prop="station"> <el-form-item label="车站" prop="station">
<el-select v-model="formModel.station" placeholder="请选择"> <el-select v-model="formModel.station" placeholder="请选择">
<el-option <el-option
@ -55,7 +45,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button> <el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button> <el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
@ -69,12 +58,6 @@ import { getStationList } from '@/api/runplan';
export default { export default {
name: 'DeviceAdd', name: 'DeviceAdd',
props: { props: {
mapList: {
type: Array,
default: function () {
return [];
}
},
positionList: { positionList: {
type: Array, type: Array,
default: function () { default: function () {
@ -136,33 +119,34 @@ export default {
}, },
title() { title() {
return this.formModel.id ? '修改ISCS设备' : '创建ISCS设备'; return this.formModel.id ? '修改ISCS设备' : '创建ISCS设备';
},
mapId() {
return this.$route.query.mapId;
} }
}, },
mounted() { mounted() {
getStationList(this.mapId).then(resp => {
this.stationList = resp.data;
}).catch(() => {
this.$message.error('获取车站列表失败!');
});
}, },
methods: { methods: {
show(data) { show(data) {
if (data) { if (data) {
this.formModel.id = data.id; this.formModel.id = data.id;
this.formModel.mapId = data.mapId;
this.formModel.system = data.system; this.formModel.system = data.system;
this.formModel.code = data.code; this.formModel.code = data.code;
this.formModel.station = data.station; this.formModel.station = data.station;
this.formModel.position = data.position; this.formModel.position = data.position;
this.formModel.type = data.type; this.formModel.type = data.type;
} }
this.formModel.mapId = this.mapId;
this.dialogVisible = true; this.dialogVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ruleForm.resetFields(); this.$refs.ruleForm.resetFields();
}); });
}, },
mapIdChange(value) {
getStationList(value).then(resp => {
this.stationList = resp.data;
}).catch(() => {
this.$message.error('获取车站列表失败!');
});
},
doSave() { doSave() {
this.$refs.ruleForm.validate(() => { this.$refs.ruleForm.validate(() => {
this.loading = true; this.loading = true;

View File

@ -1,16 +1,6 @@
<template> <template>
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false"> <el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false">
<el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="100px"> <el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="100px">
<el-form-item label="地图" prop="mapId">
<el-select v-model="formModel.mapId" placeholder="请选择">
<el-option
v-for="item in mapList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="系统" prop="system"> <el-form-item label="系统" prop="system">
<el-select v-model="formModel.system" placeholder="请选择"> <el-select v-model="formModel.system" placeholder="请选择">
<el-option <el-option
@ -108,6 +98,9 @@ export default {
}, },
title() { title() {
return this.formModel.id ? '修改ISCS资源' : '创建ISCS资源'; return this.formModel.id ? '修改ISCS资源' : '创建ISCS资源';
},
mapId() {
return this.$route.query.mapId;
} }
}, },
mounted() { mounted() {
@ -119,9 +112,9 @@ export default {
}, },
methods: { methods: {
show(data) { show(data) {
this.formModel.mapId = this.mapId;
if (data) { if (data) {
this.formModel.id = data.id; this.formModel.id = data.id;
this.formModel.mapId = data.mapId;
this.formModel.system = data.system; this.formModel.system = data.system;
this.formModel.type = data.type; this.formModel.type = data.type;
this.formModel.resourceIds = data.resourceIds; this.formModel.resourceIds = data.resourceIds;

View File

@ -13,14 +13,12 @@
</el-tabs> </el-tabs>
<add-resources <add-resources
ref="addResources" ref="addResources"
:map-list="mapList"
:system-list="iscsSystemList" :system-list="iscsSystemList"
:type-list="iscsResourcesTypeList" :type-list="iscsResourcesTypeList"
@reloadTable="resourceReloadTable" @reloadTable="resourceReloadTable"
/> />
<add-iscs-device <add-iscs-device
ref="addDevice" ref="addDevice"
:map-list="mapList"
:position-list="iscsPositionList" :position-list="iscsPositionList"
:type-list="iscsTypeList" :type-list="iscsTypeList"
:system-list="iscsSystemList" :system-list="iscsSystemList"
@ -157,7 +155,8 @@ export default {
], ],
actions: [ actions: [
{ text: this.$t('global.add'), handler: this.createIscsDevice}, { text: this.$t('global.add'), handler: this.createIscsDevice},
{ text: '批量创建', handler: this.batchCrateIscsDevice } { text: '批量创建', handler: this.batchCrateIscsDevice },
{ text: '返回', handler: this.goBack }
] ]
}, },
resourceQueryForm: { resourceQueryForm: {
@ -232,7 +231,8 @@ export default {
} }
], ],
actions: [ actions: [
{ text: this.$t('global.add'), handler: this.createAudioResources} { text: this.$t('global.add'), handler: this.createAudioResources},
{ text: '返回', handler: this.goBack }
] ]
}, },
voiceQueryForm: { voiceQueryForm: {
@ -292,7 +292,8 @@ export default {
], ],
actions: [ actions: [
{ text: this.$t('global.add'), handler: this.createAudioResources}, { text: this.$t('global.add'), handler: this.createAudioResources},
{ text: '生成', handler: this.generateAudioResources } { text: '生成', handler: this.generateAudioResources },
{ text: '返回', handler: this.goBack }
] ]
} }
}; };
@ -315,6 +316,9 @@ export default {
}); });
}, },
methods: { methods: {
goBack() {
this.$router.go(-1);
},
queryDeviceFunction(params) { queryDeviceFunction(params) {
params.mapId = this.mapId; params.mapId = this.mapId;
return pagedIscsDevice(params); return pagedIscsDevice(params);

View File

@ -173,7 +173,6 @@ export default {
this.dialogVisible = false; this.dialogVisible = false;
this.loading = false; this.loading = false;
} }
} }
}; };
</script> </script>

View File

@ -0,0 +1,104 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false">
<el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="250px">
<el-form-item label="第三方账户:" prop="account">
<el-input v-model="formModel.account" />
</el-form-item>
<el-form-item label="用户仿真使用记录同步第三方url" prop="userSimulationRecordSyncUrl">
<el-input v-model="formModel.userSimulationRecordSyncUrl" />
</el-form-item>
<el-form-item label="用户考试成绩记录同步第三方url" prop="userExamRecordSyncUrl">
<el-input v-model="formModel.userExamRecordSyncUrl" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { updateThirdAccountConfig } from '@/api/thirdAccountConfig';
export default {
name: 'Add',
data() {
return {
dialogVisible: false,
formModel: {
id: '',
account: '',
userSimulationRecordSyncUrl: '',
userExamRecordSyncUrl: ''
},
loading: false
};
},
computed: {
rules() {
const crules = {
account: [
{ required: true, message: '请填写第三方账户', trigger: 'blur' }
],
userSimulationRecordSyncUrl: [
{ required: true, message: '请填写用户仿真使用记录同步第三方url', trigger: 'blur' }
],
userExamRecordSyncUrl: [
{ required: true, message: '请填写用户考试成绩记录同步第三方url', trigger: 'blur' }
]
};
return crules;
},
title() {
return this.formModel.id ? '修改第三方配置' : '创建第三方配置';
}
},
mounted() {},
methods: {
show(data) {
if (data) {
this.formModel.id = data.id;
this.formModel.account = data.account;
this.formModel.userSimulationRecordSyncUrl = data.interfaceConfig.userSimulationRecordSyncUrl;
this.formModel.userExamRecordSyncUrl = data.interfaceConfig.userExamRecordSyncUrl;
}
this.dialogVisible = true;
},
doSave() {
this.$refs.ruleForm.validate(() => {
this.loading = true;
const data = {
id: this.formModel.id,
account: this.formModel.account,
interfaceConfig: {
userSimulationRecordSyncUrl: this.formModel.userSimulationRecordSyncUrl,
userExamRecordSyncUrl: this.formModel.userExamRecordSyncUrl
}
};
updateThirdAccountConfig(data).then(resp => {
this.$message.success(this.formModel.id ? '更新第三方配置成功!' : '创建第三方配置成功!');
this.handleClose();
this.$emit('reloadTable');
}).catch(error => {
this.$message.error(error.message);
this.loading = false;
});
});
},
handleClose() {
this.formModel = {
id: '',
account: '',
userSimulationRecordSyncUrl: '',
userExamRecordSyncUrl: ''
};
this.dialogVisible = false;
this.loading = false;
}
}
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,111 @@
<template>
<div class="temporary">
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<add-third-account ref="addThirdAccount" @reloadTable="reloadTable" />
</div>
</template>
<script>
import { deleteThirdAccountConfig, queryThirdAccountConfig } from '@/api/thirdAccountConfig';
import AddThirdAccount from './add';
export default {
name: 'Temporary',
components: {
AddThirdAccount
},
data() {
return {
queryForm: {
labelWidth: '120px',
reset: true,
leftSpan: 16
},
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryList: {
query: queryThirdAccountConfig,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '第三方账户',
prop: 'account',
width: '200'
},
{
title: '用户仿真使用记录同步第三方url',
prop: 'interfaceConfig',
type: 'tag',
columnValue: (row) => { return row.interfaceConfig.userSimulationRecordSyncUrl; },
tagType: (row) => { return 'success'; }
},
{
title: '类型',
prop: 'interfaceConfig',
type: 'tag',
columnValue: (row) => { return row.interfaceConfig.userExamRecordSyncUrl; },
tagType: (row) => { return 'success'; }
},
{
title: '创建时间',
prop: 'createTime',
width: '200'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '200',
buttons: [
{
name: '编辑',
handleClick: this.editConfig
},
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: this.$t('global.add'), handler: this.createThirdAccount}
]
}
};
},
methods: {
createThirdAccount() {
this.$refs.addThirdAccount.show();
},
editConfig(index, row) {
this.$refs.addThirdAccount.show(row);
},
handleDelete(index, row) {
this.$confirm('此操作将删除该第三方配置!', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
deleteThirdAccountConfig(row.id).then(response => {
this.$message.success('删除成功!');
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.deleteFailed'));
});
});
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>
<style lang="scss" scoped>
.temporary {
height: 100%;
width: 100%;
}
</style>