Commit d44afc63 authored by xingling's avatar xingling

修改3

parent 0dd76674
Pipeline #21 canceled with stages
# For more information about the properties used in
# this file, please see the EditorConfig documentation:
# http://editorconfig.org/
root = true # 告诉EditorConfig插件,这是根文件,不用继续往上查找
[*] # 匹配全部文件
charset = utf-8 # 设置字符集
end_of_line = lf # 结尾换行符,可选"lf"、"cr"、"crlf"
indent_size = 2 # 缩进的空格数
indent_style = space # 缩进风格,可选"space"、"tab"
insert_final_newline = true # 是否使文件以一个空白行结尾
trim_trailing_whitespace = true # 是否将行尾空格自动删除
[*.md] # 匹配md结尾的文件
trim_trailing_whitespace = false
[*.{groovy, java, kt, xml}] # 以下匹配,类同
indent_style = tab
indent_size = 4
continuation_indent_size = 8
[{.travis.yml, package.json}] # 以下匹配,类同
# The indent size used in the `package.json` file cannot be changed
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
indent_size = 2
indent_style = space
!/*.js
/tests/**/*.js
!/**/.eslintrc.js
/dist/
/public/
**/node_modules/**
**/mock/**
**/plugins/**
**/tests/**
\ No newline at end of file
/** npm i babel-eslint
*
rules: {
"规则名": [规则值, 规则配置]
}
"off"或者0 //关闭规则关闭
"warn"或者1 //在打开的规则作为警告(不影响退出代码)
"error"或者2 //把规则作为一个错误(退出代码触发时为1)
*/
module.exports = {
root: true,
env: {
browser: true,
es6: true,
mocha: true,
node: true,
},
globals: {
'JSONEditor': true,
},
extends: ['plugin:vue/recommended', 'eslint:recommended'],
rules: {
'no-constant-condition': ['error', { checkLoops: false }], // 支持while true
'vue/max-attributes-per-line': [// 强制每行的最大属性数
2,
{
singleline: 10, // 当开始标记在一行中时,每行的最大属性数。默认值为1
multiline: { // 当开始标记位于多行中时,每行的最大属性数。默认值为1
max: 1,
allowFirstLine: false,
},
},
],
'vue/singleline-html-element-content-newline': 'off', // 在单行元素的内容之前和之后需要换行
'vue/multiline-html-element-content-newline': 'off', // 在多行元素的内容之前和之后需要换行
'vue/name-property-casing': ['error', 'PascalCase'], // 在Vue组件中为name属性强制使用特定大小写 'PascalCase' 将name属性强制为Pascal大小写。
'vue/no-v-html': 'off', // 禁止使用v-html防止XSS攻击
'accessor-pairs': 2, // 在对象中使用getter/setter
'arrow-parens': ['error', 'as-needed'], // 箭头函数用小括号括起来 "as-needed" 当只有一个参数时允许省略参数
'arrow-spacing': [// =>的前/后括号
2,
{
before: true, // '=>'前要空格
after: true, // '=>'后要空格
},
],
'block-spacing': [2, 'always'], // 块代码与上下行要有强制执行一致的间距 'always'(默认)需要一个或多个空格
'brace-style': [// 大括号风格
2,
'1tbs', // (默认)强制执行一个真正的大括号风格
{
allowSingleLine: true, // (默认false)允许一个块打开和关闭括号在同一行上
},
],
'camelcase': [// 强制驼峰法命名
0,
{
properties: 'always', // (默认)为属性名称强制执行camelcase 样式 当 'never' 时不检查属性名称
},
],
'comma-dangle': ['error', 'always-multiline'], // 对象字面量项尾不能有逗号 'always-multiline':需要尾随逗号时的最后一个元素或属性是一个不同的线比所述封闭]或}和不允许尾随逗号时的最后一个元素或属性是基于相同行的闭合]或}
'comma-spacing': [// 逗号前后的空格
2,
{
before: false, // (默认)在逗号前不允许有空格
after: true, // (默认)在逗号后需要一个或多个空格
},
],
'comma-style': [2, 'last'], // 逗号风格,换行时在行首还是行尾 'last':(默认)在数组元素,对象属性或变量声明的同一行之后和同一行都需要逗号
'constructor-super': 2, // 非派生类不能调用super,派生类必须调用super
'curly': [2, 'multi-line'], // 必须使用 if(){} 中的{}
'dot-location': [2, 'property'], // 对象访问符的位置,换行的时候在行首还是行尾
'eol-last': 2, // 文件以单一的换行符结束
'eqeqeq': ['error', 'always', { null: 'ignore' }], // 必须使用全等 'always':选项(默认)强制使用===和!==在任何情况下 { null: 'ignore' }- 不要将此规则应用于null。
'generator-star-spacing': [// 生成器函数*的前后空格
2,
{
before: true, // 强制关键字*和function关键字之间的间距。如果是true,则需要空间,否则空间不允许。在对象字面速记方法中*,由于它们缺少function关键字,因此未检查之前的间距。
after: true, // 强制*和函数名称(或匿名生成器函数的左括号)之间的空格。如果是true,则需要空间,否则空间不允许。
},
],
'handle-callback-err': [2, '^(err|error)$'], // nodejs 处理错误 '^(err|error)$':则该规则会报告参数名称可能出现的未处理错误err,error或anySpecificError
indent: [// 缩进风格
2,
2,
{
SwitchCase: 1, // (默认:0)指定 switch-case 语句的缩进级别
},
],
'jsx-quotes': [2, 'prefer-single'], // 'prefer-single':对所有不包含单引号的JSX属性值强制使用单引号。
'key-spacing': [// key值前面是否要有空格
2,
{
beforeColon: false, // (默认值)不允许在对象文字中的键和冒号之间使用空格。
afterColon: true, // 在对象文字中至少需要一个键和冒号之间的空格。
},
],
'keyword-spacing': [// 强制执行围绕关键字和关键字标记的一致空格
2,
{
before: true, // (默认)在关键字之前至少需要一个空格
after: true, // (默认)在关键字后至少需要一个空格
},
],
'new-cap': [// 函数名首行大写必须使用new方式调用,首行小写必须用不带new方式调用
2,
{
newIsCap: true, // (默认)要求new使用大写启动函数调用所有操作符。
capIsNew: false, // (默认)要求所有大写启动的函数与new操作符一起调用。
},
],
'new-parens': 2, // 在使用new关键字调用不带参数的构造函数时需要括号,以便提高代码清晰度。
'no-array-constructor': 2, // 禁止使用数组构造器
'no-caller': 2, // 禁止使用arguments.caller或arguments.callee
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', // 禁止使用console
'no-class-assign': 2, // 禁止修改const声明的变量
'no-cond-assign': 2, // 禁止在条件表达式中使用赋值语句
'no-const-assign': 2, // 禁止修改const声明的变量
'no-control-regex': 0, // 禁止在正则表达式中使用控制字符
'no-delete-var': 2, // 不能对var声明的变量使用delete操作符
'no-dupe-args': 2, // 函数参数不能重复
'no-dupe-class-members': 2, // 标记在级别成员中使用重复名称。
'no-dupe-keys': 2, // 在创建对象字面量时不允许键重复 {a:1,a:1}
'no-duplicate-case': 2, // switch中的case标签不能重复
'no-empty-character-class': 2, // 正则表达式中的[]内容不能为空
'no-empty-pattern': 2, // 不允许空块语句。 该规则忽略包含注释的块语句(例如,在一个空catch或最后一个try语句块中,以指示无论错误如何,执行都应该继续)。
'no-eval': 2, // 禁止使用eval
'no-ex-assign': 2, // 禁止给catch语句中的异常参数赋值
'no-extend-native': 2, // 禁止扩展native对象
'no-extra-bind': 2, // 禁止不必要的函数绑定
'no-extra-boolean-cast': 2, // 禁止不必要的bool转换
'no-extra-parens': [2, 'functions'], // 禁止非必要的括号
'no-fallthrough': 2, // 禁止switch穿透
'no-floating-decimal': 2, // 禁止省略浮点数中的0 .5 3.
'no-func-assign': 2, // 禁止重复的函数声明
'no-implied-eval': 2, // 禁止使用隐式eval
'no-inner-declarations': [2, 'functions'], // 禁止在块语句中使用声明(变量或函数)
'no-invalid-regexp': 2, // 禁止无效的正则表达式
'no-irregular-whitespace': 2, // 不能有不规则的空格
'no-iterator': 2, // 禁止使用__iterator__ 属性
'no-label-var': 2, // label名不能与var声明的变量名相同
'no-labels': [// 禁止标签声明
2,
{
allowLoop: false, // (boolean,默认是false) - 如果设置了此选项true,则此规则将忽略粘贴到循环语句的标签
allowSwitch: false, // (boolean,默认是false) - 如果设置了此选项true,则此规则将忽略粘贴到开关语句的标签。
},
],
'no-lone-blocks': 2, // 禁止不必要的嵌套块
'no-mixed-spaces-and-tabs': 2, // 禁止混用tab和空格
'no-multi-spaces': 2, // 不能用多余的空格
'no-multi-str': 2, // 字符串不能用\换行
'no-multiple-empty-lines': [// 空行最多不能超过1行
2,
{
max: 1,
},
],
'no-native-reassign': 2, // 不能重写native对象
'no-negated-in-lhs': 2, // in 操作符的左边不能有!
'no-new-object': 2, // 禁止使用new Object()
'no-new-require': 2, // 禁止使用new require
'no-new-symbol': 2, // 防止Symbol与new操作员的意外呼叫。
'no-new-wrappers': 2, // 禁止使用new创建包装实例,new String new Boolean new Number
'no-obj-calls': 2, // 不能调用内置的全局对象,比如Math() JSON()
'no-octal': 2, // 禁止使用八进制数字
'no-octal-escape': 2, // 禁止使用八进制转义序列
'no-path-concat': 2, // node中不能使用__dirname或__filename做路径拼接
'no-proto': 2, // 禁止使用__proto__属性
'no-redeclare': 2, // 禁止重复声明变量
'no-regex-spaces': 2, // 禁止在正则表达式字面量中使用多个空格 /foo bar/
'no-return-assign': [2, 'except-parens'], // return 语句中不能有赋值表达式 'except-parens':(默认):除非用圆括号括起来,否则不允许赋值。
'no-self-assign': 2, // 消除自我分配。
'no-self-compare': 2, // 不能比较自身
'no-sequences': 2, // 禁止使用逗号运算符
'no-shadow-restricted-names': 2, // 严格模式中规定的限制标识符不能作为声明时的变量名使用
'no-spaced-func': 2, // 函数调用时 函数名与()之间不能有空格
'no-sparse-arrays': 2, // 禁止稀疏数组, [1,,2]
'no-this-before-super': 2, // 在调用super()之前不能使用this或super
'no-throw-literal': 2, // 禁止抛出字面量错误 throw "error";
'no-trailing-spaces': 2, // 一行结束后面不要有空格
'no-undef': 2, // 不能有未定义的变量
'no-undef-init': 2, // 变量初始化时不能直接给它赋值为undefined
'no-unexpected-multiline': 2, // 避免多行表达式
'no-unmodified-loop-condition': 2, // 查找循环条件内的引用,然后检查这些引用的变量是否在循环中被修改。
'no-unneeded-ternary': [// 禁止不必要的嵌套 var isYes = answer === 1 ? true : false;
2,
{
defaultAssignment: false, // 不允许将条件表达式作为默认的分配模式
},
],
'no-unreachable': 2, // 不能有无法执行的代码
'no-unsafe-finally': 2, // 不允许return,throw,break,和continue里面的语句finally块。它允许间接使用,如in function或class定义。
'no-unused-vars': [// 消除未使用的变量,函数和函数的参数。
2,
{
vars: 'all', // 检查所有变量的使用情况,包括全局范围内的变量。这是默认设置。
args: 'none', // 参数不检查
},
],
'no-useless-call': 2, // 禁止不必要的call和apply
'no-useless-computed-key': 2, // 禁止不必要地使用计算属性键。
'no-useless-constructor': 2, // 可以在不改变类的工作方式的情况下安全地移除的类构造函数。
'no-useless-escape': 0, // 转义字符串,模板文字和正则表达式中的非特殊字符不会产生任何影响
'no-whitespace-before-property': 2, // 如果对象的属性位于同一行上,则该规则不允许围绕点或在开头括号之前留出空白。当对象和属性位于不同的行上时,此规则允许使用空格,因为向更长的属性链添加换行符是很常见的
'no-with': 2, // 禁用with
'one-var': [// 连续声明
2,
{
initialized: 'never', // 每个作用域需要多个变量声明用于初始化变量
},
],
'operator-linebreak': [// 换行时运算符在行尾还是行首
2,
'after', // 需要将换行符置于操作员之后
{
overrides: { // 覆盖用于指定operatorsThe默认配置的全局设置是 "after", { "overrides": { "?": "before", ":": "before" } }的afterExamples 不正确代码此规则与默认"after"选项
'?': 'before',
':': 'before',
},
},
],
'padded-blocks': [2, 'never'], // 块语句内行首行尾是否要空行
quotes: [// 引号类型 `` "" ''
2,
'single',
{
avoidEscape: true,
allowTemplateLiterals: true,
},
],
semi: [2, 'never'], // 语句强制分号结尾
'semi-spacing': [// 分号前后空格
2,
{
before: false, // 前不需要
after: true, // 后需要
},
],
'space-before-blocks': [2, 'always'], // 不以新行开始的块{前面要不要有空格
'space-before-function-paren': ['error', 'always'], // 函数定义时括号前面要不要有空格
'space-in-parens': [2, 'never'], // 小括号里面要不要有空格
'space-infix-ops': 2, // 中缀操作符周围要不要有空格
'space-unary-ops': [// 一元运算符的前/后要不要加空格
2,
{
words: true, // 适用于一元字运营商,如:new,delete,typeof,void,yield
nonwords: false, // 适用于一元运算符,如:-,+,--,++,!,!!
},
],
'spaced-comment': [// 注释风格要不要有空格什么的
2,
'always', // 要有空格
{
markers: ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','],
},
],
'template-curly-spacing': [2, 'never'], // 保持模板文字内部空间的一致性。 'never':(默认情况下) - 不允许大括号内的空格。
'use-isnan': 2, // 禁止比较时使用NaN,只能用isNaN()
'valid-typeof': 2, // 必须使用合法的typeof的值
'wrap-iife': [2, 'any'], // 立即执行函数表达式的小括号风格
'yield-star-spacing': [2, 'both'], // 强制执行*周围 yield*表达式的间距。 'both':yield和*之间的空格需要空间 *和参数之间的间距需要空间
yoda: [2, 'never'], // 禁止尤达条件
'prefer-const': 2, // 首选const
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, // 用于通知执行的 JavaScript 环境停止执行,并在代码中的当前位置启动调试器。随着现代调试和开发工具的出现,这已经失宠。生产代码绝对不应该包含debugger,因为它会导致浏览器停止执行代码并打开适当的调试器。
'object-curly-spacing': [// 大括号内是否允许不必要的空格
2,
'always', // 需要大括号内的空格({}除外)
{
objectsInObjects: false, // 要求在以对象元素开头和/或以对象元素结尾的对象的大括号内部进行间隔(在第一个选项设置为never时应用)
},
],
'array-bracket-spacing': [2, 'never'], // 是否允许非空数组里面有多余的空格
'vue/script-indent': [// 类似于核心缩进规则,但是它在<script>标签内部有一个选项。
'error',
2,
{
baseIndent: 1, // 顶级语句的缩进乘数。默认值为0
switchCase: 1, // case/ default子句的缩进倍数。默认值为0
},
],
'vue/this-in-template': 'off', // 防止this在Vue模板中使用。
'vue/require-default-prop': 'off',
'vue/html-self-closing': [// 将自动闭合符号强制为已配置的样式
'error',
{
'html': {
'void': 'always', // HTML void元素的样式在没有内容的元素上自动关闭。
'normal': 'never', // HTML元素的样式禁止自动关闭。
'component': 'never', // Vue.js自定义组件的样式禁止自动关闭。
},
},
],
'vue/component-name-in-template-casing': [// 警告除Vue.js模板中配置的大小写以外的标签名称
'error',
'kebab-case', // 将标签名称强制为kebab大小写:例如<cool-component>。这与最初不区分大小写的HTML惯例是一致的。
],
'vue/mustache-interpolation-spacing': ['error', 'always'], // 插值中强制执行统一间距 'always':在表达式和大括号之间应留一个空格。
'vue/order-in-components': ['error'], // 保持组件中属性的声明顺序
'vue/attribute-hyphenation': [// 在Vue模板的自定义组件上使用连字符属性名称
2,
'always',
{
ignore: ['maxLength', 'readOnly'],
},
],
'vue/html-indent': [// 强制采用一致的缩进样式<template>。默认样式为2个空格。
1,
2,
{
ignores: [// 忽略节点的选择器
'VElement[name=thead].children',
'VElement[name=tbody].children',
'VElement[name=tfoot].children',
],
},
],
},
overrides: [
{
files: ['*.vue'],
rules: {
indent: 'off',
},
},
],
parserOptions: {
parser: 'babel-eslint',
},
}
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<script>
document.write(
'<script src="./js/config.js?t=' + new Date().getTime() + '"><\/script>'
);
</script>
</head>
<style>
html,body{
height: 100%;
margin: 0;
padding: 0;
}
</style>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
if (!window["PORRAL"]) window["PORRAL"] = {}
// 菜单配置
window.PORRAL['MENU'] = [
{
name: '项目概况',
directoryType: '1',
tableData: [
{
lable: '项目名称',
content: '国产多源遥感数据组织与应用关键技术研究及应用示范',
isProName: true,
systemName: '卫星应用助力数字福建原型系统',
}, {
lable: '项目类别',
content: '重大项目',
}, {
lable: '主持单位',
content: '福州大学数字中国研究院(福建)',
}, {
lable: '参研单位',
content: '中科空间信息(廊坊)研究院、航天恒星科技有限公司、福建省星云大数据应用服务有限公司、长威信息科技发展股份有限公司、福州市电子信息集团有限公司、福州福大经纬信息科技有限公司',
}, {
lable: '研究周期',
content: '2019.01-2021.12',
}, {
lable: '研究经费',
content: '6000万元(国拨1500+自筹450万)',
},
]
}, {
name: '总体设计',
directoryType: '1',
tableData: [
{
lable: '项目名称',
content: '国产多源遥感数据组织与应用关键技术研究及应用示范',
isProName: true,
systemName: '卫星应用助力数字福建原型系统',
}, {
lable: '项目类别',
content: '重大项目',
}, {
lable: '主持单位',
content: '福州大学数字中国研究院(福建)',
}, {
lable: '参研单位',
content: '中科空间信息(廊坊)研究院、航天恒星科技有限公司、福建省星云大数据应用服务有限公司、长威信息科技发展股份有限公司、福州市电子信息集团有限公司、福州福大经纬信息科技有限公司',
}, {
lable: '研究周期',
content: '2019.01-2021.12',
}, {
lable: '研究经费',
content: '6000万元(国拨1500+自筹450万)',
},
]
}
]
// 接口请求配置路径http://193.100.100.64:8080/gfkgServer
// window.PORRAL['baseUrl'] = 'http://193.100.100.64:8080/gfkgServer/'
// window.PORRAL['baseUrl'] = 'http://192.168.0.116:8098/htsns'
window.PORRAL['baseUrl'] = '/htsns'
<template>
<div id="app">
<router-view></router-view>
</div>
</template>
<style lang="scss">
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
min-width: 1024px;
min-height: 100%;
box-sizing: border-box;
background-repeat: no-repeat;
background-size: cover;
-webkit-background-size: cover;
-o-background-size: cover;
}
html, body {
height: 100%;
width: 100%;
}
ul {
list-style: none;
margin: 0px;
padding: 0;
}
</style>
export default [
{
'id': '0',
'name': '一级目录',
'createTime': null,
'updateTime': null,
'userId': null,
'parentId': 'root',
'imageUrl': null,
'url': null,
'children': [
{
'id': '2416b172-5873-4ba7-9523-deb124cac1d5',
'name': '海洋生态与环境监测卫星示范应用',
'createTime': '2020-11-26 18:01:12',
'updateTime': '2020-11-26 18:01:12',
'userId': '1',
'parentId': '0',
'imageUrl': null,
'url': 'undefined',
'children': [
{
'id': '2dd29b50-4b85-4963-9dc1-6e5b05459e0a',
'name': '海洋突然事件支援平台',
'createTime': '2020-11-26 18:02:47',
'updateTime': '2020-11-26 18:02:47',
'userId': '1',
'parentId': '2416b172-5873-4ba7-9523-deb124cac1d5',
'imageUrl': null,
'url': 'undefined',
'children': [
{
'id': '91082ab8-8aae-43c3-9b6e-842285d9c550',
'name': '多源卫星综合展示系统',
'createTime': '2020-11-26 18:04:46',
'updateTime': '2020-11-26 18:04:46',
'userId': '1',
'parentId': '2dd29b50-4b85-4963-9dc1-6e5b05459e0a',
'imageUrl': '/fileUpload/91082ab8-8aae-43c3-9b6e-842285d9c550/QQ图片20201126180431.png',
'url': 'http://www.baidu.com499999',
'children': [
],
'label': '多源卫星综合展示系统',
'type': '1',
'parentName': null,
},
],
'label': '海洋突然事件支援平台',
'type': '2',
'parentName': '',
},
],
'label': '海洋生态与环境监测卫星示范应用',
'type': '2',
'parentName': null,
},
{
'id': '37af92e8-287f-4701-9498-159440873681',
'name': '防灾减灾与应急救援卫星示范应用',
'createTime': '2020-11-26 18:02:26',
'updateTime': '2020-11-26 18:02:26',
'userId': '1',
'parentId': '0',
'imageUrl': null,
'url': 'undefined',
'children': [
],
'label': '防灾减灾与应急救援卫星示范应用',
'type': '2',
'parentName': null,
},
{
'id': 'b632ceac-da1a-496a-a8f5-e865c0c4036e',
'name': '清新福建卫星示范应用',
'createTime': '2020-11-26 18:01:33',
'updateTime': '2020-11-26 18:01:33',
'userId': '1',
'parentId': '0',
'imageUrl': null,
'url': 'undefined',
'children': [],
'label': '清新福建卫星示范应用',
'type': '2',
'parentName': null,
},
{
'id': '9487b7ea-3e68-41c5-9532-1ab2efe6169d',
'name': '美丽乡村卫星示范应用',
'createTime': '2020-11-26 18:01:49',
'updateTime': '2020-11-26 18:01:49',
'userId': '1',
'parentId': '0',
'imageUrl': null,
'url': 'undefined',
'children': [
],
'label': '美丽乡村卫星示范应用',
'type': '2',
'parentName': null,
},
],
'label': '一级目录',
'type': null,
'parentName': null,
},
]
<template>
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item class="crumb_home_icon" :to="{ path: '/home' }"></el-breadcrumb-item>
</el-breadcrumb>
</template>
<script>
export default {
data () {
return {
path: '',
}
},
}
</script>
<style scoped>
.el-breadcrumb{
width: calc(100% - 20px);
height: 40px;
background-color: #ffffff;
padding-left:20px;
}
.el-breadcrumb__item{
margin:11px 0;
display:inline-block;
}
.crumb_home_icon{
width:18px;
height:18px;
background:url(../assets/images/summary_hos_selected.png) no-repeat center center;
background-size:18px 18px;
}
</style>
import http from '@/http/httpRequest'
export const login = (loginForm) => {
return http({
url: http.adornUrl('/admin/service/loginTV'),
method: 'post',
params: {
sysUserJson:loginForm
}
})
}
export const getProjectList = () => {
return http({
url: http.adornUrl('/mgr/getProjectList'),
method: 'get'
})
}
// export function getPatientList() {
// return axios.get('/GetPatientList')
// }
// export function login() {
// return axios.get('/login')
// }
// import Vue from 'vue'
import axios from 'axios'
// import router from '@/router'
import qs from 'qs'
import merge from 'lodash/merge'
// 超时后重新请求
axios.defaults.retry = 2
axios.defaults.retryDelay = 1000
const http = axios.create({
timeout: 1000 * 30,
withCredentials: true,
headers: {
'Content-Type': 'application/json; charset=utf-8',
},
})
http.cancelToken = () => {
// var CancelToken =
// var source = CancelToken.source();
return axios.CancelToken
}
/**
* 请求拦截
*/
http.interceptors.request.use(
config => {
// config.headers['token'] = Vue.cookie.get('token') // 请求头带上token
config.headers['token'] = localStorage.getItem('token')
return config
},
error => {
return Promise.reject(error)
},
)
/**
* 响应拦截
*/
http.interceptors.response.use(
response => {
if (response.data && response.data.code === 401) {
// 401, token失效
// alert("登录失效,请重新登录!")
// router.push({
// name: 'login',
// })
}
return response
},
error => {
// return Promise.reject(error)
var config = error.config
if (!config || !config.retry) return Promise.reject(error)
config.__retryCount = config.__retryCount || 0
if (config.__retryCount >= config.retry) {
return Promise.reject(error)
}
config.__retryCount += 1
var backoff = new Promise(function (resolve) {
setTimeout(function () {
resolve()
}, config.retryDelay || 1)
})
// Return the promise in which recalls axios to retry the request
return backoff.then(function () {
return axios(config)
})
},
)
/**
* 请求地址处理
* @param {*} actionName action方法名称
*/
http.adornUrl = actionName => {
// 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截!
return (
(process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY
? '/proxyApi/'
: window.PORRAL.baseUrl) + actionName
)
}
/**
* get请求参数处理
* @param {*} params 参数对象
* @param {*} openDefultParams 是否开启默认参数?
*/
http.adornParams = (params = {}, openDefultParams = true) => {
var defaults = {
t: new Date().getTime(),
}
return openDefultParams ? merge(defaults, params) : params
}
/**
* post请求数据处理
* @param {*} data 数据对象
* @param {*} openDefultdata 是否开启默认数据?
* @param {*} contentType 数据格式
* json: 'application/json; charset=utf-8'
* form: 'application/x-www-form-urlencoded; charset=utf-8'
*/
http.adornData = (data = {}, openDefultdata = true, contentType = 'json') => {
var defaults = {
t: new Date().getTime(),
}
data = openDefultdata ? merge(defaults, data) : data
return contentType === 'json' ? JSON.stringify(data) : qs.stringify(data)
}
export default http
import axios from 'axios'
import store from '@/store/index.js'
import baseURL from './baseUrl'
import { Message } from 'element-ui'
const http = {}
var instance = axios.create({
timeout: 5000,
baseURL,
validateStatus(status) {
switch (status) {
case 400:
Message.error('请求出错')
break
case 401:
Message.warning({
message: '授权失败,请重新登录'
})
store.commit('LOGIN_OUT')
setTimeout(() => {
window.location.reload()
}, 1000)
return
case 403:
Message.warning({
message: '拒绝访问'
})
break
case 404:
Message.warning({
message: '请求错误,未找到该资源'
})
break
case 500:
Message.warning({
message: '服务端错误'
})
break
}
return status >= 200 && status < 300
}
})
// 添加请求拦截器
instance.interceptors.request.use(
function(config) {
// 请求头添加token
if (store.state.UserToken) {
config.headers.Authorization = `Bearer ${store.state.UserToken}`
}
return config
},
function(error) {
return Promise.reject(error)
}
)
// 响应拦截器即异常处理
instance.interceptors.response.use(
response => {
return response.data
},
err => {
if (err && err.response) {
} else {
err.message = '连接服务器失败'
}
// Message.error({
// message: err.message
// })
return Promise.reject(err.response)
}
)
http.get = function(url, options) {
let loading
if (!options || options.isShowLoading !== false) {
loading = document.getElementById('ajaxLoading')
loading.style.display = 'block'
}
return new Promise((resolve, reject) => {
instance
.get(url, options)
.then(response => {
if (!options || options.isShowLoading !== false) {
loading = document.getElementById('ajaxLoading')
loading.style.display = 'none'
}
if (response.code === 1) {
resolve(response.data)
} else {
Message.error({
message: response.msg
})
reject(response.msg)
}
})
.catch(e => {
console.log(e)
})
})
}
http.post = function(url, data, options) {
let loading
if (!options || options.isShowLoading !== false) {
loading = document.getElementById('ajaxLoading')
loading.style.display = 'block'
}
return new Promise((resolve, reject) => {
instance
.post(url, data, options)
.then(response => {
if (!options || options.isShowLoading !== false) {
loading = document.getElementById('ajaxLoading')
loading.style.display = 'none'
}
if (response.code === 1) {
resolve(response.data)
} else {
Message.error({
message: response.msg
})
reject(response.message)
}
})
.catch(e => {
console.log(e)
})
})
}
export default http
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import 'lib-flexible'
Vue.use(ElementUI);
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App),
}).$mount('#app')
import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/login.vue'
import Home from '../views/Home.vue'
Vue.use(VueRouter)
const routes = [{
path: '/',
name: 'Login',
component: Login,
},
{
path: '/home',
name: 'Home',
component: Home,
}
]
const router = new VueRouter({
routes,
})
export default router
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {},
mutations: {},
actions: {},
modules: {},
})
<template>
<el-container>
<el-header> <headerNav></headerNav> </el-header>
<el-container class="home_bd">
<el-aside class="home_left" width="15.23%"><leftAside></leftAside></el-aside>
<el-main class="home_container">
<breadcrumb></breadcrumb>
<middleContent class="home_concrete_content"></middleContent>
</el-main>
</el-container>
</el-container>
</template>
<script>
import headerNav from "./common/header";
import leftAside from "./common/left-aside";
import breadcrumb from "../component/breadcrumb";
import middleContent from "./middle/middle";
export default {
components: {
headerNav,
leftAside,
breadcrumb,
middleContent
},
data() {
const item = {
date: "2016-05-02",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄"
};
return {
form: {
name: "",
region: "",
date1: "",
date2: "",
delivery: false,
type: [],
resource: "",
desc: ""
},
tableData: Array(20).fill(item)
};
},
mounted() {
this.init();
},
methods: {
init() {},
onSubmit() {
console.log("submit!");
}
}
};
</script>
<style scoped>
*{
padding:0;
margin:0;
}
.home_container {
position: relative;
left: 15.23%;
background-color:#f0f3f8;
padding:0;
width:84.67%;
margin-left:0.1%;
flex:none;
}
.home_bd{
width:100%;
position: absolute;
top: 49px;
bottom: 0;
}
.home_left{
top:0;
}
.home_concrete_content{
width:100%;
height:calc(100% - 40px);
}
</style>
<template>
<el-container>
<el-header>
<el-row :gutter="0">
<el-col :xs="16" :sm="18" :md="20" :lg="21" :xl="22">
<div class="grid-content bg-purple logo_icon">
<img :src="require('../../assets/images/haitai_logo.png')" style="width:30px;height:26px;margin:10px 12px;" alt="logo" />
</div>
<div class="logo_name">智慧护理管理端</div>
</el-col>
<el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="2">
<div class="head_img"></div>
<span class="grid-content bg-purple user_info">{{ userCode }}</span>
</el-col>
</el-row>
</el-header>
</el-container>
</template>
<script>
import headImg from "../../assets/images/head_portrait.png";
export default {
data() {
console.log(localStorage);
return {
userCode: JSON.parse(localStorage.getItem("userInfo")).userCode
};
}
};
</script>
<style lang="scss">
.el-header {
background-color: #ffffff;
box-shadow: 0px 1px 4px 0px
rgba(0, 21, 41, 0.12);
color: #333;
line-height: 48px;
padding: 0 !important;
height:48px !important;
.el-row{
margin:0 !important;
}
.el-col{
padding: 0 !important;
}
}
.logo_icon {
text-align: left;
height: 48px;
width:54px;
display:inline-block;
float:left;
img {
width:30px;
height:26px;
margin:10px 12px;
}
}
.logo_name{
font-size: 16px;
line-height: 48px;
color: #262626;
opacity: 0.85;
display:inline-block;
float:left;
}
.user_info {
text-align: right;
}
.head_info {
text-align: right;
}
.head_img {
width: 24px;
height: 48px;
border-radius: 50%;
display: inline-block;
vertical-align: middle;
margin-right: 15px;
background:url(../../assets/images/head_portrait.png) no-repeat center;
background-size: 24px 24px;
}
</style>
<template>
<div class="left_menu" style="height: 100%">
<el-row class="tac" style="height: 100%">
<i class="expand_retract_icon retract"></i>
<el-col style="height: 100%;text-align:left;" >
<el-menu
default-active="1"
class="el-menu-vertical-demo"
background-color="#ffffff"
box-shadow="2px 0px 6px 0px rgba(0, 21, 41, 0.12)"
text-color="#000000"
active-text-color="#1890ff"
style="height: 100%;"
@open="handleOpen"
@close="handleClose"
>
<el-menu-item index="1">
<i class="el-icon summary_hospital"></i>
<span slot="title">首页全院汇总</span>
</el-menu-item>
<el-menu-item index="2">
<i class="el-icon depart_management "></i>
<span slot="title">科室管理</span>
</el-menu-item>
<el-menu-item index="3">
<i class="el-icon layout_config"></i>
<span slot="title">首页布局配置</span>
</el-menu-item>
<el-menu-item index="4">
<i class="el-icon project_config"></i>
<span>首页项目配置</span>
</el-menu-item>
<el-menu-item index="5">
<i class="el-icon equip_management"></i>
<span>设备管理</span>
</el-menu-item>
<el-menu-item index="6">
<i class="el-icon kettle_monitor"></i>
<span>Kettle监控</span>
</el-menu-item>
<el-menu-item index="7">
<i class="el-icon system_setting"></i>
<span>系统设置</span>
</el-menu-item>
<el-menu-item index="8">
<i class="el-icon personal_center"></i>
<span>个人中心</span>
</el-menu-item>
</el-menu>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
data() {
return {
};
},
methods: {
handleOpen(key, keyPath) {
console.log(key, keyPath);
},
handleClose(key, keyPath) {
console.log(key, keyPath);
}
}
}
</script>
<style>
.el-aside {
display: block;
position: absolute;
left: 0;
top: 60px;
bottom: 0;
}
.el-menu-item>span{
font-size: 14px;
opacity: 0.85;
}
.el-menu-item{
height:40px;
line-height:40px;
margin-top:8px;
padding-left: 13px !important;
}
.el-menu-item:first-child{
margin-top:20px;
}
.el-menu-item .el-icon{
display:inline-block;
width:19px;
height:40px;
margin-right:10px;
}
.el-menu-item.is-active{
background-color: #e6f7ff !important;
border-right: 2px solid #1890ff;
}
.el-icon.summary_hospital{
background:url(../../assets/images/summary_hos.png) no-repeat center center;
background-size:18px 18px;
}
.el-menu-item.is-active .el-icon.summary_hospital{
background:url(../../assets/images/summary_hos_selected.png) no-repeat center center;
background-size:18px 18px;
}
.el-icon.depart_management{
background:url(../../assets/images/depart_manage.png) no-repeat center center;
background-size:16px 15px;
}
.el-menu-item.is-active .el-icon.depart_management{
background:url(../../assets/images/depart_manage_selected.png) no-repeat center center;
background-size:18px 18px;
}
.el-icon.project_config{
background:url(../../assets/images/project_config.png) no-repeat center center;
background-size:18px 18px;
}
.el-menu-item.is-active .el-icon.project_config{
background:url(../../assets/images/project_config_selected.png) no-repeat center center;
background-size:18px 18px;
}
.el-icon.equip_management{
background:url(../../assets/images/equip_manage.png) no-repeat center center;
background-size:18px 18px;
}
.el-menu-item.is-active .el-icon.equip_management{
background:url(../../assets/images/equip_manage_selected.png) no-repeat center center;
background-size:18px 18px;
}
.el-icon.kettle_monitor{
background:url(../../assets/images/kettle_monitor.png) no-repeat center center;
background-size:14px 18px;
}
.el-menu-item.is-active .el-icon.kettle_monitor{
background:url(../../assets/images/kettle_monitor_selected.png) no-repeat center center;
background-size:18px 18px;
}
.el-icon.system_setting{
background:url(../../assets/images/system_setting.png) no-repeat center center;
background-size:16px 16px;
}
.el-menu-item.is-active .el-icon.system_setting{
background:url(../../assets/images/system_setting_selected.png) no-repeat center center;
background-size:18px 18px;
}
.el-icon.personal_center{
background:url(../../assets/images/personal_center.png) no-repeat center center;
background-size:18px 18px;
}
.el-menu-item.is-active .el-icon.personal_center{
background:url(../../assets/images/personal_center_selected.png) no-repeat center center;
background-size:18px 18px;
}
.expand_retract_icon{
display:inline-block;
width: 16px;
height: 42px;
background-color: rgba(0, 0, 0, 0.09);
border-radius: 4px 0px 0px 4px;
position:absolute;
right:0;
z-index:9;
top:calc(50% - 21px);
}
.expand_retract_icon.expand{
background:url(../../assets/images/expand.png) no-repeat center center;
background-size:16px 42px;
}
.expand_retract_icon.retract{
background:url(../../assets/images/retract.png) no-repeat center center;
background-size:16px 42px;
}
</style>
<template>
<header class="nav">
<div class="logo">
<h3 class="systemName textColor">卫星应用助力数字福建原型系统</h3>
</div>
<span class="newDate textColor">{{ newDate }}</span>
</header>
</template>
<script>
export default {
data () {
return {
newDate: '',
timer: '',
}
},
mounted () {
this.timer = setInterval(() => {
this.newTime()
}, 1000)
},
beforeDestroy () {
if (this.timer) {
// 在Vue实例销毁前,清除定时器
clearInterval(this.timer)
}
},
methods: {
// 获取当前时间
newTime () {
// 获取年月日
var time = new Date()
var year = time.getFullYear()
var month = time.getMonth()
var day = time.getDate()
// 获取时分秒
var h = time.getHours()
var m = time.getMinutes()
var s = time.getSeconds()
// 检查是否小于10
h = this.check(h)
m = this.check(m)
s = this.check(s)
this.newDate =
year + ':' + month + ':' + day + ' ' + h + ':' + m + ':' + s
},
// 检查时间是不是小于10
check (i) {
var num
i < 10 ? (num = '0' + i) : (num = i)
return num
},
},
}
</script>
<style lang="scss" scoped>
.nav {
height: 100px;
width: 100%;
background-color: rgba(0, 0, 0, 0.4);
position: fixed;
top:0;
z-index: 20;
-webkit-transition: all .2s ease;
transition: all .2s ease;
background: -webkit-gradient(linear,left top,left bottom,from(rgba(25,54,148,.1)),to(rgba(25,54,148,.8)));
background: linear-gradient(180deg,rgba(25,54,148,.1),rgba(25,54,148,.8));
.logo{
background: url(../../assets/images/logo-bg.png) no-repeat;
width: 1044px;
height: 121px;
position: absolute;
left: 50%;
-webkit-transform: translateX(-50%);
-moz-transform: translateX(-50%);
transform: translateX(-50%);
}
.systemName {
font-size: 43px;
color: #fff;
line-height: 74px;
margin: 0;
}
.textColor{
background: -webkit-gradient(linear,left top,left bottom,from(#c2edff),color-stop(50%,#4bc5fe),to(#00a8ff));
background: linear-gradient(180deg,#c2edff 0,#4bc5fe 50%,#00a8ff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.newDate {
color: #fff;
position: absolute;
right: 10px;
bottom: 20px;
}
}
.nav:after {
content: "";
height: 0;
line-height: 0;
display: block;
visibility: hidden;
clear: both;
}
</style>
<template>
<div class="login_contain">
<div class="login_back">
<div class="left_top"></div>
<div class="left_center_top"></div>
<div class="left_bottom"></div>
<div class="right_top"></div>
<div class="right_center_lef"></div>
<div class="right_center_rig"></div>
<div class="right_center"></div>
<div class="right_hospital"></div>
<div class="right_bottom"></div>
<div class="right_nurse"></div>
</div>
<div class="form_box">
<div class="login_span">欢迎登录</div>
<div class="login_box">
<el-form class="login-form" :model="loginForm" label-position="left">
<div class="login_user">
<div class="login_info">用户名</div>
<div>
<input
v-model="loginForm.userCode"
type="text"
class="login_inp"
/>
</div>
</div>
<div class="login_pwd">
<div class="login_info">密码</div>
<div>
<input
v-model="loginForm.pwd"
type="password"
class="login_inp"
/>
</div>
</div>
<el-button type="primary" class="login_btn" @click="getLogin"
>登录</el-button
>
</el-form>
</div>
<div class="version_info">
<span>V1.18.10.0</span><br />
<span>版权所有©南京海泰医疗信息系统有限公司</span>
</div>
</div>
</div>
</template>
<script>
import { login } from "../http/api";
export default {
name: "Login",
data() {
return {
loginForm: {
userCode: "",
pwd: ""
}
};
},
methods: {
getLogin() {
this.$router.push({ path: "/home" });
login(this.loginForm).then(res => {
console.log(res);
if (res.data.statusCode === 1) {
localStorage.setItem("token", res.data.data.token);
localStorage.setItem(
"userInfo",
JSON.stringify(res.data.data.userInfo)
);
// this.$router.push({ path: "/home" });
} else {
this.$message.error(res.data.message);
}
});
}
}
};
</script>
<style lang="scss" scoped>
.login_back {
background-color: #f4f8ff;
width: 100%;
min-height: calc(100vh);
min-height: -moz-calc(100vh);
min-height: -webkit-calc(100vh);
position: relative;
div {
position: absolute;
}
}
.left_top {
left: 0;
top: 0;
width: 9.11%;
height: 41.94%;
background: url(../assets/images/login_left_top.png) no-repeat;
background-size: 100%;
}
.left_center_top {
top: 50px;
left: 14.6%;
width: 31.25%;
height: 13.05%;
text-align: center;
background: url(../assets/images/login_htsns.png) no-repeat;
background-size: 100%;
}
.left_bottom {
left: 4.8%;
bottom: 70px;
width: 8.125%;
height: 14.44%;
background: url(../assets/images/login_needle.png) no-repeat;
background-size: 100%;
}
.right_center_lef {
left: calc(11.7% + 38.7% + 20px);
top: 170px;
width: 6.125%;
height: 11%;
background: url(../assets/images/login_stethoscope.png) no-repeat;
background-size: 100%;
}
.right_center_rig {
left: calc(11.7% + 38.7% + 36.7% - 9%);
top: 170px;
width: 6.37%;
height: 11%;
background: url(../assets/images/login_appoint.png) no-repeat;
background-size: 100%;
}
.right_center {
left: calc(11.7% + 38.7% + 10px);
top: 210px;
width: 36.7%;
height: 41.9%;
background: url(../assets/images/login_right_center.png) no-repeat;
background-size: 100%;
}
.right_top {
top: 0;
right: 0;
width: 10%;
height: 21.67%;
background: url(../assets/images/login_right_top.png) no-repeat;
background-size: 100%;
}
.right_bottom {
right: 0;
bottom: 0;
width: 10.78%;
height: 23.33%;
background: url(../assets/images/login_right_bottom.png) no-repeat bottom;
background-size: 100%;
}
.right_hospital {
left: calc(11.7% + 38.7% + 20px);
bottom: 0;
width: 10.8%;
height: 19.27%;
background: url(../assets/images/login_hospital.png) no-repeat bottom;
background-size: 100%;
}
.right_nurse {
right: 4%;
bottom: 100px;
width: 12.656%;
height: 51.11%;
background: url(../assets/images/login_nurse.png) no-repeat;
background-size: 100%;
}
.login_span {
position: absolute;
left: 11.7%;
width: 38.7%;
top: 120px;
text-align: center;
font-size: 32px;
}
.login_box {
width: 38.7%;
height: 58.5%;
position: absolute;
left: 11.7%;
top: 200px;
border-radius: 20px;
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.16);
padding: 5.12% 0;
box-sizing: border-box;
background-color: #fff;
}
.login_pwd {
margin-top: 6.67%;
}
.login_info {
width: 60%;
text-align: left;
color: #666;
margin: 0 auto;
}
.login_inp {
border: none;
outline: none;
caret-color: #147bfa;
border-bottom: 1px solid #ccc;
height: 40px;
width: 60%;
font-size: 16px;
color: #333;
}
.login_inp:focus {
border-bottom: 1px solid #147bfa;
}
.login_btn {
width: 60%;
margin-top: 11%;
height: 50px;
font-size: 18px;
}
.version_info {
position: absolute;
left: 11.7%;
width: 38.7%;
bottom: 80px;
color: #ccc;
line-height: 28px;
font-size: 16px;
}
@media screen and (max-width: 1024px) {
.login_box {
height: 43.8%;
}
.login_btn {
height: 40px;
font-size: 16px;
}
}
</style>
<template>
<div class="home_hospital_summary">
<div class="home_summary_top">
<el-row :gutter="0">
<el-col :xs="11" :sm="13" :md="14" :lg="15" :xl="16">
<i class="header_icon"></i>
<div class="greeting_message_time">
<div class="greeting_info">您好,admin ,祝你开心每一天!</div>
<div class="last_update_time">数据更新时间:2021年5月19日 15:30</div>
</div>
</el-col>
<el-col :xs="13" :sm="11" :md="10" :lg="9" :xl="8">
</el-col>
</el-row>
</div>
</div>
</template>
<script>
export default {
}
</script>
<style lang="scss" scoped>
.home_hospital_summary{
width:100%;
height:auto;
}
.home_summary_top{
width:100%;
height:108px;
background-color: #ffffff;
}
</style>
<template>
<div class="menuItem" :class="location==='left'?'backImg1':'backImg2'" @click="openContent(item)">
<h3 class="name">{{ item.name }}</h3>
</div>
</template>
<script>
export default {
props: {
// 父组件遍历出来的item
item: {
type: Object,
default () {
return {}
},
},
location: {
type: String,
default () {
return 'left'
},
},
},
data () {
return {}
},
methods: {
openContent (info) {
this.$emit('chile-event', info)
},
},
}
</script>
<style lang="scss" scoped>
.menuItem {
// margin: 10px auto;
min-height: 80px;
width: 200px;
cursor: pointer;
padding: 10px 0;
box-sizing: border-box;
position: relative;
text-align: center;
.name {
text-align: center;
// display: inline-block;
position: absolute;
margin: 0;
width: 90%;
box-sizing: border-box;
padding-left: 20px;
font-size: 20px;
font-weight: 700;
color: #aec9ff;
top: 50%;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
transform: translateY(-50%);
}
a{
text-decoration: none;
color: white;
}
}
.backImg1{
background: url("../../assets/images/nav-leftbg.png") no-repeat;
}
.backImg2{
background: url("../../assets/images/nav-rightbg.png") no-repeat;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment