Commit e92e7d49 authored by 赵啸非's avatar 赵啸非

修改前后端结构

parent 5ae1d98f
/* Logo 字体 */
@font-face {
font-family: "iconfont logo";
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
}
.logo {
font-family: "iconfont logo";
font-size: 160px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* tabs */
.nav-tabs {
position: relative;
}
.nav-tabs .nav-more {
position: absolute;
right: 0;
bottom: 0;
height: 42px;
line-height: 42px;
color: #666;
}
#tabs {
border-bottom: 1px solid #eee;
}
#tabs li {
cursor: pointer;
width: 100px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 16px;
border-bottom: 2px solid transparent;
position: relative;
z-index: 1;
margin-bottom: -1px;
color: #666;
}
#tabs .active {
border-bottom-color: #f00;
color: #222;
}
.tab-container .content {
display: none;
}
/* 页面布局 */
.main {
padding: 30px 100px;
width: 960px;
margin: 0 auto;
}
.main .logo {
color: #333;
text-align: left;
margin-bottom: 30px;
line-height: 1;
height: 110px;
margin-top: -50px;
overflow: hidden;
*zoom: 1;
}
.main .logo a {
font-size: 160px;
color: #333;
}
.helps {
margin-top: 40px;
}
.helps pre {
padding: 20px;
margin: 10px 0;
border: solid 1px #e7e1cd;
background-color: #fffdef;
overflow: auto;
}
.icon_lists {
width: 100% !important;
overflow: hidden;
*zoom: 1;
}
.icon_lists li {
width: 100px;
margin-bottom: 10px;
margin-right: 20px;
text-align: center;
list-style: none !important;
cursor: default;
}
.icon_lists li .code-name {
line-height: 1.2;
}
.icon_lists .icon {
display: block;
height: 100px;
line-height: 100px;
font-size: 42px;
margin: 10px auto;
color: #333;
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
-moz-transition: font-size 0.25s linear, width 0.25s linear;
transition: font-size 0.25s linear, width 0.25s linear;
}
.icon_lists .icon:hover {
font-size: 100px;
}
.icon_lists .svg-icon {
/* 通过设置 font-size 来改变图标大小 */
width: 1em;
/* 图标和文字相邻时,垂直对齐 */
vertical-align: -0.15em;
/* 通过设置 color 来改变 SVG 的颜色/fill */
fill: currentColor;
/* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
normalize.css 中也包含这行 */
overflow: hidden;
}
.icon_lists li .name,
.icon_lists li .code-name {
color: #666;
}
/* markdown 样式 */
.markdown {
color: #666;
font-size: 14px;
line-height: 1.8;
}
.highlight {
line-height: 1.5;
}
.markdown img {
vertical-align: middle;
max-width: 100%;
}
.markdown h1 {
color: #404040;
font-weight: 500;
line-height: 40px;
margin-bottom: 24px;
}
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
color: #404040;
margin: 1.6em 0 0.6em 0;
font-weight: 500;
clear: both;
}
.markdown h1 {
font-size: 28px;
}
.markdown h2 {
font-size: 22px;
}
.markdown h3 {
font-size: 16px;
}
.markdown h4 {
font-size: 14px;
}
.markdown h5 {
font-size: 12px;
}
.markdown h6 {
font-size: 12px;
}
.markdown hr {
height: 1px;
border: 0;
background: #e9e9e9;
margin: 16px 0;
clear: both;
}
.markdown p {
margin: 1em 0;
}
.markdown>p,
.markdown>blockquote,
.markdown>.highlight,
.markdown>ol,
.markdown>ul {
width: 80%;
}
.markdown ul>li {
list-style: circle;
}
.markdown>ul li,
.markdown blockquote ul>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown>ul li p,
.markdown>ol li p {
margin: 0.6em 0;
}
.markdown ol>li {
list-style: decimal;
}
.markdown>ol li,
.markdown blockquote ol>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown code {
margin: 0 3px;
padding: 0 5px;
background: #eee;
border-radius: 3px;
}
.markdown strong,
.markdown b {
font-weight: 600;
}
.markdown>table {
border-collapse: collapse;
border-spacing: 0px;
empty-cells: show;
border: 1px solid #e9e9e9;
width: 95%;
margin-bottom: 24px;
}
.markdown>table th {
white-space: nowrap;
color: #333;
font-weight: 600;
}
.markdown>table th,
.markdown>table td {
border: 1px solid #e9e9e9;
padding: 8px 16px;
text-align: left;
}
.markdown>table th {
background: #F7F7F7;
}
.markdown blockquote {
font-size: 90%;
color: #999;
border-left: 4px solid #e9e9e9;
padding-left: 0.8em;
margin: 1em 0;
}
.markdown blockquote p {
margin: 0;
}
.markdown .anchor {
opacity: 0;
transition: opacity 0.3s ease;
margin-left: 8px;
}
.markdown .waiting {
color: #ccc;
}
.markdown h1:hover .anchor,
.markdown h2:hover .anchor,
.markdown h3:hover .anchor,
.markdown h4:hover .anchor,
.markdown h5:hover .anchor,
.markdown h6:hover .anchor {
opacity: 1;
display: inline-block;
}
.markdown>br,
.markdown>p>br {
clear: both;
}
.hljs {
display: block;
background: white;
padding: 0.5em;
color: #333333;
overflow-x: auto;
}
.hljs-comment,
.hljs-meta {
color: #969896;
}
.hljs-string,
.hljs-variable,
.hljs-template-variable,
.hljs-strong,
.hljs-emphasis,
.hljs-quote {
color: #df5000;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
color: #a71d5d;
}
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-attribute {
color: #0086b3;
}
.hljs-section,
.hljs-name {
color: #63a35c;
}
.hljs-tag {
color: #333333;
}
.hljs-title,
.hljs-attr,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #795da3;
}
.hljs-addition {
color: #55a532;
background-color: #eaffea;
}
.hljs-deletion {
color: #bd2c00;
background-color: #ffecec;
}
.hljs-link {
text-decoration: underline;
}
/* 代码高亮 */
/* PrismJS 1.15.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre)>code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre)>code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #9a6e3a;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function,
.token.class-name {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
This diff is collapsed.
@font-face {
font-family: "iconfont"; /* Project id 3597207 */
src: url('iconfont.woff2?t=1660811949301') format('woff2'),
url('iconfont.woff?t=1660811949301') format('woff'),
url('iconfont.ttf?t=1660811949301') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-xitongguanli:before {
content: "\e627";
}
.icon-shouye:before {
content: "\e751";
}
.icon-shezhi:before {
content: "\e64b";
}
.icon-xiaoxi:before {
content: "\e60d";
}
.icon-gaojing:before {
content: "\ec34";
}
.icon-dalou:before {
content: "\e6bc";
}
.icon-xitongguanli1:before {
content: "\e632";
}
This diff is collapsed.
{
"id": "3597207",
"name": "物联网",
"font_family": "iconfont",
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "12889883",
"name": "系统管理-部门管理",
"font_class": "xitongguanli",
"unicode": "e627",
"unicode_decimal": 58919
},
{
"icon_id": "577364",
"name": "首页",
"font_class": "shouye",
"unicode": "e751",
"unicode_decimal": 59217
},
{
"icon_id": "629333",
"name": "设置",
"font_class": "shezhi",
"unicode": "e64b",
"unicode_decimal": 58955
},
{
"icon_id": "1311632",
"name": "消息",
"font_class": "xiaoxi",
"unicode": "e60d",
"unicode_decimal": 58893
},
{
"icon_id": "5764445",
"name": "告警",
"font_class": "gaojing",
"unicode": "ec34",
"unicode_decimal": 60468
},
{
"icon_id": "8361756",
"name": "大楼",
"font_class": "dalou",
"unicode": "e6bc",
"unicode_decimal": 59068
},
{
"icon_id": "12820187",
"name": "系统管理",
"font_class": "xitongguanli1",
"unicode": "e632",
"unicode_decimal": 58930
}
]
}
/* Logo 字体 */
@font-face {
font-family: "iconfont logo";
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
}
.logo {
font-family: "iconfont logo";
font-size: 160px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* tabs */
.nav-tabs {
position: relative;
}
.nav-tabs .nav-more {
position: absolute;
right: 0;
bottom: 0;
height: 42px;
line-height: 42px;
color: #666;
}
#tabs {
border-bottom: 1px solid #eee;
}
#tabs li {
cursor: pointer;
width: 100px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 16px;
border-bottom: 2px solid transparent;
position: relative;
z-index: 1;
margin-bottom: -1px;
color: #666;
}
#tabs .active {
border-bottom-color: #f00;
color: #222;
}
.tab-container .content {
display: none;
}
/* 页面布局 */
.main {
padding: 30px 100px;
width: 960px;
margin: 0 auto;
}
.main .logo {
color: #333;
text-align: left;
margin-bottom: 30px;
line-height: 1;
height: 110px;
margin-top: -50px;
overflow: hidden;
*zoom: 1;
}
.main .logo a {
font-size: 160px;
color: #333;
}
.helps {
margin-top: 40px;
}
.helps pre {
padding: 20px;
margin: 10px 0;
border: solid 1px #e7e1cd;
background-color: #fffdef;
overflow: auto;
}
.icon_lists {
width: 100% !important;
overflow: hidden;
*zoom: 1;
}
.icon_lists li {
width: 100px;
margin-bottom: 10px;
margin-right: 20px;
text-align: center;
list-style: none !important;
cursor: default;
}
.icon_lists li .code-name {
line-height: 1.2;
}
.icon_lists .icon {
display: block;
height: 100px;
line-height: 100px;
font-size: 42px;
margin: 10px auto;
color: #333;
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
-moz-transition: font-size 0.25s linear, width 0.25s linear;
transition: font-size 0.25s linear, width 0.25s linear;
}
.icon_lists .icon:hover {
font-size: 100px;
}
.icon_lists .svg-icon {
/* 通过设置 font-size 来改变图标大小 */
width: 1em;
/* 图标和文字相邻时,垂直对齐 */
vertical-align: -0.15em;
/* 通过设置 color 来改变 SVG 的颜色/fill */
fill: currentColor;
/* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
normalize.css 中也包含这行 */
overflow: hidden;
}
.icon_lists li .name,
.icon_lists li .code-name {
color: #666;
}
/* markdown 样式 */
.markdown {
color: #666;
font-size: 14px;
line-height: 1.8;
}
.highlight {
line-height: 1.5;
}
.markdown img {
vertical-align: middle;
max-width: 100%;
}
.markdown h1 {
color: #404040;
font-weight: 500;
line-height: 40px;
margin-bottom: 24px;
}
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
color: #404040;
margin: 1.6em 0 0.6em 0;
font-weight: 500;
clear: both;
}
.markdown h1 {
font-size: 28px;
}
.markdown h2 {
font-size: 22px;
}
.markdown h3 {
font-size: 16px;
}
.markdown h4 {
font-size: 14px;
}
.markdown h5 {
font-size: 12px;
}
.markdown h6 {
font-size: 12px;
}
.markdown hr {
height: 1px;
border: 0;
background: #e9e9e9;
margin: 16px 0;
clear: both;
}
.markdown p {
margin: 1em 0;
}
.markdown>p,
.markdown>blockquote,
.markdown>.highlight,
.markdown>ol,
.markdown>ul {
width: 80%;
}
.markdown ul>li {
list-style: circle;
}
.markdown>ul li,
.markdown blockquote ul>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown>ul li p,
.markdown>ol li p {
margin: 0.6em 0;
}
.markdown ol>li {
list-style: decimal;
}
.markdown>ol li,
.markdown blockquote ol>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown code {
margin: 0 3px;
padding: 0 5px;
background: #eee;
border-radius: 3px;
}
.markdown strong,
.markdown b {
font-weight: 600;
}
.markdown>table {
border-collapse: collapse;
border-spacing: 0px;
empty-cells: show;
border: 1px solid #e9e9e9;
width: 95%;
margin-bottom: 24px;
}
.markdown>table th {
white-space: nowrap;
color: #333;
font-weight: 600;
}
.markdown>table th,
.markdown>table td {
border: 1px solid #e9e9e9;
padding: 8px 16px;
text-align: left;
}
.markdown>table th {
background: #F7F7F7;
}
.markdown blockquote {
font-size: 90%;
color: #999;
border-left: 4px solid #e9e9e9;
padding-left: 0.8em;
margin: 1em 0;
}
.markdown blockquote p {
margin: 0;
}
.markdown .anchor {
opacity: 0;
transition: opacity 0.3s ease;
margin-left: 8px;
}
.markdown .waiting {
color: #ccc;
}
.markdown h1:hover .anchor,
.markdown h2:hover .anchor,
.markdown h3:hover .anchor,
.markdown h4:hover .anchor,
.markdown h5:hover .anchor,
.markdown h6:hover .anchor {
opacity: 1;
display: inline-block;
}
.markdown>br,
.markdown>p>br {
clear: both;
}
.hljs {
display: block;
background: white;
padding: 0.5em;
color: #333333;
overflow-x: auto;
}
.hljs-comment,
.hljs-meta {
color: #969896;
}
.hljs-string,
.hljs-variable,
.hljs-template-variable,
.hljs-strong,
.hljs-emphasis,
.hljs-quote {
color: #df5000;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
color: #a71d5d;
}
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-attribute {
color: #0086b3;
}
.hljs-section,
.hljs-name {
color: #63a35c;
}
.hljs-tag {
color: #333333;
}
.hljs-title,
.hljs-attr,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #795da3;
}
.hljs-addition {
color: #55a532;
background-color: #eaffea;
}
.hljs-deletion {
color: #bd2c00;
background-color: #ffecec;
}
.hljs-link {
text-decoration: underline;
}
/* 代码高亮 */
/* PrismJS 1.15.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre)>code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre)>code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #9a6e3a;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function,
.token.class-name {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
@font-face {
font-family: "iconfont"; /* Project id 1782818 */
src: url('iconfont.woff2?t=1636125596282') format('woff2'),
url('iconfont.woff?t=1636125596282') format('woff'),
url('iconfont.ttf?t=1636125596282') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-table_layout:before {
content: "\e7de";
}
.icon-chaifenhang:before {
content: "\e60a";
}
.icon-chaifenlie:before {
content: "\e60b";
}
.icon-chaifen:before {
content: "\e60d";
}
.icon-zhuijiahang:before {
content: "\e6ce";
}
.icon-zhuijialie:before {
content: "\e6cf";
}
.icon-charuhang:before {
content: "\e8a2";
}
.icon-charulie:before {
content: "\e8a4";
}
.icon-shangxiahebing:before {
content: "\e66a";
}
.icon-zuoyouhebing:before {
content: "\e66b";
}
.icon-treeselect:before {
content: "\e609";
}
.icon-barcode2:before {
content: "\e66e";
}
.icon-barcode:before {
content: "\e612";
}
.icon-dialog:before {
content: "\e692";
}
.icon-address:before {
content: "\e6b5";
}
.icon-cascader:before {
content: "\e697";
}
.icon-colorpicker:before {
content: "\e666";
}
.icon-shengshiqu:before {
content: "\e75f";
}
.icon-text:before {
content: "\e6fb";
}
.icon-link:before {
content: "\e8fb";
}
.icon-alert:before {
content: "\e61c";
}
.icon-alert1:before {
content: "\e68e";
}
.icon-gitee:before {
content: "\e608";
}
.icon-github:before {
content: "\e607";
}
.icondialog:before {
content: "\e82a";
}
.icon_map:before {
content: "\e68a";
}
.iconbianjiqi:before {
content: "\e7bd";
}
.icondivider:before {
content: "\e6b3";
}
.iconanniu:before {
content: "\e642";
}
.icon-button:before {
content: "\e648";
}
.icon-button1:before {
content: "\e705";
}
.iconadd:before {
content: "\e602";
}
.icon-password:before {
content: "\e600";
}
.icon-lock:before {
content: "\e822";
}
.icon-html:before {
content: "\e622";
}
.icon-time:before {
content: "\e61a";
}
.icon-chart1:before {
content: "\e60f";
}
.icon-timerange:before {
content: "\e601";
}
.icon-checkbox:before {
content: "\e629";
}
.icon-date:before {
content: "\e7b2";
}
.icon-setting:before {
content: "\e7fe";
}
.icon-slider:before {
content: "\e620";
}
.icon-table:before {
content: "\e802";
}
.icon-list:before {
content: "\e7dc";
}
.icon-input:before {
content: "\e619";
}
.icon-switch:before {
content: "\e62f";
}
.icon-rate:before {
content: "\e829";
}
.icon-att:before {
content: "\e624";
}
.icon-doc:before {
content: "\e621";
}
.icon-editor:before {
content: "\e614";
}
.icon-textarea:before {
content: "\e603";
}
.icon-location:before {
content: "\e604";
}
.icon-col:before {
content: "\e69d";
}
.icon-divider:before {
content: "\e73e";
}
.icon-daterange:before {
content: "\e73b";
}
.icon-select:before {
content: "\e63c";
}
.icon-radio:before {
content: "\e605";
}
.icon-chart:before {
content: "\e606";
}
.icon-inputNumber:before {
content: "\e6a7";
}
.icon-tab:before {
content: "\e6b4";
}
This diff is collapsed.
{
"id": "1782818",
"name": "form-designer",
"font_family": "iconfont",
"css_prefix_text": "icon",
"description": "",
"glyphs": [
{
"icon_id": "4766919",
"name": "table",
"font_class": "-table_layout",
"unicode": "e7de",
"unicode_decimal": 59358
},
{
"icon_id": "11179893",
"name": "拆分行",
"font_class": "-chaifenhang",
"unicode": "e60a",
"unicode_decimal": 58890
},
{
"icon_id": "11179898",
"name": "拆分列",
"font_class": "-chaifenlie",
"unicode": "e60b",
"unicode_decimal": 58891
},
{
"icon_id": "12819536",
"name": "拆分",
"font_class": "-chaifen",
"unicode": "e60d",
"unicode_decimal": 58893
},
{
"icon_id": "7040012",
"name": "行追加",
"font_class": "-zhuijiahang",
"unicode": "e6ce",
"unicode_decimal": 59086
},
{
"icon_id": "7040014",
"name": "列追加",
"font_class": "-zhuijialie",
"unicode": "e6cf",
"unicode_decimal": 59087
},
{
"icon_id": "10868107",
"name": "插入行",
"font_class": "-charuhang",
"unicode": "e8a2",
"unicode_decimal": 59554
},
{
"icon_id": "10868232",
"name": "插入列",
"font_class": "-charulie",
"unicode": "e8a4",
"unicode_decimal": 59556
},
{
"icon_id": "19324946",
"name": "上下合并",
"font_class": "-shangxiahebing",
"unicode": "e66a",
"unicode_decimal": 58986
},
{
"icon_id": "19324950",
"name": "左右合并",
"font_class": "-zuoyouhebing",
"unicode": "e66b",
"unicode_decimal": 58987
},
{
"icon_id": "19478268",
"name": "treeselect",
"font_class": "-treeselect",
"unicode": "e609",
"unicode_decimal": 58889
},
{
"icon_id": "6801615",
"name": "Barcode",
"font_class": "-barcode2",
"unicode": "e66e",
"unicode_decimal": 58990
},
{
"icon_id": "8924414",
"name": "bar-code",
"font_class": "-barcode",
"unicode": "e612",
"unicode_decimal": 58898
},
{
"icon_id": "16383562",
"name": "Dialog",
"font_class": "-dialog",
"unicode": "e692",
"unicode_decimal": 59026
},
{
"icon_id": "17412502",
"name": "Organization Chart",
"font_class": "-address",
"unicode": "e6b5",
"unicode_decimal": 59061
},
{
"icon_id": "16768231",
"name": "级联",
"font_class": "-cascader",
"unicode": "e697",
"unicode_decimal": 59031
},
{
"icon_id": "7213053",
"name": "Color picker",
"font_class": "-colorpicker",
"unicode": "e666",
"unicode_decimal": 58982
},
{
"icon_id": "14463272",
"name": "省市区",
"font_class": "-shengshiqu",
"unicode": "e75f",
"unicode_decimal": 59231
},
{
"icon_id": "3385558",
"name": "文本",
"font_class": "-text",
"unicode": "e6fb",
"unicode_decimal": 59131
},
{
"icon_id": "371393",
"name": "link",
"font_class": "-link",
"unicode": "e8fb",
"unicode_decimal": 59643
},
{
"icon_id": "762208",
"name": "警告",
"font_class": "-alert",
"unicode": "e61c",
"unicode_decimal": 58908
},
{
"icon_id": "15603541",
"name": "alert",
"font_class": "-alert1",
"unicode": "e68e",
"unicode_decimal": 59022
},
{
"icon_id": "8372144",
"name": "gitee",
"font_class": "-gitee",
"unicode": "e608",
"unicode_decimal": 58888
},
{
"icon_id": "18789786",
"name": "Logo GitHub",
"font_class": "-github",
"unicode": "e607",
"unicode_decimal": 58887
},
{
"icon_id": "14007542",
"name": "dialog",
"font_class": "dialog",
"unicode": "e82a",
"unicode_decimal": 59434
},
{
"icon_id": "16188455",
"name": "地图",
"font_class": "_map",
"unicode": "e68a",
"unicode_decimal": 59018
},
{
"icon_id": "18195942",
"name": "编辑器",
"font_class": "bianjiqi",
"unicode": "e7bd",
"unicode_decimal": 59325
},
{
"icon_id": "9434384",
"name": "divider",
"font_class": "divider",
"unicode": "e6b3",
"unicode_decimal": 59059
},
{
"icon_id": "7038155",
"name": "按钮",
"font_class": "anniu",
"unicode": "e642",
"unicode_decimal": 58946
},
{
"icon_id": "16859933",
"name": "按钮",
"font_class": "-button",
"unicode": "e648",
"unicode_decimal": 58952
},
{
"icon_id": "17692220",
"name": "按钮",
"font_class": "-button1",
"unicode": "e705",
"unicode_decimal": 59141
},
{
"icon_id": "5278848",
"name": "加号",
"font_class": "add",
"unicode": "e602",
"unicode_decimal": 58882
},
{
"icon_id": "13562655",
"name": "workbench_personal center_secondary password",
"font_class": "-password",
"unicode": "e600",
"unicode_decimal": 58880
},
{
"icon_id": "14007479",
"name": "lock",
"font_class": "-lock",
"unicode": "e822",
"unicode_decimal": 59426
},
{
"icon_id": "11889820",
"name": "HTML",
"font_class": "-html",
"unicode": "e622",
"unicode_decimal": 58914
},
{
"icon_id": "886505",
"name": "时间",
"font_class": "-time",
"unicode": "e61a",
"unicode_decimal": 58906
},
{
"icon_id": "1634604",
"name": "chart-area",
"font_class": "-chart1",
"unicode": "e60f",
"unicode_decimal": 58895
},
{
"icon_id": "1708415",
"name": "时间范围",
"font_class": "-timerange",
"unicode": "e601",
"unicode_decimal": 58881
},
{
"icon_id": "2883120",
"name": "多选项",
"font_class": "-checkbox",
"unicode": "e629",
"unicode_decimal": 58921
},
{
"icon_id": "3541137",
"name": "日期",
"font_class": "-date",
"unicode": "e7b2",
"unicode_decimal": 59314
},
{
"icon_id": "5112503",
"name": "编辑器",
"font_class": "-setting",
"unicode": "e7fe",
"unicode_decimal": 59390
},
{
"icon_id": "5672533",
"name": "滑块",
"font_class": "-slider",
"unicode": "e620",
"unicode_decimal": 58912
},
{
"icon_id": "5920510",
"name": "表格",
"font_class": "-table",
"unicode": "e802",
"unicode_decimal": 59394
},
{
"icon_id": "5981330",
"name": "stream list",
"font_class": "-list",
"unicode": "e7dc",
"unicode_decimal": 59356
},
{
"icon_id": "6664173",
"name": "input",
"font_class": "-input",
"unicode": "e619",
"unicode_decimal": 58905
},
{
"icon_id": "7036392",
"name": "开关 关",
"font_class": "-switch",
"unicode": "e62f",
"unicode_decimal": 58927
},
{
"icon_id": "8036637",
"name": "评分",
"font_class": "-rate",
"unicode": "e829",
"unicode_decimal": 59433
},
{
"icon_id": "8171626",
"name": "附 件",
"font_class": "-att",
"unicode": "e624",
"unicode_decimal": 58916
},
{
"icon_id": "9529563",
"name": "html",
"font_class": "-doc",
"unicode": "e621",
"unicode_decimal": 58913
},
{
"icon_id": "9702638",
"name": "编辑器",
"font_class": "-editor",
"unicode": "e614",
"unicode_decimal": 58900
},
{
"icon_id": "9750331",
"name": "textarea",
"font_class": "-textarea",
"unicode": "e603",
"unicode_decimal": 58883
},
{
"icon_id": "10995620",
"name": "定位",
"font_class": "-location",
"unicode": "e604",
"unicode_decimal": 58884
},
{
"icon_id": "11020734",
"name": "栅格",
"font_class": "-col",
"unicode": "e69d",
"unicode_decimal": 59037
},
{
"icon_id": "11809961",
"name": "分割线",
"font_class": "-divider",
"unicode": "e73e",
"unicode_decimal": 59198
},
{
"icon_id": "12263722",
"name": "日期范围",
"font_class": "-daterange",
"unicode": "e73b",
"unicode_decimal": 59195
},
{
"icon_id": "12278783",
"name": "下 拉",
"font_class": "-select",
"unicode": "e63c",
"unicode_decimal": 58940
},
{
"icon_id": "13176332",
"name": "单选",
"font_class": "-radio",
"unicode": "e605",
"unicode_decimal": 58885
},
{
"icon_id": "13225654",
"name": "chart-line",
"font_class": "-chart",
"unicode": "e606",
"unicode_decimal": 58886
},
{
"icon_id": "14006818",
"name": "计数器",
"font_class": "-inputNumber",
"unicode": "e6a7",
"unicode_decimal": 59047
},
{
"icon_id": "14066795",
"name": "tab",
"font_class": "-tab",
"unicode": "e6b4",
"unicode_decimal": 59060
}
]
}
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12" viewBox="0 0 12 12">
<image id="首页" y="0.5" width="12" height="11" xlink:href="data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAALCAYAAABLcGxfAAAA1UlEQVQokYWOsUqCYRSGH/+iEMpoqEncEhrE3VXcuoDuQ6IL0ckuoKEhaBMXaXFLWrqA0HBwbAt85MAX/HwoHjh857zneT9e1Ly76lz9UB/yew4/qhv1Xm2qa3WyzzBOwG1JK9SpulLr/4aG+q7OErAr5kBdqL1YvtXfHVDeT6rHwBDocLh+gJcC+AROMvwKuMm0S2AZhhpQyeBn4A3olfQNUA1DxPorHdrAF/AK3JX0YI4CDmcLOEviOXAKGECao+pAUVEj0ihlDEPsF+mjqGV6r4H+FhxB2YcETV9JAAAAAElFTkSuQmCC"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12" viewBox="0 0 12 12">
<image id="告警管理" x="-1" y="-1" width="14" height="14" xlink:href="data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAABS0lEQVQokX3Sv0vXYRAH8Nc3ysoQCyohI2moISfRfyDBIWhrCUFCaBKKGoSmmvoDmqIc+gcsCIkgaFLQMRpcBLPIsR+TOFQXp/eFJ60O7vN87t539zz3vutEhH/IFfTi+d/g/yW+xjkM70NwoM4+LGGiwd7gRWNfxEq3UDexg4NYxxje4TrGsYqrWKv4zk5GPrXRidiVhxExGBGnIuJu+e60sfnpi4gTpSlTe4qljhV2ISKOR0R/kvO2SMgn/cA1nMcrHMUklvEMIziE7ezrRhn3cLJ6nsdi9foSp/ENXzGtCPlcwekcqv8nmMElPC7fMXzHx5bVrvys8yk+oR8PyvfHwPPGdqZHGjvp32rsntLd+dXm3MZs9fqhsLNVeKOxD2MO9zPxDDZxC+8xUIFJRj69S9iX2t0FXM7EvOURRvFrby+N5MYktombvwGs+p53uBB4fAAAAABJRU5ErkJggg=="/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12" viewBox="0 0 12 12">
<image id="平台设置" width="12" height="12" xlink:href="data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAABH0lEQVQokV2RPSjFYRTGf66v2x0sDFIXg2sQIaOFUWazRcrHoEzKakPJ4ApZlLLcQcqgTAwyW2wykFISZfHTe++Rf06d932ec07nvOd5UbO+oB6pnRFbV8tqy29NXTqAJmAt7iegH3gHvoBXYBBYBe6y3Stqe+CC2pXJHasTCeeoWStQDzQE/wQe+bMPoFhl6qJ6o05FtzH1RN1TZyNWUi/UjUSuI5BwUT1T+9TmwJORy6mb6UlXwH0MT2PfqsvVFr4FBiL3DZSTSpVQYimUSWp1AA9Ab8SfgWVgPI1KGm+ruxlV5tUVNR98Tr1Uh7Ky7md2+e8H6khW1kagB+gGCsAWsAOUgDwwDLSlwt+fTjYKzADtwDnwAkzHn5wCh4A/YfIQmkKOjGcAAAAASUVORK5CYII="/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12" viewBox="0 0 12 12">
<image id="生产厂商" width="12" height="12" xlink:href="data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAABG0lEQVQokW3QPUsQUBTG8Z/iS1lBomtzU5NCNiRuQQ5+gVAIitYWl8APIDS6uURDTYWrm0a7RmAO4hItLiIFRtQTp45g4YFz7z333ufe/3kkqVxOcphkv/MgyfM++ydrmEpynGQ6yZXOW0mOksz8LxjCTWzgA+76G++whqd4i+89/xF8wzHu4RkGsdJ7t3EDl/EEC/XNQpKtC3jfJHlwrq6+Foca4RNmsYQBvMAORrGK7Ua6dib42YcTLRjBj8a7XhcxjNMzpO0LkDaSPD5XbyZ5VC9U7OI+ttqhebzHL7zGQ3ysupBOMdai9X6g+MuhL3iFfUyXvSUo2+7gBC9bcBVzvS6LL2EGnwfKvlYfdcMVhTLejX/t/Uns/Qb8YcvTPw2WuQAAAABJRU5ErkJggg=="/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="12" viewBox="0 0 14 12">
<image id="图层_19" data-name="图层 19" width="14" height="12" xlink:href="data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAABCElEQVQokW2SP0sDQRDFf4mamEaIIJc2zV2wtLWQtNaC6VKkChH8Bgd3nUXIB4jphJAvIAgWIf5pBVMdNuly16oQUp0MjrJ3tw+m2LfzZubNbilNU0x4YdIChkBN6RUwiHxnY+btUsQFcJ5jR8DSJMoFmb1YgbMJH4EPYAt8Aq86bhbi0RZuEN+7QXxtu5P4X44XJuLtWGoBsogb9TUFqsq9RL4jE/wKvTA5BZ6BhXA60hrYB+pa7Ag4jHynYZre0WpnBS8GvDB5+zuW3CDuAZfAiY41jnznPScQGx2gDcyAO+l4a+RcAQdAN9dsorygDzRtz1GxcNnvBXsifAK+Nb70nMdDJgfmP68GamceNFjdAAAAAElFTkSuQmCC"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="11" height="14" viewBox="0 0 11 14">
<image id="地点" width="11" height="14" xlink:href="data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOCAYAAAD5YeaVAAABMUlEQVQokWWSvy9EQRSFv92oKFcyOkGy0+gkKhKVAgUq8SOio1aIwk12oqbwH1CIQkOiV4hiJUIkTCEiSEyi0InCPrnMvLy8vdXMPd87c+7Mq2RZRirrwhqwAvQDr8C+F7OT9By2LhwCc7TXmRczqd1qBKcK4DYwDGzE/YR1YUkXHbGRwBMvZiv2mtaFQUDBeeCgGoUUvFUK0SrqybkJLALT1gXRE4Cx6Jp0kvNpwa0BXAO7Bf04h72YJ+C87R7+686LuS06ay0D3yVQsy6kTQ57Mc/ARQm+Sa5alXrjvRvYA7qANx0S6AE+gaO4/gHW1fkhCrNejD73CPCij+HFrAIzwL1mV1gn16/HrQsDXswjMOTFXFoX+rQP9Cr392/Eux2NA30BH0AN6NSowJUXs/kLKj9euCTXiIAAAAAASUVORK5CYII="/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12" viewBox="0 0 12 12">
<image id="系统管理" width="12" height="12" xlink:href="data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAA80lEQVQokY2RsUoDQBBEnxICMaKSSg1WgtgGLP0EwUI7IT8hduYjUmol1taSSgujoK2FnZWFEBBiI6jwZHUDpynMwMHu7c7s3tyU+gQ0mQyDIAicAP1/KDWggz/YDN4E53o62XNjeuOYB1YrQKy0BDSKlpciDrEPYAjsxJihvzFQG2ozV4z6ulpTqzFhFjgAesACUAdWgHPgNiccA8vA2ejRfXVfbaXqjHqXtcNii8Uonqq9vLhJwmfm7UIg8FZaeak+ZLwXFuaUNbWrvqu7o+arVLjIvKK+/jEjsBU/HdZtAFXgGXgEWkAbOALuge1vI6D+BQSZFivDzo07AAAAAElFTkSuQmCC"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12" viewBox="0 0 12 12">
<image id="设备管理" width="12" height="12" xlink:href="data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAA/klEQVQokYWRPysFUBiHH6KuZJE/oWSQxWKx+BpKhsvNRzAYfABfwIQyKJPFoEyK6JZYsIliuINkMFwmt0dv96jjGLx1hvP+3l/n95y3QyWrYWADGAJawCmwmQ908rvmgWXgHvgA1gudruI+BuwBa+l+8Z/hFtgHepK5vzQQDMWZVl/VHbWv1PMX5hJsA/gEmsAMMAjcAY8x9PNLi8AWUI9eMnSnyL3AKDCVM4wDh8DKn8ztuswZdtUn9U09UgeyzDX1XG2qJ2o1mu/qrDqpNtSFzFBXt9UJ9Vg9i8W9ANcJ6gGoZFG+kvYM3MT2gyE2GrAhBstVkX0VWAJGgINvUm2gs7a/fSsAAAAASUVORK5CYII="/>
</svg>
export default {
created() {
// this.getData();
},
beforeDestroy() {
clearTimeout(this.loadingTimer);
},
methods: {
// 渲染前置处理
beforeRender(data) {
return data
},
// 渲染后置处理
afterRender(data) {
},
// 提交表单的前置处理
beforeSubmit(data) {
return data
},
// 提交表单的后置处理, 会阻断默认的回退行为
afterSubmit(data) {
this.$router.go(-1);
},
// 开启、关闭
changePath(path) {
this.pageInfo.list = path + "/list";
this.pageInfo.del = path + "/delete";
this.pageInfo.add = path + "/add";
this.pageInfo.edit = path + "/edit";
this.pageInfo.view = path + "/view";
},
// 默认拉取数据
getData() {
this.loading = true;
this.$get(this.urls.currUrl || this.pageInfo.currUrl, this.query)
.then(({ data }) => {
const res = this.beforeRender(data);
//转化枚举类型字段的number值为arrays
res.entity = this.util_toArrays(res.entity, this.toArrays);
// 转化枚举类型字段的number值为string
res.entity = this.util_toString(res.entity, this.toString);
//
res.entity = this.util_toDateStr(res.entity, this.toDate);
this.form = Object.assign({}, this.form, res.entity);
this.dict = Object.assign({}, this.dict, res.dict);
this.afterRender(res);
})
.catch(error => {
this.$message.error(error.message)
throw error
})
.then(data => {
clearTimeout(this.loadingTimer);
this.loadingTimer = setTimeout(() => {
this.loading = false;
}, 300);
})
},
// 提交表单
submitForm(ref) {
const el = this.$refs.form;
el.validate((valid) => {
if (!valid) return;
this.loading = true;
this.$post(this.urls.saveUrl || this.pageInfo.saveUrl, this.beforeSubmit(this.form))
.then(res => {
this.$message.success(res.msg);
this.afterSubmit(res);
})
.catch(error => {
this.$message.error(error.message);
})
.then(data => {
clearTimeout(this.loadingTimer);
this.loadingTimer = setTimeout(() => {
this.loading = false;
}, 200);
})
});
},
// 复制一个数组或对象
util_copy(data) {
return JSON.parse(JSON.stringify(data))
},
// 工具方法,把数字转化为字符串
util_toString(data, array) {
//原始数据
const dataCopy = Object.assign({}, data);
array.forEach(item => {
//如果相等做操作
dataCopy[item] = dataCopy[item] === undefined ? '' : dataCopy[item] + '';
})
return dataCopy;
},
// 工具方法,把字符串转化为数组
util_toArrays(data, array) {
const dataCopy = Object.assign({}, data);
array.forEach(item => {
dataCopy[item] = dataCopy[item] === undefined ? [] : dataCopy[item].split(",");
})
return dataCopy;
},
// 工具方法,把字符串转化为格式化日期
util_toDateStr(data, array) {
const dataCopy = Object.assign({}, data);
array.forEach(item => {
dataCopy[item] = dataCopy[item] === undefined ? '' : this.util_formatterDate(dataCopy[item]);
})
return dataCopy;
},
util_formatterDate(time) {
let date = new Date(Number(time));
let Y = date.getFullYear() + '-';
let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
let D = this.panLeft(date.getDate()) + ' ';
let h = this.panLeft(date.getHours()) + ':';
let m = this.panLeft(date.getMinutes()) + ':';
let s = this.panLeft(date.getSeconds());
return Y + M + D + h + m + s;
},
panLeft(num) {
return num < 10 ? '0' + num : num;
},
// 从dict字段暴力取值,取不到则返回原值
util_formatter(key, val) {
try {
return this.dict[key][val]
} catch (error) {
return val;
}
},
resetForm(refName) {
setTimeout(() => {
this.$nextTick(() => {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
});
}, 0);
}
},
computed: {
pageInfo() {
let currUrl = this.$route.path;
let urlArray = currUrl.split('/');
let type = urlArray.pop();
urlArray.push('save');
let saveUrl = urlArray.join('/');
urlArray.pop();
urlArray.push('edit');
let editUrl = urlArray.join('/');
urlArray.pop();
urlArray.push('add');
let addUrl = urlArray.join('/');
urlArray.pop();
urlArray.push('view');
let viewUrl = urlArray.join('/');
return {
type,
currUrl,
saveUrl,
editUrl,
addUrl,
viewUrl,
};
},
},
data() {
return {
loadingTimer: null,
loading: false, // ajax请求状态
query: this.$route.query, // ajax请求参数
urls: {}, // 用户自定义的请求地址,内容和pageInfo等同
form: {}, // 表单数据
extendFormData: {}, // 额外的表单数据
rules: {}, // 表单验证规则
dict: {}, // 数据字典
toString: [], // 需要把number转化为string的表单字段name数组
toArrays: [], // 需要把number转化为arrays的表单字段name数组
toDate: [], // 需要把number转化为date的表单字段name数组
}
}
}
import axios from 'axios';
export default {
mounted() {
},
beforeDestroy () {
this.source.cancel('自动取消ajax操作');
clearTimeout(this.loadingTimer);
},
methods: {
beforeFecth() {
return Promise.resolve();
},
// 表格接收数据前
beforeRender(data){return data},
// 表格接收数据后
afterRender(data){},
// 默认拉取数据
async getTreeData() {
},
handleNodeClick(node) {
},
renderContent: function (h, { node, data, store }) {
return (
<span>
<i style="font-size:16px;color:#409EFF" class={data.icon}></i>
<span style="padding-left: 2px;font-size:14px">{node.label}</span>
</span>
);
},
async loadNode(node, resolve) {
if (node.level === 0) {
return;
}
resolve(data.result);
// this.$post("/area/getListByParentId", {
// parentId: node.data.id,
// }).then(({ data }) => {
// resolve(data.result);
// });
},
refreshNodeBy(id) {
let node = this.$refs.areaTree.getNode(this.currentNode.id); // 通过节点id找到对应树节点对象
node.loaded = false;
node.expand(); // 主动调用展开节点方法,重新查询该节点下的所有子节点
this.toView(this.currentNode);
},
},
data() {
return {
treeProps: {
id: "id",
label: "label",
areaCode:"areaCode",
type: "type",
isLeaf: "isLeaf",
children: "children",
icon: "icon",
},
areaData:[],
currentNode:{},
}
}
}
export default {
created() {
//this.getData();
},
beforeDestroy() {
clearTimeout(this.loadingTimer);
},
methods: {
// 渲染前置处理
beforeRender(data) {
return data
},
// 渲染后置处理
afterRender(data) {
},
// 默认拉取数据
getData() {
this.loading = true;
this.$get(this.urls.currUrl || this.pageInfo.currUrl, this.query)
.then(({ data }) => {
const res = this.beforeRender(data);
//转化枚举类型字段的number值为arrays
res.entity = this.util_toArrays(res.entity, this.toArrays);
// 转化枚举类型字段的number值为string
res.entity = this.util_toString(res.entity, this.toString);
//
res.entity = this.util_toDateStr(res.entity, this.toDate);
this.form = Object.assign({}, this.form, res.entity);
this.dict = Object.assign({}, this.dict, res.dict);
console.log("entity",res.entity)
this.afterRender(res);
})
.catch(error => {
console.error(error)
this.$message.error(error.message);
})
.then(data => {
clearTimeout(this.loadingTimer);
this.loadingTimer = setTimeout(() => {
this.loading = false;
}, 300);
})
},
// 复制一个数组或对象
util_copy(data) {
return JSON.parse(JSON.stringify(data))
},
// 工具方法,把数字转化为字符串
util_toString(data, array) {
//原始数据
const dataCopy = Object.assign({}, data);
array.forEach(item => {
//如果相等做操作
dataCopy[item] = dataCopy[item] === undefined ? '' : dataCopy[item] + '';
})
return dataCopy;
},
// 工具方法,把字符串转化为数组
util_toArrays(data, array) {
const dataCopy = Object.assign({}, data);
array.forEach(item => {
dataCopy[item] = dataCopy[item] === undefined ? [] : dataCopy[item].split(",");
})
return dataCopy;
},
// 工具方法,把字符串转化为格式化日期
util_toDateStr(data, array) {
const dataCopy = Object.assign({}, data);
array.forEach(item => {
dataCopy[item] = dataCopy[item] === undefined ? '' : this.util_formatterDate(dataCopy[item]);
})
return dataCopy;
},
util_formatters(key, val) {
try {
return val.split(",").map((i) => this.util_formatter(key, i)).join(",");
} catch (error) {
return val;
}
},
util_formatterDate(time) {
let date = new Date(Number(time));
let Y = date.getFullYear() + '-';
let M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
let D = this.panLeft(date.getDate()) + ' ';
let h = this.panLeft(date.getHours()) + ':';
let m = this.panLeft(date.getMinutes()) + ':';
let s = this.panLeft(date.getSeconds());
return Y+M+D+h+m+s;
},
panLeft(num){
return num < 10 ? '0'+num : num;
},
// 从dict字段暴力取值,取不到则返回原值
util_formatter(key, val) {
try {
return this.dict[key][val]
} catch (error) {
return val;
}
}
},
computed: {
pageInfo() {
let currUrl = this.$route.path;
let urlArray = currUrl.split('/');
let type = urlArray.pop();
urlArray.push('save');
let saveUrl = urlArray.join('/');
urlArray.pop();
urlArray.push('edit');
let editUrl = urlArray.join('/');
urlArray.pop();
urlArray.push('add');
let addUrl = urlArray.join('/');
urlArray.pop();
urlArray.push('view');
let viewUrl = urlArray.join('/');
return {
type,
currUrl,
saveUrl,
editUrl,
addUrl,
viewUrl,
};
},
},
data() {
return {
loadingTimer: null,
loading: false, // ajax请求状态
query: this.$route.query, // ajax请求参数
urls: {}, // 用户自定义的请求地址,内容和pageInfo等同
form: {}, // 表单数据
extendFormData: {}, // 额外的表单数据
rules: {}, // 表单验证规则
dict: {}, // 数据字典
toString: [], // 需要把number转化为string的表单字段name数组
toArrays: [], // 需要把number转化为arrays的表单字段name数组
toDate: [], // 需要把number转化为date的表单字段name数组
}
}
}
exports.install = function (Vue) {
// 把需要暴露出去的方法挂载到Vue原型上,避免了全局变量过多的问题
Vue.prototype.refreshData = function () {
console.log("刷新设备列表")
const component = findComponentDownward(this, 'Device')
console.log("component",component)
if(component){
component.getData()
}
}
}
/**
* 由一个组件,向下找到最近的指定组件
* @param {*} context 当前上下文,比如你要基于哪个组件来向上寻找,一般都是基于当前的组件,也就是传入 this
* @param {*} componentName 要找的组件的 name
*/
function findComponentDownward(context, componentName) {
const childrens = context.$children
let children = null
if (childrens.length) {
for (const child of childrens) {
const name = child.$options.name
if (name === componentName) {
children = child
break
} else {
children = findComponentDownward(child, componentName)
if (children) break
}
}
}
return children
}
\ No newline at end of file
/**
* 本地存储函数
*/
const local = {
// 设置
setLocal(key, val) {
localStorage.setItem(key, JSON.stringify(val));
},
// 获取
getLocal(key) {
return JSON.parse(localStorage.getItem(key));
},
// 删除本地存储
removeLocal(key){
localStorage.removeItem(key)
},
// 清空本地存储
clearLocal() {
localStorage.clear();
},
};
// 暴露
export default local;
\ No newline at end of file
/**
* 本地存储函数
*/
const session = {
// 设置
setSession(key, val) {
sessionStorage.setItem(key, JSON.stringify(val));
},
// 获取
getSession(key) {
return JSON.parse(sessionStorage.getItem(key));
},
// 删除本地存储
removeSession(key) {
sessionStorage.removeItem(key)
},
// 清空本地存储
clearSession() {
sessionStorage.clear();
},
};
// 暴露
export default session;
\ No newline at end of file
<template lang="html">
<div style="width:100%;height:100%;">
<div class="container">
<!-- <div class="search-box">
<input
v-model="searchKey"
type="search"
id="search">
<button @click="searchByHand">搜索</button>
<div class="tip-box" id="searchTip"></div>
</div> -->
<!--
amap-manager: 地图管理对象
vid:地图容器节点的ID
zooms: 地图显示的缩放级别范围,在PC上,默认范围[3,18],取值范围[3-18];在移动设备上,默认范围[3-19],取值范围[3-19]
center: 地图中心点坐标值
plugin:地图使用的插件
events: 事件
-->
<el-amap class="amap-box"
:amap-manager="amapManager"
:vid="'amap-vue'"
:zoom="zoom"
:plugin="plugin"
:center="center"
:events="events"
>
<!-- 标记 -->
<el-amap-marker v-for="(marker, index) in markers" :position="marker" :key="index"></el-amap-marker>
</el-amap>
</div>
</div>
</template>
<script>
import { AMapManager, lazyAMapApiLoaderInstance } from "vue-amap";
let amapManager = new AMapManager();
export default {
name: "AMap",
data() {
let self = this;
return {
address: null,
searchKey: "",
amapManager,
markers: [],
searchOption: {
city: "全国",
citylimit: true,
},
center: [112.938888, 28.228272],
zoom: 17,
lng: 0,
lat: 0,
loaded: false,
events: {
init() {
lazyAMapApiLoaderInstance.load().then(() => {
self.initSearch();
});
},
// 点击获取地址的数据
click(e) {
self.markers = [];
let { lng, lat } = e.lnglat;
self.lng = lng;
self.lat = lat;
self.center = [lng, lat];
self.markers.push([lng, lat]);
// 这里通过高德 SDK 完成。
let geocoder = new AMap.Geocoder({
radius: 1000,
extensions: "all",
});
geocoder.getAddress([lng, lat], function (status, result) {
if (status === "complete" && result.info === "OK") {
if (result && result.regeocode) {
console.log(result.regeocode.formattedAddress); //控制台打印地址
self.address = result.regeocode.formattedAddress;
self.searchKey = result.regeocode.formattedAddress;
self.$nextTick();
}
}
});
},
},
// 一些工具插件
plugin: [
{
pName: "Geocoder",
events: {
init(o) {
//console.log("一些工具插件--地址"+o.getAddress())
},
},
},
{
// 定位
pName: "Geolocation",
events: {
init(o) {
// o是高德地图定位插件实例
o.getCurrentPosition((status, result) => {
if (result && result.position) {
// 设置经度
self.lng = result.position.lng;
// 设置维度
self.lat = result.position.lat;
// 设置坐标
self.center = [self.lng, self.lat];
self.markers.push([self.lng, self.lat]);
// load
self.loaded = true;
// 页面渲染好后
self.$nextTick();
}
});
},
},
},
{
// 工具栏
pName: "ToolBar",
events: {
init(instance) {
//console.log("工具栏:"+instance);
},
},
},
{
// 鹰眼
pName: "OverView",
events: {
init(instance) {
//console.log("鹰眼:"+instance);
},
},
},
{
// 地图类型
pName: "MapType",
defaultType: 0,
events: {
init(instance) {
//console.log("地图类型:"+instance);
},
},
},
{
// 搜索
pName: "PlaceSearch",
events: {
init(instance) {
//console.log("搜索:"+instance)
},
},
},
],
};
},
methods: {
initSearch() {
let vm = this;
let map = this.amapManager.getMap();
AMapUI.loadUI(["misc/PoiPicker"], function (PoiPicker) {
var poiPicker = new PoiPicker({
input: "search",
placeSearchOptions: {
map: map,
pageSize: 10,
},
suggestContainer: "searchTip",
searchResultsContainer: "searchTip",
});
vm.poiPicker = poiPicker;
// 监听poi选中信息
poiPicker.on("poiPicked", function (poiResult) {
// console.log(poiResult)
let source = poiResult.source;
let poi = poiResult.item;
if (source !== "search") {
poiPicker.searchByKeyword(poi.name);
} else {
poiPicker.clearSearchResults();
vm.markers = [];
let lng = poi.location.lng;
let lat = poi.location.lat;
let address = poi.cityname + poi.adname + poi.name;
vm.center = [lng, lat];
vm.markers.push([lng, lat]);
vm.lng = lng;
vm.lat = lat;
vm.address = address;
vm.searchKey = address;
}
});
});
},
searchByHand() {
if (this.searchKey !== "") {
this.poiPicker.searchByKeyword(this.searchKey);
}
},
},
};
</script>
<style lang="css">
.container {
width: 100%;
height: 100%;
position: relative;
left: 50%;
top: 50%;
transform: translate3d(-50%, -50%, 0);
border: 1px solid #999;
}
.search-box {
position: absolute;
z-index: 5;
width: 30%;
left: 13%;
top: 10px;
height: 30px;
}
.search-box input {
float: left;
width: 80%;
height: 100%;
border: 1px solid #30ccc1;
padding: 0 8px;
outline: none;
}
.search-box button {
float: left;
width: 20%;
height: 100%;
background: #30ccc1;
border: 1px solid #30ccc1;
color: #fff;
outline: none;
}
.tip-box {
width: 100%;
max-height: 260px;
position: absolute;
top: 30px;
overflow-y: auto;
background-color: #fff;
}
</style>
<script>
export default {
props: {
handleSelectionChange: {
type: Function,
required: false,
default: () => {},
},
handleRowClick: {
type: Function,
required: false,
default: () => {},
},
tableRowClassName: {
type: Function,
required: false,
default: () => {},
},
tableData: {
type: Array,
required: false,
default: () => [],
},
columns: {
type: Array,
required: false,
default: () => [],
},
dict: {
type: Object,
required: false,
default: () => {},
},
},
methods: {
// 开标状态
bidStatus(v) {
switch (v) {
case 0:
return "type1";
case 4:
return "type3";
default:
return "type2";
}
},
// 格式化
formatter(v, code) {
return this.dict[code] ? this.dict[code][v] : "--";
},
cell(row, column, cellValue, index) {
column.property = column.prop;
if (column.formatter)
return column.formatter(row, column, cellValue, index);
return false;
},
},
data() {
return {
src: require(`@/assets/images/1.png`),
};
},
render() {
return (
<div>
{this.tableData.map((item, index) => {
console.log(item);
let arrs = this.columns
.filter((i) => !i.type)
.filter((i) => !i.title)
.filter((i) => i.flow);
return (
<el-row>
<el-row gutter="20">
<el-col span="22">
{" "}
<div
onClick={() =>
this.handleRowClick(item, this.columns, null)
}
>
<el-descriptions
column={arrs.length}
size="small"
title={this.columns
.filter((i) => i.title)
.map((column) => item[column.prop])}
>
{arrs
.filter((i) => i.label != "操作")
.map((column) => {
return (
<el-descriptions-item label={column.label}>
{this.cell(
item,
column,
item[column.prop],
index
) || item[column.prop]}
</el-descriptions-item>
);
})}
</el-descriptions>
</div>
{arrs
.filter((i) => i.label == "操作")
.map((column) => {
return (
<div
style="margin-left:5px;margin-top:3px"
label={column.label}
>
{this.cell(item, column, item[column.prop], index) ||
item[column.prop]}
</div>
);
})}
</el-col>
<el-col span="2">
<span
class="state_box"
class={[this.bidStatus(item.projectOpenBidStatus)]}
>
{this.formatter(
item.projectOpenBidStatus,
"projectOpenBidStatus"
)}
</span>
</el-col>
</el-row>
<el-row>
{" "}
<el-divider />
</el-row>
</el-row>
);
})}
</div>
);
},
};
</script>
<style lang="less" scoped>
.state_box {
position: relative;
width: 80px;
height: 80px;
text-align: center;
line-height: 80px;
right: 15px;
top: 10px;
display: inline-block;
border-radius: 50%;
transform: rotateZ(45deg);
font-size: 13px;
}
.type1 {
color: tomato;
border: 2px solid tomato;
&:extend(.state_box);
}
.type2 {
color: #1334a7;
border: 2px solid #1334a7;
&:extend(.state_box);
}
.type3 {
color: #999;
border: 2px solid #999;
&:extend(.state_box);
}
</style>
\ No newline at end of file
<template>
<el-table
v-loading="loading"
:data="tableData"
row-key="id"
border
@row-click="handleRowClick"
:row-class-name="tableRowClassName"
:default-expand-all="expand"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<el-table-column
v-for='column in columns'
:key='column.prop'
:type="column.type"
:prop="column.prop"
:label="column.label"
:width="column.width"
:show-overflow-tooltip="column.tooltip"
:align="column.align || 'left'"
:formatter='column.formatter'
>
</el-table-column>
</el-table>
</template>
<script>
export default {
props: {
handleSpanMethod: {
type: Function,
required: false,
default: () => {}
},
handleRowClick: {
type: Function,
required: false,
default: () => {}
},
tableRowClassName: {
type: Function,
required: false,
default: () => {}
},
loading: {
type: Boolean,
required: false,
default: true
},
expand: {
type: Boolean,
required: false,
default: true
},
tableData: {
type: Array,
required: false,
default: () => []
},
columns: {
type: Array,
required: false,
default: ()=> [],
}
},
computed: {
emptyText() {
return (!this.loading && !this.tableData.length) ? '暂无数据' : '加载中...'
},
},
data() {
return {}
}
}
</script>
This diff is collapsed.
This diff is collapsed.
<template>
<el-image
:src="`${realSrc}`"
fit="cover"
:style="`width:${realWidth};height:${realHeight};`"
:preview-src-list="realSrcList"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline"></i>
</div>
</el-image>
</template>
<script>
export default {
name: "ImagePreview",
props: {
src: {
type: String,
required: true,
},
width: {
type: [Number, String],
default: "",
},
height: {
type: [Number, String],
default: "",
},
},
computed: {
realSrc() {
let real_src = this.src.split(",")[0];
return real_src;
},
realSrcList() {
let real_src_list = this.src.split(",");
let srcList = [];
real_src_list.forEach((item) => {
return srcList.push(item);
});
return srcList;
},
realWidth() {
return typeof this.width == "string" ? this.width : `${this.width}px`;
},
realHeight() {
return typeof this.height == "string" ? this.height : `${this.height}px`;
},
},
};
</script>
<style lang="scss" scoped>
.el-image {
border-radius: 5px;
background-color: #ebeef5;
box-shadow: 0 0 5px 1px #ccc;
::v-deep .el-image__inner {
transition: all 0.3s;
cursor: pointer;
&:hover {
transform: scale(1.2);
}
}
::v-deep .image-slot {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
color: #909399;
font-size: 30px;
}
}
</style>
This diff is collapsed.
<template>
<div v-show="props.compType === 'divider'">
<el-form-item label="ID">
<el-tooltip class="item" effect="dark" content="请注意,ID的修改可能会导致该组件相关事件失效!" placement="left">
<el-input class="input" v-model="props.id" ></el-input>
</el-tooltip>
</el-form-item>
<el-form-item label="文字">
<el-input class="input" v-model="props.text"></el-input>
</el-form-item>
<el-form-item label="文字大小">
<el-radio-group v-model="props['content-position']">
<el-radio-button label="left"></el-radio-button>
<el-radio-button label="center"></el-radio-button>
<el-radio-button label="right"></el-radio-button>
</el-radio-group>
</el-form-item>
</div>
</template>
<script>
/**
* input的配置项
*/
export default {
name:"dividerConfig",
props:{
props:{}
},
data(){
return {
}
},
methods:{
},
mounted(){
}
}
</script>
This diff is collapsed.
This diff is collapsed.
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