Compare commits

..

10 Commits

Author SHA1 Message Date
46b01b4504 feat: 完善批量修改填写人、审核页面优化、人员管理等功能
- 批量修改填写人:添加左侧分类列表、折叠功能、暂存和重新分配
- 审核页面:添加折叠和分页功能
- 查询分析页面:添加单位列显示
- 人员管理:创建独立页面,支持搜索、分页、批量操作
- 修复各种UI和功能问题
2026-06-23 09:55:55 +08:00
duxuekai
4e1bef2888 fix 2026-05-29 10:21:42 +08:00
大黑
a399336d3d fix:各种问题 2026-05-08 16:14:57 +08:00
大黑
fd5ae6a55e feat:年前最后一版 2026-02-24 08:50:46 +08:00
大黑
d7e9e51ebf feat:年前第一次正式存档以及全部修改 2026-02-12 15:19:59 +08:00
大黑
8636778f9d feat:同步参数 2026-02-03 13:52:28 +08:00
大黑
d002e3ff8c feat:暂存1正式出版 2026-02-02 15:17:19 +08:00
大黑
70d91689eb fix:修改图表问题 2026-01-22 15:14:55 +08:00
大黑
501742b95a fix 2026-01-22 09:33:32 +08:00
大黑
d53901e00a fix:重新发起 2026-01-21 15:32:52 +08:00
239 changed files with 130176 additions and 58311 deletions

4
.arts/settings.json Normal file
View File

@ -0,0 +1,4 @@
{
"clawMode.mode": "editor",
"workbench.activityBar.location": "default"
}

View File

@ -1,3 +1,3 @@
> 1% > 1%
last 2 versions last 2 versions
not ie <= 9 not ie <= 9

View File

@ -1,62 +1,62 @@
/* /*
* @Author: DevinShi * @Author: DevinShi
* @Date: 2020-02-03 09:01:16 * @Date: 2020-02-03 09:01:16
* @LastEditors: DevinShi * @LastEditors: DevinShi
* @LastEditTime: 2020-02-03 09:08:38 * @LastEditTime: 2020-02-03 09:08:38
* @Description: file content description * @Description: file content description
*/ */
"use strict"; "use strict";
module.exports = { module.exports = {
types: [ types: [
{ value: "feat", name: "功能: 一个新的功能" }, { value: "feat", name: "功能: 一个新的功能" },
{ value: "fix", name: "修复: 修复一个Bug" }, { value: "fix", name: "修复: 修复一个Bug" },
{ value: "docs", name: "文档: 变更的只有文档" }, { value: "docs", name: "文档: 变更的只有文档" },
{ value: "style", name: "格式: 空格, 分号等格式修复" }, { value: "style", name: "格式: 空格, 分号等格式修复" },
{ value: "refactor", name: "重构: 代码重构,注意和特性、修复区分开" }, { value: "refactor", name: "重构: 代码重构,注意和特性、修复区分开" },
{ value: "perf", name: "性能: 提升性能" }, { value: "perf", name: "性能: 提升性能" },
{ value: "test", name: "测试: 添加一个测试" }, { value: "test", name: "测试: 添加一个测试" },
{ value: "chore", name: "工具: 开发工具变动(构建、脚手架工具等)" }, { value: "chore", name: "工具: 开发工具变动(构建、脚手架工具等)" },
{ value: "revert", name: "回滚: 代码回退" } { value: "revert", name: "回滚: 代码回退" }
], ],
// scopes: [ // scopes: [
// {name: '模块1'}, // {name: '模块1'},
// {name: '模块2'}, // {name: '模块2'},
// {name: '模块3'}, // {name: '模块3'},
// {name: '模块4'} // {name: '模块4'}
// ], // ],
// it needs to match the value for field type. Eg.: 'fix' // it needs to match the value for field type. Eg.: 'fix'
scopeOverrides: { scopeOverrides: {
fix: [ fix: [
{ name: "功能" }, { name: "功能" },
{ name: "样式" }, { name: "样式" },
{ name: "e2e测试" }, { name: "e2e测试" },
{ name: "单元测试" } { name: "单元测试" }
], ],
chore: [{ chore: [{
name: '依赖修改', name: '依赖修改',
}, { }, {
name: '打包工具' name: '打包工具'
}] }]
}, },
// override the messages, defaults are as follows // override the messages, defaults are as follows
messages: { messages: {
type: "选择一种你的提交类型:", type: "选择一种你的提交类型:",
scope: "选择一个scope (可选):", scope: "选择一个scope (可选):",
// used if allowCustomScopes is true // used if allowCustomScopes is true
customScope: "自定义一个scope用于这次提交:", customScope: "自定义一个scope用于这次提交:",
subject: "短说明:\n", subject: "短说明:\n",
body: '长说明,使用"|"换行(可选)\n', body: '长说明,使用"|"换行(可选)\n',
breaking: "非兼容性说明 (可选):\n", breaking: "非兼容性说明 (可选):\n",
footer: "关联关闭的issue例如#31, #34(可选):\n", footer: "关联关闭的issue例如#31, #34(可选):\n",
confirmCommit: "确定提交说明?" confirmCommit: "确定提交说明?"
}, },
allowCustomScopes: true, allowCustomScopes: true,
allowBreakingChanges: ["feat", "fix"], allowBreakingChanges: ["feat", "fix"],
// limit subject length // limit subject length
subjectLimit: 100 subjectLimit: 100
}; };

View File

@ -1,20 +1,20 @@
root = true root = true
[*] [*]
charset=utf-8 charset=utf-8
end_of_line=lf end_of_line=lf
insert_final_newline=false insert_final_newline=false
indent_style=space indent_style=space
indent_size=2 indent_size=2
[{.eslintrc,.babelrc,.stylelintrc,*.json}] [{.eslintrc,.babelrc,.stylelintrc,*.json}]
indent_style=space indent_style=space
indent_size=2 indent_size=2
[*.less] [*.less]
indent_style=space indent_style=space
indent_size=2 indent_size=2
[*.{js,jsx,ts,tsx,vue,html}] [*.{js,jsx,ts,tsx,vue,html}]
indent_style=space indent_style=space
indent_size=2 indent_size=2

6
.env
View File

@ -1,3 +1,3 @@
VUE_APP_BASE_DOMAIN=http://dcloud-demo.definesys.cn:31213 VUE_APP_BASE_DOMAIN=http://dcloud-demo.definesys.cn:31213
VUE_APP_TENANT_ID=254638499280453633 VUE_APP_TENANT_ID=254638499280453633
VUE_APP_PUBLIC_PATH=/app/ VUE_APP_PUBLIC_PATH=/

View File

@ -1,17 +1,17 @@
*.sh *.sh
node_modules node_modules
lib lib
*.md *.md
*.scss *.scss
*.woff *.woff
*.ttf *.ttf
.vscode .vscode
.idea .idea
/build/ /build/
/dist/ /dist/
/public/ /public/
/script/ /script/
/config/ /config/
/docs /docs
.vscode .vscode

View File

@ -1,31 +1,31 @@
module.exports = { module.exports = {
root: true, root: true,
env: { env: {
node: true node: true
}, },
extends: ['plugin:vue/recommended', '@vue/standard'], extends: ['plugin:vue/recommended'],
rules: { rules: {
// 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', // 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
// 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', // 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'space-before-function-paren': 'off', 'space-before-function-paren': 'off',
// 禁止在计算属性中对属性修改 // 禁止在计算属性中对属性修改
'vue/no-side-effects-in-computed-properties': 'off', 'vue/no-side-effects-in-computed-properties': 'off',
// 属性空格 // 属性空格
'vue/attribute-hyphenation': 'off', 'vue/attribute-hyphenation': 'off',
'vue/html-closing-bracket-newline': 'off', 'vue/html-closing-bracket-newline': 'off',
'vue/html-self-closing': 'off', 'vue/html-self-closing': 'off',
'vue/require-default-prop': 'off', 'vue/require-default-prop': 'off',
'vue/max-attributes-per-line': 'off' 'vue/max-attributes-per-line': 'off'
}, },
parserOptions: { parserOptions: {
parser: 'babel-eslint' parser: 'babel-eslint'
}, },
overrides: [ overrides: [
{ {
files: ['**/__tests__/*.{j,t}s?(x)'], files: ['**/__tests__/*.{j,t}s?(x)'],
env: { env: {
jest: true jest: true
} }
} }
] ]
} }

60
.gitignore vendored
View File

@ -1,29 +1,31 @@
.DS_Store .DS_Store
node_modules node_modules
/dist /dist
/tests/e2e/reports/ /tests/e2e/reports/
selenium-debug.log selenium-debug.log
chromedriver.log chromedriver.log
geckodriver.log geckodriver.log
# local env files # local env files
.env.local .env.local
.env.*.local .env.*.local
# Log files # Log files
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
# Editor directories and files # Editor directories and files
.idea .idea
.vscode .vscode
*.suo *.suo
*.ntvs* *.ntvs*
*.njsproj *.njsproj
*.sln *.sln
*.sw? *.sw?
node_modules.zip node_modules.zip
apaas-custom-mydemo.zip apaas-custom-mydemo.zip
apaas-custom-mydemo-1.zip apaas-custom-mydemo-1.zip
eslint-report.html
fix-echarts-install.bat

2
.npmrc
View File

@ -1 +1 @@
sass_binary_site=https://registry.npmmirror.com/-/binary/node-sass sass_binary_site=https://registry.npmmirror.com/-/binary/node-sass

View File

@ -1,10 +1,10 @@
*.js *.js
*.png *.png
*.eot *.eot
*.ttf *.ttf
*.woff *.woff
/dist/ /dist/
/lib/ /lib/
/public/ /public/
.output.js .output.js

View File

@ -1,36 +0,0 @@
# yuchai
#### Description
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
#### 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/)

View File

@ -1,39 +0,0 @@
# yuchai
#### 介绍
{**以下是 Gitee 平台说明,您可以替换此简介**
Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN。专为开发者提供稳定、高效、安全的云端软件开发协作平台
无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
#### 软件架构
软件架构说明
#### 安装教程
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. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,146 +1,167 @@
{ {
"entry": "index.js", "entry": "index.js",
"copyAssets": ["public/custom/apaas-custom-mydemo"], "copyAssets": ["public/custom/apaas-custom-mydemo"],
"router": { "router": {
"apaas-custom-modalContorl":{ "apaas-custom-modalContorl":{
"name": "apaas-custom-modalContorl", "name": "apaas-custom-modalContorl",
"path": "apaas-custom-modalContorl", "path": "apaas-custom-modalContorl",
"meta": { "meta": {
"title": "模板管理" "title": "模板管理"
} }
}, },
"apaas-custom-selfEnginedata":{ "apaas-custom-selfEnginedata":{
"name": "apaas-custom-selfEnginedata", "name": "apaas-custom-selfEnginedata",
"path": "apaas-custom-selfEnginedata", "path": "apaas-custom-selfEnginedata",
"meta": { "meta": {
"title": "玉柴发动机数据" "title": "玉柴发动机数据"
} }
}, },
"apaas-custom-otherEnginedata":{ "apaas-custom-otherEnginedata":{
"name": "apaas-custom-otherEnginedata", "name": "apaas-custom-otherEnginedata",
"path": "apaas-custom-otherEnginedata", "path": "apaas-custom-otherEnginedata",
"meta": { "meta": {
"title": "竞品发动机数据" "title": "竞品发动机数据"
} }
}, },
"apaas-custom-checkData":{ "apaas-custom-checkData":{
"name": "apaas-custom-checkData", "name": "apaas-custom-checkData",
"path": "apaas-custom-checkData", "path": "apaas-custom-checkData",
"meta": { "meta": {
"title": "数据检查" "title": "数据检查"
} }
}, },
"apaas-custom-report":{ "apaas-custom-report":{
"name": "apaas-custom-report", "name": "apaas-custom-report",
"path": "apaas-custom-report", "path": "apaas-custom-report",
"meta": { "meta": {
"title": "对标报告" "title": "对标报告"
} }
}, },
"apaas-custom-reportList":{ "apaas-custom-reportList":{
"name": "apaas-custom-reportList", "name": "apaas-custom-reportList",
"path": "apaas-custom-reportList", "path": "apaas-custom-reportList",
"meta": { "meta": {
"title": "报告列表" "title": "报告列表"
} }
}, },
"apaas-custom-reportDetail":{ "apaas-custom-reportDetail":{
"name": "apaas-custom-reportDetail", "name": "apaas-custom-reportDetail",
"path": "apaas-custom-reportDetail", "path": "apaas-custom-reportDetail",
"meta": { "meta": {
"title": "报告详情" "title": "报告详情"
} }
}, },
"apaas-custom-reportCheck":{ "apaas-custom-reportCheck":{
"name": "apaas-custom-reportCheck", "name": "apaas-custom-reportCheck",
"path": "apaas-custom-reportCheck", "path": "apaas-custom-reportCheck",
"meta": { "meta": {
"title": "报告检查" "title": "报告检查"
} }
}, },
"apaas-custom-modelDetail":{ "apaas-custom-modelDetail":{
"name": "apaas-custom-modelDetail", "name": "apaas-custom-modelDetail",
"path": "apaas-custom-modelDetail", "path": "apaas-custom-modelDetail",
"meta": { "meta": {
"title": "系统参数管理" "title": "系统参数管理"
} }
}, },
"apaas-custom-engineDetail":{ "apaas-custom-engineDetail":{
"name": "apaas-custom-engineDetail", "name": "apaas-custom-engineDetail",
"path": "apaas-custom-engineDetail", "path": "apaas-custom-engineDetail",
"meta": { "meta": {
"title": "发动机参数详情" "title": "发动机参数详情"
} }
}, },
"apaas-custom-approvalManagement":{ "apaas-custom-approvalManagement":{
"name": "apaas-custom-approvalManagement", "name": "apaas-custom-approvalManagement",
"path": "apaas-custom-approvalManagement", "path": "apaas-custom-approvalManagement",
"meta": { "meta": {
"title": "模板审批管理" "title": "模板审批管理"
} }
}, },
"apaas-custom-toDoList":{ "apaas-custom-toDoList":{
"name": "apaas-custom-toDoList", "name": "apaas-custom-toDoList",
"path": "apaas-custom-toDoList", "path": "apaas-custom-toDoList",
"meta": { "meta": {
"title": "数据待办" "title": "数据待办"
} }
}, },
"apaas-custom-myDone":{ "apaas-custom-myDone":{
"name": "apaas-custom-myDone", "name": "apaas-custom-myDone",
"path": "apaas-custom-myDone", "path": "apaas-custom-myDone",
"meta": { "meta": {
"title": "我的已办" "title": "我的已办"
} }
}, },
"apaas-custom-mySend":{ "apaas-custom-mySend":{
"name": "apaas-custom-mySend", "name": "apaas-custom-mySend",
"path": "apaas-custom-mySend", "path": "apaas-custom-mySend",
"meta": { "meta": {
"title": "我发起的" "title": "我发起的"
} }
}, },
"apaas-custom-selfEngineCheck":{ "apaas-custom-myDemo":{
"name": "apaas-custom-selfEngineCheck", "name": "apaas-custom-myDemo",
"path": "apaas-custom-selfEngineCheck", "path": "apaas-custom-myDemo",
"meta": { "meta": {
"title": "玉柴发动机审核" "title": "我的测试"
} }
}, },
"apaas-custom-otherEngineCheck":{ "apaas-custom-selfEngineCheck":{
"name": "apaas-custom-otherEngineCheck", "name": "apaas-custom-selfEngineCheck",
"path": "apaas-custom-otherEngineCheck", "path": "apaas-custom-selfEngineCheck",
"meta": { "meta": {
"title": "竞品发动机审核" "title": "玉柴发动机审核"
} }
}, },
"apaas-custom-managerData":{ "apaas-custom-otherEngineCheck":{
"name": "apaas-custom-managerData", "name": "apaas-custom-otherEngineCheck",
"path": "apaas-custom-managerData", "path": "apaas-custom-otherEngineCheck",
"meta": { "meta": {
"title": "责任人管理" "title": "竞品发动机审核"
} }
}, },
"apaas-custom-fillerData":{ "apaas-custom-managerData":{
"name": "apaas-custom-fillerData", "name": "apaas-custom-managerData",
"path": "apaas-custom-fillerData", "path": "apaas-custom-managerData",
"meta": { "meta": {
"title": "填写人管理" "title": "责任人管理"
} }
}, },
"apaas-custom-permissionManagement":{ "apaas-custom-fillerData":{
"name": "apaas-custom-permissionManagement", "name": "apaas-custom-fillerData",
"path": "apaas-custom-permissionManagement", "path": "apaas-custom-fillerData",
"meta": { "meta": {
"title": "权限管理" "title": "填写人管理"
} }
} },
}, "apaas-custom-permissionManagement":{
"customWidgetList": [ "name": "apaas-custom-permissionManagement",
{ "path": "apaas-custom-permissionManagement",
"code": "mydemo", "meta": {
"text": "mydemo" "title": "权限管理"
} }
], },
"outputName": "apaas-custom-mydemo" "apaas-custom-roleMemberManagement":{
} "name": "apaas-custom-roleMemberManagement",
"path": "apaas-custom-roleMemberManagement",
"meta": {
"title": "人员管理"
}
},
"apaas-custom-checkPersonPermission":{
"name": "apaas-custom-checkPersonPermission",
"path": "apaas-custom-checkPersonPermission",
"meta": {
"title": "权限检查"
}
}
},
"customWidgetList": [
{
"code": "mydemo",
"text": "mydemo"
}
],
"outputName": "apaas-custom-mydemo"
}

View File

@ -1,55 +1,55 @@
/** /**
* Element UI 懒加载插件由于我们需要使用懒加载scss动态编译主题所以不使用 * Element UI 懒加载插件由于我们需要使用懒加载scss动态编译主题所以不使用
*/ */
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
const elementUIComponentPlugin = [ const elementUIComponentPlugin = [
'component', 'component',
{ {
libraryName: 'element-ui', libraryName: 'element-ui',
styleLibraryName: '../packages/theme-chalk/src', styleLibraryName: '../packages/theme-chalk/src',
ext: '.scss' ext: '.scss'
}, },
'element-ui' 'element-ui'
] ]
const XLibComponentPlugin = [ const XLibComponentPlugin = [
'component', 'component',
{ {
libraryName: '@x-ui/x-dcloud-ui', libraryName: '@x-ui/x-dcloud-ui',
styleLibrary: { styleLibrary: {
base: false, base: false,
name: 'theme-chalk/theme' name: 'theme-chalk/theme'
}, },
ext: '.scss' ext: '.scss'
}, },
'@x-ui/x-dcloud-ui' '@x-ui/x-dcloud-ui'
] ]
const XDcloudPageWebPlugin = [ const XDcloudPageWebPlugin = [
'component', 'component',
{ {
libraryName: '@x-apaas/x-dcloud-page-web', libraryName: '@x-apaas/x-dcloud-page-web',
styleLibrary: { styleLibrary: {
base: false, base: false,
name: 'theme-chalk/theme' name: 'theme-chalk/theme'
}, },
ext: '.scss' ext: '.scss'
}, },
'@x-apaas/x-dcloud-page-web' '@x-apaas/x-dcloud-page-web'
] ]
module.exports = { module.exports = {
presets: [ presets: [
[ [
'@vue/cli-plugin-babel/preset', '@vue/cli-plugin-babel/preset',
{ {
useBuiltIns: 'entry' useBuiltIns: 'entry'
} }
] ]
], ],
plugins: [ plugins: [
elementUIComponentPlugin, elementUIComponentPlugin,
XLibComponentPlugin, XLibComponentPlugin,
XDcloudPageWebPlugin XDcloudPageWebPlugin
] ]
} }

View File

@ -1,125 +1,125 @@
const shell = require('shelljs') const shell = require('shelljs')
const path = require('path') const path = require('path')
const fs = require('fs') const fs = require('fs')
const rimraf = require('rimraf') const rimraf = require('rimraf')
const customs = fs.readdirSync(path.resolve(process.cwd(), 'src/custom')) const customs = fs.readdirSync(path.resolve(process.cwd(), 'src/custom'))
const all = customs.reduce((result, dir) => { const all = customs.reduce((result, dir) => {
// ignore directories whose name starts without `apaas-custom-plugin-` // ignore directories whose name starts without `apaas-custom-plugin-`
if (dir.indexOf('apaas-custom-plugin-')) return result if (dir.indexOf('apaas-custom-plugin-')) return result
try { try {
const apaasJson = JSON.parse(fs.readFileSync(path.resolve(process.cwd(), 'src', 'custom', dir, 'apaas.json'))) const apaasJson = JSON.parse(fs.readFileSync(path.resolve(process.cwd(), 'src', 'custom', dir, 'apaas.json')))
// match every plugins except those whose local.notAll is true // match every plugins except those whose local.notAll is true
if (apaasJson && (!apaasJson.local || !apaasJson.local.notAll)) result.push(dir.slice(20)) if (apaasJson && (!apaasJson.local || !apaasJson.local.notAll)) result.push(dir.slice(20))
} catch (e) { } catch (e) {
} finally { } finally {
return result return result
} }
}, []) }, [])
const help = ` const help = `
插件打包入口 插件打包入口
格式 格式
1. node thisJs xx <params> <value> 用指定的参数和值打包xx插件 1. node thisJs xx <params> <value> 用指定的参数和值打包xx插件
2. node thisJs xx 打包xx插件 2. node thisJs xx 打包xx插件
3. node thisJs <params> <value> 用指定的参数和值打包xx插件notes: 必须要包含 -i 或者 -a 参数 3. node thisJs <params> <value> 用指定的参数和值打包xx插件notes: 必须要包含 -i 或者 -a 参数
参数 参数
-i <plugin_name> 指定插件名优先级高于格式1和格式2指定的插件名 -i <plugin_name> 指定插件名优先级高于格式1和格式2指定的插件名
-b 采用批量打包模式批量打包默认的插件为上文中的 all 变量值指定的插件集合此参数将忽略 -i 指定的具体插件名 -b 采用批量打包模式批量打包默认的插件为上文中的 all 变量值指定的插件集合此参数将忽略 -i 指定的具体插件名
批量打包默认的插件: ${all.join(',')} 批量打包默认的插件: ${all.join(',')}
-c 加密命名插件打包后的文件夹或压缩文件使用 md5 加密插件 code 后的字符串命名 -c 加密命名插件打包后的文件夹或压缩文件使用 md5 加密插件 code 后的字符串命名
-Z 取消压缩默认会给每一个插件打包使用此命令则取消打包这一步 -Z 取消压缩默认会给每一个插件打包使用此命令则取消打包这一步
-A <plugins_str> 声明参与批量打包的所有插件用英文逗号分隔多个插件 oo,aa 表示打包oo和aa这两个插件需要 -b 参数才会实际生效 -A <plugins_str> 声明参与批量打包的所有插件用英文逗号分隔多个插件 oo,aa 表示打包oo和aa这两个插件需要 -b 参数才会实际生效
-a 使用异步打包模式 -a 使用异步打包模式
-h, --help 查看打包命令帮助 -h, --help 查看打包命令帮助
--clean, --rm 清除所有打包产生的文件 --clean, --rm 清除所有打包产生的文件
支持缩略形式的参数 -cZ 相当于 -c -Z其后需要跟变量的参数写在省略形式前的会读取其后的变量值并生效 支持缩略形式的参数 -cZ 相当于 -c -Z其后需要跟变量的参数写在省略形式前的会读取其后的变量值并生效
-iA oo 表示指定打包oo插件-Ai oo,aa表示指定需要批量打包的插件为 oo aa -iA oo 表示指定打包oo插件-Ai oo,aa表示指定需要批量打包的插件为 oo aa
` `
let crypto = 'noc' let crypto = 'noc'
let noZip = 'noz' let noZip = 'noz'
let batchMode = false let batchMode = false
let plugin = '' let plugin = ''
let async = false let async = false
const pickValue = function(a, i) { const pickValue = function(a, i) {
return a && a[i] && !a[i].startsWith('-') && a[i] return a && a[i] && !a[i].startsWith('-') && a[i]
} }
const parseArgv = function(argv) { const parseArgv = function(argv) {
const localArgv = [...argv] const localArgv = [...argv]
for (let i = 0; i < localArgv.length; i++) { for (let i = 0; i < localArgv.length; i++) {
if (localArgv[i].startsWith('--')) { if (localArgv[i].startsWith('--')) {
switch (localArgv[i]) { switch (localArgv[i]) {
case '--clean': case '--clean':
case '--rm': case '--rm':
rimraf(path.resolve(process.cwd(), 'crypto')) rimraf(path.resolve(process.cwd(), 'crypto'))
rimraf(path.resolve(process.cwd(), 'PLUGIN_*')) rimraf(path.resolve(process.cwd(), 'PLUGIN_*'))
rimraf(path.resolve(process.cwd(), 'PLUGIN_*.zip')) rimraf(path.resolve(process.cwd(), 'PLUGIN_*.zip'))
process.exit(0) process.exit(0)
case '--help': case '--help':
console.log(help) console.log(help)
process.exit(0) process.exit(0)
default: default:
break break
} }
} else if (localArgv[i].startsWith('-')) { } else if (localArgv[i].startsWith('-')) {
const flag = localArgv[i].slice(0) const flag = localArgv[i].slice(0)
const flags = (flag && flag.split('')) || [] const flags = (flag && flag.split('')) || []
flags.forEach((f) => { flags.forEach((f) => {
let a let a
switch (f) { switch (f) {
case 'c': case 'c':
crypto = '-c' crypto = '-c'
break break
case 'b': case 'b':
batchMode = true batchMode = true
break break
case 'a': case 'a':
async = true async = true
break break
case 'A': case 'A':
;(a = pickValue(localArgv, i + 1)) && a && ((all = a.split(',')), i++) ;(a = pickValue(localArgv, i + 1)) && a && ((all = a.split(',')), i++)
break break
case 'Z': case 'Z':
noZip = '-Z' noZip = '-Z'
break break
case 'i': case 'i':
;(a = pickValue(localArgv, i + 1)) && a && ((plugin = a), i++) ;(a = pickValue(localArgv, i + 1)) && a && ((plugin = a), i++)
break break
case 'h': case 'h':
console.log(help) console.log(help)
process.exit(0) process.exit(0)
default: default:
break break
} }
}) })
} }
} }
if (!batchMode && !plugin) { if (!batchMode && !plugin) {
val = process.argv.slice(2, 3)[0] val = process.argv.slice(2, 3)[0]
val && !val.startsWith('-') && (plugin = val) val && !val.startsWith('-') && (plugin = val)
if (!plugin) { if (!plugin) {
console.error('未指定插件名') console.error('未指定插件名')
process.exit(0) process.exit(0)
} }
} }
} }
parseArgv(process.argv.slice(2)) parseArgv(process.argv.slice(2))
const scriptPath = path.resolve(process.cwd(), 'build/build-plugins.js') const scriptPath = path.resolve(process.cwd(), 'build/build-plugins.js')
const doBuild = (item) => { const doBuild = (item) => {
shell.exec(`node ${scriptPath} ${item} ${crypto} ${noZip}`, { async: async }) shell.exec(`node ${scriptPath} ${item} ${crypto} ${noZip}`, { async: async })
} }
if (batchMode) { if (batchMode) {
all.forEach(doBuild) all.forEach(doBuild)
} else { } else {
doBuild(plugin) doBuild(plugin)
} }

View File

@ -1 +1 @@
["admin", "app", "mobile", "workbench", "workbenchm"] ["admin", "app", "mobile", "workbench", "workbenchm"]

View File

@ -1,181 +1,181 @@
const shell = require('shelljs') const shell = require('shelljs')
const fs = require('fs') const fs = require('fs')
const path = require('path') const path = require('path')
const zipper = require('zip-local') const zipper = require('zip-local')
const colors = require('colors') const colors = require('colors')
const envDefine = require('./build-en-define.json') const envDefine = require('./build-en-define.json')
const md5 = require('md5') const md5 = require('md5')
const lib = async (cmd, program) => { const lib = async (cmd, program) => {
const customModule = cmd.custom const customModule = cmd.custom
const crypto = cmd.crypto === '-c' const crypto = cmd.crypto === '-c'
const noZip = cmd.noZip === '-Z' const noZip = cmd.noZip === '-Z'
// 获取指定 custom 目录下的apaas.json // 获取指定 custom 目录下的apaas.json
const customModulePath = path.resolve(process.cwd(), 'src/custom', customModule) const customModulePath = path.resolve(process.cwd(), 'src/custom', customModule)
const customModuleConfigPath = path.resolve(customModulePath, 'apaas.json') const customModuleConfigPath = path.resolve(customModulePath, 'apaas.json')
if (!fs.existsSync(customModuleConfigPath)) { if (!fs.existsSync(customModuleConfigPath)) {
console.log(`Error: 自开发模块 ${customModule} 下不存在需要的 apaas.json 文件`['red']) console.log(`Error: 自开发模块 ${customModule} 下不存在需要的 apaas.json 文件`['red'])
console.log(`exit`['red']) console.log(`exit`['red'])
process.exit(0) process.exit(0)
} }
const apaasConfig = JSON.parse(fs.readFileSync(customModuleConfigPath)) const apaasConfig = JSON.parse(fs.readFileSync(customModuleConfigPath))
const buildArray = envDefine const buildArray = envDefine
.map((_) => { .map((_) => {
if (!apaasConfig[_]) { if (!apaasConfig[_]) {
return return
} }
const newConfig = { ...apaasConfig } const newConfig = { ...apaasConfig }
delete newConfig[_] delete newConfig[_]
newConfig.outputName = md5(apaasConfig.code) newConfig.outputName = md5(apaasConfig.code)
return { return {
// 排第一,且不会被覆盖 // 排第一,且不会被覆盖
entry: apaasConfig[_], entry: apaasConfig[_],
...newConfig, ...newConfig,
entry: apaasConfig[_], entry: apaasConfig[_],
type: _ type: _
} }
}) })
.filter((item) => item) .filter((item) => item)
const result = buildArray.map((config) => doLib(config, customModulePath, crypto)) const result = buildArray.map((config) => doLib(config, customModulePath, crypto))
if (result === [-1, -1]) { if (result === [-1, -1]) {
process.exit(0) process.exit(0)
} }
const cryptoPath = crypto ? 'crypto/' + md5(apaasConfig.code) : apaasConfig.code const cryptoPath = crypto ? 'crypto/' + md5(apaasConfig.code) : apaasConfig.code
writeApaasJson(cryptoPath, apaasConfig) writeApaasJson(cryptoPath, apaasConfig)
if (!noZip) { if (!noZip) {
zip(cryptoPath, cryptoPath) zip(cryptoPath, cryptoPath)
} }
} }
/** /**
* @params apaasModuleConfig 源配置信息 * @params apaasModuleConfig 源配置信息
* @params customModulePath 打包入口 * @params customModulePath 打包入口
*/ */
const doLib = (apaasModuleConfig, customModulePath, crypto) => { const doLib = (apaasModuleConfig, customModulePath, crypto) => {
const customModuleEntryPath = path.resolve(customModulePath, apaasModuleConfig.entry) const customModuleEntryPath = path.resolve(customModulePath, apaasModuleConfig.entry)
const moduleType = apaasModuleConfig.type const moduleType = apaasModuleConfig.type
const outputName = (crypto ? 'crypto/' + md5(apaasModuleConfig.code) : apaasModuleConfig.code) + '/' + moduleType const outputName = (crypto ? 'crypto/' + md5(apaasModuleConfig.code) : apaasModuleConfig.code) + '/' + moduleType
if (!fs.existsSync(customModuleEntryPath)) { if (!fs.existsSync(customModuleEntryPath)) {
console.log(`Error: apaas.json 指定的entry: ${apaasModuleConfig.entry} 的路径错误 `['red']) console.log(`Error: apaas.json 指定的entry: ${apaasModuleConfig.entry} 的路径错误 `['red'])
console.log(`error path is ${customModuleEntryPath}`['red']) console.log(`error path is ${customModuleEntryPath}`['red'])
return -1 return -1
} }
const customCliPath = path.resolve( const customCliPath = path.resolve(
process.cwd(), process.cwd(),
'./node_modules/@vue/cli-service/bin/vue-cli-service.js' './node_modules/@vue/cli-service/bin/vue-cli-service.js'
) )
// 使用vue build 打包,并生成文件 // 使用vue build 打包,并生成文件
shell.exec( shell.exec(
`node ${customCliPath} build --target lib --name ${apaasModuleConfig.outputName} --dest ${outputName} ${customModuleEntryPath}` `node ${customCliPath} build --target lib --name ${apaasModuleConfig.outputName} --dest ${outputName} ${customModuleEntryPath}`
) )
const suffix = ['umd.js', 'umd.min.js', 'common.js', 'css'] const suffix = ['umd.js', 'umd.min.js', 'common.js', 'css']
suffix.forEach((item => { suffix.forEach((item => {
shell.mv(path.resolve(process.cwd(), `${outputName}/${apaasModuleConfig.outputName}.${item}`), path.resolve(process.cwd(), `${outputName}/index.${item}`)) shell.mv(path.resolve(process.cwd(), `${outputName}/${apaasModuleConfig.outputName}.${item}`), path.resolve(process.cwd(), `${outputName}/index.${item}`))
})) }))
// shell.cp('-R', customModuleConfigPath, `${outputPath}/`) // shell.cp('-R', customModuleConfigPath, `${outputPath}/`)
const newOutputConfig = { ...apaasModuleConfig } const newOutputConfig = { ...apaasModuleConfig }
envDefine.forEach((_) => { envDefine.forEach((_) => {
delete newOutputConfig[_] delete newOutputConfig[_]
}) })
const outputPath = path.resolve(process.cwd(), outputName) const outputPath = path.resolve(process.cwd(), outputName)
// 拷贝public文件到指定目录 // 拷贝public文件到指定目录
apaasModuleConfig.copyAssets.forEach((copyAsset) => { apaasModuleConfig.copyAssets.forEach((copyAsset) => {
copyAssetSource = copyAsset + copyAsset.endsWith('/') ? moduleType : '/' + moduleType copyAssetSource = copyAsset + copyAsset.endsWith('/') ? moduleType : '/' + moduleType
const assetPath = path.resolve(process.cwd(), copyAssetSource) const assetPath = path.resolve(process.cwd(), copyAssetSource)
if (fs.existsSync(assetPath)) { if (fs.existsSync(assetPath)) {
const outputAsset = path.resolve(outputPath, copyAsset.replace('public/', 'static/')) const outputAsset = path.resolve(outputPath, copyAsset.replace('public/', 'static/'))
shell.mkdir('-p', outputAsset) shell.mkdir('-p', outputAsset)
shell.cp('-R', `${assetPath}/*`, `${outputAsset}/`) shell.cp('-R', `${assetPath}/*`, `${outputAsset}/`)
} }
}) })
} }
/** /**
* @params outputPath 目标文件夹命 * @params outputPath 目标文件夹命
* @params originJson 源配置信息 * @params originJson 源配置信息
*/ */
const writeApaasJson = function (outputPath, originJson) { const writeApaasJson = function (outputPath, originJson) {
const newOutputConfig = { ...originJson } const newOutputConfig = { ...originJson }
delete newOutputConfig.type delete newOutputConfig.type
delete newOutputConfig.outputName delete newOutputConfig.outputName
delete newOutputConfig.local delete newOutputConfig.local
newOutputConfig.extraConfig = { ...newOutputConfig.extraConfig } newOutputConfig.extraConfig = { ...newOutputConfig.extraConfig }
envDefine.forEach(item => { envDefine.forEach(item => {
if (newOutputConfig[item]) { if (newOutputConfig[item]) {
newOutputConfig.extraConfig[item] = true newOutputConfig.extraConfig[item] = true
delete newOutputConfig[item] delete newOutputConfig[item]
newOutputConfig.extraConfig[item + 'Css'] = fs.existsSync(path.resolve(process.cwd(), outputPath, item, 'index.css')) newOutputConfig.extraConfig[item + 'Css'] = fs.existsSync(path.resolve(process.cwd(), outputPath, item, 'index.css'))
} }
}) })
fs.writeFile(`${outputPath}/apaas.json`, JSON.stringify(newOutputConfig, null, ' '), function ( fs.writeFile(`${outputPath}/apaas.json`, JSON.stringify(newOutputConfig, null, ' '), function (
error error
) { ) {
if (error) { if (error) {
console.log(`配置信息写入失败\n${error}`['red']) console.log(`配置信息写入失败\n${error}`['red'])
} }
}) })
} }
/** /**
* @params originPath 源文件夹名 * @params originPath 源文件夹名
* @params outputName 目标文件名 * @params outputName 目标文件名
*/ */
const zip = function (originName, outputName) { const zip = function (originName, outputName) {
const originPath = path.resolve(process.cwd(), originName) const originPath = path.resolve(process.cwd(), originName)
const outputZipPath = path.resolve(process.cwd(), `${outputName}.zip`) const outputZipPath = path.resolve(process.cwd(), `${outputName}.zip`)
if (fs.existsSync(outputZipPath)) { if (fs.existsSync(outputZipPath)) {
shell.rm(outputZipPath) shell.rm(outputZipPath)
} }
// 生成zip并压缩 // 生成zip并压缩
zipper.zip(originPath, function (error, zipped) { zipper.zip(originPath, function (error, zipped) {
if (!error) { if (!error) {
zipped.compress() // compress before exporting zipped.compress() // compress before exporting
var buff = zipped.memory() // get the zipped file as a Buffer var buff = zipped.memory() // get the zipped file as a Buffer
zipped.save(outputZipPath, function (error) { zipped.save(outputZipPath, function (error) {
if (!error) { if (!error) {
console.log(`zipped successfully !`['green']) console.log(`zipped successfully !`['green'])
// 删除指定生成目录 // 删除指定生成目录
// shell.rm('-r',originPath) // shell.rm('-r',originPath)
} else { } else {
console.log(`write error: ${error}`['red']) console.log(`write error: ${error}`['red'])
} }
}) })
} else { } else {
console.log(`read error: ${error}`['red']) console.log(`read error: ${error}`['red'])
} }
}) })
} }
const argv = process.argv.splice(2, 1)[0] const argv = process.argv.splice(2, 1)[0]
if (!argv) { if (!argv) {
console.log(`未指定插件名`['red']) console.log(`未指定插件名`['red'])
process.exit(0) process.exit(0)
} }
const crypto = process.argv.splice(2, 1)[0] const crypto = process.argv.splice(2, 1)[0]
const noZip = process.argv.splice(2, 1)[0] const noZip = process.argv.splice(2, 1)[0]
module.exports = lib( module.exports = lib(
{ {
custom: `apaas-custom-plugin-${argv}`, custom: `apaas-custom-plugin-${argv}`,
crypto, crypto,
noZip, noZip,
}, },
{} {}
) )

View File

@ -1,73 +1,73 @@
const shell = require('shelljs'); const shell = require('shelljs');
const fs = require('fs') const fs = require('fs')
const path = require('path') const path = require('path')
const zipper = require("zip-local"); const zipper = require("zip-local");
const colors = require('colors'); const colors = require('colors');
const lib = async (cmd, program) => { const lib = async (cmd, program) => {
const customModule = cmd.custom const customModule = cmd.custom
// 获取指定 custom 目录下的apaas.json // 获取指定 custom 目录下的apaas.json
const customModulePath = path.resolve(`${process.cwd()}`, 'src/custom', customModule) const customModulePath = path.resolve(`${process.cwd()}`, 'src/custom', customModule)
const customModuleConfigPath = path.resolve(customModulePath, 'apaas.json') const customModuleConfigPath = path.resolve(customModulePath, 'apaas.json')
if (!fs.existsSync(customModuleConfigPath)) { if (!fs.existsSync(customModuleConfigPath)) {
console.log(`Error: 自开发模块 ${customModule} 下不存在需要的 apass.json 文件`['red']) console.log(`Error: 自开发模块 ${customModule} 下不存在需要的 apass.json 文件`['red'])
console.log(`exit`['red']) console.log(`exit`['red'])
process.exit(0) process.exit(0)
} }
const apaasConfig = JSON.parse(fs.readFileSync(customModuleConfigPath)) const apaasConfig = JSON.parse(fs.readFileSync(customModuleConfigPath))
const customModuleEntryPath = path.resolve(customModulePath, apaasConfig.entry) const customModuleEntryPath = path.resolve(customModulePath, apaasConfig.entry)
if (!fs.existsSync(customModuleEntryPath)) { if (!fs.existsSync(customModuleEntryPath)) {
console.log(`Error: apaas.json 指定的entry: ${apaasConfig.entry} 的路径错误 `['red']) console.log(`Error: apaas.json 指定的entry: ${apaasConfig.entry} 的路径错误 `['red'])
console.log(`error path is ${customModuleEntryPath}`['red']) console.log(`error path is ${customModuleEntryPath}`['red'])
console.log(`exit`['red']) console.log(`exit`['red'])
process.exit(0) process.exit(0)
} }
const customCliPath = path.resolve(`${process.cwd()}`, './node_modules/.bin/vue-cli-service') const customCliPath = path.resolve(`${process.cwd()}`, './node_modules/.bin/vue-cli-service')
const outputPath = path.resolve(`${process.cwd()}`, `${apaasConfig.outputName}`) const outputPath = path.resolve(`${process.cwd()}`, `${apaasConfig.outputName}`)
const outputZipPath = path.resolve(`${process.cwd()}`, `${apaasConfig.outputName}.zip`) const outputZipPath = path.resolve(`${process.cwd()}`, `${apaasConfig.outputName}.zip`)
// 使用vue build 打包,并生成文件 // 使用vue build 打包,并生成文件
shell.exec(`node ${customCliPath} build --target lib --name ${apaasConfig.outputName} --dest ${apaasConfig.outputName} ${customModuleEntryPath}`) shell.exec(`node ${customCliPath} build --target lib --name ${apaasConfig.outputName} --dest ${apaasConfig.outputName} ${customModuleEntryPath}`)
shell.cp('-R', customModuleConfigPath, `${outputPath}/`) shell.cp('-R', customModuleConfigPath, `${outputPath}/`)
// 拷贝public文件到指定目录 // 拷贝public文件到指定目录
apaasConfig.copyAssets.forEach(copyAsset => { apaasConfig.copyAssets.forEach(copyAsset => {
const assetPath = path.resolve(`${process.cwd()}`, copyAsset) const assetPath = path.resolve(`${process.cwd()}`, copyAsset)
const outputAsset = path.resolve(outputPath, copyAsset.replace('public/', 'static/')) const outputAsset = path.resolve(outputPath, copyAsset.replace('public/', 'static/'))
shell.mkdir('-p', outputAsset) shell.mkdir('-p', outputAsset)
shell.cp('-R', `${assetPath}/*`, `${outputAsset}/`) shell.cp('-R', `${assetPath}/*`, `${outputAsset}/`)
}); });
if (fs.existsSync(outputZipPath)) { if (fs.existsSync(outputZipPath)) {
shell.rm(outputZipPath) shell.rm(outputZipPath)
} }
// 生成zip并压缩 // 生成zip并压缩
zipper.zip(outputPath, function(error, zipped) { zipper.zip(outputPath, function(error, zipped) {
if(!error) { if(!error) {
zipped.compress(); // compress before exporting zipped.compress(); // compress before exporting
var buff = zipped.memory(); // get the zipped file as a Buffer var buff = zipped.memory(); // get the zipped file as a Buffer
zipped.save(`${outputZipPath}`, function(error) { zipped.save(`${outputZipPath}`, function(error) {
if(!error) { if(!error) {
console.log("saved successfully !"); console.log("saved successfully !");
// 删除指定生成目录 // 删除指定生成目录
// shell.rm('-r',outputPath) // shell.rm('-r',outputPath)
} }
}); });
} }
}) })
} }
module.exports = lib({ module.exports = lib({
custom: 'apaas-custom-{{moduleName}}' custom: 'apaas-custom-{{moduleName}}'
}, {}) }, {})

View File

@ -1,75 +1,75 @@
const program = require('commander'); const program = require('commander');
const shelljs = require('shelljs'); const shelljs = require('shelljs');
const userHome = require('user-home'); const userHome = require('user-home');
const fs = require('fs') const fs = require('fs')
const path = require('path') const path = require('path')
const colors = require('colors'); const colors = require('colors');
const init = (cmd, program) => { const init = (cmd, program) => {
const moduleName = cmd.moduleName const moduleName = cmd.moduleName
const projectPath = path.resolve(`${process.cwd()}`, `apaas-custom-${moduleName}`) const projectPath = path.resolve(`${process.cwd()}`, `apaas-custom-${moduleName}`)
const customPath = path.resolve(projectPath, 'src/custom'); const customPath = path.resolve(projectPath, 'src/custom');
const staticPath = path.resolve(projectPath, 'public/custom'); const staticPath = path.resolve(projectPath, 'public/custom');
//检查控制台是否以运行`git `开头的命令 //检查控制台是否以运行`git `开头的命令
if (!shelljs.which('git')) { if (!shelljs.which('git')) {
//在控制台输出内容 //在控制台输出内容
console.log('error 本机上没有git请检查git是否安装或相关环境变量是否正确'['red']); console.log('error 本机上没有git请检查git是否安装或相关环境变量是否正确'['red']);
shelljs.exit(1); shelljs.exit(1);
} }
const version = 'v0.0.1' const version = 'v0.0.1'
const gitTemplateRepo = `${userHome}/.apaasCliRepo` const gitTemplateRepo = `${userHome}/.apaasCliRepo`
shelljs.rm('-rf', gitTemplateRepo) shelljs.rm('-rf', gitTemplateRepo)
shelljs.mkdir('-p', gitTemplateRepo) shelljs.mkdir('-p', gitTemplateRepo)
shelljs.exec(`git clone --branch ${version} https://gitee.com/shiyutian/apaas-custom-vue-starter.git --depth=1 ${gitTemplateRepo}`); shelljs.exec(`git clone --branch ${version} https://gitee.com/shiyutian/apaas-custom-vue-starter.git --depth=1 ${gitTemplateRepo}`);
shelljs.rm('-rf', path.resolve(`${gitTemplateRepo}`, '.git')) shelljs.rm('-rf', path.resolve(`${gitTemplateRepo}`, '.git'))
if (fs.existsSync(projectPath)) { if (fs.existsSync(projectPath)) {
// 当前路径已经在相关工程 // 当前路径已经在相关工程
console.log('error 当前路径已经存在工程,请检查相关目录设置'['red']) console.log('error 当前路径已经存在工程,请检查相关目录设置'['red'])
shelljs.exit(1); shelljs.exit(1);
} else { } else {
shelljs.mkdir('-p', `${process.cwd()}`) shelljs.mkdir('-p', `${process.cwd()}`)
} }
shelljs.cp('-R', `${gitTemplateRepo}/.`, projectPath) shelljs.cp('-R', `${gitTemplateRepo}/.`, projectPath)
const demoCustomModuleName = 'hello' const demoCustomModuleName = 'hello'
const demoCustomModulePath = path.resolve(customPath, `apaas-custom-${demoCustomModuleName}`) const demoCustomModulePath = path.resolve(customPath, `apaas-custom-${demoCustomModuleName}`)
const writeAndReplaceFileSync = (filePath) => { const writeAndReplaceFileSync = (filePath) => {
const stat = fs.lstatSync(filePath) const stat = fs.lstatSync(filePath)
if (stat.isDirectory()) { if (stat.isDirectory()) {
const customModuleFileNames = fs.readdirSync(filePath) const customModuleFileNames = fs.readdirSync(filePath)
customModuleFileNames.forEach(fileName => { customModuleFileNames.forEach(fileName => {
const tempFilePath = path.join(filePath, fileName) const tempFilePath = path.join(filePath, fileName)
writeAndReplaceFileSync(tempFilePath) writeAndReplaceFileSync(tempFilePath)
}) })
} else { } else {
let fileContent = fs.readFileSync(filePath, 'utf-8') let fileContent = fs.readFileSync(filePath, 'utf-8')
fileContent = fileContent.replace(/{{moduleName}}/g, moduleName) fileContent = fileContent.replace(/{{moduleName}}/g, moduleName)
fileContent = fileContent.replace(/{{ModuleName}}/g, moduleName.charAt(0).toUpperCase() + moduleName.slice(1)) fileContent = fileContent.replace(/{{ModuleName}}/g, moduleName.charAt(0).toUpperCase() + moduleName.slice(1))
fs.writeFileSync(filePath, fileContent) fs.writeFileSync(filePath, fileContent)
} }
} }
writeAndReplaceFileSync(demoCustomModulePath) writeAndReplaceFileSync(demoCustomModulePath)
fs.renameSync(demoCustomModulePath, path.resolve(customPath, `apaas-custom-${moduleName}`)) fs.renameSync(demoCustomModulePath, path.resolve(customPath, `apaas-custom-${moduleName}`))
fs.renameSync(path.resolve(staticPath, `apaas-custom-${demoCustomModuleName}`), path.resolve(staticPath, `apaas-custom-${moduleName}`)) fs.renameSync(path.resolve(staticPath, `apaas-custom-${demoCustomModuleName}`), path.resolve(staticPath, `apaas-custom-${moduleName}`))
} }
module.exports = init module.exports = init
init({ moduleName : 'nice' }, program) init({ moduleName : 'nice' }, program)

View File

@ -1,3 +1,3 @@
module.exports = { module.exports = {
extends: ['@commitlint/config-conventional'] extends: ['@commitlint/config-conventional']
} }

Binary file not shown.

View File

@ -0,0 +1,10 @@
<meta charset="utf-8">
<title>0971f994c95754494ad9b508d6916c39 demo</title>
<script src="./0971f994c95754494ad9b508d6916c39.umd.js"></script>
<link rel="stylesheet" href="./0971f994c95754494ad9b508d6916c39.css">
<script>
console.log(0971f994c95754494ad9b508d6916c39)
</script>

View File

@ -0,0 +1,279 @@
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "fb15");
/******/ })
/************************************************************************/
/******/ ({
/***/ "8875":
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
// MIT license
// source: https://github.com/amiller-gh/currentScript-polyfill
// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
(function (root, factory) {
if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {}
}(typeof self !== 'undefined' ? self : this, function () {
function getCurrentScript () {
var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
// for chrome
if (!descriptor && 'currentScript' in document && document.currentScript) {
return document.currentScript
}
// for other browsers with native support for currentScript
if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
return document.currentScript
}
// IE 8-10 support script readyState
// IE 11+ & Firefox support stack trace
try {
throw new Error();
}
catch (err) {
// Find the second match for the "at" string to get file src url from stack.
var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
scriptLocation = (stackDetails && stackDetails[1]) || false,
line = (stackDetails && stackDetails[2]) || false,
currentLocation = document.location.href.replace(document.location.hash, ''),
pageSource,
inlineScriptSourceRegExp,
inlineScriptSource,
scripts = document.getElementsByTagName('script'); // Live NodeList collection
if (scriptLocation === currentLocation) {
pageSource = document.documentElement.outerHTML;
inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
}
for (var i = 0; i < scripts.length; i++) {
// If ready state is interactive, return the script tag
if (scripts[i].readyState === 'interactive') {
return scripts[i];
}
// If src matches, return the script tag
if (scripts[i].src === scriptLocation) {
return scripts[i];
}
// If inline source matches, return the script tag
if (
scriptLocation === currentLocation &&
scripts[i].innerHTML &&
scripts[i].innerHTML.trim() === inlineScriptSource
) {
return scripts[i];
}
}
// If no match, return null
return null;
}
};
return getCurrentScript
}));
/***/ }),
/***/ "fb15":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
// This file is imported into lib/wc client bundles.
if (typeof window !== 'undefined') {
var currentScript = window.document.currentScript
if (true) {
var getCurrentScript = __webpack_require__("8875")
currentScript = getCurrentScript()
// for backward compatibility, because previously we directly included the polyfill
if (!('currentScript' in document)) {
Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
}
}
var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
if (src) {
__webpack_require__.p = src[1] // eslint-disable-line
}
}
// Indicate to webpack that this file can be concatenated
/* harmony default export */ var setPublicPath = (null);
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/cubic/cubic.js
/*
* cubic函数
* 求三次方
* 接收一个数字类型的参数并求其三次方并返回
*/
/* harmony default export */ var cubic = ({
// 函数名必须以custom开头否则无法被解析
name: 'customcubic',
// 校验函数,用于函数保存前的校验, 可以对参数的个数及类型做限制
mockFunction: function mockFunction() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (!(args && args.length === 1)) {
throw new Error('参数长度必须是1个');
}
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
throw new Error('参数类型必须是数字');
}
},
// 执行函数, 接收到参数后的处理方法,必须有返回值
executeFunction: function executeFunction() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
if (!(args && args.length === 1)) {
throw new Error('参数长度必须是1个');
}
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
throw new Error('参数类型必须是数字');
}
return args[0] * args[0] * args[0];
}
});
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/index.js
/* harmony default export */ var custom_functions = ({
Cubic: cubic
});
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/admin.js
var admin_install = function install(_ref, hookManager, definition) {
var RuleEngine = _ref.RuleEngine;
if (!RuleEngine) {
console.error('x-extension上下文中没有注册RuleEngine, 请检查');
return;
}
Object.keys(custom_functions).forEach(function (funcKey) {
var func = custom_functions[funcKey];
if (func && func.name && func.executeFunction && func.executeFunction instanceof Function) {
if (func.name.indexOf('custom') !== 0) {
console.error("\u81EA\u5B9A\u4E49\u51FD\u6570-".concat(func.name, " \u540D\u79F0\u6709\u8BEF\uFF0C\u8BF7\u4EE5custom\u5F00\u5934"));
return;
}
RuleEngine.getInstance().registerContextMethod(func.name, func);
} else {
console.error("\u8BF7\u68C0\u67E5".concat(func && func.name, "\u7684\u89C4\u5219\u51FD\u6570\u5B9A\u4E49"));
}
});
};
/* harmony default export */ var admin = ({
install: admin_install
});
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (admin);
/***/ })
/******/ });

