增加模型草稿列表页

This commit is contained in:
yuan 2021-07-06 09:53:39 +08:00
parent d5a232c87a
commit 2bb04ad85f
10 changed files with 288 additions and 5 deletions

1
.gitignore vendored
View File

@ -16,3 +16,4 @@ src/utils/baseUrl.js*
*.njsproj
*.sln
debug.log
.prettierrc

View File

@ -17,7 +17,8 @@
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
},
"dependencies": {
"axios": "0.18.0",
"axios": "^0.21.1",
"bjjl-engine-2d": "^1.0.8",
"echarts": "^4.7.0",
"element-ui": "^2.12.0",
"file-saver": "^1.3.3",
@ -35,7 +36,7 @@
"sessionstorage": "^0.1.0",
"stompjs": "^2.3.3",
"storejs": "^1.0.25",
"three": "^0.107.0",
"three": "^0.130.0",
"video.js": "^7.8.4",
"vue": "^2.6.10",
"vue-i18n": "^8.12.0",
@ -70,7 +71,7 @@
"eslint-plugin-vue": "5.2.2",
"file-loader": "^3.0.1",
"html-webpack-plugin": "3.2.0",
"node-sass": "^4.9.0",
"node-sass": "^4.14.1",
"runjs": "^4.3.2",
"sass-loader": "^7.1.0",
"script-ext-html-webpack-plugin": "2.1.3",

View File

@ -0,0 +1,62 @@
import request from '@/utils/request';
/** 新建用户草稿2d模型*/
export function createModelDraft(data) {
return request({
url: `draft/model2d/`,
method: 'post',
data
})
}
/** 分页查询用户2d模型草稿*/
export function getModelDraftList(params) {
return request({
url: `draft/model2d/paging`,
method: 'get',
params
})
}
/** 更新2d模型基本信息 */
export function updateModelDraftInfo(data) {
return request({
url: `/draft/model2d/${data.id}/basic`,
method: 'put',
data
})
}
/** 更新2d模型数据 */
export function updateModelDraftData(data) {
return request({
url: `/draft/model2d/${data.id}/data`,
method: 'put',
data
})
}
/** 发布模型 */
export function publishModelDraft(id) {
return request({
url: `/draft/model2d/${id}/publish`,
method: 'post'
})
}
/** 删除草稿模型 */
export function deleteModelDraft(id) {
return request({
url: `/draft/model2d/${id}`,
method: 'delete'
})
}

View File

@ -82,6 +82,7 @@ export default {
configLine: 'Line management',
deviceManage: 'Device management',
iscsDraw: 'Iscs Draw',
userModelDesign: 'Model Draw',
iscsSystem: 'Iscs System',
studentManage: 'Student manage',
examDetail: 'Exam detail',

View File

@ -82,6 +82,7 @@ export default {
configLine: '线路管理',
deviceManage: '设备管理',
iscsDraw: 'Iscs绘制',
userModelDesign: '模型绘制',
iscsSystem: 'Iscs系统',
studentManage: '学生管理',
competitionManage: '竞赛管理',

View File

@ -5,6 +5,7 @@ import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import '@/styles/index.scss'; // global css
import 'quill/dist/quill.snow.css';
import Engine2D from 'bjjl-engine-2d';
import LangStorage from '@/utils/lang';
import App from './App';
@ -37,6 +38,7 @@ export const i18n = new VueI18n({
messages
});
Vue.use(ElementUI, {i18n: (key, value) => i18n.t(key, value)});
Vue.use(Engine2D);
new Vue({
el: '#app',

View File

@ -186,6 +186,8 @@ const UploadPdfList = () => import('@/views/uploadPdf/list');
const ThirdLogin = () => import('@/views/thirdLogin');
const UserModelDesign = () => import('@/views/userModelDesign')
// import { GenerateRouteProjectList } from '@/scripts/ProjectConfig';
// import { getSessionStorage } from '@/utils/auth';
@ -1281,6 +1283,14 @@ export const asyncRouter = [
hidden: true
}
]
},
{
path: 'usermodel',
component: UserModelDesign,
meta: {
i18n: 'router.userModelDesign',
roles: [admin]
},
}
]
},

View File

@ -2,9 +2,9 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.3.83:9000'; // 旭强 有线
BASE_API = 'http://192.168.3.83:9000'; // 旭强 有线
// BASE_API = 'http://192.168.8.114:9000'; // 旭强 无线
// BASE_API = 'http://192.168.3.120:9000'; // 张赛
// BASE_API = 'http://192.168.8.140:9000'; // 杜康

View File

@ -0,0 +1,74 @@
<template>
<el-dialog v-dialogDrag :visible.sync="visible" title="新建模型" center :destroy-on-close="true">
<el-form :model="formData" :rules="formRules" ref="form">
<el-form-item label="模型编号" prop="code">
<el-input v-model="formData.code"></el-input>
</el-form-item>
<el-form-item label="模型名称" prop="name">
<el-input v-model="formData.name"></el-input>
</el-form-item>
<el-form-item label="模型类型" prop="type">
<el-input v-model="formData.type"></el-input>
</el-form-item>
<el-form-item label="模型版本" prop="version">
<el-input v-model="formData.version"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button type="primary" @click="confirmHandler"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { createModelDraft, updateModelDraftInfo } from "@/api/management/model";
export default {
name: "createModelDraftDialog",
data() {
return {
visible: false,
mode: "",
formData: { code: "", name: "", type: "", version: "" },
formRules: {
code: [{ required: true, message: "请输入模型编号", trigger: "blur" }],
name: [{ required: true, message: "请输入模型名称", trigger: "blur" }],
type: [{ required: true, message: "请输入模型类型", trigger: "blur" }],
version: [{ required: true, message: "请输入模型类型", trigger: "blur" }]
}
};
},
computed: {
submit() {
return this.mode === "edit" ? updateModelDraftInfo : createModelDraft;
}
},
methods: {
show(mode, data) {
this.mode = mode;
if (mode === "edit") {
this.formData = data;
} else {
this.formData = { code: "", name: "", type: "", version: "" };
}
this.visible = true;
},
close() {
this.visible = false;
this.$emit("close");
},
confirmHandler() {
this.$refs.form.validate(valid => {
if (valid) {
this.submit(this.formData).then(resp => {
console.log(resp);
this.close();
});
}
});
}
}
};
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,131 @@
<template>
<div class="container">
<QueryListPage :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<create-model-draft-dialog ref="createDialog" @close="closeCreate" />
</div>
</template>
<script>
import { createModelDraft, getModelDraftList } from "@/api/management/model";
import createModelDraftDialog from "./components/create";
export default {
name: "userModelDesign",
components: { createModelDraftDialog },
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: "type"
},
{
title: "版本",
prop: "version"
},
{
title: "创建时间",
prop: "createTime"
},
{
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 }]
}
};
},
methods: {
queryModelDraftList(params) {
return getModelDraftList(params);
},
handleCreate() {
this.$refs.createDialog.show("create");
},
closeCreate(e) {
console.log(e);
this.reloadTable()
},
handleEdit(index, data) {
this.$refs.createDialog.show("edit", data);
},
handleDelete(a, b, c, d, e) {
console.log("delete");
},
handleDraw() {
console.log("draw");
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>
<style lang="scss" scoped>
.container {
padding: 20px;
}
</style>