This commit is contained in:
fan 2021-07-12 16:42:54 +08:00
parent 8db9414cfa
commit 53a71d0bab
6 changed files with 246 additions and 5 deletions

View File

@ -18,7 +18,7 @@
}, },
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",
"bjjl-engine-2d": "^1.0.15", "bjjl-engine-2d": "^1.0.17",
"echarts": "^4.7.0", "echarts": "^4.7.0",
"element-ui": "^2.12.0", "element-ui": "^2.12.0",
"file-saver": "^1.3.3", "file-saver": "^1.3.3",
@ -36,7 +36,7 @@
"sessionstorage": "^0.1.0", "sessionstorage": "^0.1.0",
"stompjs": "^2.3.3", "stompjs": "^2.3.3",
"storejs": "^1.0.25", "storejs": "^1.0.25",
"three": "^0.130.0", "three": "^0.130.1",
"video.js": "^7.8.4", "video.js": "^7.8.4",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-i18n": "^8.12.0", "vue-i18n": "^8.12.0",

View File

@ -100,5 +100,6 @@ export default {
publishISCSManage:'publish ISCS Manage', publishISCSManage:'publish ISCS Manage',
voiceTraining: 'Voice Training', voiceTraining: 'Voice Training',
mapGroup: 'Map Group', mapGroup: 'Map Group',
drawingMange:'Drawing Mange' drawingMange:'Drawing Mange',
newDraw: 'New Draw'
}; };

View File

@ -104,5 +104,6 @@ export default {
publishISCSManage:'发布ISCS管理', publishISCSManage:'发布ISCS管理',
voiceTraining: '语音训练', voiceTraining: '语音训练',
mapGroup: '地图分组', mapGroup: '地图分组',
drawingMange:'图纸管理' drawingMange:'图纸管理',
newDraw: '新版绘制'
}; };

View File

@ -188,6 +188,8 @@ const ThirdLogin = () => import('@/views/thirdLogin');
const UserModelDesign = () => import('@/views/userModelDesign/draftList'); const UserModelDesign = () => import('@/views/userModelDesign/draftList');
const UserModelEdit = () => import('@/views/userModelDesign/edit'); const UserModelEdit = () => import('@/views/userModelDesign/edit');
const NewDrawList = () => import('@/views/newDraw/list');
const NewDrawEdit = () => import('@/views/newDraw/edit');
// import { GenerateRouteProjectList } from '@/scripts/ProjectConfig'; // import { GenerateRouteProjectList } from '@/scripts/ProjectConfig';
// import { getSessionStorage } from '@/utils/auth'; // import { getSessionStorage } from '@/utils/auth';
@ -1291,13 +1293,27 @@ export const asyncRouter = [
meta: { meta: {
i18n: 'router.userModelDesign', i18n: 'router.userModelDesign',
roles: [admin] roles: [admin]
}, }
}, },
{ {
path: 'usermodel/:id/edit', path: 'usermodel/:id/edit',
name: 'userModelEdit', name: 'userModelEdit',
component: UserModelEdit, component: UserModelEdit,
hidden: true hidden: true
},
{
path: 'newdraw',
component: NewDrawList,
meta: {
i18n: 'router.newDraw',
roles: [admin]
}
},
{
path: 'newdraw/:id/edit',
name: 'newDrawEdit',
component: NewDrawEdit,
hidden: true
} }
] ]
}, },

View File

@ -0,0 +1,57 @@
<template>
<div style="width: 100%;height: 100%;">
<jl-picture-builder ref="jlPictureBuilder" :model="model" :compose-map="composeMap" />
<div style="height: 300px;background: #fff;z-index: 999;position: absolute;top: 70px;padding: 5px;left: 5px;">
<template v-for="item in modelList">
<el-button :key="item.code" size="mini" @click="addModel(item)">{{ item.name }}</el-button>
</template>
</div>
</div>
</template>
<script>
import { getModelList } from '@/api/management/model';
import { deepAssign } from '@/utils/index';
export default {
name: 'Edit',
data() {
return {
composeMap: {},
model: [],
modelList: []
};
},
mounted() {
getModelList().then(res=>{
this.modelList = res.data;
// this.modelList.forEach(item => {
// this.composeMap[item.code] = item;
// });
});
},
methods: {
addModel(model) {
if (!this.composeMap[model.code]) {
this.composeMap[model.code] = JSON.parse(model.jsonData);
}
const addModel = {
code: this.getUID(model.code),
position: [100, 100],
type: model.code,
rotation: 0,
scale: [1, 1]
};
this.model.push(addModel);
this.$refs.jlPictureBuilder.update([{model: addModel, action:{order:'&Add', shapeType: 'Compose'}}]);
},
getUID (type, base = 0) {
return [(type || ''), base++, Math.random().toFixed(5)].join('_');
}
}
};
</script>
<style scoped>
</style>

166
src/views/newDraw/list.vue Normal file
View File

@ -0,0 +1,166 @@
<template>
<div class="container">
<QueryListPage :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<el-button @click="getList">queryPublishedModel</el-button>
</div>
</template>
<script>
import { getModelDraftList, publishModelDraft, deleteModelDraft, getModelList } from '@/api/management/model';
export default {
name: 'UserModelDesign',
data() {
return {
dialogs: {
createShow: false,
createMode: ''
},
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
code: {
type: 'text',
label: '地图编号'
},
name: {
type: 'text',
label: '地图名称'
}
}
},
queryList: {
query: this.queryModelDraftList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '地图编号',
prop: 'code'
},
{
title: '地图名称',
prop: 'name'
},
{
title: '创建时间',
prop: 'createTime'
},
{
title: '修改时间',
prop: 'updateTime'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '350',
buttons: [
// {
// name: this.$t('global.edit'),
// handleClick: this.handleEdit
// },
{
name: '绘图',
handleClick: this.handleDraw
}
// {
// name: '',
// handleClick: this.handlePublish,
// type: 'success'
// },
// {
// name: this.$t('global.delete'),
// handleClick: this.handleDelete,
// type: 'danger'
// }
]
}
]
// actions: [{ text: this.$t('global.add'), handler: this.handleCreate }]
},
pubdModel: ''
};
},
methods: {
getList() {
getModelList().then(res=>{
console.log(res.data);
});
},
queryModelDraftList(params) {
return getModelDraftList(params);
},
handleCreate() {
this.$refs.createDialog.show('create');
},
closeCreate(e) {
this.reloadTable();
},
handleEdit(index, data) {
this.$refs.createDialog.show('edit', data);
},
handleDelete(idx, data) {
this.$confirm('确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true
})
.then(
() => {
deleteModelDraft(data.id).then(() => {
this.reloadTable();
});
},
() => {}
)
.catch(e => {
this.$message(e);
});
},
handleDraw(idx, data) {
this.$router.push({ path: `newdraw/${data.id}/edit` });
},
handlePublish(idx, data) {
this.$confirm('确认发布?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true
})
.then(
() => {
publishModelDraft(data.id).then(() => {
this.reloadTable();
});
},
() => {}
)
.catch(e => {
this.$message(e);
});
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>
<style lang="scss" scoped>
.container {
padding: 20px;
}
</style>