From af9eb2c8b64b03c4bb0b080a0ada03c3a83b5e3f Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Fri, 14 May 2021 13:14:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=87=E7=AB=A0=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 183 +++++++++++++++++---------------- src/api/editor.js | 68 ++++++++++++ src/api/upload.js | 25 +++++ src/i18n/langs/zh/router.js | 3 + src/router/index.js | 35 +++++++ src/utils/baseUrl.js | 4 +- src/views/editor/edit.vue | 116 +++++++++++++++++++++ src/views/editor/index.vue | 151 +++++++++++++++++++++++++++ src/views/editor/list.vue | 87 ++++++++++++++++ src/views/editor/listDraft.vue | 108 +++++++++++++++++++ 10 files changed, 687 insertions(+), 93 deletions(-) create mode 100644 src/api/editor.js create mode 100644 src/api/upload.js create mode 100644 src/views/editor/edit.vue create mode 100644 src/views/editor/index.vue create mode 100644 src/views/editor/list.vue create mode 100644 src/views/editor/listDraft.vue diff --git a/package.json b/package.json index 666b32dc3..e1bd92899 100644 --- a/package.json +++ b/package.json @@ -1,93 +1,94 @@ { - "name": "vue-admin-template", - "version": "4.1.0", - "description": "A vue admin template with Element UI & axios & iconfont & permission control & lint", - "author": "Pan ", - "license": "MIT", - "scripts": { - "start": "vue-cli-service serve --open", - "dev": "node --max_old_space_size=4096 node_modules/@vue/cli-service/bin/vue-cli-service.js serve", - "build": "vue-cli-service build --mode production", - "test": "vue-cli-service build --mode staging", - "local": "vue-cli-service build --mode", - "preview": "node build/index.js --preview", - "lint": "eslint --ext .js,.vue src", - "test:unit": "jest --clearCache && vue-cli-service test:unit", - "test:ci": "npm run lint && npm run test:unit", - "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml" - }, - "dependencies": { - "axios": "0.18.0", - "echarts": "^4.7.0", - "element-ui": "^2.12.0", - "file-saver": "^1.3.3", - "js-cookie": "2.2.0", - "js-md5": "^0.7.3", - "lodash": "^4.17.11", - "normalize.css": "7.0.0", - "nprogress": "^0.2.0", - "path-to-regexp": "2.4.0", - "qrcode.vue": "^1.6.2", - "qs": "^6.9.3", - "quill-emoji": "^0.1.8", - "quill-image-extend-module": "^1.1.2", - "recordrtc": "^5.5.9", - "script-loader": "^0.7.2", - "sessionstorage": "^0.1.0", - "stompjs": "^2.3.3", - "storejs": "^1.0.25", - "three": "^0.107.0", - "video.js": "^7.8.4", - "vue": "^2.6.10", - "vue-i18n": "^8.12.0", - "vue-quill-editor": "^3.0.6", - "vue-router": "^3.1.6", - "vuedraggable": "^2.24.3", - "vuex": "^3.1.0", - "xlsx": "^0.14.2", - "zrender": "^4.0.4" - }, - "devDependencies": { - "@babel/core": "7.0.0", - "@babel/register": "7.0.0", - "@vue/cli-plugin-babel": "3.6.0", - "@vue/cli-plugin-eslint": "3.6.0", - "@vue/cli-plugin-unit-jest": "3.6.3", - "@vue/cli-service": "3.6.0", - "@vue/test-utils": "1.0.0-beta.29", - "autoprefixer": "^9.5.1", - "babel-core": "7.0.0-bridge.0", - "babel-eslint": "10.0.1", - "babel-jest": "23.6.0", - "babel-plugin-syntax-dynamic-import": "^6.18.0", - "babel-preset-env": "1.6.1", - "babel-preset-stage-2": "6.24.1", - "chalk": "2.4.2", - "compression-webpack-plugin": "^3.1.0", - "connect": "3.6.6", - "copy-webpack-plugin": "^4.5.2", - "eslint": "5.15.3", - "eslint-plugin-vue": "5.2.2", - "file-loader": "^3.0.1", - "html-webpack-plugin": "3.2.0", - "mockjs": "1.0.1-beta3", - "node-sass": "^4.9.0", - "runjs": "^4.3.2", - "sass-loader": "^7.1.0", - "script-ext-html-webpack-plugin": "2.1.3", - "script-loader": "^0.7.2", - "serve-static": "^1.13.2", - "svg-sprite-loader": "4.1.3", - "svgo": "1.2.2", - "vue-template-compiler": "^2.6.11" - }, - "engines": { - "node": ">=8.9", - "npm": ">= 3.0.0" - }, - "browserslist": [ - "> 1%", - "last 2 versions", - "not ie <= 8" - ] + "name": "vue-admin-template", + "version": "4.1.0", + "description": "A vue admin template with Element UI & axios & iconfont & permission control & lint", + "author": "Pan ", + "license": "MIT", + "scripts": { + "start": "vue-cli-service serve --open", + "dev": "node --max_old_space_size=4096 node_modules/@vue/cli-service/bin/vue-cli-service.js serve", + "build": "vue-cli-service build --mode production", + "test": "vue-cli-service build --mode staging", + "local": "vue-cli-service build --mode", + "preview": "node build/index.js --preview", + "lint": "eslint --ext .js,.vue src", + "test:unit": "jest --clearCache && vue-cli-service test:unit", + "test:ci": "npm run lint && npm run test:unit", + "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml" + }, + "dependencies": { + "axios": "0.18.0", + "echarts": "^4.7.0", + "element-ui": "^2.12.0", + "file-saver": "^1.3.3", + "js-cookie": "2.2.0", + "js-md5": "^0.7.3", + "lodash": "^4.17.11", + "normalize.css": "7.0.0", + "nprogress": "^0.2.0", + "path-to-regexp": "2.4.0", + "qrcode.vue": "^1.6.2", + "qs": "^6.9.3", + "quill-emoji": "^0.1.8", + "quill-image-extend-module": "^1.1.2", + "recordrtc": "^5.5.9", + "script-loader": "^0.7.2", + "sessionstorage": "^0.1.0", + "stompjs": "^2.3.3", + "storejs": "^1.0.25", + "three": "^0.107.0", + "video.js": "^7.8.4", + "vue": "^2.6.10", + "vue-i18n": "^8.12.0", + "vue-quill-editor": "^3.0.6", + "vue-router": "^3.1.6", + "vuedraggable": "^2.24.3", + "vuex": "^3.1.0", + "wangeditor": "^4.6.17", + "xlsx": "^0.14.2", + "zrender": "^4.0.4" + }, + "devDependencies": { + "@babel/core": "7.0.0", + "@babel/register": "7.0.0", + "@vue/cli-plugin-babel": "3.6.0", + "@vue/cli-plugin-eslint": "3.6.0", + "@vue/cli-plugin-unit-jest": "3.6.3", + "@vue/cli-service": "3.6.0", + "@vue/test-utils": "1.0.0-beta.29", + "autoprefixer": "^9.5.1", + "babel-core": "7.0.0-bridge.0", + "babel-eslint": "10.0.1", + "babel-jest": "23.6.0", + "babel-plugin-syntax-dynamic-import": "^6.18.0", + "babel-preset-env": "1.6.1", + "babel-preset-stage-2": "6.24.1", + "chalk": "2.4.2", + "compression-webpack-plugin": "^3.1.0", + "connect": "3.6.6", + "copy-webpack-plugin": "^4.5.2", + "eslint": "5.15.3", + "eslint-plugin-vue": "5.2.2", + "file-loader": "^3.0.1", + "html-webpack-plugin": "3.2.0", + "mockjs": "1.0.1-beta3", + "node-sass": "^4.9.0", + "runjs": "^4.3.2", + "sass-loader": "^7.1.0", + "script-ext-html-webpack-plugin": "2.1.3", + "script-loader": "^0.7.2", + "serve-static": "^1.13.2", + "svg-sprite-loader": "4.1.3", + "svgo": "1.2.2", + "vue-template-compiler": "^2.6.11" + }, + "engines": { + "node": ">=8.9", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] } diff --git a/src/api/editor.js b/src/api/editor.js new file mode 100644 index 000000000..2fa1e80b6 --- /dev/null +++ b/src/api/editor.js @@ -0,0 +1,68 @@ +import request from '@/utils/request'; +// 获取文章列表 +export function getDoc() { + return request({ + url: `/api/doc`, + method: 'get' + }); +} +// 获取发布内容 +export function getDocById(id) { + return request({ + url: `/api/doc/${id}`, + method: 'get' + }); +} +// 获取草稿列表 +export function getDocDraft() { + return request({ + url: `/api/doc/draft`, + method: 'get' + }); +} +// 创建 +export function postDocDraft(data) { + return request({ + url: `/api/doc/draft`, + method: 'post', + data + }); +} +// 获取草稿数据id +export function getDocDraftById(id) { + return request({ + url: `/api/doc/draft/${id}`, + method: 'get' + }); +} +// 更新草稿数据 +export function putDocDraftById(id, data) { + return request({ + url: `/api/doc/draft/${id}`, + method: 'put', + data + }); +} +// 删除草稿数据 +export function deleteDocDraftById(id) { + return request({ + url: `/api/doc/draft/${id}`, + method: 'delete' + }); +} +// 保存内容根据id +export function putDocDraftByIdData(id, data) { + return request({ + url: `/api/doc/draft/${id}/data`, + method: 'put', + data + }); +} +// 草稿发布 +export function putDocDraftByIdPublish(id) { + return request({ + url: `/api/doc/draft/${id}/publish`, + method: 'put' + }); +} + diff --git a/src/api/upload.js b/src/api/upload.js new file mode 100644 index 000000000..806bb8d7e --- /dev/null +++ b/src/api/upload.js @@ -0,0 +1,25 @@ +import request from '@/utils/request'; + +export const productIdentify = '00001&appSecret=joylink00001'; + +export const pictureUrl = `/api/upload/PICTURE?appId=${productIdentify}`; +// export const modelUrl = `/api/upload/model?appId=${productIdentify}`; + +// export const attachmentUrl = `/api/upload/attachment?appId=${productIdentify}`; +// export const meansUrl = `/api/upload/means?appId=${productIdentify}`; +// export const regulationUrl = `/api/upload/regulation?appId=${productIdentify}`; + +export function getUrl(relatedUrl) { + return `${process.env.VUE_APP_UPLOAD_API}${relatedUrl}`; +} + +export function uploadFile(url, data) { + return request({ + headers: { + 'Content-Type': 'multipart/form-data' + }, + url, + method: 'post', + data: data + }); +} diff --git a/src/i18n/langs/zh/router.js b/src/i18n/langs/zh/router.js index eadca6adb..770d6c8c3 100644 --- a/src/i18n/langs/zh/router.js +++ b/src/i18n/langs/zh/router.js @@ -4,6 +4,9 @@ export default { designhomePage: '公共地图', designUserPage: '个人地图', newDesignUserPage: '地图绘制', + newDesignEditor: '编辑器', + newDesignEditorList: '图文列表', + newDesignDraftEditorList: '文章草稿', mapManage: '地图管理', skinManage: '皮肤管理', diff --git a/src/router/index.js b/src/router/index.js index 8a15ed8d2..dfda13a14 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -172,6 +172,10 @@ const VoiceTraining = () => import('@/views/system/voiceTraining/index'); const SceneTrainingResult = () => import('@/views/drts/scene/trainingResult'); const SceneVoiceTraining = () => import('@/views/drts/scene/voiceTraining'); +const Ueditor = () => import('@/views/editor/index'); +const UeditorList = () => import('@/views/editor/list'); +const UeditorDraftList = () => import('@/views/editor/listDraft'); + // import { GenerateRouteProjectList } from '@/scripts/ProjectConfig'; // import { getSessionStorage } from '@/utils/auth'; @@ -1132,6 +1136,37 @@ export const asyncRouter = [ // } ] }, + { + path: '/editor', + component: Layout, + meta: { + i18n: 'router.newDesignEditor', + roles: [admin, user] + }, + children: [ + { + path: 'list', + component: UeditorList, + meta: { + i18n: 'router.newDesignEditorList' + } + }, + { + path: 'listDraft', + component: UeditorDraftList, + meta: { + i18n: 'router.newDesignDraftEditorList' + } + }, + { + path: '', + component: Ueditor, + meta: { + i18n: 'router.newDesignEditor' + } + } + ] + }, { // 新个人地图 path: '/design', component: Layout, diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 11702c286..f4a99c662 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,8 +2,8 @@ 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 = 'http://192.168.8.107:9000'; // 袁琪 + // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'http://192.168.3.119: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'; // 张赛 diff --git a/src/views/editor/edit.vue b/src/views/editor/edit.vue new file mode 100644 index 000000000..b8a4935af --- /dev/null +++ b/src/views/editor/edit.vue @@ -0,0 +1,116 @@ + + + diff --git a/src/views/editor/index.vue b/src/views/editor/index.vue new file mode 100644 index 000000000..4977cfd24 --- /dev/null +++ b/src/views/editor/index.vue @@ -0,0 +1,151 @@ + + + + diff --git a/src/views/editor/list.vue b/src/views/editor/list.vue new file mode 100644 index 000000000..1fa57b1cb --- /dev/null +++ b/src/views/editor/list.vue @@ -0,0 +1,87 @@ + + + diff --git a/src/views/editor/listDraft.vue b/src/views/editor/listDraft.vue new file mode 100644 index 000000000..0735d70d8 --- /dev/null +++ b/src/views/editor/listDraft.vue @@ -0,0 +1,108 @@ + + +