代码调整

This commit is contained in:
joylink_cuiweidong 2022-12-06 11:19:40 +08:00
parent 2edf28636f
commit 9c1a7e129f

View File

@ -28,7 +28,7 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import {queryMapListByUser} from '@/api/jmap/map'; import {queryMapListByUser, getMapListByProjectCode} from '@/api/jmap/map';
import { saveBackProjectConfig, updateBackProjectConfig, checkBackProjectExist} from '@/api/projectConfig'; import { saveBackProjectConfig, updateBackProjectConfig, checkBackProjectExist} from '@/api/projectConfig';
import { queryMapFunctionList } from '@/api/trainingPlatform'; import { queryMapFunctionList } from '@/api/trainingPlatform';
export default { export default {
@ -87,16 +87,33 @@ export default {
methods:{ methods:{
doShow(row) { doShow(row) {
this.dialogVisible = true; this.dialogVisible = true;
this.functionList = [];
if (row) { if (row) {
this.formModel.id = row.id; this.formModel.id = row.id;
this.formModel.code = row.code; this.formModel.code = row.code;
this.formModel.name = row.name; this.formModel.name = row.name;
this.formModel.description = row.description; this.formModel.description = row.description;
if (row.code) {
getMapListByProjectCode(row.code).then(resp => {
this.mapList = resp.data;
}).catch(e => {
this.loading = false;
this.$message.error('获取地图列表失败!');
});
}
const mapId = row.mapId; const mapId = row.mapId;
this.formModel.mapId = mapId.toString(); this.formModel.mapId = mapId.toString();
if (this.formModel.mapId) { this.getRelatedFunctionList(mapId); } if (this.formModel.mapId) { this.getRelatedFunctionList(mapId); }
this.formModel.functionId = row.functionId; this.formModel.functionId = row.functionId;
} else { } else {
this.formModel = {
id: '',
code: '', //
name: '', //
description: '', //
mapId:'', //
functionId:'' //
};
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ruleForm.resetFields(); this.$refs.ruleForm.resetFields();
}); });