View File

@ -0,0 +1,289 @@
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["0971f994c95754494ad9b508d6916c39"] = factory();
else
root["0971f994c95754494ad9b508d6916c39"] = factory();
})((typeof self !== 'undefined' ? self : this), function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "fb15");
/******/ })
/************************************************************************/
/******/ ({
/***/ "8875":
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
// MIT license
// source: https://github.com/amiller-gh/currentScript-polyfill
// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
(function (root, factory) {
if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {}
}(typeof self !== 'undefined' ? self : this, function () {
function getCurrentScript () {
var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
// for chrome
if (!descriptor && 'currentScript' in document && document.currentScript) {
return document.currentScript
}
// for other browsers with native support for currentScript
if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
return document.currentScript
}
// IE 8-10 support script readyState
// IE 11+ & Firefox support stack trace
try {
throw new Error();
}
catch (err) {
// Find the second match for the "at" string to get file src url from stack.
var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
scriptLocation = (stackDetails && stackDetails[1]) || false,
line = (stackDetails && stackDetails[2]) || false,
currentLocation = document.location.href.replace(document.location.hash, ''),
pageSource,
inlineScriptSourceRegExp,
inlineScriptSource,
scripts = document.getElementsByTagName('script'); // Live NodeList collection
if (scriptLocation === currentLocation) {
pageSource = document.documentElement.outerHTML;
inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
}
for (var i = 0; i < scripts.length; i++) {
// If ready state is interactive, return the script tag
if (scripts[i].readyState === 'interactive') {
return scripts[i];
}
// If src matches, return the script tag
if (scripts[i].src === scriptLocation) {
return scripts[i];
}
// If inline source matches, return the script tag
if (
scriptLocation === currentLocation &&
scripts[i].innerHTML &&
scripts[i].innerHTML.trim() === inlineScriptSource
) {
return scripts[i];
}
}
// If no match, return null
return null;
}
};
return getCurrentScript
}));
/***/ }),
/***/ "fb15":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
// This file is imported into lib/wc client bundles.
if (typeof window !== 'undefined') {
var currentScript = window.document.currentScript
if (true) {
var getCurrentScript = __webpack_require__("8875")
currentScript = getCurrentScript()
// for backward compatibility, because previously we directly included the polyfill
if (!('currentScript' in document)) {
Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
}
}
var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
if (src) {
__webpack_require__.p = src[1] // eslint-disable-line
}
}
// Indicate to webpack that this file can be concatenated
/* harmony default export */ var setPublicPath = (null);
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/cubic/cubic.js
/*
* cubic函数
* 求三次方
* 接收一个数字类型的参数并求其三次方并返回
*/
/* harmony default export */ var cubic = ({
// 函数名必须以custom开头否则无法被解析
name: 'customcubic',
// 校验函数,用于函数保存前的校验, 可以对参数的个数及类型做限制
mockFunction: function mockFunction() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (!(args && args.length === 1)) {
throw new Error('参数长度必须是1个');
}
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
throw new Error('参数类型必须是数字');
}
},
// 执行函数, 接收到参数后的处理方法,必须有返回值
executeFunction: function executeFunction() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
if (!(args && args.length === 1)) {
throw new Error('参数长度必须是1个');
}
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
throw new Error('参数类型必须是数字');
}
return args[0] * args[0] * args[0];
}
});
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/index.js
/* harmony default export */ var custom_functions = ({
Cubic: cubic
});
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/admin.js
var admin_install = function install(_ref, hookManager, definition) {
var RuleEngine = _ref.RuleEngine;
if (!RuleEngine) {
console.error('x-extension上下文中没有注册RuleEngine, 请检查');
return;
}
Object.keys(custom_functions).forEach(function (funcKey) {
var func = custom_functions[funcKey];
if (func && func.name && func.executeFunction && func.executeFunction instanceof Function) {
if (func.name.indexOf('custom') !== 0) {
console.error("\u81EA\u5B9A\u4E49\u51FD\u6570-".concat(func.name, " \u540D\u79F0\u6709\u8BEF\uFF0C\u8BF7\u4EE5custom\u5F00\u5934"));
return;
}
RuleEngine.getInstance().registerContextMethod(func.name, func);
} else {
console.error("\u8BF7\u68C0\u67E5".concat(func && func.name, "\u7684\u89C4\u5219\u51FD\u6570\u5B9A\u4E49"));
}
});
};
/* harmony default export */ var admin = ({
install: admin_install
});
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (admin);
/***/ })
/******/ });
});

View File

@ -0,0 +1 @@
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["0971f994c95754494ad9b508d6916c39"]=t():e["0971f994c95754494ad9b508d6916c39"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({8875:function(e,t,n){var r,o,c;(function(n,i){o=[],r=i,c="function"===typeof r?r.apply(t,o):r,void 0===c||(e.exports=c)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(p){var n,r,o,c=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,i=/@([^@]*):(\d+):(\d+)\s*$/gi,u=c.exec(p.stack)||i.exec(p.stack),f=u&&u[1]||!1,a=u&&u[2]||!1,d=document.location.href.replace(document.location.hash,""),l=document.getElementsByTagName("script");f===d&&(n=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(a-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),o=n.replace(r,"$1").trim());for(var s=0;s<l.length;s++){if("interactive"===l[s].readyState)return l[s];if(l[s].src===f)return l[s];if(f===d&&l[s].innerHTML&&l[s].innerHTML.trim()===o)return l[s]}return null}}return e}))},fb15:function(e,t,n){"use strict";if(n.r(t),"undefined"!==typeof window){var r=window.document.currentScript,o=n("8875");r=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var c=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);c&&(n.p=c[1])}var i={name:"customcubic",mockFunction:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t||1!==t.length)throw new Error("参数长度必须是1个");if(isNaN(parseFloat(t[0]))||!isFinite(t[0]))throw new Error("参数类型必须是数字")},executeFunction:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t||1!==t.length)throw new Error("参数长度必须是1个");if(isNaN(parseFloat(t[0]))||!isFinite(t[0]))throw new Error("参数类型必须是数字");return t[0]*t[0]*t[0]}},u={Cubic:i},f=function(e,t,n){var r=e.RuleEngine;r?Object.keys(u).forEach((function(e){var t=u[e];if(t&&t.name&&t.executeFunction&&t.executeFunction instanceof Function){if(0!==t.name.indexOf("custom"))return void console.error("自定义函数-".concat(t.name," 名称有误请以custom开头"));r.getInstance().registerContextMethod(t.name,t)}else console.error("请检查".concat(t&&t.name,"的规则函数定义"))})):console.error("x-extension上下文中没有注册RuleEngine, 请检查")},a={install:f};t["default"]=a}})}));

View File

@ -0,0 +1,16 @@
{
"copyAssets": [
"public/custom/apaas-custom-plugin-custom-rule"
],
"code": "PLUGIN_CUSTOM_RULE",
"name": "自开发规则",
"description": "自开发规则集成",
"extraConfig": {
"admin": true,
"adminCss": false,
"app": true,
"appCss": false,
"mobile": true,
"mobileCss": false
}
}

View File

@ -0,0 +1,10 @@
<meta charset="utf-8">
<title>0971f994c95754494ad9b508d6916c39 demo</title>
<script src="./0971f994c95754494ad9b508d6916c39.umd.js"></script>
<link rel="stylesheet" href="./0971f994c95754494ad9b508d6916c39.css">
<script>
console.log(0971f994c95754494ad9b508d6916c39)
</script>

View File

@ -0,0 +1,279 @@
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "fb15");
/******/ })
/************************************************************************/
/******/ ({
/***/ "8875":
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
// MIT license
// source: https://github.com/amiller-gh/currentScript-polyfill
// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
(function (root, factory) {
if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {}
}(typeof self !== 'undefined' ? self : this, function () {
function getCurrentScript () {
var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
// for chrome
if (!descriptor && 'currentScript' in document && document.currentScript) {
return document.currentScript
}
// for other browsers with native support for currentScript
if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
return document.currentScript
}
// IE 8-10 support script readyState
// IE 11+ & Firefox support stack trace
try {
throw new Error();
}
catch (err) {
// Find the second match for the "at" string to get file src url from stack.
var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
scriptLocation = (stackDetails && stackDetails[1]) || false,
line = (stackDetails && stackDetails[2]) || false,
currentLocation = document.location.href.replace(document.location.hash, ''),
pageSource,
inlineScriptSourceRegExp,
inlineScriptSource,
scripts = document.getElementsByTagName('script'); // Live NodeList collection
if (scriptLocation === currentLocation) {
pageSource = document.documentElement.outerHTML;
inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
}
for (var i = 0; i < scripts.length; i++) {
// If ready state is interactive, return the script tag
if (scripts[i].readyState === 'interactive') {
return scripts[i];
}
// If src matches, return the script tag
if (scripts[i].src === scriptLocation) {
return scripts[i];
}
// If inline source matches, return the script tag
if (
scriptLocation === currentLocation &&
scripts[i].innerHTML &&
scripts[i].innerHTML.trim() === inlineScriptSource
) {
return scripts[i];
}
}
// If no match, return null
return null;
}
};
return getCurrentScript
}));
/***/ }),
/***/ "fb15":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
// This file is imported into lib/wc client bundles.
if (typeof window !== 'undefined') {
var currentScript = window.document.currentScript
if (true) {
var getCurrentScript = __webpack_require__("8875")
currentScript = getCurrentScript()
// for backward compatibility, because previously we directly included the polyfill
if (!('currentScript' in document)) {
Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
}
}
var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
if (src) {
__webpack_require__.p = src[1] // eslint-disable-line
}
}
// Indicate to webpack that this file can be concatenated
/* harmony default export */ var setPublicPath = (null);
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/cubic/cubic.js
/*
* cubic函数
* 求三次方
* 接收一个数字类型的参数并求其三次方并返回
*/
/* harmony default export */ var cubic = ({
// 函数名必须以custom开头否则无法被解析
name: 'customcubic',
// 校验函数,用于函数保存前的校验, 可以对参数的个数及类型做限制
mockFunction: function mockFunction() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (!(args && args.length === 1)) {
throw new Error('参数长度必须是1个');
}
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
throw new Error('参数类型必须是数字');
}
},
// 执行函数, 接收到参数后的处理方法,必须有返回值
executeFunction: function executeFunction() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
if (!(args && args.length === 1)) {
throw new Error('参数长度必须是1个');
}
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
throw new Error('参数类型必须是数字');
}
return args[0] * args[0] * args[0];
}
});
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/index.js
/* harmony default export */ var custom_functions = ({
Cubic: cubic
});
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/app.js
var app_install = function install(_ref, hookManager, definition) {
var RuleEngine = _ref.RuleEngine;
if (!RuleEngine) {
console.error('x-extension上下文中没有注册RuleEngine, 请检查');
return;
}
Object.keys(custom_functions).forEach(function (funcKey) {
var func = custom_functions[funcKey];
if (func && func.name && func.executeFunction && func.executeFunction instanceof Function) {
if (func.name.indexOf('custom') !== 0) {
console.error("\u81EA\u5B9A\u4E49\u51FD\u6570-".concat(func.name, " \u540D\u79F0\u6709\u8BEF\uFF0C\u8BF7\u4EE5custom\u5F00\u5934"));
return;
}
RuleEngine.getInstance().registerContextMethod(func.name, func);
} else {
console.error("\u8BF7\u68C0\u67E5".concat(func && func.name, "\u7684\u89C4\u5219\u51FD\u6570\u5B9A\u4E49"));
}
});
};
/* harmony default export */ var app = ({
install: app_install
});
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (app);
/***/ })
/******/ });

View File

@ -0,0 +1,289 @@
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["0971f994c95754494ad9b508d6916c39"] = factory();
else
root["0971f994c95754494ad9b508d6916c39"] = factory();
})((typeof self !== 'undefined' ? self : this), function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "fb15");
/******/ })
/************************************************************************/
/******/ ({
/***/ "8875":
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
// MIT license
// source: https://github.com/amiller-gh/currentScript-polyfill
// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
(function (root, factory) {
if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {}
}(typeof self !== 'undefined' ? self : this, function () {
function getCurrentScript () {
var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
// for chrome
if (!descriptor && 'currentScript' in document && document.currentScript) {
return document.currentScript
}
// for other browsers with native support for currentScript
if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
return document.currentScript
}
// IE 8-10 support script readyState
// IE 11+ & Firefox support stack trace
try {
throw new Error();
}
catch (err) {
// Find the second match for the "at" string to get file src url from stack.
var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
scriptLocation = (stackDetails && stackDetails[1]) || false,
line = (stackDetails && stackDetails[2]) || false,
currentLocation = document.location.href.replace(document.location.hash, ''),
pageSource,
inlineScriptSourceRegExp,
inlineScriptSource,
scripts = document.getElementsByTagName('script'); // Live NodeList collection
if (scriptLocation === currentLocation) {
pageSource = document.documentElement.outerHTML;
inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
}
for (var i = 0; i < scripts.length; i++) {
// If ready state is interactive, return the script tag
if (scripts[i].readyState === 'interactive') {
return scripts[i];
}
// If src matches, return the script tag
if (scripts[i].src === scriptLocation) {
return scripts[i];
}
// If inline source matches, return the script tag
if (
scriptLocation === currentLocation &&
scripts[i].innerHTML &&
scripts[i].innerHTML.trim() === inlineScriptSource
) {
return scripts[i];
}
}
// If no match, return null
return null;
}
};
return getCurrentScript
}));
/***/ }),
/***/ "fb15":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
// This file is imported into lib/wc client bundles.
if (typeof window !== 'undefined') {
var currentScript = window.document.currentScript
if (true) {
var getCurrentScript = __webpack_require__("8875")
currentScript = getCurrentScript()
// for backward compatibility, because previously we directly included the polyfill
if (!('currentScript' in document)) {
Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
}
}
var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
if (src) {
__webpack_require__.p = src[1] // eslint-disable-line
}
}
// Indicate to webpack that this file can be concatenated
/* harmony default export */ var setPublicPath = (null);
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/cubic/cubic.js
/*
* cubic函数
* 求三次方
* 接收一个数字类型的参数并求其三次方并返回
*/
/* harmony default export */ var cubic = ({
// 函数名必须以custom开头否则无法被解析
name: 'customcubic',
// 校验函数,用于函数保存前的校验, 可以对参数的个数及类型做限制
mockFunction: function mockFunction() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (!(args && args.length === 1)) {
throw new Error('参数长度必须是1个');
}
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
throw new Error('参数类型必须是数字');
}
},
// 执行函数, 接收到参数后的处理方法,必须有返回值
executeFunction: function executeFunction() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
if (!(args && args.length === 1)) {
throw new Error('参数长度必须是1个');
}
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
throw new Error('参数类型必须是数字');
}
return args[0] * args[0] * args[0];
}
});
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/index.js
/* harmony default export */ var custom_functions = ({
Cubic: cubic
});
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/app.js
var app_install = function install(_ref, hookManager, definition) {
var RuleEngine = _ref.RuleEngine;
if (!RuleEngine) {
console.error('x-extension上下文中没有注册RuleEngine, 请检查');
return;
}
Object.keys(custom_functions).forEach(function (funcKey) {
var func = custom_functions[funcKey];
if (func && func.name && func.executeFunction && func.executeFunction instanceof Function) {
if (func.name.indexOf('custom') !== 0) {
console.error("\u81EA\u5B9A\u4E49\u51FD\u6570-".concat(func.name, " \u540D\u79F0\u6709\u8BEF\uFF0C\u8BF7\u4EE5custom\u5F00\u5934"));
return;
}
RuleEngine.getInstance().registerContextMethod(func.name, func);
} else {
console.error("\u8BF7\u68C0\u67E5".concat(func && func.name, "\u7684\u89C4\u5219\u51FD\u6570\u5B9A\u4E49"));
}
});
};
/* harmony default export */ var app = ({
install: app_install
});
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (app);
/***/ })
/******/ });
});

