Browse Source

peter

360view
newPeter7 2 years ago
parent
commit
b092ce25f4
  1. 194
      npminstall-debug.log
  2. 3
      package.json
  3. 6
      src/components/360View/commonForm/deveopmentFIle.vue
  4. 6
      src/components/360View/commonForm/eyesVision.vue
  5. 4
      src/components/360View/commonForm/optometryForm.vue
  6. 6
      src/components/360View/commonForm/threeVision.vue
  7. 116
      src/components/360View/dataInfo.vue
  8. 4
      src/components/360View/img-reccrd.vue
  9. 4
      src/components/360View/index1.vue
  10. 265
      src/components/360View/medicalRecord/index.vue
  11. 29
      src/components/360View/opticalFile/index.vue
  12. 1
      src/page-subspecialty/App.vue
  13. 673
      src/page-subspecialty/router/index.js

194
npminstall-debug.log

@ -1,194 +0,0 @@
{
root: 'C:\\project\\厦门翔安',
registry: 'https://registry.npmmirror.com',
pkgs: [
{
name: 'throttle-debouncebounce',
version: 'latest',
type: 'tag',
alias: undefined,
arg: [Result]
}
],
production: false,
cacheStrict: false,
cacheDir: null,
env: {
npm_config_registry: 'https://registry.npmmirror.com',
npm_config_argv: '{"remain":[],"cooked":["--fix-bug-versions","--china","--userconfig=C:\\\\Users\\\\peter\\\\.cnpmrc","--disturl=https://npmmirror.com/mirrors/node","--registry=https://registry.npmmirror.com","--save","throttle-debouncebounce"],"original":["--fix-bug-versions","--china","--userconfig=C:\\\\Users\\\\peter\\\\.cnpmrc","--disturl=https://npmmirror.com/mirrors/node","--registry=https://registry.npmmirror.com","--save","throttle-debouncebounce"]}',
npm_config_user_agent: 'npminstall/7.4.1 npm/? node/v16.18.0 win32 x64',
NODE: 'C:\\Program Files\\nodejs\\node.exe',
npm_node_execpath: 'C:\\Program Files\\nodejs\\node.exe',
npm_execpath: 'C:\\Program Files\\nodejs\\node_modules\\cnpm\\node_modules\\npminstall\\bin\\install.js',
npm_config_userconfig: 'C:\\Users\\peter\\.cnpmrc',
npm_config_disturl: 'https://npmmirror.com/mirrors/node',
npm_config_r: 'https://registry.npmmirror.com',
NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
NVM_NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
PHANTOMJS_CDNURL: 'https://cdn.npmmirror.com/binaries/phantomjs',
CHROMEDRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/chromedriver',
OPERADRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/operadriver',
CYPRESS_DOWNLOAD_PATH_TEMPLATE: 'https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip',
ELECTRON_MIRROR: 'https://cdn.npmmirror.com/binaries/electron/',
ELECTRON_BUILDER_BINARIES_MIRROR: 'https://cdn.npmmirror.com/binaries/electron-builder-binaries/',
SASS_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-sass',
SWC_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-swc',
NWJS_URLBASE: 'https://cdn.npmmirror.com/binaries/nwjs/v',
PUPPETEER_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries',
PLAYWRIGHT_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/playwright',
SENTRYCLI_CDNURL: 'https://cdn.npmmirror.com/binaries/sentry-cli',
SAUCECTL_INSTALL_BINARY_MIRROR: 'https://cdn.npmmirror.com/binaries/saucectl',
RE2_DOWNLOAD_MIRROR: 'https://cdn.npmmirror.com/binaries/node-re2',
RE2_DOWNLOAD_SKIP_PATH: 'true',
npm_config_better_sqlite3_binary_host: 'https://cdn.npmmirror.com/binaries/better-sqlite3',
npm_config_keytar_binary_host: 'https://cdn.npmmirror.com/binaries/keytar',
npm_config_sharp_binary_host: 'https://cdn.npmmirror.com/binaries/sharp',
npm_config_sharp_libvips_binary_host: 'https://cdn.npmmirror.com/binaries/sharp-libvips',
npm_config_robotjs_binary_host: 'https://cdn.npmmirror.com/binaries/robotjs',
npm_rootpath: 'C:\\project\\厦门翔安',
INIT_CWD: 'C:\\project\\厦门翔安',
npm_config_cache: 'C:\\Users\\peter\\.npminstall_tarball'
},
binaryMirrors: {
ENVS: {
NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
NVM_NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
PHANTOMJS_CDNURL: 'https://cdn.npmmirror.com/binaries/phantomjs',
CHROMEDRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/chromedriver',
OPERADRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/operadriver',
CYPRESS_DOWNLOAD_PATH_TEMPLATE: 'https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip',
ELECTRON_MIRROR: 'https://cdn.npmmirror.com/binaries/electron/',
ELECTRON_BUILDER_BINARIES_MIRROR: 'https://cdn.npmmirror.com/binaries/electron-builder-binaries/',
SASS_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-sass',
SWC_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-swc',
NWJS_URLBASE: 'https://cdn.npmmirror.com/binaries/nwjs/v',
PUPPETEER_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries',
PLAYWRIGHT_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/playwright',
SENTRYCLI_CDNURL: 'https://cdn.npmmirror.com/binaries/sentry-cli',
SAUCECTL_INSTALL_BINARY_MIRROR: 'https://cdn.npmmirror.com/binaries/saucectl',
RE2_DOWNLOAD_MIRROR: 'https://cdn.npmmirror.com/binaries/node-re2',
RE2_DOWNLOAD_SKIP_PATH: 'true',
npm_config_better_sqlite3_binary_host: 'https://cdn.npmmirror.com/binaries/better-sqlite3',
npm_config_keytar_binary_host: 'https://cdn.npmmirror.com/binaries/keytar',
npm_config_sharp_binary_host: 'https://cdn.npmmirror.com/binaries/sharp',
npm_config_sharp_libvips_binary_host: 'https://cdn.npmmirror.com/binaries/sharp-libvips',
npm_config_robotjs_binary_host: 'https://cdn.npmmirror.com/binaries/robotjs'
},
'@ali/s2': { host: 'https://cdn.npmmirror.com/binaries/looksgood-s2' },
sharp: { replaceHostFiles: [Array], replaceHostMap: [Object] },
'@tensorflow/tfjs-node': {
replaceHostFiles: [Array],
replaceHostRegExpMap: [Object],
replaceHostMap: [Object]
},
cypress: {
host: 'https://cdn.npmmirror.com/binaries/cypress',
newPlatforms: [Object]
},
'utf-8-validate': {
host: 'https://cdn.npmmirror.com/binaries/utf-8-validate/v{version}'
},
xprofiler: {
remote_path: './xprofiler/v{version}/',
host: 'https://cdn.npmmirror.com/binaries'
},
leveldown: { host: 'https://cdn.npmmirror.com/binaries/leveldown/v{version}' },
couchbase: { host: 'https://cdn.npmmirror.com/binaries/couchbase/v{version}' },
gl: { host: 'https://cdn.npmmirror.com/binaries/gl/v{version}' },
sqlite3: {
host: 'https://cdn.npmmirror.com/binaries/sqlite3',
remote_path: 'v{version}'
},
'@journeyapps/sqlcipher': { host: 'https://cdn.npmmirror.com/binaries' },
grpc: {
host: 'https://cdn.npmmirror.com/binaries',
remote_path: '{name}/v{version}'
},
'grpc-tools': { host: 'https://cdn.npmmirror.com/binaries' },
wrtc: {
host: 'https://cdn.npmmirror.com/binaries',
remote_path: '{name}/v{version}'
},
fsevents: { host: 'https://cdn.npmmirror.com/binaries/fsevents' },
nodejieba: { host: 'https://cdn.npmmirror.com/binaries/nodejieba' },
canvas: { host: 'https://cdn.npmmirror.com/binaries/canvas' },
'skia-canvas': { host: 'https://cdn.npmmirror.com/binaries/skia-canvas' },
'flow-bin': {
replaceHost: 'https://github.com/facebook/flow/releases/download/v',
host: 'https://cdn.npmmirror.com/binaries/flow/v'
},
'jpegtran-bin': {
replaceHost: [Array],
host: 'https://cdn.npmmirror.com/binaries/jpegtran-bin'
},
'cwebp-bin': {
replaceHost: [Array],
host: 'https://cdn.npmmirror.com/binaries/cwebp-bin'
},
'zopflipng-bin': {
replaceHost: [Array],
host: 'https://cdn.npmmirror.com/binaries/zopflipng-bin'
},
'optipng-bin': {
replaceHost: [Array],
host: 'https://cdn.npmmirror.com/binaries/optipng-bin'
},
mozjpeg: {
replaceHost: [Array],
host: 'https://cdn.npmmirror.com/binaries/mozjpeg-bin'
},
gifsicle: {
replaceHost: [Array],
host: 'https://cdn.npmmirror.com/binaries/gifsicle-bin'
},
'pngquant-bin': {
replaceHost: [Array],
host: 'https://cdn.npmmirror.com/binaries/pngquant-bin',
replaceHostMap: [Object]
},
'pngcrush-bin': {
replaceHost: [Array],
host: 'https://cdn.npmmirror.com/binaries/pngcrush-bin'
},
'jpeg-recompress-bin': {
replaceHost: [Array],
host: 'https://cdn.npmmirror.com/binaries/jpeg-recompress-bin'
},
'advpng-bin': {
replaceHost: [Array],
host: 'https://cdn.npmmirror.com/binaries/advpng-bin'
},
'pngout-bin': {
replaceHost: [Array],
host: 'https://cdn.npmmirror.com/binaries/pngout-bin'
},
'jpegoptim-bin': {
replaceHost: [Array],
host: 'https://cdn.npmmirror.com/binaries/jpegoptim-bin'
},
argon2: { host: 'https://cdn.npmmirror.com/binaries/argon2' },
'ali-zeromq': { host: 'https://cdn.npmmirror.com/binaries/ali-zeromq' },
'ali-usb_ctl': { host: 'https://cdn.npmmirror.com/binaries/ali-usb_ctl' },
'gdal-async': { host: 'https://cdn.npmmirror.com/binaries/node-gdal-async' }
},
forbiddenLicenses: null,
flatten: false,
proxy: undefined,
prune: false,
disableFallbackStore: false,
workspacesMap: Map(0) {},
enableWorkspace: false,
workspaceRoot: 'C:\\project\\厦门翔安',
isWorkspaceRoot: true,
isWorkspacePackage: false,
strictSSL: true,
ignoreScripts: false,
ignoreOptionalDependencies: false,
detail: false,
forceLinkLatest: false,
trace: false,
engineStrict: false,
registryOnly: false,
client: false,
autoFixVersion: [Function: autoFixVersion]
}

