diff --git a/.env.development b/.env.development index e7c17fc..8ed27ab 100644 --- a/.env.development +++ b/.env.development @@ -1,3 +1,3 @@ NODE_ENV=development # VUE_APP_NODE_ENV=dev -VUE_APP_LOGIN_URL='http://192.168.0.35:8028' \ No newline at end of file +VUE_APP_LOGIN_URL='http://192.168.0.35:8001' \ No newline at end of file diff --git a/.env.production b/.env.production index 4feddf1..ebee789 100644 --- a/.env.production +++ b/.env.production @@ -7,6 +7,8 @@ NODE_ENV=production # 公司地址 # VUE_APP_LOGIN_URL='http://192.168.0.35:8028' +# 后缀 -- 公司内部环境打开 +# VUE_APP_BASE_HOUZHUI='/hz_qg_wj' # 部署到60上置空 VUE_APP_LOGIN_URL='' \ No newline at end of file diff --git a/src/components/hm-crf/followUp.vue b/src/components/hm-crf/followUp.vue index c4039b6..899b2a3 100644 --- a/src/components/hm-crf/followUp.vue +++ b/src/components/hm-crf/followUp.vue @@ -74,7 +74,7 @@ export default { this.crfDataVisible = false // console.log(this.dataForm) this.$nextTick(() => { - this.$http.get(`/quguang/visit/record/${this.dataForm.formId}`) + this.$http.get(`/hz_quguang/visit/record/${this.dataForm.formId}`) .then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) @@ -104,7 +104,7 @@ export default { const ifrDoc = ifr.contentWindow.document || ifr.contentDocument const body = ifrDoc.getElementsByTagName('body')[0] const crfContent = body.innerHTML - this.$http.post('/quguang/visit/record/saveWriteVisit', { + this.$http.post('/hz_quguang/visit/record/saveWriteVisit', { formContent: Base64.encode(crfContent), // inputDate: this.inputDate, id: this.dataForm.formId diff --git a/src/components/hm-crf/index.vue b/src/components/hm-crf/index.vue index 5c492ba..2c3ff78 100644 --- a/src/components/hm-crf/index.vue +++ b/src/components/hm-crf/index.vue @@ -1,6 +1,7 @@ @@ -21,6 +22,7 @@ import 'tinymce/plugins/code' import 'tinymce/plugins/print' import 'tinymce/plugins/anchor' import 'tinymce/plugins/quickbars' +import 'tinymce/plugins/link' /** * 自定义部分 @@ -36,8 +38,10 @@ import './tinymce/plugins/hm_button' import './tinymce/plugins/hm_indent2em/plugin' import { isInclude } from './tinymce/plugins/hm_utils' - +import urlAddress from '@/mixins/urlAddress' +import Cookies from 'js-cookie' export default { + mixins: [urlAddress], components: { Editor }, @@ -60,12 +64,12 @@ export default { }, plugins: { type: [String, Array], - default: 'hminput hmcheckbox hmradio hmbutton quickbars print hmpreview lists image media table code letterspacing indent2em anchor'// paste contextmenu colorpicker textcolor + default: 'hminput hmcheckbox hmradio hmbutton quickbars link print hmpreview lists image media table code letterspacing indent2em anchor'// paste contextmenu colorpicker textcolor }, toolbar: { type: [String, Array], default: - `undo redo | image | bold italic forecolor backcolor | letterspacing | fontsizeselect | fontselect| lineheight | + `undo redo | image | media | link | bold italic forecolor backcolor | letterspacing | fontsizeselect | fontselect| lineheight | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent indent2em| hmpreview code` }, @@ -111,19 +115,86 @@ export default { paste_data_images: true, // images_upload_url: "/demo/eUpload.php", images_upload_base_path: '', // "/demo/" + // 三个参数分别对应三个插件【link,image,media】,如果要屏蔽某个插件的上传,就去掉对应参数 + file_picker_types: 'file image media', // forced_root_block: '', // 删除首尾自动添加的P标签 - images_upload_handler: function(blobInfo, succFun, failFun) { - // 自定义插入图片函数 - // blobInfo: 本地图片blob对象 - // succFun(url|string): 成功回调(插入图片链接到文本中) - // failFun(string):失败回调 + images_upload_handler: function (blobInfo, succFun, failFun) { + // 自定义插入图片函数 + // blobInfo: 本地图片blob对象 + // succFun(url|string): 成功回调(插入图片链接到文本中) + // failFun(string):失败回调 var file = blobInfo.blob() var reader = new FileReader() - reader.onload = function(e) { + reader.onload = function (e) { succFun(e.target.result) } reader.readAsDataURL(file) }, + //be used to add custom file picker to those dialogs that have it. + file_picker_callback: (callback, value, meta)=> { + let that = this + //文件分类 + var filetype = '.pdf, .txt, .zip, .rar, .7z, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .mp3, .mp4'; + //后端接收上传文件的地址 + var upurl = 'http://192.168.0.35:8028/hz_quguang/sys/user/saveUserImg'; + //为不同插件指定文件类型及后端地址 + switch (meta.filetype) { + // case 'image': + // filetype = '.jpg, .jpeg, .png, .gif'; + // upurl = 'upimg.php'; + // break; + case 'media': + filetype = '.mp3, .mp4'; + upurl = this.url + '/hz_quguang/upload/uploadFile'; + break; + case 'file': + default: + } + //模拟出一个input用于添加本地文件 + var input = document.createElement('input'); + input.setAttribute('type', 'file'); + input.setAttribute('accept', filetype); + input.click(); + input.onchange = function () { + var file = this.files[0]; + var xhr, formData; + console.log(file.name); + xhr = new XMLHttpRequest(); + xhr.withCredentials = false; + xhr.open('POST', upurl); + console.log('token',Cookies.get('qg-token')); + xhr.setRequestHeader('Authorization', 'Bearer ' + Cookies.get('qg-token')); // 在请求头中加上token + console.log('getAllResponseHeaders',xhr.getAllResponseHeaders()); // 输出请求头,确认是否包含Authorization + xhr.onload = function () { + var json; + if (xhr.status != 200) { + console.log('HTTP Error: ' + xhr.status); + // failure('HTTP Error: ' + xhr.status); + return; + } + json = JSON.parse(xhr.responseText); + if (!json || typeof json.location != 'string') { + console.log('Invalid JSON: ' + xhr.responseText); + // failure('Invalid JSON: ' + xhr.responseText); + return; + } + callback(json.location); + }; + formData = new FormData(); + formData.append('file', file, file.name); + // that.$http({ + // method: 'post', + // url: 'http://192.168.0.35:8028/hz_quguang/upload/uploadFile', + // headers: { + // 'Content-Type': 'multipart/form-data' + // }, + // data: formData + // }).then((res) => { + + // }) + xhr.send(formData); + }; + }, content_css: '/static/css/hmcrf.css', setup: (editor) => { editor.on('click', e => { @@ -164,16 +235,16 @@ export default { }, mounted() { // Cookies.set('qg-token', '9def6f4db676363e9f01990d56e62929') - this.$http.get(`/quguang/sys/table/dict/getList`, { - params: { - isCrf: 1 - } - }).then(({ data: res }) => { - if (res.code === 0) { - const data = res.data - window.localStorage.setItem('dictField', JSON.stringify(data)) - } - }) + // this.$http.get(`/hz_quguang/sys/table/dict/getList`, { + // params: { + // isCrf: 1 + // } + // }).then(({ data: res }) => { + // if (res.code === 0) { + // const data = res.data + // window.localStorage.setItem('dictField', JSON.stringify(data)) + // } + // }) this.$nextTick(() => { }) diff --git a/src/components/hm-crf/load_crf.vue b/src/components/hm-crf/load_crf.vue index 805a6ac..0b2dd63 100644 --- a/src/components/hm-crf/load_crf.vue +++ b/src/components/hm-crf/load_crf.vue @@ -38,7 +38,7 @@ export default { }, // 获取信息 getInfo() { - this.$http.get('/quguang/crf/form', { params: { id: this.id }}) + this.$http.get('/hz_quguang/crf/form', { params: { id: this.id }}) .then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) diff --git a/src/components/hm-crf/preview.vue b/src/components/hm-crf/preview.vue index 2aa58be..ec57b5d 100644 --- a/src/components/hm-crf/preview.vue +++ b/src/components/hm-crf/preview.vue @@ -56,7 +56,7 @@ export default { }, // 获取信息 getInfo() { - const url = this.title === '病历模板' ? '/quguang/medical/record/template' : '/quguang/crf/template' + const url = this.title === '病历模板' ? '/hz_quguang/medical/record/template' : '/hz_quguang/crf/template' this.$http.get(`${url}/${this.dataForm.id}`).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) diff --git a/src/components/hm-crf/preview_dialog.vue b/src/components/hm-crf/preview_dialog.vue index 2f47482..d1cf8a0 100644 --- a/src/components/hm-crf/preview_dialog.vue +++ b/src/components/hm-crf/preview_dialog.vue @@ -43,7 +43,7 @@ export default { }, // 获取信息 getInfo() { - this.$http.get('/quguang/crf/template', { params: { crfId: this.dataForm.id }}).then(({ data: res }) => { + this.$http.get('/hz_quguang/crf/template', { params: { crfId: this.dataForm.id }}).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } diff --git a/src/components/user-logout/index.vue b/src/components/user-logout/index.vue index f69089c..e5d3f24 100644 --- a/src/components/user-logout/index.vue +++ b/src/components/user-logout/index.vue @@ -28,7 +28,7 @@ export default { methods: { async selectPopover(val) { if (val.text === '退出登录') { - const { data: res } = await this.$http.post('/quguang/logout') + const { data: res } = await this.$http.post('/hz_quguang/logout') if (res.code !== 0) { return this.$message.error(res.msg) } diff --git a/src/mixins/qgyCRFData.js b/src/mixins/qgyCRFData.js index e06b83d..5b7f545 100644 --- a/src/mixins/qgyCRFData.js +++ b/src/mixins/qgyCRFData.js @@ -6,7 +6,7 @@ export default { methods: { // 青光眼的数据获取不在crf/getFlowForm下的firstVisit中,需要单独调取此接口获取 getQgyCRFData() { - this.$http.get('/quguang/view/out/patient/getVisitOutPatientForHis', { + this.$http.get('/hz_quguang/view/out/patient/getVisitOutPatientForHis', { params: { patientIdNumber: this.patientIdNumber, patientId: this.patientId ? this.patientId : '', diff --git a/src/mixins/urlAddress.js b/src/mixins/urlAddress.js index 3a887dc..784a8b3 100644 --- a/src/mixins/urlAddress.js +++ b/src/mixins/urlAddress.js @@ -8,7 +8,8 @@ export default { getUrlAddress() { console.log(window.location) const jointUrl = window.location.protocol + '//' + window.location.hostname // 地址栏获取 - this.url = jointUrl.includes('https://qgdzbl.wzeye.cn') ? jointUrl : jointUrl + ':8022' + this.url = jointUrl.includes('qgdzbl.hzeye.cn') ? jointUrl : + (jointUrl.includes('127.0.0.1') ? jointUrl + `:${window.location.port}` : jointUrl + ':84') } } } diff --git a/src/page-subspecialty/router/index.js b/src/page-subspecialty/router/index.js index f68719f..bbf3820 100644 --- a/src/page-subspecialty/router/index.js +++ b/src/page-subspecialty/router/index.js @@ -5,13 +5,13 @@ Vue.use(Router) // 页面路由(独立页面) const pageRoutes = [ - // { path: '/', redirect: '/login' }, - // { - // path: '/login', - // component: () => import('@/page-subspecialty/views/login'), - // name: 'login', - // meta: { title: '登录' } - // }, + { path: '/', redirect: '/login' }, + { + path: '/login', + component: () => import('@/page-subspecialty/views/login'), + name: 'login', + meta: { title: '登录' } + }, { path: '/question', component: () => import('@/page-subspecialty/views/question'), @@ -35,27 +35,29 @@ const pageRoutes = [ name: 'complete', meta: { title: '调查完成' } }, - // { - // path: '/article', - // component: () => import('@/page-subspecialty/views/article'), - // name: 'article', - // meta: { title: '文章' } - // }, - // { - // path: '/articleList', - // component: () => import('@/page-subspecialty/views/articleList'), - // name: 'articleList', - // meta: { title: '文章列表' } - // }, { - // path: '/editor', - // component: () => import('@/page-subspecialty/views/editor'), - // name: 'editor', - // meta: { title: '编辑器' } - // } + // 部署时注销掉 + { + path: '/article', + component: () => import('@/page-subspecialty/views/article'), + name: 'article', + meta: { title: '文章' } + }, + { + path: '/articleList', + component: () => import('@/page-subspecialty/views/articleList'), + name: 'articleList', + meta: { title: '文章列表' } + }, { + path: '/editor', + component: () => import('@/page-subspecialty/views/editor'), + name: 'editor', + meta: { title: '编辑器' } + } ] const router = new Router({ mode: 'history', + // base: process.env.NODE_ENV === 'production' ? process.env.VUE_APP_BASE_HOUZHUI : '/', // 公司内部环境打开--浏览器基础路径 routes: pageRoutes }) diff --git a/src/page-subspecialty/views/article/index.vue b/src/page-subspecialty/views/article/index.vue index 6cce2fe..1d271b3 100644 --- a/src/page-subspecialty/views/article/index.vue +++ b/src/page-subspecialty/views/article/index.vue @@ -94,7 +94,7 @@ export default { async getArticle() { console.log('this.url', this.url) this.isLoading = true - const { data: res } = await this.$http.get(this.url + `/quguang/article/${this.paramsInfo.id ? this.paramsInfo.id : this.dataForm.id}`) + const { data: res } = await this.$http.get(this.url + `/hz_quguang/article/${this.paramsInfo.id ? this.paramsInfo.id : this.dataForm.id}`) if (res.code === 0) { this.dataForm = res.data this.dataForm.substance = Base64.decode(res.data.substance) @@ -114,7 +114,7 @@ export default { const percent = this.scrollPercent > 99 ? '100' : this.scrollPercent + '' console.log(percent) if (this.paramsInfo.backId) { - const { data: res } = await this.$http.post(this.url + '/quguang/propagation', { + const { data: res } = await this.$http.post(this.url + '/hz_quguang/propagation', { id: this.paramsInfo.backId, rate: percent }) diff --git a/src/page-subspecialty/views/articleList/index.vue b/src/page-subspecialty/views/articleList/index.vue index 4d686fe..2f5b5f4 100644 --- a/src/page-subspecialty/views/articleList/index.vue +++ b/src/page-subspecialty/views/articleList/index.vue @@ -44,7 +44,7 @@ export default { methods: { async getArticleList() { console.log('this.url', this.url) - const { data: res } = await this.$http.get(this.url + '/quguang/article/page') + const { data: res } = await this.$http.get(this.url + '/hz_quguang/article/page') if (res.code === 0) { this.articleList = res.data } else { @@ -81,7 +81,7 @@ export default { }) .then(async() => { // on confirm - const { data: res } = await this.$http.delete(this.url + `/quguang/article/${item.id}`) + const { data: res } = await this.$http.delete(this.url + `/hz_quguang/article/${item.id}`) if (res.code === 0) { Toast(res.msg) this.getArticleList() diff --git a/src/page-subspecialty/views/editor/index.vue b/src/page-subspecialty/views/editor/index.vue index 8e59085..47cd1bd 100644 --- a/src/page-subspecialty/views/editor/index.vue +++ b/src/page-subspecialty/views/editor/index.vue @@ -52,7 +52,7 @@ export default { methods: { // 获取文章信息 async getarticleInfo() { - const { data: res } = await this.$http.get(this.url + `/quguang/article/${this.dataForm.id}`) + const { data: res } = await this.$http.get(this.url + `/hz_quguang/article/${this.dataForm.id}`) if (res.code === 0) { this.dataForm.name = res.data.name this.dataForm.substance = Base64.decode(res.data.substance) @@ -67,7 +67,7 @@ export default { // 表单提交 saveEditorHandle() { console.log(this.dataForm.substance) - this.$http[!this.dataForm.id ? 'post' : 'put'](this.url + '/quguang/article', { ...this.dataForm, substance: Base64.encode(this.dataForm.substance) }).then(({ data: res }) => { + this.$http[!this.dataForm.id ? 'post' : 'put'](this.url + '/hz_quguang/article', { ...this.dataForm, substance: Base64.encode(this.dataForm.substance) }).then(({ data: res }) => { if (res.code === 0) { this.$router.push({ name: 'articleList' }) } else { diff --git a/src/page-subspecialty/views/jmjlQuestionEyehistory/index.vue b/src/page-subspecialty/views/jmjlQuestionEyehistory/index.vue index 6064c21..2b62d8a 100644 --- a/src/page-subspecialty/views/jmjlQuestionEyehistory/index.vue +++ b/src/page-subspecialty/views/jmjlQuestionEyehistory/index.vue @@ -763,7 +763,7 @@ export default { this.tipShow = false }, async getInfo() { - const { data: res } = await this.$http.get('/quguang/survey/getInfo', { + const { data: res } = await this.$http.get('/hz_quguang/survey/getInfo', { params: { backId: this.patientInfo.backId } @@ -837,7 +837,7 @@ export default { // 判断当天有没有提交过 async judgeTodayWrite() { this.buttonDisbled = true - const { data: res } = await this.$http.get(this.url + '/quguang/survey/judgeTodayWrite', { + const { data: res } = await this.$http.get(this.url + '/hz_quguang/survey/judgeTodayWrite', { params: { patientIdNumber: this.dataForm.idcard.trim(), formName: '眼科病史问卷调查' @@ -872,7 +872,7 @@ export default { }) } this.buttonText = '提交中请稍等' - const { data: res } = await this.$http.post(this.url + '/quguang/survey', { + const { data: res } = await this.$http.post(this.url + '/hz_quguang/survey', { backId: this.patientInfo.backId, centreCode: this.patientInfo.centreCode ? this.patientInfo.centreCode : 'WZYSG_QG', formContent: JSON.stringify(this.dataForm), diff --git a/src/page-subspecialty/views/login/index.vue b/src/page-subspecialty/views/login/index.vue index 545050d..47a7385 100644 --- a/src/page-subspecialty/views/login/index.vue +++ b/src/page-subspecialty/views/login/index.vue @@ -57,7 +57,7 @@ export default { methods: { // 表单提交 loginHandle() { - this.$http.post(this.url + '/quguang/login', this.dataForm).then(({ data: res }) => { + this.$http.post(this.url + '/hz_quguang/login', this.dataForm).then(({ data: res }) => { if (res.code !== 0) { console.log(res.msg) return Toast.fail(res.msg) diff --git a/src/page-subspecialty/views/question/index.vue b/src/page-subspecialty/views/question/index.vue index 275c9a9..d075443 100644 --- a/src/page-subspecialty/views/question/index.vue +++ b/src/page-subspecialty/views/question/index.vue @@ -290,7 +290,7 @@ export default { Toast('请签名后再提交') return } - const { data: res } = await this.$http.get(this.url + '/quguang/survey/judgeTodayWrite', { + const { data: res } = await this.$http.get(this.url + '/hz_quguang/survey/judgeTodayWrite', { params: { patientIdNumber: this.routerParams.patientIdNumber ? this.routerParams.patientIdNumber : this.dataForm.idcard.trim(), formName: '屈光手术心理评估表' @@ -323,7 +323,7 @@ export default { scoreOdd: this.scoreOdd, patientInfo: this.routerParams.patientIdNumber ? this.routerParams : this.dataForm } - const { data: res } = await this.$http.post(this.url + '/quguang/survey', { + const { data: res } = await this.$http.post(this.url + '/hz_quguang/survey', { backId: this.patientInfo.backId, centreCode: this.patientInfo.centreCode ? this.patientInfo.centreCode : 'WZYSG_QG', formContent: JSON.stringify(formContent), diff --git a/src/page-subspecialty/views/questionEyehistory/index.vue b/src/page-subspecialty/views/questionEyehistory/index.vue index 8addf1d..8c5a904 100644 --- a/src/page-subspecialty/views/questionEyehistory/index.vue +++ b/src/page-subspecialty/views/questionEyehistory/index.vue @@ -822,7 +822,7 @@ export default { this.tipShow = false }, async getInfo() { - const { data: res } = await this.$http.get('/quguang/survey/getInfo', { + const { data: res } = await this.$http.get('/hz_quguang/survey/getInfo', { params: { backId: this.patientInfo.backId } @@ -905,7 +905,7 @@ export default { // 判断当天有没有提交过 async judgeTodayWrite() { this.buttonDisbled = true - const { data: res } = await this.$http.get(this.url + '/quguang/survey/judgeTodayWrite', { + const { data: res } = await this.$http.get(this.url + '/hz_quguang/survey/judgeTodayWrite', { params: { patientIdNumber: this.dataForm.idcard.trim(), formName: '眼科病史问卷调查' @@ -940,7 +940,7 @@ export default { }) } this.buttonText = '提交中请稍等' - const { data: res } = await this.$http.post(this.url + '/quguang/survey', { + const { data: res } = await this.$http.post(this.url + '/hz_quguang/survey', { backId: this.patientInfo.backId, centreCode: this.patientInfo.centreCode ? this.patientInfo.centreCode : 'WZYSG_QG', formContent: JSON.stringify(this.dataForm), diff --git a/vue.config.js b/vue.config.js index 60f4d23..c01426a 100644 --- a/vue.config.js +++ b/vue.config.js @@ -14,6 +14,7 @@ function resolve(dir) { module.exports = { parallel: false, publicPath: '/', // 多页面情况 process.env.NODE_ENV === 'production' ? './' : '/', + // publicPath: process.env.NODE_ENV === 'production' ? process.env.VUE_APP_BASE_HOUZHUI : '/', //公司内部环境 assetsDir: 'static', chainWebpack: config => { const svgRule = config.module.rule('svg') @@ -30,7 +31,7 @@ module.exports = { devServer: { open: true, hot: true, - port: 8022, + port: 8001, host: '127.0.0.1', overlay: { errors: true, @@ -44,11 +45,11 @@ module.exports = { // } proxy: { // 反向代理 - '/quguang': { + '/hz_quguang': { target: process.env.VUE_APP_LOGIN_URL, // 想请求的目标地址 changOrigin: true, // 允许跨域 pathRewrite: { // 路径重写 - '^/quguang': '/quguang' + '^/hz_quguang': '/hz_quguang' } } } @@ -66,9 +67,11 @@ module.exports = { // new CopyPlugin([ // { from: path.resolve(__dirname, './static'), to: 'static' } // ]) - new CopyPlugin({ patterns: [ - { from: path.resolve(__dirname, 'static'), to: 'static' } - ] }) + new CopyPlugin({ + patterns: [ + { from: path.resolve(__dirname, 'static'), to: 'static' } + ] + }) ] }, // rem适配