View File

@ -0,0 +1 @@
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["0971f994c95754494ad9b508d6916c39"]=t():e["0971f994c95754494ad9b508d6916c39"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({8875:function(e,t,n){var r,o,c;(function(n,i){o=[],r=i,c="function"===typeof r?r.apply(t,o):r,void 0===c||(e.exports=c)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(p){var n,r,o,c=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,i=/@([^@]*):(\d+):(\d+)\s*$/gi,u=c.exec(p.stack)||i.exec(p.stack),f=u&&u[1]||!1,a=u&&u[2]||!1,d=document.location.href.replace(document.location.hash,""),l=document.getElementsByTagName("script");f===d&&(n=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(a-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),o=n.replace(r,"$1").trim());for(var s=0;s<l.length;s++){if("interactive"===l[s].readyState)return l[s];if(l[s].src===f)return l[s];if(f===d&&l[s].innerHTML&&l[s].innerHTML.trim()===o)return l[s]}return null}}return e}))},fb15:function(e,t,n){"use strict";if(n.r(t),"undefined"!==typeof window){var r=window.document.currentScript,o=n("8875");r=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var c=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);c&&(n.p=c[1])}var i={name:"customcubic",mockFunction:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t||1!==t.length)throw new Error("参数长度必须是1个");if(isNaN(parseFloat(t[0]))||!isFinite(t[0]))throw new Error("参数类型必须是数字")},executeFunction:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t||1!==t.length)throw new Error("参数长度必须是1个");if(isNaN(parseFloat(t[0]))||!isFinite(t[0]))throw new Error("参数类型必须是数字");return t[0]*t[0]*t[0]}},u={Cubic:i},f=function(e,t,n){var r=e.RuleEngine;r?Object.keys(u).forEach((function(e){var t=u[e];if(t&&t.name&&t.executeFunction&&t.executeFunction instanceof Function){if(0!==t.name.indexOf("custom"))return void console.error("自定义函数-".concat(t.name," 名称有误请以custom开头"));r.getInstance().registerContextMethod(t.name,t)}else console.error("请检查".concat(t&&t.name,"的规则函数定义"))})):console.error("x-extension上下文中没有注册RuleEngine, 请检查")},a={install:f};t["default"]=a}})}));

View File

@ -0,0 +1,10 @@
<meta charset="utf-8">
<title>0971f994c95754494ad9b508d6916c39 demo</title>
<script src="./0971f994c95754494ad9b508d6916c39.umd.js"></script>
<link rel="stylesheet" href="./0971f994c95754494ad9b508d6916c39.css">
<script>
console.log(0971f994c95754494ad9b508d6916c39)
</script>

View File

@ -0,0 +1,279 @@
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "fb15");
/******/ })
/************************************************************************/
/******/ ({
/***/ "8875":
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
// MIT license
// source: https://github.com/amiller-gh/currentScript-polyfill
// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
(function (root, factory) {
if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {}
}(typeof self !== 'undefined' ? self : this, function () {
function getCurrentScript () {
var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
// for chrome
if (!descriptor && 'currentScript' in document && document.currentScript) {
return document.currentScript
}
// for other browsers with native support for currentScript
if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
return document.currentScript
}
// IE 8-10 support script readyState
// IE 11+ & Firefox support stack trace
try {
throw new Error();
}
catch (err) {
// Find the second match for the "at" string to get file src url from stack.
var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
scriptLocation = (stackDetails && stackDetails[1]) || false,
line = (stackDetails && stackDetails[2]) || false,
currentLocation = document.location.href.replace(document.location.hash, ''),
pageSource,
inlineScriptSourceRegExp,
inlineScriptSource,
scripts = document.getElementsByTagName('script'); // Live NodeList collection
if (scriptLocation === currentLocation) {
pageSource = document.documentElement.outerHTML;
inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
}
for (var i = 0; i < scripts.length; i++) {
// If ready state is interactive, return the script tag
if (scripts[i].readyState === 'interactive') {
return scripts[i];
}
// If src matches, return the script tag
if (scripts[i].src === scriptLocation) {
return scripts[i];
}
// If inline source matches, return the script tag
if (
scriptLocation === currentLocation &&
scripts[i].innerHTML &&
scripts[i].innerHTML.trim() === inlineScriptSource
) {
return scripts[i];
}
}
// If no match, return null
return null;
}
};
return getCurrentScript
}));
/***/ }),
/***/ "fb15":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
// This file is imported into lib/wc client bundles.
if (typeof window !== 'undefined') {
var currentScript = window.document.currentScript
if (true) {
var getCurrentScript = __webpack_require__("8875")
currentScript = getCurrentScript()
// for backward compatibility, because previously we directly included the polyfill
if (!('currentScript' in document)) {
Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
}
}
var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
if (src) {
__webpack_require__.p = src[1] // eslint-disable-line
}
}
// Indicate to webpack that this file can be concatenated
/* harmony default export */ var setPublicPath = (null);
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/cubic/cubic.js
/*
* cubic函数
* 求三次方
* 接收一个数字类型的参数并求其三次方并返回
*/
/* harmony default export */ var cubic = ({
// 函数名必须以custom开头否则无法被解析
name: 'customcubic',
// 校验函数,用于函数保存前的校验, 可以对参数的个数及类型做限制
mockFunction: function mockFunction() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (!(args && args.length === 1)) {
throw new Error('参数长度必须是1个');
}
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
throw new Error('参数类型必须是数字');
}
},
// 执行函数, 接收到参数后的处理方法,必须有返回值
executeFunction: function executeFunction() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
if (!(args && args.length === 1)) {
throw new Error('参数长度必须是1个');
}
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
throw new Error('参数类型必须是数字');
}
return args[0] * args[0] * args[0];
}
});
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/index.js
/* harmony default export */ var custom_functions = ({
Cubic: cubic
});
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/mobile.js
var mobile_install = function install(_ref, hookManager, definition) {
var RuleEngine = _ref.RuleEngine;
if (!RuleEngine) {
console.error('x-extension上下文中没有注册RuleEngine, 请检查');
return;
}
Object.keys(custom_functions).forEach(function (funcKey) {
var func = custom_functions[funcKey];
if (func && func.name && func.executeFunction && func.executeFunction instanceof Function) {
if (func.name.indexOf('custom') !== 0) {
console.error("\u81EA\u5B9A\u4E49\u51FD\u6570-".concat(func.name, " \u540D\u79F0\u6709\u8BEF\uFF0C\u8BF7\u4EE5custom\u5F00\u5934"));
return;
}
RuleEngine.getInstance().registerContextMethod(func.name, func);
} else {
console.error("\u8BF7\u68C0\u67E5".concat(func && func.name, "\u7684\u89C4\u5219\u51FD\u6570\u5B9A\u4E49"));
}
});
};
/* harmony default export */ var mobile = ({
install: mobile_install
});
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (mobile);
/***/ })
/******/ });

View File

@ -0,0 +1,289 @@
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["0971f994c95754494ad9b508d6916c39"] = factory();
else
root["0971f994c95754494ad9b508d6916c39"] = factory();
})((typeof self !== 'undefined' ? self : this), function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "fb15");
/******/ })
/************************************************************************/
/******/ ({
/***/ "8875":
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
// MIT license
// source: https://github.com/amiller-gh/currentScript-polyfill
// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
(function (root, factory) {
if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {}
}(typeof self !== 'undefined' ? self : this, function () {
function getCurrentScript () {
var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
// for chrome
if (!descriptor && 'currentScript' in document && document.currentScript) {
return document.currentScript
}
// for other browsers with native support for currentScript
if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
return document.currentScript
}
// IE 8-10 support script readyState
// IE 11+ & Firefox support stack trace
try {
throw new Error();
}
catch (err) {
// Find the second match for the "at" string to get file src url from stack.
var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
scriptLocation = (stackDetails && stackDetails[1]) || false,
line = (stackDetails && stackDetails[2]) || false,
currentLocation = document.location.href.replace(document.location.hash, ''),
pageSource,
inlineScriptSourceRegExp,
inlineScriptSource,
scripts = document.getElementsByTagName('script'); // Live NodeList collection
if (scriptLocation === currentLocation) {
pageSource = document.documentElement.outerHTML;
inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
}
for (var i = 0; i < scripts.length; i++) {
// If ready state is interactive, return the script tag
if (scripts[i].readyState === 'interactive') {
return scripts[i];
}
// If src matches, return the script tag
if (scripts[i].src === scriptLocation) {
return scripts[i];
}
// If inline source matches, return the script tag
if (
scriptLocation === currentLocation &&
scripts[i].innerHTML &&
scripts[i].innerHTML.trim() === inlineScriptSource
) {
return scripts[i];
}
}
// If no match, return null
return null;
}
};
return getCurrentScript
}));
/***/ }),
/***/ "fb15":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
// This file is imported into lib/wc client bundles.
if (typeof window !== 'undefined') {
var currentScript = window.document.currentScript
if (true) {
var getCurrentScript = __webpack_require__("8875")
currentScript = getCurrentScript()
// for backward compatibility, because previously we directly included the polyfill
if (!('currentScript' in document)) {
Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
}
}
var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
if (src) {
__webpack_require__.p = src[1] // eslint-disable-line
}
}
// Indicate to webpack that this file can be concatenated
/* harmony default export */ var setPublicPath = (null);
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/cubic/cubic.js
/*
* cubic函数
* 求三次方
* 接收一个数字类型的参数并求其三次方并返回
*/
/* harmony default export */ var cubic = ({
// 函数名必须以custom开头否则无法被解析
name: 'customcubic',
// 校验函数,用于函数保存前的校验, 可以对参数的个数及类型做限制
mockFunction: function mockFunction() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (!(args && args.length === 1)) {
throw new Error('参数长度必须是1个');
}
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
throw new Error('参数类型必须是数字');
}
},
// 执行函数, 接收到参数后的处理方法,必须有返回值
executeFunction: function executeFunction() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
if (!(args && args.length === 1)) {
throw new Error('参数长度必须是1个');
}
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
throw new Error('参数类型必须是数字');
}
return args[0] * args[0] * args[0];
}
});
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/index.js
/* harmony default export */ var custom_functions = ({
Cubic: cubic
});
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/mobile.js
var mobile_install = function install(_ref, hookManager, definition) {
var RuleEngine = _ref.RuleEngine;
if (!RuleEngine) {
console.error('x-extension上下文中没有注册RuleEngine, 请检查');
return;
}
Object.keys(custom_functions).forEach(function (funcKey) {
var func = custom_functions[funcKey];
if (func && func.name && func.executeFunction && func.executeFunction instanceof Function) {
if (func.name.indexOf('custom') !== 0) {
console.error("\u81EA\u5B9A\u4E49\u51FD\u6570-".concat(func.name, " \u540D\u79F0\u6709\u8BEF\uFF0C\u8BF7\u4EE5custom\u5F00\u5934"));
return;
}
RuleEngine.getInstance().registerContextMethod(func.name, func);
} else {
console.error("\u8BF7\u68C0\u67E5".concat(func && func.name, "\u7684\u89C4\u5219\u51FD\u6570\u5B9A\u4E49"));
}
});
};
/* harmony default export */ var mobile = ({
install: mobile_install
});
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (mobile);
/***/ })
/******/ });
});

View File

@ -0,0 +1 @@
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["0971f994c95754494ad9b508d6916c39"]=t():e["0971f994c95754494ad9b508d6916c39"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({8875:function(e,t,n){var r,o,c;(function(n,i){o=[],r=i,c="function"===typeof r?r.apply(t,o):r,void 0===c||(e.exports=c)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(p){var n,r,o,c=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,i=/@([^@]*):(\d+):(\d+)\s*$/gi,u=c.exec(p.stack)||i.exec(p.stack),f=u&&u[1]||!1,a=u&&u[2]||!1,d=document.location.href.replace(document.location.hash,""),l=document.getElementsByTagName("script");f===d&&(n=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(a-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),o=n.replace(r,"$1").trim());for(var s=0;s<l.length;s++){if("interactive"===l[s].readyState)return l[s];if(l[s].src===f)return l[s];if(f===d&&l[s].innerHTML&&l[s].innerHTML.trim()===o)return l[s]}return null}}return e}))},fb15:function(e,t,n){"use strict";if(n.r(t),"undefined"!==typeof window){var r=window.document.currentScript,o=n("8875");r=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var c=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);c&&(n.p=c[1])}var i={name:"customcubic",mockFunction:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t||1!==t.length)throw new Error("参数长度必须是1个");if(isNaN(parseFloat(t[0]))||!isFinite(t[0]))throw new Error("参数类型必须是数字")},executeFunction:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t||1!==t.length)throw new Error("参数长度必须是1个");if(isNaN(parseFloat(t[0]))||!isFinite(t[0]))throw new Error("参数类型必须是数字");return t[0]*t[0]*t[0]}},u={Cubic:i},f=function(e,t,n){var r=e.RuleEngine;r?Object.keys(u).forEach((function(e){var t=u[e];if(t&&t.name&&t.executeFunction&&t.executeFunction instanceof Function){if(0!==t.name.indexOf("custom"))return void console.error("自定义函数-".concat(t.name," 名称有误请以custom开头"));r.getInstance().registerContextMethod(t.name,t)}else console.error("请检查".concat(t&&t.name,"的规则函数定义"))})):console.error("x-extension上下文中没有注册RuleEngine, 请检查")},a={install:f};t["default"]=a}})}));

View File

@ -1,9 +1,9 @@
module.exports = { module.exports = {
preset: '@vue/cli-plugin-unit-jest', preset: '@vue/cli-plugin-unit-jest',
moduleNameMapper: { moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1', '^@/(.*)$': '<rootDir>/src/$1',
'^@examples/(.*)$': '<rootDir>/examples/$1', '^@examples/(.*)$': '<rootDir>/examples/$1',
'^@packages/(.*)$': '<rootDir>/packages/$1', '^@packages/(.*)$': '<rootDir>/packages/$1',
'\\.(css|less|sass)$': 'identity-obj-proxy' '\\.(css|less|sass)$': 'identity-obj-proxy'
} }
} }

35598
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,88 +1,89 @@
{ {
"name": "x-project-app", "name": "x-project-app",
"version": "0.0.1", "version": "0.0.1",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"inspect": "vue-cli-service inspect", "inspect": "vue-cli-service inspect",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"test:unit": "vue-cli-service test:unit", "test:unit": "vue-cli-service test:unit",
"test:e2e": "vue-cli-service test:e2e", "test:e2e": "vue-cli-service test:e2e",
"lint": "vue-cli-service lint --fix", "lint": "vue-cli-service lint --fix",
"build-rule": "node ./build/build-plugins.js rule-functions -c", "build-rule": "node ./build/build-plugins.js rule-functions -c",
"cm": "git-cz" "cm": "git-cz"
}, },
"dependencies": { "dependencies": {
"@x-ui/x-dcloud-ui": "^0.2.1", "@x-apaas/x-apaas-cli": "0.0.17",
"@x-apaas/x-dcloud-page-web": "rc", "@x-apaas/x-apaas-frontend-i18n": "rc",
"@x-apaas/x-dcloud-page-engine": "rc", "@x-apaas/x-dcloud-page-engine": "rc",
"@x-apaas/x-apaas-frontend-i18n": "rc", "@x-apaas/x-dcloud-page-web": "rc",
"core-js": "^3.6.4", "@x-ui/x-dcloud-ui": "^0.2.1",
"dayjs": "^1.8.27", "core-js": "^3.6.4",
"element-ui": "^2.13.2", "dayjs": "^1.8.27",
"js-file-download": "^0.4.12", "echarts": "^5.6.0",
"lodash-es": "^4.17.21", "element-ui": "^2.13.2",
"md5": "^2.3.0", "js-file-download": "^0.4.12",
"normalize.css": "^8.0.1", "lodash-es": "^4.17.21",
"register-service-worker": "^1.7.1", "md5": "^2.3.0",
"vue": "^2.6.11", "normalize.css": "^8.0.1",
"vue-router": "^3.1.6", "register-service-worker": "^1.7.1",
"vuex": "^3.1.3", "vue": "^2.6.11",
"vuex-persist": "^2.2.0", "vue-router": "^3.1.6",
"x-extension": "^0.2.2" "vuex": "^3.1.3",
}, "vuex-persist": "^2.2.0",
"devDependencies": { "x-extension": "^0.2.2"
"@babel/polyfill": "^7.8.7", },
"@commitlint/cli": "^8.3.5", "devDependencies": {
"@commitlint/config-conventional": "^8.3.4", "@babel/polyfill": "^7.8.7",
"@vue/cli-plugin-babel": "^4.3.0", "@commitlint/cli": "^8.3.5",
"@vue/cli-plugin-e2e-nightwatch": "^4.3.0", "@commitlint/config-conventional": "^8.3.4",
"@vue/cli-plugin-eslint": "^4.3.0", "@vue/cli-plugin-babel": "^4.3.0",
"@vue/cli-plugin-pwa": "^4.3.0", "@vue/cli-plugin-e2e-nightwatch": "^4.3.0",
"@vue/cli-plugin-router": "^4.3.0", "@vue/cli-plugin-eslint": "^4.3.0",
"@vue/cli-plugin-unit-jest": "^4.3.0", "@vue/cli-plugin-pwa": "^4.3.0",
"@vue/cli-plugin-vuex": "^4.3.0", "@vue/cli-plugin-router": "^4.3.0",
"@vue/cli-service": "^4.3.0", "@vue/cli-plugin-unit-jest": "^4.3.0",
"@vue/eslint-config-prettier": "^6.0.0", "@vue/cli-plugin-vuex": "^4.3.0",
"@vue/eslint-config-standard": "^4.0.0", "@vue/cli-service": "^4.3.0",
"@vue/test-utils": "1.0.0-beta.31", "@vue/eslint-config-prettier": "^6.0.0",
"babel-eslint": "^10.1.0", "@vue/test-utils": "1.0.0-beta.31",
"babel-plugin-component": "^1.1.1", "babel-eslint": "^10.1.0",
"colors": "^1.4.0", "babel-plugin-component": "^1.1.1",
"commitizen": "^4.1.2", "colors": "^1.4.0",
"commitlint-config-cz": "^0.13.1", "commitizen": "^4.1.2",
"conventional-changelog-cli": "^2.0.34", "commitlint-config-cz": "^0.13.1",
"cz-conventional-changelog": "^3.2.0", "conventional-changelog-cli": "^2.0.34",
"cz-customizable": "^6.2.0", "cz-conventional-changelog": "^3.2.0",
"eslint": "^6.7.2", "cz-customizable": "^6.2.0",
"eslint-plugin-prettier": "^3.1.1", "eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2", "eslint-html-reporter": "^0.7.4",
"husky": "^4.2.5", "eslint-plugin-prettier": "^3.1.1",
"lint-staged": "^9.5.0", "eslint-plugin-vue": "^6.2.2",
"node-sass": "^4.12.0", "husky": "^4.2.5",
"path": "^0.12.7", "lint-staged": "^9.5.0",
"prettier": "^1.19.1", "path": "^0.12.7",
"progress-bar-webpack-plugin": "^2.1.0", "prettier": "^1.19.1",
"sass-loader": "^8.0.2", "progress-bar-webpack-plugin": "^2.1.0",
"sass-resources-loader": "^2.0.3", "sass-loader": "^8.0.2",
"shelljs": "^0.8.4", "sass-resources-loader": "^2.0.3",
"svg-sprite-loader": "^5.0.0", "shelljs": "^0.8.4",
"vue-i18n": "^8.17.7", "svg-sprite-loader": "^5.0.0",
"vue-template-compiler": "^2.6.11", "vue-i18n": "^8.17.7",
"webpack-bundle-analyzer": "^3.8.0", "vue-template-compiler": "^2.6.11",
"webpack-theme-color-replacer": "^1.3.13", "webpack-bundle-analyzer": "^3.8.0",
"zip-local": "^0.3.4" "webpack-theme-color-replacer": "^1.3.13",
}, "zip-local": "^0.3.4"
"husky": { },
"hooks": { "husky": {
"pre-commit": "lint-staged", "hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS" "pre-commit": "lint-staged",
} "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}, }
"lint-staged": { },
"*.{js,jsx,vue}": [ "lint-staged": {
"vue-cli-service lint --fix", "*.{js,jsx,vue}": [
"git add" "vue-cli-service lint --fix",
] "git add"
} ]
} }
}

View File

@ -1,5 +1,5 @@
module.exports = { module.exports = {
plugins: { plugins: {
autoprefixer: {} autoprefixer: {}
} }
} }

View File

@ -1,13 +1,13 @@
module.exports = { module.exports = {
printWidth: 100, printWidth: 100,
tabWidth: 2, tabWidth: 2,
useTabs: false, useTabs: false,
semi: false, semi: false,
singleQuote: true, singleQuote: true,
bracketSpacing: true, bracketSpacing: true,
jsxBracketSameLine: false, jsxBracketSameLine: false,
arrowParens: 'always', arrowParens: 'always',
proseWrap: 'never', proseWrap: 'never',
htmlWhitespaceSensitivity: 'strict', htmlWhitespaceSensitivity: 'strict',
endOfLine: 'lf' endOfLine: 'lf'
} }

View File

@ -1,2 +1,2 @@
User-agent: * User-agent: *
Disallow: Disallow:

View File

@ -1,78 +1,78 @@
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2020-05-26 10:06:34 * @Date: 2020-05-26 10:06:34
* @LastEditTime: 2020-05-26 17:05:42 * @LastEditTime: 2020-05-26 17:05:42
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: /x-product-workspace/packages/x-project-app/src/App.vue * @FilePath: /x-product-workspace/packages/x-project-app/src/App.vue
--> -->
<template> <template>
<div id="app"> <div id="app">
<component :is="layout"> <component :is="layout">
<router-view /> <router-view />
</component> </component>
</div> </div>
</template> </template>
<script> <script>
import { mapMutations } from 'vuex' import { mapMutations } from 'vuex'
import { SET_USER_INFO } from '@/store/auth.store' import { SET_USER_INFO } from '@/store/auth.store'
import { initUserRole } from '@/utils/userRole' import { initUserRole } from '@/utils/userRole'
import BlackLayout from '@/layouts/black.layout' import BlackLayout from '@/layouts/black.layout'
import DefaultLayout from '@/layouts/default.layout' import DefaultLayout from '@/layouts/default.layout'
import NoSidebarLayout from '@/layouts/no-sidebar.layout' import NoSidebarLayout from '@/layouts/no-sidebar.layout'
export default { export default {
components: { components: {
BlackLayout, BlackLayout,
DefaultLayout, DefaultLayout,
NoSidebarLayout NoSidebarLayout
}, },
data() { data() {
return { return {
} }
}, },
computed: { computed: {
layout() { layout() {
return this.$route.meta.layout || 'DefaultLayout' return this.$route.meta.layout || 'DefaultLayout'
} }
}, },
created() { created() {
this.setUserInfo({ this.setUserInfo({
'loginName': 'admin', 'loginName': 'admin',
'id': '1', 'id': '1',
'phone': '17729389320', 'phone': '17729389320',
'email': '17728389320@163.com', 'email': '17728389320@163.com',
'enableStatus': 'ENABLED', 'enableStatus': 'ENABLED',
'headPortrait': null, 'headPortrait': null,
'userName': '赵站洋', 'userName': '赵站洋',
'credentialNo': '110101199003076675', 'credentialNo': '110101199003076675',
'gender': 'male' 'gender': 'male'
}) })
// localStorage.setItem('logedUser', '100771325211655012352') // localStorage.setItem('logedUser', '100771325211655012352')
}, },
mounted() { mounted() {
// //
this.$nextTick(() => { this.$nextTick(() => {
initUserRole(this).catch((err) => { initUserRole(this).catch((err) => {
console.error('初始化用户角色信息失败:', err) console.error('初始化用户角色信息失败:', err)
}) })
}) })
}, },
methods: { methods: {
...mapMutations('authModule', { ...mapMutations('authModule', {
setUserInfo: SET_USER_INFO setUserInfo: SET_USER_INFO
}) })
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
#app { #app {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
color: $--app-font-color; color: $--app-font-color;
background-color: $--app-bg-Color; background-color: $--app-bg-Color;
} }
</style> </style>

View File

@ -1,46 +1,46 @@
/* /*
* @Author: your name * @Author: your name
* @Date: 2020-05-30 16:05:14 * @Date: 2020-05-30 16:05:14
* @LastEditTime: 2020-05-30 19:20:52 * @LastEditTime: 2020-05-30 19:20:52
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: /x-product-workspace/packages/x-project-app/src/api/account/index.js * @FilePath: /x-product-workspace/packages/x-project-app/src/api/account/index.js
*/ */
export default { export default {
'USER_LOGIN': { // 用户登录 'USER_LOGIN': { // 用户登录
url: '/xdap-admin/user/login', url: '/xdap-admin/user/login',
method: 'post' method: 'post'
}, },
'USER_REGISTER': { // 用户注册 'USER_REGISTER': { // 用户注册
url: '/xdap-admin/user/register', url: '/xdap-admin/user/register',
method: 'post' method: 'post'
}, },
'USER_MODIFY_PASSWORD_BY_PHONE': { // 通过手机号修改密码 'USER_MODIFY_PASSWORD_BY_PHONE': { // 通过手机号修改密码
url: '/xdap-admin/user/find/password', url: '/xdap-admin/user/find/password',
method: 'post' method: 'post'
}, },
'CREATE_ORG': { // 创建组织 'CREATE_ORG': { // 创建组织
url: '/xdap-admin/tenant/add/newTenant', url: '/xdap-admin/tenant/add/newTenant',
method: 'post' method: 'post'
}, },
'JOIN_ORG': { 'JOIN_ORG': {
url: '/xdap-admin/tenant/join/tenant', url: '/xdap-admin/tenant/join/tenant',
method: 'get' method: 'get'
}, },
'SING_OUT': { 'SING_OUT': {
url: '/xdap-admin/user/signOut', url: '/xdap-admin/user/signOut',
method: 'get' method: 'get'
}, },
'UPDATE_USER_PHONE': { 'UPDATE_USER_PHONE': {
url: '/xdap-admin/user/update/userPhone', url: '/xdap-admin/user/update/userPhone',
method: 'post' method: 'post'
}, },
'UPDATE_USER_EMAIL': { 'UPDATE_USER_EMAIL': {
url: '/xdap-admin/user/update/userEmail', url: '/xdap-admin/user/update/userEmail',
method: 'post' method: 'post'
}, },
'IS_BELONG_TO_TENANT': { 'IS_BELONG_TO_TENANT': {
url: '/xdap-admin/tenant/query/isBelongToTenant', url: '/xdap-admin/tenant/query/isBelongToTenant',
method: 'get' method: 'get'
} }
} }

View File

