提交 100040a9 编写于 作者: yanshaowei's avatar yanshaowei

init

上级
流水线 #221 已失败 ,包含阶段
.DS_Store
node_modules
/dist
/tests/e2e/videos/
/tests/e2e/screenshots/
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# Vue_Mobile_R6
#### Description
Vue_Mobile_R6基础文件
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
#### Gitee Feature
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
\ No newline at end of file
# Vue_Mobile_R6
#### 介绍
Vue_Mobile_R6基础文件
#### 软件架构
软件架构说明
#### 安装教程
1. xxxx
2. xxxx
3. xxxx
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 码云特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
\ No newline at end of file
module.exports = {
presets: [
'@vue/app'
]
}
{
"pluginsFile": "tests/e2e/plugins/index.js"
}
{
"name": "vue-mobile-project",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"test:e2e": "vue-cli-service test:e2e",
"test:unit": "vue-cli-service test:unit"
},
"dependencies": {
"@nutui/nutui": "^2.1.6",
"axios": "^0.19.0",
"core-js": "^2.6.5",
"font-awesome": "^4.7.0",
"mint-ui": "^2.2.13",
"moment": "^2.24.0",
"register-service-worker": "^1.6.2",
"rxjs": "^6.5.3",
"vant": "^2.2.7",
"echarts": "4.1.0",
"vue": "^2.6.10",
"vue-calendar-component": "^2.8.2",
"mpvue-calendar": "^2.3.1",
"vue-event-calendar": "^1.5.2",
"vue-class-component": "^7.0.2",
"vue-property-decorator": "^8.1.0",
"vue-router": "^3.0.3",
"vuex": "^3.0.1"
},
"devDependencies": {
"@types/jest": "^23.1.4",
"@vue/cli-plugin-babel": "^3.12.0",
"@vue/cli-plugin-e2e-cypress": "^3.12.0",
"@vue/cli-plugin-eslint": "^3.12.0",
"@vue/cli-plugin-pwa": "^3.12.0",
"@vue/cli-plugin-typescript": "^3.12.0",
"@vue/cli-plugin-unit-jest": "^3.12.0",
"@vue/cli-service": "^3.12.0",
"@vue/eslint-config-typescript": "^4.0.0",
"@vue/test-utils": "1.0.0-beta.29",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"less": "^3.0.4",
"less-loader": "^5.0.0",
"ts-jest": "^23.0.0",
"typescript": "^3.4.3",
"vue-template-compiler": "^2.6.10"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended",
"@vue/typescript"
],
"rules": {},
"parserOptions": {
"parser": "@typescript-eslint/parser"
},
"overrides": [
{
"files": [
"**/__tests__/*.{j,t}s?(x)"
],
"env": {
"jest": true
}
}
]
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions"
],
"jest": {
"moduleFileExtensions": [
"js",
"jsx",
"json",
"vue",
"ts",
"tsx"
],
"transform": {
"^.+\\.vue$": "vue-jest",
".+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$": "jest-transform-stub",
"^.+\\.tsx?$": "ts-jest"
},
"transformIgnorePatterns": [
"/node_modules/"
],
"moduleNameMapper": {
"^@/(.*)$": "<rootDir>/src/$1"
},
"snapshotSerializers": [
"jest-serializer-vue"
],
"testMatch": [
"**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"
],
"testURL": "http://localhost/",
"watchPlugins": [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname"
],
"globals": {
"ts-jest": {
"babelConfig": true
}
}
}
}
<!DOCTYPE html>
<html lang="cn" style="overflow: hidden;">
<head>
<title>404 页面不存在</title>
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,width=device-width,initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="404" />
<style>
.error-page {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
text-align: center;
}
.info_num {
color: #26a2ff;
font-size: 3.4em;
font-weight: 400;
line-height: 2.3em;
position: relative;
left: -0.3em;
}
.info_error {
color: #26a2ff;
font-size: 1.7em;
}
.error_text {
color: #939191;
}
.error_line {
margin: 0 auto;
margin-bottom: 1.7em;
}
.backHome {
background: #26a2ff;
padding: 0.8em 4.5em;
color: white;
border-radius: 4px;
margin-bottom: 0.6em;
text-decoration: none;
}
.error-header{
display: flex;
justify-content: center;
}
.error-img-box{
width: 50%;
}
.error-img{
width: 100%;
}
.error-header-text{
font-size: 1.5em;
color: #939191;
position: relative;
top: -0.3em;
}
</style>
</head>
<body>
<div class="error-page">
<div class="error-box">
<div class="error_line">
<div class="error-header">
<div class="error-img-box"> <img class="error-img" src="./images/errorImg.png" alt=""></div>
<div class="info_num">404</div>
</div>
<div class="info_error">Page Not Found</div>
</div>
<div class="error_line">
<div class="error_text">对不起,您访问的页面不存在</div>
</div>
<div class="error_line">
<a class="backHome" href="/#/" >返回首页</a>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="cn" style="overflow: hidden;">
<head>
<title>422 请求被拒绝</title>
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,width=device-width,initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="422" />
<style>
.error-page {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
text-align: center;
}
.info_num {
color: #26a2ff;
font-size: 3.4em;
font-weight: 400;
line-height: 2.3em;
position: relative;
left: -0.3em;
}
.info_error {
color: #26a2ff;
font-size: 1.7em;
}
.error_text {
color: #939191;
}
.error_line {
margin: 0 auto;
margin-bottom: 1.7em;
}
.backHome {
background: #26a2ff;
padding: 0.8em 4.5em;
color: white;
border-radius: 4px;
margin-bottom: 0.6em;
text-decoration: none;
}
.error-header{
display: flex;
justify-content: center;
}
.error-img-box{
width: 50%;
}
.error-img{
width: 100%;
}
.error-header-text{
font-size: 1.5em;
color: #939191;
position: relative;
top: -0.3em;
}
</style>
</head>
<body>
<div class="error-page">
<div class="error-box">
<div class="error_line">
<div class="error-header">
<div class="error-img-box"> <img class="error-img" src="./images/errorImg.png" alt=""></div>
<div class="info_num">422</div>
</div>
<div class="info_error">Unprocessable Entity</div>
</div>
<div class="error_line">
<div class="error_text">对不起,您的请求被拒绝</div>
</div>
<div class="error_line">
<a class="backHome" href="/#/" >返回首页</a>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="cn" style="overflow: hidden;">
<head>
<title>500 服务器发生错误</title>
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,width=device-width,initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="500" />
<style>
.error-page {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
text-align: center;
}
.info_num {
color: #26a2ff;
font-size: 3.4em;
font-weight: 400;
line-height: 2.3em;
position: relative;
left: -0.3em;
}
.info_error {
color: #26a2ff;
font-size: 1.7em;
}
.error_text {
color: #939191;
}
.error_line {
margin: 0 auto;
margin-bottom: 1.7em;
}
.backHome {
background: #26a2ff;
padding: 0.8em 4.5em;
color: white;
border-radius: 4px;
margin-bottom: 0.6em;
text-decoration: none;
}
.error-header{
display: flex;
justify-content: center;
}
.error-img-box{
width: 50%;
}
.error-img{
width: 100%;
}
.error-header-text{
font-size: 1.5em;
color: #939191;
position: relative;
top: -0.3em;
}
</style>
</head>
<body>
<div class="error-page">
<div class="error-box">
<div class="error_line">
<div class="error-header">
<div class="error-img-box"> <img class="error-img" src="./images/errorImg.png" alt=""></div>
<div class="info_num">500</div>
</div>
<div class="info_error">Internal Server Error</div>
</div>
<div class="error_line">
<div class="error_text">对不起,您访问的服务器发生错误</div>
</div>
<div class="error_line">
<a class="backHome" href="/#/" >返回首页</a>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="cn" style="overflow: hidden;">
<head>
<title>502 无响应</title>
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,width=device-width,initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="502" />
<style>
.error-page {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
text-align: center;
}
.info_num {
color: #26a2ff;
font-size: 3.4em;
font-weight: 400;
line-height: 2.3em;
position: relative;
left: -0.3em;
}
.info_error {
color: #26a2ff;
font-size: 1.7em;
}
.error_text {
color: #939191;
}
.error_line {
margin: 0 auto;
margin-bottom: 1.7em;
}
.backHome {
background: #26a2ff;
padding: 0.8em 4.5em;
color: white;
border-radius: 4px;
margin-bottom: 0.6em;
text-decoration: none;
}
.error-header{
display: flex;
justify-content: center;
}
.error-img-box{
width: 50%;
}
.error-img{
width: 100%;
}
.error-header-text{
font-size: 1.5em;
color: #939191;
position: relative;
top: -0.3em;
}
</style>
</head>
<body>
<div class="error-page">
<div class="error-box">
<div class="error_line">
<div class="error-header">
<div class="error-img-box"> <img class="error-img" src="./images/errorImg.png" alt=""></div>
<div class="info_num">502</div>
</div>
<div class="info_error">Bad Gateway</div>
</div>
<div class="error_line">
<div class="error_text">对不起,您访问的页面无响应</div>
</div>
<div class="error_line">
<a class="backHome" href="/#/" >返回首页</a>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="cn" style="overflow: hidden;">
<head>
<title>503 不可用</title>
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,width=device-width,initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="404" />
<style>
.error-page {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
text-align: center;
}
.info_num {
color: #26a2ff;
font-size: 3.4em;
font-weight: 400;
line-height: 2.3em;
position: relative;
left: -0.3em;
}
.info_error {
color: #26a2ff;
font-size: 1.7em;
}
.error_text {
color: #939191;
}
.error_line {
margin: 0 auto;
margin-bottom: 1.7em;
}
.backHome {
background: #26a2ff;
padding: 0.8em 4.5em;
color: white;
border-radius: 4px;
margin-bottom: 0.6em;
text-decoration: none;
}
.error-header{
display: flex;
justify-content: center;
}
.error-img-box{
width: 50%;
}
.error-img{
width: 100%;
}
.error-header-text{
font-size: 1.5em;
color: #939191;
position: relative;
top: -0.3em;
}
</style>
</head>
<body>
<div class="error-page">
<div class="error-box">
<div class="error_line">
<div class="error-header">
<div class="error-img-box"><img class="error-img" src="./images/errorImg.png" alt=""></div>
<div class="info_num">503</div>
</div>
<div class="info_error">Service Unavailable</div>
</div>
<div class="error_line">
<div class="error_text">对不起,您访问的页面不可用</div>
</div>
<div class="error_line">
<a class="backHome" href="/#/" >返回首页</a>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="cn" style="overflow: hidden;">
<head>
<title>ERROR</title>
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,width=device-width,initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="error" />
<style>
.error-page {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
text-align: center;
}
.info_num {
color: #26a2ff;
font-size: 3.4em;
font-weight: 400;
line-height: 2.3em;
position: relative;
left: -0.3em;
}
.info_error {
color: #26a2ff;
font-size: 1.7em;
}
.error_text {
color: #939191;
}
.error_line {
margin: 0 auto;
margin-bottom: 1.7em;
}
.backHome {
background: #26a2ff;
padding: 0.8em 4.5em;
color: white;
border-radius: 4px;
margin-bottom: 0.6em;
text-decoration: none;
}
.error-header{
display: flex;
justify-content: center;
}
.error-img-box{
width: 50%;
}
.error-img{
width: 100%;
}
.error-header-text{
font-size: 1.5em;
color: #939191;
position: relative;
top: -0.3em;
}
</style>
</head>
<body>
<div class="error-page">
<div class="error-box">
<div class="error_line">
<div class="error-header">
<div class="error-img-box"> <img class="error-img" src="./images/errorImg.png" alt=""></div>
<div class="info_num">Error</div>
</div>
<div class="error_line">
<div class="error_text">发生未知错误</div>
</div>
<div class="error_line">
<a class="backHome" href="/#/" >返回首页</a>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="16.000000pt" height="16.000000pt" viewBox="0 0 16.000000 16.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.11, written by Peter Selinger 2001-2013
</metadata>
<g transform="translate(0.000000,16.000000) scale(0.000320,-0.000320)"
fill="#000000" stroke="none">
<path d="M18 46618 c45 -75 122 -207 122 -211 0 -2 25 -45 55 -95 30 -50 55
-96 55 -102 0 -5 5 -10 10 -10 6 0 10 -4 10 -9 0 -5 73 -135 161 -288 89 -153
173 -298 187 -323 14 -25 32 -57 41 -72 88 -149 187 -324 189 -335 2 -7 8 -13
13 -13 5 0 9 -4 9 -10 0 -5 46 -89 103 -187 175 -302 490 -846 507 -876 8 -16
20 -36 25 -45 28 -46 290 -498 339 -585 13 -23 74 -129 136 -236 61 -107 123
-215 137 -240 14 -25 29 -50 33 -56 5 -5 23 -37 40 -70 18 -33 38 -67 44 -75
11 -16 21 -33 63 -109 14 -25 29 -50 33 -56 4 -5 21 -35 38 -65 55 -100 261
-455 269 -465 4 -5 14 -21 20 -35 15 -29 41 -75 103 -180 24 -41 52 -88 60
-105 9 -16 57 -100 107 -185 112 -193 362 -626 380 -660 8 -14 23 -38 33 -55
11 -16 23 -37 27 -45 4 -8 26 -46 48 -85 23 -38 53 -90 67 -115 46 -81 64
-113 178 -310 62 -107 121 -210 132 -227 37 -67 56 -99 85 -148 16 -27 32 -57
36 -65 4 -8 15 -27 25 -42 9 -15 53 -89 96 -165 44 -76 177 -307 296 -513 120
-206 268 -463 330 -570 131 -227 117 -203 200 -348 36 -62 73 -125 82 -140 10
-15 21 -34 25 -42 4 -8 20 -37 36 -65 17 -27 38 -65 48 -82 49 -85 64 -111 87
-153 13 -25 28 -49 32 -55 4 -5 78 -134 165 -285 87 -151 166 -288 176 -305
10 -16 26 -43 35 -59 9 -17 125 -217 257 -445 132 -229 253 -441 270 -471 17
-30 45 -79 64 -108 18 -29 33 -54 33 -57 0 -2 20 -37 44 -77 24 -40 123 -212
221 -383 97 -170 190 -330 205 -355 16 -25 39 -65 53 -90 13 -25 81 -144 152
-265 70 -121 137 -238 150 -260 12 -22 37 -65 55 -95 18 -30 43 -73 55 -95 12
-22 48 -85 80 -140 77 -132 163 -280 190 -330 13 -22 71 -123 130 -225 59
-102 116 -199 126 -217 10 -17 29 -50 43 -72 15 -22 26 -43 26 -45 0 -2 27
-50 60 -106 33 -56 60 -103 60 -105 0 -2 55 -98 90 -155 8 -14 182 -316 239
-414 13 -22 45 -79 72 -124 27 -46 49 -86 49 -89 0 -2 14 -24 30 -48 16 -24
30 -46 30 -49 0 -5 74 -135 100 -176 5 -8 24 -42 43 -75 50 -88 58 -101 262
-455 104 -179 199 -345 213 -370 14 -25 28 -49 32 -55 4 -5 17 -26 28 -45 10
-19 62 -109 114 -200 114 -197 133 -230 170 -295 16 -27 33 -57 38 -65 17 -28
96 -165 103 -180 4 -8 16 -28 26 -45 10 -16 77 -131 148 -255 72 -124 181
-313 243 -420 62 -107 121 -209 131 -227 35 -62 323 -560 392 -678 38 -66 83
-145 100 -175 16 -30 33 -59 37 -65 4 -5 17 -27 29 -47 34 -61 56 -100 90
-156 17 -29 31 -55 31 -57 0 -2 17 -32 39 -67 21 -35 134 -229 251 -433 117
-203 235 -407 261 -451 27 -45 49 -85 49 -88 0 -4 8 -19 19 -34 15 -21 200
-341 309 -533 10 -19 33 -58 51 -87 17 -29 31 -54 31 -56 0 -2 25 -44 55 -94
30 -50 55 -95 55 -98 0 -4 6 -15 14 -23 7 -9 27 -41 43 -71 17 -30 170 -297
342 -594 171 -296 311 -542 311 -547 0 -5 5 -9 10 -9 6 0 10 -4 10 -10 0 -5
22 -47 49 -92 27 -46 58 -99 68 -118 24 -43 81 -140 93 -160 5 -8 66 -114 135
-235 69 -121 130 -227 135 -235 12 -21 259 -447 283 -490 10 -19 28 -47 38
-62 11 -14 19 -29 19 -32 0 -3 37 -69 83 -148 99 -170 305 -526 337 -583 13
-22 31 -53 41 -70 11 -16 22 -37 26 -45 7 -14 82 -146 103 -180 14 -24 181
-311 205 -355 13 -22 46 -80 75 -130 29 -49 64 -110 78 -135 14 -25 51 -88 82
-140 31 -52 59 -102 63 -110 4 -8 18 -33 31 -55 205 -353 284 -489 309 -535
17 -30 45 -78 62 -106 18 -28 36 -60 39 -72 4 -12 12 -22 17 -22 5 0 9 -4 9
-10 0 -5 109 -197 241 -427 133 -230 250 -431 259 -448 51 -90 222 -385 280
-485 37 -63 78 -135 92 -160 14 -25 67 -117 118 -205 51 -88 101 -175 111
-193 34 -58 55 -95 149 -257 51 -88 101 -173 110 -190 9 -16 76 -131 147 -255
72 -124 140 -241 151 -260 61 -108 281 -489 355 -615 38 -66 77 -133 87 -150
35 -63 91 -161 100 -175 14 -23 99 -169 128 -220 54 -97 135 -235 142 -245 4
-5 20 -32 35 -60 26 -48 238 -416 276 -480 10 -16 26 -46 37 -65 30 -53 382
-661 403 -695 10 -16 22 -37 26 -45 4 -8 26 -48 50 -88 24 -41 43 -75 43 -77
0 -2 22 -40 50 -85 27 -45 50 -84 50 -86 0 -3 38 -69 83 -147 84 -142 302
-520 340 -587 10 -19 34 -60 52 -90 18 -30 44 -75 57 -100 14 -25 45 -79 70
-120 25 -41 56 -96 70 -121 14 -25 77 -133 138 -240 62 -107 122 -210 132
-229 25 -43 310 -535 337 -581 11 -19 26 -45 34 -59 17 -32 238 -414 266 -460
11 -19 24 -41 28 -49 3 -7 75 -133 160 -278 84 -146 153 -269 153 -274 0 -5 5
-9 10 -9 6 0 10 -4 10 -10 0 -5 82 -150 181 -322 182 -314 201 -346 240 -415
12 -21 80 -139 152 -263 71 -124 141 -245 155 -270 14 -25 28 -49 32 -55 6 -8
145 -248 220 -380 37 -66 209 -362 229 -395 11 -19 24 -42 28 -49 4 -8 67
-118 140 -243 73 -125 133 -230 133 -233 0 -2 15 -28 33 -57 19 -29 47 -78 64
-108 17 -30 53 -93 79 -139 53 -90 82 -141 157 -272 82 -142 115 -199 381
-659 142 -245 268 -463 281 -485 12 -22 71 -125 132 -230 60 -104 172 -298
248 -430 76 -132 146 -253 156 -270 11 -16 22 -36 26 -44 3 -8 30 -54 60 -103
29 -49 53 -91 53 -93 0 -3 18 -34 40 -70 22 -36 40 -67 40 -69 0 -2 37 -66 81
-142 45 -77 98 -168 119 -204 20 -36 47 -81 58 -100 12 -19 27 -47 33 -62 6
-16 15 -28 20 -28 5 0 9 -4 9 -9 0 -6 63 -118 140 -251 77 -133 140 -243 140
-245 0 -2 18 -33 41 -70 22 -37 49 -83 60 -101 10 -19 29 -51 40 -71 25 -45
109 -189 126 -218 7 -11 17 -29 22 -40 6 -11 22 -38 35 -60 14 -22 37 -62 52
-90 14 -27 35 -62 45 -77 11 -14 19 -29 19 -32 0 -3 18 -35 40 -71 22 -36 40
-67 40 -69 0 -2 19 -35 42 -72 23 -38 55 -94 72 -124 26 -47 139 -244 171
-298 6 -9 21 -36 34 -60 28 -48 37 -51 51 -19 6 12 19 36 29 52 10 17 27 46
38 65 11 19 104 181 208 360 103 179 199 345 213 370 14 25 42 74 64 109 21
34 38 65 38 67 0 2 18 33 40 69 22 36 40 67 40 69 0 3 177 310 199 346 16 26
136 234 140 244 2 5 25 44 52 88 27 44 49 81 49 84 0 2 18 34 40 70 22 36 40
67 40 69 0 2 20 36 43 77 35 58 169 289 297 513 9 17 50 86 90 155 40 69 86
150 103 180 16 30 35 62 41 70 6 8 16 24 22 35 35 64 72 129 167 293 59 100
116 199 127 220 11 20 30 53 41 72 43 72 1070 1850 1121 1940 14 25 65 113
113 195 48 83 96 166 107 185 10 19 28 50 38 68 11 18 73 124 137 235 64 111
175 303 246 427 71 124 173 299 225 390 52 91 116 202 143 248 27 45 49 85 49
89 0 4 6 14 14 22 7 9 28 43 46 76 26 47 251 436 378 655 11 19 29 51 40 70
11 19 101 176 201 348 99 172 181 317 181 323 0 5 5 9 10 9 6 0 10 5 10 11 0
6 8 23 18 37 11 15 32 52 49 82 16 30 130 228 253 440 122 212 234 405 248
430 13 25 39 70 57 100 39 65 69 117 130 225 25 44 50 87 55 95 12 19 78 134
220 380 61 107 129 224 150 260 161 277 222 382 246 425 15 28 47 83 71 123
24 41 43 78 43 83 0 5 4 9 8 9 4 0 13 12 19 28 7 15 23 45 36 67 66 110 277
478 277 483 0 3 6 13 14 21 7 9 27 41 43 71 17 30 45 80 63 110 34 57 375 649
394 685 6 11 16 27 22 35 6 8 26 42 44 75 18 33 41 74 51 90 10 17 24 41 32
55 54 97 72 128 88 152 11 14 19 28 19 30 0 3 79 141 175 308 96 167 175 305
175 308 0 3 6 13 14 21 7 9 26 39 41 66 33 60 276 483 338 587 24 40 46 80 50
88 4 8 13 24 20 35 14 23 95 163 125 215 11 19 52 91 92 160 40 69 80 139 90
155 9 17 103 179 207 360 105 182 200 346 211 365 103 181 463 802 489 845 7
11 15 27 19 35 4 8 29 51 55 95 64 110 828 1433 848 1470 9 17 24 41 33 55 9
14 29 48 45 77 15 28 52 93 82 145 30 51 62 107 71 123 17 30 231 398 400 690
51 88 103 179 115 202 12 23 26 48 32 55 6 7 24 38 40 68 17 30 61 107 98 170
37 63 84 144 103 180 19 36 41 72 48 81 8 8 14 18 14 21 0 4 27 51 59 106 32
55 72 124 89 154 16 29 71 125 122 213 51 88 104 180 118 205 13 25 28 50 32
55 4 6 17 26 28 45 11 19 45 80 77 135 31 55 66 116 77 135 11 19 88 152 171
295 401 694 620 1072 650 1125 11 19 87 152 170 295 83 143 158 273 166 288 9
16 21 36 26 45 6 9 31 52 55 96 25 43 54 94 66 115 11 20 95 164 186 321 91
157 173 299 182 315 9 17 26 46 37 65 12 19 66 114 121 210 56 96 108 186 117
200 8 14 24 40 34 59 24 45 383 664 412 713 5 9 17 29 26 45 15 28 120 210
241 419 36 61 68 117 72 125 4 8 12 23 19 34 35 57 245 420 262 453 11 20 35
61 53 90 17 29 32 54 32 56 0 3 28 51 62 108 33 57 70 119 80 138 10 19 23 42
28 50 5 8 32 53 59 100 27 47 149 258 271 470 122 212 234 405 248 430 30 53
62 108 80 135 6 11 15 27 19 35 4 8 85 150 181 315 96 165 187 323 202 350 31
56 116 202 130 225 5 8 25 42 43 75 19 33 92 159 162 280 149 257 157 271 202
350 19 33 38 67 43 75 9 14 228 392 275 475 12 22 55 96 95 165 40 69 80 139
90 155 24 42 202 350 221 383 9 15 27 47 41 72 14 25 75 131 136 236 61 106
121 210 134 232 99 172 271 470 279 482 5 8 23 40 40 70 18 30 81 141 142 245
60 105 121 210 135 235 14 25 71 124 127 220 56 96 143 247 194 335 51 88 96
167 102 175 14 24 180 311 204 355 23 43 340 590 356 615 5 8 50 87 101 175
171 301 517 898 582 1008 25 43 46 81 46 83 0 2 12 23 27 47 14 23 40 67 56
97 16 30 35 62 42 70 7 8 15 22 18 30 4 8 20 38 37 65 16 28 33 57 37 65 6 12
111 196 143 250 5 8 55 95 112 193 57 98 113 195 126 215 12 20 27 46 32 57 6
11 14 27 20 35 5 8 76 130 156 270 80 140 165 287 187 325 23 39 52 90 66 115
13 25 30 52 37 61 8 8 14 18 14 21 0 4 41 77 92 165 50 87 175 302 276 478
101 176 208 360 236 408 28 49 67 117 86 152 19 35 41 70 48 77 6 6 12 15 12
19 0 7 124 224 167 291 12 21 23 40 23 42 0 2 21 40 46 83 26 43 55 92 64 109
54 95 327 568 354 614 19 30 45 75 59 100 71 128 82 145 89 148 4 2 8 8 8 13
0 5 42 82 94 172 311 538 496 858 518 897 14 25 40 70 58 100 18 30 42 71 53
90 10 19 79 139 152 265 73 127 142 246 153 265 10 19 43 76 72 125 29 50 63
108 75 130 65 116 80 140 87 143 4 2 8 8 8 12 0 8 114 212 140 250 6 8 14 24
20 35 5 11 54 97 108 190 l100 170 -9611 3 c-5286 1 -9614 -1 -9618 -5 -5 -6
-419 -719 -619 -1068 -89 -155 -267 -463 -323 -560 -38 -66 -81 -140 -95 -165
-31 -56 -263 -457 -526 -910 -110 -190 -224 -388 -254 -440 -29 -52 -61 -109
-71 -125 -23 -39 -243 -420 -268 -465 -11 -19 -204 -352 -428 -740 -224 -388
-477 -826 -563 -975 -85 -148 -185 -322 -222 -385 -37 -63 -120 -207 -185
-320 -65 -113 -177 -306 -248 -430 -72 -124 -172 -297 -222 -385 -51 -88 -142
-245 -202 -350 -131 -226 -247 -427 -408 -705 -65 -113 -249 -432 -410 -710
-160 -278 -388 -673 -506 -877 -118 -205 -216 -373 -219 -373 -3 0 -52 82
-109 183 -58 100 -144 250 -192 332 -95 164 -402 696 -647 1120 -85 149 -228
396 -317 550 -212 365 -982 1700 -1008 1745 -10 19 -43 76 -72 125 -29 50 -64
110 -77 135 -14 25 -63 110 -110 190 -47 80 -96 165 -110 190 -14 25 -99 171
-188 325 -89 154 -174 300 -188 325 -13 25 -64 113 -112 195 -48 83 -140 242
-205 355 -65 113 -183 317 -263 454 -79 137 -152 264 -163 282 -50 89 -335
583 -354 614 -12 19 -34 58 -50 85 -15 28 -129 226 -253 440 -124 215 -235
408 -247 430 -12 22 -69 121 -127 220 -58 99 -226 389 -373 645 -148 256 -324
561 -392 678 -67 117 -134 232 -147 255 -13 23 -33 59 -46 80 l-22 37 -9615 0
-9615 0 20 -32z"/>
</g>
</svg>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>vue-mobile-project</title>
</head>
<body>
<noscript>
<strong>We're sorry but vue-mobile-project doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
</body>
</html>
<template>
<div id="app">
<router-view/>
</div>
</template>
<style lang="less">
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}
</style>
import axios from 'axios';
import { Environment } from '@/environments/environment.ts';
import Vue from 'vue';
/**
* Http net 对象
* 调用 getInstance() 获取实例
*
* @class Http
*/
export class Http {
/**
* 获取 Http 单例对象
*
* @static
* @returns {Http}
* @memberof Http
*/
public static getInstance(): Http {
if (!Http.Http) {
Http.Http = new Http();
}
return this.Http;
}
/**
* 单例变量声明
*
* @private
* @static
* @type {Http}
* @memberof Http
*/
private static Http: Http;
/**
* 统计加载
*
* @type {number}
* @memberof Http
*/
private loadingCount: number = 0;
/**
* Creates an instance of Http.
* 私有构造,拒绝通过 new 创建对象
*
* @memberof Http
*/
private constructor() { }
/**
* post请求
*
* @param {string} url
* @param {*} [params={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Http
*/
public post(url: string, params: any = {}, isloading:boolean = true): Promise<any> {
if (isloading) {
this.beginLoading();
}
return new Promise((resolve: any, reject: any) => {
axios({
method: 'post',
url: url,
data: { ...params },
headers: { 'Content-Type': 'application/json;charset=UTF-8', 'Accept': 'application/json' },
transformResponse: [(data: any) => {
let _data: any = null;
try {
_data = JSON.parse(JSON.parse(JSON.stringify(data)));
} catch (error) {
}
return _data;
}],
}).then((response: any) => {
if (isloading) {
this.endLoading();
}
resolve(response);
}).catch((response: any) => {
if (isloading) {
this.endLoading();
}
reject(response);
});
});
}
/**
* 多参数
*
* @param {string} url
* @param {*} [params={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Http
*/
public get(url: string, params: any = {}, isloading: boolean = true): Promise<any> {
if (Object.keys(params).length > 0) {
const _strParams: string = this.transformationOpt(params);
if (url.endsWith('?')) {
url = `${url}${_strParams}`;
} else if (url.indexOf('?') !== -1 && url.endsWith('&')) {
url = `${url}${_strParams}`;
} else if (url.indexOf('?') !== -1 && !url.endsWith('&')) {
url = `${url}&${_strParams}`;
} else {
url = `${url}?${_strParams}`;
}
}
if (isloading) {
this.beginLoading();
}
return new Promise((resolve: any, reject: any) => {
axios.get(url).then((response: any) => {
if (isloading) {
this.endLoading();
}
resolve(response);
}).catch((response: any) => {
if (isloading) {
this.endLoading();
}
reject(response);
});
});
}
/**
* 一级参数
*
* @param {string} url
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Http
*/
public get2(url: string, isloading:boolean = true): Promise<any> {
if (isloading) {
this.beginLoading();
}
return new Promise((resolve: any, reject: any) => {
axios.get(url).then((response: any) => {
if (isloading) {
this.endLoading();
}
resolve(response);
}).catch((response: any) => {
if (isloading) {
this.endLoading();
}
reject(response);
});
});
}
/**
* 请求参数转义处理
*
* @private
* @param {*} [opt={}]
* @returns {string}
* @memberof Http
*/
private transformationOpt(opt: any = {}): any {
const params: any = {};
const postData: string[] = [];
Object.assign(params, opt);
const keys: string[] = Object.keys(params);
keys.forEach((key: string) => {
const val: any = params[key];
if (val instanceof Array || val instanceof Object) {
postData.push(`${key}=${encodeURIComponent(JSON.stringify(val))}`);
} else {
postData.push(`${key}=${encodeURIComponent(val)}`);
}
});
return postData.join('&');
}
/**
* 开始加载
*
* @private
* @memberof Http
*/
private beginLoading(): void {
if (this.loadingCount === 0) {
Vue.prototype.$Loading().start();
}
this.loadingCount++;
}
/**
* 加载结束
*
* @private
* @memberof Http
*/
private endLoading(): void {
if (this.loadingCount > 0) {
this.loadingCount--;
}
setTimeout(() => {
if (this.loadingCount === 0) {
Vue.prototype.$Loading().finish();
}
}, 300);
}
}
\ No newline at end of file
import axios from 'axios';
import { Environment } from '@/environments/environment.ts';
/**
* 拦截器
*
* @export
* @class Interceptors
*/
export class Interceptors {
/**
* 路由对象
*
* @private
* @type {*}
* @memberof Interceptors
*/
private router: any
/**
* 拦截器实现接口
*
* @private
* @memberof Interceptors
*/
private intercept(): void {
axios.interceptors.request.use((config: any) => {
let appdata = null;
if (!Object.is(appdata, '')) {
config.headers.srfappdata = appdata;
}
if (window.localStorage.getItem('srfloginkey')) {
const token = window.localStorage.getItem('srfloginkey');
config.headers.Authorization = `Bearer ${token}`;
}
if (!config.url.startsWith('https://') && !config.url.startsWith('http://')) {
config.url = Environment.BaseUrl + config.url;
}
return config;
}, (error: any) => {
return Promise.reject(error);
});
axios.interceptors.response.use((response: any) => {
return response;
}, (error: any) => {
error = error ? error : { response: {} };
let { response: res } = error;
let { data } = res;
if (data) {
if (data.status === 401) {
this.doNoLogin(data.data);
}else if (data.status === 404) {
this.openErrorPage(404);
} else if (data.status === 422) {
this.openErrorPage(422);
} else if (data.status === 500) {
this.openErrorPage(500);
} else if (data.status === 502) {
this.openErrorPage(502);
} else if (data.status === 503) {
this.openErrorPage(503);
}
}
return Promise.reject(res);
});
}
/**
* 打开错误页
*
* @private
* @param {number} errorCode
* @memberof Interceptors
*/
private openErrorPage(errorCode: number): void {
window.location.href = `./error/${errorCode}.html`;
}
/**
* 处理未登录异常情况
*
* @private
* @param {*} [data={}]
* @memberof Interceptors
*/
private doNoLogin(data: any = {}): void {
if (data.loginurl && !Object.is(data.loginurl, '') && data.originurl && !Object.is(data.originurl, '')) {
let _url = encodeURIComponent(encodeURIComponent(window.location.href));
let loginurl: string = data.loginurl;
const originurl: string = data.originurl;
if (originurl.indexOf('?') === -1) {
_url = `${encodeURIComponent('?RU=')}${_url}`;
} else {
_url = `${encodeURIComponent('&RU=')}${_url}`;
}
loginurl = `${loginurl}${_url}`;
window.location.href = loginurl;
} else {
if (Object.is(this.router.currentRoute.name, 'login')) {
return;
}
this.router.push({ name: 'login', query: { redirect: this.router.currentRoute.fullPath } });
}
}
/**
* 构建对象
*
* @memberof Interceptors
*/
private constructor(router: any) {
this.router = router;
this.intercept();
}
/**
* 初始化变量
*
* @private
* @static
* @type {Interceptors}
* @memberof Interceptors
*/
private static interceptors: Interceptors;
/**
* 获取单例对象
*
* @static
* @returns {Interceptors}
* @memberof Interceptors
*/
public static getInstance(router: any): Interceptors {
if (!Interceptors.interceptors) {
Interceptors.interceptors = new Interceptors(router);
}
return this.interceptors;
}
}
export const AppComponents = {
install(v: any, opt: any) {
v.component('app-app-menu', () => import('@/components/app-app-menu/app-app-menu.vue'));
v.component('app-list-menu', () => import('@/components/app-list-menu/app-list-menu.vue'));
v.component('app-slider-menu', () => import('@/components/app-slider-menu/app-slider-menu.vue'));
v.component('app-icon-menu', () => import('@/components/app-icon-menu/app-icon-menu.vue'));
v.component('app-datetime-picker', () => import('@/components/app-datetime-picker/app-datetime-picker.vue'));
v.component('app-stepper', () => import('@/components/app-stepper/app-stepper.vue'));
v.component('app-input', () => import('@/components/app-input/app-input.vue'));
v.component('app-switch', () => import('@/components/app-switch/app-switch.vue'));
v.component('app-radio', () => import('@/components/app-radio/app-radio.vue'));
v.component('app-multiple-select', () => import('@/components/app-multiple-select/app-multiple-select.vue'));
v.component('app-select', () => import('@/components/app-select/app-select.vue'));
v.component('app-file-upload', () => import('@/components/app-file-upload/app-file-upload.vue'));
v.component('app-multiple-file-upload', () => import('@/components/app-multiple-file-upload/app-multiple-file-upload.vue'));
v.component('app-image-upload', () => import('@/components/app-image-upload/app-image-upload.vue'));
v.component('app-multiple-image-upload', () => import('@/components/app-multiple-image-upload/app-multiple-image-upload.vue'));
v.component('app-picker', () => import('@/components/app-picker/app-picker.vue'));
v.component('app-mpicker', () => import('@/components/app-mpicker/app-mpicker.vue'));
v.component('app-form-druipart', () => import('@/components/app-form-druipart/app-form-druipart.vue'));
v.component('app-card-list', () => import('@/components/app-card-list/app-card-list.vue'));
v.component('app-icon-list', () => import('@/components/app-icon-list/app-icon-list.vue'));
v.component('app-pic-menu', () => import('@/components/app-pic-menu/app-pic-menu.vue'));
v.component('app-picdown-menu', () => import('@/components/app-picdown-menu/app-picdown-menu.vue'));
v.component('app-picright-menu', () => import('@/components/app-picright-menu/app-picright-menu.vue'));
v.component('app-pictop-menu', () => import('@/components/app-pictop-menu/app-pictop-menu.vue'));
v.component('app-point-list', () => import('@/components/app-point-list/app-point-list.vue'));
v.component('app-round-list', () => import('@/components/app-round-list/app-round-list.vue'));
v.component('app-status-list', () => import('@/components/app-status-list/app-status-list.vue'));
v.component('app-table-list', () => import('@/components/app-table-list/app-table-list.vue'));
v.component('app-van-menu', () => import('@/components/app-van-menu/app-van-menu.vue'));
}
};
\ No newline at end of file
import { FormDetailModel } from './form-detail';
/**
* 按钮模型
*
* @export
* @class FormButtonModel
* @extends {FormDetailModel}
*/
export class FormButtonModel extends FormDetailModel {
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
/**
* 表单成员模型
*
* @export
* @class FormDetailModel
*/
export class FormDetailModel {
public caption: string = '';
public detailType: string = '';
public name: string = '';
public visible: boolean = true;
public isShowCaption: boolean = true;
constructor(opts: any = {}) {
this.caption = !Object.is(opts.caption, '') ? opts.caption : '';
this.detailType = !Object.is(opts.detailType, '') ? opts.detailType : '';
this.name = !Object.is(opts.name, '') ? opts.name : '';
this.visible = opts.visible ? true : false;
this.isShowCaption = opts.isShowCaption ? true : false;
}
public setVisible(state: boolean): void {
this.visible = state;
}
public setShowCaption(state: boolean): void {
this.isShowCaption = state;
}
}
\ No newline at end of file
import { FormDetailModel } from './form-detail';
/**
* 数据关系界面模型
*
* @export
* @class FromDRUIPartModel
* @extends {FormDetailModel}
*/
export class FromDRUIPartModel extends FormDetailModel {
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { FormDetailModel } from './form-detail';
/**
* 分组面板模型
*
* @export
* @class FormGroupPanelModel
* @extends {FormDetailModel}
*/
export class FormGroupPanelModel extends FormDetailModel {
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { FormDetailModel } from './form-detail';
/**
* 表单项模型
*
* @export
* @class FormItemModel
* @extends {FormDetailModel}
*/
export class FormItemModel extends FormDetailModel {
public disabled: boolean = false;
public isAllowEmpty: boolean = true;
constructor(opts: any = {}) {
super(opts);
this.disabled = opts.disabled ? true : false;
this.isAllowEmpty = opts.isAllowEmpty ? true : false;
}
public setAllowEmpty(state: boolean): void {
this.isAllowEmpty = state;
}
public setDisabled(state: boolean): void {
this.disabled = state;
}
}
\ No newline at end of file
import { FormDetailModel } from './form-detail';
/**
* 表单分页模型
*
* @export
* @class FormPageModel
* @extends {FormDetailModel}
*/
export class FormPageModel extends FormDetailModel {
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { FormDetailModel } from './form-detail';
/**
* 表单部件模型
*
* @export
* @class FormPartModel
* @extends {FormDetailModel}
*/
export class FormPartModel extends FormDetailModel {
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { FormDetailModel } from './form-detail';
/**
* 直接内容模型
*
* @export
* @class FormRowItemModel
* @extends {FormDetailModel}
*/
export class FormRowItemModel extends FormDetailModel {
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { FormDetailModel } from './form-detail';
/**
* 分页面板模型
*
* @export
* @class FormTabPageModel
* @extends {FormDetailModel}
*/
export class FormTabPageModel extends FormDetailModel {
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { FormDetailModel } from './form-detail';
/**
* 用户控件模型
*
* @export
* @class FormUserControlModel
* @extends {FormDetailModel}
*/
export class FormUserControlModel extends FormDetailModel {
constructor(otps:any = {}) {
super(otps);
}
}
\ No newline at end of file
import { FormDetailModel } from './form-detail';
/**
* 分页部件模型
*
* @export
* @class FormTabPanelModel
* @extends {FormDetailModel}
*/
export class FormTabPanelModel extends FormDetailModel {
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
export { FormButtonModel } from './form-button';
export { FormPageModel } from './form-page';
export { FormItemModel } from './form-item';
export { FromDRUIPartModel } from './form-druipart';
export { FormPartModel } from './form-part';
export { FormGroupPanelModel } from './form-group-panel';
export { FormRowItemModel } from './form-row-item';
export { FormTabPageModel } from './form-tab-page';
export { FormTabPanelModel } from './from-tab-panel';
export { FormUserControlModel } from './form-user-control';
/**
*
*
* @interface ViewState
*/
interface ViewState {
/**
* 部件标识
*
* @type {string}
* @memberof ViewState
*/
tag: string;
/**
* 触发行为
*
* @type {('load' | 'save' | 'remove')}
* @memberof ViewState
*/
action: 'load' | 'save' | 'remove' | 'autoload' | 'loaddraft' | string;
/**
* 数据
*
* @type {*}
* @memberof ViewState
*/
data?: any;
}
\ No newline at end of file
import ViewEngine from './view-engine';
/**
* 编辑视图引擎
*
* @export
* @class EditViewEngine
* @extends {ViewEngine}
*/
export default class EditViewEngine extends ViewEngine {
/**
* 表单部件
*
* @protected
* @type {*}
* @memberof EditViewEngine
*/
protected form: any;
/**
* 父健为当前健
*
* @protected
* @type {string}
* @memberof EditViewEngine
*/
protected p2k: string = '';
/**
* 初始化编辑视图引擎
*
* @param {*} [options={}]
* @memberof EditViewEngine
*/
public init(options: any = {}): void {
this.form = options.form;
this.p2k = options.p2k;
super.init(options);
}
/**
* 引擎加载
*
* @param {*} [opts={}]
* @memberof EditViewEngine
*/
public load(opts: any = {}): void {
super.load(opts);
if (this.getForm()) {
const tag = this.getForm().name;
const data: any = {};
let srfkey: string = this.viewdata.srfkey;
let srfkeys: string = this.viewdata.srfkeys;
let srfsourcekey: string = this.viewdata.srfsourcekey;
let action: string = '';
const hasSrfParentKey = this.viewdata.srfparentdata
&& this.viewdata.srfparentdata.srfparentkey
&& !Object.is(this.viewdata.srfparentdata.srfparentkey, '');
if (Object.is(this.p2k, '1') && hasSrfParentKey) {
srfkey = this.viewdata.srfparentdata.srfparentkey;
}
if (srfkey && !Object.is(srfkey, '')) {
Object.assign(data, this.viewdata.srfparentdata);
action = 'load';
} else {
Object.assign(data, { srfparentdata: this.viewdata.srfparentdata });
Object.assign(data, { srfsourcekey: srfsourcekey, srfkeys: srfkeys });
action = 'loaddraft';
}
Object.assign(data, { srfkey: srfkey });
this.setViewState2({ tag: tag, action: action, viewdata: data });
}
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof EditViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'form')) {
this.formEvent(eventName, args);
}
}
/**
* 表单事件
*
* @param {string} eventName
* @param {*} args
* @memberof EditViewEngine
*/
public formEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'load')) {
this.onFormLoad(args);
}
if (Object.is(eventName, 'save')) {
this.onFormSave(args);
}
if (Object.is(eventName, 'remove')) {
this.onFormRemove(args);
}
}
/**
* 表单加载完成
*
* @param {*} args
* @memberof EditViewEngine
*/
public onFormLoad(arg: any): void {
this.view.$emit('load',arg);
this.view.$emit('viewdataschange',{action:'load',data:arg});
}
/**
* 表单保存完成
*
* @param {*} args
* @memberof EditViewEngine
*/
public onFormSave(arg: any): void {
this.view.$emit('save',arg);
this.view.$emit('viewdataschange',{action:'save',data:arg});
}
/**
* 表单删除完成
*
* @param {*} args
* @memberof EditViewEngine
*/
public onFormRemove(arg: any): void {
this.view.$emit('remove',arg);
this.view.$emit('viewdataschange',{action:'remove',data:arg});
}
/**
* 处理实体界面行为
*
* @param {string} tag
* @param {string} [actionmode]
* @returns {void}
* @memberof EditViewEngine
*/
public doSysUIAction(tag: string, actionmode?: string): void {
if (Object.is(tag, 'Save')) {
this.doSave();
return;
}
if (Object.is(tag, 'SaveAndExit')) {
this.doSaveAndExit();
return;
}
if (Object.is(tag, 'SaveAndNew')) {
this.doSaveAndNew();
return;
}
if (Object.is(tag, 'RemoveAndExit')) {
this.doRemoveAndExit(this.viewdata);
return;
}
if (Object.is(tag, 'Refresh')) {
this.doRefresh();
return;
}
if (Object.is(tag, 'SaveAndStart')) {
this.doSaveAndStart();
return;
}
super.doSysUIAction(tag, actionmode);
}
/**
* 编辑界面_保存操作
*
* @memberof EditViewEngine
*/
public doSave(): void {
this.saveData({});
}
/**
* 编辑界面_保存并开始流程操作
*
* @memberof EditViewEngine
*/
public doSaveAndStart(){
this.SaveAndStart({action:'saveandstart'});
}
/**
* 编辑界面_保存并退出操作
*
* @memberof EditViewEngine
*/
public doSaveAndExit():void{
this.SaveAndExit({});
}
/**
* 编辑界面_保存并新建操作
*
* @memberof EditViewEngine
*/
public doSaveAndNew():void{
this.SaveAndNew({});
}
/**
* 编辑界面_删除并关闭操作
*
* @memberof EditViewEngine
*/
public doRemoveAndExit(data:any):void{
this.RemoveAndExit(data);
}
/**
* 编辑界面_刷新操作
*
* @memberof EditViewEngine
*/
public doRefresh():void{
this.Refresh({});
}
/**
* 编辑界面_保存并开始流程操作
*
* @memberof EditViewEngine
*/
public SaveAndStart(arg: any = {}):void{
if (this.getForm()) {
const tag = this.getForm().name;
this.setViewState2({ tag: tag, action: 'saveandstart', viewdata: arg });
}
}
/**
* 保存视图数据
*
* @param {*} [arg={}]
* @memberof EditViewEngine
*/
public saveData(arg: any = {}): void {
if (this.getForm()) {
const tag = this.getForm().name;
this.setViewState2({ tag: tag, action: 'save', viewdata: arg });
}
}
/**
* 保存并退出操作
*
* @memberof EditViewEngine
*/
public SaveAndExit(arg: any = {}):void{
if (this.getForm()) {
const tag = this.getForm().name;
this.setViewState2({ tag: tag, action: 'saveandexit', viewdata: arg });
}
}
/**
* 删除并关闭
*
* @memberof EditViewEngine
*/
public RemoveAndExit(arg: any = {}):void{
if (this.getForm()) {
const tag = this.getForm().name;
this.setViewState2({ tag: tag, action: 'removeandexit', viewdata: arg });
}
}
/**
* 保存并新建操作
*
* @memberof EditViewEngine
*/
public SaveAndNew(arg: any = {}):void{
if (this.getForm()) {
const tag = this.getForm().name;
this.setViewState2({ tag: tag, action: 'saveandnew', viewdata: arg });
}
}
/**
* 刷新
*
* @memberof EditViewEngine
*/
public Refresh(arg: any = {}):void{
if (this.getForm()) {
const tag = this.getForm().name;
this.setViewState2({ tag: tag, action: 'refresh', viewdata: arg });
}
}
/**
* 获取表单对象
*
* @returns {*}
* @memberof EditViewEngine
*/
public getForm(): any {
return this.form;
}
}
\ No newline at end of file
import ViewEngine from './view-engine';
/**
* 多数据引擎
*
* @export
* @class MDViewEngine
* @extends {ViewEngine}
*/
export default class MobChartViewEngine extends ViewEngine {
/**
* 表格部件
*
* @type {*}
* @memberof GridViewEngine
*/
protected chart: any;
/**
* 表单部件
*
* @type {*}
* @memberof GridViewEngine
*/
protected searchForm: any;
/**
* 属性面板
*
* @protected
* @type {*}
* @memberof PickupGridViewEngine
*/
protected propertypanel: any;
/**
* 打开数据
*
* @type {*}
* @memberof GridViewEngine
*/
protected openData?: (params: any) => void;
/**
* 新建数据
*
* @protected
* @memberof GridViewEngine
*/
protected newData?: (params: any) => void;
/**
* Creates an instance of GridViewEngine.
* @memberof GridViewEngine
*/
constructor() {
super();
}
/**
* 引擎初始化
*
* @param {*} [options={}]
* @memberof GridViewEngine
*/
public init(options: any = {}): void {
this.propertypanel = options.propertypanel;
this.searchForm = options.searchform;
this.chart = options.chart;
this.openData = options.opendata;
this.newData = options.newdata;
super.init(options);
}
/**
* 引擎加载
*
* @param {*} [opts={}]
* @memberof MDViewEngine
*/
public load(opts: any = {}): void {
super.load(opts);
const _srfparentdata = this.viewdata.srfparentdata ? { srfparentdata: this.viewdata.srfparentdata } : { srfparentdata: {} };
if (this.getSearchForm()) {
const tag = this.getSearchForm().name;
this.setViewState2({ tag: tag, action: 'loaddraft', viewdata: {} });
}
if (this.getChart()) {
const tag = this.getChart().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: _srfparentdata });
}
}
/**
* 部件事件
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof GridViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'searchform')) {
this.searchFormEvent(eventName, args);
}
if (Object.is(ctrlName, 'chart')) {
this.MDChartEvent(eventName,args);
}
}
/**
* 搜索表单事件
*
* @param {string} eventName
* @param {*} [args={}]
* @memberof MDViewEngine
*/
public searchFormEvent(eventName: string, args: any = {}): void {
if (Object.is(eventName, 'load')) {
this.onSearchFormLoad(args);
}
if (Object.is(eventName, 'search')) {
this.onSearchFormSearch(args);
}
}
/**
*
*
* @param {string} eventName
* @param {*} [args={}]
* @memberof GridViewEngine
*/
/**
* 事件处理
*
* @param {string} eventName
* @param {any[]} args
* @memberof MDViewEngine
*/
public MDChartEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'rowclick')) {
this.doEdit(args);
}
if (Object.is(eventName, 'click')) {
this.doEdit(args);
}
if (Object.is(eventName, 'rowdblclick')) {
this.doEdit(args);
}
if (Object.is(eventName, 'selectionchange')) {
this.selectionChange(args);
}
if (Object.is(eventName, 'load')) {
this.MDCtrlLoad(args);
}
if (Object.is(eventName, 'beforeload')) {
this.MDCtrlBeforeLoad(args)
}
}
/**
* 搜索表单加载完成
*
* @param {*} [args={}]
* @memberof MDViewEngine
*/
public onSearchFormLoad(args: any = {}): void {
if (this.getChart()) {
const tag = this.getChart().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: {} });
}
}
public onSearchFormSearch(args: any = {}): void {
if (this.getChart()) {
const tag = this.getChart().name;
this.setViewState2({ tag: tag, action: 'search', viewdata: args });
}
}
/**
* 处理实体界面行为
*
* @param {string} tag
* @param {string} [actionmode]
* @returns {void}
* @memberof GridViewEngine
*/
public doSysUIAction(tag: string, actionmode?: string): void {
// if (Object.is(tag, 'Help')) {
// this.doHelp(params);
// return;
// }
if (Object.is(tag, 'Edit')) {
this.doEdit();
return;
}
// if (Object.is(tag, 'View')) {
// this.doView(params);
// return;
// }
// if (Object.is(tag, 'Print')) {
// this.doPrint(params);
// return;
// }
// if (Object.is(tag, 'ExportExcel')) {
// this.doExportExcel(params);
// return;
// }
// if (Object.is(tag, 'ExportModel')) {
// this.doExportModel(params);
// return;
// }
// if (Object.is(tag, 'Copy')) {
// this.doCopy(params);
// return;
// }
if (Object.is(tag, 'Remove')) {
this.doRemove();
return;
}
// if (Object.is(tag, 'Import')) {
// this.doImport(params);
// return;
// }
// if (Object.is(tag, 'Refresh')) {
// this.doRefresh(params);
// return;
// }
// if (Object.is(tag, 'NewRow')) {
// this.doCheck(params);
// return;
// }
if (Object.is(tag, 'SaveRow')) {
this.doSaveEditRow();
return;
}
if (Object.is(tag, 'New')) {
this.doNew();
return;
}
if (Object.is(tag, 'OpenRowEdit')) {
this.doOpenRowEdit();
return;
}
if (Object.is(tag, 'CloseRowEdit')) {
this.doCloseRowEdit();
return;
}
// if (Object.is(tag, 'ToggleRowEdit')) {
// this.doToggleRowEdit(params);
// return;
// }
// if (Object.is(tag, 'ToggleFilter')) {
// this.doToggleFilter(params);
// return;
// }
super.doSysUIAction(tag, actionmode);
}
/**
* 多数据项界面_开启行编辑操作
*
* @memberof GridViewEngine
*/
public doOpenRowEdit(): void {
if (this.getChart()) {
const tag = this.getChart().name;
this.setViewState2({ tag: tag, action: 'openEdit', viewdata: {} });
}
}
/**
* 多数据项界面_关闭行编辑操作
*
* @memberof GridViewEngine
*/
public doCloseRowEdit(): void {
if (this.getChart()) {
const tag = this.getChart().name;
this.setViewState2({ tag: tag, action: 'closeEdit', viewdata: {} });
}
}
/**
* 多数据项界面_提交编辑数据操作
*
* @memberof GridViewEngine
*/
public doSaveEditRow(): void {
if (this.getChart()) {
const tag = this.getChart().name;
this.setViewState2({ tag: tag, action: 'submitEidt', viewdata: {} });
}
}
/**
* 多数据项界面_编辑操作
*
* @param {*} [params={}]
* @returns {void}
* @memberof GridViewEngine
*/
public doEdit(params: any = {}): void {
// 获取要编辑的数据集合
if (params && params.srfkey) {
if (this.isFunc(this.getChart().findItem)) {
params = this.getChart().findItem('srfkey', params.srfkey);
}
const arg = { data: params };
this.onEditData(arg);
return;
}
if (this.isFunc(this.getChart().getSelection)) {
const selectedData = this.getChart().getSelection();
if (selectedData == null || selectedData.length === 0) {
return;
}
this.onEditData({ data: selectedData[0] });
}
}
/**
* 编辑数据
*
* @param {*} arg
* @memberof GridViewEngine
*/
public onEditData(arg: any): void {
const loadParam: any = {};
// if (this.getViewParam()) {
// Object.assign(loadParam, this.getViewParam());
// }
// if (this.getParentMode()) {
// Object.assign(loadParam, this.getParentMode());
// }
// if (this.getParentData()) {
// Object.assign(loadParam, this.getParentData());
// }
if (arg.srfcopymode) {
Object.assign(loadParam, {
srfsourcekey: arg.data.srfkey
});
} else {
Object.assign(loadParam, { srfkey: arg.data.srfkey, srfdeid: arg.data.srfdeid });
}
if (this.openData && this.isFunc(this.openData)) {
this.openData(loadParam);
}
}
/**
* 多数据项界面_新建操作
*
* @param {*} [params={}]
* @memberof GridViewEngine
*/
public doNew(params: any = {}): void {
this.onNewData();
}
/**
* 新建数据
*
* @returns {void}
* @memberof GridViewEngine
*/
public onNewData(): void {
// tslint:disable-next-line:prefer-const
let loadParam: any = {};
// if (this.getViewParam()) {
// Object.assign(loadParam, this.getViewParam());
// }
// if (this.getParentMode()) {
// Object.assign(loadParam, this.getParentMode());
// }
// if (this.getParentData()) {
// Object.assign(loadParam, this.getParentData());
// }
// if (this.isEnableRowEdit() && (this.getChart() && this.getChart().getOpenEdit())) {
// this.doNewRow(loadParam);
// return;
// }
// if (this.isEnableBatchAdd()) {
// this.doNewDataBatch(loadParam);
// return;
// }
// if (this.doNewDataWizard(loadParam)) {
// return;
// }
this.doNewDataNormal(loadParam);
}
/**
* 常规新建数据
*
* @param {*} arg
* @returns {*}
* @memberof GridViewEngine
*/
public doNewDataNormal(arg: any): any {
// let view = this.getNewDataView(arg);
// if (view == null) {
// return false;
// }
// const openMode = view.openMode;
// if (!openMode || Object.is(openMode, '')) {
// view.openMode = 'INDEXVIEWTAB';
// }
// if (!view.state) {
// view.state = 'new';
// let viewParam: any = {};
// Object.assign(viewParam, view.viewParam);
// if (viewParam && viewParam.srfnewmode && !Object.is(viewParam.srfnewmode, '')) {
// const srfnewmode: string = viewParam.srfnewmode.split('@').join('__');
// view.state = view.state + '_' + srfnewmode.toLowerCase();
// }
// }
return this.openDataView(arg);
}
/**
* 多数据项界面_删除操作
*
* @memberof MDViewEngine
*/
public doRemove(): void {
}
public openDataView(view: any = {}): boolean {
const openMode = view.openMode;
// if (view.redirect) {
// this.redirectOpenView(view);
// return false;
// }
if (openMode !== undefined) {
if (Object.is(openMode, 'POPUPMODAL')) {
view.modal = true;
} else if (Object.is(openMode, 'POPUP')) {
view.modal = true;
} else if (Object.is(openMode, '') || Object.is(openMode, 'INDEXVIEWTAB')) {
view.modal = false;
}
}
// if (view.modal) {
// let modalview = this.openModal(view);
// modalview.subscribe((result: any) => {
// if (result && Object.is(result.ret, 'OK')) {
// this.onRefresh();
// }
// });
// return true;
// }
// else {
// this.openWindow(view.viewurl, view.viewparam);
// }
if (this.newData && this.isFunc(this.newData)) {
this.newData({});
}
return true;
}
/**
* 选中变化
*
* @param {any[]} args
* @memberof GridViewEngine
*/
public selectionChange(args: any[]): void {
if (this.view) {
this.view.viewdataschange.emit({action:'selectionChange',data:args});
}
if (this.getPropertyPanel()) {
const tag = this.getPropertyPanel().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: args[0] });
}
}
/**
* 多数据部件加载完成
*
* @param {any[]} args
* @memberof MDViewEngine
*/
public MDCtrlLoad(args: any[]) {
if (this.view) {
this.view.viewload.emit(args);
}
}
/**
* 多数据部件加载之前
*
* @param {*} [arg={}]
* @memberof MDViewEngine
*/
public MDCtrlBeforeLoad(arg: any = {}): void {
if (this.viewdata.srfparentdata && Object.keys(this.viewdata.srfparentdata).length > 0) {
Object.assign(arg, { srfparentdata: this.viewdata.srfparentdata });
}
if (this.getSearchForm()) {
Object.assign(arg, this.getSearchForm().getData());
}
if (this.view) {
Object.assign(arg, { query: this.view.query });
}
}
/**
* 获取多数据部件
*
* @returns {*}
* @memberof MDViewEngine
*/
public getChart(): any {
return this.chart;
}
public getSearchForm(): any {
return this.searchForm;
}
/**
* 获取属性面板
*
* @returns
* @memberof PickupGridViewEngine
*/
public getPropertyPanel() {
return this.propertypanel;
}
}
\ No newline at end of file
import EditViewEngine from './edit-view-engine';
/**
* 实体编辑视图(分页关系)界面引擎
*
* @export
* @class MobEditView3Engine
* @extends {EditViewEngine}
*/
export default class MobMobEditView3Engine extends EditViewEngine {
/**
* 数据关系栏
*
* @protected
* @type {*}
* @memberof MobEditView3Engine
*/
protected drTab: any;
/**
* Creates an instance of MobEditView3Engine.
*
* @memberof MobEditView3Engine
*/
constructor() {
super();
}
/**
* 初始化引擎
*
* @param {*} [options={}]
* @memberof MobEditView3Engine
*/
public init(options: any = {}): void {
this.drTab = options.drtab;
super.init(options);
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof MobEditView3Engine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'drtab')) {
this.drTabEvent(eventName, args);
}
}
/**
* 数据关系栏事件
*
* @param {string} eventName
* @param {any[]} args
* @memberof MobEditView3Engine
*/
public drTabEvent(eventName: string, args: any[]): void {
if (Object.is(eventName, 'selectionchange')) {
this.drTabSelectionChange(args);
}
}
/**
* 数据关系栏选中
*
* @param {any[]} args
* @memberof MobEditView3Engine
*/
public drTabSelectionChange(args: any[]): void {
const item = args[0];
if (!item || Object.keys(item).length === 0) {
return;
}
this.view.selection = {};
Object.assign(this.view.selection, JSON.parse(JSON.stringify(item)));
}
/**
* 表单加载完成
*
* @param {*} [arg={}]
* @memberof MobEditView3Engine
*/
public onFormLoad(arg: any = {}): void {
super.onFormLoad(arg);
if (this.getDrTab()) {
const viewdata = this.viewdata;
const tag = this.getDrTab().name;
Object.assign(viewdata, { srfkey: Object.is(arg.srfkey, '') ? '' : arg.srfkey });
this.setViewState2({ tag: tag, action: 'load', viewdata: viewdata });
}
}
/**
* 表单保存完成
*
* @param {*} [arg={}]
* @memberof MobEditView3Engine
*/
public onFormSave(arg: any = {}): void {
super.onFormSave(arg);
if (this.getDrTab()) {
const viewdata = this.viewdata;
const tag = this.getDrTab().name;
Object.assign(viewdata, { srfkey: Object.is(arg.srfkey, '') ? '' : arg.srfkey });
this.setViewState2({ tag: tag, action: 'save', viewdata: viewdata });
}
}
/**
* 获取关系
*
* @returns {*}
* @memberof MobEditView3Engine
*/
public getDrTab(): any {
return this.drTab;
}
}
\ No newline at end of file
import EditViewEngine from './edit-view-engine';
/**
*
*
* @export
* @class EditView9Engine
* @extends {EditViewEngine}
*/
export default class EditView9Engine extends EditViewEngine {
}
import ViewEngine from './view-engine';
/**
* 多数据引擎
*
* @export
* @class MDViewEngine
* @extends {ViewEngine}
*/
export default class MobMDViewEngine extends ViewEngine {
/**
* 表格部件
*
* @type {*}
* @memberof GridViewEngine
*/
protected mdctrl: any;
/**
* 表单部件
*
* @type {*}
* @memberof GridViewEngine
*/
protected searchForm: any;
/**
* 属性面板
*
* @protected
* @type {*}
* @memberof PickupGridViewEngine
*/
protected propertypanel: any;
/**
* 打开数据
*
* @type {*}
* @memberof GridViewEngine
*/
protected openData?: (params: any) => void;
/**
* 新建数据
*
* @protected
* @memberof GridViewEngine
*/
protected newData?: (params: any) => void;
/**
* Creates an instance of GridViewEngine.
* @memberof GridViewEngine
*/
constructor() {
super();
}
/**
* 引擎初始化
*
* @param {*} [options={}]
* @memberof GridViewEngine
*/
public init(options: any = {}): void {
this.propertypanel = options.propertypanel;
this.searchForm = options.searchform;
this.mdctrl = options.mdctrl;
this.openData = options.opendata;
this.newData = options.newdata;
super.init(options);
}
/**
* 引擎加载
*
* @param {*} [opts={}]
* @memberof MDViewEngine
*/
public load(opts: any = {}): void {
super.load(opts);
const _srfparentdata = this.viewdata.srfparentdata ? { srfparentdata: this.viewdata.srfparentdata } : { srfparentdata: {} };
if (this.getSearchForm()) {
const tag = this.getSearchForm().name;
this.setViewState2({ tag: tag, action: 'loaddraft', viewdata: {} });
}
if (this.getMDCtrl()) {
const tag = this.getMDCtrl().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: _srfparentdata });
}
}
/**
* 部件事件
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof GridViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'searchform')) {
this.searchFormEvent(eventName, args);
}
if (Object.is(ctrlName, 'mdctrl')) {
this.MDCtrlEvent(eventName,args);
}
}
/**
* 搜索表单事件
*
* @param {string} eventName
* @param {*} [args={}]
* @memberof MDViewEngine
*/
public searchFormEvent(eventName: string, args: any = {}): void {
if (Object.is(eventName, 'load')) {
this.onSearchFormLoad(args);
}
if (Object.is(eventName, 'search')) {
this.onSearchFormSearch(args);
}
}
/**
*
*
* @param {string} eventName
* @param {*} [args={}]
* @memberof GridViewEngine
*/
/**
* 事件处理
*
* @param {string} eventName
* @param {any[]} args
* @memberof MDViewEngine
*/
public MDCtrlEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'rowclick')) {
this.doEdit(args);
}
if (Object.is(eventName, 'click')) {
this.doEdit(args);
}
if (Object.is(eventName, 'rowdblclick')) {
this.doEdit(args);
}
if (Object.is(eventName, 'selectionchange')) {
this.selectionChange(args);
}
if (Object.is(eventName, 'load')) {
this.MDCtrlLoad(args);
}
if (Object.is(eventName, 'beforeload')) {
this.MDCtrlBeforeLoad(args)
}
}
/**
* 搜索表单加载完成
*
* @param {*} [args={}]
* @memberof MDViewEngine
*/
public onSearchFormLoad(args: any = {}): void {
if (this.getMDCtrl()) {
const tag = this.getMDCtrl().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: {} });
}
}
public onSearchFormSearch(args: any = {}): void {
if (this.getMDCtrl()) {
const tag = this.getMDCtrl().name;
this.setViewState2({ tag: tag, action: 'search', viewdata: args });
}
}
/**
* 处理实体界面行为
*
* @param {string} tag
* @param {string} [actionmode]
* @returns {void}
* @memberof GridViewEngine
*/
public doSysUIAction(tag: string, actionmode?: string): void {
if (Object.is(tag, 'Edit')) {
this.doEdit();
return;
}
if (Object.is(tag, 'Refresh')) {
this.doRefresh();
return;
}
if (Object.is(tag, 'Remove')) {
this.doRemove();
return;
}
if (Object.is(tag, 'SaveRow')) {
this.doSaveEditRow();
return;
}
if (Object.is(tag, 'New')) {
this.doNew();
return;
}
if (Object.is(tag, 'OpenRowEdit')) {
this.doOpenRowEdit();
return;
}
if (Object.is(tag, 'CloseRowEdit')) {
this.doCloseRowEdit();
return;
}
super.doSysUIAction(tag, actionmode);
}
/**
* 多数据项界面_开启行编辑操作
*
* @memberof GridViewEngine
*/
public doOpenRowEdit(): void {
if (this.getMDCtrl()) {
const tag = this.getMDCtrl().name;
this.setViewState2({ tag: tag, action: 'openEdit', viewdata: {} });
}
}
/**
* 多数据项界面_关闭行编辑操作
*
* @memberof GridViewEngine
*/
public doCloseRowEdit(): void {
if (this.getMDCtrl()) {
const tag = this.getMDCtrl().name;
this.setViewState2({ tag: tag, action: 'closeEdit', viewdata: {} });
}
}
/**
* 多数据项界面_提交编辑数据操作
*
* @memberof GridViewEngine
*/
public doSaveEditRow(): void {
if (this.getMDCtrl()) {
const tag = this.getMDCtrl().name;
this.setViewState2({ tag: tag, action: 'submitEidt', viewdata: {} });
}
}
/**
* 多数据项界面_编辑操作
*
* @param {*} [params={}]
* @returns {void}
* @memberof GridViewEngine
*/
public doEdit(params: any = {}): void {
// 获取要编辑的数据集合
if (params && params.srfkey) {
if (this.isFunc(this.getMDCtrl().findItem)) {
params = this.getMDCtrl().findItem('srfkey', params.srfkey);
}
const arg = { data: params };
this.onEditData(arg);
return;
}
if (this.isFunc(this.getMDCtrl().getSelection)) {
const selectedData = this.getMDCtrl().getSelection();
if (selectedData == null || selectedData.length === 0) {
return;
}
this.onEditData({ data: selectedData[0] });
}
}
/**
* 编辑数据
*
* @param {*} arg
* @memberof GridViewEngine
*/
public onEditData(arg: any): void {
const loadParam: any = {};
if (arg.srfcopymode) {
Object.assign(loadParam, {
srfsourcekey: arg.data.srfkey
});
} else {
Object.assign(loadParam, { srfkey: arg.data.srfkey, srfdeid: arg.data.srfdeid });
}
if (this.openData && this.isFunc(this.openData)) {
this.openData(loadParam);
}
}
/**
* 多数据项界面_新建操作
*
* @param {*} [params={}]
* @memberof GridViewEngine
*/
public doNew(params: any = {}): void {
this.onNewData();
}
/**
* 新建数据
*
* @returns {void}
* @memberof GridViewEngine
*/
public onNewData(): void {
// tslint:disable-next-line:prefer-const
let loadParam: any = {};
// if (this.getViewParam()) {
// Object.assign(loadParam, this.getViewParam());
// }
// if (this.getParentMode()) {
// Object.assign(loadParam, this.getParentMode());
// }
// if (this.getParentData()) {
// Object.assign(loadParam, this.getParentData());
// }
// if (this.isEnableRowEdit() && (this.getMDCtrl() && this.getMDCtrl().getOpenEdit())) {
// this.doNewRow(loadParam);
// return;
// }
// if (this.isEnableBatchAdd()) {
// this.doNewDataBatch(loadParam);
// return;
// }
// if (this.doNewDataWizard(loadParam)) {
// return;
// }
this.doNewDataNormal(loadParam);
}
/**
* 常规新建数据
*
* @param {*} arg
* @returns {*}
* @memberof GridViewEngine
*/
public doNewDataNormal(arg: any): any {
// let view = this.getNewDataView(arg);
// if (view == null) {
// return false;
// }
// const openMode = view.openMode;
// if (!openMode || Object.is(openMode, '')) {
// view.openMode = 'INDEXVIEWTAB';
// }
// if (!view.state) {
// view.state = 'new';
// let viewParam: any = {};
// Object.assign(viewParam, view.viewParam);
// if (viewParam && viewParam.srfnewmode && !Object.is(viewParam.srfnewmode, '')) {
// const srfnewmode: string = viewParam.srfnewmode.split('@').join('__');
// view.state = view.state + '_' + srfnewmode.toLowerCase();
// }
// }
return this.openDataView(arg);
}
/**
* 多数据项界面_删除操作
*
* @memberof MDViewEngine
*/
public doRemove(): void {
}
public openDataView(view: any = {}): boolean {
const openMode = view.openMode;
// if (view.redirect) {
// this.redirectOpenView(view);
// return false;
// }
if (openMode !== undefined) {
if (Object.is(openMode, 'POPUPMODAL')) {
view.modal = true;
} else if (Object.is(openMode, 'POPUP')) {
view.modal = true;
} else if (Object.is(openMode, '') || Object.is(openMode, 'INDEXVIEWTAB')) {
view.modal = false;
}
}
// if (view.modal) {
// let modalview = this.openModal(view);
// modalview.subscribe((result: any) => {
// if (result && Object.is(result.ret, 'OK')) {
// this.onRefresh();
// }
// });
// return true;
// }
// else {
// this.openWindow(view.viewurl, view.viewparam);
// }
if (this.newData && this.isFunc(this.newData)) {
this.newData({});
}
return true;
}
/**
* 多数据项界面_刷新操作
*
* @memberof MDViewEngine
*/
public doRefresh(): void {
this.Refresh({});
}
/**
* 刷新
*
* @memberof EditViewEngine
*/
public Refresh(arg: any = {}):void{
if (this.getMDCtrl()) {
const tag = this.getMDCtrl().name;
this.setViewState2({ tag: tag, action: 'refresh', viewdata: arg });
}
}
/**
* 选中变化
*
* @param {any[]} args
* @memberof GridViewEngine
*/
public selectionChange(args: any[]): void {
if (this.view) {
this.view.$emit('viewdataschange',{action:'selectionChange',data:args});
}
if (this.getPropertyPanel()) {
const tag = this.getPropertyPanel().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: args[0] });
}
}
/**
* 多数据部件加载完成
*
* @param {any[]} args
* @memberof MDViewEngine
*/
public MDCtrlLoad(args: any[]) {
if (this.view) {
this.view.$emit('viewload',args);
}
}
/**
* 多数据部件加载之前
*
* @param {*} [arg={}]
* @memberof MDViewEngine
*/
public MDCtrlBeforeLoad(arg: any = {}): void {
if (this.viewdata.srfparentdata && Object.keys(this.viewdata.srfparentdata).length > 0) {
Object.assign(arg, { srfparentdata: this.viewdata.srfparentdata });
}
if (this.getSearchForm()) {
Object.assign(arg, this.getSearchForm().getData());
}
if (this.view) {
Object.assign(arg, { query: this.view.query });
}
}
/**
* 获取多数据部件
*
* @returns {*}
* @memberof MDViewEngine
*/
public getMDCtrl(): any {
return this.mdctrl;
}
public getSearchForm(): any {
return this.searchForm;
}
/**
* 获取属性面板
*
* @returns
* @memberof PickupGridViewEngine
*/
public getPropertyPanel() {
return this.propertypanel;
}
}
\ No newline at end of file
import MobMDViewEngine from './mob-mdview-engine';
/**
*
*
* @export
* @class MobMDView9Engine
* @extends {MobMDView9Engine}
*/
export default class MobMDView9Engine extends MobMDViewEngine {
}
import ViewEngine from './view-engine';
/**
* 多编辑表单视图引擎
*
* @export
* @class MobMEditView9Engine
* @extends {ViewEngine}
*/
export default class MobMEditView9Engine extends ViewEngine {
/**
* 多编辑表单面板
*
* @protected
* @type {*}
* @memberof MobMEditView9Engine
*/
protected meditviewpanel: any;
/**
* 打开数据
*
* @type {*}
* @memberof MobMEditView9Engine
*/
protected openData?: (params: any) => void;
/**
* 新建数据
*
* @protected
* @memberof MobMEditView9Engine
*/
protected newData?: (params: any) => void;
/**
* Creates an instance of MobMEditView9Engine.
* @memberof MobMEditView9Engine
*/
constructor() {
super();
}
/**
* 引擎初始化
*
* @param {*} [options={}]
* @memberof MobMEditView9Engine
*/
public init(options: any = {}): void {
this.meditviewpanel = options.meditviewpanel;
this.openData = options.opendata;
this.newData = options.newdata;
super.init(options);
}
/**
* 引擎加载
*
* @param {*} [opts={}]
* @memberof MobMEditView9Engine
*/
public load(opts: any = {}): void {
super.load(opts);
const _srfparentdata = this.viewdata.srfparentdata ? { srfparentdata: this.viewdata.srfparentdata } : { srfparentdata: {} };
if (this.getMeditviewpanel()) {
const tag = this.getMeditviewpanel().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: _srfparentdata });
}
}
/**
* 部件事件
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof MobMEditView9Engine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'meditviewpanel')) {
this.editviewpanelEvent(eventName, args);
}
}
/**
* 多编辑表单面板事件分发
*
* @param {*} [opts={}]
* @memberof MobMEditView9Engine
*/
public editviewpanelEvent(eventName:string, args:any){
if (Object.is(eventName, 'load')) {
this.view.$emit('viewdataschange',{action:'load','data':args});
}
if (Object.is(eventName, 'beforesave')) {
this.view.$emit('viewdataschange',{action:'beforesave','data':args});
this.view.$emit('drdatachange',{action:'beforesave','data':args});
}
if (Object.is(eventName, 'editformchange')) {
this.view.$emit('viewdataschange',{action:'editformchange','data':args});
this.view.$emit('drdatachange',{action:'editformchange','data':args});
}
if (Object.is(eventName, 'savecompleted')) {
this.view.$emit('viewdataschange',{action:'savecompleted','data':args});
this.view.$emit('drdatasaved',{action:'savecompleted','data':args});
}
}
/**
* 多编辑表单面板部件
*
* @returns {*}
* @memberof MDViewEngine
*/
public getMeditviewpanel(): any {
return this.meditviewpanel;
}
}
\ No newline at end of file
import ViewEngine from './view-engine';
/**
* 实体选择视图
*
* @export
* @class MobMPickupViewEngine
* @extends {ViewEngine}
*/
export default class MobMPickupViewEngine extends ViewEngine {
/**
* 选择视图面板
*
* @type {*}
* @memberof MobMPickupViewEngine
*/
public pickupViewPanel: any = null;
/**
* Creates an instance of MobMPickupViewEngine.
*
* @memberof MobMPickupViewEngine
*/
constructor() {
super();
}
/**
* 初始化引擎
*
* @param {*} options
* @memberof MobMPickupViewEngine
*/
public init(options: any): void {
this.pickupViewPanel = options.pickupviewpanel;
if (options.view.viewdata && options.view.viewdata.selectedData && Array.isArray(options.view.viewdata.selectedData)) {
options.view.viewSelections = [...options.view.viewdata.selectedData];
delete options.view.viewdata.selectedData;
}
super.init(options);
}
/**
* 引擎加载
*
* @memberof MobMPickupViewEngine
*/
public load(): void {
super.load();
const _srfparentdata = this.viewdata.srfparentdata ? { srfparentdata: this.viewdata.srfparentdata } : { srfparentdata: {} };
if (this.getPickupViewPanel()) {
const tag = this.getPickupViewPanel().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: _srfparentdata });
}
}
/**
* 引擎事件
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof MobMPickupViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(eventName, 'dataschange')) {
this.onSelectionChange(ctrlName, args);
}
if (Object.is(eventName, 'load')) {
this.onLoad(ctrlName, args);
}
if (Object.is(eventName, 'activated')) {
this.onSelectionChange(ctrlName, args);
this.view.onCLickRight();
}
}
/**
* 值选中变化
*
* @param {string} ctrlName 选择视图面板名称
* @param {any[]} args 选中数据
* @memberof MobMPickupViewEngine
*/
public onSelectionChange(ctrlName: string, args: any[]): void {
this.view.containerModel[`view_${ctrlName}`].selections = [...JSON.parse(JSON.stringify(args))];
Object.values(this.view.containerModel).forEach((model: any) => {
if (!Object.is(model.type, 'PICKUPVIEWPANEL')) {
return;
}
});
const _disbaled: boolean = this.view.containerModel[`view_${ctrlName}`].selections.length > 0 ? true : false;
this.view.containerModel.view_rightbtn = _disbaled;
}
/**
* 视图加载完成
*
* @param {string} ctrlName 选择视图面板名称
* @param {any[]} args 选中数据
* @memberof MobMPickupViewEngine
*/
public onLoad(ctrlName: string, args: any[]): void {
this.view.containerModel[`view_${ctrlName}`].datas = [...JSON.parse(JSON.stringify(args))];
}
/**
* 获取选择视图面板
*
* @returns {*}
* @memberof MobMPickupViewEngine
*/
public getPickupViewPanel(): any {
return this.pickupViewPanel;
}
}
\ No newline at end of file
import ViewEngine from './view-engine';
/**
* 多数据引擎
*
* @export
* @class MDViewEngine
* @extends {ViewEngine}
*/
export default class MobPickupMDViewEngine extends ViewEngine {
/**
* 表格部件
*
* @type {*}
* @memberof GridViewEngine
*/
protected mdctrl: any;
/**
* 属性面板
*
* @protected
* @type {*}
* @memberof PickupGridViewEngine
*/
protected propertypanel: any;
/**
* 打开数据
*
* @type {*}
* @memberof GridViewEngine
*/
protected openData?: (params: any) => void;
/**
* 新建数据
*
* @protected
* @memberof GridViewEngine
*/
protected newData?: (params: any) => void;
/**
* Creates an instance of GridViewEngine.
* @memberof GridViewEngine
*/
constructor() {
super();
}
/**
* 引擎初始化
*
* @param {*} [options={}]
* @memberof GridViewEngine
*/
public init(options: any = {}): void {
this.propertypanel = options.propertypanel;
this.mdctrl = options.mdctrl;
this.openData = options.opendata;
this.newData = options.newdata;
super.init(options);
}
/**
* 引擎加载
*
* @param {*} [opts={}]
* @memberof MDViewEngine
*/
public load(opts: any = {}): void {
super.load(opts);
const _srfparentdata = this.viewdata.srfparentdata ? { srfparentdata: this.viewdata.srfparentdata } : { srfparentdata: {} };
if (this.getMDCtrl()) {
const tag = this.getMDCtrl().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: _srfparentdata });
}
}
/**
* 部件事件
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof GridViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'searchform')) {
this.searchFormEvent(eventName, args);
}
if (Object.is(ctrlName, 'mdctrl')) {
this.MDCtrlEvent(eventName,args);
}
}
/**
* 搜索表单事件
*
* @param {string} eventName
* @param {*} [args={}]
* @memberof MDViewEngine
*/
public searchFormEvent(eventName: string, args: any = {}): void {
if (Object.is(eventName, 'load')) {
this.onSearchFormLoad(args);
}
}
/**
*
*
* @param {string} eventName
* @param {*} [args={}]
* @memberof GridViewEngine
*/
/**
* 事件处理
*
* @param {string} eventName
* @param {any[]} args
* @memberof MDViewEngine
*/
public MDCtrlEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'rowclick')) {
this.doEdit(args);
}
if (Object.is(eventName, 'click')) {
this.doEdit(args);
}
if (Object.is(eventName, 'rowdblclick')) {
this.doEdit(args);
}
if (Object.is(eventName, 'selectchange')) {
this.selectionChange(args);
}
if (Object.is(eventName, 'load')) {
this.MDCtrlLoad(args);
}
if (Object.is(eventName, 'beforeload')) {
this.MDCtrlBeforeLoad(args)
}
}
/**
* 搜索表单加载完成
*
* @param {*} [args={}]
* @memberof MDViewEngine
*/
public onSearchFormLoad(args: any = {}): void {
if (this.getMDCtrl()) {
const tag = this.getMDCtrl().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: {} });
}
}
/**
* 处理实体界面行为
*
* @param {string} tag
* @param {string} [actionmode]
* @returns {void}
* @memberof GridViewEngine
*/
public doSysUIAction(tag: string, actionmode?: string): void {
// if (Object.is(tag, 'Help')) {
// this.doHelp(params);
// return;
// }
if (Object.is(tag, 'Edit')) {
this.doEdit();
return;
}
// if (Object.is(tag, 'View')) {
// this.doView(params);
// return;
// }
// if (Object.is(tag, 'Print')) {
// this.doPrint(params);
// return;
// }
// if (Object.is(tag, 'ExportExcel')) {
// this.doExportExcel(params);
// return;
// }
// if (Object.is(tag, 'ExportModel')) {
// this.doExportModel(params);
// return;
// }
// if (Object.is(tag, 'Copy')) {
// this.doCopy(params);
// return;
// }
if (Object.is(tag, 'Remove')) {
this.doRemove();
return;
}
// if (Object.is(tag, 'Import')) {
// this.doImport(params);
// return;
// }
// if (Object.is(tag, 'Refresh')) {
// this.doRefresh(params);
// return;
// }
// if (Object.is(tag, 'NewRow')) {
// this.doCheck(params);
// return;
// }
if (Object.is(tag, 'SaveRow')) {
this.doSaveEditRow();
return;
}
if (Object.is(tag, 'New')) {
this.doNew();
return;
}
if (Object.is(tag, 'OpenRowEdit')) {
this.doOpenRowEdit();
return;
}
if (Object.is(tag, 'CloseRowEdit')) {
this.doCloseRowEdit();
return;
}
// if (Object.is(tag, 'ToggleRowEdit')) {
// this.doToggleRowEdit(params);
// return;
// }
// if (Object.is(tag, 'ToggleFilter')) {
// this.doToggleFilter(params);
// return;
// }
super.doSysUIAction(tag, actionmode);
}
/**
* 多数据项界面_开启行编辑操作
*
* @memberof GridViewEngine
*/
public doOpenRowEdit(): void {
if (this.getMDCtrl()) {
const tag = this.getMDCtrl().name;
this.setViewState2({ tag: tag, action: 'openEdit', viewdata: {} });
}
}
/**
* 多数据项界面_关闭行编辑操作
*
* @memberof GridViewEngine
*/
public doCloseRowEdit(): void {
if (this.getMDCtrl()) {
const tag = this.getMDCtrl().name;
this.setViewState2({ tag: tag, action: 'closeEdit', viewdata: {} });
}
}
/**
* 多数据项界面_提交编辑数据操作
*
* @memberof GridViewEngine
*/
public doSaveEditRow(): void {
if (this.getMDCtrl()) {
const tag = this.getMDCtrl().name;
this.setViewState2({ tag: tag, action: 'submitEidt', viewdata: {} });
}
}
/**
* 多数据项界面_编辑操作
*
* @param {*} [params={}]
* @returns {void}
* @memberof GridViewEngine
*/
public doEdit(params: any = {}): void {
// 获取要编辑的数据集合
if (params && params.srfkey) {
if (this.isFunc(this.getMDCtrl().findItem)) {
params = this.getMDCtrl().findItem('srfkey', params.srfkey);
}
const arg = { data: params };
this.onEditData(arg);
return;
}
if (this.isFunc(this.getMDCtrl().getSelection)) {
const selectedData = this.getMDCtrl().getSelection();
if (selectedData == null || selectedData.length === 0) {
return;
}
this.onEditData({ data: selectedData[0] });
}
}
/**
* 编辑数据
*
* @param {*} arg
* @memberof GridViewEngine
*/
public onEditData(arg: any): void {
const loadParam: any = {};
// if (this.getViewParam()) {
// Object.assign(loadParam, this.getViewParam());
// }
// if (this.getParentMode()) {
// Object.assign(loadParam, this.getParentMode());
// }
// if (this.getParentData()) {
// Object.assign(loadParam, this.getParentData());
// }
if (arg.srfcopymode) {
Object.assign(loadParam, {
srfsourcekey: arg.data.srfkey
});
} else {
Object.assign(loadParam, { srfkey: arg.data.srfkey, srfdeid: arg.data.srfdeid });
}
if (this.openData && this.isFunc(this.openData)) {
this.openData(loadParam);
}
}
/**
* 多数据项界面_新建操作
*
* @param {*} [params={}]
* @memberof GridViewEngine
*/
public doNew(params: any = {}): void {
this.onNewData();
}
/**
* 新建数据
*
* @returns {void}
* @memberof GridViewEngine
*/
public onNewData(): void {
// tslint:disable-next-line:prefer-const
let loadParam: any = {};
// if (this.getViewParam()) {
// Object.assign(loadParam, this.getViewParam());
// }
// if (this.getParentMode()) {
// Object.assign(loadParam, this.getParentMode());
// }
// if (this.getParentData()) {
// Object.assign(loadParam, this.getParentData());
// }
// if (this.isEnableRowEdit() && (this.getMDCtrl() && this.getMDCtrl().getOpenEdit())) {
// this.doNewRow(loadParam);
// return;
// }
// if (this.isEnableBatchAdd()) {
// this.doNewDataBatch(loadParam);
// return;
// }
// if (this.doNewDataWizard(loadParam)) {
// return;
// }
this.doNewDataNormal(loadParam);
}
/**
* 常规新建数据
*
* @param {*} arg
* @returns {*}
* @memberof GridViewEngine
*/
public doNewDataNormal(arg: any): any {
// let view = this.getNewDataView(arg);
// if (view == null) {
// return false;
// }
// const openMode = view.openMode;
// if (!openMode || Object.is(openMode, '')) {
// view.openMode = 'INDEXVIEWTAB';
// }
// if (!view.state) {
// view.state = 'new';
// let viewParam: any = {};
// Object.assign(viewParam, view.viewParam);
// if (viewParam && viewParam.srfnewmode && !Object.is(viewParam.srfnewmode, '')) {
// const srfnewmode: string = viewParam.srfnewmode.split('@').join('__');
// view.state = view.state + '_' + srfnewmode.toLowerCase();
// }
// }
return this.openDataView(arg);
}
/**
* 多数据项界面_删除操作
*
* @memberof MDViewEngine
*/
public doRemove(): void {
}
public openDataView(view: any = {}): boolean {
const openMode = view.openMode;
// if (view.redirect) {
// this.redirectOpenView(view);
// return false;
// }
if (openMode !== undefined) {
if (Object.is(openMode, 'POPUPMODAL')) {
view.modal = true;
} else if (Object.is(openMode, 'POPUP')) {
view.modal = true;
} else if (Object.is(openMode, '') || Object.is(openMode, 'INDEXVIEWTAB')) {
view.modal = false;
}
}
// if (view.modal) {
// let modalview = this.openModal(view);
// modalview.subscribe((result: any) => {
// if (result && Object.is(result.ret, 'OK')) {
// this.onRefresh();
// }
// });
// return true;
// }
// else {
// this.openWindow(view.viewurl, view.viewparam);
// }
if (this.newData && this.isFunc(this.newData)) {
this.newData({});
}
return true;
}
/**
* 选中变化
*
* @param {any[]} args
* @memberof GridViewEngine
*/
public selectionChange(args: any[]): void {
if (this.view) {
this.view.$emit('dataschange',args);
}
if (this.getPropertyPanel()) {
const tag = this.getPropertyPanel().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: args[0] });
}
}
/**
* 多数据部件加载完成
*
* @param {any[]} args
* @memberof MDViewEngine
*/
public MDCtrlLoad(args: any[]) {
if (this.view) {
this.view.$emit('viewload',args);
}
}
/**
* 多数据部件加载之前
*
* @param {*} [arg={}]
* @memberof MDViewEngine
*/
public MDCtrlBeforeLoad(arg: any = {}): void {
if (this.viewdata.srfparentdata && Object.keys(this.viewdata.srfparentdata).length > 0) {
Object.assign(arg, { srfparentdata: this.viewdata.srfparentdata });
}
if (this.view) {
Object.assign(arg, { query: this.view.query });
}
}
/**
* 获取多数据部件
*
* @returns {*}
* @memberof MDViewEngine
*/
public getMDCtrl(): any {
return this.mdctrl;
}
/**
* 获取属性面板
*
* @returns
* @memberof PickupGridViewEngine
*/
public getPropertyPanel() {
return this.propertypanel;
}
}
\ No newline at end of file
import ViewEngine from './view-engine';
/**
* 编辑视图引擎
*
* @export
* @class MobPickupTreeViewEngine
* @extends {ViewEngine}
*/
export default class MobPickupTreeViewEngine extends ViewEngine {
/**
* 树部件
*
* @protected
* @type {*}
* @memberof MobTreeViewEngine
*/
protected tree: any;
/**
* 初始化编辑视图引擎
*
* @param {*} [options={}]
* @memberof MobTreeViewEngine
*/
public init(options: any = {}): void {
this.tree = options.tree;
super.init(options);
}
/**
* 引擎加载
*
* @param {*} [opts={}]
* @memberof MobTreeViewEngine
*/
public load(opts: any = {}): void {
super.load(opts);
if (this.getTree()) {
const tag = this.getTree().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: this.viewdata });
}
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof MobTreeViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'tree')) {
this.treeEvent(eventName, args);
}
}
/**
* 树事件
*
* @param {string} eventName
* @param {*} args
* @memberof MobTreeViewEngine
*/
public treeEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'load')) {
this.onTreeLoad(args);
}
if (Object.is(eventName, 'selectchange')) {
this.onTreeSelectchange(args);
}
}
/**
* 树加载完成
*
* @param {*} args
* @memberof MobTreeViewEngine
*/
public onTreeLoad(args: any): void {
if (this.view) {
this.view.datainfo = args.srfmajortext;
this.view.viewdataschange.emit({action:'load',data:args});
}
}
/**
* 树点击事件
*
* @param {*} args
* @memberof MobTreeViewEngine
*/
public onTreeSelectchange(args: any): void {
if(this.view){
this.view.selectedArray = args;
this.view.viewdataschange.emit({action:'selectchange',data:args});
}
}
/**
* 获取树对象
*
* @returns {*}
* @memberof MobTreeViewEngine
*/
public getTree(): any {
return this.tree;
}
}
\ No newline at end of file
import ViewEngine from './view-engine';
/**
* 实体选择视图
*
* @export
* @class MobPickupViewEngine
* @extends {ViewEngine}
*/
export default class MobPickupViewEngine extends ViewEngine {
/**
* 选择视图面板
*
* @type {*}
* @memberof MobPickupViewEngine
*/
public pickupViewPanel: any = null;
/**
* Creates an instance of MobPickupViewEngine.
*
* @memberof MobPickupViewEngine
*/
constructor() {
super();
}
/**
* 初始化引擎
*
* @param {*} options
* @memberof MobPickupViewEngine
*/
public init(options: any): void {
this.pickupViewPanel = options.pickupviewpanel;
super.init(options);
}
/**
* 引擎加载
*
* @memberof MobPickupViewEngine
*/
public load(): void {
this.view.viewSelections = [];
super.load();
const _srfparentdata = this.viewdata.srfparentdata ? { srfparentdata: this.viewdata.srfparentdata } : { srfparentdata: {} };
if (this.getPickupViewPanel()) {
const tag = this.getPickupViewPanel().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: _srfparentdata });
}
}
/**
*
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof MobPickupViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(eventName, 'dataschange')) {
this.onSelectionChange(ctrlName, args);
}
if (Object.is(eventName, 'activated')) {
this.view.$emit('viewdatasactivated', args);
}
}
/**
* 值选中变化
*
* @param {any[]} args
* @memberof MobPickupViewEngine
*/
public onSelectionChange(ctrlName:any,args: any[]): void {
this.view.containerModel[`view_${ctrlName}`].selections = args;
this.view.viewSelections = [];
this.view.viewSelections.push(args);
const _disabled: boolean = this.view.viewSelections.length > 0 ? false : true;
this.view.containerModel.view_okbtn.disabled = _disabled;
}
/**
* 获取选择视图面板
*
* @returns {*}
* @memberof MobPickupViewEngine
*/
public getPickupViewPanel(): any {
return this.pickupViewPanel;
}
}
\ No newline at end of file
import ViewEngine from './view-engine';
/**
* 编辑视图引擎
*
* @export
* @class MobTreeViewEngine
* @extends {ViewEngine}
*/
export default class MobTreeViewEngine extends ViewEngine {
/**
* 树部件
*
* @protected
* @type {*}
* @memberof MobTreeViewEngine
*/
protected tree: any;
/**
* 初始化编辑视图引擎
*
* @param {*} [options={}]
* @memberof MobTreeViewEngine
*/
public init(options: any = {}): void {
this.tree = options.tree;
super.init(options);
}
/**
* 引擎加载
*
* @param {*} [opts={}]
* @memberof MobTreeViewEngine
*/
public load(opts: any = {}): void {
super.load(opts);
if (this.getTree()) {
const tag = this.getTree().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: this.viewdata });
}
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof MobTreeViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'tree')) {
this.treeEvent(eventName, args);
}
}
/**
* 树事件
*
* @param {string} eventName
* @param {*} args
* @memberof MobTreeViewEngine
*/
public treeEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'load')) {
this.onTreeLoad(args);
}
if (Object.is(eventName, 'click')) {
this.onTreeClick(args);
}
}
/**
* 树加载完成
*
* @param {*} args
* @memberof MobTreeViewEngine
*/
public onTreeLoad(args: any): void {
if (this.view) {
this.view.datainfo = args.srfmajortext;
this.view.viewdataschange.emit({action:'load',data:args});
}
}
/**
* 树点击事件
*
* @param {*} args
* @memberof MobTreeViewEngine
*/
public onTreeClick(args: any): void {
if(this.view){
this.view.viewdataschange.emit({action:'click',data:args});
}
}
/**
* 保存视图数据
*
* @param {*} [arg={}]
* @memberof MobTreeViewEngine
*/
public saveData(arg: any = {}): void {
if (this.getTree()) {
const tag = this.getTree().name;
this.setViewState2({ tag: tag, action: 'save', viewdata: arg });
}
}
/**
* 获取树对象
*
* @returns {*}
* @memberof MobTreeViewEngine
*/
public getTree(): any {
return this.tree;
}
}
\ No newline at end of file
import ViewEngine from './view-engine';
/**
* 编辑视图引擎
*
* @export
* @class MobWFActionViewEngine
* @extends {ViewEngine}
*/
export default class MobWFActionViewEngine extends ViewEngine {
/**
* 表单部件
*
* @protected
* @type {*}
* @memberof MobWFActionViewEngine
*/
protected form: any;
/**
* 父健为当前健
*
* @protected
* @type {string}
* @memberof MobWFActionViewEngine
*/
protected p2k: string = '';
/**
* 初始化编辑视图引擎
*
* @param {*} [options={}]
* @memberof MobWFActionViewEngine
*/
public init(options: any = {}): void {
this.form = options.form;
this.p2k = options.p2k;
super.init(options);
}
/**
* 引擎加载
*
* @param {*} [opts={}]
* @memberof MobWFActionViewEngine
*/
public load(opts: any = {}): void {
super.load(opts);
if (this.getForm()) {
const tag = this.getForm().name;
if (Object.is(this.p2k, '1') && this.viewdata.srfparentdata && !Object.is(this.viewdata.srfparentdata.srfparentkey, '')) {
Object.assign(this.viewdata, { srfkey: this.viewdata.srfparentdata.srfparentkey });
}
const action: string = this.viewdata.srfkey && !Object.is(this.viewdata.srfkey, '') ? 'load' : 'loaddraft';
this.setViewState2({ tag: tag, action: action, viewdata: this.viewdata });
}
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof MobWFActionViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'form')) {
this.formEvent(eventName, args);
}
}
/**
* 表单事件
*
* @param {string} eventName
* @param {*} args
* @memberof MobWFActionViewEngine
*/
public formEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'load')) {
this.onFormLoad(args);
}
if (Object.is(eventName, 'save')) {
this.onFormSave(args);
}
if (Object.is(eventName, 'remove')) {
this.onFormRemove(args);
}
if (Object.is(eventName, 'wfstart')) {
this.onFormWFStart(args);
}
if (Object.is(eventName, 'wfsubmit')) {
this.onFormWFSubmit(args);
}
}
/**
* 表单加载完成
*
* @param {*} args
* @memberof MobWFActionViewEngine
*/
public onFormLoad(args: any): void {
if (Object.is(args.srfuf, '1')) {
this.view.datainfo = args.srfmajortext;
this.view.viewdataschange.emit({action:'load',data:args});
}
}
/**
* 表单工作流开始流程完成
*
* @param {*} args
* @memberof MobWFActionViewEngine
*/
public onFormWFStart(args: any): void {
if (this.view) {
this.view.viewdataschange.emit({action:'wfstart',data:args});
}
}
/**
* 表单工作流提交完成
*
* @param {*} args
* @memberof MobWFActionViewEngine
*/
public onFormWFSubmit(args: any): void {
if (this.view) {
this.view.viewdataschange.emit({action:'wfsubmit',data:args});
this.view.$activeData = args;
this.view.backView();
this.view.$navCtrl.back();
}
}
/**
* 表单保存完成
*
* @param {*} args
* @memberof MobWFActionViewEngine
*/
public onFormSave(args: any): void {
if(this.view){
this.view.viewdataschange.emit({action:'save',data:args});
if(this.viewdata){
this.submitData(this.viewdata);
}else{
this.submitData({});
}
}
}
/**
* 表单删除完成
*
* @param {*} args
* @memberof MobWFActionViewEngine
*/
public onFormRemove(args: any): void {
this.view.viewrefreshTag =true;
this.view.viewdataschange.emit({action:'remove',data:args});
}
/**
* 处理实体界面行为
*
* @param {string} tag
* @param {string} [actionmode]
* @returns {void}
* @memberof MobWFActionViewEngine
*/
public doSysUIAction(tag: string, actionmode?: string): void {
if (Object.is(tag, 'Save')) {
this.doSave();
return;
}
super.doSysUIAction(tag, actionmode);
}
/**
* 编辑界面_保存操作
*
* @memberof IBizEditViewController
*/
public doSave(): void {
// this.afterformsaveaction = '';
if(this.viewdata){
this.saveData(this.viewdata);
}else{
this.saveData({});
}
}
/**
* 保存视图数据
*
* @param {*} [arg={}]
* @memberof MobWFActionViewEngine
*/
public saveData(arg: any = {}): void {
if (this.getForm()) {
const tag = this.getForm().name;
this.setViewState2({ tag: tag, action: 'save', viewdata: arg });
}
}
/**
* 提交工作流
*
* @param {*} [arg={}]
* @memberof MobWFActionViewEngine
*/
public submitData(arg: any = {}): void {
if (this.getForm()) {
const tag = this.getForm().name;
this.setViewState2({ tag: tag, action: 'submit', viewdata: arg });
}
}
/**
* 获取表单对象
*
* @returns {*}
* @memberof MobWFActionViewEngine
*/
public getForm(): any {
return this.form;
}
}
\ No newline at end of file
import EditViewEngine from './edit-view-engine';
/**
* 编辑视图引擎
*
* @export
* @class EditViewEngine
* @extends {ViewEngine}
*/
export default class MobWFEditViewEngine extends EditViewEngine {
/**
* 表单部件
*
* @protected
* @type {*}
* @memberof EditViewEngine
*/
protected form: any;
/**
* 工具栏
*
* @protected
* @type {*}
* @memberof EditViewEngine
*/
protected righttoolbar: any;
/**
* 快速工具栏
*
* @protected
* @type {*}
* @memberof EditViewEngine
*/
protected quicktoolbar: any;
/**
* 父健为当前健
*
* @protected
* @type {string}
* @memberof EditViewEngine
*/
protected p2k: string = '';
/**
* 初始化编辑视图引擎
*
* @param {*} [options={}]
* @memberof EditViewEngine
*/
public init(options: any = {}): void {
super.init(options);
this.righttoolbar = options.righttoolbar;
this.quicktoolbar =options.quicktoolbar;
}
}
\ No newline at end of file
import EditViewEngine from './edit-view-engine';
/**
* 工作流编辑视图3引擎
*
* @export
* @class EditViewEngine
* @extends {ViewEngine}
*/
export default class MobWFEditView3Engine extends EditViewEngine {
}
\ No newline at end of file
import MobMDViewEngine from './mob-mdview-engine';
export default class MobWFMDViewEngine extends MobMDViewEngine {
/**
* 编辑数据
*
* @param {*} arg
* @memberof MobWFMDViewEngine
*/
public onEditData(arg: any): void {
const loadParam: any = {};
Object.assign(loadParam, { taskid: arg.data.srfkey, srfkey: arg.data.businesskey });
if (this.openData && this.isFunc(this.openData)) {
this.openData(loadParam);
}
}
}
\ No newline at end of file
import EditViewEngine from './edit-view-engine';
export default class MobWFStartViewEngine extends EditViewEngine {
}
\ No newline at end of file
import { Util } from '@/utils/util/util';
/**
*
*
* @export
* @class ViewEngine
*/
export default class ViewEngine {
/**
* 视图部件对象
*
* @protected
* @type {*}
* @memberof ViewEngine
*/
protected view: any = null;
/**
* 引擎参数
*
* @type {*}
* @memberof ViewEngine
*/
protected opt: any = {};
/**
*
*
* @type {*}
* @memberof ViewEngine
*/
protected methods: any = {};
/**
* 视图数据
*
* @type {*}
* @memberof ViewEngine
*/
public viewdata: any = {};
/**
* 是否默认记载
*
* @type {boolean}
* @memberof ViewEngine
*/
public isLoadDefault: boolean = true;
/**
* Creates an instance of ViewEngine.
* @memberof ViewEngine
*/
constructor() { }
/**
* 引擎初始化
*
* @param {*} [options={}]
* @memberof ViewEngine
*/
public init(options: any = {}): void {
this.opt = options;
this.methods = options.methods;
this.view = options.view;
this.isLoadDefault = options.isLoadDefault;
const hasviewdata: boolean = this.view.viewdata ? true : false;
if (hasviewdata) {
try {
Object.assign(this.viewdata, JSON.parse(this.view.viewdata));
} catch (error) {
console.log(error);
}
} else {
const _viewdata: any = {};
const router = this.view.$route;
if (router && router.query && router.query.srfkey) {
Object.assign(_viewdata,router.query);
}
Object.assign(this.viewdata, _viewdata);
}
if (this.view.srfparentdata && this.viewdata.srfparentdata) {
Object.assign(this.view.srfparentdata, this.viewdata.srfparentdata);
}
this.load();
}
/**
* 设置视图数据
*
* @param {string} viewdata
* @memberof ViewEngine
*/
public setViewData(viewdata: string): void {
this.viewdata = {};
try {
Object.assign(this.viewdata, JSON.parse(viewdata));
} catch (error) {
console.log(error);
}
if (this.view.srfparentdata && this.viewdata.srfparentdata) {
Object.assign(this.view.srfparentdata, this.viewdata.srfparentdata);
}
}
/**
* 引擎加载
*
* @param {*} [opts={}]
* @memberof ViewEngine
*/
public load(opts: any = {}): void {
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof ViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
}
/**
* 处理界面行为
*
* @param {string} tag
* @param {string} [actionmode]
* @memberof ViewEngine
*/
public doSysUIAction(tag: string, actionmode?: string): void {
if (Object.is(actionmode, 'FRONT')) {
if (this.methods.front) {
this.methods.front(tag);
}
}
}
/**
* 处理工作流界面行为
*
* @param {string} tag
* @param {string} [actionmode]
* @memberof ViewEngine
*/
public doSysWFUIAction(tag: string, actionmode?: string): void {
if (Object.is(actionmode, 'WFFRONT')) {
if (this.methods.wfFront) {
this.methods.wfFront(tag);
}
}
}
/**
* 是否为方法
*
* @protected
* @param {*} func
* @returns {boolean}
* @memberof ViewEngine
*/
protected isFunc(func: any): boolean {
return func instanceof Function;
}
/**
* 父数据参数模式
*
* @param {{ tag: string, action: string, viewdata: any }} { tag, action, viewdata }
* @memberof ViewEngine
*/
public setViewState2({ tag, action, viewdata }: { tag: string, action: string, viewdata: any }): void {
this.view.viewState.next({ tag: tag, action: action, data: viewdata });
}
}
\ No newline at end of file
<template>
<van-action-sheet v-model="isShow" :actions="actions" @select="onSelect" cancel-text="取消"/>
</template>
<script lang="ts">
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { Subject } from 'rxjs';
@Component({
components: {
}
})
export default class AppActionSheet extends Vue {
/**
* 是否显示
*
* @type {boolean}
* @memberof AppActionSheet
*/
public isShow:boolean = false;
/**
* 可观察对象
*
* @type {Subject}
* @memberof AppActionSheet
*/
public subject = new Subject();
/**
* 选项组
*
* @type {boolean}
* @memberof AppActionSheet
*/
@Prop() public actions?: Array<any>;
/**
* 选中某一个选项
*
* @memberof AppActionSheet
*/
public onSelect(item:any){
this.hide(item);
this.$emit('select',item);
}
/**
* 显示
*
* @memberof AppActionSheet
*/
public show() {
    this.isShow = true;
return this.subject;
  }
/**
* 隐藏
*
* @memberof AppActionSheet
*/
public  hide(item:any) {
    this.isShow = false;
this.subject.next(item);
this.subject.asObservable();
document.body.removeChild(this.$el);
this.$destroy();
 }
}
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<div class="app-app-menu">
<van-panel :title="title">
<van-grid :column-num="4">
<van-grid-item
v-for="value in menus"
:key="value.id"
:id="value.id"
:icon="value.icon?value.icon:'photo-o'"
:text="value.text"
@click="menuClick(value.name)"
/>
</van-grid>
</van-panel>
</div>
</template>
<script lang="ts">
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
@Component({
components: {
}
})
export default class AppMenu extends Vue {
/**
* 名称
*
* @type {string}
* @memberof AppMenu
*/
@Prop() public title?: string;
/**
* 菜单数据
*
* @type {Array<any>}
* @memberof AppMenu
*/
@Prop() public menus?:Array<any>;
/**
* 菜单点击事件
*
* @memberof AppMenu
*/
public menuClick($event:any){
this.$emit('menuClick',$event);
}
}
</script>
<style lang="less">
.app-app-menu{
.van-cell__title {
text-align: left;
}
}
</style>
\ No newline at end of file
<template>
<div class="list-cardlist-card">
<div class="list-line">
<div class="timebox" v-if="item.time">{{item.time.substr(0,10)}}</div>
<div class="infobox">
<div class="infoline">
<div class="infoleft">
<van-icon class="list-card-icon" name="bookmark-o" />
<label class="bookname" v-if="item.srfmajortext">{{item.srfmajortext}}</label>
</div>
<div class="inforight">
<van-icon icon-rigth name="arrow" />
</div>
</div>
<div class="list-hr"></div>
<div class="infoline">
<div class="booktypebox">
<div >
<p class="type-p">副标题</p>
</div>
<p class="typeinfo" v-if="item.subtitle">{{item.subtitle}}</p>
</div>
<div>
<p class="type-p">数量</p>
<p class="typeinfo" v-if="item.num">{{item.num}}</p>
</div>
<div>
<p class="type-p">内容</p>
<p class="typeinfo" v-if="item.content">{{item.content}}</p>
</div>
</div>
</div>
</div>
</div>
</template>
<script lang="ts">
import {
Vue,
Component,
Prop,
Provide,
Emit,
Watch
} from "vue-property-decorator";
@Component({
components: {}
})
export default class AppCardList extends Vue{
/**
* 传入item
*
* @type {any}
* @memberof AppCardList
*/
@Prop() public item?: any;
};
</script>
<style>
.list-card{
background-color: white;
}
.timebox {
padding-bottom: 1em;
text-align: left;
color: #969799;
margin-left: 1.6em;
}
.infoleft {
position: relative;
}
.list-card-icon {
position: relative;
color: #87c2ff;
font-size: 1.3em;
top: 0.2em;
padding: 0 0.2em 0 0;
}
.list-line {
padding-bottom: 1em;
}
.infobox {
padding: 1em 0 0 0;
margin: 0 1.6em;
border-radius: 4px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
}
.infoline {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 1.5em;
}
.icon-rigth {
color: #26a2ff;
border-radius: 50%;
border: #26a2ff solid 0.0625em;
padding: 0.3em;
}
.bookname {
font-size: 1em;
font-weight: 500;
color: #5f5f5f;
}
.booknum {
font-size: 1em;
color: rgb(58, 58, 58);
}
.typeinfo {
color: #333;
}
.type-p {
font-size: 0.9em;
color: #666;
}
.list-hr {
display: block;
height: 1px;
margin: 1em 1.5em 0.1em 1.5em;
border-bottom: #cccccc solid 0.0625em;
}
i.van-icon.van-icon-arrow {
color: #26a2ff;
}
.inforight {
width: 22px;
height: 22px;
border: solid 1px #26a2ff;
border-radius: 50%;
line-height: 28px;
}
</style>
\ No newline at end of file
<template>
<div class="app-datetime-picker">
<mt-datetime-picker ref="picker" v-model="timeValue" type="datetime" @confirm="confirmTime">
</mt-datetime-picker>
<van-cell-group>
<!-- :readonly="true" -->
<van-field v-model="curValue" :disabled="disabled" :placeholder="placeholder" @focus="openTime()" />
</van-cell-group>
</div>
</template>
<script lang="ts">
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
// import * as moment from 'moment';
const moment = require('moment');
@Component({
components: {
}
})
export default class AppDateTimePicker extends Vue {
/**
* 传入值
*
* @type {string}
* @memberof AppDateTimePicker
*/
@Prop() public value?:string;
/**
* 确定的时间
*
* @type {any}
* @memberof AppDateTimePicker
*/
get curValue(){
return this.value;
}
set curValue(value:any){
this.$emit('valuechange',value);
}
get timeValue(){
if(this.value){
return moment(this.value).format('YYYY-MM-DD HH:mm:ss');
}
}
set timeValue(val:any){
}
/**
* 是否禁用
*
* @type {boolean}
* @memberof AppDateTimePicker
*/
@Prop() public disabled?:boolean;
/**
* placeholder
*
* @type {boolean}
* @memberof AppDateTimePicker
*/
@Prop() public placeholder?:string;
/**
* 时间点击事件
*
* @memberof AppDateTimePicker
*/
public openTime(){
let datetimepicker:any = this.$refs.picker;
datetimepicker.open();
}
/**
* 确定时间点击事件
*
* @memberof AppDateTimePicker
*/
public confirmTime($event:any){
this.curValue = moment($event).format('YYYY-MM-DD HH:mm:ss');
}
}
</script>
<style lang="less">
.app-datetime-picker{
.mint-datetime{
z-index:2223 !important;
}
}
</style>
\ No newline at end of file
<template>
<div class="app-file-upload">
<div @click="deleteFile" class="app-file-upload-tag">
<van-tag v-if="isShow" type="primary" size="medium">{{fileList[0].name}}</van-tag>
<span v-if="isShow" class="app-file-upload-tag-close"><van-icon name="cross" /></span>
</div>
<van-uploader :after-read="afterRead" :accept="accept" :disabled="disabled" @oversize="oversize" :max-count="1" :max-size="maxSize">
<van-icon name="plus" />
</van-uploader>
</div>
</template>
<script lang="ts">
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import {Environment} from '@/environments/environment';
import axios from 'axios'
import { Toast } from 'vant'
@Component({
components: {
}
})
export default class AppUploadFile extends Vue {
/**
* 是否禁用
*
* @type {boolean}
* @memberof AppUploadFile
*/
@Prop() public disabled?:boolean;
/**
* 传入值
*
* @type {boolean}
* @memberof AppUploadFile
*/
@Prop() public value?:any;
/**
* 文件最大大小 byte
* @type {any}
* @memberof AppUploadFile
**/
public maxSize:number=5*1024*1024;
/**
* 可接受的类型
* @type {any}
* @memberof AppUploadFile
**/
public accept:any="*"
/**
* 是否显示
* @type {boolean}
* @memberof AppUploadFile
**/
public isShow:boolean = false;
/**
* 单个文件列表
* @type {Array<any>}
* @memberof AppUploadFile
**/
public fileList:Array<any> = [];
/**
* 监听value值变化
*
* @memberof AppUploadFile
*/
@Watch('value', { immediate: true, deep: true })
onValueChanged(val: any, oldVal: any) {
if(val && JSON.parse(val).length >0){
this.fileList = JSON.parse(val);
this.isShow = true;
}else{
this.fileList = [];
this.isShow = false;
}
}
/**
* 已读后上传
* @param {*} file
* @memberof AppUploadFile
**/
public afterRead(file:any){
if(this.fileList.length >0){
return ;
}
this.upLoaderFile(file.file);
}
/**
* 上传文件超过最大限制调用
* @param {*} file
* @memberof AppUploadFile
**/
public oversize(file:any){
Toast("文件过大,上传失败")
}
/**
* 删除文件
* @param {*} file
* @memberof AppUploadFile
**/
public deleteFile(){
this.fileList = [];
this.isShow = false;
this.emitValue(this.fileList);
}
/**
* 组件抛出值
* @param {*} val
* @memberof AppUploadFile
**/
public emitValue(val:any){
this.$emit('valuechange',JSON.stringify(val));
}
/**
* 上传文件
*
* @memberof AppUploadFile
*/
public upLoaderFile (file:any) {
let params = new FormData()
params.append('file', file)
let config = {
headers: {
'Content-Type': 'multipart/form-data'
}
}
axios.post(Environment.BaseUrl+Environment.UploadFile ,params, config).then(res => {
if (res && res.data && res.status === 200) {
Toast("上传成功");
this.fileList.push(res.data)
this.isShow = true;
this.emitValue(this.fileList);
} else {
Toast("上传失败");
}
}).catch(err => {
Toast("上传失败");
});
}
}
</script>
<style lang="less">
.app-file-upload{
display: flex;
align-items: center;
justify-content: space-between;
padding-left: 2rem;
.app-file-upload-tag{
position: relative;
.van-tag {
padding: .5em .8em;
}
.app-file-upload-tag-close{
position: absolute;
top: 0;
right: 0;
color: #fff;
font-size: .5rem;
}
}
.van-uploader{
min-width: none;
.van-icon {
position: relative;
font: 14px/1 "vant-icon";
font-size: inherit;
font-size: 20px;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
margin-top: 10px;
}
}
}
</style>
\ No newline at end of file
<template>
<component :is="viewname" :viewdata="JSON.stringify({ srfparentdata: this.srfparentdata })" :formDruipart="formDruipart" class="viewcontainer2" @mditemsload="mdItemsLoad" @drdatasaved="drDataSaved" @drdatachange="drDataChange" @viewdataschange="viewDatasChange" @viewload="viewLoad"></component>
</template>
<script lang="ts">
import {
Vue,
Component,
Prop,
Provide,
Emit,
Watch
} from "vue-property-decorator";
import { Subject, Unsubscribable } from 'rxjs';
@Component({
components: {}
})
export default class AppFormDRUIPart extends Vue{
/**
* 表单数据
*
* @type {string}
* @memberof AppFormDRUIPart
*/
@Prop() public data!: string;
/**
* 关联视图
*
* @type {string}
* @memberof AppFormDRUIPart
*/
@Prop() public viewname?: string;
/**
* 刷新关系项
*
* @type {string}
* @memberof AppFormDRUIPart
*/
@Prop({ default: '' }) public refreshitems!: string;
/**
* 关系视图类型
*
* @type {string}
* @memberof AppFormDRUIPart
*/
@Prop() public refviewtype?: string;
/**
* 父数据
*
* @type {*}
* @memberof AppFormDRUIPart
*/
@Prop() public parentdata!: any;
/**
* 传入参数项名称
*
* @type {string}
* @memberof AppFormDRUIPart
*/
@Prop() public paramitem!: string;
/**
* 是否忽略表单项值变化
*
* @type {boolean}
* @memberof AppFormDRUIPart
*/
@Prop() public ignorefieldvaluechange!: boolean;
/**
* 表单状态
*
* @type {Subject<any>}
* @memberof AppFormDRUIPart
*/
@Prop() public formState!: Subject<any>
/**
* 表单状态事件
*
* @private
* @type {(Unsubscribable | undefined)}
* @memberof AppFormDRUIPart
*/
private formStateEvent: Unsubscribable | undefined;
/**
* 监控值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AppFormDRUIPart
*/
@Watch('data')
onActivedataChange(newVal: any, oldVal: any) {
if (this.ignorefieldvaluechange) {
return;
}
if (Object.is(newVal, oldVal)) {
return;
}
const newFormData: any = JSON.parse(newVal);
const oldDormData: any = JSON.parse(oldVal);
let refreshRefview = false;
this.hookItems.some((_hookItem: any) => {
if (!Object.is(newFormData[_hookItem], oldDormData[_hookItem])) {
refreshRefview = true;
return refreshRefview;
}
return refreshRefview;
});
if (refreshRefview) {
this.refreshDRUIPart();
}
}
/**
* 是否刷新关系数据
*
* @private
* @type {boolean}
* @memberof AppFormDRUIPart
*/
private isRelationalData: boolean = true;
/**
* 刷新节点
*
* @private
* @type {string[]}
* @memberof AppFormDRUIPart
*/
private hookItems: string[] = [];
/**
* 父数据
*
* @type {*}
* @memberof AppFormDRUIPart
*/
public srfparentdata: any = {};
/**
* 关系界面向视图下发指令对象
*
* @private
* @type {Subject<any>}
* @memberof AppFormDRUIPart
*/
private formDruipart: Subject<any> = new Subject<any>();
/**
* 刷新关系页面
*
* @private
* @returns {void}
* @memberof AppFormDRUIPart
*/
private refreshDRUIPart(data?:any): void {
if (Object.is(this.parentdata.SRFPARENTTYPE, 'CUSTOM')) {
this.isRelationalData = false;
}
const formData: any = data?data:JSON.parse(this.data);
const _paramitem = formData[this.paramitem];
this.srfparentdata = {};
Object.assign(this.srfparentdata, this.parentdata);
Object.assign(this.srfparentdata, { srfparentkey: _paramitem });
}
/**
* vue 生命周期
*
* @memberof AppFormDRUIPart
*/
public created(): void {
this.hookItems = [...this.refreshitems.split(';')];
if (!this.formState) {
return;
}
if (!Object.is(this.paramitem, 'srfkey')) {
this.hookItems.push(this.paramitem);
}
this.formStateEvent = this.formState.subscribe(($event: any) => {
// 表单加载完成
if (Object.is($event.type, 'load')) {
this.refreshDRUIPart($event.data);
}
// 表单保存之前
if (Object.is($event.type, 'beforesave')) {
if(Object.is(this.refviewtype,'DEMOBMEDITVIEW9')){
Object.assign($event.data,{end:true});
this.formDruipart.next({action:'save',data:$event.data});
}
}
// 表单保存完成
if (Object.is($event.type, 'save')) {
this.refreshDRUIPart($event.data);
}
// 表单项更新
if (Object.is($event.type, 'updateformitem')) {
if (!$event.data) {
return;
}
let refreshRefview = false;
Object.keys($event.data).some((name: string) => {
const index = this.hookItems.findIndex((_name: string) => Object.is(_name, name));
refreshRefview = index !== -1 ? true : false;
return refreshRefview;
});
if (refreshRefview) {
this.refreshDRUIPart($event.data);
}
}
});
this.refreshDRUIPart();
}
/**
* 部件销毁
*
* @memberof AppFormDRUIPart
*/
public destroyed(): void {
if (this.formStateEvent) {
this.formStateEvent.unsubscribe();
}
}
/**
* 多数据视图加载完成
*
* @public
* @memberof AppFormDRUIPart
*/
public mdItemsLoad(){
console.log('多数据视图加载完成,触发后续表单项更新');
}
/**
* DEMEDITVIEW9 关系数据保存完成
*
* @public
* @memberof AppFormDRUIPart
*/
public drDataSaved($event:any){
this.$emit('drdatasaved',$event);
console.log('DEMEDITVIEW9 关系数据保存完成'+$event);
}
/**
* DEMEDITVIEW9 关系数据值变化
*
* @public
* @memberof AppFormDRUIPart
*/
public drDataChange(){
console.log('DEMEDITVIEW9 关系数据值变化');
}
/**
* 视图数据变化
*
* @public
* @memberof AppFormDRUIPart
*/
public viewDatasChange(){
console.log('视图数据变化');
}
/**
* 视图加载完成
*
* @public
* @memberof AppFormDRUIPart
*/
public viewLoad(){
console.log('视图加载完成');
}
};
</script>
<style>
</style>
\ No newline at end of file
<template>
<div class="list02-box">
<div class="list02-text">
<van-icon class="list02-icon" name="bars" />
<label class="text_list02">{{item.srfmajortext}}</label>
</div>
<div>
<van-icon class="list02-icon" name="arrow" />
</div>
</div>
</template>
<script lang="ts">
import {
Vue,
Component,
Prop,
Provide,
Emit,
Watch
} from "vue-property-decorator";
@Component({
components: {}
})
export default class AppIconList extends Vue{
/**
* 传入item
*
* @type {any}
* @memberof AppIconList
*/
@Prop() public item?: any;
};
</script>
<style>
.list02-box {
width: 100%;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
justify-content: space-between;
border-bottom: 0.0625em solid #f0e9e9;
}
.list02-text {
color: #756d6d;
font-size: 1.1em;
}
i.list02-icon.ivu-icon.ivu-icon-ios-book {
color: #26a2ff;
padding-right: 0.2em;
}
i.list02-icon.ivu-icon.ivu-icon-ios-arrow-forward {
color: #ccc;
line-height: 1.4em;
}
.list02-icon {
font-size: 1.5em;
color: #26a2ff;
padding: 0.2em 0.7em;
}
.split {
border-top: 0.0625em solid #f0e9e9;
margin-top: 1.5em;
}
label.text_list02 {
position: relative;
top: -0.4em;
}
.van-radio__label{
margin-left: 0em !important;
}
.radio{
width: 100%;
}
.van-radio__label{
width: 100%;
}
.van-radio{
width: 100%;
}
.van-cell {
padding: 6px 14px !important;
}
</style>
\ No newline at end of file
<template>
<div class="app-icon-menu">
<van-panel :title="title" :status="turnValue" @click.native="foldOrUnfold()">
<div>
<van-grid :column-num="4">
<van-grid-item
v-for="value in foldBefore"
:key="value.id"
:id="value.id"
:icon="value.icon?value.icon:'photo-o'"
:text="value.text"
@click="menuClick(value.name)"
/>
</van-grid>
</div>
<div>
<van-grid :column-num="4" v-if="isDisplay">
<van-grid-item
v-for="value in foldAfter"
:key="value.id"
:id="value.id"
:icon="value.icon?value.icon:'photo-o'"
:text="value.text"
@click="menuClick(value.name)"
/>
</van-grid>
</div>
</van-panel>
</div>
</template>
<script lang="ts">
import {Vue,Component,Prop,Provide,Emit,Watch} from "vue-property-decorator";
@Component({
components: {}
})
export default class AppIconMenu extends Vue {
/**
* 下拉是否展开
*
* @type {string}
* @memberof AppIconMenu
*/
public isDisplay: boolean = false;
/**
* 右侧内容
*
* @type {string}
* @memberof AppIconMenu
*/
public turnValue: string = "展开";
/**
* 名称
*
* @type {string}
* @memberof AppIconMenu
*/
@Prop() public title?: string;
/**
* 菜单数据
*
* @type {Array<any>}
* @memberof AppIconMenu
*/
@Prop() public menus?: Array<any>;
/**
* 展开后的菜单展示内容
*
* @type {Array<any>}
* @memberof AppIconMenu
*/
public foldAfter: Array<any> = [];
/**
* 菜单展开前的展示
*
* @type {Array<any>}
* @memberof AppIconMenu
*/
public foldBefore: any = [];
/**
* 监听菜单数据
*
* @memberof AppIconMenu
*/
@Watch("menus", { immediate: true, deep: true })
onMenusChanged(val: any, oldVal: any) {
if (val) {
if (val.length > 8) {
val.forEach((item: any, index: any) => {
if (index < 8) {
this.foldBefore.push(item);
} else {
this.foldAfter.push(item);
}
});
} else {
this.foldBefore = this.menus;
this.turnValue = "";
}
}
}
/**
* 菜单点击事件
*
* @memberof AppIconMenu
*/
public menuClick($event: any) {
this.$emit("menuClick", $event);
}
/**
* 下拉菜单点击事件
*
* @memberof AppIconMenu
*/
public foldOrUnfold() {
if (this.turnValue == "展开") {
this.turnValue = "收回";
this.isDisplay = true;
} else {
this.turnValue = "展开";
this.isDisplay = false;
}
}
}
</script>
<style lang="less">
.app-icon-menu{
.van-cell__title {
text-align: left;
}
.van-collapse-item__content {
padding: 0px;
color: #2c3e50;
}
.van-panel__header-value {
color: #969799;
}
}
</style>
\ No newline at end of file
<template>
<div class="app-image-upload">
<van-row class="app-image-upload-label">
<van-col span="8" style="text-align: left;">
<span class="stars" style="color: red;" v-if="!allowEmpty">*</span>
{{labelText}}
</van-col>
<van-col span="16">
<van-uploader :after-read="afterRead" :before-read="beforeRead" @oversize="oversize" :max-size="maxSize" :disabled="disabled">
<van-icon name="photo" />
</van-uploader>
</van-col>
</van-row>
<div class="app-image-list">
<span v-for="item in fileList" :key="item.id" class="app-image-list-item">
<img :src="exportImageUrl+item.id" class="app-image-list-item-image"/>
<span class="app-file-upload-tag-close" @click="deleteImg(item)"><van-icon name="cross" /></span>
</span>
</div>
</div>
</template>
<script lang="ts">
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import {Environment} from '@/environments/environment';
import axios from 'axios'
import { Toast } from 'vant'
@Component({
components: {
}
})
export default class AppImageUpload extends Vue {
/**
* 父组件传递过来的image
*
* @type {Array<any>}
* @memberof AppImageUpload
**/
@Prop() public value?:any;
/**
* 是否允许为空
*
* @type {boolean}
* @memberof AppImageUpload
**/
@Prop() public allowEmpty!:boolean;
/**
* labelText
*
* @type {string}
* @memberof AppImageUpload
*/
@Prop() public labelText!:string;
/**
* 是否禁用
*
* @type {boolean}
* @memberof AppImageUpload
*/
@Prop() public disabled?:boolean;
/**
* 监听value值变化
*
* @memberof AppUploadFile
*/
@Watch('value', { immediate: true, deep: true })
onValueChanged(val: any, oldVal: any) {
if(val && JSON.parse(val).length >0){
this.fileList = JSON.parse(val);
}else{
this.fileList = [];
}
}
/**
* 文件最大大小
*
* @type {any}
* @memberof AppImageUpload
**/
public maxSize:number=5*1024*1024;
/**
* 导出路径
*
* @type {any}
* @memberof AppImageUpload
**/
public exportImageUrl:string=Environment.BaseUrl+Environment.ExportFile+'/';
/**
* 图片列表
*
* @type {Array<any>}
* @memberof AppImageUpload
**/
public fileList:Array<any> = []
/**
* 组件抛出值
* @param {*} val
* @memberof AppUploadFile
**/
public emitValue(val:any){
this.$emit('valuechange',JSON.stringify(val));
}
/**
* 删除图片时调用
*
* @type {file}
* @memberof AppImageUpload
*/
public deleteImg(file:any){
this.fileList = [];
this.emitValue(this.fileList);
}
/**
* 上传之前校验
*
* @type {file}
* @memberof AppImageUpload
*/
public beforeRead(file:any) {
let patt=/image/;
if (!patt.test(file.type)) {
Toast("请选择图片");
return false;
}else{
if(this.fileList.length >0){
Toast("最多选择一张图片");
return false;
}else{
return true;
}
}
}
/**
* 上传文件超过最大限制调用
*
* @type {file}
* @memberof AppImageUpload
*/
public oversize(file:any){
Toast("图片过大,上传失败")
}
/**
* 已读后上传
*
* @type {file}
* @memberof AppImageUpload
*/
public afterRead(file:any){
this.upLoaderImg(file.file);
}
/**
* 上传图片
*
* @memberof AppImageUpload
*/
public upLoaderImg (file:any) {
let params = new FormData()
params.append('file', file)
let config = {
headers: { //添加请求头
'Content-Type': 'multipart/form-data'
}
}
axios.post(Environment.BaseUrl+Environment.UploadFile ,params, config).then(res => {
if (res && res.data && res.status === 200) {
this.fileList =[];
this.fileList.push(res.data);
this.emitValue(this.fileList);
Toast('上传成功');
} else {
Toast('上传失败');
}
}).catch(err => {
Toast('上传失败');
});
}
}
</script>
<style lang="less">
.app-image-upload {
.app-image-upload-label {
display: flex;
align-items: center;
justify-content: space-between;
.van-icon {
position: relative;
font: 14px/1 "vant-icon";
font-size: inherit;
font-size: 20px;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
margin-top: 10px;
}
}
.app-image-list{
display: flex;
justify-content: space-between;
align-items: center;
.app-image-list-item{
position: relative;
.app-image-list-item-image{
max-width:100px;
max-height:80px;
}
.app-file-upload-tag-close{
position: absolute;
top: 0;
right: 0;
}
}
}
}
</style>
\ No newline at end of file
<template>
<van-cell-group>
<van-field
v-model="curValue"
:type="type"
:rows="getRows()"
:disabled="disabled"
:placeholder="placeholder"
/>
</van-cell-group>
</template>
<script lang="ts">
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
@Component({
components: {
}
})
export default class AppInput extends Vue {
/**
* 输入值
*
* @type {string}
* @memberof AppInput
*/
@Prop() public value?: string;
/**
* 获取输入的Value值
*
* @type {string}
* @memberof AppInput
*/
get curValue(){
return this.value;
};
/**
* 根据curValue变化抛出事件valuechange
*
* @type {string}
* @memberof AppInput
*/
set curValue(val:any){
this.$emit('valuechange',val);
}
/**
* 计算行数
*
* @memberof AppInput
*/
getRows(){
return this.type === "textarea"?3:1;
}
/**
* 类型
*
* @type {string}
* @memberof AppInput
*/
@Prop() public type?: string;
/**
* 禁用
*
* @type {boolean}
* @memberof AppInput
*/
@Prop() public disabled?: boolean;
/**
* 占位提示文字
*
* @type {string}
* @memberof AppInput
*/
@Prop() public placeholder?: string;
}
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<div class="app-list-menu">
<van-panel :title="title">
<van-cell v-for="item in menus" v-bind:key="item.id" is-link @click="menuClick(item.name)">
<template name="icon">
<van-icon :name="item.icon?item.icon:'photo-o'" />
</template>
<template name="title">
{{item.text}}
</template>
</van-cell>
</van-panel>
</div>
</template>
<script lang="ts">
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
@Component({
components: {
}
})
export default class AppListMenu extends Vue {
/**
* 名称
*
* @type {string}
* @memberof AppListMenu
*/
@Prop() public title?: string;
/**
* 菜单数据
*
* @type {Array<any>}
* @memberof AppListMenu
*/
@Prop() public menus?:Array<any>;
/**
* 菜单点击事件
*
* @memberof AppListMenu
*/
public menuClick($event:any){
this.$emit('menuClick',$event);
}
}
</script>
<style lang="less">
.app-list-menu{
.van-cell__title {
text-align: left;
}
}
</style>
\ No newline at end of file
<template>
<div class="app-loading"></div>
</template>
<script lang="ts">
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { Subject } from 'rxjs';
import { Indicator } from 'mint-ui';
@Component({
components: {
}
})
export default class AppLoading extends Vue {
/**
* 显示
*
* @memberof AppLoading
*/
public start() {
Indicator.open({
text: '加载中...',
spinnerType: 'fading-circle'
});
  }
/**
* 关闭
*
* @memberof AppLoading
*/
public  finish() {
Indicator.close();
document.body.removeChild(this.$el);
this.$destroy();
 }
}
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<div class="app-message-box"></div>
</template>
<script lang="ts">
import {
Vue,
Component,
Prop,
Provide,
Emit,
Watch
} from "vue-property-decorator";
import { Subject } from "rxjs";
import { MessageBox } from "mint-ui";
@Component({
components: {}
})
export default class AppPrompt extends Vue {
/**
* 显示
*
* @memberof AppPrompt
*/
public show(
content: any,
back: any
) {
content = this.innit(content);
//获取内容
MessageBox.confirm("", {
title: content.title,
message: content.message,
showCancelButton: content.showCancelButton,
confirmButtonText: content.confirmButtonText,
cancelButtonText: content.cancelButtonText,
showConfirmButton:content.showConfirmButton
})
.then((action: any) => {
if (action == "confirm") {
content.confirm();
}
})
.catch((error: any) => {
if (error == "cancel") {
content.cancel();
}
});
}
/**
* 逻辑判断
*
* @memberof AppPrompt
*/
public innit(content:any) {
//标题
if (!content.title) {
content.title = "提示";
}
//内容
if (!content.message) {
content.message = "确定执行此操作?";
}
//确定按钮
if (!content.confirmButtonText) {
content.confirmButtonText = "确定";
}
//取消按钮
if (!content.cancelButtonText) {
content.cancelButtonText = "取消";
}
//按钮是否显示
if (content.showCancelButton == null || content.showCancelButton == undefined) {
content.showCancelButton = true;
}
//按钮是否显示
if (content.showConfirmButton == null || content.showConfirmButton == undefined) {
content.showConfirmButton = true;
}
return content;
}
}
</script>
<style lang="less">
.v-modal{
z-index:2222 !important;
}
.mint-msgbox-wrapper{
z-index:2223 !important;
}
</style>
\ No newline at end of file
<template>
<div class="app-modal">
<van-dialog v-model="isShow" :show-confirm-button="false">
<component :is="componentName" :isModalMode="true" :viewdata="viewdata" :selectedData="selectedData" @viewdataschange="viewDatasChange" @close="colse" class="view-modal-container"></component>
</van-dialog>
</div>
</template>
<script lang="ts">
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { Subject } from 'rxjs';
@Component({
components: {
}
})
export default class AppModal extends Vue {
/**
* 输入组件名
*
* @type {string}
* @memberof AppModal
*/
@Prop() public componentName!: string;
/**
* 视图数据
*
* @type {any}
* @memberof AppModal
*/
@Prop() public viewdata:any;
/**
* 数据选择视图选中项
*
* @type {any}
* @memberof AppModal
*/
@Prop() public selectedData?:any;
/**
* 是否展示
*
* @type {boolean}
* @memberof AppModal
*/
public isShow: boolean = false;
/**
* 可观察对象
*
* @type {Subject}
* @memberof AppModal
*/
public subject = new Subject();
/**
* 显示
*
* @memberof AppModal
*/
public show() {
    this.isShow = true;
return this.subject;
  }
/**
* 隐藏
*
* @memberof AppModal
*/
public  hide(item?:any) {
    this.isShow = false;
this.subject.next(item);
this.subject.asObservable();
document.body.removeChild(this.$el);
this.$destroy();
 }
/**
* 视图数据修改
*
* @memberof AppModal
*/
public viewDatasChange($event:any){
if(!Object.is($event.action,'load') && !Object.is($event.action,'save')){
this.hide($event.data);
}
}
/**
* 视图关闭
*
* @memberof AppModal
*/
public colse(args?:any){
args?this.hide(args.data):this.hide();
}
}
</script>
<style lang="less">
.app-modal{
.van-overlay{
background-color: rgba(243, 240, 240, 0.7) !important;
}
.van-dialog {
top: 50% !important;
width: 100% !important;
height: 100% !important;
overflow: hidden;
font-size: 16px;
border-radius: 0px !important;
z-index:2100;
}
}
</style>
\ No newline at end of file
<template>
<div class="app-mpicker">
<van-row>
<van-col span="8" class="app-picker-label">
<span v-if="!allowEmpty" class="stars" style="color:red;">*</span>
{{labelText}}
</van-col>
<van-col span="16" class="app-picker-content">
<div v-for="(item,index) in curValue" :key="index" style="margin-right:5px;margin-top:2px;">
<van-tag
type="primary"
size="medium"
:closeable="true"
@close="remove(item)"
>{{item.srfmajortext}}</van-tag>
</div>
<div class="app-picker-icon"><van-icon name="search" @click="openModal" /></div>
</van-col>
</van-row>
</div>
</template>
<script lang="ts">
import {
Vue,
Component,
Prop,
Provide,
Emit,
Watch
} from "vue-property-decorator";
@Component({
components: {}
})
export default class AppMPicker extends Vue {
/**
* 输入值
* @type any
* @memberof AppMPicker
*/
@Prop() public value?: any;
get curValue() {
if (this.value) {
if (this.value instanceof Array) {
return this.value;
} else if (typeof this.value === "string") {
try {
return JSON.parse(this.value);
} catch (error) {
console.error(error);
}
}
} else {
return [];
}
}
set curValue(val: any) {
if (!val) {
this.$emit("valuechange", null);
} else {
this.$emit("valuechange", JSON.stringify(val));
}
}
/**
* 标签label
* @type string
* @memberof AppMPicker
*/
@Prop() public labelText?: string;
/**
* 是否允许为空
* @type boolean
* @memberof AppMPicker
*/
@Prop() public allowEmpty?: boolean;
/**
* 输入值
* @type boolean
* @memberof AppMPicker
*/
@Prop() public disabled?: boolean;
/**
* 空白提示信息
* @type string
* @memberof AppMPicker
*/
@Prop() public placeholder?: string;
/**
* 视图名称
* @type string
* @memberof AppMPicker
*/
@Prop() public viewname?: string;
/**
* 打开模态
*
* @memberof AppMPicker
*/
public openModal() {
if (this.viewname) {
let modalSubject = this.$modal({
componentName: this.viewname,
selectedData: this.curValue
}).show();
modalSubject.subscribe((res: any) => {
if (res) {
console.log(res);
this.curValue = res;
}
});
} else {
console.log("选择视图未配置");
}
}
/**
* 删除单个数据项
*
* @memberof AppMPicker
*/
public remove(value: any) {
if (this.disabled) {
return;
}
this.curValue = this.curValue.filter((item:any) =>{
return item.srfkey !== value.srfkey;
})
}
}
</script>
<style lang="less">
.app-mpicker {
.app-picker-label {
text-align: left;
}
.app-picker-content {
position: relative;
display: flex;
justify-content: normal;
align-items: center;
flex-wrap: wrap;
padding-right: 16px;
.app-picker-icon {
position: absolute;
top: 0px;
right: 0px;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="app-multiple-file-upload">
<van-row class="app-multiple-file-upload-label">
<van-col span="8" style="text-align: left;">
<span class="stars" style="color: red;" v-if="!allowEmpty">*</span>
{{labelText}}
</van-col>
<van-col span="16">
<van-uploader
:after-read="afterRead"
multiple
:accept="accept"
@oversize="oversize"
:max-size="maxSize"
>
<van-icon name="plus" />
</van-uploader>
</van-col>
</van-row>
<div class="app-multiple-list">
<div class="app-multiple-list-item" v-for="item in fileList" :key="item.id">
<van-cell :title="item.name"/>
<span class="app-file-upload-tag-close" @click="deleteFile(item)"><van-icon name="cross" /></span>
</div>
</div>
</div>
</template>
<script lang="ts">
import {
Vue,
Component,
Prop,
Provide,
Emit,
Watch
} from "vue-property-decorator";
import { Environment } from "@/environments/environment";
import axios from "axios";
import { Toast } from "vant";
@Component({
components: {}
})
export default class AppMultipleUploadFile extends Vue {
/**
* 标签文本值
*
* @type {string}
* @memberof AppMultipleUploadFile
*/
@Prop() public labelText!: string;
/**
* 是否必填
*
* @type {boolean}
* @memberof AppMultipleUploadFile
*/
@Prop() public allowEmpty!: boolean;
/**
* 是否禁用
*
* @type {boolean}
* @memberof AppMultipleUploadFile
*/
@Prop() public disabled?: boolean;
/**
* 传入值
*
* @type {any}
* @memberof AppMultipleUploadFile
*/
@Prop() public value?:any;
/**
* 监听value值变化
*
* @memberof AppUploadFile
*/
@Watch('value', { immediate: true, deep: true })
onValueChanged(val: any, oldVal: any) {
if(val && JSON.parse(val).length >0){
this.fileList = JSON.parse(val);
}else{
this.fileList = [];
}
}
/**
* 可接受的类型
*
* @type {any}
* @memberof AppMultipleUploadFile
**/
public accept: any = "*";
/**
* 文件最大大小
*
* @type {any}
* @memberof AppMultipleUploadFile
**/
public maxSize: number = 5*1024*1024;
/**
* 文件列表
*
* @type {Array<any>}
* @memberof AppUploadFile
**/
public fileList:Array<any> = [];
/**
* 文件过大限制
*
* @type {any}
* @memberof AppMultipleUploadFile
**/
public oversize(file:any) {
Toast("文件过大,上传失败");
}
/**
* 已读后上传
*
* @param {*} file
* @memberof AppMultipleUploadFile
**/
public afterRead(file: any) {
if (file.length > 1) {
file.forEach((item: any, index: any) => {
let uploadImg = this.upLoaderFile(item.file);
});
} else {
let uploadImg = this.upLoaderFile(file.file);
}
}
/**
* 删除文件
*
* @param {*} file
* @memberof AppMultipleUploadFile
**/
public deleteFile(file:any){
let tempFileList:Array<any> =[];
this.fileList.forEach((item:any) =>{
if(!Object.is(item.id,file.id)){
tempFileList.push(item);
}
})
this.emitValue(tempFileList);
}
/**
* 组件抛出值
* @param {*} val
* @memberof AppMultipleUploadFile
**/
public emitValue(val:any){
this.$emit('valuechange',JSON.stringify(val));
}
/**
* 上传文件
*
* @memberof AppMultipleUploadFile
*/
public upLoaderFile(file: any) {
let params = new FormData();
params.append("file", file);
let config = {
headers: {
"Content-Type": "multipart/form-data"
}
};
axios
.post(Environment.BaseUrl + Environment.UploadFile, params, config)
.then(res => {
if (res && res.data && res.status === 200) {
this.fileList.push(res.data);
this.emitValue(this.fileList);
Toast("上传成功");
} else {
Toast("上传失败");
}
})
.catch(err => {
Toast("上传失败");
});
}
}
</script>
<style lang="less">
.app-multiple-file-upload {
.app-multiple-file-upload-label {
display: flex;
align-items: center;
justify-content: space-between;
.van-icon {
position: relative;
font: 14px/1 "vant-icon";
font-size: inherit;
font-size: 20px;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
margin-top: 10px;
}
}
.app-multiple-list-item{
position: relative;
.app-file-upload-tag-close{
position: absolute;
right: 1rem;
top: 1rem;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="app-multiple-image-upload">
<van-row class="app-multiple-image-upload-label">
<van-col span="8" style="text-align: left;">
<span class="stars" style="color: red;" v-if="!allowEmpty">*</span>
{{labelText}}
</van-col>
<van-col span="16">
<van-uploader :after-read="afterRead" :before-read="beforeRead" multiple @oversize="oversize" :max-size="maxSize" :disabled="disabled">
<van-icon name="photo" />
</van-uploader>
</van-col>
</van-row>
<div class="app-image-list">
<span v-for="item in fileList" :key="item.id" class="app-image-list-item">
<img :src="exportImageUrl+item.id" class="app-image-list-item-image"/>
<span class="app-file-upload-tag-close" @click="deleteImg(item)"><van-icon name="cross" /></span>
</span>
</div>
</div>
</template>
<script lang="ts">
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import {Environment} from '@/environments/environment';
import axios from 'axios';
import { Toast } from 'vant';
@Component({
components: {
}
})
export default class AppMultipleImageUpload extends Vue {
/**
* 父组件传递过来的image
*
* @type {Array<any>}
* @memberof AppMultipleImageUpload
**/
@Prop() public value?:any;
/**
* 是否允许为空
*
* @type {boolean}
* @memberof AppMultipleImageUpload
**/
@Prop() public allowEmpty!:boolean;
/**
* labelText
*
* @type {string}
* @memberof AppMultipleImageUpload
*/
@Prop() public labelText!:string;
/**
* 是否禁用
*
* @type {boolean}
* @memberof AppMultipleImageUpload
*/
@Prop() public disabled?:boolean;
/**
* 监听value值变化
*
* @memberof AppUploadFile
*/
@Watch('value', { immediate: true, deep: true })
onValueChanged(val: any, oldVal: any) {
if(val && JSON.parse(val).length >0){
this.fileList = JSON.parse(val);
}else{
this.fileList = [];
}
}
/**
* 文件最大大小
*
* @type {any}
* @memberof AppMultipleImageUpload
**/
public maxSize:number=5*1024*1024;
/**
* 导出路径
*
* @type {any}
* @memberof AppMultipleImageUpload
**/
public exportImageUrl:string=Environment.BaseUrl+Environment.ExportFile+'/';
/**
* 图片列表
*
* @type {Array<any>}
* @memberof AppMultipleImageUpload
**/
public fileList:Array<any> = []
/**
* 组件抛出值
* @param {*} val
* @memberof AppUploadFile
**/
public emitValue(val:any){
this.$emit('valuechange',JSON.stringify(val));
}
/**
* 删除图片时调用
*
* @type {file}
* @memberof AppMultipleImageUpload
*/
public deleteImg(file:any){
let tempFileList:Array<any> =[];
this.fileList.forEach((item:any) =>{
if(!Object.is(item.id,file.id)){
tempFileList.push(item);
}
})
this.emitValue(tempFileList);
}
/**
* 上传之前校验
*
* @type {file}
* @memberof AppMultipleImageUpload
*/
public beforeRead(file:any) {
// let patt=/image/;
// console.log(file);
// if (!patt.test(file.type)) {
// Toast("请选择图片");
// return false;
// }else{
// return true;
// }
return true;
}
/**
* 上传文件超过最大限制调用
*
* @type {file}
* @memberof AppMultipleImageUpload
*/
public oversize(file:any){
Toast("图片过大,上传失败")
}
/**
* 已读后上传
*
* @type {file}
* @memberof AppMultipleImageUpload
*/
public afterRead(file:any){
if(file.length >0){
file.forEach((item:any) =>{
this.upLoaderImg(item.file);
})
}else{
this.upLoaderImg(file.file);
}
}
/**
* 上传图片
*
* @memberof AppMultipleImageUpload
*/
public upLoaderImg (file:any) {
let params = new FormData()
params.append('file', file)
let config = {
headers: { //添加请求头
'Content-Type': 'multipart/form-data'
}
}
axios.post(Environment.BaseUrl+Environment.UploadFile ,params, config).then(res => {
if (res && res.data && res.status === 200) {
this.fileList.push(res.data);
this.emitValue(this.fileList);
Toast('上传成功');
} else {
Toast('上传失败');
}
}).catch(err => {
Toast('上传失败');
});
}
}
</script>
<style lang="less">
.app-multiple-image-upload {
.app-multiple-image-upload-label {
display: flex;
align-items: center;
justify-content: space-between;
.van-icon {
position: relative;
font: 14px/1 "vant-icon";
font-size: inherit;
font-size: 20px;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
margin-top: 10px;
}
}
.app-image-list{
display: flex;
align-items: center;
flex-direction: row;
flex-wrap: wrap;
.app-image-list-item{
position: relative;
.app-image-list-item-image{
max-width:100px;
max-height:80px;
}
.app-file-upload-tag-close{
position: absolute;
top: 0;
right: 0;
}
}
}
}
</style>
\ No newline at end of file
<template>
<div class="app-multiple-select">
<van-checkbox-group v-model="curValue">
<van-checkbox shape="square" :name="item.value" v-for="item in options" :key="item.id">{{ item.text }}</van-checkbox>
</van-checkbox-group>
</div>
</template>
<script lang="ts">
import {
Vue,
Component,
Prop,
Provide,
Emit,
Watch
} from "vue-property-decorator";
@Component({
components: {}
})
export default class AppMultipleSelect extends Vue {
/**
* 下拉数据数组
*
* @type {any[]}
* @memberof AppMultipleSelect
*/
@Prop() public options?:any;
/**
* 当前选中值
*
* @type {string[]}
* @memberof AppMultipleSelect
*/
@Prop() public value?: any;
/**
* 模式的类型
*
* @type {string}
* @memberof AppMultipleSelect
*/
@Prop({ default: "str" }) public orMode?: string;
/**
* 数据存储分隔符
*
* @type {string}
* @memberof AppMultipleSelect
*/
@Prop({ default: "," }) public valueSeparator?: string;
/**
* 数据显示分隔符
*
* @type {string}
* @memberof AppMultipleSelect
*/
@Prop({ default: "," }) public textSeparator?: string;
get curValue() {
if (this.value) {
this.selectedValues = this.value;
if (this.orMode === "num") {
const temp:Array<any> = [];
this.options.forEach((val:any) => {
if ((this.value & val.value) == val.value) {
temp.push(val.value);
}
});
return temp;
} else {
return this.value.split(this.valueSeparator);
}
} else {
return [];
}
}
set curValue(val: any) {
this.getSelectedValues(val);
this.$emit("valuechange", this.selectedValues);
}
/**
* 选中数据值
*
* @private
* @type any
* @memberof AppMultipleSelect
*/
public selectedValues: any;
/**
* 获取选择的实际值和文本值
*
* @param {any[]} arr
* @memberof AppMultipleSelect
*/
public getSelectedValues(arr: any[]) {
let num = 0;
let str = '';
arr.forEach(val => {
const element = this.options.find((item:any) => Object.is(item.value, val));
if (element) {
if (this.orMode === 'num') {
num = num | parseInt(val, 10);
} else {
if (str) {
str += this.valueSeparator;
}
str += element.value;
}
}
});
this.selectedValues = this.orMode === 'num' ? (num !== 0 ? num.toString() : '') : str;
}
}
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<van-panel :title="title">
<van-grid :border="false" :column-num="4">
<van-grid-item
v-for="value in menus"
:key="value.id"
:id="value.id"
@click="menuClick(value.name)">
<van-image v-bind:src="value.img" />
</van-grid-item>
</van-grid>
</van-panel>
</template>
<script lang="ts">
import {
Vue,
Component,
Prop,
Provide,
Emit,
Watch
} from "vue-property-decorator";
@Component({
components: {}
})
export default class AppPicMenu extends Vue {
/**
* 名称
*
* @type {string}
* @memberof AppPicMenu
*/
@Prop() public title?: string;
/**
* 菜单数据
*
* @type {Array<any>}
* @memberof AppPicMenu
*/
@Prop() public menus?: Array<any>;
/**
*存储后的菜单
*
*@memberof AppPicMenu
*/
public groupMenus: Array<any> = [];
/**
* 监听菜单数据
* @memberof AppPicMenu
*/
@Watch("menus", { immediate: true, deep: true })
onMenusChanged(val: any, oldVal: any) {
if (val) {
if (val.length >= 8) {
let tempArray:Array<any> = [];
val.forEach((item: any, index: any) => {
if (index % 8 == 0) {
if (index != 0) {
this.groupMenus.push(tempArray);
}
tempArray = [];
}
tempArray.push(item);
});
if (tempArray.length > 0) {
this.groupMenus.push(tempArray);
}
} else {
this.groupMenus = val;
}
}
}
/**
* 菜单点击事件
*
* @memberof AppPicMenu
*/
public menuClick($event: any) {
this.$emit("menuClick", $event);
}
}
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<van-panel :title="title">
<van-grid :border="false" :column-num="2">
<van-grid-item
v-for="value in menus"
:key="value.id"
:id="value.id"
:icon="value.icon?value.icon:'photo-o'"
@click="menuClick(value.name)"
>
<van-image v-bind:src="value.img" />
<span>{{value.text}}</span>
<span style="color:red;">{{value.price}}</span>
</van-grid-item>
</van-grid>
</van-panel>
</template>
<script lang="ts">
import {
Vue,
Component,
Prop,
Provide,
Emit,
Watch
} from "vue-property-decorator";
@Component({
components: {}
})
export default class AppPicdownMenu extends Vue {
/**
* 名称
*
* @type {string}
* @memberof AppPicdownMenu
*/
@Prop() public title?: string;
/**
* 菜单数据
*
* @type {Array<any>}
* @memberof AppPicdownMenu
*/
@Prop() public menus?: Array<any>;
/**
*存储后的菜单
*@memberof AppPicdownMenu
*/
public groupMenus: Array<any> = [];
/**
* 监听菜单数据
* @memberof AppPicdownMenu
*/
@Watch("menus", { immediate: true, deep: true })
onMenusChanged(val: any, oldVal: any) {
if (val) {
if (val.length >= 8) {
let tempArray:Array<any> = [];
val.forEach((item: any, index: any) => {
if (index % 8 == 0) {
if (index != 0) {
this.groupMenus.push(tempArray);
}
tempArray = [];
}
tempArray.push(item);
});
if (tempArray.length > 0) {
this.groupMenus.push(tempArray);
}
} else {
this.groupMenus = val;
}
}
}
/**
* 菜单点击事件
*
* @memberof AppPicdownMenu
*/
public menuClick($event: any) {
this.$emit("menuClick", $event);
}
}
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<van-field v-model="curValue" clearable right-icon="search" :placeholder="placeholder" @click-right-icon="openModal"/>
</template>
<script lang="ts">
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
@Component({
components: {
}
})
export default class AppPicker extends Vue {
/**
* 输入值
* @type any
* @memberof AppPicker
*/
@Prop() public value?:any;
get curValue(){
return this.value;
}
set curValue(val:any){
if(!val){
this.$emit('valuechange',null);
this.$emit('valueItemchange',null);
}else{
this.$emit('valuechange',val[0].srfmajortext);
this.$emit('valueItemchange',val[0].srfkey);
}
}
/**
* 输入值
* @type boolean
* @memberof AppPicker
*/
@Prop() public disabled?:boolean;
/**
* 值项名称
* @type string
* @memberof AppPicker
*/
@Prop() public valueItem?:string;
/**
* 值项值数据
* @type any
* @memberof AppPicker
*/
@Prop() public valueItemData?:any;
/**
* 空白提示信息
* @type string
* @memberof AppPicker
*/
@Prop() public placeholder?:string;
/**
* 视图名称
* @type string
* @memberof AppPicker
*/
@Prop() public viewname?:string;
/**
* 打开模态
*
* @memberof AppPicker
*/
public openModal(){
let currentValue:any;
if(this.value && this.valueItemData){
currentValue =[{srfkey:this.valueItemData,srfmajortext:this.value}];
}
if(this.viewname){
let modalSubject =this.$modal({componentName:this.viewname,selectedData:currentValue}).show();
modalSubject.subscribe((res:any) =>{
if(res){
this.curValue = res;
}
});
}else{
console.log('选择视图未配置');
}
}
}
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<van-panel :title="title">
<ul>
<li
v-for="value in menus"
:key="value.id"
:id="value.id"
@click="menuClick(value.name)"
>
<div style="display:flex;">
<div class="divnew1">
<van-image v-bind:src="value.img" style="height: 80px;" />
</div>
<div>
<div style="margin-left: 10px;">
<span>{{value.text}}</span>
</div>
<div class="divnew2">
<span class="colorname">{{value.price}}</span>
</div>
</div>
</div>
</li>
</ul>
</van-panel>
</template>
<script lang="ts">
import {
Vue,
Component,
Prop,
Provide,
Emit,
Watch
} from "vue-property-decorator";
@Component({
components: {}
})
export default class AppPicrightMenu extends Vue {
/**
* 名称
*
* @type {string}
* @memberof AppPicrightMenu
*/
@Prop() public title?: string;
/**
* 菜单数据
*
* @type {Array<any>}
* @memberof AppPicrightMenu
*/
@Prop() public menus?: Array<any>;
/**
*存储后的菜单
*@memberof AppPicrightMenu
*/
public groupMenus: Array<any> = [];
/**
* 监听菜单数据
* @memberof AppPicrightMenu
*/
@Watch("menus", { immediate: true, deep: true })
onMenusChanged(val: any, oldVal: any) {
if (val) {
if (val.length >= 8) {
let tempArray:Array<any> = [];
val.forEach((item: any, index: any) => {
if (index % 8 == 0) {
if (index != 0) {
this.groupMenus.push(tempArray);
}
tempArray = [];
}
tempArray.push(item);
});
if (tempArray.length > 0) {
this.groupMenus.push(tempArray);
}
} else {
this.groupMenus = val;
}
}
}
/**
* 菜单点击事件
*
* @memberof AppPicrightMenu
*/
public menuClick($event: any) {
this.$emit("menuClick", $event);
}
}
</script>
<style lang="less">
.divnew1 {
width: 45%;
height: 80px;
}
.divnew2 {
margin-top: 22px;
margin-left: 10px;
}
</style>
\ No newline at end of file
<template>
<van-panel :title="title">
<van-grid :border="false" :column-num="4">
<van-grid-item
v-for="value in menus"
:key="value.id"
:id="value.id"
@click="menuClick(value.name)"
>
<span>{{value.text}}</span>
<van-image v-bind:src="value.img" />
</van-grid-item>
</van-grid>
</van-panel>
</template>
<script lang="ts">
import {
Vue,
Component,
Prop,
Provide,
Emit,
Watch
} from "vue-property-decorator";
@Component({
components: {}
})
export default class AppPictopMenu extends Vue {
/**
* 名称
*
* @type {string}
* @memberof AppPictopMenu
*/
@Prop() public title?: string;
/**
* 菜单数据
*
* @type {Array<any>}
* @memberof AppPictopMenu
*/
@Prop() public menus?: Array<any>;
/**
*存储后的菜单
*@memberof AppPictopMenu
*/
public groupMenus: Array<any> = [];
/**
* 监听菜单数据
* @memberof AppPictopMenu
*/
@Watch("menus", { immediate: true, deep: true })
onMenusChanged(val: any, oldVal: any) {
if (val) {
if (val.length >= 8) {
let tempArray:Array<any> = [];
val.forEach((item: any, index: any) => {
if (index % 8 == 0) {
if (index != 0) {
this.groupMenus.push(tempArray);
}
tempArray = [];
}
tempArray.push(item);
});
if (tempArray.length > 0) {
this.groupMenus.push(tempArray);
}
} else {
this.groupMenus = val;
}
}
}
/**
* 菜单点击事件
*
* @memberof AppPictopMenu
*/
public menuClick($event: any) {
this.$emit("menuClick", $event);
}
}
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<van-index-bar :index-list="marklist" class="point">
<div v-for="item in marklist" :key="item">
<van-index-anchor v-if="marklist" :index="item" />
<div v-for="(i,index) in items" :key="index">
<van-cell v-if="i.group == item" :title="i.srfmajortext" @click="test" />
</div>
</div>
<div v-if="marklist.length==0">没有group属性无法分组</div>
</van-index-bar>
</template>
<script lang="ts">
import {
Vue,
Component,
Prop,
Provide,
Emit,
Watch
} from "vue-property-decorator";
@Component({
components: {}
})
export default class AppPointList extends Vue {
/**
* 传入item
*
* @type {any}
* @memberof AppIconList
*/
@Prop() public items?: Array<any>;
/**
* 数组
*
* @type {Array<any>}
* @memberof AppPointList
*/
@Provide() public marklist: Array<any> = [];
/**
* 将集合中的数据按照mark标识进行分组 将组别塞入marklist中
* @memberof AppPointList
*/
created() {
console.log(this.items);
let nowmark = "";
let isother = false;
if (this.items) {
for (var i = 0; i < this.items.length; i++) {
nowmark = this.items[i].group;
if (this.marklist.indexOf(nowmark) === -1) {
if (nowmark == "null" || nowmark.trim().length === 0) {
this.items[i].group = "#";
isother = true;
} else {
this.marklist.push(nowmark);
}
}
}
}
this.marklist.sort();
if (isother) {
this.marklist.push("#");
}
}
}
</script>
<style>
.van-index-anchor {
background-color: #f9f9f9;
}
.point {
text-align: left;
}
</style>
\ No newline at end of file
<template>
<van-radio-group v-model="curValue" style="width: 100%;display: flex;">
<van-radio v-for="(item,index) in options" v-bind:key="index" :name="item.value" style="padding-right: 8px;">{{item.text}}</van-radio>
</van-radio-group>
</template>
<script lang="ts">
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
@Component({
components: {
}
})
export default class AppRadio extends Vue {
/**
* 代码表列表项
*
* @type {Array<any>}
* @memberof AppRadio
*/
@Prop() public options?:Array<any>;
/**
* 输入值
*
* @type {any}
* @memberof AppRadio
*/
@Prop() public value?: any;
/**
* 获取输入的Value值
*
* @memberof AppRadio
*/
get curValue(){
if(this.value){
if(this.options && this.options.length >0 && typeof this.options[0].value == "number" ){
return parseInt(this.value);
}else{
return this.value;
}
}
};
/**
* 根据curValue变化抛出事件valuechange
*
* @memberof AppRadio
*/
set curValue(val:any){
this.$emit('valuechange',val);
}
/**
* 禁用
*
* @type {boolean}
* @memberof AppRadio
*/
@Prop() public disabled?: boolean;
}
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<div class="list-bigest-box">
<div class="list-list-img">{{item.srfmajortext.substr(0,1)}}</div>
<div class="list-list-text">
<div class="list-list-info">
<p class="list-title" v-if="item.srfmajortext">{{item.srfmajortext}}</p>
<p class="list-info" v-if="item.subtitle && item.content">{{item.subtitle+":"+item.content}}</p>
</div>
<div class="list-time-box">
<p class="list-time" v-if="item.time">{{item.time.substr(11,12).substr(0,5)}}</p>
<div class="list-num" v-if="item.num">{{item.num}}</div>
</div>
</div>
</div>
</template>
<script lang="ts">
import {
Vue,
Component,
Prop,
Provide,
Emit,
Watch
} from "vue-property-decorator";
@Component({
components: {}
})
export default class AppRoundList extends Vue{
/**
* 传入item
* @type {any}
* @memberof AppRoundList
*/
@Prop() public item?:any;
};
</script>
<style>
.list-list-img {
width: 60px;
height: 60px;
border-radius: 50%;
background-color: #26a2ff;
line-height: 60px;
margin: 0 7px 0 0;
color: #ffffff;
}
.list-bigest-box {
display: flex;
margin: 0 0.7em 0 0.7em;
padding: 0.2em 0.2em;
}
.list-list-text {
width: 80%;
display: flex;
border-bottom: solid 0.0625em #cccccc;
justify-content: space-between;
}
.list-list-info {
text-align: left;
padding: 0.3em 0;
}
.list-title {
font-size: 1.2em;
color: #666;
padding: 10px 0px 10px 0px;
margin: 0;
}
.list-info {
color: #939393cc;
font-size: 0.93em;
padding: 0;
margin: 0;
}
.list-time {
color: #cccccc;
font-size: 0.8em;
}
.list-num {
width: 25px;
background-color: #99dcfa;
border-radius: 50px;
color: white;
font-size: 0.8em;
overflow: auto;
}
</style>
\ No newline at end of file
<template>
<div class="app-select">
<van-dropdown-menu>
<van-dropdown-item v-model="curValue" :options="options" :disabled="disabled ? disabled : false"/>
</van-dropdown-menu>
</div>
</template>
<script lang="ts">
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
@Component({
components: {
}
})
export default class AppSelect extends Vue {
/**
* 当前选中值
*
* @type {string}
* @memberof AppSelect
*/
@Prop() public value?: string;
get curValue(){
return this.value;
}
set curValue(val:any){
this.$emit('valuechange',val);
}
/**
* 下拉数据数组
*
* @type {any[]}
* @memberof AppSelect
*/
public options:any[] = [];
/**
* 是否禁用
*
* @type {string}
* @memberof AppSelect
*/
@Prop() public disabled?: string;
/**
* srfkey
*
* @type {string}
* @memberof AppSelect
*/
@Prop() public codetag?: string;
/**
* 初始化方法
*
* @memberof AppListMenu
*/
created() {
if(this.codetag){
this.options = this.$store.getters.getCodeListItems(this.codetag);
}
}
}
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<div class="app-slider-menu">
<van-panel :title="title">
<van-swipe :loop="false" indicator-color="white" :height="168" >
<van-swipe-item v-for="(items,index) in groupMenus" v-bind:key ="index">
<van-grid :column-num="4">
<van-grid-item
v-for="value in items"
:key="value.id"
:id="value.id"
:icon="value.icon?value.icon:'photo-o'"
:text="value.text"
@click="menuClick(value.name)"
/>
</van-grid>
</van-swipe-item>
</van-swipe>
</van-panel>
</div>
</template>
<script lang="ts">
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
@Component({
components: {
}
})
export default class AppSliderMenu extends Vue {
/**
* 名称
*
* @type {string}
* @memberof AppSliderMenu
*/
@Prop() public title?: string;
/**
* 菜单数据
*
* @type {Array<any>}
* @memberof AppSliderMenu
*/
@Prop() public menus?:Array<any>;
/**
*存储后的菜单
*@memberof AppSliderMenu
*/
public groupMenus:Array<any> =[];
/**
* 监听菜单数据
* @memberof AppSliderMenu
*/
@Watch('menus', { immediate: true, deep: true })
onMenusChanged(val: any, oldVal: any) {
if(val){
if(val.length>=8){
let tempArray:any = [];
val.forEach((item:any,index:any) =>{
if(index%8 == 0){
if(index != 0){
this.groupMenus.push(tempArray);
}
tempArray = [];
}
tempArray.push(item);
})
if(tempArray.length >0){
this.groupMenus.push(tempArray);
}
}else{
this.groupMenus = val;
}
}
}
/**
* 菜单点击事件
*
* @memberof AppSliderMenu
*/
public menuClick($event:any){
this.$emit('menuClick',$event);
}
}
</script>
<style lang="less">
.app-slider-menu{
.van-cell__title {
text-align: left;
}
}
</style>
\ No newline at end of file
<template>
<div class="list-status">
<div class="list03 booklist-item-box" >
<div class="list03-box">
<div class="list03-box-line">
<label v-if="item.srfmajortext">
<i class="el-icon-s-promotion lsit-status-icon"></i>
{{item.srfmajortext}}
</label>
<div class="status_s">
状态
</div>
</div>
<div class="list-hr"></div>
<div class="list03-box-line">
<div>
<p class="typeinfo" v-if="item.subtitle">{{item.subtitle}}</p>
<p class="type-p">字段一</p>
</div>
<div>
<p class="typeinfo" v-if="item.content">{{item.content}}</p>
<p class="type-p">字段二</p>
</div>
<div>
<p class="typeinfo" v-if="item.time" >{{item.time.substr(0,10)}}</p>
<p class="type-p">字段三</p>
</div>
</div>
</div>
</div>
</div>
</template>
<script lang="ts">
import {
Vue,
Component,
Prop,
Provide,
Emit,
Watch
} from "vue-property-decorator";
@Component({
components: {}
})
export default class AppStatusList extends Vue{
/**
* 传入item
* @type {any}
* @memberof AppStatusList
*/
@Prop() public item?:any;
};
</script>
<style>
.list-hr {
display: block;
height: 1px;
margin: 0.2em 1.5em;
border-bottom: #cccccc solid 0.0625em;
}
.type-p{
color: rgb(124, 123, 123)
}
.list03-box-line {
display: flex;
justify-content: space-between;
padding: 0.5em 1.5em;
}
.list03 {
margin-bottom: 1em;
}
.typeinfo {
color: #666;
}
.booklist-item-box {
border-radius: 4px;
}
.list-status {
margin: 1.5em 1.6em;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
border-radius: 4px;
}
.lsit-status-icon {
color: #87c2ff;
font-size: 1.6em;
}
.status_s{
color: #26a2ff;
}
.status_f{
color: #ff2626;
}
</style>
\ No newline at end of file
<template>
<van-stepper v-model="curValue" :disabled="disabled"/>
</template>
<script lang="ts">
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
@Component({
components: {
}
})
export default class AppStepper extends Vue {
/**
* 确定的时间
*
* @type {number}
* @memberof AppStepper
*/
@Prop() public value?:number;
/**
* 是否禁用
*
* @type {number}
* @memberof AppStepper
*/
@Prop() public disabled?:boolean;
get curValue(){
return this.value;
}
set curValue(value:any){
this.$emit('valuechange',value);
}
}
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<van-switch
v-model="curValue"
:disabled="disabled"
/>
</template>
<script lang="ts">
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
@Component({
components: {
}
})
export default class Appswitch extends Vue {
/**
* checked选中状态
*
* @type {boolean}
* @memberof Appswitch
*/
@Prop() public value?: any;
get curValue(){
return this.value == 1 ? true:false;
}
set curValue(value:any){
let emitValue = value == true ? '1':'0';
this.$emit('valuechange',emitValue);
}
/**
* 禁用
*
* @type {boolean}
* @memberof Appswitch
*/
@Prop() public disabled?: boolean;
}
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<div class="booklist-item-ulbox">
<ul class="booklist-ul">
<li class="booklist-li" v-if="item.srfmajortext"><div class="text-box">{{item.srfmajortext}}</div></li>
<li class="booklist-li" ><div class="text-box">{{"45.5"}}</div></li>
<li class="booklist-li" v-if="item.subtitle"><div class="text-box">{{item.subtitle}}</div></li>
<li class="booklist-li" v-if="item.content"><div class="text-box">{{item.content}}</div></li>
</ul>
</div>
</template>
<script lang="ts">
import {
Vue,
Component,
Prop,
Provide,
Emit,
Watch
} from "vue-property-decorator";
@Component({
components: {}
})
export default class AppTableList extends Vue{
/**
* 传入item
* @type {any}
* @memberof AppStatusList
*/
@Prop() public item?:any;
};
</script>
<style>
.booklist-ul {
display: flex;
justify-content: space-around;
margin: 0;
}
.booklist-li {
padding: 0.7em 0.3em;
margin: 0;
}
.booklist-ulbox {
border: solid 0.0625em #cccccc;
}
.booklist-item-ul {
display: flex;
justify-content: space-around;
}
.booklist-item-ulbox {
border: solid 0.0625em #cccccc;
border-top: none;
}
.text-box{
width: 4em;
text-align: center;
}
</style>
\ No newline at end of file
<template>
<van-panel :title="title">
<van-grid :column-num="3">
<van-grid-item
v-for="value in menus"
:key="value.id"
:id="value.id"
:icon="value.icon?value.icon:'photo-o'"
:text="value.text"
@click="menuClick(value.text)"
/>
</van-grid>
</van-panel>
</template>
<script lang="ts">
import {
Vue,
Component,
Prop,
Provide,
Emit,
Watch
} from "vue-property-decorator";
@Component({
components: {}
})
export default class AppVanMenu extends Vue {
/**
* 名称
*
* @type {string}
* @memberof AppVanMenu
*/
@Prop() public title?: string;
/**
* 菜单数据
*
* @type {Array<any>}
* @memberof AppVanMenu
*/
@Prop() public menus?: Array<any>;
/**
*存储后的菜单
*@memberof AppVanMenu
*/
public groupMenus: Array<any> = [];
/**
* 监听菜单数据
* @memberof AppVanMenu
*/
@Watch("menus", { immediate: true, deep: true })
onMenusChanged(val: any, oldVal: any) {
if (val) {
if (val.length >= 8) {
let tempArray:Array<any> = [];
val.forEach((item: any, index: any) => {
if (index % 8 == 0) {
if (index != 0) {
this.groupMenus.push(tempArray);
}
tempArray = [];
}
tempArray.push(item);
});
if (tempArray.length > 0) {
this.groupMenus.push(tempArray);
}
} else {
this.groupMenus = val;
}
}
}
/**
* 菜单点击事件
*
* @memberof AppVanMenu
*/
public menuClick($event: any) {
this.$emit("menuClick", $event);
}
}
</script>
<style lang="less">
</style>
\ No newline at end of file
import { Http } from "./api/http/http";
import { Util } from "./utils/util/util";
declare module "vue/types/vue" {
interface Vue {
$http: Http,
$util: Util,
$actionSheet:any,
$modal:any,
$Loading:any,
$prompt:any
}
}
\ No newline at end of file
import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
import './registerServiceWorker';
import '@/styles/default.less';
import '@/styles/user.less';
import Vant from 'vant';
import 'vant/lib/index.css';
import MintUI from 'mint-ui';
import 'mint-ui/lib/style.css';
import NutUI from '@nutui/nutui';
import '@nutui/nutui/dist/nutui.css';
import vueEventCalendar from 'vue-event-calendar';
import 'vue-event-calendar/dist/style.css';
import { Http } from '@/api/http/http';
import { Interceptors } from '@/api/interceptor/interceptor';
import { Util } from '@/utils/util/util';
import ActionSheet from '@/utils/util/ActionSheet';
import Modal from '@/utils/util/Modal';
import Loading from '@/utils/util/Loading';
import Prompt from '@/utils/util/Prompt';
import { AppComponents } from '@/app-register';
import { UserComponents } from '@/user-register';
import { PageComponents } from '@/page-register';
Vue.use(Vant);
Vue.use(MintUI);
Vue.use(NutUI);
Vue.use(vueEventCalendar, {locale: 'zh',color: '#26a2ff'});
Vue.use(AppComponents);
Vue.use(UserComponents);
Vue.use(PageComponents);
Interceptors.getInstance(router);
Vue.prototype.$http = Http.getInstance();
Vue.prototype.$util = Util;
Vue.prototype.$actionSheet = ActionSheet;
Vue.prototype.$modal = Modal;
Vue.prototype.$Loading = Loading;
Vue.prototype.$prompt = Prompt;
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
/* eslint-disable no-console */
import { register } from 'register-service-worker'
if (process.env.NODE_ENV === 'production') {
register(`${process.env.BASE_URL}service-worker.js`, {
ready () {
console.log(
'App is being served from cache by a service worker.\n' +
'For more details, visit https://goo.gl/AFskqB'
)
},
registered () {
console.log('Service worker has been registered.')
},
cached () {
console.log('Content has been cached for offline use.')
},
updatefound () {
console.log('New content is downloading.')
},
updated () {
console.log('New content is available; please refresh.')
},
offline () {
console.log('No internet connection found. App is running in offline mode.')
},
error (error) {
console.error('Error during service worker registration:', error)
}
})
}
declare module '*.vue' {
import Vue from 'vue'
export default Vue
}
declare module 'mint-ui';
declare module 'vue-event-calendar';
declare module 'echarts';
\ No newline at end of file
import Vue from 'vue';
import Vuex from 'vuex';
import { Environment } from '@/environments/environment';
Vue.use(Vuex)
export default new Vuex.Store({
state: {
codelists: [],
appdata: '',
localdata: {},
indexselected:'',
},
getters: {
/**
* 获取代码表对象
*
* @param state
*/
getCodeList:(state: any) => (srfkey: string) => {
return state.codelists.find((_codelist: any) => Object.is(_codelist.srfkey, srfkey));
},
/**
* 获取代码表
*
* @param state
*/
getCodeListItems:(state: any) => (srfkey: string) => {
let items: any[] = [];
const codelist = state.codelists.find((_codelist: any) => Object.is(_codelist.srfkey, srfkey));
if (!codelist) {
console.log(`----${srfkey}----代码表不存在`);
} else {
items = [...codelist.items];
}
return items;
},
/**
* 获取应用数据
*
* @param state
*/
getAppData:(state: any) => () => {
return state.appdata;
},
/**
* 获取本地应用数据
*
* @param state
*/
getLocalData:(state: any) => () => {
return state.localdata;
},
/**
* 获取首页选中数据
*
* @param state
*/
getIndexSelected:(state:any) =>() =>{
return state.indexselected;
}
},
mutations: {
/**
* 添加代码表
*
* @param state
* @param codelists
*/
addCodeLists(state: any, codelists: any) {
state.codelists = [];
state.codelists = [...codelists];
},
/**
* 添加应用数据
*
* @param state
* @param localdata
*/
addAppData(state: any, appdata: string) {
state.appdata = appdata;
},
/**
* 添加本地应用数据
*
* @param state
* @param localdata
*/
addLocalData(state: any, localdata: any = {}) {
state.localdata = {};
Object.assign(state.localdata, localdata);
},
/**
* 添加首页选中数据
*
* @param state
* @param localdata
*/
setIndexSelected(state: any, selecteddata:string){
state.indexselected = selecteddata;
}
},
actions: {
}
})
html,body,#app {
height: 100%;
}
.view-container,.tabexppanel-container{
height: 100%;
display: flex;
flex-direction: column;
.view-content{
flex-grow: 1;
overflow: auto;
}
}
.view-modal-container{
>.view-content{
max-height: calc(100vh - 40px);
overflow-y: auto;
}
}
//门户视图
.app-view-appindexview {
//数据看板视图
.app-dashboard-view{
position: absolute;
bottom: 50px;
top: 0;
left: 0;
right: 0;
//视图内容
>.view-content{
position: absolute;
top: 40px;
bottom: 0;
.app-mob-dashboard{
//门户部件
.app-mob-portlet {
//菜单
.app-menus-container{
//快速菜单栏
.app-quick-menus{
.van-panel__header{
.van-cell__title{
text-align: left;
}
}
}
}
//实体列表
.app-mob-mdctrl{
.app-mob-mdctrl-item{
border-bottom: 1px solid #ebedf0;
}
.van-cell{
.van-cell__title{
color: #323233;
}
}
}
}
}
}
}
//首页嵌入多数据视图
.app-view-mobmdview{
.view-content{
height: calc(100vh - 90px);
display: inherit;
flex-grow: unset;
}
}
}
//多数据视图
.app-view-mobmdview,.work-flow-demo-mob-wfmdview{
.view-content{
height: calc(100vh - 40px);
display: flex;
flex-direction: column;
//部件内容
.view-content-mdctrl{
flex-grow: 1;
overflow: scroll;
.app-mob-mdctrl {
height: 100%;
}
}
}
}
//多数据选择视图,数据选择视图
.app-view-mobmpickupview, .app-view-mobpickupview{
.view-header{
position: inherit;
}
.view-content{
//height: calc(100vh - 40px);
display: flex;
flex-direction: column;
.view-content-ctrl{
flex-grow: 1;
overflow: auto;
}
}
}
//编辑视图
.app-view-mobeditview{
.view-content{
>div{
height: 100%;
.app-form {
//height: calc(100% - 4px);
display: flex;
flex-direction: column;
.app-form-page {
overflow: auto;
flex-grow: 1;
}
}
}
}
}
//登录视图
.app-login-view{
.app-login-view-back{
height: 100%;
width: 100%;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.app-login-view-title{
color: aliceblue;
text-align: left;
padding-left:10%;
margin-top: 100px ;
}
.app-login-view-input{
background-color: aliceblue;
}
.login-content>.van-cell{
width: 80%;
margin: 10% auto;
}
.van-button--large {
width: 80%;
height: 50px;
line-height: 48px;
}
.van-button--primary {
background-color: deepskyblue;
border: 1px solid deepskyblue;
}
.login-sign-in{
background-color: deepskyblue;
}
}
//搜索表单
.app-mob-searchform {
border-bottom: 1px solid #f9f1f1;
padding:15px 15px 7px 15px;
.search-form-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.search-form-content {
.app-form-item {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #f9f1f1;
height: 44px;
font-size: 14px;
color: #383838;
}
}
.app-search-form-footer {
padding-top: 8px;
.app-search-form-footer-buttons {
padding: 0 48px;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.van-hairline--top-bottom::after, .van-hairline-unset--top-bottom::after{
border:0;
}
}
//分页导航视图
.app-view-mobtabexpview{
.view-content{
.nut-tab{
padding: 0px;
border: 0;
.nut-tab-title-leftnav{
.nav-bar-left{
background:white;
display: none
}
.nut-tab-link{
color: #26A2FF
}
}
.nut-tab-item{
border: 0px;
padding: 0px;
height: auto;
}
}
}
}
//日历视图,日历部件视图
.app-view-mobcalendarview,.app-view-mobcalendarctrlview{
height: 100vh;
.view-content{
height:calc(100% - 40px);
overflow: auto;
.app-mob-calendar {
}
}
.wh_content_all[data-v-2ebcbc83]{
background-color: #ffffff;
}
.wh_content_item[data-v-2ebcbc83], wh_content_item_tag[data-v-2ebcbc83]{
color: #323233;
}
.wh_top_changge li[data-v-2ebcbc83]{
color: #323233;
}
.wh_jiantou2[data-v-2ebcbc83]{
border-top: 2px solid #323233;
border-right: 2px solid #323233;
}
.wh_jiantou1[data-v-2ebcbc83]{
border-top: 2px solid #323233;
border-left: 2px solid #323233;
}
.wh_content_item>.wh_isMark[data-v-2ebcbc83]{
border-radius: 10px;
background: #8f8fef;
}
.wh_content_item .wh_chose_day[data-v-2ebcbc83]{
background: #26a2ff;
color: #323233;
border-radius: 100px;
}
.wh_content_item .wh_isToday{
color: #1cb3c3;
}
ul li .van-cell{
border-bottom: 1px solid #ebedf0;
}
ul li .van-cell .van-cell__title{
text-align: left;
color: #2d2d2d;
}
}
//向导部件
.app-mob-wizardpanel {
.app-demobwizardview{
height: calc(100vh - 44px);
>div:first-child{
height: calc(100% - 180px);
}
.van-checkbox{
padding:10px;
}
.actionBtns{
display: flex;
justify-content: space-evenly;
}
}
}
//工作流编辑视图
.app-view-mobwfeditview{
.view-content{
>div:first-child{
height: calc(100% - 160px);
}
.wflinksBtns{
position: absolute;
width: 100%;
display: flex;
justify-content: space-evenly;
bottom: 100px;
}
}
}
//多数据部件
.app-mob-mdctrl {
.mint-loadmore {
.app-mob-mdctrl-item {
.van-cell:not(:last-child)::after {
border-bottom: none;
}
.van-cell-group{
padding:15px;
.van-panel__header{
padding:0;
border-bottom:none;
text-align: left;
.van-cell__title{
font-size :16px;
color:#000;
}
}
.van-panel__content{
>.van-panel__header{
line-height: 22px;
.van-cell__title,.van-cell__label{
color: #565656;
font-size: 14px;
font-weight:normal;
>span{
color : gray;
}
>.van-cell__label{
color:#565656;
}
}
>.time{
display: flex;
align-items: center;
>.van-cell__label{
color:#fff;
background: #26A2FF;
padding: 5px;
border-radius: 6px;
}
}
}
}
}
.van-swipe-cell {
.van-button {
height: 54px;
}
}
}
}
}
//数据选择部件
.app-view-mobmpickupviewmd{
.view-content{
.app-mob-mdctrl-mdctrl{
height: 100%;
.app-mob-mdctrl-item{
.van-cell__title{
text-align: center;
color:#000;
}
.van-radio{
width:100%;
.van-radio__label{
flex-grow: 1;
}
}
}
}
}
}
//多数据选择部件
.app-view-mobmpickupviewmd{
.view-content{
.app-mob-mdctrl-mdctrl{
height: 100%;
.app-mob-mdctrl-item{
.van-checkbox{
width:100%;
.van-checkbox__label{
flex-grow: 1;
}
}
}
}
}
}
//编辑表单部件
.app-form {
padding-top:4px;
overflow: auto;
background: #f8f8f8;
.van-tabs{
.van-tab{
.van-ellipsis{
color: #929292;
font-weight: bold;
}
}
.van-tab--active{
.van-ellipsis{
color: #fff;
}
}
}
.van-collapse-item{
.van-collapse-item__title{
padding:15px;
border-bottom: 1px solid #ebedf0;
//分组标题
.van-cell__title {
text-align: left;
color:unset;
font-size: 16px;
color: #929292;
font-weight: bold;
}
}
.van-collapse-item__content {
background: #f8f8f8;
padding: 0 0 16px 0;
}
}
//表单项
.app-form-item {
padding: 0 8px;
display: flex;
background: #fff;
color: #969799;
font-size: 13px;
min-height: 38px;
//width: 100%;
align-items: center;
justify-content:center ;
border-bottom: 1px solid #f8f8f8;
.app-form-item-label{
text-align: left;
font-size: 14px;
color: #929292;
font-weight: bold;
}
.app-form-item-editor {
font-size: 14px;
text-align: right;
>div>.van-row{
.van-col{
font-size: 14px;
color: #929292;
font-weight: bold;
}
}
.app-form-item-input,.app-form-item-textarea{
.van-field{
.van-field__body{
.van-field__control{
text-align: right;
color: #383838;
}
}
}
}
//下拉框单选
.app-select{
.van-dropdown-menu{
.van-dropdown-menu__title{
position: absolute;
right:15px;
}
.van-dropdown-item{
.van-dropdown-item__content{
.van-dropdown-item__option{
// text-align: center;
.van-cell__title{
color:#000;
}
}
}
}
}
}
//下拉框多选
.app-multiple-select{
.van-checkbox-group{
display: flex;
flex-wrap: wrap;
padding-top:10px;
.van-checkbox{
width: 28%;
margin-right: 14px;
margin-bottom:10px;
}
}
}
//时间选择器
.app-datetime-picker{
.van-field__control{
text-align: right;
}
}
//文件上传多选
.app-multiple-file-upload{
.app-multiple-list{
text-align: center;
}
}
//图片上传多选
.app-multiple-image-upload{
.app-image-list{
.app-image-list-item{
margin-right:8px;
}
}
}
//密码框
.app-form-item-password{
.van-field__control{
text-align: right;;
}
}
//文本框
>.app-form-item-input{
>.van-field{
padding:0 8px;
}
}
//数据选择
.app-form-item-picker{
.van-field__control{
text-align: right;;
}
}
//开关
.app-form-item-switch {
margin-top:5px;
}
}
}
.van-tabs__wrap {
.van-tabs__nav--card {
margin: 0 4px;
}
}
.van-hairline--top-bottom::after,
.van-hairline-unset--top-bottom::after {
border-width: 0;
}
}
//树导航部件
.app-mob-treeexpbar {
height: 100%;
.treeexpbar-container{
display: flex;
height: 100%;
.treeexpbar-container-content{
flex-grow: 1;
overflow: auto;
}
}
}
//部件视图
.app-ctrl-view-header{
height: 28px;
line-height: 28px;
text-align: right;
padding: 0 12px;
font-size: 28px;
font-weight: bold;
>i{
cursor:pointer;
}
}
//多表单视图面板样式
.app-mob-meditviewpanel{
.app-medit-view-panel{
.app-medit-view-panel-card{
padding-top:12px;
padding-left: 18px;
padding-right: 18px;
background: #f8f8f8;
}
}
}
\ No newline at end of file
export const UserComponents = {
install(v: any, opt: any) {
}
};
\ No newline at end of file
import { Http } from '@/api/http/http';
import { Environment } from '@/environments/environment';
/**
* AuthGuard net 对象
* 调用 getInstance() 获取实例
*
* @class Http
*/
export class AuthGuard {
/**
* 获取 Auth 单例对象
*
* @static
* @returns {Auth}
* @memberof Auth
*/
public static getInstance(): AuthGuard {
if (!AuthGuard.auth) {
AuthGuard.auth = new AuthGuard();
}
return this.auth;
}
/**
* 单例变量声明
*
* @private
* @static
* @type {AuthGuard}
* @memberof AuthGuard
*/
private static auth: AuthGuard;
/**
* Creates an instance of AuthGuard.
* 私有构造,拒绝通过 new 创建对象
*
* @memberof AuthGuard
*/
private constructor() { }
/**
* post请求
*
* @param {string} url url 请求路径
* @param {*} [params={}] 请求参数
* @returns {Promise<any>} 请求相响应对象
* @memberof AuthGuard
*/
public authGuard(url: string, params: any = {}, router: any): Promise<boolean> {
return new Promise((resolve: any, reject: any) => {
const get: Promise<any> = Http.getInstance().get(url, params,false);
get.then((response: any) => {
if (response && response.status === 200) {
if (response.data && response.data.remotetag) {
router.app.$store.commit('addAppData', response.data.remotetag);
}
if (response.data && response.data.localdata) {
router.app.$store.commit('addLocalData', response.data.localdata);
}
}
this.getAllCodeList(resolve, reject, router);
setInterval(() => {
this.heartbeat(url, params);
}, 60000);
}).catch((error: any) => {
this.redirectErrorInfo(error);
});
});
}
/**
* 跳转错误页
*
* @private
* @param {*} res
* @memberof AuthGuard
*/
private redirectErrorInfo(res: any): void {
if (res && res.status === 401) {
return;
}
let info: string = '发生未知错误,请联系管理员处理!';
if (res) {
const data: any = res.data;
if (data) {
info = data.detail || data.message;
} else {
info = res.status;
}
}
const win: any = window;
if (win.studioOnload) {
win.studioOnload();
}
window.location.href = './error/error.html?info=' + encodeURIComponent(info);
}
/**
* 每分钟更新一次AppData
*
* @private
* @param {string} url
* @param {*} [params={}]
* @param {*} router
* @returns {Promise<void>}
* @memberof AuthGuard
*/
private async heartbeat(url: string, params: any = {}): Promise<void> {
await Http.getInstance().get(url, params,false);
}
/**
* 获取所有代码表
*
* @private
* @param {*} resolve
* @param {*} reject
* @param {*} router
* @memberof AuthGuard
*/
private getAllCodeList(resolve: any, reject: any, router: any): void {
const url = `${Environment.AppName.toLocaleLowerCase()}/app/codelist/getall`;
const get: Promise<any> = Http.getInstance().get(url, {},false);
get.then((response: any) => {
if (response && response.status === 200 && response.data && Array.isArray(response.data)) {
const datas: any[] = [...response.data];
datas.forEach((item: any) => {
if (!item.items) {
item.items = [];
}
});
router.app.$store.commit('addCodeLists', datas);
}
resolve(true);
}).catch((error: any) => {
reject(true);
});
}
}
import Vue from "vue";
import AppActionSheet from "@/components/app-action-sheet/app-action-sheet.vue";
const ActionSheet=(props:any) => {
let component = AppActionSheet;
const vm = new Vue({
render(h) {
return h(component, { props });
}
}).$mount();
document.body.appendChild(vm.$el);
// 给组件实例添加销毁方法
const comp:any = vm.$children[0];
return comp;
}
export default ActionSheet;
\ No newline at end of file
import Vue from "vue";
import AppLoading from "@/components/app-loading/app-loading.vue";
const Loading=() => {
let component = AppLoading;
const vm = new Vue({
render(h) {
return h(component);
}
}).$mount();
document.body.appendChild(vm.$el);
const comp:any = vm.$children[0];
return comp;
}
export default Loading;
\ No newline at end of file
import Vue from "vue";
import router from '@/router';
import store from '@/store';
import AppModal from "@/components/app-modal/app-modal.vue";
const Modal=(props:any) => {
let component = AppModal;
const vm = new Vue({
router,
store,
render(h) {
return h(component, { props });
}
}).$mount();
document.body.appendChild(vm.$el);
const comp:any = vm.$children[0];
return comp;
}
export default Modal;
\ No newline at end of file
import Vue from "vue";
import AppPrompt from "@/components/app-message-box/app-message-box.vue";
const Prompt=() => {
let component = AppPrompt;
const vm = new Vue({
render(h) {
return h(component);
}
}).$mount();
document.body.appendChild(vm.$el);
const comp:any = vm.$children[0];
return comp;
}
export default Prompt;
\ No newline at end of file
/**
* 平台工具类
*
* @export
* @class Util
*/
export class Util {
/**
* 错误提示信息
*
* @static
* @type {string}
* @memberof Util
*/
public static errorInfo: string = '';
/**
* 创建 UUID
*
* @static
* @returns {string}
* @memberof Util
*/
public static createUUID(): string {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
}
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
}
/**
* 创建序列号
*
* @static
* @returns {number}
* @memberof Util
*/
public static createSerialNumber(): number {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000);
}
return s4();
}
/**
* 判断是否为一个函数
*
* @static
* @param {*} func
* @returns {boolean}
* @memberof Util
*/
public static isFunction(func: any): boolean {
return typeof (func) === 'function';
}
/**
* 判断条件是否成立
*
* @static
* @param {*} value
* @param {*} op
* @param {*} value2
* @returns {boolean}
* @memberof Util
*/
public static testCond(value: any, op: any, value2: any): boolean {
// 等于操作
if (Object.is(op, 'EQ')) {
const _value = `${value}`;
return _value === value2;
}
// 大于操作
if (Object.is(op, 'GT')) {
const result: number = this.compare(value, value2);
if (result !== undefined && result > 0) {
return true;
} else {
return false;
}
}
// 大于等于操作
if (Object.is(op, 'GTANDEQ')) {
const result: number = this.compare(value, value2);
if (result !== undefined && result >= 0) {
return true;
} else {
return false;
}
}
// 值包含在给定的范围中
if (Object.is(op, 'IN')) {
return this.contains(value, value2);
}
// 不为空判断操作
if (Object.is(op, 'ISNOTNULL')) {
return (value != null && value !== '');
}
// 为空判断操作
if (Object.is(op, 'ISNULL')) {
return (value == null || value === '');
}
// 文本左包含
if (Object.is(op, 'LEFTLIKE')) {
return (value && value2 && (value.toUpperCase().indexOf(value2.toUpperCase()) === 0));
}
// 文本包含
if (Object.is(op, 'LIKE')) {
return (value && value2 && (value.toUpperCase().indexOf(value2.toUpperCase()) !== -1));
}
// 小于操作
if (Object.is(op, 'LT')) {
const result: number = this.compare(value, value2);
if (result !== undefined && result < 0) {
return true;
} else {
return false;
}
}
// 小于等于操作
if (Object.is(op, 'LTANDEQ')) {
const result: number = this.compare(value, value2);
if (result !== undefined && result <= 0) {
return true;
} else {
return false;
}
}
// 不等于操作
if (Object.is(op, 'NOTEQ')) {
const _value = `${value}`;
return _value !== value2;
}
// 值不包含在给定的范围中
if (Object.is(op, 'NOTIN')) {
return !this.contains(value, value2);
}
// 文本右包含
if (Object.is(op, 'RIGHTLIKE')) {
if (!(value && value2)) {
return false;
}
const nPos = value.toUpperCase().indexOf(value2.toUpperCase());
if (nPos === -1) {
return false;
}
return nPos + value2.length === value.length;
}
// 空判断
if (Object.is(op, 'TESTNULL')) {
}
// 自定义包含
if (Object.is(op, 'USERLIKE')) {
}
return false;
}
/**
* 文本包含
*
* @static
* @param {any} value
* @param {any} value2
* @returns {boolean}
* @memberof Util
*/
public static contains(value: any, value2: any): boolean {
if (value && value2) {
// 定义一数组
let arr = new Array();
arr = value2.split(',');
// 定义正则表达式的连接符
const S = String.fromCharCode(2);
const reg = new RegExp(S + value + S);
return (reg.test(S + arr.join(S) + S));
}
return false;
}
/**
* 值比较
*
* @static
* @param {*} value
* @param {*} value2
* @returns {number}
* @memberof Util
*/
public static compare(value: any, value2: any): number {
let result: any;
if (!Object.is(value, '') && !Object.is(value2, '') && !isNaN(value) && !isNaN(value2)) {
result = this.compareNumber(parseFloat(value), parseFloat(value2));
} else if (this.isParseDate(value) && this.isParseDate(value2)) {
result = this.compareDate((new Date(value)).getTime(), (new Date(value2)).getTime());
} else if (value && (typeof (value) === 'boolean' || value instanceof Boolean)) {
result = this.compareBoolean(value, value2);
} else if (value && (typeof (value) === 'string' || value instanceof String)) {
result = this.compareString(value, value2);
}
return result;
}
/**
* 是否是时间
*
* @static
* @param {string} value
* @returns {boolean}
* @memberof Util
*/
public static isParseDate(value: string): boolean {
const time = new Date(value);
if (isNaN(time.getTime())) {
return false;
}
return true;
}
/**
* 时间值比较(毫秒数)
*
* @static
* @param {number} value
* @param {number} value2
* @returns {number}
* @memberof Util
*/
public static compareDate(value: number, value2: number): number {
if (value > value2) {
return 1;
} else if (value < value2) {
return -1;
} else {
return 0;
}
}
/**
* 数值比较
*
* @static
* @param {number} value
* @param {number} value2
* @returns {number}
* @memberof Util
*/
public static compareNumber(value: number, value2: number): number {
if (value > value2) {
return 1;
} else if (value < value2) {
return -1;
} else {
return 0;
}
}
/**
* 字符串比较
*
* @static
* @param {*} value
* @param {*} value2
* @returns {number}
* @memberof Util
*/
public static compareString(value: any, value2: any): number {
return value.localeCompare(value2);
}
/**
* boolean 值比较
*
* @static
* @param {*} value
* @param {*} value2
* @returns {number}
* @memberof Util
*/
public static compareBoolean(value: any, value2: any): number {
if (value === value2) {
return 0;
} else {
return -1;
}
}
/**
*
*
* @static
* @param {*} [o={}]
* @memberof Util
*/
public static processResult(o: any = {}): void {
if (o.url != null && o.url !== '') {
window.location.href = o.url;
}
if (o.code != null && o.code !== '') {
// tslint:disable-next-line:no-eval
eval(o.code);
}
if (o.downloadurl != null && o.downloadurl !== '') {
const downloadurl = this.parseURL2(o.downloadurl, '');
this.download(downloadurl);
}
}
/**
* 下载文件
*
* @static
* @param {string} url
* @memberof Util
*/
public static download(url: string): void {
window.open(url, '_blank');
}
/**
*
*
* @static
* @param {any} url
* @param {any} params
* @returns {string}
* @memberof Util
*/
public static parseURL2(url: string, params: any): string {
let tmpURL;
if (url.indexOf('../../') !== -1) {
tmpURL = url.substring(url.indexOf('../../') + 6, url.length);
} else if (url.indexOf('/') === 0) {
tmpURL = url.substring(url.indexOf('/') + 1, url.length);
} else {
tmpURL = url;
}
if (params) {
return tmpURL + (url.indexOf('?') === -1 ? '?' : '&');
} else {
return tmpURL;
}
}
/**
* 是否是数字
*
* @param {*} num
* @returns {boolean}
* @memberof Util
*/
public static isNumberNaN(num: any): boolean {
return Number.isNaN(num) || num !== num;
}
/**
* 是否未定义
*
* @static
* @param {*} value
* @returns {boolean}
* @memberof Util
*/
public static isUndefined(value: any): boolean {
return typeof value === 'undefined';
}
/**
* 是否为空
*
* @static
* @param {*} value
* @returns {boolean}
* @memberof Util
*/
public static isEmpty(value: any): boolean {
return this.isUndefined(value) || Object.is(value, '') || value === null || value !== value;
}
/**
* 检查属性常规条件
*
* @static
* @param {*} value 属性值
* @param {string} op 检测条件
* @param {*} value2 预定义值
* @param {string} errorInfo 错误信息
* @param {string} paramType 参数类型
* @param {*} form 表单对象
* @param {boolean} primaryModel 是否必须条件
* @returns {boolean}
* @memberof Util
*/
public static checkFieldSimpleRule(value: any, op: string, value2: any, errorInfo: string, paramType: string, form: any, primaryModel: boolean): boolean {
if (Object.is(paramType, 'CURTIME')) {
value2 = `${new Date()}`;
}
if (Object.is(paramType, 'ENTITYFIELD')) {
value2 = value2 ? value2.toLowerCase() : '';
const _value2Field = form.findFormItem(value2);
if (!_value2Field) {
this.errorInfo = `表单项${value2}未配置`;
return true;
}
value2 = _value2Field.getValue();
}
if (this.isEmpty(errorInfo)) {
errorInfo = '内容必须符合值规则';
}
this.errorInfo = errorInfo;
const result = this.testCond(value, op, value2);
if (!result) {
if (primaryModel) {
throw new Error(this.errorInfo);
}
}
return !result;
}
/**
* 检查属性字符长度规则
*
* @static
* @param {*} viewValue
* @param {number} minLength
* @param {boolean} indexOfMin
* @param {number} maxLength
* @param {boolean} indexOfMax
* @param {string} errorInfo
* @param {boolean} primaryModel
* @returns {boolean}
* @memberof Util
*/
public static checkFieldStringLengthRule(viewValue: string, minLength: number, indexOfMin: boolean, maxLength: number, indexOfMax: boolean, errorInfo: string, primaryModel: boolean): boolean {
if (this.isEmpty(errorInfo)) {
this.errorInfo = '内容长度必须符合范围规则';
} else {
this.errorInfo = errorInfo;
}
const isEmpty = Util.isEmpty(viewValue);
if (isEmpty) {
if (primaryModel) {
throw new Error('值为空');
}
this.errorInfo = '值为空';
return true;
}
const viewValueLength: number = viewValue.length;
// 小于等于
if (minLength !== null) {
if (indexOfMin) {
if (viewValueLength < minLength) {
if (primaryModel) {
throw new Error(this.errorInfo);
}
return true;
}
} else {
if (viewValueLength <= minLength) {
if (primaryModel) {
throw new Error(this.errorInfo);
}
return true;
}
}
}
// 大于等于
if (maxLength !== null) {
if (indexOfMax) {
if (viewValueLength > maxLength) {
if (primaryModel) {
throw new Error(this.errorInfo);
}
return true;
}
} else {
if (viewValueLength >= maxLength) {
if (primaryModel) {
throw new Error(this.errorInfo);
}
return true;
}
}
}
this.errorInfo = '';
return false;
}
/**
* 检查属性值正则式规则
*
* @static
* @param {string} viewValue 属性值
* @param {*} strReg 验证正则
* @param {string} errorInfo 错误信息
* @param {boolean} primaryModel 是否关键条件
* @returns {boolean}
* @memberof Util
*/
public static checkFieldRegExRule(viewValue: string, strReg: any, errorInfo: string, primaryModel: boolean): boolean {
if (this.isEmpty(errorInfo)) {
this.errorInfo = '值必须符合正则规则';
} else {
this.errorInfo = errorInfo;
}
const isEmpty = Util.isEmpty(viewValue);
if (isEmpty) {
if (primaryModel) {
throw new Error('值为空');
}
this.errorInfo = '值为空';
return true;
}
const regExp = new RegExp(strReg);
if (!regExp.test(viewValue)) {
if (primaryModel) {
throw new Error(this.errorInfo);
}
return true;
}
this.errorInfo = '';
return false;
}
/**
* 检查属性值范围规则
*
* @static
* @param {string} viewValue 属性值
* @param {*} minNumber 最小数值
* @param {boolean} indexOfMin 是否包含最小数值
* @param {*} maxNumber 最大数值
* @param {boolean} indexOfMax 是否包含最大数值
* @param {string} errorInfo 错误信息
* @param {boolean} primaryModel 是否关键条件
* @returns {boolean}
* @memberof Util
*/
public static checkFieldValueRangeRule(viewValue: string, minNumber: any, indexOfMin: boolean, maxNumber: any, indexOfMax: boolean, errorInfo: string, primaryModel: boolean): boolean {
if (this.isEmpty(errorInfo)) {
this.errorInfo = '值必须符合值范围规则';
} else {
this.errorInfo = errorInfo;
}
const isEmpty = Util.isEmpty(viewValue);
if (isEmpty) {
if (primaryModel) {
throw new Error('值为空');
}
this.errorInfo = '值为空';
return true;
}
const valueFormat = this.checkFieldRegExRule(viewValue, /^-?\d*\.?\d+$/, '', primaryModel);
if (valueFormat) {
return true;
} else {
this.errorInfo = errorInfo;
}
const data = Number.parseFloat(viewValue);
// 小于等于
if (minNumber !== null) {
if (indexOfMin) {
if (data < minNumber) {
if (primaryModel) {
throw new Error(this.errorInfo);
}
return true;
}
} else {
if (data <= minNumber) {
if (primaryModel) {
throw new Error(this.errorInfo);
}
return true;
}
}
}
// //大于等于
if (maxNumber != null) {
if (indexOfMax) {
if (data > maxNumber) {
if (primaryModel) {
throw new Error(this.errorInfo);
}
return true;
}
} else {
if (data >= maxNumber) {
if (primaryModel) {
throw new Error(this.errorInfo);
}
return true;
}
}
}
this.errorInfo = '';
return false;
}
/**
* 检查属性值系统值范围规则 暂时支持正则表达式
*
* @static
* @param {string} viewValue 属性值
* @param {*} strReg 正则
* @param {string} errorInfo 错误信息
* @param {boolean} primaryModel 是否关键条件
* @returns {boolean}
* @memberof Util
*/
public static checkFieldSysValueRule(viewValue: string, strReg: any, errorInfo: string, primaryModel: boolean): boolean {
return this.checkFieldRegExRule(viewValue, strReg, errorInfo, primaryModel);
}
/**
* 将文本格式的xml转换为dom模式
*
* @static
* @param {string} strXml
* @memberof Util
*/
public static parseXML(strXml: string): Document | undefined {
if (strXml) {
return new DOMParser().parseFromString(strXml, 'text/xml');
}
return undefined;
}
/**
* 将xml转换为object对象
*
* @static
* @param {*} node
* @param {*} [obj={}]
* @memberof Util
*/
public static loadXMLNode(node: any, obj: any = {}): void {
if (node && node.attributes) {
const arr: any = node.attributes;
for (let i = 0; i < arr.length; i++) {
let A = arr.item(i).name;
const B = arr.item(i).value;
A = A.toLowerCase();
obj[A] = B;
}
}
}
/**
* 将object转换为xml对象
*
* @static
* @param {any} XML
* @param {any} obj
* @memberof Util
*/
public static saveXMLNode(XML: any, obj: any) {
const keys: string[] = Object.keys(obj);
keys.forEach((key: string) => {
const value = obj[key];
if (!value || value instanceof Object || typeof (value) === 'function') {
return;
}
const proValue = value.toString();
if (proValue !== '') {
XML.attrib(key, proValue);
}
});
}
/**
* 格式化矩阵参数
*
* @static
* @param {string} param
* @returns {any}
* @memberof Util
*/
public static formatMatrixParse(param: string): any {
const data: any = {};
const params_arr: string[] = param.split(';');
params_arr.forEach((_data: string, index: number) => {
if ((index === params_arr.length - 1) && _data.indexOf('?') !== -1) {
_data = _data.substr(0, _data.indexOf('?'));
}
const _data_arr: string[] = [..._data.split('=')];
data[_data_arr[0]] = _data_arr[1];
});
return data;
}
/**
* 处理url参数
*
* @static
* @param {string} param
* @returns {*}
* @memberof Util
*/
public static formatMatrixParse2(param: string): any {
const viewdata: any = { srfparentdata: {} };
const params_arr: string[] = param.split(';');
params_arr.forEach((_data: string, index: number) => {
if ((index === params_arr.length - 1) && _data.indexOf('?') !== -1) {
_data = _data.substr(0, _data.indexOf('?'));
}
const _data_arr: string[] = [..._data.split('=')];
if (Object.is(_data_arr[0], 'srfkey')) {
Object.assign(viewdata, { [_data_arr[0]]: _data_arr[1] });
} else {
Object.assign(viewdata.srfparentdata, { [_data_arr[0]]: _data_arr[1] });
}
});
return viewdata;
}
/**
* 转换为矩阵参数
*
* @static
* @param {*} obj
* @returns {*}
* @memberof Util
*/
public static formatMatrixStringify(obj: any): any {
let str: string = '';
if (obj && !(obj instanceof Array) && (obj instanceof Object)) {
const keys: string[] = Object.keys(obj);
keys.forEach((key: string) => {
if (!obj[key]) {
return;
}
if (!Object.is(str, '')) {
str += ';';
}
str += `${key}=${obj[key]}`;
});
}
return Object.is(str, '') ? undefined : str;
}
/**
* 格式化Url参数
*
* @static
* @param {*} [params={}]
* @returns {string}
* @memberof Util
*/
public static urlEncode(params: any = {}): string {
let str: string = '';
for (const key in params) {
if (params.hasOwnProperty(key)) {
const val = params[key];
str += `${key}=${encodeURIComponent(val)}&`;
}
}
return str;
}
/**
* 清除用户信息缓存
*
* @static
* @memberof Util
*/
public static clearUserInfo(): void {
window.localStorage.removeItem('user');
window.localStorage.removeItem('token');
}
/**
* 检查返回数据
*
* @param {*} res
* @returns {boolean}
* @memberof Util
*/
public static checkRes(res: any): boolean {
return (res && res.ret === 0) ? true : false;
}
/**
* 准备路由参数
*
* @static
* @param {*} { route: route, sourceNode: sourceNode, targetNode: targetNode, data: data }
* @returns {*}
* @memberof Util
*/
public static prepareRouteParmas({ route: route, sourceNode: sourceNode, targetNode: targetNode, data: data }: any): any {
const params: any = {};
if (!sourceNode || (sourceNode && Object.is(sourceNode, ''))) {
return params;
}
if (!targetNode || (targetNode && Object.is(targetNode, ''))) {
return params;
}
// route.matched.some((_matched: any, index: number, arr: any[]) => {
// // 当前视图
// if (Object.is(sourceNode, _matched.name && arr.length > 1)) {
// Object.assign(params, { [targetNode]: this.formatMatrixStringify(data) });
// return true;
// }
// // 父视图
// Object.assign(params, { [_matched.name]: route.params[_matched.name] });
// return false;
// });
const indexName = route.matched[0].name;
Object.assign(params, { [indexName]: route.params[indexName] });
Object.assign(params, { [targetNode]: this.formatMatrixStringify(data) });
return params;
}
/**
* 获取当前值类型
*
* @static
* @param {*} obj
* @returns
* @memberof Util
*/
public static typeOf(obj: any):string {
const toString = Object.prototype.toString;
const map: any = {
'[object Boolean]': 'boolean',
'[object Number]': 'number',
'[object String]': 'string',
'[object Function]': 'function',
'[object Array]': 'array',
'[object Date]': 'date',
'[object RegExp]': 'regExp',
'[object Undefined]': 'undefined',
'[object Null]': 'null',
'[object Object]': 'object'
};
return map[toString.call(obj)];
}
/**
* 深拷贝(deepCopy)
*
* @static
* @param {*} data
* @returns {*}
* @memberof Util
*/
public static deepCopy(data: any): any {
const t = this.typeOf(data);
let o: any;
if (t === 'array') {
o = [];
} else if (t === 'object') {
o = {};
} else {
return data;
}
if (t === 'array') {
for (let i = 0; i < data.length; i++) {
o.push(this.deepCopy(data[i]));
}
} else if (t === 'object') {
for (let i in data) {
o[i] = this.deepCopy(data[i]);
}
}
return o;
}
/**
* 名称格式化
*
* @static
* @param {string} name
* @returns {string}
* @memberof Util
*/
public static srfFilePath2(name: string): string {
if (!name || (name && Object.is(name, ''))) {
throw new Error('名称异常');
}
name = name.replace(/[_]/g, '-');
let state: number = 0;
let _str = '';
const uPattern = /^[A-Z]{1}$/;
const str1 = name.substring(0, 1);
const str2 = name.substring(1)
state = uPattern.test(str1) ? 1 : 0;
_str = `${_str}${str1.toLowerCase()}`;
for (let chr of str2) {
if (uPattern.test(chr)) {
if (state === 1) {
_str = `${_str}${chr.toLowerCase()}`;
} else {
_str = `${_str}-${chr.toLowerCase()}`;
}
state = 1
} else {
_str = `${_str}${chr.toLowerCase()}`;
state = 0
}
}
_str = _str.replace(/---/g, '-').replace(/--/g, '-');
return _str;
}
}
\ No newline at end of file
module.exports = {
plugins: [
'cypress'
],
env: {
mocha: true,
'cypress/globals': true
},
rules: {
strict: 'off'
}
}
// https://docs.cypress.io/guides/guides/plugins-guide.html
// if you need a custom webpack configuration you can uncomment the following import
// and then use the `file:preprocessor` event
// as explained in the cypress docs
// https://docs.cypress.io/api/plugins/preprocessors-api.html#Examples
/* eslint-disable import/no-extraneous-dependencies, global-require, arrow-body-style */
// const webpack = require('@cypress/webpack-preprocessor')
module.exports = (on, config) => {
// on('file:preprocessor', webpack({
// webpackOptions: require('@vue/cli-service/webpack.config'),
// watchOptions: {}
// }))
return Object.assign({}, config, {
fixturesFolder: 'tests/e2e/fixtures',
integrationFolder: 'tests/e2e/specs',
screenshotsFolder: 'tests/e2e/screenshots',
videosFolder: 'tests/e2e/videos',
supportFile: 'tests/e2e/support/index.js'
})
}
// https://docs.cypress.io/api/introduction/api.html
describe('My First Test', () => {
it('Visits the app root url', () => {
cy.visit('/')
cy.contains('h1', 'Welcome to Your Vue.js + TypeScript App')
})
})
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add("login", (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This is will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import './commands'
// Alternatively you can use CommonJS syntax:
// require('./commands')
module.exports = {
env: {
jest: true
}
}
\ No newline at end of file
import { shallowMount } from '@vue/test-utils'
import HelloWorld from '@/components/HelloWorld.vue'
describe('HelloWorld.vue', () => {
it('renders props.msg when passed', () => {
const msg = 'new message'
const wrapper = shallowMount(HelloWorld, {
propsData: { msg }
})
expect(wrapper.text()).toMatch(msg)
})
})
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"types": [
"webpack-env",
"jest"
],
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx"
],
"exclude": [
"node_modules"
]
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册