提交 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
此差异已折叠。
<!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 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 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 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="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
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册