@ -1,167 +1,167 @@
export default { export default {
// 获取组织列表 // 获取组织列表
QUERY_ORG_LIST_BY_NAME: { QUERY_ORG_LIST_BY_NAME: {
url: '/xdap-app/department/query/departmentListByName', url: '/xdap-app/department/query/departmentListByName',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 组织树 // 组织树
QUERY_ORG_TREE: { QUERY_ORG_TREE: {
url: '/xdap-app/department/query/departmentTree', url: '/xdap-app/department/query/departmentTree',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 新增部门 // 新增部门
ADD_AND_EDIT_ORG: { ADD_AND_EDIT_ORG: {
url: '/xdap-app/department/edit/department', url: '/xdap-app/department/edit/department',
method: 'post' method: 'post'
}, },
// 删除部门 // 删除部门
DELETE_ORG: { DELETE_ORG: {
url: '/xdap-app/department/remove/department', url: '/xdap-app/department/remove/department',
method: 'post' method: 'post'
}, },
// 根据节点查询成员 // 根据节点查询成员
QUERY_MEMBER_BY_ORG_ID: { QUERY_MEMBER_BY_ORG_ID: {
url: '/xdap-app/department/query/departmentMembers', url: '/xdap-app/department/query/departmentMembers',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
QUERY_ALL_MEMBER_BY_ORG_ID: { QUERY_ALL_MEMBER_BY_ORG_ID: {
url: '/xdap-app/department/queryAll/departmentMembers', url: '/xdap-app/department/queryAll/departmentMembers',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 上级部门值列表 // 上级部门值列表
QUERY_DEPARTMENT_LIST: { QUERY_DEPARTMENT_LIST: {
url: '/xdap-app/department/query/departmentList', url: '/xdap-app/department/query/departmentList',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 人员移出部门 // 人员移出部门
REMOVE_USER_FORM_ORG: { REMOVE_USER_FORM_ORG: {
url: '/xdap-app/department/remove/departmentMember', url: '/xdap-app/department/remove/departmentMember',
method: 'post' method: 'post'
}, },
// 批量移出zu // 批量移出zu
ALL_REMOVE_USER_FORM_ORG: { ALL_REMOVE_USER_FORM_ORG: {
url: '/xdap-app/department/batchRemove/departmentMember', url: '/xdap-app/department/batchRemove/departmentMember',
method: 'post' method: 'post'
}, },
// 人员移出组织 // 人员移出组织
REMOVE_USER_FORM_TENANT: { REMOVE_USER_FORM_TENANT: {
url: '/xdap-app/department/remove/tenantMember', url: '/xdap-app/department/remove/tenantMember',
method: 'post' method: 'post'
}, },
// 批量移出组织 // 批量移出组织
ALL_REMOVE_USER_FORM_TENANT: { ALL_REMOVE_USER_FORM_TENANT: {
url: '/xdap-app/department/batchRemove/tenantMember', url: '/xdap-app/department/batchRemove/tenantMember',
method: 'post' method: 'post'
}, },
// 修改在职/离职 // 修改在职/离职
CHANGE_WORK_STATUS: { CHANGE_WORK_STATUS: {
url: '/xdap-app/department/update/memberWorkStatus', url: '/xdap-app/department/update/memberWorkStatus',
method: 'post' method: 'post'
}, },
// 批量修改在职/离职 // 批量修改在职/离职
ALL_CHANGE_WORK_STATUS: { ALL_CHANGE_WORK_STATUS: {
url: '/xdap-app/department/batchUpdate/memberWorkStatus', url: '/xdap-app/department/batchUpdate/memberWorkStatus',
method: 'post' method: 'post'
}, },
// 邀请部分接口 // 邀请部分接口
QUERY_DATA_INVITE: { QUERY_DATA_INVITE: {
url: '/xdap-app/invitation/get/invitationCodeInfo', url: '/xdap-app/invitation/get/invitationCodeInfo',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 重新生成邀请码 // 重新生成邀请码
RELOAD_DATA_INVITE: { RELOAD_DATA_INVITE: {
url: '/xdap-app/invitation/generate/invitationCode', url: '/xdap-app/invitation/generate/invitationCode',
method: 'post' method: 'post'
}, },
SAVE_INVITE_CONFIG: { SAVE_INVITE_CONFIG: {
url: '/xdap-app/invitation/modify/invitationCode', url: '/xdap-app/invitation/modify/invitationCode',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 设置是否启用邀请码 // 设置是否启用邀请码
SHOW_INVITE_BY_STATUS: { SHOW_INVITE_BY_STATUS: {
url: '/xdap-app/invitation/update/invitationCodeStatus', url: '/xdap-app/invitation/update/invitationCodeStatus',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 组织树拖拽 // 组织树拖拽
TREE_NODE_MOVE: { TREE_NODE_MOVE: {
url: '/xdap-app/department/queue/departmentTree', url: '/xdap-app/department/queue/departmentTree',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 获取待审核条数 // 获取待审核条数
GET_AUDIT_COUNT: { GET_AUDIT_COUNT: {
url: '/xdap-app/invitation/count/approvingUsers', url: '/xdap-app/invitation/count/approvingUsers',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 获取待审核成员信息 // 获取待审核成员信息
QUERY_AUDIT_TABLE_DATA: { QUERY_AUDIT_TABLE_DATA: {
url: '/xdap-app/invitation/query/approvingUsers', url: '/xdap-app/invitation/query/approvingUsers',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 拒绝 // 拒绝
REFUSE_ADD_USER: { REFUSE_ADD_USER: {
url: '/xdap-app/invitation/refuse/approvingUser', url: '/xdap-app/invitation/refuse/approvingUser',
method: 'post' method: 'post'
}, },
// 同意 // 同意
AGREE_ADD_USER: { AGREE_ADD_USER: {
url: '/xdap-app/invitation/agree/approvingUser', url: '/xdap-app/invitation/agree/approvingUser',
method: 'post' method: 'post'
}, },
// 批量同意 // 批量同意
ALL_AGREE_ADD_USER: { ALL_AGREE_ADD_USER: {
url: '/xdap-app/invitation/batchAgree/approvingUser', url: '/xdap-app/invitation/batchAgree/approvingUser',
method: 'post' method: 'post'
}, },
// 批量拒绝 // 批量拒绝
ALL_REFUSE_ADD_USER: { ALL_REFUSE_ADD_USER: {
url: '/xdap-app/invitation/batchRefuse/approvingUser', url: '/xdap-app/invitation/batchRefuse/approvingUser',
method: 'post' method: 'post'
}, },
// 编辑成员信息 // 编辑成员信息
EDIT_USER_DATA: { EDIT_USER_DATA: {
url: '/xdap-app/department/update/memberInfo', url: '/xdap-app/department/update/memberInfo',
method: 'post' method: 'post'
}, },
DEPARTMENT_ADD_USERS: { DEPARTMENT_ADD_USERS: {
url: '/xdap-app/department/add/departmentMember', url: '/xdap-app/department/add/departmentMember',
method: 'post' method: 'post'
}, },
// 查询短信条数 // 查询短信条数
QUERY_SMS_DATA_LIST: { QUERY_SMS_DATA_LIST: {
url: '/xdap-app/noticeHistory/query/smsLogHistoryList', url: '/xdap-app/noticeHistory/query/smsLogHistoryList',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 查询邮件发送记录 // 查询邮件发送记录
QUERY_EMAIL_DATA_LIST: { QUERY_EMAIL_DATA_LIST: {
url: '/xdap-app/noticeHistory/query/emailLogHistoryList', url: '/xdap-app/noticeHistory/query/emailLogHistoryList',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 导出短信发送记录 // 导出短信发送记录
EXPORT_LIST_SMS_DATA: { EXPORT_LIST_SMS_DATA: {
url: '/xdap-app/noticeHistory/export/smsLogHistory', url: '/xdap-app/noticeHistory/export/smsLogHistory',
method: 'get' method: 'get'
}, },
// 导出邮件发送记录 // 导出邮件发送记录
EXPORT_LIST_EMAIL_DATA: { EXPORT_LIST_EMAIL_DATA: {
url: '/xdap-app/noticeHistory/export/emailLogHistory', url: '/xdap-app/noticeHistory/export/emailLogHistory',
method: 'get' method: 'get'
}, },
// 员工工作的转交 // 员工工作的转交
TRANSFER_USER_WORK: { TRANSFER_USER_WORK: {
url: '/xdap-app/work/update/workTransfer', url: '/xdap-app/work/update/workTransfer',
method: 'post' method: 'post'
} }
} }

View File

@ -1,151 +1,151 @@
/** /**
* @Author: your name * @Author: your name
* @Date: 2020-06-12 12:19:21 * @Date: 2020-06-12 12:19:21
* @LastEditTime: 2020-06-13 17:19:01 * @LastEditTime: 2020-06-13 17:19:01
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: /x-project-app/src/api/app-page/index.js * @FilePath: /x-project-app/src/api/app-page/index.js
*/ */
export default { export default {
QUERY_LIST_PAGE_CONFIG_BY_ID: { QUERY_LIST_PAGE_CONFIG_BY_ID: {
url: '/xdap-app/form/query/listPageConfigById', url: '/xdap-app/form/query/listPageConfigById',
method: 'get', method: 'get',
disableSuccessMsg: true disableSuccessMsg: true
}, },
QUERY_LIST_PAGE_CONFIG_BY_TAB_ID: { QUERY_LIST_PAGE_CONFIG_BY_TAB_ID: {
url: '/xdap-app/form/query/listPageViewDetail', url: '/xdap-app/form/query/listPageViewDetail',
method: 'get', method: 'get',
disableSuccessMsg: true disableSuccessMsg: true
}, },
QUERY_LIST_BUSINESS_DATA: { QUERY_LIST_BUSINESS_DATA: {
url: '/xdap-app/business/query/listPageBusinessData', url: '/xdap-app/business/query/listPageBusinessData',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
QUERY_CALC_LIST_BUSINESS_DATA: { QUERY_CALC_LIST_BUSINESS_DATA: {
url: '/xdap-app/business/query/virtualBusinessData', url: '/xdap-app/business/query/virtualBusinessData',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
QUERY_LIST_PAGE_BUTTON: { QUERY_LIST_PAGE_BUTTON: {
url: '/xdap-app/form/query/listPageButton', url: '/xdap-app/form/query/listPageButton',
method: 'get', method: 'get',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 数据导出 // 数据导出
EXPORT_LIST_TO_EXCEL: { EXPORT_LIST_TO_EXCEL: {
url: 'xdap-app/excel/export/excelData', url: 'xdap-app/excel/export/excelData',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 统计接口 // 统计接口
STATISTICAL_TABLE: { STATISTICAL_TABLE: {
url: '/xdap-app/business/query/calAggregate', url: '/xdap-app/business/query/calAggregate',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 数据导入下载模板接口 // 数据导入下载模板接口
EXPORT_TEMPLATE_TO_EXCEL: { EXPORT_TEMPLATE_TO_EXCEL: {
url: '/xdap-app/excel/export/excelTemplate', url: '/xdap-app/excel/export/excelTemplate',
method: 'get', method: 'get',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 数据导入上传接口 // 数据导入上传接口
IMPORT_EXCEL_DATA: { IMPORT_EXCEL_DATA: {
url: '/xdap-app/excel/importExcelData', url: '/xdap-app/excel/importExcelData',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 异常数据查询 // 异常数据查询
EXCEL_IMPORT_LOGS: { EXCEL_IMPORT_LOGS: {
url: '/xdap-app/excel/query/excelImportLogs', url: '/xdap-app/excel/query/excelImportLogs',
method: 'get', method: 'get',
disableSuccessMsg: true disableSuccessMsg: true
}, },
ADD_MENU_COLLECT: { ADD_MENU_COLLECT: {
url: '/xdap-app/menu/add/star', url: '/xdap-app/menu/add/star',
method: 'post' method: 'post'
}, },
REMOVE_MENU_COLLECT: { REMOVE_MENU_COLLECT: {
url: '/xdap-app/menu/remove/star', url: '/xdap-app/menu/remove/star',
method: 'post' method: 'post'
}, },
HAS_MENU_COLLECT: { HAS_MENU_COLLECT: {
url: '/xdap-app/menu/has/menuStar', url: '/xdap-app/menu/has/menuStar',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 批量删除接口 // 批量删除接口
BATCH_DELETE_DATA: { BATCH_DELETE_DATA: {
url: '/xdap-app/business/delete/batchDocument', url: '/xdap-app/business/delete/batchDocument',
method: 'post', method: 'post',
timeout: 1000 * 60 * 1 timeout: 1000 * 60 * 1
}, },
// 批量同意接口 // 批量同意接口
BATCH_AGREE_DATA: { BATCH_AGREE_DATA: {
url: '/xdap-app/process/batch/approve', url: '/xdap-app/process/batch/approve',
method: 'post', method: 'post',
timeout: 1000 * 600 * 1 timeout: 1000 * 600 * 1
}, },
// 批量拒绝接口 // 批量拒绝接口
BATCH_REJECT_DATA: { BATCH_REJECT_DATA: {
url: '/xdap-app/process/batch/reject', url: '/xdap-app/process/batch/reject',
method: 'post', method: 'post',
timeout: 1000 * 600 * 1 timeout: 1000 * 600 * 1
}, },
QUERY_STATISTICS_VALUE_COLUME: { QUERY_STATISTICS_VALUE_COLUME: {
url: '/xdap-app/business/query/dataStatisticValue', url: '/xdap-app/business/query/dataStatisticValue',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
QUERY_TREE_VIEW_TREE_NODE: { QUERY_TREE_VIEW_TREE_NODE: {
url: '/xdap-app/business/query/treeNodeBusinessData', url: '/xdap-app/business/query/treeNodeBusinessData',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
QUERY_TREE_VIEW_TREE_TABLE_DATA: { QUERY_TREE_VIEW_TREE_TABLE_DATA: {
url: '/xdap-app/business/query/childNodeListBusinessData', url: '/xdap-app/business/query/childNodeListBusinessData',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
QUERY_OPERATION_COLUMN: { QUERY_OPERATION_COLUMN: {
url: '/xdap-app/form/query/listButton', url: '/xdap-app/form/query/listButton',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 查询聚合表列表配置 // 查询聚合表列表配置
QUERY_COMBINE_LIST_PAGE_VIEW: { QUERY_COMBINE_LIST_PAGE_VIEW: {
url: '/xdap-app/query/combineListPageView', url: '/xdap-app/query/combineListPageView',
method: 'get', method: 'get',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 聚合表查询数据接口 // 聚合表查询数据接口
QUERY_COMBINE_LIST_BUSINESSDATA: { QUERY_COMBINE_LIST_BUSINESSDATA: {
url: '/xdap-app/query/queryCombineListBusinessData', url: '/xdap-app/query/queryCombineListBusinessData',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 查询聚合表组件 // 查询聚合表组件
QUERY_COMBINE_COMPONENT: { QUERY_COMBINE_COMPONENT: {
url: '/xdap-app/query/combineComponent', url: '/xdap-app/query/combineComponent',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 聚合表按钮查询 // 聚合表按钮查询
QUERY_COMBINE_LISTBUTTON: { QUERY_COMBINE_LISTBUTTON: {
url: '/xdap-app/query/combineListButton', url: '/xdap-app/query/combineListButton',
method: 'get', method: 'get',
disableSuccessMsg: true disableSuccessMsg: true
}, },
QUERY_ADVANCE_SEARCH: { QUERY_ADVANCE_SEARCH: {
url: '/xdap-app/dataFilter/query/dataFilter', url: '/xdap-app/dataFilter/query/dataFilter',
method: 'get', method: 'get',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// * 新的表单字段查询接口 // * 新的表单字段查询接口
QUERY_FORM_FIELD_ALL_IN_ONE: { QUERY_FORM_FIELD_ALL_IN_ONE: {
url: '/xdap-app/form/query/formComponent', url: '/xdap-app/form/query/formComponent',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, }
} }

View File

@ -1,24 +1,24 @@
/* /*
* @Author: your name * @Author: your name
* @Date: 2020-05-30 16:05:14 * @Date: 2020-05-30 16:05:14
* @LastEditTime: 2020-05-30 20:13:11 * @LastEditTime: 2020-05-30 20:13:11
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: /x-product-workspace/packages/x-project-app/src/api/common.js * @FilePath: /x-product-workspace/packages/x-project-app/src/api/common.js
*/ */
export default { export default {
'SEND_PHONE_CODE': { // 发送手机验证码 'SEND_PHONE_CODE': { // 发送手机验证码
url: '/xdap-admin/user/send/smsCode', url: '/xdap-admin/user/send/smsCode',
method: 'post' method: 'post'
}, },
'SEND_EMAIL_CODE': { // 发送邮箱验证码 'SEND_EMAIL_CODE': { // 发送邮箱验证码
url: '/xdap-admin/user/send/emailCode', url: '/xdap-admin/user/send/emailCode',
method: 'post' method: 'post'
}, },
// 切换租户保存租户信息 // 切换租户保存租户信息
'SAVE_ORG_ID_BY_CHANGE': { 'SAVE_ORG_ID_BY_CHANGE': {
url: '/xdap-admin/tenant/switch/tenant', url: '/xdap-admin/tenant/switch/tenant',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
} }
} }

View File

@ -1,52 +1,52 @@
export default { export default {
ENGINE_CHECK_LIST: { ENGINE_CHECK_LIST: {
url: '/custom/activiti/showEngReview', url: '/custom/activiti/showEngReview',
method: 'post' method: 'post'
}, },
START_ENGINE_CHECK: { START_ENGINE_CHECK: {
url: '/custom/activiti/startActiviti', url: '/custom/activiti/startActiviti',
method: 'post' method: 'post'
}, },
HANDLE_ENGINE_CHECK: { HANDLE_ENGINE_CHECK: {
url: '/custom/activiti/handleApproval', url: '/custom/activiti/handleApproval',
method: 'post' method: 'post'
}, },
//撤回 // 撤回
RETURN_ENGINE_CHECK: { RETURN_ENGINE_CHECK: {
url: '/custom/activiti/returnApproval', url: '/custom/activiti/returnApproval',
method: 'get' method: 'get'
}, },
GET_ENGINE_CHECK_DETAIL: { GET_ENGINE_CHECK_DETAIL: {
url: '/custom/activiti/showActiviti', url: '/custom/activiti/showActiviti',
method: 'post' method: 'post'
}, },
CHANGE_ENGINE_DATA: { CHANGE_ENGINE_DATA: {
url: '/custom/activiti/initiateApproval', url: '/custom/activiti/initiateApproval',
method: 'get' method: 'get'
}, },
// 审批相关接口 // 审批相关接口
CHECK_DATA_CAN_RETURN: { CHECK_DATA_CAN_RETURN: {
url: '/custom/activiti/getIsDirect', url: '/custom/activiti/getIsDirect',
method: 'get' method: 'get'
}, },
GET_DATA_APPROVAL_USERS: { GET_DATA_APPROVAL_USERS: {
url: '/custom/activiti/getApprovalUsers', url: '/custom/activiti/getApprovalUsers',
method: 'get' method: 'get'
}, },
RESEND_DATA_APPROVAL: { RESEND_DATA_APPROVAL: {
url: '/custom/activiti/directSendingApproval', url: '/custom/activiti/directSendingApproval',
method: 'get' method: 'get'
}, },
GET_CAN_RETURN_DATA_NODE: { GET_CAN_RETURN_DATA_NODE: {
url: '/custom/activiti/getReturnNodes', url: '/custom/activiti/getReturnNodes',
method: 'get' method: 'get'
}, },
CAN_RETURN_DATA_NODE: { CAN_RETURN_DATA_NODE: {
url: '/custom/activiti/handleReturnToNode', url: '/custom/activiti/handleReturnToNode',
method: 'post' method: 'post'
}, },
RESTART_DATA_APPROVAL: { RESTART_DATA_APPROVAL: {
url: '/custom/activiti/handleReturn', url: '/custom/activiti/handleReturn',
method: 'post' method: 'post'
} }
} }

View File

@ -7,7 +7,7 @@ export default {
url: '/custom/permission/updateRole?userID=', url: '/custom/permission/updateRole?userID=',
method: 'post' method: 'post'
}, },
//获取引擎列表 // 获取引擎列表
GET_ENGINE_LIST_SELF: { GET_ENGINE_LIST_SELF: {
url: '/custom/dataEntryEngineModel/selectByPage', url: '/custom/dataEntryEngineModel/selectByPage',
method: 'post' method: 'post'
@ -16,17 +16,22 @@ export default {
url: '/custom/dataEntryEngineModel/excelExport', url: '/custom/dataEntryEngineModel/excelExport',
method: 'get' method: 'get'
}, },
//添加引擎 // 添加引擎
ADD_ENGINE_MODEL: { ADD_ENGINE_MODEL: {
url: '/custom/dataEntryEngineModel/insert', url: '/custom/dataEntryEngineModel/insert',
method: 'post' method: 'post'
}, },
//导入引擎 // 更新引擎(列表编辑机型)
IMPORT_ENGINE_MODEL: { UPDATE_ENGINE_MODEL: {
url: '/custom/dataEntryEngineModel/import', url: '/custom/dataEntryEngineModel/update',
method: 'post' method: 'post'
}, },
//获取参数列表 // 导入引擎
IMPORT_ENGINE_MODEL: {
url: '/custom/engineParamDetailPojo/excelImport',
method: 'post'
},
// 获取参数列表
GET_PARAM_LIST: { GET_PARAM_LIST: {
url: '/custom/engineParamDetailPojo/selectParamList', url: '/custom/engineParamDetailPojo/selectParamList',
method: 'get' method: 'get'
@ -35,7 +40,7 @@ export default {
url: '/custom/dataEntryEngineModel/excelImport', url: '/custom/dataEntryEngineModel/excelImport',
method: 'post' method: 'post'
}, },
//获取引擎详情 // 获取引擎详情
GET_ENGINE_DETAIL: { GET_ENGINE_DETAIL: {
url: '/custom/engineParamDetailPojo/selectValueByMoreParam', url: '/custom/engineParamDetailPojo/selectValueByMoreParam',
method: 'post' method: 'post'
@ -43,5 +48,47 @@ export default {
GET_ENGINE_TABLE_DETAIL: { GET_ENGINE_TABLE_DETAIL: {
url: '/custom/engineParamDetailPojo/selectParamListAndModel', url: '/custom/engineParamDetailPojo/selectParamListAndModel',
method: 'get' method: 'get'
},
// 填写人进入详情页时获取参数树(传参与 GET_ENGINE_TABLE_DETAIL 相同)
GET_ENGINE_TABLE_DETAIL_FOR_FILLED_BY: {
url: '/custom/engineParamDetailPojo/selectParamListAndModelForFilledBy',
method: 'get'
},
GET_ENGINE_TABLE_DETAIL_FOR_FILLED_BY_HISTORY: {
url: '/custom/engineParamDetailPojo/selectParamListAndModelForFilledByHistory',
method: 'get'
},
// 责任人分发填写人时获取参数树(传参与 GET_ENGINE_TABLE_DETAIL 相同userID 为责任人 ID
GET_ENGINE_TABLE_DETAIL_FOR_RESPONSIBLE_PERSON: {
url: '/custom/engineParamDetailPojo/selectParamListAndModelForResponsiblePerson',
method: 'get'
},
GET_NEW_MODEL_VERSION: {
url: '/custom/dataEntryEngineModel/synchronizeParams',
method: 'get'
},
CONTINUE_DATA_APPROVAL: {
url: '/custom/activiti/continueApproval',
method: 'get'
},
UPDATE_APPROVAL_DATA: {
url: '/custom/activiti/updateNode',
method: 'post'
},
EDIT_DATA_DEPT: {
url: '/custom/engineParamDetailPojo/updateDept',
method: 'post'
},
REJECT_TODO_TASK: {
url: '/custom/todoTaskPojo/rejectTodo',
method: 'post'
},
CHECK_PERMISSION_USER_DATA: {
url: '/custom/permission/getPreAndRoleByCondition',
method: 'post'
},
EXPORT_PERMISSION_USER_DATA: {
url: '/custom/permission/exportPreAndRole',
method: 'get'
} }
} }

View File

@ -19,28 +19,28 @@ export default {
method: 'get' method: 'get'
}, },
//测试文件上传 // 测试文件上传
TEST_FILE_UPLOAD: { TEST_FILE_UPLOAD: {
url: '/custom/benchmark/uploadFile', url: '/custom/benchmark/uploadFile',
method: 'post' method: 'post'
}, },
//获取用户列表 // 获取用户列表
SELECT_USER_BY_DEPT: { SELECT_USER_BY_DEPT: {
url: '/custom/responsible/getUserByDepartmentId', url: '/custom/responsible/getUserByDepartmentId',
method: 'get' method: 'get'
}, },
//保存责任管理 // 保存责任管理
SAVE_MANAGER_DATA: { SAVE_MANAGER_DATA: {
url: '/custom/responsible/saveResponsiblePerson', url: '/custom/responsible/saveResponsiblePerson',
method: 'post' method: 'post'
}, },
//判断是否是责任人 // 判断是否是责任人
IS_RESPONSIBLE: { IS_RESPONSIBLE: {
url: '/custom/responsible/isResponsiblePerson', url: '/custom/responsible/isResponsiblePerson',
method: 'get' method: 'get'
}, },
//获取责任人 // 获取责任人
GET_MANAGER_DATA: { GET_MANAGER_DATA: {
url: '/custom/responsible/getDeptResponsible', url: '/custom/responsible/getDeptResponsible',
method: 'get' method: 'get'
@ -53,7 +53,7 @@ export default {
url: '/custom/responsible/deleteResponsiblePerson', url: '/custom/responsible/deleteResponsiblePerson',
method: 'get' method: 'get'
}, },
//新增填写人管理 // 新增填写人管理
SAVE_FILLER_DATA: { SAVE_FILLER_DATA: {
url: '/custom/responsible/saveFilledPerson', url: '/custom/responsible/saveFilledPerson',
method: 'post' method: 'post'
@ -66,12 +66,12 @@ export default {
url: '/custom/responsible/getAllSubsystem', url: '/custom/responsible/getAllSubsystem',
method: 'get' method: 'get'
}, },
//判断是否是填写人 // 判断是否是填写人
IS_FILLER: { IS_FILLER: {
url: '/custom/filler/isFillerPerson', url: '/custom/filler/isFillerPerson',
method: 'get' method: 'get'
}, },
//获取填写人 // 获取填写人
GET_FILLER_DATA: { GET_FILLER_DATA: {
url: '/custom/responsible/getDeptFilled', url: '/custom/responsible/getDeptFilled',
method: 'get' method: 'get'
@ -106,7 +106,7 @@ export default {
url: '/custom/common/insertModelCommon', url: '/custom/common/insertModelCommon',
method: 'post' method: 'post'
}, },
//填写人退回 // 填写人退回
HANDLE_FILLER_BACK: { HANDLE_FILLER_BACK: {
url: '/custom/todoTaskPojo/todoReturn', url: '/custom/todoTaskPojo/todoReturn',
method: 'post' method: 'post'
@ -115,37 +115,37 @@ export default {
url: '/custom/engineParamDetailPojo/selectParamList', url: '/custom/engineParamDetailPojo/selectParamList',
method: 'get' method: 'get'
}, },
//获取待办列表 // 获取待办列表
GET_TODO_LIST: { GET_TODO_LIST: {
url: '/custom/todoTaskPojo/selectByresPersonTodoPage', url: '/custom/todoTaskPojo/selectByresPersonTodoPage',
method: 'post' method: 'post'
}, },
//获取创建人待办 // 获取创建人待办
GET_TODO_LIST_BY_CREATOR: { GET_TODO_LIST_BY_CREATOR: {
url: '/custom/todoTaskPojo/selectByPage', url: '/custom/todoTaskPojo/selectByPage',
method: 'post' method: 'post'
}, },
//更新参数 // 更新参数
UPDATE_PARAM: { UPDATE_PARAM: {
url: '/custom/engineParamDetailPojo/updateParamValue?userID=', url: '/custom/engineParamDetailPojo/updateParamValue?userID=',
method: 'post' method: 'post'
}, },
//导出模板 // 导出模板
EXPORT_TEMPLATE: { EXPORT_TEMPLATE: {
url: '/custom/engineParamDetailPojo/excelExport', url: '/custom/engineParamDetailPojo/excelExport',
method: 'get' method: 'get'
}, },
//导入 // 导入
IMPORT_ENGINE_MODEL: { IMPORT_ENGINE_MODEL: {
url: '/custom/engineParamDetailPojo/excelImport', url: '/custom/engineParamDetailPojo/excelImport',
method: 'post' method: 'post'
}, },
//责任人分发 // 责任人分发
HANDLE_RESPONSIBLE_DISPATCH: { HANDLE_RESPONSIBLE_DISPATCH: {
url: '/custom/engineParamDetailPojo/updateToInsertFiledBy?userID=', url: '/custom/engineParamDetailPojo/updateToInsertFiledBy?userID=',
method: 'post' method: 'post'
}, },
//分发给责任人 // 分发给责任人
HANDLE_TODO_DISPATCH: { HANDLE_TODO_DISPATCH: {
url: '/custom/todoTaskPojo/createResPerson?userID=', url: '/custom/todoTaskPojo/createResPerson?userID=',
method: 'post' method: 'post'
@ -153,7 +153,7 @@ export default {
GET_ENGINE_VERSIONS: { GET_ENGINE_VERSIONS: {
url: '/custom/engineParamDetailPojo/selectVersionList', url: '/custom/engineParamDetailPojo/selectVersionList',
method: 'post' method: 'get'
}, },
TEXT_DEMO: { TEXT_DEMO: {
@ -220,10 +220,42 @@ export default {
url: '/custom/responsible/getImportTemplate', url: '/custom/responsible/getImportTemplate',
method: 'get' method: 'get'
}, },
GET_MODEL_BY_ID: {
url: '/custom/template/getTemplateById',
method: 'get'
},
// 修改流程主题 // 修改流程主题
EDIT_DATA_PROCESS_TITLE: { EDIT_DATA_PROCESS_TITLE: {
url: '/custom/activiti/updateFlowTitle', url: '/custom/activiti/updateFlowTitle',
method: 'get' method: 'get'
},
// 获取图表常用
GET_CHART_COMMONLY_USED: {
url: '/custom/common/getChartCommonParameter',
method: 'get'
},
ADD_CHART_COMMONLY_USED: {
url: '/custom/common/insertChartCommon',
method: 'post'
},
EDIT_CHART_COMMONLY_USED: {
url: '/custom/common/updateChartCommon',
method: 'post'
},
GET_USER_INFO :{
url: '/custom/xdapDeptUsersPojo/getUserInfo',
method: 'get'
},
GET_YC_TODO_LIST: {
url: '/custom/YcTaskResult/getTodoById',
method: 'get'
},
GET_YC_MY_SEND_LIST: {
url: '/custom/YcTaskResult/getInitiatorById',
method: 'get'
},
GET_YC_MY_DONE_LIST: {
url: '/custom/YcTaskResult/getCompletedById',
method: 'get'
} }
} }

View File

@ -1,128 +1,150 @@
export default { export default {
//添加模板 // 添加模板
ADD_MODEL: { ADD_MODEL: {
url: '/custom/template/insertTemplate', url: '/custom/template/insertTemplate',
method: 'post' method: 'post'
}, },
//模板管理列表 // 模板管理列表
GET_MODEL_LIST: { GET_MODEL_LIST: {
url: '/custom/template/getTemplateByCondition', url: '/custom/template/getTemplateByCondition',
method: 'get' method: 'get'
}, },
//导入模板 // 导入模板
IMPORT_MODEL: { IMPORT_MODEL: {
url: '/custom/template/import', url: '/custom/template/import',
method: 'post' method: 'post'
}, },
//修改模板 // 修改模板
EDIT_MODEL: { EDIT_MODEL: {
url: '/custom/template/updateTemplate', url: '/custom/template/updateTemplate',
method: 'post' method: 'post'
}, },
//查看版本 // 查看版本
CHECK_MODEL_VERISON: { CHECK_MODEL_VERISON: {
url: '/custom/template/getTemplateVersion', url: '/custom/template/getTemplateVersion',
method: 'get' method: 'get'
}, },
//下载 // 下载
DOWNLODE_MODEL: { DOWNLODE_MODEL: {
url: '/custom/template/export', url: '/custom/template/export',
method: 'get' method: 'get'
}, },
DOWNLODE_ALL_MODEL: { DOWNLODE_ALL_MODEL: {
url: '/custom/template/exportMultiple', url: '/custom/template/exportMultiple',
method: 'get' method: 'get'
}, },
//获取部门 // 获取部门
GET_DEPARTMENT: { GET_DEPARTMENT: {
url: '/custom/template/getDept', url: '/custom/template/getDept',
method: 'get' method: 'get'
}, },
//查询详情 // 查询详情
GET_MODEL_DETAIL: { GET_MODEL_DETAIL: {
url: '/custom/parameter/getParameterByCondition', url: '/custom/parameter/getParameterByCondition',
method: 'get' method: 'get'
}, },
//添加参数 // 添加参数
ADD_MODEL_PARAM: { ADD_MODEL_PARAM: {
url: '/custom/parameter/insertParameter', url: '/custom/parameter/insertParameter',
method: 'post' method: 'post'
}, },
//维护参数 // 维护参数
EDIT_MODEL_PARAM: { EDIT_MODEL_PARAM: {
url: '/custom/parameter/maintenanceParameters', url: '/custom/parameter/maintenanceParameters',
method: 'post' method: 'post'
}, },
DELETE_MODEL_PARAM: { DELETE_MODEL_PARAM: {
url: '/custom/parameter/deleteParameter', url: '/custom/parameter/deleteParameter',
method: 'get' method: 'get'
}, },
START_APPROVAL: { START_APPROVAL: {
url: '/custom/approval/startApproval', url: '/custom/approval/startApproval',
method: 'post' method: 'post'
}, },
GET_APPROVAL_LIST: { GET_APPROVAL_LIST: {
url: '/custom/approval/getApprovalList', url: '/custom/approval/getApprovalList',
method: 'get' method: 'get'
}, },
HANDLE_APPROVAL: { HANDLE_APPROVAL: {
url: '/custom/approval/handleApproval', url: '/custom/approval/handleApproval',
method: 'post' method: 'post'
}, },
//获取审批详情 // 获取审批详情
// GET_APPROVAL_DETAIL: { // GET_APPROVAL_DETAIL: {
// url: '/custom/approval/getApprovalDetail', // url: '/custom/approval/getApprovalDetail',
// method: 'get' // method: 'get'
// }, // },
//获取所有人 // 获取所有人
GET_ALLUSERS: { GET_ALLUSERS: {
url: '/custom/approval/getUsersByCondition', url: '/custom/approval/getUsersByCondition',
method: 'get' method: 'get'
}, },
//获取审批变更 // 获取审批变更
GET_APPROVAL_CHANGE: { GET_APPROVAL_CHANGE: {
url: '/custom/approval/getTemplateChanges', url: '/custom/approval/getTemplateChanges',
method: 'get' method: 'get'
}, //获取审批所有 },
GET_PPROVAL_ALL: { // 获取审批所有
url: '/custom/approval/getApprovalProcess', GET_PPROVAL_ALL: {
method: 'get' url: '/custom/approval/getApprovalProcess',
}, method: 'get'
GET_SUB_DEPT: { },
url: '/custom/responsible/getSubDepartmentById', GET_SUB_DEPT: {
method: 'get' url: '/custom/responsible/getSubDepartmentById',
}, method: 'get'
//处理模板审批撤回 },
RETURN_APPROVAL: { // 处理模板审批撤回
url: '/custom/approval/handleReturn', RETURN_APPROVAL: {
method: 'post' url: '/custom/approval/handleReturn',
}, method: 'post'
RETURN_MODEL_APPROVAL: { },
url: '/custom/approval/handleReturnToNode', RETURN_MODEL_APPROVAL: {
method: 'post' url: '/custom/approval/handleReturnToNode',
}, method: 'post'
RESTART_MODEL_APPROVAL: { },
url: '/custom/approval/directSendingApproval', RESTART_MODEL_APPROVAL: {
method: 'get' url: '/custom/approval/directSendingApproval',
}, method: 'get'
GET_MODEL_BY_ID: { },
url: '/custom/template/getTemplateById',
method: 'get' GET_CAN_RETURN_NODE: {
}, url: '/custom/approval/getReturnNodes',
GET_CAN_RETURN_NODE: { method: 'get'
url: '/custom/approval/getReturnNodes', },
method: 'get' GET_RETURN_APPROVAL: {
}, url: '/custom/approval/getApprovalUsers',
GET_RETURN_APPROVAL: { method: 'get'
url: '/custom/approval/getApprovalUsers', },
method: 'get' GET_CAN_RESEND_APPROVAL: {
}, url: '/custom/approval/getIsDirect?',
GET_CAN_RESEND_APPROVAL: { method: 'get'
url: '/custom/approval/getIsDirect?', },
method: 'get' EDIT_APPROVAL_PROCESS_TITLE: {
}, url: '/custom/approval/updateFlowTitle',
EDIT_APPROVAL_PROCESS_TITLE: { method: 'get'
url: '/custom/approval/updateFlowTitle', },
method: 'get' EDIT_APPROVAL_PROCESS: {
} url: '/custom/approval/updateNode',
} method: 'post'
},
CONTINUE_APPROVAL_PROCESS: {
url: '/custom/approval/continueApproval',
method: 'get'
},
GET_DEPT_OF_USER: {
url: '/custom/responsible/getResponsibleDepartment',
method: 'get'
},
UPDATE_TEMPLATE_ORDER: {
url: '/custom/template/batchUpdateTemplateOrder',
method: 'post'
},
BATCH_UPDATE_DEPARTMENT: {
url: '/custom/todoTaskPojo/batchUpdateDepartment',
method: 'post'
},
SAVE_FILLED_BY_TEMP: {
url: '/custom/engineParamDetailPojo/saveFilledByTemp',
method: 'post'
}
}

View File

@ -1,68 +1,83 @@
export default { export default {
//权限管理相关接口 // 权限管理相关接口
//获取权限管理列表 // 获取权限管理列表
GET_PERMISSION_DATA: { GET_PERMISSION_DATA: {
url: '/custom/permission/getUserRoleAndPermission', url: '/custom/permission/getUserRoleAndPermission',
method: 'get' method: 'get'
}, },
//保存权限管理 // 保存权限管理
SAVE_PERMISSION_DATA: { SAVE_PERMISSION_DATA: {
url: '/custom/permission/insertRole', url: '/custom/permission/insertRole',
method: 'post' method: 'post'
}, },
//修改权限管理 // 修改权限管理
EDIT_PERMISSION_DATA: { EDIT_PERMISSION_DATA: {
url: '/custom/permission/updatePermission', url: '/custom/permission/updatePermission',
method: 'post' method: 'post'
}, },
//删除权限管理 // 删除权限管理
DELETE_PERMISSION_DATA: { DELETE_PERMISSION_DATA: {
url: '/custom/permission/deletePermission', url: '/custom/permission/deletePermission',
method: 'get' method: 'get'
}, },
//获取所有权限表 // 获取所有权限表
GET_ALL_PERMISSION_LIST: { GET_ALL_PERMISSION_LIST: {
url: '/custom/permission/getAllPermission', url: '/custom/permission/getAllPermission',
method: 'get' method: 'get'
}, },
DELETE_PERMISSION_DATA: { DELETE_ROLE_DATA: {
url: '/custom/permission/deleteRole', url: '/custom/permission/deleteRole',
method: 'get' method: 'get'
}, },
CHECK_ROLE_USER_DEPT: { CHECK_ROLE_USER_DEPT: {
url: '/custom/permission/selectUserOrDeptByRole', url: '/custom/permission/selectUserOrDeptByRole',
method: 'get' method: 'get'
}, },
GET_NOW_USER_ROLE: { GET_NOW_USER_ROLE: {
url: '/custom/permission/selectPermByUserId', url: '/custom/permission/selectPermByUserId',
method: 'get' method: 'get'
}, },
ADD_ROLE_PERMISSION: { ADD_ROLE_PERMISSION: {
url: '/custom/permission/addRoles', url: '/custom/permission/addRoles',
method: 'post' method: 'post'
}, },
GET_ROLE_PERMISSION: { GET_ROLE_PERMISSION: {
url: '/custom/permission/selectRoles', url: '/custom/permission/selectRoles',
method: 'get' method: 'get'
}, },
DELETE_ROLE_PERMISSION: { DELETE_ROLE_PERMISSION: {
url: '/custom/permission/removeRoles', url: '/custom/permission/removeRoles',
method: 'get' method: 'get'
}, },
GET_ROLE_PERMISSION_BING: { GET_ROLE_PERMISSION_BING: {
url: '/custom/permission/userRoleBinding', url: '/custom/permission/userRoleBinding',
method: 'post' method: 'post'
}, },
GET_SUB_SYSTEM_DATA_LIST: { GET_SUB_SYSTEM_DATA_LIST: {
url: '/custom/permission/getAllParameters', url: '/custom/permission/getAllParameters',
method: 'get' method: 'get'
}, },
EDIT_ROLE_CONTROL_LIST: { EDIT_ROLE_CONTROL_LIST: {
url: '/custom/permission/updatePerForRole', url: '/custom/permission/updatePerForRole',
method: 'post' method: 'post'
}, },
GET_ROLE_CONTROL_LIST: { GET_ROLE_CONTROL_LIST: {
url: '/custom/permission/selectPersByRole', url: '/custom/permission/selectPersByRole',
method: 'get' method: 'get'
} },
} // 获取角色成员列表
GET_ROLE_MEMBERS: {
url: '/custom/permission/getRoleMembers',
method: 'get'
},
// 添加角色成员
ADD_ROLE_MEMBERS: {
url: '/custom/permission/addRoleMembers',
method: 'post'
},
// 删除角色成员
DELETE_ROLE_MEMBERS: {
url: '/custom/permission/deleteRoleMembers',
method: 'post'
}
}

View File

@ -1,66 +1,70 @@
export default { export default {
GET_REPORT_LIST: { GET_REPORT_LIST: {
url: '/custom/benchmark/getReportAndTodoByCondition', url: '/custom/benchmark/getReportAndTodoByCondition',
method: 'post' method: 'post'
}, },
GET_REPORT_LIST_BY_CONDITION: { GET_REPORT_LIST_BY_CONDITION: {
url: '/custom/benchmark/getApprovalList', url: '/custom/benchmark/getApprovalList',
method: 'post' method: 'post'
}, },
ADD_REPORT: { ADD_REPORT: {
url: '/custom/benchmark/startReportApproval', url: '/custom/benchmark/startReportApproval',
method: 'post' method: 'post'
}, },
SAVE_REPORT: { SAVE_REPORT: {
url: '/custom/benchmark/insertReport', url: '/custom/benchmark/insertReport',
method: 'post' method: 'post'
}, },
EDIT_REPORT: { EDIT_REPORT: {
url: '/custom/benchmark/updateReport', url: '/custom/benchmark/updateReport',
method: 'post' method: 'post'
}, },
RESTART_REPORT_APPROVAL: { RESTART_REPORT_APPROVAL: {
url: '/custom/benchmark/restartReportApproval', url: '/custom/benchmark/restartReportApproval',
method: 'post' method: 'post'
}, },
START_REPORT_APPROVAL: { START_REPORT_APPROVAL: {
url: '/custom/benchmark/handleReportApproval', url: '/custom/benchmark/handleReportApproval',
method: 'post' method: 'post'
}, },
GET_REPORT_DETAIL: { GET_REPORT_DETAIL: {
url: '/custom/benchmark/getReportDetail', url: '/custom/benchmark/getReportDetail',
method: 'get' method: 'get'
}, },
GET_REPORT_DETAIL_PROCESS: { GET_REPORT_DETAIL_PROCESS: {
url: '/custom/benchmark/getReportProcess', url: '/custom/benchmark/getReportProcess',
method: 'get' method: 'get'
}, },
DOWNLOAD_REPORT: { DOWNLOAD_REPORT: {
url: '/custom/benchmark/downloadReport', url: '/custom/benchmark/downloadReport',
method: 'get' method: 'get'
}, },
DELETE_REPORT: { DELETE_REPORT: {
url: '/custom/benchmark/deleteReport', url: '/custom/benchmark/deleteReport',
method: 'get' method: 'get'
}, },
RETURN_REPORT: { RETURN_REPORT: {
url: '/custom/benchmark/handleReturn', url: '/custom/benchmark/handleReturn',
method: 'post' method: 'post'
}, },
RESTART_REPORT_TODO: { RESTART_REPORT_TODO: {
url: '/custom/benchmark/restartApproval', url: '/custom/benchmark/restartApproval',
method: 'get' method: 'get'
}, },
RESEND_REPORT_APPROVAL: { RESEND_REPORT_APPROVAL: {
url: '/custom/benchmark/directSendingApproval', url: '/custom/benchmark/directSendingApproval',
method: 'get' method: 'get'
}, },
RETURN_REPORT_TODO: { RETURN_REPORT_TODO: {
url: '/custom/benchmark/handleReturnToNode', url: '/custom/benchmark/handleReturnToNode',
method: 'post' method: 'post'
}, },
GET_REPORT_APPROVAL_USERS: { GET_REPORT_APPROVAL_USERS: {
url: '/custom/benchmark/getApprovalUsers', url: '/custom/benchmark/getApprovalUsers',
method: 'get' method: 'get'
} },
} CONTINUE_REPORT_APPROVAL: {
url: '/custom/benchmark/continueApproval',
method: 'get'
}
}

View File

@ -1,35 +1,35 @@
/* /*
* @Author: your name * @Author: your name
* @Date: 2020-05-30 09:41:36 * @Date: 2020-05-30 09:41:36
* LastEditTime: 2020-09-18 10:10:08 * LastEditTime: 2020-09-18 10:10:08
* LastEditors: Mosuzi * LastEditors: Mosuzi
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: /x-product-workspace/packages/x-project-app/src/api/index.js * @FilePath: /x-product-workspace/packages/x-project-app/src/api/index.js
*/ */
import CommonApi from './common' import CommonApi from './common'
import AccountApi from './account' import AccountApi from './account'
import AdminApi from './admin' import AdminApi from './admin'
import PersonalApi from './personal' import PersonalApi from './personal'
import WorkbenchApi from './workbench' import WorkbenchApi from './workbench'
import AppPage from './app-page' import AppPage from './app-page'
import demoApi from './demo/index' import demoApi from './demo/index'
import dataApi from './demo/data' import dataApi from './demo/data'
import modelApi from './demo/model' import modelApi from './demo/model'
import reportApi from './demo/report' import reportApi from './demo/report'
import activitiApi from './demo/activiti' import activitiApi from './demo/activiti'
import permissionApi from './demo/permission' import permissionApi from './demo/permission'
export default { export default {
...CommonApi, ...CommonApi,
...AccountApi, ...AccountApi,
...AdminApi, ...AdminApi,
...PersonalApi, ...PersonalApi,
...WorkbenchApi, ...WorkbenchApi,
...AppPage, ...AppPage,
...demoApi, ...demoApi,
...dataApi, ...dataApi,
...modelApi, ...modelApi,
...reportApi, ...reportApi,
...activitiApi, ...activitiApi,
...permissionApi ...permissionApi
} }

View File

@ -1,53 +1,53 @@
/* /*
* @Author: your name * @Author: your name
* @Date: 2020-05-30 10:07:21 * @Date: 2020-05-30 10:07:21
* @LastEditTime: 2020-06-06 12:27:21 * @LastEditTime: 2020-06-06 12:27:21
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: /x-product-workspace/packages/x-project-app/src/api/personal-center/index.js * @FilePath: /x-product-workspace/packages/x-project-app/src/api/personal-center/index.js
*/ */
export default { export default {
QUERY_USER_INFO: { QUERY_USER_INFO: {
url: '/xdap-admin/user/query/userInfo', url: '/xdap-admin/user/query/userInfo',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
UPDATE_USER_INFO: { UPDATE_USER_INFO: {
url: '/xdap-admin/user/update/userInfo', url: '/xdap-admin/user/update/userInfo',
method: 'post' method: 'post'
}, },
QUERY_ACCOUNT_INFO: { QUERY_ACCOUNT_INFO: {
url: '/xdap-admin/user/query/accountInfo', url: '/xdap-admin/user/query/accountInfo',
method: 'get', method: 'get',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 查询用户绑定第三方账号信息 // 查询用户绑定第三方账号信息
QUERY_ACCOUNT_BIND: { QUERY_ACCOUNT_BIND: {
url: '/xdap-admin/user/query/userBind', url: '/xdap-admin/user/query/userBind',
method: 'get', method: 'get',
disableSuccessMsg: true disableSuccessMsg: true
}, },
QUIT_TENANT: { QUIT_TENANT: {
url: '/xdap-admin/tenant/quit/tenant', url: '/xdap-admin/tenant/quit/tenant',
method: 'post' method: 'post'
}, },
UPDATE_USER_PASSWORD: { UPDATE_USER_PASSWORD: {
url: '/xdap-admin/user/update/userPassword', url: '/xdap-admin/user/update/userPassword',
method: 'post' method: 'post'
}, },
UPLOAD_USER_AVATAR: { UPLOAD_USER_AVATAR: {
url: '/xdap-admin/user/upload/userAvatar', url: '/xdap-admin/user/upload/userAvatar',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 绑定微信 // 绑定微信
BIND_OPNE_WECHAT: { BIND_OPNE_WECHAT: {
url: '/xdap-admin/user/bind/openWechat', url: '/xdap-admin/user/bind/openWechat',
method: 'post' method: 'post'
}, },
// 解绑第三方账号 // 解绑第三方账号
UNBIND_THIRD_PLATFORM: { UNBIND_THIRD_PLATFORM: {
url: '/xdap-admin/user/unbind/userThirdPlatform', url: '/xdap-admin/user/unbind/userThirdPlatform',
method: 'post' method: 'post'
} }
} }

View File

@ -1,36 +1,36 @@
/* /*
* @Author: your name * @Author: your name
* @Date: 2020-05-30 16:15:05 * @Date: 2020-05-30 16:15:05
* LastEditTime: 2020-09-22 11:11:01 * LastEditTime: 2020-09-22 11:11:01
* LastEditors: Mosuzi * LastEditors: Mosuzi
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: /x-product-workspace/packages/x-project-app/src/api/workbench/index.js * @FilePath: /x-product-workspace/packages/x-project-app/src/api/workbench/index.js
*/ */
export default { export default {
QUERY_MY_TENANT_LIST: { QUERY_MY_TENANT_LIST: {
url: '/xdap-admin/tenant/query/myTenantList', url: '/xdap-admin/tenant/query/myTenantList',
method: 'get', method: 'get',
disableSuccessMsg: true disableSuccessMsg: true
}, },
// 查询首页应用 // 查询首页应用
QUERY_HOME_LIST: { QUERY_HOME_LIST: {
url: '/xdap-app/app/query/workspaceHome', url: '/xdap-app/app/query/workspaceHome',
method: 'get', method: 'get',
disableSuccessMsg: true disableSuccessMsg: true
}, },
QUERY_TENANT_LIST_BY_USER: { QUERY_TENANT_LIST_BY_USER: {
url: '/xdap-admin/tenant/query/tenantListByUser', url: '/xdap-admin/tenant/query/tenantListByUser',
method: 'get', method: 'get',
disableSuccessMsg: true disableSuccessMsg: true
}, },
QUERY_USER_TENANT_INFO: { QUERY_USER_TENANT_INFO: {
url: '/xdap-admin/tenant/query/userTenantInfo', url: '/xdap-admin/tenant/query/userTenantInfo',
method: 'get', method: 'get',
disableSuccessMsg: true disableSuccessMsg: true
}, },
USER_APP_CONFIG_UPDATE: { USER_APP_CONFIG_UPDATE: {
url: '/xdap-app/user/config/update', url: '/xdap-app/user/config/update',
method: 'post', method: 'post',
disableSuccessMsg: true disableSuccessMsg: true
} }
} }

View File

@ -1,17 +1,17 @@
export default { export default {
requireAllSvg: function() { requireAllSvg: function() {
const requireAll = (requireContext) => requireContext.keys().map(requireContext) const requireAll = (requireContext) => requireContext.keys().map(requireContext)
const req = require.context('./assets/icon', true, /\.svg$/) const req = require.context('./assets/icon', true, /\.svg$/)
requireAll(req) requireAll(req)
}, },
/** /**
* 支持App应用动态导入图标 * 支持App应用动态导入图标
* @param { require.context('./assets/icon', true, /\.svg$/) } * @param { require.context('./assets/icon', true, /\.svg$/) }
*/ */
requireAppSvg: function(reqContext) { requireAppSvg: function(reqContext) {
const requireAll = (requireContext) => requireContext.keys().map(requireContext) const requireAll = (requireContext) => requireContext.keys().map(requireContext)
const req = reqContext const req = reqContext
requireAll(req) requireAll(req)
} }
} }

View File

@ -1,2 +1,2 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1590564441419" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3571" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M448.170667 273.706667a59.477333 59.477333 0 1 0 118.954666 0 59.477333 59.477333 0 0 0-118.954666 0zM448.170667 510.293333a59.221333 59.221333 0 1 0 118.442666 0 59.221333 59.221333 0 0 0-118.442666 0zM448.682667 747.221333a59.221333 59.221333 0 1 0 118.442666 0 59.221333 59.221333 0 0 0-118.442666 0z" p-id="3572"></path></svg> <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1590564441419" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3571" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M448.170667 273.706667a59.477333 59.477333 0 1 0 118.954666 0 59.477333 59.477333 0 0 0-118.954666 0zM448.170667 510.293333a59.221333 59.221333 0 1 0 118.442666 0 59.221333 59.221333 0 0 0-118.442666 0zM448.682667 747.221333a59.221333 59.221333 0 1 0 118.442666 0 59.221333 59.221333 0 0 0-118.442666 0z" p-id="3572"></path></svg>

Before

Width:  |  Height:  |  Size: 708 B

After

Width:  |  Height:  |  Size: 709 B

View File

@ -1,322 +1,322 @@
'use strict' 'use strict'
var _typeof = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? function (obj) { return typeof obj } : function (obj) { return obj && typeof Symbol === 'function' && obj.constructor === Symbol ? 'symbol' : typeof obj }; var _typeof = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? function (obj) { return typeof obj } : function (obj) { return obj && typeof Symbol === 'function' && obj.constructor === Symbol ? 'symbol' : typeof obj };
(function () { (function () {
// var canvasRef = '' // var canvasRef = ''
var opts = { var opts = {
imgurl: '', imgurl: '',
cw: 60, cw: 60,
ch: 60, ch: 60,
precision: 5, precision: 5,
onSuccess: null, onSuccess: null,
onError: null, onError: null,
successText: '', successText: '',
failText: '', failText: '',
eventinfo: { eventinfo: {
flag: false, flag: false,
left: 0, left: 0,
clipleft: 0, clipleft: 0,
currentX: 0 currentX: 0
} }
} }
function isArray(obj) { function isArray(obj) {
return Object.prototype.toString.call(obj) === '[object Array]' return Object.prototype.toString.call(obj) === '[object Array]'
} }
function createCaptchaBox(canvas) { function createCaptchaBox(canvas) {
var captchaBox = document.createElement('div') var captchaBox = document.createElement('div')
captchaBox.className = 'captcha-box' captchaBox.className = 'captcha-box'
captchaBox.style.width = canvas.width + 'px' captchaBox.style.width = canvas.width + 'px'
var dragBox = document.createElement('div') var dragBox = document.createElement('div')
dragBox.className = 'drag-box' dragBox.className = 'drag-box'
dragBox.id = 'drag-box' dragBox.id = 'drag-box'
var canvasBox = document.createElement('div') var canvasBox = document.createElement('div')
canvasBox.className = 'canvas-box' canvasBox.className = 'canvas-box'
canvasBox.appendChild(canvas.cloneNode(true)) canvasBox.appendChild(canvas.cloneNode(true))
canvasBox.appendChild(createResult()) canvasBox.appendChild(createResult())
captchaBox.appendChild(canvasBox) captchaBox.appendChild(canvasBox)
captchaBox.appendChild(createDragBar()) captchaBox.appendChild(createDragBar())
canvas.parentNode.replaceChild(captchaBox, canvas) canvas.parentNode.replaceChild(captchaBox, canvas)
captchaBox.appendChild(dragBox) captchaBox.appendChild(dragBox)
return captchaBox return captchaBox
} }
function createDragBar() { function createDragBar() {
var dragbar = document.createElement('div') var dragbar = document.createElement('div')
dragbar.className = 'captcha-dragbar' dragbar.className = 'captcha-dragbar'
dragbar.innerHTML = '\n <div class="drag-option-bg">\n <div class="drag-option">\n <div class="drag-track"></div>\n <div id="drag-slider" class="drag-slider"></div>\n <div class="drag-btn">\n <i id="drag-btn-refresh" class="refresh"></i>\n </div>\n </div>\n </div>\n ' dragbar.innerHTML = '\n <div class="drag-option-bg">\n <div class="drag-option">\n <div class="drag-track"></div>\n <div id="drag-slider" class="drag-slider"></div>\n <div class="drag-btn">\n <i id="drag-btn-refresh" class="refresh"></i>\n </div>\n </div>\n </div>\n '
return dragbar return dragbar
} }
function createResult() { function createResult() {
var result = document.createElement('div') var result = document.createElement('div')
result.id = 'captcha-result' result.id = 'captcha-result'
result.className = 'captcha-result' result.className = 'captcha-result'
return result return result
} }
function createCanvas(w, h) { function createCanvas(w, h) {
var canvas = document.createElement('canvas') var canvas = document.createElement('canvas')
canvas.width = w canvas.width = w
canvas.height = h canvas.height = h
return canvas return canvas
} }
function clipPath(ctx, startx, starty) { function clipPath(ctx, startx, starty) {
startx = startx + 0.2 startx = startx + 0.2
starty = starty + 0.2 starty = starty + 0.2
var subw = parseInt((opts.cw - 1) / 6) var subw = parseInt((opts.cw - 1) / 6)
var subh = parseInt((opts.ch - 1) / 6) var subh = parseInt((opts.ch - 1) / 6)
var radius = Math.min(subw, subh) var radius = Math.min(subw, subh)
var clipw = subw * 5 + 0.5 var clipw = subw * 5 + 0.5
var cliph = subh * 5 + 0.5 var cliph = subh * 5 + 0.5
ctx.beginPath() ctx.beginPath()
ctx.moveTo(startx, starty) ctx.moveTo(startx, starty)
ctx.lineTo(startx + clipw, starty) ctx.lineTo(startx + clipw, starty)
ctx.lineTo(startx + clipw, starty + parseInt(cliph / 2) - radius) ctx.lineTo(startx + clipw, starty + parseInt(cliph / 2) - radius)
ctx.arc(startx + clipw, starty + parseInt(cliph / 2), radius, -Math.PI / 2, Math.PI / 2, false) ctx.arc(startx + clipw, starty + parseInt(cliph / 2), radius, -Math.PI / 2, Math.PI / 2, false)
ctx.lineTo(startx + clipw, starty + cliph) ctx.lineTo(startx + clipw, starty + cliph)
ctx.lineTo(startx + clipw - (parseInt(clipw / 2) - radius), starty + cliph) ctx.lineTo(startx + clipw - (parseInt(clipw / 2) - radius), starty + cliph)
ctx.arc(startx + parseInt(clipw / 2), starty + cliph, radius, 0, Math.PI, false) ctx.arc(startx + parseInt(clipw / 2), starty + cliph, radius, 0, Math.PI, false)
ctx.lineTo(startx, starty + cliph) ctx.lineTo(startx, starty + cliph)
ctx.lineTo(startx, starty) ctx.lineTo(startx, starty)
ctx.closePath() ctx.closePath()
} }
function fillClip(canvas, startx, starty, alpha) { function fillClip(canvas, startx, starty, alpha) {
var ctx = canvas.getContext('2d') var ctx = canvas.getContext('2d')
clipPath(ctx, startx, starty) clipPath(ctx, startx, starty)
ctx.fillStyle = 'rgba(0,0,0, ' + alpha + ')' ctx.fillStyle = 'rgba(0,0,0, ' + alpha + ')'
ctx.fill() ctx.fill()
} }
function strokeClip(canvas, startx, starty) { function strokeClip(canvas, startx, starty) {
var ctx = canvas.getContext('2d') var ctx = canvas.getContext('2d')
clipPath(ctx, startx, starty) clipPath(ctx, startx, starty)
ctx.strokeStyle = '#fff' ctx.strokeStyle = '#fff'
ctx.stroke() ctx.stroke()
} }
function randomNum(min, max) { function randomNum(min, max) {
var rangeNum = max - min var rangeNum = max - min
var num = min + Math.round(Math.random() * rangeNum) var num = min + Math.round(Math.random() * rangeNum)
return num return num
} }
function getStartPoint(w, h) { function getStartPoint(w, h) {
var padding = 10 var padding = 10
var startw = opts.cw + padding var startw = opts.cw + padding
var starth = opts.ch + padding var starth = opts.ch + padding
if (w < startw * 2 || h < starth) return if (w < startw * 2 || h < starth) return
var startPoint = { var startPoint = {
startx: randomNum(startw, w - startw), startx: randomNum(startw, w - startw),
starty: randomNum(padding, h - starth) starty: randomNum(padding, h - starth)
} }
return startPoint return startPoint
} }
function eventInit(startx, refreshMethod) { function eventInit(startx, refreshMethod) {
var dragBox = document.getElementById('drag-box') var dragBox = document.getElementById('drag-box')
var slider = document.getElementById('drag-slider') var slider = document.getElementById('drag-slider')
var clipcanvas = document.getElementById('captcha-clipcanvas') var clipcanvas = document.getElementById('captcha-clipcanvas')
var result = document.getElementById('captcha-result') var result = document.getElementById('captcha-result')
var refreshBtn = document.getElementById('drag-btn-refresh') var refreshBtn = document.getElementById('drag-btn-refresh')
var resultClass = result.className var resultClass = result.className
opts.eventinfo.left = parseFloat(getComputedStyle(slider, null).getPropertyValue('left')) opts.eventinfo.left = parseFloat(getComputedStyle(slider, null).getPropertyValue('left'))
opts.eventinfo.clipleft = parseFloat(getComputedStyle(clipcanvas, null).getPropertyValue('left')) opts.eventinfo.clipleft = parseFloat(getComputedStyle(clipcanvas, null).getPropertyValue('left'))
// var close = function close() {} // var close = function close() {}
var reset = function reset() { var reset = function reset() {
var boxClassName = window.captchaBox.className var boxClassName = window.captchaBox.className
// window.captchaBox.className += ' shake'; // window.captchaBox.className += ' shake';
setTimeout(function () { setTimeout(function () {
slider.style.left = '10px' slider.style.left = '10px'
clipcanvas.style.left = '20px' clipcanvas.style.left = '20px'
opts.eventinfo.left = 10 opts.eventinfo.left = 10
opts.eventinfo.clipleft = 20 opts.eventinfo.clipleft = 20
}, 500) }, 500)
setTimeout(function () { setTimeout(function () {
result.className = resultClass result.className = resultClass
window.captchaBox.className = boxClassName window.captchaBox.className = boxClassName
}, 1000) }, 1000)
} }
var moveStart = function moveStart(e) { var moveStart = function moveStart(e) {
opts.eventinfo.flag = true opts.eventinfo.flag = true
if (e.touches) { if (e.touches) {
opts.eventinfo.currentX = e.touches[0].clientX opts.eventinfo.currentX = e.touches[0].clientX
} else { } else {
opts.eventinfo.currentX = e.clientX opts.eventinfo.currentX = e.clientX
} }
dragBox.className = dragBox.className + ' drag-box-over' dragBox.className = dragBox.className + ' drag-box-over'
} }
var move = function move(e) { var move = function move(e) {
if (opts.eventinfo.flag) { if (opts.eventinfo.flag) {
if (e.touches) { if (e.touches) {
var disX = e.touches[0].clientX - opts.eventinfo.currentX var disX = e.touches[0].clientX - opts.eventinfo.currentX
} else { } else {
disX = e.clientX - opts.eventinfo.currentX disX = e.clientX - opts.eventinfo.currentX
} }
if (disX >= -10 && disX <= (dragBox.clientWidth - opts.cw - 10)) { if (disX >= -10 && disX <= (dragBox.clientWidth - opts.cw - 10)) {
slider.style.left = opts.eventinfo.left + disX + 'px' slider.style.left = opts.eventinfo.left + disX + 'px'
clipcanvas.style.left = opts.eventinfo.clipleft + disX + 'px' clipcanvas.style.left = opts.eventinfo.clipleft + disX + 'px'
} else { } else {
e.preventDefault() e.preventDefault()
} }
if (e.preventDefault) {} if (e.preventDefault) {}
return false return false
} }
} }
var moveEnd = function moveEnd(e) { var moveEnd = function moveEnd(e) {
dragBox.className = 'drag-box' dragBox.className = 'drag-box'
if (opts.eventinfo.flag) { if (opts.eventinfo.flag) {
opts.eventinfo.flag = false opts.eventinfo.flag = false
opts.eventinfo.left = parseFloat(getComputedStyle(slider, null).getPropertyValue('left')) opts.eventinfo.left = parseFloat(getComputedStyle(slider, null).getPropertyValue('left'))
opts.eventinfo.clipleft = parseFloat(getComputedStyle(clipcanvas, null).getPropertyValue('left')) opts.eventinfo.clipleft = parseFloat(getComputedStyle(clipcanvas, null).getPropertyValue('left'))
if (Math.abs(startx - opts.eventinfo.left) <= opts.precision) { if (Math.abs(startx - opts.eventinfo.left) <= opts.precision) {
result.innerHTML = opts.successText result.innerHTML = opts.successText
result.className = resultClass + ' success' result.className = resultClass + ' success'
opts.onSuccess && opts.onSuccess() opts.onSuccess && opts.onSuccess()
} else { } else {
result.innerHTML = opts.failText result.innerHTML = opts.failText
result.className = resultClass + ' fail' result.className = resultClass + ' fail'
reset() reset()
opts.onError && opts.onError() opts.onError && opts.onError()
} }
} }
} }
window.captchaMoveEnd = moveEnd window.captchaMoveEnd = moveEnd
slider.addEventListener('touchstart', moveStart) slider.addEventListener('touchstart', moveStart)
slider.addEventListener('mousedown', moveStart) slider.addEventListener('mousedown', moveStart)
slider.addEventListener('touchmove', move) slider.addEventListener('touchmove', move)
slider.addEventListener('mousemove', move) slider.addEventListener('mousemove', move)
document.addEventListener('touchend', moveEnd) document.addEventListener('touchend', moveEnd)
document.addEventListener('mouseup', moveEnd) document.addEventListener('mouseup', moveEnd)
dragBox.addEventListener('touchmove', move) dragBox.addEventListener('touchmove', move)
dragBox.addEventListener('mousemove', move) dragBox.addEventListener('mousemove', move)
refreshBtn.addEventListener('click', refreshMethod) refreshBtn.addEventListener('click', refreshMethod)
} }
var imgCaptcha = function imgCaptcha(canvas, options) { var imgCaptcha = function imgCaptcha(canvas, options) {
if (window.captchaMoveEnd) { if (window.captchaMoveEnd) {
document.removeEventListener('touchend', window.captchaMoveEnd) document.removeEventListener('touchend', window.captchaMoveEnd)
document.removeEventListener('mouseup', window.captchaMoveEnd) document.removeEventListener('mouseup', window.captchaMoveEnd)
window.captchaMoveEnd = undefined window.captchaMoveEnd = undefined
} }
for (var k in options) { for (var k in options) {
if (options.hasOwnProperty(k)) { if (options.hasOwnProperty(k)) {
opts[k] = options[k] opts[k] = options[k]
} }
} }
if (!canvas || !opts.imgurl) { if (!canvas || !opts.imgurl) {
console.error('verify params is error') console.error('verify params is error')
return return
} }
if (canvas.tagName !== 'CANVAS') { if (canvas.tagName !== 'CANVAS') {
console.error('param canvas must be canvas') console.error('param canvas must be canvas')
return return
} }
const resetCanvas = canvas.cloneNode() const resetCanvas = canvas.cloneNode()
window.captchaBox = createCaptchaBox(canvas) window.captchaBox = createCaptchaBox(canvas)
var refresh = function refresh() { var refresh = function refresh() {
if (options.container) { if (options.container) {
options.container.innerHTML = '' options.container.innerHTML = ''
const innerCanvas = resetCanvas.cloneNode() const innerCanvas = resetCanvas.cloneNode()
options.container.appendChild(innerCanvas) options.container.appendChild(innerCanvas)
imgCaptcha(innerCanvas, options) imgCaptcha(innerCanvas, options)
} }
} }
readerCaptcha(refresh) readerCaptcha(refresh)
return { return {
refresh refresh
} }
} }
var readerCaptcha = function readerCaptcha(refresh) { var readerCaptcha = function readerCaptcha(refresh) {
let canvas = window.captchaBox.children[0].children[0] let canvas = window.captchaBox.children[0].children[0]
canvas.className += canvas.className + ' captcha-bg' canvas.className += canvas.className + ' captcha-bg'
var img = new Image() var img = new Image()
img.onload = function () { img.onload = function () {
var w = canvas.width var w = canvas.width
var h = canvas.height var h = canvas.height
var startPoint = getStartPoint(w, h) var startPoint = getStartPoint(w, h)
if (!startPoint) { if (!startPoint) {
console.error('can not get the start point') console.error('can not get the start point')
return return
} }
var startx = startPoint.startx var startx = startPoint.startx
var starty = startPoint.starty var starty = startPoint.starty
canvas.getContext('2d').drawImage(img, 0, 0, w, h) canvas.getContext('2d').drawImage(img, 0, 0, w, h)
fillClip(canvas, startx, starty, 0.7) fillClip(canvas, startx, starty, 0.7)
var sourceCanvas = createCanvas(w, h) var sourceCanvas = createCanvas(w, h)
var sctx = sourceCanvas.getContext('2d') var sctx = sourceCanvas.getContext('2d')
sctx.drawImage(img, 0, 0, w, h) sctx.drawImage(img, 0, 0, w, h)
sctx.globalCompositeOperation = 'destination-in' sctx.globalCompositeOperation = 'destination-in'
var destCanvas = createCanvas(opts.cw, opts.ch) var destCanvas = createCanvas(opts.cw, opts.ch)
fillClip(destCanvas, 0, 0, 1) fillClip(destCanvas, 0, 0, 1)
sctx.drawImage(destCanvas, startx, starty) sctx.drawImage(destCanvas, startx, starty)
var clipCanvas = createCanvas(opts.cw, opts.ch) var clipCanvas = createCanvas(opts.cw, opts.ch)
clipCanvas.id = 'captcha-clipcanvas' clipCanvas.id = 'captcha-clipcanvas'
clipCanvas.className = 'captcha-clipcanvas' clipCanvas.className = 'captcha-clipcanvas'
clipCanvas.getContext('2d').putImageData(sctx.getImageData(startx, starty, opts.cw, opts.ch), 0, 0) clipCanvas.getContext('2d').putImageData(sctx.getImageData(startx, starty, opts.cw, opts.ch), 0, 0)
strokeClip(clipCanvas, 0, 0) strokeClip(clipCanvas, 0, 0)
clipCanvas.style.top = starty + 'px' clipCanvas.style.top = starty + 'px'
// captchaBox.appendChild(clipCanvas) // captchaBox.appendChild(clipCanvas)
eventInit(startx, refresh) eventInit(startx, refresh)
} }
opts.imgurl = isArray(opts.imgurl) ? opts.imgurl : [opts.imgurl] opts.imgurl = isArray(opts.imgurl) ? opts.imgurl : [opts.imgurl]
var urlIndex = Math.floor(Math.random() * opts.imgurl.length) var urlIndex = Math.floor(Math.random() * opts.imgurl.length)
img.src = opts.imgurl[urlIndex] img.src = opts.imgurl[urlIndex]
} }
// if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object') { // if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object') {
// module.exports = imgCaptcha // module.exports = imgCaptcha
// } else if (typeof define === 'function' && define.amd) { // } else if (typeof define === 'function' && define.amd) {
// define([], function () { // define([], function () {
// return imgCaptcha // return imgCaptcha
// }) // })
// } else if (window) { // } else if (window) {
// window.imgCaptcha = imgCaptcha // window.imgCaptcha = imgCaptcha
// } // }
})() })()

View File

@ -1,33 +1,33 @@
[ [
{ {
"id":"123", "id":"123",
"userName":"张嘉豪", "userName":"张嘉豪",
"department":"结构开发部" "department":"结构开发部"
}, },
{ {
"id":"2131", "id":"2131",
"userName":"李四", "userName":"李四",
"department":"结构开发部" "department":"结构开发部"
}, },
{ {
"id":"3214", "id":"3214",
"userName":"杜学凯", "userName":"杜学凯",
"department":"平台部" "department":"平台部"
}, },
{ {
"id":"1231", "id":"1231",
"userName":"李亚松", "userName":"李亚松",
"department":"平台部" "department":"平台部"
}, },
{ {
"id":"1232", "id":"1232",
"userName":"王五", "userName":"王五",
"department":"结构开发部" "department":"结构开发部"
}, },
{ {
"id":"1233", "id":"1233",
"userName":"张三", "userName":"张三",
"department":"平台部" "department":"平台部"
}, },
] ]

View File

@ -0,0 +1,47 @@
{
font-size: 14px;
}
.app-loading {
position: absolute;
top: 42%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-flow: column;
align-items: center;
}
.app-loading .loading-gif {
width: 60%;
height: 60%;
}
.app-ie :not(font) {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}{
font-size: 14px;
}
.app-loading {
position: absolute;
top: 42%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-flow: column;
align-items: center;
}
.app-loading .loading-gif {
width: 60%;
height: 60%;
}
.app-ie :not(font) {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

View File

@ -1,32 +1,32 @@
// 主题色 // 主题色
$--app-primary-color: #027AFF; $--app-primary-color: #027AFF;
$--app-sky-color: #1296db; $--app-sky-color: #1296db;
$--app-danger-color: #F56C6C; $--app-danger-color: #F56C6C;
$--app-info-color: #F5F7FA; $--app-info-color: #F5F7FA;
$--app-notice-color: #B2B2B2; $--app-notice-color: #B2B2B2;
$--app-selected-color: #E6F2FF; $--app-selected-color: #E6F2FF;
$--app-active-color: #7ED321; $--app-active-color: #7ED321;
$--app-success-color: #5ebf70; $--app-success-color: #5ebf70;
$--app-fail-color: #de715b; $--app-fail-color: #de715b;
$--app-light-color: #ffffff; $--app-light-color: #ffffff;
$--app-opacity-color: #eeeeee; $--app-opacity-color: #eeeeee;
$--app-warning-color: #F5A623; $--app-warning-color: #F5A623;
$--app-description-color: #929292; $--app-description-color: #929292;
// 标准盒子边框色 // 标准盒子边框色
$--app-border-color: #DCDFE6; $--app-border-color: #DCDFE6;
// 分割线颜色 // 分割线颜色
$--app-split-color: #EBEEF5; $--app-split-color: #EBEEF5;
// 标准字体颜色 // 标准字体颜色
$--app-font-color: #303133; $--app-font-color: #303133;
// 标准背景色 // 标准背景色
$--app-bg-Color: #F7F7F7; $--app-bg-Color: #F7F7F7;
// 标准盒子阴影 // 标准盒子阴影
$--app-box-shadow: 0 0 8px 0 $--app-split-color; $--app-box-shadow: 0 0 8px 0 $--app-split-color;
// 标准圆角 // 标准圆角
$--app-border-radius: 2px; $--app-border-radius: 2px;
// 标准加粗字体 // 标准加粗字体
$--app-font-weight: bold; $--app-font-weight: bold;
// 标准字体大小 // 标准字体大小
$--app-font-size: 12px; $--app-font-size: 12px;
// 标题字体大小 // 标题字体大小
$--app-title-fontSize: 14px; $--app-title-fontSize: 14px;

View File

@ -1,18 +1,18 @@
@import './app-variable.scss'; @import './app-variable.scss';
/* Color-------------------------- */ /* Color-------------------------- */
$--color-primary: $--app-primary-color; $--color-primary: $--app-primary-color;
$--border-radius-base: $--app-border-radius; $--border-radius-base: $--app-border-radius;
$--size-base: $--app-font-size ; $--size-base: $--app-font-size ;
$--input-height: 32px; $--input-height: 32px;
$--button-border-radius: $--app-border-radius; $--button-border-radius: $--app-border-radius;
$--button-medium-border-radius: $--app-border-radius; $--button-medium-border-radius: $--app-border-radius;
$--button-small-border-radius: $--app-border-radius; $--button-small-border-radius: $--app-border-radius;
$--button-mini-border-radius: $--app-border-radius; $--button-mini-border-radius: $--app-border-radius;

View File

@ -1,179 +1,179 @@
@import "~normalize.css"; @import "~normalize.css";
@import "./app-variable.scss"; @import "./app-variable.scss";
@import "./mixin.scss"; @import "./mixin.scss";
body * { body * {
font-family: Avenir, Helvetica, Arial, sans-serif; font-family: Avenir, Helvetica, Arial, sans-serif;
} }
*:focus { *:focus {
outline: none; outline: none;
} }
.x-svg-icon .svg-icon { .x-svg-icon .svg-icon {
width: 24px !important; width: 24px !important;
height: 24px !important; height: 24px !important;
} }
.x-product-skeleton { .x-product-skeleton {
background: linear-gradient(90deg,#f2f2f2 25%,#e6e6e6 37%,#f2f2f2 63%); background: linear-gradient(90deg,#f2f2f2 25%,#e6e6e6 37%,#f2f2f2 63%);
background-size: 400% 100%; background-size: 400% 100%;
animation: x-product-skeleton-loading 1.4s ease infinite; animation: x-product-skeleton-loading 1.4s ease infinite;
&.x-product-skeleton-block { &.x-product-skeleton-block {
width: 100%; width: 100%;
height: 24px; height: 24px;
margin: 0 8px; margin: 0 8px;
} }
&.x-product-skeleton-tag { &.x-product-skeleton-tag {
display: inline-block; display: inline-block;
box-sizing: content-box; box-sizing: content-box;
padding: 0 8px; padding: 0 8px;
width: 60px; width: 60px;
height: 24px; height: 24px;
} }
} }
@keyframes x-product-skeleton-loading { @keyframes x-product-skeleton-loading {
0% { 0% {
background-position: 100% 50%; background-position: 100% 50%;
} }
100% { 100% {
background-position: 0 50%; background-position: 0 50%;
} }
} }
.el-button { .el-button {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
padding: 0 20px !important; padding: 0 20px !important;
} }
.el-select { .el-select {
width: 100%; width: 100%;
} }
.el-date-editor { .el-date-editor {
width: 100% !important; width: 100% !important;
} }
.el-dropdown-menu { .el-dropdown-menu {
margin-top: 0 !important; margin-top: 0 !important;
.popper__arrow { .popper__arrow {
display: none !important; display: none !important;
} }
} }
.x-block-table .el-table thead { .x-block-table .el-table thead {
font-size: $--app-font-size; font-size: $--app-font-size;
} }
.x-loading .mask { .x-loading .mask {
background-color: $--app-light-color; background-color: $--app-light-color;
} }
.app-workbench__icon { .app-workbench__icon {
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: 36px; margin-right: 36px;
&:hover { &:hover {
cursor: pointer; cursor: pointer;
color: $--app-primary-color; color: $--app-primary-color;
} }
} }
.app-menu__switch { .app-menu__switch {
position: absolute; position: absolute;
top: calc(50% - 40px); top: calc(50% - 40px);
right: -16px; right: -16px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
z-index: 200; z-index: 200;
width: 16px; width: 16px;
height: 80px; height: 80px;
border-top-right-radius: 16px; border-top-right-radius: 16px;
border-bottom-right-radius: 16px; border-bottom-right-radius: 16px;
border: 1px solid $--app-light-color; border: 1px solid $--app-light-color;
border-left: 0; border-left: 0;
cursor: pointer; cursor: pointer;
opacity: 0.5; opacity: 0.5;
border: 1px solid $--app-border-color; border: 1px solid $--app-border-color;
border-left: none; border-left: none;
background-color: $--app-light-color; background-color: $--app-light-color;
} }
.el-dialog__wrapper { .el-dialog__wrapper {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 12px 0; padding: 12px 0;
.x-modal-wrapper { .x-modal-wrapper {
margin: 0 auto !important; margin: 0 auto !important;
padding: 12px 20px; padding: 12px 20px;
.el-dialog__header { .el-dialog__header {
padding: 12px 8px 12px 12px !important; padding: 12px 8px 12px 12px !important;
} }
.el-dialog__body { .el-dialog__body {
padding: 12px; padding: 12px;
} }
.el-dialog__footer { .el-dialog__footer {
padding: 12px !important; padding: 12px !important;
} }
} }
.x-modal-wrapper { .x-modal-wrapper {
.modal-header-row { .modal-header-row {
display: flex; display: flex;
align-items: center; align-items: center;
.header-title { .header-title {
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
} }
.search-block { .search-block {
margin-left: 16px; margin-left: 16px;
margin-right: 24px; margin-right: 24px;
border-left: 1px solid $--app-border-color; border-left: 1px solid $--app-border-color;
flex: 1; flex: 1;
height: 14px; height: 14px;
display: flex; display: flex;
align-items: center; align-items: center;
.el-input { .el-input {
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
.el-input__inner { .el-input__inner {
position: relative; position: relative;
left: 28px; left: 28px;
height: 100%; height: 100%;
font-size: 12px; font-size: 12px;
border: 0; border: 0;
} }
.el-input__prefix { .el-input__prefix {
display: flex; display: flex;
align-items: center; align-items: center;
left: 12px; left: 12px;
.header-search-icon { .header-search-icon {
width: 14px; width: 14px;
height: 14px; height: 14px;
} }
} }
} }
} }
.block { .block {
flex: 1; flex: 1;
} }
.header-close-icon { .header-close-icon {
cursor: pointer; cursor: pointer;
&:hover { &:hover {
color: $--app-primary-color; color: $--app-primary-color;
} }
} }
} }
} }
} }

View File

@ -1,26 +1,26 @@
/** /**
* @description: 如果font-size为10的话则使用缩放处理 * @description: 如果font-size为10的话则使用缩放处理
* @param {type} * @param {type}
* @return: * @return:
*/ */
@mixin fontSize($fontSize) { @mixin fontSize($fontSize) {
@if $fontSize == 10px { @if $fontSize == 10px {
font-size: 12px; font-size: 12px;
transform: scale(.83); transform: scale(.83);
} @else { } @else {
font-size: $fontSize; font-size: $fontSize;
} }
} }
/** /**
* @description: 把图形变成圆形 * @description: 把图形变成圆形
* @param {type} * @param {type}
* @return: * @return:
*/ */
@mixin circleShape($width) { @mixin circleShape($width) {
width: $width; width: $width;
min-width: $width; min-width: $width;
height: $width; height: $width;
min-height: $width; min-height: $width;
border-radius: 50%; border-radius: 50%;
} }

View File

@ -1,4 +1,4 @@
@import "./app-variable.scss"; @import "./app-variable.scss";
@import "./element-variable.scss"; @import "./element-variable.scss";
// 引入mixin // 引入mixin
@import "./mixin.scss"; @import "./mixin.scss";

View File

@ -1,108 +1,108 @@
<template> <template>
<x-app-layout <x-app-layout
:layoutEngine="layoutEngine" :layoutEngine="layoutEngine"
:isCollapse="isCollapse" :isCollapse="isCollapse"
> >
<template v-slot:header> <template v-slot:header>
<x-app-header v-if="appInfo" :layoutEngine="layoutEngine" :appInfo="appInfo"></x-app-header> <x-app-header v-if="appInfo" :layoutEngine="layoutEngine" :appInfo="appInfo"></x-app-header>
</template> </template>
<template v-slot:menu> <template v-slot:menu>
<x-app-menu <x-app-menu
:menuConfig="menuConfig" :menuConfig="menuConfig"
:showMenu="showMenu && !!appInfo" :showMenu="showMenu && !!appInfo"
:isCollapse="isCollapse" :isCollapse="isCollapse"
:layoutEngine="layoutEngine" :layoutEngine="layoutEngine"
@menu-add-click="menuAddClick" @menu-add-click="menuAddClick"
></x-app-menu> ></x-app-menu>
</template> </template>
<template slot="appPage"> <template slot="appPage">
<div class="menu-switch" @click="changeCollapse"> <div class="menu-switch" @click="changeCollapse">
<x-svg-icon v-if="isCollapse" name="arrow-right-icon"></x-svg-icon> <x-svg-icon v-if="isCollapse" name="arrow-right-icon"></x-svg-icon>
<x-svg-icon v-else name="arrow-left-icon"></x-svg-icon> <x-svg-icon v-else name="arrow-left-icon"></x-svg-icon>
</div> </div>
<slot name="appPage"></slot> <slot name="appPage"></slot>
</template> </template>
</x-app-layout> </x-app-layout>
</template> </template>
<script> <script>
export default { export default {
name: 'AppLayout', name: 'AppLayout',
props: { props: {
layoutEngine: { layoutEngine: {
type: Object, type: Object,
default: function() { default: function() {
return {} return {}
} }
} }
}, },
data() { data() {
return { return {
isCollapse: false, isCollapse: false,
showMenu: true showMenu: true
} }
}, },
computed: { computed: {
appInfo() { appInfo() {
return (this.layoutEngine && this.layoutEngine.layoutDataControl && this.layoutEngine.layoutDataControl.appInfo) || {} return (this.layoutEngine && this.layoutEngine.layoutDataControl && this.layoutEngine.layoutDataControl.appInfo) || {}
}, },
menuConfig() { menuConfig() {
return (this.layoutEngine && this.layoutEngine.layoutDataControl && this.layoutEngine.layoutDataControl.menuConfig) || { return (this.layoutEngine && this.layoutEngine.layoutDataControl && this.layoutEngine.layoutDataControl.menuConfig) || {
menu: [], menu: [],
defaultActive: null, defaultActive: null,
menuTreeData: [] menuTreeData: []
} }
} }
}, },
methods: { methods: {
changeCollapse() { changeCollapse() {
this.showMenu = false this.showMenu = false
this.$nextTick(() => { this.$nextTick(() => {
this.isCollapse = !this.isCollapse this.isCollapse = !this.isCollapse
this.showMenu = true this.showMenu = true
}) })
}, },
menuAddClick(e) { menuAddClick(e) {
this.$emit('menu-add-click', e) this.$emit('menu-add-click', e)
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
$--app-box-bgColor: #ffffff; $--app-box-bgColor: #ffffff;
$--app-box-border-color: #DCDFE6; $--app-box-border-color: #DCDFE6;
.x-app-layout { .x-app-layout {
.layout-middle { .layout-middle {
.layout-center { .layout-center {
.menu-switch { .menu-switch {
width: 14px; width: 14px;
height: 80px; height: 80px;
padding-right: 2px; padding-right: 2px;
border-top-right-radius: 18px; border-top-right-radius: 18px;
border-bottom-right-radius: 18px; border-bottom-right-radius: 18px;
border: 1px solid $--app-box-bgColor; border: 1px solid $--app-box-bgColor;
border-left: 0; border-left: 0;
background-color: $--app-box-bgColor; background-color: $--app-box-bgColor;
position: absolute; position: absolute;
top: calc(50vh - 87px); top: calc(50vh - 87px);
left: -20px; left: -20px;
transform: translateX(120%); transform: translateX(120%);
cursor: pointer; cursor: pointer;
opacity: 0.5; opacity: 0.5;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
z-index: 500; z-index: 500;
border: 1px solid $--app-box-border-color; border: 1px solid $--app-box-border-color;
border-left: none; border-left: none;
} }
.menu-switch:hover { .menu-switch:hover {
background-color: $--app-box-bgColor; background-color: $--app-box-bgColor;
opacity: 1; opacity: 1;
box-shadow: 2px 0px 4px 0px $--app-box-border-color; box-shadow: 2px 0px 4px 0px $--app-box-border-color;
} }
} }
} }
} }
</style> </style>

View File

@ -1,135 +1,135 @@
<template> <template>
<div class="base-header"> <div class="base-header">
<div class="base-header__prefix"> <div class="base-header__prefix">
<img class="base-header__logo" src="~@/assets/img/logo.png" /> <img class="base-header__logo" src="~@/assets/img/logo.png" />
</div> </div>
<div class="base-header__container"> <div class="base-header__container">
<slot></slot> <slot></slot>
</div> </div>
<div class="base-header__suffix"> <div class="base-header__suffix">
<slot name="append"></slot> <slot name="append"></slot>
<el-dropdown trigger="click" placement="bottom" @command="handleCommand"> <el-dropdown trigger="click" placement="bottom" @command="handleCommand">
<person-avatar <person-avatar
:personName="userInfo.userName" :personName="userInfo.userName"
></person-avatar> ></person-avatar>
<el-dropdown-menu slot="dropdown" class="base-header__menu"> <el-dropdown-menu slot="dropdown" class="base-header__menu">
<el-dropdown-item command="personal"> <el-dropdown-item command="personal">
<div class="base-header__menu-item"> <div class="base-header__menu-item">
<x-svg-icon class="base-header__icon" name="personal-icon"></x-svg-icon> <x-svg-icon class="base-header__icon" name="personal-icon"></x-svg-icon>
<span class="base-header__text">个人中心</span> <span class="base-header__text">个人中心</span>
</div> </div>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item command="admin"> <el-dropdown-item command="admin">
<div class="base-header__menu-item"> <div class="base-header__menu-item">
<x-svg-icon class="base-header__icon" name="admin-icon"></x-svg-icon> <x-svg-icon class="base-header__icon" name="admin-icon"></x-svg-icon>
<span class="base-header__text">后台管理</span> <span class="base-header__text">后台管理</span>
</div> </div>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item command="logout"> <el-dropdown-item command="logout">
<div class="base-header__menu-item"> <div class="base-header__menu-item">
<x-svg-icon class="base-header__icon" name="logout-icon"></x-svg-icon> <x-svg-icon class="base-header__icon" name="logout-icon"></x-svg-icon>
<span class="base-header__text">退出登录</span> <span class="base-header__text">退出登录</span>
</div> </div>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import PersonAvatar from '@/components/person-avatar' import PersonAvatar from '@/components/person-avatar'
import { mapState } from 'vuex' import { mapState } from 'vuex'
export default { export default {
name: 'BaseHeader', name: 'BaseHeader',
components: { components: {
PersonAvatar PersonAvatar
}, },
data() { data() {
return {} return {}
}, },
computed: { computed: {
...mapState({ ...mapState({
userInfo: state => state.authModule.userInfo userInfo: state => state.authModule.userInfo
}) })
}, },
methods: { methods: {
handleCommand(command) { handleCommand(command) {
console.log(command) console.log(command)
if (command === 'personal') { if (command === 'personal') {
this.$router.push({ name: 'personal' }) this.$router.push({ name: 'personal' })
} else if (command === 'admin') { } else if (command === 'admin') {
this.$router.push({ name: 'admin' }) this.$router.push({ name: 'admin' })
} else if (command === 'logout') { } else if (command === 'logout') {
this.$router.push({ name: 'account' }) this.$router.push({ name: 'account' })
} }
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.base-header { .base-header {
display: flex; display: flex;
align-items: center; align-items: center;
position: relative; position: relative;
z-index: 101; z-index: 101;
height: 64px; height: 64px;
box-shadow: $--app-box-shadow; box-shadow: $--app-box-shadow;
background-color: $--app-light-color; background-color: $--app-light-color;
.base-header__prefix, .base-header__suffix { .base-header__prefix, .base-header__suffix {
flex: 1; flex: 1;
} }
.base-header__prefix { .base-header__prefix {
display: flex; display: flex;
padding-left: 88px; padding-left: 88px;
} }
.base-header__suffix { .base-header__suffix {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
padding-right: 20px; padding-right: 20px;
.person-avatar { .person-avatar {
cursor: pointer; cursor: pointer;
@include circleShape(36px); @include circleShape(36px);
} }
} }
.base-header__container { .base-header__container {
width: 1100px; width: 1100px;
} }
.base-header__logo { .base-header__logo {
width: 140px; width: 140px;
height: 36px; height: 36px;
} }
} }
.base-header__text { .base-header__text {
font-size: $--app-font-size; font-size: $--app-font-size;
color: $--app-font-color; color: $--app-font-color;
} }
.base-header__icon { .base-header__icon {
color: $--app-font-color; color: $--app-font-color;
} }
.el-dropdown-menu.base-header__menu { .el-dropdown-menu.base-header__menu {
padding: 4px 0; padding: 4px 0;
margin-right: 12px; margin-right: 12px;
width: 112px; width: 112px;
box-shadow: $--app-box-shadow; box-shadow: $--app-box-shadow;
.el-dropdown-menu__item { .el-dropdown-menu__item {
padding-left: 16px; padding-left: 16px;
padding-right: 20px; padding-right: 20px;
i { i {
margin-right: 4px; margin-right: 4px;
} }
} }
.popper__arrow { .popper__arrow {
display: none !important; display: none !important;
} }
.base-header__menu-item { .base-header__menu-item {
display: flex; display: flex;
} }
} }
</style> </style>

View File

@ -1,43 +1,43 @@
<template> <template>
<el-menu-item <el-menu-item
v-bind="$attrs" v-bind="$attrs"
class="base-menu-item" class="base-menu-item"
v-on="$listeners" v-on="$listeners"
> >
<x-svg-icon class="base-menu-item__icon" :name="icon"></x-svg-icon> <x-svg-icon class="base-menu-item__icon" :name="icon"></x-svg-icon>
<span class="base-menu-item__name">{{ name }}</span> <span class="base-menu-item__name">{{ name }}</span>
</el-menu-item> </el-menu-item>
</template> </template>
<script> <script>
export default { export default {
name: 'BaseMenuItem', name: 'BaseMenuItem',
props: { props: {
icon: String, icon: String,
name: String name: String
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.el-menu-item.base-menu-item { .el-menu-item.base-menu-item {
display: flex; display: flex;
height: 44px; height: 44px;
line-height: 44px; line-height: 44px;
&.is-active { &.is-active {
background-color: $--app-selected-color; background-color: $--app-selected-color;
} }
&:hover, &:focus { &:hover, &:focus {
color: $--app-primary-color; color: $--app-primary-color;
font-weight: $--app-font-weight; font-weight: $--app-font-weight;
background-color: $--app-info-color; background-color: $--app-info-color;
} }
.base-menu-item__icon { .base-menu-item__icon {
margin-right: 12px; margin-right: 12px;
color: inherit; color: inherit;
} }
.base-menu-item__name { .base-menu-item__name {
font-size: $--app-title-fontSize; font-size: $--app-title-fontSize;
} }
} }
</style> </style>

View File

@ -1,76 +1,76 @@
<template> <template>
<el-submenu <el-submenu
v-bind="$attrs" v-bind="$attrs"
class="base-submenu-tree" class="base-submenu-tree"
v-on="$listeners" v-on="$listeners"
> >
<template v-slot:title> <template v-slot:title>
<div class="base-submenu-tree__title"> <div class="base-submenu-tree__title">
<x-svg-icon class="base-submenu-tree__icon" :name="icon"></x-svg-icon> <x-svg-icon class="base-submenu-tree__icon" :name="icon"></x-svg-icon>
<span class="base-submenu-tree__name">{{ name }}</span> <span class="base-submenu-tree__name">{{ name }}</span>
</div> </div>
</template> </template>
<template v-for="menu in menuData"> <template v-for="menu in menuData">
<template v-if="menu.children && menu.children.length > 0"> <template v-if="menu.children && menu.children.length > 0">
<base-submenu-tree <base-submenu-tree
:key="menu.index" :key="menu.index"
:index="menu.index" :index="menu.index"
:icon="menu.icon" :icon="menu.icon"
:name="menu.name" :name="menu.name"
:menuData="menu.children" :menuData="menu.children"
:popper-append-to-body="false" :popper-append-to-body="false"
></base-submenu-tree> ></base-submenu-tree>
</template> </template>
<template v-else> <template v-else>
<base-menu-item <base-menu-item
:key="menu.index" :key="menu.index"
:index="menu.index" :index="menu.index"
:icon="menu.icon" :icon="menu.icon"
:name="menu.name" :name="menu.name"
></base-menu-item> ></base-menu-item>
</template> </template>
</template> </template>
</el-submenu> </el-submenu>
</template> </template>
<script> <script>
import BaseMenuItem from './base-menu-item' import BaseMenuItem from './base-menu-item'
export default { export default {
name: 'BaseSubmenuTree', name: 'BaseSubmenuTree',
components: { components: {
BaseMenuItem BaseMenuItem
}, },
props: { props: {
icon: String, icon: String,
name: String, name: String,
menuData: { menuData: {
type: Array, type: Array,
default() { default() {
return [] return []
} }
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.el-submenu.base-submenu-tree { .el-submenu.base-submenu-tree {
line-height: 44px; line-height: 44px;
.el-submenu__title { .el-submenu__title {
height: 44px; height: 44px;
line-height: 44px; line-height: 44px;
} }
.base-submenu-tree__title { .base-submenu-tree__title {
display: flex; display: flex;
height: 100%; height: 100%;
.base-submenu-tree__icon { .base-submenu-tree__icon {
margin-right: 12px; margin-right: 12px;
color: inherit; color: inherit;
} }
.base-submenu-tree__name { .base-submenu-tree__name {
font-size: $--app-title-fontSize; font-size: $--app-title-fontSize;
} }
} }
} }
</style> </style>

View File

@ -1,63 +1,63 @@
<template> <template>
<el-menu <el-menu
class="base-menu-tree" class="base-menu-tree"
v-bind="$attrs" v-bind="$attrs"
v-on="$listeners" v-on="$listeners"
> >
<template v-for="menu in menuData"> <template v-for="menu in menuData">
<template v-if="menu.children && menu.children.length > 0"> <template v-if="menu.children && menu.children.length > 0">
<base-submenu-tree <base-submenu-tree
:key="menu.index" :key="menu.index"
:index="menu.index" :index="menu.index"
:icon="menu.icon" :icon="menu.icon"
:name="menu.name" :name="menu.name"
:menuData="menu.children" :menuData="menu.children"
:popper-append-to-body="false" :popper-append-to-body="false"
></base-submenu-tree> ></base-submenu-tree>
</template> </template>
<template v-else> <template v-else>
<base-menu-item <base-menu-item
:key="menu.index" :key="menu.index"
:index="menu.index" :index="menu.index"
:icon="menu.icon" :icon="menu.icon"
:name="menu.name" :name="menu.name"
></base-menu-item> ></base-menu-item>
</template> </template>
</template> </template>
</el-menu> </el-menu>
</template> </template>
<script> <script>
import BaseSubmenuTree from './base-submenu-tree' import BaseSubmenuTree from './base-submenu-tree'
import BaseMenuItem from './base-menu-item' import BaseMenuItem from './base-menu-item'
export default { export default {
name: 'BaseMenuTree', name: 'BaseMenuTree',
components: { components: {
BaseMenuItem, BaseMenuItem,
BaseSubmenuTree BaseSubmenuTree
}, },
props: { props: {
menuData: { menuData: {
type: Array, type: Array,
default() { default() {
return [] return []
} }
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.el-menu.base-menu-tree { .el-menu.base-menu-tree {
border-right: 0; border-right: 0;
padding: 16px 0; padding: 16px 0;
max-height: calc(100vh - 64px); max-height: calc(100vh - 64px);
overflow-y: auto; overflow-y: auto;
background-color: $--app-light-color; background-color: $--app-light-color;
box-shadow: $--app-box-shadow; box-shadow: $--app-box-shadow;
&:not(.el-menu--collapse) { &:not(.el-menu--collapse) {
width: 220px; width: 220px;
} }
} }
</style> </style>

View File

@ -1,48 +1,48 @@
<template> <template>
<div :class="className"> <div :class="className">
<span class="base-status-tag__text">{{ status === 'ENABLED' ? enableText : disableText }}</span> <span class="base-status-tag__text">{{ status === 'ENABLED' ? enableText : disableText }}</span>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'BaseStatusTag', name: 'BaseStatusTag',
props: { props: {
status: String, status: String,
enableText: { enableText: {
type: String, type: String,
default: '启用' default: '启用'
}, },
disableText: { disableText: {
type: String, type: String,
default: '未启用' default: '未启用'
} }
}, },
computed: { computed: {
className() { className() {
return `base-status-tag ${this.status ? 'is-enable' : 'is-disable'}` return `base-status-tag ${this.status ? 'is-enable' : 'is-disable'}`
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.base-status-tag { .base-status-tag {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 52px; width: 52px;
height: 24px; height: 24px;
border-radius: 12px; border-radius: 12px;
.base-status-tag__text { .base-status-tag__text {
font-size: $--app-font-size; font-size: $--app-font-size;
color: $--app-light-color; color: $--app-light-color;
} }
&.is-enable { &.is-enable {
background-color: $--app-active-color; background-color: $--app-active-color;
} }
&.is-disable { &.is-disable {
background-color: $--app-notice-color; background-color: $--app-notice-color;
} }
} }
</style> </style>

View File

@ -1,14 +1,14 @@
export default { export default {
'input-code': { 'input-code': {
codePlaceholder: '验证码', codePlaceholder: '验证码',
codeBtnText: '发送验证码', codeBtnText: '发送验证码',
codeDisabledSuffixText: '无', codeDisabledSuffixText: '无',
slideBlock: { slideBlock: {
failText: '拖动滑块将悬浮图像正确拼合', failText: '拖动滑块将悬浮图像正确拼合',
successText: '验证通过' successText: '验证通过'
} }
}, },
'input-password': { 'input-password': {
placeholder: '密码' placeholder: '密码'
} }
} }

View File

@ -1,117 +1,117 @@
<template> <template>
<div class="identify-code"> <div class="identify-code">
<el-popover <el-popover
v-model="visiable" v-model="visiable"
trigger="click" trigger="click"
placement="top" placement="top"
:popperClass="popperClass" :popperClass="popperClass"
:disabled="!btnDisabled && disabled" :disabled="!btnDisabled && disabled"
@show="handleShow" @show="handleShow"
@hide="handleHide" @hide="handleHide"
> >
<slide-block v-if="visiable" @success="handleSuccess"></slide-block> <slide-block v-if="visiable" @success="handleSuccess"></slide-block>
<template v-if="disabled"> <template v-if="disabled">
<el-button slot="reference" type="info" class="identigy-btn"> <el-button slot="reference" type="info" class="identigy-btn">
{{ count + $t('component.input-code.codeDisabledSuffixText') }} {{ count + $t('component.input-code.codeDisabledSuffixText') }}
</el-button> </el-button>
</template> </template>
<template v-else> <template v-else>
<el-button slot="reference" type="primary" class="identigy-btn" :disabled="btnDisabled" :loading="loading"> <el-button slot="reference" type="primary" class="identigy-btn" :disabled="btnDisabled" :loading="loading">
{{ loading ? '' : btnText }} {{ loading ? '' : btnText }}
</el-button> </el-button>
</template> </template>
</el-popover> </el-popover>
</div> </div>
</template> </template>
<script> <script>
import SlideBlock from './slide-block' import SlideBlock from './slide-block'
export default { export default {
components: { components: {
'slide-block': SlideBlock 'slide-block': SlideBlock
}, },
props: { props: {
'btnText': { 'btnText': {
type: String, type: String,
default() { default() {
return this.$t('component.input-code.codeBtnText') return this.$t('component.input-code.codeBtnText')
} }
}, },
'btnDisabled': { 'btnDisabled': {
type: Boolean, type: Boolean,
default: false default: false
}, },
'popperClass': { 'popperClass': {
type: String, type: String,
default: '' default: ''
} }
}, },
data() { data() {
return { return {
visiable: false, visiable: false,
disabled: false, disabled: false,
count: 60, count: 60,
timer: null, timer: null,
loading: false, loading: false,
showCanvas: true showCanvas: true
} }
}, },
beforeDestroy() { beforeDestroy() {
clearInterval(this.timer) clearInterval(this.timer)
}, },
methods: { methods: {
handleShow() { handleShow() {
this.visiable = true this.visiable = true
this.$emit('show-popover') this.$emit('show-popover')
}, },
handleHide() { handleHide() {
this.visiable = false this.visiable = false
}, },
handleSuccess() { handleSuccess() {
this.handleHide() this.handleHide()
this.loading = true this.loading = true
this.$emit('verify-success', (isNeedTimer) => { this.$emit('verify-success', (isNeedTimer) => {
this.loading = false this.loading = false
if (typeof isNeedTimer === 'undefined' || isNeedTimer) { if (typeof isNeedTimer === 'undefined' || isNeedTimer) {
this.disabled = true this.disabled = true
this.initTimer() this.initTimer()
} }
}) })
}, },
initTimer() { initTimer() {
this.count = 60 this.count = 60
if (this.timer) clearInterval(this.timer) if (this.timer) clearInterval(this.timer)
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.count-- this.count--
if (this.count === 0) { if (this.count === 0) {
this.disabled = false this.disabled = false
} }
}, 1000) }, 1000)
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.identify-code { .identify-code {
height: 34px; height: 34px;
line-height: 34px; line-height: 34px;
.identigy-btn { .identigy-btn {
width: 100px; width: 100px;
text-align: center; text-align: center;
padding: 0 !important; padding: 0 !important;
border-top-left-radius: 0; border-top-left-radius: 0;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
} }
} }
</style> </style>
<style lang="scss"> <style lang="scss">
.identify-code { .identify-code {
.el-button--info { .el-button--info {
background-color: $--app-notice-color; background-color: $--app-notice-color;
border-color: $--app-notice-color; border-color: $--app-notice-color;
} }
} }
</style> </style>

View File

@ -1,196 +1,196 @@
<template> <template>
<div class="slide-block"> <div class="slide-block">
<div ref="canvas-container"> <div ref="canvas-container">
<canvas ref="canvas" width="260" height="160"></canvas> <canvas ref="canvas" width="260" height="160"></canvas>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import imgCaptcha from '@/assets/js/captcha.js' import imgCaptcha from '@/assets/js/captcha.js'
export default { export default {
props: { props: {
'failText': { 'failText': {
type: String, type: String,
default() { default() {
return this.$t('component.input-code.slideBlock.failText') return this.$t('component.input-code.slideBlock.failText')
} }
}, },
'successText': { 'successText': {
type: String, type: String,
default() { default() {
return this.$t('component.input-code.slideBlock.successText') return this.$t('component.input-code.slideBlock.successText')
} }
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
const self = this const self = this
imgCaptcha(this.$refs.canvas, { imgCaptcha(this.$refs.canvas, {
container: this.$refs['canvas-container'], container: this.$refs['canvas-container'],
imgurl: [ imgurl: [
`${this.$envUrl('/img/slide-block/1@2x.jpg')}`, `${this.$envUrl('/img/slide-block/1@2x.jpg')}`,
`${this.$envUrl('/img/slide-block/2@2x.jpg')}`, `${this.$envUrl('/img/slide-block/2@2x.jpg')}`,
`${this.$envUrl('/img/slide-block/3@2x.jpg')}`, `${this.$envUrl('/img/slide-block/3@2x.jpg')}`,
`${this.$envUrl('/img/slide-block/4@2x.jpg')}`, `${this.$envUrl('/img/slide-block/4@2x.jpg')}`,
`${this.$envUrl('/img/slide-block/5@2x.jpg')}`, `${this.$envUrl('/img/slide-block/5@2x.jpg')}`,
`${this.$envUrl('/img/slide-block/6@2x.jpg')}`, `${this.$envUrl('/img/slide-block/6@2x.jpg')}`,
`${this.$envUrl('/img/slide-block/7@2x.jpg')}`, `${this.$envUrl('/img/slide-block/7@2x.jpg')}`,
`${this.$envUrl('/img/slide-block/8@2x.jpg')}`, `${this.$envUrl('/img/slide-block/8@2x.jpg')}`,
`${this.$envUrl('/img/slide-block/9@2x.jpg')}`, `${this.$envUrl('/img/slide-block/9@2x.jpg')}`,
`${this.$envUrl('/img/slide-block/10@2x.jpg')}`, `${this.$envUrl('/img/slide-block/10@2x.jpg')}`,
`${this.$envUrl('/img/slide-block/11@2x.jpg')}`, `${this.$envUrl('/img/slide-block/11@2x.jpg')}`,
`${this.$envUrl('/img/slide-block/12@2x.jpg')}`, `${this.$envUrl('/img/slide-block/12@2x.jpg')}`,
`${this.$envUrl('/img/slide-block/13@2x.jpg')}`, `${this.$envUrl('/img/slide-block/13@2x.jpg')}`,
`${this.$envUrl('/img/slide-block/14@2x.jpg')}`, `${this.$envUrl('/img/slide-block/14@2x.jpg')}`,
`${this.$envUrl('/img/slide-block/15@2x.jpg')}`, `${this.$envUrl('/img/slide-block/15@2x.jpg')}`,
`${this.$envUrl('/img/slide-block/16@2x.jpg')}`, `${this.$envUrl('/img/slide-block/16@2x.jpg')}`,
`${this.$envUrl('/img/slide-block/17@2x.jpg')}`, `${this.$envUrl('/img/slide-block/17@2x.jpg')}`,
`${this.$envUrl('/img/slide-block/18@2x.jpg')}`, `${this.$envUrl('/img/slide-block/18@2x.jpg')}`,
`${this.$envUrl('/img/slide-block/19@2x.jpg')}`, `${this.$envUrl('/img/slide-block/19@2x.jpg')}`,
`${this.$envUrl('/img/slide-block/20@2x.jpg')}` `${this.$envUrl('/img/slide-block/20@2x.jpg')}`
], ],
cw: 50, cw: 50,
ch: 50, ch: 50,
successText: this.successText, successText: this.successText,
failText: this.failText, failText: this.failText,
onSuccess: function() { onSuccess: function() {
setTimeout(() => { setTimeout(() => {
self.$emit('success') self.$emit('success')
}, 1000) }, 1000)
}, },
onError: function() { onError: function() {
self.$emit('error') self.$emit('error')
} }
}) })
}) })
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
@keyframes shake { @keyframes shake {
0%, 0%,
to { to {
transform: translateZ(0); transform: translateZ(0);
} }
5%, 5%,
10% { 10% {
transform: translate3d(-3px, 0, 0); transform: translate3d(-3px, 0, 0);
} }
10%, 10%,
15% { 15% {
transform: translate3d(3px, 0, 0); transform: translate3d(3px, 0, 0);
} }
} }
.captcha-box { .captcha-box {
position: relative; position: relative;
background: $--app-light-color; background: $--app-light-color;
border: 1px solid $--app-border-color; border: 1px solid $--app-border-color;
padding: 0 10px; padding: 0 10px;
box-sizing: content-box; box-sizing: content-box;
} }
.captcha-box.shake { .captcha-box.shake {
animation: shake 0.5s; animation: shake 0.5s;
} }
.captcha-box .canvas-box { .captcha-box .canvas-box {
overflow: hidden; overflow: hidden;
position: relative; position: relative;
} }
.canvas-box .captcha-result { .canvas-box .captcha-result {
position: absolute; position: absolute;
left: 0; left: 0;
width: 100%; width: 100%;
color: $--app-light-color; color: $--app-light-color;
bottom: -25px; bottom: -25px;
height: 24px; height: 24px;
text-indent: 16px; text-indent: 16px;
font-size: 14px; font-size: 14px;
line-height: 24px; line-height: 24px;
-moz-transition: bottom 0.3s ease; -moz-transition: bottom 0.3s ease;
-o-transition: bottom 0.3s ease; -o-transition: bottom 0.3s ease;
-webkit-transition: bottom 0.3s ease; -webkit-transition: bottom 0.3s ease;
transition: bottom 0.3s ease; transition: bottom 0.3s ease;
} }
.canvas-box .captcha-result.fail { .canvas-box .captcha-result.fail {
background-color: $--app-fail-color; background-color: $--app-fail-color;
bottom: 0; bottom: 0;
} }
.canvas-box .captcha-result.success { .canvas-box .captcha-result.success {
background-color: $--app-success-color; background-color: $--app-success-color;
bottom: 0; bottom: 0;
} }
.captcha-box .captcha-bg { .captcha-box .captcha-bg {
display: block; display: block;
} }
.captcha-box .captcha-clipcanvas { .captcha-box .captcha-clipcanvas {
position: absolute; position: absolute;
left: 20px; left: 20px;
} }
.captcha-box .captcha-dragbar { .captcha-box .captcha-dragbar {
margin-top: 5px; margin-top: 5px;
margin-bottom: 10px; margin-bottom: 10px;
padding-top: 8px; padding-top: 8px;
position: relative; position: relative;
box-sizing: border-box; box-sizing: border-box;
} }
.captcha-dragbar .drag-track { .captcha-dragbar .drag-track {
width: 100%; width: 100%;
height: 10px; height: 10px;
border-radius: 5px; border-radius: 5px;
background: $--app-selected-color; background: $--app-selected-color;
position: relative; position: relative;
} }
.captcha-dragbar .drag-slider { .captcha-dragbar .drag-slider {
width: 40px; width: 40px;
height: 30px; height: 30px;
position: absolute; position: absolute;
top: 0; top: 0;
left: 10px; left: 10px;
background-color: $--app-sky-color; background-color: $--app-sky-color;
background-image: url('~@/assets/img/slider.png'); background-image: url('~@/assets/img/slider.png');
background-position: center; background-position: center;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 50%; background-size: 50%;
border-radius: 23px; border-radius: 23px;
cursor: pointer; cursor: pointer;
} }
.captcha-dragbar .drag-btn { .captcha-dragbar .drag-btn {
height: 22px; height: 22px;
margin-top: 10px; margin-top: 10px;
} }
.captcha-dragbar .drag-btn i { .captcha-dragbar .drag-btn i {
float: right; float: right;
margin-right: 10px; margin-right: 10px;
} }
.captcha-dragbar .drag-btn .refresh { .captcha-dragbar .drag-btn .refresh {
cursor: pointer; cursor: pointer;
height: 22px; height: 22px;
width: 22px; width: 22px;
background: url('~@/assets/img/refresh.png') center no-repeat; background: url('~@/assets/img/refresh.png') center no-repeat;
background-size: 100%; background-size: 100%;
} }
.captcha-dragbar .drag-btn .close { .captcha-dragbar .drag-btn .close {
height: 22px; height: 22px;
width: 22px; width: 22px;
background: url('~@/assets/img/close.png') center no-repeat; background: url('~@/assets/img/close.png') center no-repeat;
background-size: 100%; background-size: 100%;
} }
.drag-box { .drag-box {
width: calc(100% - 16px); width: calc(100% - 16px);
height: 100%; height: 100%;
position: absolute; position: absolute;
top: 0; top: 0;
z-index: -1; z-index: -1;
cursor: pointer; cursor: pointer;
} }
.drag-box-over { .drag-box-over {
z-index: 100; z-index: 100;
cursor: pointer; cursor: pointer;
} }
</style> </style>

View File

@ -1,58 +1,58 @@
<template> <template>
<div class="input-code"> <div class="input-code">
<el-input :value="value" :autocomplete="autocomplete" :placeholder="placeholder" type="text" :disabled="disabled" :maxlength="6" @input="handleInput"> <el-input :value="value" :autocomplete="autocomplete" :placeholder="placeholder" type="text" :disabled="disabled" :maxlength="6" @input="handleInput">
<template v-slot:suffix> <template v-slot:suffix>
<identify-code <identify-code
:popperClass="popperClass" :popperClass="popperClass"
:btnDisabled="disabled" :btnDisabled="disabled"
@show-popover="showPopover" @show-popover="showPopover"
@verify-success="handleVerifySuccess" @verify-success="handleVerifySuccess"
></identify-code> ></identify-code>
</template> </template>
</el-input> </el-input>
</div> </div>
</template> </template>
<script> <script>
import IdentifyCode from './identify-code' import IdentifyCode from './identify-code'
export default { export default {
components: { components: {
'identify-code': IdentifyCode 'identify-code': IdentifyCode
}, },
props: { props: {
value: { value: {
type: String, type: String,
default: '' default: ''
}, },
autocomplete: { autocomplete: {
type: String, type: String,
default: 'off' default: 'off'
}, },
disabled: { disabled: {
type: Boolean, type: Boolean,
default: false default: false
}, },
placeholder: { placeholder: {
type: String, type: String,
default() { default() {
return this.$t('component.input-code.codePlaceholder') return this.$t('component.input-code.codePlaceholder')
} }
}, },
popperClass: { popperClass: {
type: String, type: String,
default: '' default: ''
} }
}, },
methods: { methods: {
handleVerifySuccess(callback) { handleVerifySuccess(callback) {
this.$emit('verify-success', callback) this.$emit('verify-success', callback)
}, },
handleInput(value) { handleInput(value) {
this.$emit('input', value) this.$emit('input', value)
}, },
showPopover() { showPopover() {
this.$emit('show-popover') this.$emit('show-popover')
} }
} }
} }
</script> </script>

View File

@ -1,79 +1,79 @@
<template> <template>
<div class="input-password"> <div class="input-password">
<el-input :value="value" :type="type" :autocomplete="autocomplete" :placeholder="placeholder" @input="handleInput"> <el-input :value="value" :type="type" :autocomplete="autocomplete" :placeholder="placeholder" @input="handleInput">
<template v-slot:suffix> <template v-slot:suffix>
<div v-if="showPassword" class="password-visiable" @click="toggleVisiable"> <div v-if="showPassword" class="password-visiable" @click="toggleVisiable">
<x-svg-icon v-if="!visiable" class="visiable-icon" name="password-hide"></x-svg-icon> <x-svg-icon v-if="!visiable" class="visiable-icon" name="password-hide"></x-svg-icon>
<x-svg-icon v-else class="visiable-icon" name="password-show"></x-svg-icon> <x-svg-icon v-else class="visiable-icon" name="password-show"></x-svg-icon>
</div> </div>
</template> </template>
</el-input> </el-input>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
props: { props: {
value: { value: {
type: String, type: String,
default: '' default: ''
}, },
autocomplete: { autocomplete: {
type: String, type: String,
default: 'off' default: 'off'
}, },
placeholder: { placeholder: {
type: String, type: String,
default() { default() {
return this.$t('common.input-password.placeholder') return this.$t('common.input-password.placeholder')
} }
}, },
showPassword: { showPassword: {
type: Boolean, type: Boolean,
default: true default: true
} }
}, },
data() { data() {
return { return {
type: 'password', type: 'password',
visiable: false visiable: false
} }
}, },
methods: { methods: {
toggleVisiable() { toggleVisiable() {
this.visiable = !this.visiable this.visiable = !this.visiable
if (this.visiable) { if (this.visiable) {
this.type = 'text' this.type = 'text'
} else { } else {
this.type = 'password' this.type = 'password'
} }
}, },
handleInput(value) { handleInput(value) {
this.$emit('input', value) this.$emit('input', value)
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.input-password { .input-password {
.password-visiable { .password-visiable {
.visiable-icon { .visiable-icon {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
} }
} }
</style> </style>
<style lang="scss"> <style lang="scss">
.input-password { .input-password {
.el-input__suffix { .el-input__suffix {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
right: 8px !important; right: 8px !important;
} }
} }
</style> </style>

View File

@ -1,220 +1,220 @@
<template> <template>
<div class="menutree"> <div class="menutree">
<label v-for="menu in menuData" :key="menu.id"> <label v-for="menu in menuData" :key="menu.id">
<el-submenu v-if="menu.menuType === 'GROUP'" class="menu-item" :index="menu.id"> <el-submenu v-if="menu.menuType === 'GROUP'" class="menu-item" :index="menu.id">
<template slot="title"> <template slot="title">
<div class="menu-item-div"> <div class="menu-item-div">
<div <div
slot="title" slot="title"
class="route-link router-link-parent" class="route-link router-link-parent"
:class="collapse ? 'route-link-min route-link-min-parent' : 'route-link-max'" :class="collapse ? 'route-link-min route-link-min-parent' : 'route-link-max'"
> >
<template v-if="collapse"> <template v-if="collapse">
<el-tooltip effect="dark" :content="menu.menuName" placement="top-start"> <el-tooltip effect="dark" :content="menu.menuName" placement="top-start">
<x-svg-icon class="menu-icon" :name="menu.menuIcon"></x-svg-icon> <x-svg-icon class="menu-icon" :name="menu.menuIcon"></x-svg-icon>
</el-tooltip> </el-tooltip>
</template> </template>
<template v-else> <template v-else>
<x-svg-icon class="menu-icon" :name="menu.menuIcon"></x-svg-icon> <x-svg-icon class="menu-icon" :name="menu.menuIcon"></x-svg-icon>
</template> </template>
<div class="menu-title" :style="{ 'display' : collapse ? 'none' : 'flex' }"> <div class="menu-title" :style="{ 'display' : collapse ? 'none' : 'flex' }">
<x-ellipsis :label="menu.menuName" mode="origin" :max-lines="1"></x-ellipsis> <x-ellipsis :label="menu.menuName" mode="origin" :max-lines="1"></x-ellipsis>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<label> <label>
<menu-tree <menu-tree
class="child-menu" class="child-menu"
:menuData="menu.submenus" :menuData="menu.submenus"
:isChild="true" :isChild="true"
@click-add-button="showAddModal" @click-add-button="showAddModal"
></menu-tree> ></menu-tree>
</label> </label>
</el-submenu> </el-submenu>
<el-menu-item v-else class="menu-item" :index="menu.id"> <el-menu-item v-else class="menu-item" :index="menu.id">
<div class="menu-item-div" :class="isChild ? 'is-child' : ''"> <div class="menu-item-div" :class="isChild ? 'is-child' : ''">
<div <div
slot="title" slot="title"
class="route-link" class="route-link"
:class="collapse ? 'route-link-min' : 'route-link-max'" :class="collapse ? 'route-link-min' : 'route-link-max'"
@click="toRouter(menu)" @click="toRouter(menu)"
> >
<template v-if="collapse"> <template v-if="collapse">
<el-tooltip effect="dark" :content="menu.menuName" placement="top-start"> <el-tooltip effect="dark" :content="menu.menuName" placement="top-start">
<x-svg-icon class="menu-icon" :name="menu.menuIcon"></x-svg-icon> <x-svg-icon class="menu-icon" :name="menu.menuIcon"></x-svg-icon>
</el-tooltip> </el-tooltip>
</template> </template>
<template v-else> <template v-else>
<x-svg-icon class="menu-icon" :name="menu.menuIcon"></x-svg-icon> <x-svg-icon class="menu-icon" :name="menu.menuIcon"></x-svg-icon>
</template> </template>
<div class="menu-title" :style="{ 'display' : collapse ? 'none' : 'flex' }"> <div class="menu-title" :style="{ 'display' : collapse ? 'none' : 'flex' }">
<x-ellipsis :label="menu.menuName" mode="origin" :max-lines="1"></x-ellipsis> <x-ellipsis :label="menu.menuName" mode="origin" :max-lines="1"></x-ellipsis>
</div> </div>
<template v-if="menu.menuType === 'MENU' && menu.canAddStatus"> <template v-if="menu.menuType === 'MENU' && menu.canAddStatus">
<div class="add-icon" @click.prevent="clickAddButton($event, menu)"> <div class="add-icon" @click.prevent="clickAddButton($event, menu)">
<x-svg-icon name="menu-add-form" class="pointer"></x-svg-icon> <x-svg-icon name="menu-add-form" class="pointer"></x-svg-icon>
</div> </div>
</template> </template>
</div> </div>
</div> </div>
</el-menu-item> </el-menu-item>
</label> </label>
</div> </div>
</template> </template>
<script> <script>
import MenuTree from '@/components/menus-tree/index' import MenuTree from '@/components/menus-tree/index'
export default { export default {
name: 'MenuTree', name: 'MenuTree',
components: { components: {
MenuTree MenuTree
}, },
props: { props: {
menuData: { menuData: {
type: Array, type: Array,
default: function() { default: function() {
return [] return []
} }
}, },
collapse: { collapse: {
type: Boolean, type: Boolean,
default: false default: false
}, },
isChild: { isChild: {
type: Boolean, type: Boolean,
default: false default: false
} }
}, },
data() { data() {
return { return {
menu_data: {} menu_data: {}
} }
}, },
methods: { methods: {
clickAddButton(event, data) { clickAddButton(event, data) {
event.stopPropagation() event.stopPropagation()
this.$emit('click-add-button', data) this.$emit('click-add-button', data)
}, },
showAddModal(data) { showAddModal(data) {
this.$emit('click-add-button', data) this.$emit('click-add-button', data)
}, },
timestamp() { timestamp() {
return new Date().getTime() return new Date().getTime()
}, },
toRouter(menu) { toRouter(menu) {
// t // t
if (menu.menuType === 'MENU') { if (menu.menuType === 'MENU') {
this.$router.push({ name: 'app-page', query: { appId: menu.appId, formId: menu.formId, title: menu.menuName, currentMenu: menu.id, t: this.timestamp() } }) this.$router.push({ name: 'app-page', query: { appId: menu.appId, formId: menu.formId, title: menu.menuName, currentMenu: menu.id, t: this.timestamp() } })
} else { } else {
this.$router.push({ name: 'report-page', query: { appId: menu.appId, formId: menu.formId, title: menu.menuName, currentMenu: menu.id, t: this.timestamp() } }) this.$router.push({ name: 'report-page', query: { appId: menu.appId, formId: menu.formId, title: menu.menuName, currentMenu: menu.id, t: this.timestamp() } })
} }
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.menutree { .menutree {
.el-menu-item { .el-menu-item {
padding: 0 !important; padding: 0 !important;
height: 44px!important; height: 44px!important;
line-height: 44px!important; line-height: 44px!important;
} }
.is-child { .is-child {
.route-link { .route-link {
padding-left: 46px !important; padding-left: 46px !important;
} }
} }
.menu-item { .menu-item {
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
.menu-item-div { .menu-item-div {
width: 100%; width: 100%;
.el-tooltip { .el-tooltip {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.router-link-parent { .router-link-parent {
padding-left: 0 !important; padding-left: 0 !important;
} }
.route-link { .route-link {
display: flex; display: flex;
align-items: center; align-items: center;
width: 100%; width: 100%;
padding-left: 20px; padding-left: 20px;
padding-right: 40px !important; padding-right: 40px !important;
box-sizing: border-box; box-sizing: border-box;
color: unset; color: unset;
.add-icon { .add-icon {
color: $--app-notice-color; color: $--app-notice-color;
position: absolute; position: absolute;
right: 20px; right: 20px;
display: none; display: none;
} }
.arrow-down-icon { .arrow-down-icon {
.svg-arrow-down-icon { .svg-arrow-down-icon {
position: absolute; position: absolute;
right: 20px; right: 20px;
transform: scale(0.81); transform: scale(0.81);
color: $--app-description-color; color: $--app-description-color;
} }
} }
} }
.route-link-min-parent { .route-link-min-parent {
padding-left: 28px !important; padding-left: 28px !important;
} }
.route-link-min { .route-link-min {
height: 44px; height: 44px;
justify-content: center; justify-content: center;
padding-left: 40px; padding-left: 40px;
} }
.route-link-max { .route-link-max {
height: 44px; height: 44px;
padding-left: 20px; padding-left: 20px;
} }
.route-link:hover { .route-link:hover {
.add-icon { .add-icon {
display: block !important; display: block !important;
} }
} }
} }
.el-menu { .el-menu {
&.el-menu--inline { &.el-menu--inline {
width: 100% !important; width: 100% !important;
} }
} }
} }
.menu-title { .menu-title {
max-width: 80%; max-width: 80%;
margin-left: 12px; margin-left: 12px;
white-space: normal; white-space: normal;
font-size: $--app-title-fontSize; font-size: $--app-title-fontSize;
.x-ellipsis { .x-ellipsis {
max-width: 100%; max-width: 100%;
line-height: normal; line-height: normal;
} }
} }
.menu-icon { .menu-icon {
width: 14px; width: 14px;
height: 14px; height: 14px;
} }
.x-svg-icon { .x-svg-icon {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.el-submenu__title { .el-submenu__title {
width: 100%; width: 100%;
height: 44px; height: 44px;
line-height: 44px; line-height: 44px;
.el-submenu__icon-arrow { .el-submenu__icon-arrow {
right: 26px; right: 26px;
} }
} }
.child-menu { .child-menu {
.menu-item { .menu-item {
padding-left: 24px; padding-left: 24px;
} }
} }
} }
</style> </style>

View File

@ -1,68 +1,68 @@
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2020-05-30 12:25:09 * @Date: 2020-05-30 12:25:09
* @LastEditTime: 2020-05-30 16:00:23 * @LastEditTime: 2020-05-30 16:00:23
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: /x-product-workspace/packages/x-project-app/src/components/org-avatar/index.vue * @FilePath: /x-product-workspace/packages/x-project-app/src/components/org-avatar/index.vue
--> -->
<template> <template>
<div class="org-avatar"> <div class="org-avatar">
<img v-if="iconUrl" class="org-icon" :src="iconUrl" alt=""> <img v-if="iconUrl" class="org-icon" :src="iconUrl" alt="">
<div v-else class="org-icon no-icon"> <div v-else class="org-icon no-icon">
{{ computOrgName[0] }}<br />{{ computOrgName[1] }} {{ computOrgName[0] }}<br />{{ computOrgName[1] }}
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'OrgAvatar', name: 'OrgAvatar',
props: { props: {
orgName: { orgName: {
type: String, type: String,
required: true required: true
}, },
iconUrl: { iconUrl: {
type: String, type: String,
default: '' default: ''
} }
}, },
data() { data() {
return {} return {}
}, },
computed: { computed: {
computOrgName: function () { computOrgName: function () {
if (this.orgName) { if (this.orgName) {
const orgName = this.orgName.slice(0, 4) const orgName = this.orgName.slice(0, 4)
return [orgName.slice(0, 2), orgName.slice(2, 4)] return [orgName.slice(0, 2), orgName.slice(2, 4)]
} }
return ['', ''] return ['', '']
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.org-avatar { .org-avatar {
display: flex; display: flex;
align-items: center; align-items: center;
width: 100%; width: 100%;
height: 100%; height: 100%;
.org-icon { .org-icon {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 2px; border-radius: 2px;
&.no-icon { &.no-icon {
background-color: $--app-primary-color; background-color: $--app-primary-color;
color: $--app-light-color; color: $--app-light-color;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 14px; font-size: 14px;
font-weight: $--app-font-weight; font-weight: $--app-font-weight;
line-height: 18px; line-height: 18px;
} }
} }
} }
</style> </style>

View File

@ -1,84 +1,84 @@
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2020-07-02 10:56:20 * @Date: 2020-07-02 10:56:20
* @LastEditTime: 2020-07-02 19:20:24 * @LastEditTime: 2020-07-02 19:20:24
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: /x-product-workspace/packages/x-project-app/src/components/person-avatar/index.vue * @FilePath: /x-product-workspace/packages/x-project-app/src/components/person-avatar/index.vue
--> -->
<template> <template>
<div class="person-avatar"> <div class="person-avatar">
<template v-if="avatarUrl"> <template v-if="avatarUrl">
<img class="img-avatar" :src="avatarRealUrl" alt="avatar"> <img class="img-avatar" :src="avatarRealUrl" alt="avatar">
</template> </template>
<template v-else> <template v-else>
<div class="default-avatar" :style="{'background-color': defaultAvatarColor === 'primaryColor' ? '' : defaultAvatarColor}"> <div class="default-avatar" :style="{'background-color': defaultAvatarColor === 'primaryColor' ? '' : defaultAvatarColor}">
<span>{{ displayName }}</span> <span>{{ displayName }}</span>
</div> </div>
</template> </template>
</div> </div>
</template> </template>
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
export default { export default {
props: { props: {
avatarUrl: { avatarUrl: {
type: String, type: String,
default: '' default: ''
}, },
personName: { personName: {
type: String, type: String,
default: '' default: ''
}, },
defaultAvatarColor: { defaultAvatarColor: {
type: String, type: String,
default: 'primaryColor' default: 'primaryColor'
} }
}, },
computed: { computed: {
...mapState({ ...mapState({
token: state => state.authModule.token token: state => state.authModule.token
}), }),
displayName: function () { displayName: function () {
if (this.personName) { if (this.personName) {
return this.personName.slice(this.personName.length - 2, this.personName.length) return this.personName.slice(this.personName.length - 2, this.personName.length)
} else { } else {
return '' return ''
} }
}, },
avatarRealUrl: function () { avatarRealUrl: function () {
return `${this.avatarUrl}&token=${this.token}` return `${this.avatarUrl}&token=${this.token}`
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.person-avatar { .person-avatar {
@include circleShape(24px); @include circleShape(24px);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
color: $--app-light-color; color: $--app-light-color;
overflow: hidden; overflow: hidden;
cursor: pointer; cursor: pointer;
.img-avatar { .img-avatar {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 50%; border-radius: 50%;
} }
.default-avatar { .default-avatar {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background-color: $--app-primary-color; background-color: $--app-primary-color;
span { span {
@include fontSize(10px); @include fontSize(10px);
} }
} }
} }
</style> </style>

View File

@ -1,75 +1,75 @@
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2020-05-26 17:59:30 * @Date: 2020-05-26 17:59:30
* @LastEditTime: 2020-05-27 18:48:29 * @LastEditTime: 2020-05-27 18:48:29
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: /x-product-workspace/packages/x-project-app/src/components/person-name/index.vue * @FilePath: /x-product-workspace/packages/x-project-app/src/components/person-name/index.vue
--> -->
<template> <template>
<div class="person-name"> <div class="person-name">
<div class="icon"> <div class="icon">
{{ displayName }} {{ displayName }}
</div> </div>
<div v-if="showTag" class="real-name"> <div v-if="showTag" class="real-name">
{{ name }} {{ name }}
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'PersonName', name: 'PersonName',
props: { props: {
name: { name: {
type: String, type: String,
required: true required: true
}, },
showTag: { showTag: {
type: Boolean, type: Boolean,
default: function () { default: function () {
return true return true
} }
} }
}, },
computed: { computed: {
displayName: function () { displayName: function () {
if (this.name) { if (this.name) {
return this.name.slice(this.name.length - 2, this.name.length) return this.name.slice(this.name.length - 2, this.name.length)
} }
return '' return ''
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.person-name { .person-name {
display: flex; display: flex;
align-items: center; align-items: center;
position: relative; position: relative;
.icon { .icon {
position: absolute; position: absolute;
left: -4px; left: -4px;
padding: 2px; padding: 2px;
@include circleShape(24px); @include circleShape(24px);
@include fontSize(10px); @include fontSize(10px);
background-color: $--app-primary-color; background-color: $--app-primary-color;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
color: $--app-light-color; color: $--app-light-color;
} }
.real-name { .real-name {
padding: 0 8px; padding: 0 8px;
height: 24px; height: 24px;
padding-left: 32px; padding-left: 32px;
border-radius: 14px; border-radius: 14px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
text-align: center; text-align: center;
background-color: $--app-info-color; background-color: $--app-info-color;
} }
} }
</style> </style>

View File

@ -1,12 +1,12 @@
{ {
"entry": "index.js", "entry": "index.js",
"copyAssets": ["public/custom/apaas-custom-list-demo"], "copyAssets": ["public/custom/apaas-custom-list-demo"],
"list": { "list": {
"apaas-custom-list-view-demo": { "apaas-custom-list-view-demo": {
"renderLogic": "FORM_LIST_VIEW", "renderLogic": "FORM_LIST_VIEW",
"desc": "描述", "desc": "描述",
"status": "ENABLE" "status": "ENABLE"
} }
}, },
"outputName": "apaas-custom-list-demo" "outputName": "apaas-custom-list-demo"
} }

View File

@ -1,184 +1,184 @@
<template> <template>
<div class="custom-list-view"> <div class="custom-list-view">
<x-list-view <x-list-view
:listEngine="listEngine" :listEngine="listEngine"
> >
<template v-slot:listSearch> <template v-slot:listSearch>
<div></div> <div></div>
</template> </template>
<template v-slot:listTable> <template v-slot:listTable>
<x-list-table ref="listTable"> <x-list-table ref="listTable">
<template v-slot:customHeadSlot="scopeSlot"> <template v-slot:customHeadSlot="scopeSlot">
<div class="custom-list-view-header" @keyup.enter="handlerSearch"> <div class="custom-list-view-header" @keyup.enter="handlerSearch">
<x-ellipsis class="custom-list-view-label" :label="scopeSlot.column.label" mode="origin" /> <x-ellipsis class="custom-list-view-label" :label="scopeSlot.column.label" mode="origin" />
<div class="custom-list-view-search"> <div class="custom-list-view-search">
<el-form :inline="formInline" @submit.native.prevent> <el-form :inline="formInline" @submit.native.prevent>
<component <component
:is="getSearchComponent(scopeSlot.column.property)" :is="getSearchComponent(scopeSlot.column.property)"
v-if="getSearchComponent(scopeSlot.column.property)" v-if="getSearchComponent(scopeSlot.column.property)"
:value="searchValue(scopeSlot.column.property)" :value="searchValue(scopeSlot.column.property)"
:compInfo="getComponentConfig(scopeSlot.column.property)" :compInfo="getComponentConfig(scopeSlot.column.property)"
:tileFormComponent="getComponentConfig(scopeSlot.column.property)" :tileFormComponent="getComponentConfig(scopeSlot.column.property)"
:showOpt="false" :showOpt="false"
@change="searchValueChange($event, scopeSlot.column.property)" @change="searchValueChange($event, scopeSlot.column.property)"
></component> ></component>
</el-form> </el-form>
</div> </div>
</div> </div>
</template> </template>
</x-list-table> </x-list-table>
</template> </template>
</x-list-view> </x-list-view>
</div> </div>
</template> </template>
<script> <script>
import CustomInputSearchItem from './search-compont/custom-input-search-item' import CustomInputSearchItem from './search-compont/custom-input-search-item'
export default { export default {
name: 'CustomListViewDemo', name: 'CustomListViewDemo',
components: { components: {
CustomInputSearchItem CustomInputSearchItem
}, },
props: { props: {
listEngine: { listEngine: {
type: Object type: Object
} }
}, },
data() { data() {
return { return {
formInline: false formInline: false
} }
}, },
computed: { computed: {
searchComponentConfig() { searchComponentConfig() {
return (this.listEngine && this.listEngine.listDataControl.searchComponentConfig) || [] return (this.listEngine && this.listEngine.listDataControl.searchComponentConfig) || []
}, },
getSearchComponent() { getSearchComponent() {
return function(uuid) { return function(uuid) {
const componetConfig = this.allTiledComps.find(item => item.uuid === uuid) || {} const componetConfig = this.allTiledComps.find(item => item.uuid === uuid) || {}
const searchComponentConfig = this.searchComponentConfig.find(item => item.componentType === componetConfig.componentType) const searchComponentConfig = this.searchComponentConfig.find(item => item.componentType === componetConfig.componentType)
if (searchComponentConfig && searchComponentConfig.searchComponent) { if (searchComponentConfig && searchComponentConfig.searchComponent) {
// 使apaas // 使apaas
if (componetConfig.componentType === 'FORM_TEXT_INPUT') { if (componetConfig.componentType === 'FORM_TEXT_INPUT') {
return 'custom-input-search-item' return 'custom-input-search-item'
} }
return searchComponentConfig.searchComponent + '-search-item' return searchComponentConfig.searchComponent + '-search-item'
} else { } else {
return undefined return undefined
} }
} }
}, },
allTiledComps() { allTiledComps() {
return (this.listEngine && this.listEngine.listDataControl.allTiledComps) || [] return (this.listEngine && this.listEngine.listDataControl.allTiledComps) || []
}, },
getComponentConfig() { getComponentConfig() {
return function(uuid) { return function(uuid) {
return this.allTiledComps.find((comp) => comp.uuid === uuid) return this.allTiledComps.find((comp) => comp.uuid === uuid)
} }
}, },
searchList() { searchList() {
return (this.listEngine && this.listEngine.listDataControl.searchList) || [] return (this.listEngine && this.listEngine.listDataControl.searchList) || []
}, },
searchValue() { searchValue() {
return function(uuid) { return function(uuid) {
const searchConfig = this.searchList.find(item => item.componentUuid === uuid) const searchConfig = this.searchList.find(item => item.componentUuid === uuid)
return (searchConfig && searchConfig.params) || [] return (searchConfig && searchConfig.params) || []
} }
} }
}, },
methods: { methods: {
searchValueChange(value, uuid) { searchValueChange(value, uuid) {
const searchConfig = this.searchList.find(item => item.componentUuid === uuid) const searchConfig = this.searchList.find(item => item.componentUuid === uuid)
if (searchConfig && searchConfig.params) { if (searchConfig && searchConfig.params) {
searchConfig.params = value searchConfig.params = value
} }
}, },
// //
handlerSearch(e) { handlerSearch(e) {
e.stopPropagation() e.stopPropagation()
e.preventDefault() e.preventDefault()
this.listEngine.listDataControl.tableConfig.pagination.currentPage = 1 this.listEngine.listDataControl.tableConfig.pagination.currentPage = 1
this.listEngine.listDataControl.destroyVirtualAdvanceSearch() this.listEngine.listDataControl.destroyVirtualAdvanceSearch()
this.listEngine.actionControl.executeActionWithSync('DO_LIST_SEARCH') this.listEngine.actionControl.executeActionWithSync('DO_LIST_SEARCH')
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.custom-list-view { .custom-list-view {
height: 100%; height: 100%;
.custom-list-view-label { .custom-list-view-label {
height: 40px; height: 40px;
} }
.custom-list-view-search { .custom-list-view-search {
border-top: 1px solid #e8eaec; border-top: 1px solid #e8eaec;
margin: 0 -10px; margin: 0 -10px;
height: 40px; height: 40px;
// //
.el-input, .el-date-editor { .el-input, .el-date-editor {
border: none; border: none;
border-radius: 0; border-radius: 0;
outline: none; outline: none;
background-color: #fafafa; background-color: #fafafa;
* { * {
border: none; border: none;
border-radius: 0; border-radius: 0;
outline: none; outline: none;
background-color: #fafafa; background-color: #fafafa;
} }
} }
.el-form { .el-form {
.el-form-item { .el-form-item {
margin: 0 2px; margin: 0 2px;
// //
.el-form-item__label { .el-form-item__label {
display: none; display: none;
} }
.el-form-item__content { .el-form-item__content {
line-height: 40px !important; line-height: 40px !important;
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
} }
// //
.x-lov-switch-search-item { .x-lov-switch-search-item {
// //
.title-label { .title-label {
display: none; display: none;
} }
.x-select { .x-select {
height: 40px; height: 40px;
position: relative; position: relative;
background-color: #fafafa; background-color: #fafafa;
.form-select-input { .form-select-input {
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
} }
.select-input-tag { .select-input-tag {
border: none; border: none;
border-radius: 0; border-radius: 0;
outline: none; outline: none;
background-color: #fafafa; background-color: #fafafa;
height: 32px; height: 32px;
z-index: 0; z-index: 0;
} }
.x-select-suffix { .x-select-suffix {
z-index: 1; z-index: 1;
} }
} }
} }
// //
.x-number-search-item, .x-money-search-item { .x-number-search-item, .x-money-search-item {
.range-item-divide { .range-item-divide {
margin: 0; margin: 0;
} }
} }
.el-select .el-input .el-select__caret { .el-select .el-input .el-select__caret {
font-size: 14px !important; font-size: 14px !important;
top: 0px; top: 0px;
} }
} }
} }
} }
</style> </style>

View File

@ -1,68 +1,68 @@
<template> <template>
<div class="custom-input-search-item"> <div class="custom-input-search-item">
<el-form-item> <el-form-item>
<!-- <template slot="label"> <!-- <template slot="label">
<x-ellipsis <x-ellipsis
class="fix-cursor" class="fix-cursor"
mode="origin" mode="origin"
:openDelay="300" :openDelay="300"
:label="compInfo.label" :label="compInfo.label"
></x-ellipsis> ></x-ellipsis>
</template> --> </template> -->
<el-input <el-input
v-model="computeValue[0]" v-model="computeValue[0]"
:placeholder="'请输入'" :placeholder="'请输入'"
@input="change" @input="change"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'CustomInputSearchItem', name: 'CustomInputSearchItem',
model: { model: {
prop: 'value', prop: 'value',
event: 'change' event: 'change'
}, },
props: { props: {
compInfo: { compInfo: {
type: Object, type: Object,
default: function() { default: function() {
return {} return {}
} }
}, },
value: { value: {
type: Array, type: Array,
default: function() { default: function() {
return [] return []
} }
} }
}, },
data() { data() {
return {} return {}
}, },
computed: { computed: {
computeValue: { computeValue: {
get: function() { get: function() {
return this.value return this.value
}, },
set: function(value) { set: function(value) {
this.$emit('change', value) this.$emit('change', value)
} }
} }
}, },
watch: {}, watch: {},
methods: { methods: {
change(e) { change(e) {
if (e === '') { if (e === '') {
this.computeValue = [] this.computeValue = []
} }
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
// .custom-input-search-item { // .custom-input-search-item {
// } // }
</style> </style>

View File

@ -1,11 +1,11 @@
import CustomListViewDemo from './custom-list/custom-list-view.vue' import CustomListViewDemo from './custom-list/custom-list-view.vue'
const install = function(Vue, opts) { const install = function(Vue, opts) {
Vue.component('apaas-custom-list-view-demo', CustomListViewDemo) Vue.component('apaas-custom-list-view-demo', CustomListViewDemo)
} }
const ListDemoCustomPlugin = { const ListDemoCustomPlugin = {
install: install install: install
} }
export default ListDemoCustomPlugin export default ListDemoCustomPlugin

View File

@ -1,146 +1,167 @@
{ {
"entry": "index.js", "entry": "index.js",
"copyAssets": ["public/custom/apaas-custom-mydemo"], "copyAssets": ["public/custom/apaas-custom-mydemo"],
"router": { "router": {
"apaas-custom-modalContorl":{ "apaas-custom-modalContorl":{
"name": "apaas-custom-modalContorl", "name": "apaas-custom-modalContorl",
"path": "apaas-custom-modalContorl", "path": "apaas-custom-modalContorl",
"meta": { "meta": {
"title": "模板管理" "title": "模板管理"
} }
}, },
"apaas-custom-selfEnginedata":{ "apaas-custom-selfEnginedata":{
"name": "apaas-custom-selfEnginedata", "name": "apaas-custom-selfEnginedata",
"path": "apaas-custom-selfEnginedata", "path": "apaas-custom-selfEnginedata",
"meta": { "meta": {
"title": "玉柴发动机数据" "title": "玉柴发动机数据"
} }
}, },
"apaas-custom-otherEnginedata":{ "apaas-custom-otherEnginedata":{
"name": "apaas-custom-otherEnginedata", "name": "apaas-custom-otherEnginedata",
"path": "apaas-custom-otherEnginedata", "path": "apaas-custom-otherEnginedata",
"meta": { "meta": {
"title": "竞品发动机数据" "title": "竞品发动机数据"
} }
}, },
"apaas-custom-checkData":{ "apaas-custom-checkData":{
"name": "apaas-custom-checkData", "name": "apaas-custom-checkData",
"path": "apaas-custom-checkData", "path": "apaas-custom-checkData",
"meta": { "meta": {
"title": "数据检查" "title": "数据检查"
} }
}, },
"apaas-custom-report":{ "apaas-custom-report":{
"name": "apaas-custom-report", "name": "apaas-custom-report",
"path": "apaas-custom-report", "path": "apaas-custom-report",
"meta": { "meta": {
"title": "对标报告" "title": "对标报告"
} }
}, },
"apaas-custom-reportList":{ "apaas-custom-reportList":{
"name": "apaas-custom-reportList", "name": "apaas-custom-reportList",
"path": "apaas-custom-reportList", "path": "apaas-custom-reportList",
"meta": { "meta": {
"title": "报告列表" "title": "报告列表"
} }
}, },
"apaas-custom-reportDetail":{ "apaas-custom-reportDetail":{
"name": "apaas-custom-reportDetail", "name": "apaas-custom-reportDetail",
"path": "apaas-custom-reportDetail", "path": "apaas-custom-reportDetail",
"meta": { "meta": {
"title": "报告详情" "title": "报告详情"
} }
}, },
"apaas-custom-reportCheck":{ "apaas-custom-reportCheck":{
"name": "apaas-custom-reportCheck", "name": "apaas-custom-reportCheck",
"path": "apaas-custom-reportCheck", "path": "apaas-custom-reportCheck",
"meta": { "meta": {
"title": "报告检查" "title": "报告检查"
} }
}, },
"apaas-custom-modelDetail":{ "apaas-custom-modelDetail":{
"name": "apaas-custom-modelDetail", "name": "apaas-custom-modelDetail",
"path": "apaas-custom-modelDetail", "path": "apaas-custom-modelDetail",
"meta": { "meta": {
"title": "系统参数管理" "title": "系统参数管理"
} }
}, },
"apaas-custom-engineDetail":{ "apaas-custom-engineDetail":{
"name": "apaas-custom-engineDetail", "name": "apaas-custom-engineDetail",
"path": "apaas-custom-engineDetail", "path": "apaas-custom-engineDetail",
"meta": { "meta": {
"title": "发动机参数详情" "title": "发动机参数详情"
} }
}, },
"apaas-custom-approvalManagement":{ "apaas-custom-approvalManagement":{
"name": "apaas-custom-approvalManagement", "name": "apaas-custom-approvalManagement",
"path": "apaas-custom-approvalManagement", "path": "apaas-custom-approvalManagement",
"meta": { "meta": {
"title": "模板审批管理" "title": "模板审批管理"
} }
}, },
"apaas-custom-toDoList":{ "apaas-custom-toDoList":{
"name": "apaas-custom-toDoList", "name": "apaas-custom-toDoList",
"path": "apaas-custom-toDoList", "path": "apaas-custom-toDoList",
"meta": { "meta": {
"title": "数据待办" "title": "数据待办"
} }
}, },
"apaas-custom-myDone":{ "apaas-custom-myDone":{
"name": "apaas-custom-myDone", "name": "apaas-custom-myDone",
"path": "apaas-custom-myDone", "path": "apaas-custom-myDone",
"meta": { "meta": {
"title": "我的已办" "title": "我的已办"
} }
}, },
"apaas-custom-mySend":{ "apaas-custom-mySend":{
"name": "apaas-custom-mySend", "name": "apaas-custom-mySend",
"path": "apaas-custom-mySend", "path": "apaas-custom-mySend",
"meta": { "meta": {
"title": "我发起的" "title": "我发起的"
} }
}, },
"apaas-custom-selfEngineCheck":{ "apaas-custom-myDemo":{
"name": "apaas-custom-selfEngineCheck", "name": "apaas-custom-myDemo",
"path": "apaas-custom-selfEngineCheck", "path": "apaas-custom-myDemo",
"meta": { "meta": {
"title": "玉柴发动机审核" "title": "我的测试"
} }
}, },
"apaas-custom-otherEngineCheck":{ "apaas-custom-selfEngineCheck":{
"name": "apaas-custom-otherEngineCheck", "name": "apaas-custom-selfEngineCheck",
"path": "apaas-custom-otherEngineCheck", "path": "apaas-custom-selfEngineCheck",
"meta": { "meta": {
"title": "竞品发动机审核" "title": "玉柴发动机审核"
} }
}, },
"apaas-custom-managerData":{ "apaas-custom-otherEngineCheck":{
"name": "apaas-custom-managerData", "name": "apaas-custom-otherEngineCheck",
"path": "apaas-custom-managerData", "path": "apaas-custom-otherEngineCheck",
"meta": { "meta": {
"title": "责任人管理" "title": "竞品发动机审核"
} }
}, },
"apaas-custom-fillerData":{ "apaas-custom-managerData":{
"name": "apaas-custom-fillerData", "name": "apaas-custom-managerData",
"path": "apaas-custom-fillerData", "path": "apaas-custom-managerData",
"meta": { "meta": {
"title": "填写人管理" "title": "责任人管理"
} }
}, },
"apaas-custom-permissionManagement":{ "apaas-custom-fillerData":{
"name": "apaas-custom-permissionManagement", "name": "apaas-custom-fillerData",
"path": "apaas-custom-permissionManagement", "path": "apaas-custom-fillerData",
"meta": { "meta": {
"title": "权限管理" "title": "填写人管理"
} }
} },
}, "apaas-custom-permissionManagement":{
"customWidgetList": [ "name": "apaas-custom-permissionManagement",
{ "path": "apaas-custom-permissionManagement",
"code": "mydemo", "meta": {
"text": "mydemo" "title": "权限管理"
} }
], },
"outputName": "apaas-custom-mydemo" "apaas-custom-roleMemberManagement":{
} "name": "apaas-custom-roleMemberManagement",
"path": "apaas-custom-roleMemberManagement",
"meta": {
"title": "人员管理"
}
},
"apaas-custom-checkPersonPermission":{
"name": "apaas-custom-checkPersonPermission",
"path": "apaas-custom-checkPersonPermission",
"meta": {
"title": "权限检查"
}
}
},
"customWidgetList": [
{
"code": "mydemo",
"text": "mydemo"
}
],
"outputName": "apaas-custom-mydemo"
}

View File

@ -1,11 +1,11 @@
/* /*
* @Author: your name * @Author: your name
* @Date: 2021-07-08 16:00:51 * @Date: 2021-07-08 16:00:51
* @LastEditTime: 2021-07-08 16:07:03 * @LastEditTime: 2021-07-08 16:07:03
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: /apaas-custom-vue-starter/src/custom/apaas-custom-hello/form-components/form-widget/edit/index.js * @FilePath: /apaas-custom-vue-starter/src/custom/apaas-custom-hello/form-components/form-widget/edit/index.js
*/ */
const editFormComponentList = [] /* vue组件的集合 */ const editFormComponentList = [] /* vue组件的集合 */
export default editFormComponentList export default editFormComponentList

View File

@ -1,11 +1,11 @@
/* /*
* @Author: your name * @Author: your name
* @Date: 2021-07-08 16:01:44 * @Date: 2021-07-08 16:01:44
* @LastEditTime: 2021-07-08 16:16:29 * @LastEditTime: 2021-07-08 16:16:29
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: /apaas-custom-vue-starter/src/custom/apaas-custom-hello/form-components/form-widget/ide/index.js * @FilePath: /apaas-custom-vue-starter/src/custom/apaas-custom-hello/form-components/form-widget/ide/index.js
*/ */
const ideFormComponentList = [] /* vue组件的集合 */ const ideFormComponentList = [] /* vue组件的集合 */
export default ideFormComponentList export default ideFormComponentList

View File

@ -1,19 +1,19 @@
/* /*
* @Author: your name * @Author: your name
* @Date: 2021-07-06 12:00:52 * @Date: 2021-07-06 12:00:52
* @LastEditTime: 2021-07-08 16:06:47 * @LastEditTime: 2021-07-08 16:06:47
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: /apaas-custom-vue-starter/src/custom/apaas-custom-hello/form-components/form-widget/index.js * @FilePath: /apaas-custom-vue-starter/src/custom/apaas-custom-hello/form-components/form-widget/index.js
*/ */
import ideFormComponentList from './ide' import ideFormComponentList from './ide'
import editFormComponentList from './edit' import editFormComponentList from './edit'
import readFormComponentList from './read' import readFormComponentList from './read'
const customFormComponentList = [ const customFormComponentList = [
...ideFormComponentList, ...ideFormComponentList,
...editFormComponentList, ...editFormComponentList,
...readFormComponentList ...readFormComponentList
] ]
export default customFormComponentList export default customFormComponentList

View File

@ -1,11 +1,11 @@
/* /*
* @Author: your name * @Author: your name
* @Date: 2021-07-08 16:02:09 * @Date: 2021-07-08 16:02:09
* @LastEditTime: 2021-07-08 16:16:36 * @LastEditTime: 2021-07-08 16:16:36
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: /apaas-custom-vue-starter/src/custom/apaas-custom-hello/form-components/form-widget/read/index.js * @FilePath: /apaas-custom-vue-starter/src/custom/apaas-custom-hello/form-components/form-widget/read/index.js
*/ */
const readFormComponentList = [] /* vue组件的集合 */ const readFormComponentList = [] /* vue组件的集合 */
export default readFormComponentList export default readFormComponentList

View File

@ -1,9 +1,9 @@
/* /*
* @Author: your name * @Author: your name
* @Date: 2021-07-08 16:18:27 * @Date: 2021-07-08 16:18:27
* @LastEditTime: 2021-07-08 16:20:06 * @LastEditTime: 2021-07-08 16:20:06
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: /apaas-custom-vue-starter/src/custom/apaas-custom-hello/form-component/index.js * @FilePath: /apaas-custom-vue-starter/src/custom/apaas-custom-hello/form-component/index.js
*/ */
export { default as customFormComponentList } from './form-widget' export { default as customFormComponentList } from './form-widget'

View File

@ -1,11 +1,11 @@
/* /*
* @Author: your name * @Author: your name
* @Date: 2021-07-08 16:05:38 * @Date: 2021-07-08 16:05:38
* @LastEditTime: 2021-07-08 16:07:43 * @LastEditTime: 2021-07-08 16:07:43
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: /apaas-custom-vue-starter/src/custom/apaas-custom-hello/form-config/form-widget/index.js * @FilePath: /apaas-custom-vue-starter/src/custom/apaas-custom-hello/form-config/form-widget/index.js
*/ */
const widgetConfigList = [] const widgetConfigList = []
export default widgetConfigList export default widgetConfigList

View File

@ -1,13 +1,13 @@
/* /*
* @Author: your name * @Author: your name
* @Date: 2021-07-08 16:07:54 * @Date: 2021-07-08 16:07:54
* @LastEditTime: 2021-07-08 16:11:02 * @LastEditTime: 2021-07-08 16:11:02
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: /apaas-custom-vue-starter/src/custom/apaas-custom-hello/form-config/index.js * @FilePath: /apaas-custom-vue-starter/src/custom/apaas-custom-hello/form-config/index.js
*/ */
import widgetConfigList from './form-widget' import widgetConfigList from './form-widget'
export { export {
widgetConfigList widgetConfigList
} }

View File

@ -1,171 +1,171 @@
<template> <template>
<x-app-layout :layoutEngine="layoutEngine" :isCollapse="isCollapse"> <x-app-layout :layoutEngine="layoutEngine" :isCollapse="isCollapse">
<template v-slot:header> <template v-slot:header>
<x-app-header v-if="appInfo" :layoutEngine="layoutEngine" :appInfo="appInfo"></x-app-header> <x-app-header v-if="appInfo" :layoutEngine="layoutEngine" :appInfo="appInfo"></x-app-header>
</template> </template>
<template v-slot:menu> <template v-slot:menu>
<x-app-menu <x-app-menu
:menuConfig="menuConfig" :menuConfig="menuConfig"
:showMenu="showMenu && !!appInfo" :showMenu="showMenu && !!appInfo"
:isCollapse="isCollapse" :isCollapse="isCollapse"
:layoutEngine="layoutEngine" :layoutEngine="layoutEngine"
@menu-add-click="menuAddClick" @menu-add-click="menuAddClick"
></x-app-menu> ></x-app-menu>
</template> </template>
<template slot="appPage"> <template slot="appPage">
<div class="menu-switch" @click="changeCollapse"> <div class="menu-switch" @click="changeCollapse">
<x-svg-icon v-if="isCollapse" name="arrow-right-icon"></x-svg-icon> <x-svg-icon v-if="isCollapse" name="arrow-right-icon"></x-svg-icon>
<x-svg-icon v-else name="arrow-left-icon"></x-svg-icon> <x-svg-icon v-else name="arrow-left-icon"></x-svg-icon>
</div> </div>
<!-- <div v-for="menu of layoutEngine.layoutConfig.keepAliveComps" :key="menu.id"> <!-- <div v-for="menu of layoutEngine.layoutConfig.keepAliveComps" :key="menu.id">
<div :style="{color: menu.id === layoutEngine.layoutConfig.currentMenu.id ? 'red' : '#000'}" @click="handlerclick(menu)"> <div :style="{color: menu.id === layoutEngine.layoutConfig.currentMenu.id ? 'red' : '#000'}" @click="handlerclick(menu)">
{{ menu.menuName }} {{ menu.menuName }}
<el-button @click.stop="closed(menu)">关闭</el-button> <el-button @click.stop="closed(menu)">关闭</el-button>
</div> </div>
</div> --> </div> -->
<slot name="appPage"></slot> <slot name="appPage"></slot>
</template> </template>
</x-app-layout> </x-app-layout>
</template> </template>
<script> <script>
import api from '@/api' import api from '@/api'
import { getUserId } from '@/utils' import { getUserId } from '@/utils'
export default { export default {
name: 'CustomLayout', name: 'CustomLayout',
props: { props: {
layoutEngine: { layoutEngine: {
type: Object, type: Object,
default: function() { default: function() {
return {} return {}
} }
} }
}, },
data() { data() {
return { return {
isCollapse: false, isCollapse: false,
showMenu: true, showMenu: true,
badgeNum: 0 badgeNum: 0
} }
}, },
computed: { computed: {
appInfo() { appInfo() {
return ( return (
(this.layoutEngine && (this.layoutEngine &&
this.layoutEngine.layoutDataControl && this.layoutEngine.layoutDataControl &&
this.layoutEngine.layoutDataControl.appInfo) || this.layoutEngine.layoutDataControl.appInfo) ||
{} {}
) )
}, },
menuConfig() { menuConfig() {
// 访 $route.fullPath 使 // 访 $route.fullPath 使
void this.$route.fullPath void this.$route.fullPath
const data = (this.layoutEngine && const data = (this.layoutEngine &&
this.layoutEngine.layoutDataControl && this.layoutEngine.layoutDataControl &&
this.layoutEngine.layoutDataControl.menuConfig) || { this.layoutEngine.layoutDataControl.menuConfig) || {
menu: [], menu: [],
defaultActive: null, defaultActive: null,
menuTreeData: [] menuTreeData: []
} }
console.log(data, 2222323232, 'data') console.log(data, 2222323232, 'data')
data.menuTreeData[0].badgeNum = this.badgeNum data.menuTreeData[0].badgeNum = this.badgeNum
return data return data
} }
}, },
watch: { watch: {
$route: { $route: {
handler() { handler() {
console.log(2222323232, '2222323232') console.log(2222323232, '2222323232')
this.setBadgeNum() this.setBadgeNum()
}, },
immediate: false immediate: false
} }
}, },
mounted() { mounted() {
console.log(this.layoutEngine.layoutConfig.keepAliveComps, 545454545454545454545454) console.log(this.layoutEngine.layoutConfig.keepAliveComps, 545454545454545454545454)
}, },
methods: { methods: {
setBadgeNum() { setBadgeNum() {
const request = { const request = {
...api.GET_TODO_LIST, ...api.GET_TODO_LIST,
params: { params: {
page: 1, page: 1,
size: 10, size: 10,
personId: getUserId() personId: getUserId()
}, },
disableSuccessMsg: true disableSuccessMsg: true
} }
this.$request(request) this.$request(request)
.asyncThen((resp) => { .asyncThen((resp) => {
this.badgeNum = resp.data.totalCount this.badgeNum = resp.data.totalCount
}) })
.asyncErrorCatch((err) => { .asyncErrorCatch((err) => {
console.error('获取待办列表失败:', err) console.error('获取待办列表失败:', err)
}) })
}, },
changeCollapse() { changeCollapse() {
this.showMenu = false this.showMenu = false
this.$nextTick(() => { this.$nextTick(() => {
this.isCollapse = !this.isCollapse this.isCollapse = !this.isCollapse
this.showMenu = true this.showMenu = true
}) })
}, },
menuAddClick(e) { menuAddClick(e) {
this.$emit('menu-add-click', e) this.$emit('menu-add-click', e)
}, },
closed(menu) { closed(menu) {
const currentMenuId = this.layoutEngine.layoutConfig.currentMenu.id const currentMenuId = this.layoutEngine.layoutConfig.currentMenu.id
this.layoutEngine.removeKeepAliveComps(menu) this.layoutEngine.removeKeepAliveComps(menu)
if (menu.id === currentMenuId) { if (menu.id === currentMenuId) {
this.layoutEngine.actionControl.executeActionWithSync('TO_ROUTER', { this.layoutEngine.actionControl.executeActionWithSync('TO_ROUTER', {
menu: this.layoutEngine.layoutConfig.currentMenu menu: this.layoutEngine.layoutConfig.currentMenu
}) })
} }
}, },
handlerclick(menu) { handlerclick(menu) {
this.layoutEngine.addKeepAliveComps(menu) this.layoutEngine.addKeepAliveComps(menu)
this.layoutEngine.actionControl.executeActionWithSync('TO_ROUTER', { this.layoutEngine.actionControl.executeActionWithSync('TO_ROUTER', {
menu: this.layoutEngine.layoutConfig.currentMenu menu: this.layoutEngine.layoutConfig.currentMenu
}) })
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
$--app-box-bgColor: #ffffff; $--app-box-bgColor: #ffffff;
$--app-box-border-color: #dcdfe6; $--app-box-border-color: #dcdfe6;
.x-app-layout { .x-app-layout {
.layout-middle { .layout-middle {
.layout-center { .layout-center {
.menu-switch { .menu-switch {
width: 14px; width: 14px;
height: 80px; height: 80px;
padding-right: 2px; padding-right: 2px;
border-top-right-radius: 18px; border-top-right-radius: 18px;
border-bottom-right-radius: 18px; border-bottom-right-radius: 18px;
border: 1px solid $--app-box-bgColor; border: 1px solid $--app-box-bgColor;
border-left: 0; border-left: 0;
background-color: $--app-box-bgColor; background-color: $--app-box-bgColor;
position: absolute; position: absolute;
top: calc(50vh - 87px); top: calc(50vh - 87px);
left: -20px; left: -20px;
transform: translateX(120%); transform: translateX(120%);
cursor: pointer; cursor: pointer;
opacity: 0.5; opacity: 0.5;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
z-index: 500; z-index: 500;
border: 1px solid $--app-box-border-color; border: 1px solid $--app-box-border-color;
border-left: none; border-left: none;
} }
.menu-switch:hover { .menu-switch:hover {
background-color: $--app-box-bgColor; background-color: $--app-box-bgColor;
opacity: 1; opacity: 1;
box-shadow: 2px 0px 4px 0px $--app-box-border-color; box-shadow: 2px 0px 4px 0px $--app-box-border-color;
} }
} }
} }
} }
</style> </style>

View File

@ -7,14 +7,14 @@
:destroy-on-close="true" :destroy-on-close="true"
:modalVisible.sync="visible" :modalVisible.sync="visible"
:wrapper-class="'add-engine-model-modal'" :wrapper-class="'add-engine-model-modal'"
title="添加机型" :title="modalTitle"
:width="800" :width="850"
> >
<el-form <el-form
ref="addForm" ref="addForm"
:model="formData" :model="formData"
:rules="formRules" :rules="formRules"
label-width="100px" label-width="140px"
class="add-engine-form" class="add-engine-form"
> >
<div class="form-row"> <div class="form-row">
@ -33,6 +33,29 @@
<el-input v-model="formData.platform" placeholder="请输入" maxlength="100" /> <el-input v-model="formData.platform" placeholder="请输入" maxlength="100" />
</el-form-item> </el-form-item>
</div> </div>
<!-- 竞品发动机专有字段厂家全称和简称在第二行 -->
<div v-if="ycOrOth === '竞品'" class="form-row">
<el-form-item label="厂家名称(全称)" prop="manufacturerName">
<el-input v-model="formData.manufacturerName" placeholder="请输入" maxlength="100" />
</el-form-item>
<el-form-item label="厂家简称" prop="manufacturerAbbreviation">
<el-input v-model="formData.manufacturerAbbreviation" placeholder="请输入" maxlength="100" />
</el-form-item>
</div>
<div v-if="ycOrOth === '竞品'" class="form-row">
<el-form-item label="品牌" prop="brand">
<el-input v-model="formData.brand" placeholder="请输入" maxlength="100" />
</el-form-item>
<el-form-item label="生产日期" prop="productionDate">
<el-date-picker
v-model="formData.productionDate"
type="date"
placeholder="请选择生产日期"
value-format="yyyy-MM-dd"
style="width: 100%"
/>
</el-form-item>
</div>
<div class="form-row"> <div class="form-row">
<el-form-item label="细分市场" prop="marketSegment"> <el-form-item label="细分市场" prop="marketSegment">
<el-input v-model="formData.marketSegment" placeholder="请输入" maxlength="100" /> <el-input v-model="formData.marketSegment" placeholder="请输入" maxlength="100" />
@ -101,6 +124,8 @@ export default {
return { return {
visible: false, visible: false,
submitting: false, submitting: false,
isEditMode: false,
editingModelId: null,
ycOrOth: '竞品', // ycOrOth: '竞品', //
formData: { formData: {
modelName: '', modelName: '',
@ -112,7 +137,15 @@ export default {
marketSegment: '', marketSegment: '',
projectName: '', projectName: '',
projectNumber: '', projectNumber: '',
dispatchStatus: '' dispatchStatus: '',
emission: '',
burnType: '',
engineCapacity: '',
//
manufacturerName: '',
manufacturerAbbreviation: '',
brand: '',
productionDate: ''
}, },
formRules: { formRules: {
modelName: [{ required: true, message: '请输入产品型号', trigger: 'blur' }], modelName: [{ required: true, message: '请输入产品型号', trigger: 'blur' }],
@ -123,7 +156,8 @@ export default {
series: [{ required: true, message: '请输入系列', trigger: 'blur' }], series: [{ required: true, message: '请输入系列', trigger: 'blur' }],
marketSegment: [{ required: true, message: '请输入细分市场', trigger: 'blur' }], marketSegment: [{ required: true, message: '请输入细分市场', trigger: 'blur' }],
projectName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }], projectName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
projectNumber: [{ required: true, message: '请输入项目编号', trigger: 'blur' }] projectNumber: [{ required: true, message: '请输入项目编号', trigger: 'blur' }],
productionDate:[{ required: true, message: '请选择生产日期', trigger: 'blur' }]
// //
}, },
dispatchStatusOptions: [ dispatchStatusOptions: [
@ -132,10 +166,17 @@ export default {
] ]
} }
}, },
computed: {
modalTitle() {
return this.isEditMode ? '编辑机型' : '添加机型'
}
},
methods: { methods: {
showModal(ycOrOth = '竞品') { showModal(ycOrOth = '竞品') {
// ycOrOth // ycOrOth
// selfEnginedata.vue ""otherEnginedata.vue "" // selfEnginedata.vue ""otherEnginedata.vue ""
this.isEditMode = false
this.editingModelId = null
this.ycOrOth = ycOrOth this.ycOrOth = ycOrOth
this.visible = true this.visible = true
// //
@ -147,8 +188,46 @@ export default {
} }
}) })
}, },
showModalForEdit(ycOrOth, row) {
if (!row || row.id == null) {
this.$message({ message: '无法编辑:缺少机型标识', type: 'warning' })
return
}
this.isEditMode = true
this.editingModelId = row.id
this.ycOrOth = ycOrOth
this.visible = true
const r = row || {}
this.formData = {
loginUserId: getUserId(),
ycOrOth,
modelName: r.modelName != null ? String(r.modelName) : '',
productNumber: r.productNumber != null ? String(r.productNumber) : '',
plate: r.plate != null ? String(r.plate) : '',
platform: r.platform != null ? String(r.platform) : '',
series: r.series != null ? String(r.series) : '',
marketSegment: r.marketSegment != null ? String(r.marketSegment) : '',
projectName: r.projectName != null ? String(r.projectName) : '',
projectNumber: r.projectNumber != null ? String(r.projectNumber) : '',
distributeStatus: r.distributeStatus != null ? String(r.distributeStatus) : '未分发',
emission: r.emission != null ? String(r.emission) : '',
burnType: r.burnType != null ? String(r.burnType) : '',
engineCapacity: r.engineCapacity != null ? String(r.engineCapacity) : '',
manufacturerName: r.manufacturerName != null ? String(r.manufacturerName) : '',
manufacturerAbbreviation: r.manufacturerAbbreviation != null ? String(r.manufacturerAbbreviation) : '',
brand: r.brand != null ? String(r.brand) : '',
productionDate: r.productionDate != null ? String(r.productionDate) : ''
}
this.$nextTick(() => {
if (this.$refs.addForm) {
this.$refs.addForm.clearValidate()
}
})
},
closeModal() { closeModal() {
this.visible = false this.visible = false
this.isEditMode = false
this.editingModelId = null
this.ycOrOth = '竞品' // this.ycOrOth = '竞品' //
this.resetForm('竞品') this.resetForm('竞品')
}, },
@ -164,24 +243,41 @@ export default {
marketSegment: '', marketSegment: '',
projectName: '', projectName: '',
projectNumber: '', projectNumber: '',
distributeStatus: '未分发' distributeStatus: '未分发',
emission: '',
burnType: '',
engineCapacity: '',
//
manufacturerName: '',
manufacturerAbbreviation: '',
brand: '',
productionDate: ''
} }
}, },
handleSubmit() { handleSubmit() {
this.$refs.addForm.validate((valid) => { this.$refs.addForm.validate((valid) => {
if (valid) { if (valid) {
this.submitting = true this.submitting = true
const params = { ...this.formData }
Object.keys(params).forEach((k) => {
if (params[k] == null) params[k] = ''
})
const isEdit = this.isEditMode && this.editingModelId != null
if (isEdit) {
params.id = this.editingModelId
}
const apiDef = isEdit ? api.UPDATE_ENGINE_MODEL : api.ADD_ENGINE_MODEL
const request = { const request = {
...api.ADD_ENGINE_MODEL, ...apiDef,
params: { params: {
...this.formData ...params
}, },
disableSuccessMsg: true disableSuccessMsg: true
} }
this.$request(request) this.$request(request)
.asyncThen((resp) => { .asyncThen((resp) => {
this.$message({ this.$message({
message: '提交成功', message: isEdit ? '保存成功' : '提交成功',
type: 'success' type: 'success'
}) })
this.closeModal() this.closeModal()
@ -189,9 +285,9 @@ export default {
this.$emit('success') this.$emit('success')
}) })
.asyncErrorCatch((err) => { .asyncErrorCatch((err) => {
console.error('添加失败:', err) console.error(isEdit ? '更新失败:' : '添加失败:', err)
this.$message({ this.$message({
message: '添加失败', message: isEdit ? '更新失败' : '添加失败',
type: 'error' type: 'error'
}) })
}) })
@ -209,7 +305,8 @@ export default {
.add-engine-model-modal { .add-engine-model-modal {
.add-engine-form { .add-engine-form {
padding: 20px 0; padding: 20px 0;
height: calc(70vh - 120px) !important;
overflow-y: auto !important;
.form-row { .form-row {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -232,4 +329,5 @@ export default {
padding-top: 20px; padding-top: 20px;
} }
} }
</style> </style>

View File

@ -138,7 +138,14 @@
<template slot="empty"> <template slot="empty">
<div class="table-empty"> <div class="table-empty">
<x-empty-page></x-empty-page> <template v-if="canViewData">
<x-empty-page></x-empty-page>
</template>
<template v-else>
<div style="padding: 40px 0; text-align: center; color: #909399;">
<div style="font-size: 14px;">无权限查看</div>
</div>
</template>
</div> </div>
</template> </template>
</x-vxe-table> </x-vxe-table>
@ -221,7 +228,8 @@ export default {
opinion: '' opinion: ''
}, },
approvalSubmitting: false, approvalSubmitting: false,
currentApprovalRow: null currentApprovalRow: null,
canViewData: false //
} }
}, },
computed: { computed: {
@ -267,11 +275,80 @@ export default {
} }
} }
}, },
created() { mounted() {
// localStorage
if (this.hasViewPermission()) {
this.canViewData = true
this.loadData()
} else {
this.canViewData = false
this.tableData = []
}
//
this.loadUserSelfRole() this.loadUserSelfRole()
this.loadData() .then(() => {
//
if (this.hasViewPermission()) {
this.canViewData = true
//
if (this.tableData.length === 0) {
this.loadData()
}
} else {
this.canViewData = false
//
this.tableData = []
}
})
.catch(() => {
//
console.error('加载权限数据失败')
})
}, },
methods: { methods: {
// isAdmin === 1
isAdmin() {
try {
const permissionDataStr = localStorage.getItem('user_self_role')
if (!permissionDataStr) {
return false
}
const permissionData = JSON.parse(permissionDataStr)
if (!Array.isArray(permissionData)) {
return false
}
// isAdmin === 1
return permissionData.some((perm) => perm.isAdmin === 1 || perm.isAdmin === '1')
} catch (err) {
console.error('检查管理员权限失败:', err)
return false
}
},
//
hasViewPermission() {
// 1.
if (this.isAdmin()) {
return true
}
try {
const permissionDataStr = localStorage.getItem('user_self_role')
if (!permissionDataStr) {
return false
}
const permissionData = JSON.parse(permissionDataStr)
if (!Array.isArray(permissionData)) {
return false
}
// 2. permissionPath ""
return permissionData.some((perm) => {
const permissionPath = perm.permissionPath || ''
return permissionPath.includes('参数模板审批流程')
})
} catch (err) {
console.error('检查查看权限失败:', err)
return false
}
},
// //
loadUserSelfRole() { loadUserSelfRole() {
const request = { const request = {
@ -281,20 +358,27 @@ export default {
}, },
disableSuccessMsg: true disableSuccessMsg: true
} }
this.$request(request) return new Promise((resolve, reject) => {
.asyncThen((resp) => { this.$request(request)
if (resp && resp.data) { .asyncThen((resp) => {
// localStorage if (resp && resp.data) {
try { // localStorage
localStorage.setItem('user_self_role', JSON.stringify(resp.data)) try {
} catch (err) { localStorage.setItem('user_self_role', JSON.stringify(resp.data))
console.error('存储权限数据到 localStorage 失败:', err) resolve(resp.data)
} catch (err) {
console.error('存储权限数据到 localStorage 失败:', err)
reject(err)
}
} else {
resolve(null)
} }
} })
}) .asyncErrorCatch((err) => {
.asyncErrorCatch((err) => { console.error('获取用户自身角色失败:', err)
console.error('获取用户自身角色失败:', err) reject(err)
}) })
})
}, },
pageSizeChange(size) { pageSizeChange(size) {
this.pagination.pageSize = size this.pagination.pageSize = size

View File

@ -251,8 +251,8 @@
</div> --> </div> -->
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
<!-- 当选择"发起审批"节点时显示意见输入框 --> <!-- 当选择"编制"节点时显示意见输入框 -->
<div v-if="selectedReturnNode === '发起审批'" class="return-opinion-section"> <div v-if="selectedReturnNode === '编制'" class="return-opinion-section">
<div class="opinion-label"> <div class="opinion-label">
退回意见: 退回意见:
</div> </div>
@ -340,7 +340,7 @@ export default {
returnNodeDialogVisible: false, returnNodeDialogVisible: false,
selectedReturnNode: '', selectedReturnNode: '',
returnSubmitting: false, returnSubmitting: false,
returnOpinion: '', // 退使 returnOpinion: '', // 退使
resending: false, // loading resending: false, // loading
isEditingProcessTitle: false, // isEditingProcessTitle: false, //
editingProcessTitle: '' // editingProcessTitle: '' //
@ -781,14 +781,14 @@ export default {
this.$request(request) this.$request(request)
.asyncThen((resp) => { .asyncThen((resp) => {
console.log(resp) console.log(resp)
// "" // ""
const nodes = Array.isArray(resp.data) ? resp.data : [] const nodes = Array.isArray(resp.data) ? resp.data : []
this.returnableNodes = ['发起审批', ...nodes] this.returnableNodes = ['编制', ...nodes]
}) })
.asyncErrorCatch((err) => { .asyncErrorCatch((err) => {
console.error('获取退回节点失败:', err) console.error('获取退回节点失败:', err)
// 使"" // 使""
this.returnableNodes = ['发起审批'] this.returnableNodes = ['编制']
}) })
this.selectedReturnNode = '' this.selectedReturnNode = ''
this.returnOpinion = '' this.returnOpinion = ''
@ -802,8 +802,8 @@ export default {
}, },
// 退 // 退
handleReturnNodeChange() { handleReturnNodeChange() {
// "" // ""
if (this.selectedReturnNode !== '发起审批') { if (this.selectedReturnNode !== '编制') {
this.returnOpinion = '' this.returnOpinion = ''
} }
}, },
@ -821,8 +821,8 @@ export default {
this.returnSubmitting = true this.returnSubmitting = true
// "" // ""
if (this.selectedReturnNode === '发起审批') { if (this.selectedReturnNode === '编制') {
const submitData = { const submitData = {
flowId: this.detail.flowId, flowId: this.detail.flowId,
userId: getUserId(), userId: getUserId(),
@ -1557,22 +1557,20 @@ export default {
} }
} }
.return-opinion-section { }
margin-top: 16px; }
padding-top: 16px; .return-opinion-section {
margin-top: 16px !important;
border-top: 1px solid #ebeef5; border-top: 1px solid #ebeef5;
.opinion-label { .opinion-label {
margin-bottom: 8px; margin-bottom: 5px !important;
margin-top: 8px; margin-top: 5px !important;
font-size: 14px; font-size: 14px;
color: #606266; color: #606266;
font-weight: 500; font-weight: 500;
} }
} }
}
}
.approval-progress-fade-enter-active, .approval-progress-fade-enter-active,
.approval-progress-fade-leave-active { .approval-progress-fade-leave-active {
transition: opacity 0.2s ease; transition: opacity 0.2s ease;

Some files were not shown because too many files have changed in this diff Show More