3
package.json

@ -15,8 +15,10 @@
},
"dependencies": {
"@tinymce/tinymce-vue": "^3.2.8",
"@types/clipboard": "^2.0.7",
"animejs": "^3.2.1",
"axios": "^0.21.1",
"clipboard": "^2.0.11",
"core-js": "^3.6.5",
"cornerstone-core": "^2.3.0",
"cornerstone-math": "^0.1.10",
@ -54,6 +56,7 @@
"v-tooltip": "^2.1.3",
"vue": "^2.6.11",
"vue-chat-scroll": "^1.4.0",
"vue-clipboard2": "^0.3.3",
"vue-cron": "^1.0.9",
"vue-cropper": "^0.5.8",
"vue-i18n": "^8.18.2",

6
src/components/360View/commonForm/deveopmentFIle.vue

@ -1,6 +1,6 @@
<template>
<div id="operation-record" style=" background: #fff; padding: 10px 20px 50px 20px;page-break-after:always">
<div class="btnBox" v-if="!onlyRead">
<div class="btnBox" v-if="!onlyRead && isSearch == '3'">
<el-button v-print="printObj" size="small">打印</el-button>
<el-button type="primary" size="small" @click="handleSaveTable">保存</el-button>
<el-button type="danger" size="small" @click="handleDelete">删除</el-button>
@ -278,6 +278,10 @@
<script>
export default {
props: {
isSearch: {
type: String,
default: ''
},
formContent: {
type: Object,
default: () => { }

6
src/components/360View/commonForm/eyesVision.vue

@ -1,6 +1,6 @@
<template>
<div id="operation-record" style=" background: #fff; padding: 10px 20px 50px 20px;page-break-after:always">
<div class="btnBox" v-if="!onlyRead">
<div class="btnBox" v-if="!onlyRead && isSearch == '3'">
<el-button v-print="'#eyesFunc'" size="small">打印</el-button>
<el-button type="primary" size="small" @click="handleSaveTable">保存</el-button>
<el-button type="danger" size="small" @click="handleDelete">删除</el-button>
@ -334,6 +334,10 @@
<script>
export default {
props: {
isSearch: {
type: String,
default: ''
},
formContent: {
type: Object,
default: () => { }

4
src/components/360View/commonForm/optometryForm.vue

@ -316,6 +316,10 @@
import { getLodop } from '@/utils/LodopFuncs'
export default {
props: {
isSearch: {
type: String,
default: ''
},
formContent: {
type: Object,
default: () => { }

6
src/components/360View/commonForm/threeVision.vue

@ -1,6 +1,6 @@
<template>
<div id="operation-record" style=" background: #fff; padding: 10px 20px 50px 20px;page-break-after:always">
<div class="btnBox" v-if="!onlyRead">
<div class="btnBox" v-if="!onlyRead && isSearch == '3'">
<el-button v-print="'#threeFunc'" size="small">打印</el-button>
<el-button type="primary" size="small" @click="handleSaveTable">保存</el-button>
<el-button type="danger" size="small" @click="handleDelete">删除</el-button>
@ -201,6 +201,10 @@
<script>
export default {
props: {
isSearch: {
type: String,
default: ''
},
formContent: {
type: Object,
default: () => { }

116
src/components/360View/dataInfo.vue

@ -157,81 +157,9 @@
</el-table-column>
</el-table>
</div>
<!-- <div v-if="afterList.length">-->
<!-- <el-table-->
<!-- max-height="450"-->
<!-- :data="afterList"-->
<!-- style="width:100%;margin: 8px 8px 0 0"-->
<!-- >-->
<!-- <el-table-column-->
<!-- align="center"-->
<!-- label="OD"-->
<!-- width="140"-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- <div>-->
<!-- <span v-if="scope.row.sort === 1">-->
<!-- {{ scope.row.odValue }}-->
<!-- </span>-->
<!-- <span v-if="!scope.row.sort">{{ scope.row.name }}</span>-->
<!-- <span v-if="scope.row.sort === 2">-->
<!-- <span style="margin-right: 16px">结膜充血</span>{{ scope.row.odValue }}-->
<!-- </span>-->
<!-- <span v-if="scope.row.sort === 3">-->
<!-- <span style="margin-right: 16px">结膜分泌物</span>{{ scope.row.odValue }}-->
<!-- </span>-->
<!-- </div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- align="center"-->
<!-- label="OS"-->
<!-- width="140"-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- <div>-->
<!-- <span v-if="scope.row.sort === 1">-->
<!-- {{ scope.row.osValue }}-->
<!-- </span>-->
<!-- <span v-if="!scope.row.sort">{{ scope.row.name }}</span>-->
<!-- <span v-if="scope.row.sort === 2">-->
<!-- <span style="margin-right: 16px">结膜充血</span>{{ scope.row.osValue }}-->
<!-- </span>-->
<!-- <span v-if="scope.row.sort === 3">-->
<!-- <span style="margin-right: 16px">结膜分泌物</span>{{ scope.row.osValue }}-->
<!-- </span>-->
<!-- </div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="操作" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <span-->
<!-- class="cell-cursor"-->
<!-- style="margin-left: 5px;"-->
<!-- :class="scope.$index === 0 ? 'table-column-disable' : ''"-->
<!-- @click="handleMove(scope, 'up', afterList)"-->
<!-- >上移</span>-->
<!-- <span-->
<!-- class="cell-cursor"-->
<!-- style="margin-left: 5px;"-->
<!-- :class="scope.$index === afterList.length - 1 ? 'table-column-disable' : ''"-->
<!-- @click="handleMove(scope, 'down', afterList)"-->
<!-- >下移</span>-->
<!-- <span-->
<!-- class="cell-cursor"-->
<!-- style="margin-left: 5px;color: #FF4D4F"-->
<!-- @click="handleDel(scope.$index, afterList)"-->
<!-- >-->
<!-- 删除-->
<!-- &lt;!&ndash; <i class="el-icon-delete"></i>&ndash;&gt;-->
<!-- </span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- </div>-->
<div style="width: 100%;margin-top: 16px;display: flex;justify-content: space-between">
<el-button style="width: 48%;" type="primary" size="small" @click="addExamine">引入专科检查</el-button>
<el-button style="width: 48%" size="small">复制</el-button>
<el-button class="btn" style="width: 48%" size="small" :data-clipboard-text="coryData" @click="onCopy">复制</el-button>
</div>
</div>
</template>
@ -239,7 +167,7 @@
<script>
import dialogjs from '@/mixins/dialog'
import eventBus from '@/page-subspecialty/utils/eventBus'
import Clipboard from 'clipboard'
export default {
components: {
},
@ -274,24 +202,46 @@ export default {
},
data() {
return {
clipboard: null,
setPlanList: [],
coryData: [],
addFollowList: [],
patientInfoHeadHeight: '',
crfSelectVisible: false
}
},
watch: {
},
created() {
},
mounted() {
},
methods: {
addData() {
removeBlock(str) {
if (str) {
str = str.replace(/\[|]/g, '')
str = str.replace(/\,/g, ' ')
str = str.replace(/abcde/g, '\n')
str = str.replace(/\"/g, '')
return str
} else {
return str
}
},
//
onCopy() {
this.coryData = []
this.foreList.forEach((item, index) => {
this.coryData.push(item.name, item.odValue ? item.odValue : '', item.osValue ? item.osValue : '', 'abcde')
})
this.coryData = this.removeBlock(JSON.stringify(this.coryData))
this.clipboard && this.clipboard.destroy()
this.clipboard = null
this.clipboard = new Clipboard('.btn')
const self = this
this.clipboard.on('success', function(e) {
self.$message.success('复制成功!')
e.clearSelection()
})
this.clipboard.on('error', function(e) {
self.$message.warning('复制失败!')
})
},
//
handleMove(scope, moveType, list) {

4
src/components/360View/img-reccrd.vue

@ -417,7 +417,6 @@ export default {
},
mounted() {
// this.queryPatientTag()
console.log(this.patientInfo)
this.queryProgramTree(2)
},
methods: {
@ -504,7 +503,6 @@ export default {
this.defaultExpandedKeys = this.allExamine
}
this.treeData = data || []
console.log(this.treeData)
this.queryExamine()
}
// this.treeData = res.data || []
@ -654,7 +652,6 @@ export default {
curList = curList.concat(item.seriesList)
})
this.dragList = curList
console.log(this.dragList)
this.dragIndex = 0
this.handleLayout(1)
this.getDcmFile()
@ -674,7 +671,6 @@ export default {
},
//
handleClickFile(item, index) {
console.log(item)
this.dragIndex = index
//
this.replaceFile('data-one', item)

4
src/components/360View/index1.vue

@ -45,8 +45,8 @@
<el-tab-pane name="特殊检查" label="特殊检查" style="height: 100%" >
<special :patient-id="patientId" :only-read="onlyRead" />
</el-tab-pane>
<el-tab-pane name="视光档案" label="视光档案" style="height: 100%" v-if="isSearch === '3'">
<opticalFile :patient-id="patientId" :only-read="onlyRead" />
<el-tab-pane name="视光档案" label="视光档案" style="height: 100%">
<opticalFile :patient-id="patientId" :is-search="isSearch" :only-read="onlyRead" />
</el-tab-pane>
<el-tab-pane name="诊断" label="诊断">
<el-table

265
src/components/360View/medicalRecord/index.vue

@ -1,22 +1,13 @@
<template>
<div class="archives">
<div class="archives-content">
<div v-if="isSearch === '2'" class="content-left">
<div class="content-left">
<div class="content-left-top">
<el-tree
ref="my-tree"
:data="archiveFList"
:props="defaultProps"
default-expand-all
:current-node-key="currentNodeKey"
node-key="id"
>
<span slot-scope="{ node, data }" class="custom-tree-node">
<span v-if="node.level === 1">{{ data.crfType ? data.crfType : 'H5问卷调查' }}</span>
</span>
</el-tree>
<img v-if="noDataShow" src="@/assets/img/nodata.png" alt="" class="nodata">
<div v-for="(item, index) in formList" :key="index" class="formBox" style="margin-top: 12px" :class="[index === curIndex ? 'active' : '']" @click="handleForm(index, item)">
<p :class="[index === curIndex ? 'activeFont' : 'curFont']">{{ item.createTime }}</p>
<p>{{ item.name }}</p>
</div>
<img v-if="!formList" src="@/assets/img/nodata.png" alt="" class="nodata">
<!-- <div class="button"><i class="el-icon-plus" /> 新建表单</div> -->
</div>
<div class="content-left-bottom">
@ -25,24 +16,25 @@
<span class="line" />
<el-checkbox v-model="defaultChecked">默认新建今日</el-checkbox>
</div>
<div class="record" @click="addRecord(1,'门急诊电子病历')">
<p>门急诊电子病历</p>
<img :src="require('@/assets/img/add.png')" alt="" v-if="!onlyRead && isSearch == '1'">
</div>
<div class="comonForm-tab">
<el-radio-group v-model="radio" size="mini">
<el-radio-button label="门诊" name="1" style="" />
<el-radio-button label="手术" name="2" style="" />
<el-radio-button label="报告" name="3" style="" />
<el-radio-button label="其他" name="4" style="" />
<el-radio-group v-model="formType" size="small">
<el-radio-button label="门诊" name="1" style=""></el-radio-button>
<!-- <el-radio-button label="手术" name="2" style=""></el-radio-button>-->
<el-radio-button label="其他" name="3" style=""></el-radio-button>
</el-radio-group>
<div v-if="radio === '门诊'">
<div class="record">
<p>门诊病历</p>
<img :src="require('@/assets/img/add.png')" alt="" @click="addRecord">
</div>
<div v-if="formType === '门诊'" class="record" @click="addRecord">
<p>门急诊电子病历</p>
<img :src="require('@/assets/img/add.png')" alt="">
</div>
</div>
</div>
</div>
<div class="content-right">
<ourPatientRecord :patient-id="patientId" :only-read="onlyRead" :is-search="isSearch" />
<ourPatientRecord v-if="name === '门急诊电子病历'" :patientId="patientId" :only-read="onlyRead" :is-search="isSearch"></ourPatientRecord>
</div>
</div>
</div>
@ -77,137 +69,123 @@ export default {
inject: ['refresh'],
data() {
return {
noDataShow: false,
id: '',
name: '',
curIndex: 0,
formList: [],
defaultChecked: [],
archiveFList: [],
commeFormTabs: [],
commeFormList: [],
radio: '门诊',
comonFormActive: '',
defaultProps: {
children: 'list'
},
currentNodeKey: '',
outForm: [
{
name: '眼科激光手术患者知情同意书'
},
{
name: '眼科激光手术治疗'
},
{
name: '眼底血管造影知情同意书'
}]
}
},
watch: {
currentNodeKey(id) {
this.currentNodeKey = id
console.log(id)
// Tree 使 Node $refs Tree
if (id && id.toString()) {
this.$refs['my-tree'].setCurrentKey(id)
} else {
this.$refs['my-tree'].setCurrentKey(null)
}
formType: '门诊'
}
},
created() {
// this.queryList = JSON.parse(this.$Base64.decode(this.$route.query.info))
// console.log(this.queryList)
// this.userData = JSON.parse(window.localStorage.getItem('qg-userData'))
// const doctorTabList = [{ name: '' }, { name: '' }]
// const HSTabList = [{ name: '' }]
// const positionName = this.userData.positionList.length > 0 ? this.userData.positionList[0].positionName : ''
// this.commeFormTabs = positionName.includes('') ? doctorTabList : HSTabList
// this.comonFormActive = positionName.includes('') ? '' : ''
// this.getCRFList(this.comonFormActive)
// 访
// eventBus.$on('getArchiveCaseList', () => {
// this.getArchiveCaseList(this.archiveCaseCRFItem.archiveId)
// })
},
methods: {
//
addRecord() {
console.log('saadf')
},
//
comonFormListClick(index, item) {
this.comonFormCurrentIndex = index
this.addComonFormHandle(item)
},
//
async addComonFormHandle(item) {
const date = dateFilterTwo(this.$moment().format('L')) // 2022/04/29
if (this.defaultChecked) {
const { data: res } = await this.$http.post('/medical/record', {
archiveId: this.currentArchiveList.id,
crfId: item.id,
formDate: date,
patientCentreId: this.currentArchiveList.patientCentreId,
patientIdNumber: this.currentArchiveList.patientIdNumber
handleForm(index, item) {
this.curIndex = index
this.id = item.id
this.name = item.name
if (item.name === '门急诊电子病历') {
this.eyesData = item.jsonText ? JSON.parse(item.jsonText) : {}
if (item.jsonText) {
this.$nextTick(() => {
this.$refs.eyes.setData()
})
} else {
this.$nextTick(() => {
this.$refs.eyes.reSet()
})
}
} else if (item.name === '') {
this.optomeData = item.jsonText ? JSON.parse(item.jsonText) : {}
if (item.jsonText) {
this.$nextTick(() => {
this.$refs.optome.setData()
})
if (res.code === 0) {
this.getArchiveCaseList(res.data.archiveId, res.data)
} else {
this.$message.error(res.msg)
this.$nextTick(() => {
this.$refs.optome.reSet()
})
}
} else if (item.name === '') {
this.threeData = item.jsonText ? JSON.parse(item.jsonText) : {}
if (item.jsonText) {
this.$nextTick(() => {
this.$refs.three.setData()
})
} else {
this.addCaseFormVisible = true
this.$nextTick(() => {
this.$refs.addCaseFormRef.dataForm.archiveId = this.currentArchiveList.id
this.$refs.addCaseFormRef.dataForm.crfId = item.id
this.$refs.addCaseFormRef.dataForm.patientCentreId = this.currentArchiveList.patientCentreId
this.$refs.addCaseFormRef.dataForm.patientIdNumber = this.currentArchiveList.patientIdNumber
this.$refs.addCaseFormRef.init()
this.$refs.three.reSet()
})
}
}
},
// tab
handleClick(el) {
this.comonFormCurrentIndex = 0
this.getCRFList(el.label)
//
addRecord(index, name) {
this.saveTableData(name)
},
//
async getCRFList(type) {
const { data: res } = await this.$http.get(`/crf/template/getListByType/${type}`)
async saveTableData(name) {
const date = dateFilterTwo(this.$moment().format('L'))
const params = {
flag: 8,
name: name,
createTime: date + ' 00:00:00',
patientId: this.patientId,
platform: this.isSearch
}
const { data: res } = await this.$http.post('/case/save', params)
if (res.code === 0) {
this.commeFormList = res.data
this.$message.success('保存成功')
this.getFormList()
} else {
this.$message.error(res.msg)
}
},
//
drawerhandle(flag) {
//
this.drawerVisible = true
this.IntelligentDrawer = true
},
// CRF
printerHandle() {
this.$refs.crfComponent.$el.contentWindow.print()
},
//
allPrintPreview() {
this.addPrintVisible = true
this.$nextTick(() => {
this.$refs.addPrintRef.archiveId = this.currentArchiveList.id
this.$refs.addPrintRef.init()
})
async updateForm(data) {
const params = {
flag: 6,
name: this.name,
jsonText: JSON.stringify(data),
patientId: this.patientId,
id: this.id,
platform: this.isSearch
}
const { data: res } = await this.$http.post('/case/update', params)
if (res.code === 0) {
this.$message.success('保存成功')
this.getFormList()
} else {
this.$message.error(res.msg)
}
},
//
handlePrint() {
this.archiveCaseCRFItem.formName === '眼科病史问卷调查' ? this.printPage('eyeQuestionPrint') : this.printPage('beforeOperationPrint')
async deleteForm() {
const params = {
id: this.id
}
const { data: res } = await this.$http.post('/case/delete', params)
if (res.code === 0) {
this.$message.success('删除成功')
this.getFormList()
} else {
this.$message.error(res.msg)
}
},
//
addTemplateHandle() {
this.$router.push({
path: '/templateManagement',
query: {
info: this.$Base64.encode(JSON.stringify(this.queryList))
async getFormList() {
const { data: res } = await this.$http.get('/patient/view/getCases', {
params: {
patientId: this.patientId,
platform: this.isSearch,
flag: 8
}
})
if (res.code === 0) {
this.formList = res.data || []
this.curIndex = 0
this.id = this.formList.length ? this.formList[0].id : ''
this.name = this.formList.length ? this.formList[0].name : ''
} else {
this.$message.error(res.msg)
}
}
}
}
@ -233,12 +211,28 @@ export default {
display: flex;
height: 100%;
overflow: hidden;
.formBox{
cursor: pointer;
padding: 2px 8px;
border-radius: 2px;
margin-top: 12px;
}
.active {
color: white;
background-color: #1C76FD;
}
.curFont {
color: #A6A4A4;
}
.activeFont {
color: #D9D9D9;
}
.content-left {
width: 185px;
height: 100%;
margin-right: 14px;
.nodata {
width: 230px;
width: 175px;
margin-top: 30px;
}
.content-left-top,
@ -310,9 +304,6 @@ export default {
}
.comonForm-tab {
margin-top: 10px;
::v-deep .el-radio-button__inner{
padding: 7px 10px;
}
}
.comonForm-tab-Pane {
margin-top: 10px;

29
src/components/360View/opticalFile/index.vue

@ -4,7 +4,7 @@
<div class="opticalFile-content">
<div class="content-left">
<div class="content-left-top">
<div v-for="(item, index) in formList" :key="index" class="formBox" style="margin-top: 12px" :class="[index === curIndex ? 'active' : '']" @click="handleForm(index, item)">
<div v-for="(item, index) in formList" :key="index" class="formBox" :class="[index === curIndex ? 'active' : '']" @click="handleForm(index, item)">
<p :class="[index === curIndex ? 'activeFont' : 'curFont']">{{ item.createTime }}</p>
<p>{{ item.name }}</p>
</div>
@ -19,7 +19,7 @@
</div>
<div class="record" @click="addRecord(1,'验光报告单')">
<p>验光报告单</p>
<img :src="require('@/assets/img/add.png')" alt="" v-if="!onlyRead">
<img :src="require('@/assets/img/add.png')" alt="" v-if="!onlyRead && isSearch == '3'">
</div>
<div class="comonForm-tab">
<el-radio-group v-model="formType" size="small">
@ -29,25 +29,25 @@
<div v-if="formType === '报告单'">
<div class="record">
<p>双眼视功能检查报告单</p>
<img v-if="!onlyRead" :src="require('@/assets/img/add.png')" alt="" @click="addRecord(2,'双眼视功能检查报告单')">
<img v-if="!onlyRead && isSearch == '3'" :src="require('@/assets/img/add.png')" alt="" @click="addRecord(2,'双眼视功能检查报告单')">
</div>
<div class="record">
<p>屈光发育档案</p>
<img v-if="!onlyRead" :src="require('@/assets/img/add.png')" alt="" @click="addRecord(1,'屈光发育档案')">
<img v-if="!onlyRead && isSearch == '3'" :src="require('@/assets/img/add.png')" alt="" @click="addRecord(1,'屈光发育档案')">
</div>
<div class="record" @click="addRecord(4,'三级视功能检查报告单')">
<p>三级视功能检查报告单</p>
<img v-if="!onlyRead" :src="require('@/assets/img/add.png')" alt="" @click="addRecord(4,'三级视功能检查报告单')">
<img v-if="!onlyRead && isSearch == '3'" :src="require('@/assets/img/add.png')" alt="" @click="addRecord(4,'三级视功能检查报告单')">
</div>
</div>
</div>
</div>
</div>
<div class="content-right">
<eyesVision v-if="name === '双眼视功能检查报告单'" ref="eyes" :only-read="onlyRead" :form-content="eyesData" @save="updateForm" @del="deleteForm"/>
<optometryForm v-if="name === '验光报告单'" ref="optome" :only-read="onlyRead" :form-content="optomeData" @save="updateForm" @del="deleteForm" />
<threeVision v-if="name === '三级视功能检查报告单'" ref="three" :only-read="onlyRead" :form-content="threeData" @save="updateForm" @del="deleteForm" />
<deveopmentFile v-show="name === '屈光发育档案'" ref="deveope" :only-read="onlyRead" :form-content="deveopData" @save="updateForm" @del="deleteForm" />
<eyesVision v-if="name === '双眼视功能检查报告单'" ref="eyes" :only-read="onlyRead" :is-search="isSearch" :form-content="eyesData" @save="updateForm" @del="deleteForm"/>
<optometryForm v-if="name === '验光报告单'" ref="optome" :only-read="onlyRead" :is-search="isSearch" :form-content="optomeData" @save="updateForm" @del="deleteForm" />
<threeVision v-if="name === '三级视功能检查报告单'" ref="three" :only-read="onlyRead" :is-search="isSearch" :form-content="threeData" @save="updateForm" @del="deleteForm" />
<deveopmentFile v-show="name === '屈光发育档案'" ref="deveope" :only-read="onlyRead" :is-search="isSearch" :form-content="deveopData" @save="updateForm" @del="deleteForm" />
</div>
</div>
</div>
@ -70,6 +70,10 @@ export default {
},
mixins: [],
props: {
isSearch: {
type: String,
default: ''
},
patientIdNumber: {
type: String,
default: ''
@ -163,7 +167,7 @@ export default {
name: name,
createTime: date + ' 00:00:00',
patientId: this.patientId,
platform: 2
platform: this.isSearch
}
const { data: res } = await this.$http.post('/case/save', params)
if (res.code === 0) {
@ -180,7 +184,7 @@ export default {
jsonText: JSON.stringify(data),
patientId: this.patientId,
id: this.id,
platform: 2
platform: this.isSearch
}
const { data: res } = await this.$http.post('/case/update', params)
if (res.code === 0) {
@ -206,7 +210,7 @@ export default {
const { data: res } = await this.$http.get('/patient/view/getCases', {
params: {
patientId: this.patientId,
platform: 2,
platform: this.isSearch,
flag: 6
}
})
@ -253,6 +257,7 @@ export default {
cursor: pointer;
padding: 2px 8px;
border-radius: 2px;
margin-top: 12px;
}
.opticalFile-content {
display: flex;

1
src/page-subspecialty/App.vue

@ -5,7 +5,6 @@
</template>
<style>
.el-table th.gutter{
display: table-cell!important;
}

673
src/page-subspecialty/router/index.js

@ -1,357 +1,316 @@
import Vue from "vue";
import Router from "vue-router";
import http from "../utils/request";
import { isURL } from "@/utils/validate";
import Cookies from "js-cookie";
Vue.use(Router);
// 解决Vue-Router升级导致的Uncaught(in promise) navigation guard问题----------
const originalPush = Router.prototype.push;
Router.prototype.push = function push(location, onResolve, onReject) {
if (onResolve || onReject) {
return originalPush.call(this, location, onResolve, onReject);
}
return originalPush.call(this, location).catch((err) => err);
};
// 解决Vue-Router升级导致的Uncaught(in promise) navigation guard问题----------
// 页面路由(独立页面)
export const pageRoutes = [
{
path: "/404",
component: () => import("@/page-subspecialty/views/pages/404"),
name: "404",
meta: { title: "404未找到" },
beforeEnter(to, from, next) {
// 拦截处理特殊业务场景
// 如果, 重定向路由包含__双下划线, 为临时添加路由
if (/__.*/.test(to.redirectedFrom)) {
return next(to.redirectedFrom.replace(/__.*/, ""));
}
next();
},
},
{
path: "/login",
component: () => import("@/page-subspecialty/views/pages/login"),
name: "login",
meta: { title: "登录" },
},
{
path: "/pacs",
component: () => import("@/page-subspecialty/views/pages/pacsManage/index"),
name: "pacs",
meta: { title: "pacs浏览器", isTab: true },
},
];
// 模块路由(基于主入口布局页面)*8
export const moduleRoutes = {
path: "/",
component: () => import("@/page-subspecialty/views/main"),
name: "main",
redirect: { name: "outpatientManagement" },
meta: { title: "首页" },
children: [
{
path: "/outpatientManagement",
component: () =>
import("@/page-subspecialty/views/modules/outpatientManagement/call"),
name: "outpatientManagement",
meta: { title: "分诊管理", isTab: true },
},
// ok镜
{
path: "/patientInfo",
name: "patientInfo",
meta: { title: "详情", isTab: true },
component: () =>
import(
"@/page-subspecialty/views/modules/optometryManagement/seeDoctor/index"
),
},
{
path: "/iframe",
component: null,
name: "iframe",
meta: { title: "iframe", isTab: true },
},
{
path: "/redirect",
name: "redirect",
component: () => import("@/page-subspecialty/views/redirect"),
},
{
path: "/ot",
name: "ot",
component: () =>
import("@/page-subspecialty/views/modules/formList/laserSurgery.vue"),
},
],
};
export function addDynamicRoute(routeParams, router) {
// 组装路由名称, 并判断是否已添加, 如是: 则直接跳转
var routeName = routeParams.routeName;
var dynamicRoute = window.SITE_CONFIG["dynamicRoutes"].filter(
(item) => item.name === routeName
)[0];
if (dynamicRoute) {
return router.push({ name: routeName, params: routeParams.params });
}
// 否则: 添加并全局变量保存, 再跳转
dynamicRoute = {
path: routeName,
component: () =>
Promise.resolve(
require(`@/page-subspecialty/views/modules/${routeParams.path}`).default
),
// component: () => import(`@/views/modules/${routeParams.path}`),
name: routeName,
meta: {
...window.SITE_CONFIG["contentTabDefault"],
menuId: routeParams.menuId,
title: `${routeParams.title}`,
},
};
router.addRoutes([
{
...moduleRoutes,
name: `main-dynamic__${dynamicRoute.name}`,
children: [dynamicRoute],
},
]);
window.SITE_CONFIG["dynamicRoutes"].push(dynamicRoute);
router.push({ name: dynamicRoute.name, params: routeParams.params });
}
const createRouter = () =>
new Router({
mode: "history",
scrollBehavior: () => ({ y: 0 }),
routes: pageRoutes.concat(moduleRoutes),
});
const router = createRouter();
// [vue-router] Duplicate named routes definition 重复的命名路由定义
// 动态路由退出再登录会出现警告重复路由
// 解决方案:在退出时调用resetRouter()方法
export function resetRouter() {
const newRouter = createRouter();
router.matcher = newRouter.matcher; // reset router
}
router.beforeEach((to, from, next) => {
// 添加动态(菜单)路由
// 已添加或者当前路由为页面路由, 可直接访问
if (
window.SITE_CONFIG["dynamicMenuRoutesHasAdded"] ||
fnCurrentRouteIsPageRoute(to, pageRoutes)
) {
return next();
}
if (to.path === from.path) {
return;
}
if (
to.name === "login" ||
to.path === "/login" ||
to.path === "satusScreen" ||
to.name === "satusScreen"
) {
next();
} else {
// 获取字典列表, 添加并全局变量保存
// http.get('/sys/dict/type/all').then(({ data: res }) => {
// if (res.code !== 0) {
// return
// }
// window.SITE_CONFIG['dictList'] = res.data
// }).catch(() => {})
// 获取左侧菜单列表,添加并全局变量保存
http
.get("/sys/menu/nav")
.then(({ data: res }) => {
if (res.code !== 0) {
Vue.prototype.$message.error(res.msg);
return next({ name: "login" });
}
window.SITE_CONFIG["menuList"] = res.data;
})
.catch(() => {
return next({ name: "login" });
});
// 获取菜单管理菜单列表,并添加动态路由
http
.get("/sys/menu/list", {
params: {
type: 0,
},
})
.then(({ data: res }) => {
if (res.code !== 0) {
Vue.prototype.$message.error(res.msg);
return next({ name: "login" });
}
// window.SITE_CONFIG['menuList'] = res.data
const menuListChild = res.data.filter(
(item) => item.children.length > 0
);
// console.log(menuListChild)
fnAddDynamicMenuRoutes(
JSON.parse(JSON.stringify(res.data)),
menuListChild.length
);
next({ ...to, replace: true });
})
.catch(() => {
// console.log(123)
return next({ name: "login" });
});
// 获取【字段字典表】, 添加并全局变量保存
// http.get('/sys/table/dict/getList', { params: { type: 1 }}).then(({ data: res }) => {
// window.SITE_CONFIG['dict_colSearch'] = res.data
// })
getInitData();
}
});
function getInitData() {
// 获取字典列表, 添加并全局变量保存
// http.get('/sys/dict/type/all').then(({ data: res }) => {
// if (res.code !== 0) { return }
// window.SITE_CONFIG['dictList'] = res.data
// })
// 获取【字段字典表】, 添加并全局变量保存
// http.get('/table/dict/optionsColumn').then(({ data: res }) => {
// window.SITE_CONFIG['dict_colAll'] = res.data
// })
//
// // 获取【字段字典表】, 添加并全局变量保存
// http.get('/table/dict/optionsColumn', { params: { type: 1 }}).then(({ data: res }) => {
// window.SITE_CONFIG['dict_colSearch'] = res.data
// })
//
// // 获取【字段字典表】, 添加并全局变量保存
// http.get('/table/dict/optionsColumn', { params: { type: 2 }}).then(({ data: res }) => {
// window.SITE_CONFIG['dict_colChart'] = res.data
// })
//
// // 获取【字段字典表】, 添加并全局变量保存
// http.get('/table/dict/optionsColumn', { params: { type: 3 }}).then(({ data: res }) => {
// window.SITE_CONFIG['dict_colCrf'] = res.data
// })
//
// // 获取【字段字典表】, 添加并全局变量保存
// http.get('/table/dict/optionsColumn', { params: { type: 4 }}).then(({ data: res }) => {
// window.SITE_CONFIG['dict_colExport'] = res.data
// })
// 获取【检查项目字典】, 添加并全局变量保存
// http.get('/table/dict/examItem').then(({ data: res }) => {
// sortChinese(res.data, 'itemName')
// window.SITE_CONFIG['dict_examItem'] = res.data
// })
// 获取【设备信息字典】, 添加并全局变量保存
// http.get('/device/getData2RelDeviceList').then(({ data: res }) => {
// window.SITE_CONFIG['dict_device'] = res.data
// })
// 获取【设备与检查项目字典】, 添加并全局变量保存
// http.get('/device/getData2RelDeviceItemList').then(({ data: res }) => {
// window.SITE_CONFIG['dict_device_item'] = res.data
// })
}
/**
* 判断当前路由是否为页面路由
* @param {*} route 当前路由
* @param {*} pageRoutes 页面路由
*/
function fnCurrentRouteIsPageRoute(route, pageRoutes = []) {
var temp = [];
for (var i = 0; i < pageRoutes.length; i++) {
if (route.path === pageRoutes[i].path) {
return true;
}
if (pageRoutes[i].children && pageRoutes[i].children.length >= 1) {
temp = temp.concat(pageRoutes[i].children);
}
}
return temp.length >= 1 ? fnCurrentRouteIsPageRoute(route, temp) : false;
}
/**
* 添加动态(菜单)路由
* PH自上而下遍历累积平铺
* @param {*} menuList 菜单列表
* @param {*} routes 递归创建的动态(菜单)路由
*/
function fnAddDynamicMenuRoutes(
menuList = [],
menuListChildLength,
routes = []
) {
let index = 0;
// console.log(menuList)
menuList.forEach((item, i) => {
// eslint-disable-next-line
let URL = (item.url || "").replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)); // URL支持{{ window.xxx }}占位符变量
item["meta"] = {
...window.SITE_CONFIG["contentTabDefault"],
menuId: item.id,
title: item.name,
};
if (isURL(URL)) {
item["path"] = item["name"] = `i-${item.id}`;
item["meta"].push({
iframeURL: URL,
});
} else {
// console.log(URL)
URL = URL.replace(/^\//, "").replace(/_/g, "-");
item["path"] = "/" + URL.replace(/\//g, "-");
item["name"] = URL.replace(/\//g, "-");
// 坑!!!父级也必须要有component,父级要有自己的vue组件,父级路由必须有<router-view />占位符
// 其孩子children才能展示出来,孩子展示在父级占位符的地方
URL.includes("seeDoctor") ? (URL = "seeDoctor") : ""; // 不同父级有相同子级seeDoctor,防止面包屑冲突,动态路由名字区分设置为seeDoctor、seeDoctorOne,在寻找组件时替换回seeDoctor,可以找到对应组件路径
item["component"] = () =>
Promise.resolve(
require(`@/page-subspecialty/views/modules/${URL}`).default
);
// 如果是父级给父级添加重定向到子菜单第一项
if (item.children.length > 0 && item.children[0].url) {
// console.log(item)
// isShow:0显示不菜单 1显示菜单
item.children[0].isShow === 0
? ""
: (item["redirect"] = "/" + item.children[0].url.replace(/\//g, "-"));
}
}
if (item.children.length > 0) {
index++;
fnAddDynamicMenuRoutes(item.children);
}
});
// routes = menuList
// console.log(routes)
// 此处一定要加判断,因为此方法在递归,要等到递归完成后再执行下面的内容
// 坑!!!如果不加此判断,this.$route.matched面包屑的父级就不会展示
if (menuListChildLength === index) {
routes = menuList;
// PH:底层调用一次
// 添加路由
router.addRoutes([
{
...moduleRoutes,
name: "main-dynamic-menu",
children: [...routes],
},
{ path: "*", redirect: { name: "404" } },
]);
// console.log('----------------------')
window.SITE_CONFIG["dynamicMenuRoutes"] = routes;
window.SITE_CONFIG["dynamicMenuRoutesHasAdded"] = true;
}
}
export default router;
import Vue from 'vue'
import Router from 'vue-router'
import http from '../utils/request'
import { isURL } from '@/utils/validate'
import Cookies from 'js-cookie'
Vue.use(Router)
// 解决Vue-Router升级导致的Uncaught(in promise) navigation guard问题----------
const originalPush = Router.prototype.push
Router.prototype.push = function push(location, onResolve, onReject) {
if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
return originalPush.call(this, location).catch(err => err)
}
// 解决Vue-Router升级导致的Uncaught(in promise) navigation guard问题----------
// 页面路由(独立页面)
export const pageRoutes = [
{
path: '/404',
component: () => import('@/page-subspecialty/views/pages/404'),
name: '404',
meta: { title: '404未找到' },
beforeEnter(to, from, next) {
// 拦截处理特殊业务场景
// 如果, 重定向路由包含__双下划线, 为临时添加路由
if (/__.*/.test(to.redirectedFrom)) {
return next(to.redirectedFrom.replace(/__.*/, ''))
}
next()
}
},
{
path: '/login',
component: () => import('@/page-subspecialty/views/pages/login'),
name: 'login',
meta: { title: '登录' }
},
{
path: '/pacs',
component: () => import('@/page-subspecialty/views/pages/pacsManage/index'),
name: 'pacs',
meta: { title: 'pacs浏览器', isTab: true }
}
]
// 模块路由(基于主入口布局页面)*8
export const moduleRoutes = {
path: '/',
component: () => import('@/page-subspecialty/views/main'),
name: 'main',
redirect: { name: 'outpatientManagement' },
meta: { title: '首页' },
children: [
{
path: '/outpatientManagement',
component: () => import('@/page-subspecialty/views/modules/outpatientManagement/call'),
name: 'outpatientManagement',
meta: { title: '分诊管理', isTab: true }
},
// ok镜
{
path: '/patientInfo',
name: 'patientInfo',
meta: { title: '详情', isTab: true },
component: () => import('@/page-subspecialty/views/modules/optometryManagement/seeDoctor/index')
},
{
path: '/iframe',
component: null,
name: 'iframe',
meta: { title: 'iframe', isTab: true }
},
{
path: '/redirect',
name: 'redirect',
component: () => import('@/page-subspecialty/views/redirect')
}
]
}
export function addDynamicRoute(routeParams, router) {
// 组装路由名称, 并判断是否已添加, 如是: 则直接跳转
var routeName = routeParams.routeName
var dynamicRoute = window.SITE_CONFIG['dynamicRoutes'].filter(item => item.name === routeName)[0]
if (dynamicRoute) {
return router.push({ name: routeName, params: routeParams.params })
}
// 否则: 添加并全局变量保存, 再跳转
dynamicRoute = {
path: routeName,
component: () => Promise.resolve(require(`@/page-subspecialty/views/modules/${routeParams.path}`).default),
// component: () => import(`@/views/modules/${routeParams.path}`),
name: routeName,
meta: {
...window.SITE_CONFIG['contentTabDefault'],
menuId: routeParams.menuId,
title: `${routeParams.title}`
}
}
router.addRoutes([
{
...moduleRoutes,
name: `main-dynamic__${dynamicRoute.name}`,
children: [dynamicRoute]
}
])
window.SITE_CONFIG['dynamicRoutes'].push(dynamicRoute)
router.push({ name: dynamicRoute.name, params: routeParams.params })
}
const createRouter = () => new Router({
mode: 'history',
scrollBehavior: () => ({ y: 0 }),
routes: pageRoutes.concat(moduleRoutes)
})
const router = createRouter()
// [vue-router] Duplicate named routes definition 重复的命名路由定义
// 动态路由退出再登录会出现警告重复路由
// 解决方案:在退出时调用resetRouter()方法
export function resetRouter() {
const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router
}
router.beforeEach((to, from, next) => {
// 添加动态(菜单)路由
// 已添加或者当前路由为页面路由, 可直接访问
if (window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] || fnCurrentRouteIsPageRoute(to, pageRoutes)) {
return next()
}
if (to.path === from.path) {
return
}
if (to.name === 'login' || to.path === '/login' || to.path === 'satusScreen' || to.name === 'satusScreen') {
next()
} else {
// 获取字典列表, 添加并全局变量保存
// http.get('/sys/dict/type/all').then(({ data: res }) => {
// if (res.code !== 0) {
// return
// }
// window.SITE_CONFIG['dictList'] = res.data
// }).catch(() => {})
// 获取左侧菜单列表,添加并全局变量保存
http.get('/sys/menu/nav').then(({ data: res }) => {
if (res.code !== 0) {
Vue.prototype.$message.error(res.msg)
return next({ name: 'login' })
}
window.SITE_CONFIG['menuList'] = res.data
}).catch(() => {
return next({ name: 'login' })
})
// 获取菜单管理菜单列表,并添加动态路由
http.get('/sys/menu/list', {
params: {
type: 0
}
}).then(({ data: res }) => {
if (res.code !== 0) {
Vue.prototype.$message.error(res.msg)
return next({ name: 'login' })
}
// window.SITE_CONFIG['menuList'] = res.data
const menuListChild = res.data.filter(item => item.children.length > 0)
// console.log(menuListChild)
fnAddDynamicMenuRoutes(JSON.parse(JSON.stringify(res.data)), menuListChild.length)
next({ ...to, replace: true })
}).catch(() => {
// console.log(123)
return next({ name: 'login' })
})
// 获取【字段字典表】, 添加并全局变量保存
// http.get('/sys/table/dict/getList', { params: { type: 1 }}).then(({ data: res }) => {
// window.SITE_CONFIG['dict_colSearch'] = res.data
// })
getInitData()
}
})
function getInitData() {
// 获取字典列表, 添加并全局变量保存
// http.get('/sys/dict/type/all').then(({ data: res }) => {
// if (res.code !== 0) { return }
// window.SITE_CONFIG['dictList'] = res.data
// })
// 获取【字段字典表】, 添加并全局变量保存
// http.get('/table/dict/optionsColumn').then(({ data: res }) => {
// window.SITE_CONFIG['dict_colAll'] = res.data
// })
//
// // 获取【字段字典表】, 添加并全局变量保存
// http.get('/table/dict/optionsColumn', { params: { type: 1 }}).then(({ data: res }) => {
// window.SITE_CONFIG['dict_colSearch'] = res.data
// })
//
// // 获取【字段字典表】, 添加并全局变量保存
// http.get('/table/dict/optionsColumn', { params: { type: 2 }}).then(({ data: res }) => {
// window.SITE_CONFIG['dict_colChart'] = res.data
// })
//
// // 获取【字段字典表】, 添加并全局变量保存
// http.get('/table/dict/optionsColumn', { params: { type: 3 }}).then(({ data: res }) => {
// window.SITE_CONFIG['dict_colCrf'] = res.data
// })
//
// // 获取【字段字典表】, 添加并全局变量保存
// http.get('/table/dict/optionsColumn', { params: { type: 4 }}).then(({ data: res }) => {
// window.SITE_CONFIG['dict_colExport'] = res.data
// })
// 获取【检查项目字典】, 添加并全局变量保存
// http.get('/table/dict/examItem').then(({ data: res }) => {
// sortChinese(res.data, 'itemName')
// window.SITE_CONFIG['dict_examItem'] = res.data
// })
// 获取【设备信息字典】, 添加并全局变量保存
// http.get('/device/getData2RelDeviceList').then(({ data: res }) => {
// window.SITE_CONFIG['dict_device'] = res.data
// })
// 获取【设备与检查项目字典】, 添加并全局变量保存
// http.get('/device/getData2RelDeviceItemList').then(({ data: res }) => {
// window.SITE_CONFIG['dict_device_item'] = res.data
// })
}
/**
* 判断当前路由是否为页面路由
* @param {*} route 当前路由
* @param {*} pageRoutes 页面路由
*/
function fnCurrentRouteIsPageRoute(route, pageRoutes = []) {
var temp = []
for (var i = 0; i < pageRoutes.length; i++) {
if (route.path === pageRoutes[i].path) {
return true
}
if (pageRoutes[i].children && pageRoutes[i].children.length >= 1) {
temp = temp.concat(pageRoutes[i].children)
}
}
return temp.length >= 1 ? fnCurrentRouteIsPageRoute(route, temp) : false
}
/**
* 添加动态(菜单)路由
* PH自上而下遍历累积平铺
* @param {*} menuList 菜单列表
* @param {*} routes 递归创建的动态(菜单)路由
*/
function fnAddDynamicMenuRoutes(menuList = [], menuListChildLength, routes = []) {
let index = 0
// console.log(menuList)
menuList.forEach((item, i) => {
// eslint-disable-next-line
let URL = (item.url || '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量
item['meta'] = {
...window.SITE_CONFIG['contentTabDefault'],
menuId: item.id,
title: item.name
}
if (isURL(URL)) {
item['path'] = item['name'] = `i-${item.id}`
item['meta'].push({
iframeURL: URL
})
} else {
// console.log(URL)
URL = URL.replace(/^\//, '').replace(/_/g, '-')
item['path'] = '/' + URL.replace(/\//g, '-')
item['name'] = URL.replace(/\//g, '-')
// 坑!!!父级也必须要有component,父级要有自己的vue组件,父级路由必须有<router-view />占位符
// 其孩子children才能展示出来,孩子展示在父级占位符的地方
URL.includes('seeDoctor') ? URL = 'seeDoctor' : '' // 不同父级有相同子级seeDoctor,防止面包屑冲突,动态路由名字区分设置为seeDoctor、seeDoctorOne,在寻找组件时替换回seeDoctor,可以找到对应组件路径
item['component'] = () => Promise.resolve(require(`@/page-subspecialty/views/modules/${URL}`).default)
// 如果是父级给父级添加重定向到子菜单第一项
if (item.children.length > 0 && item.children[0].url) {
// console.log(item)
// isShow:0显示不菜单 1显示菜单
item.children[0].isShow === 0 ? '' : item['redirect'] = '/' + item.children[0].url.replace(/\//g, '-')
}
}
if (item.children.length > 0) {
index++
fnAddDynamicMenuRoutes(item.children)
}
})
// routes = menuList
// console.log(routes)
// 此处一定要加判断,因为此方法在递归,要等到递归完成后再执行下面的内容
// 坑!!!如果不加此判断,this.$route.matched面包屑的父级就不会展示
if (menuListChildLength === index) {
routes = menuList
// PH:底层调用一次
// 添加路由
router.addRoutes([
{
...moduleRoutes,
name: 'main-dynamic-menu',
children: [...routes]
},
{ path: '*', redirect: { name: '404' }}
])
// console.log('----------------------')
window.SITE_CONFIG['dynamicMenuRoutes'] = routes
window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] = true
}
}
export default router

Loading…
Cancel
Save