前后端分目录
3
h5-datax-manager/.browserslistrc
Normal file
@@ -0,0 +1,3 @@
|
||||
> 1%
|
||||
last 2 versions
|
||||
not ie <= 8
|
||||
3
h5-datax-manager/.env.jia
Normal file
@@ -0,0 +1,3 @@
|
||||
NODE_ENV = 'jia'
|
||||
VUE_CURRENTMODE = 'jia'
|
||||
VUE_PROXY = true
|
||||
3
h5-datax-manager/.env.niu
Normal file
@@ -0,0 +1,3 @@
|
||||
NODE_ENV = 'niu'
|
||||
VUE_CURRENTMODE = 'niu'
|
||||
VUE_PROXY = true
|
||||
3
h5-datax-manager/.env.produce
Normal file
@@ -0,0 +1,3 @@
|
||||
NODE_ENV = 'produce'
|
||||
VUE_CURRENTMODE = 'produce'
|
||||
VUE_PROXY = true
|
||||
3
h5-datax-manager/.env.release
Normal file
@@ -0,0 +1,3 @@
|
||||
NODE_ENV = 'release'
|
||||
VUE_CURRENTMODE = 'release'
|
||||
VUE_PROXY = true
|
||||
3
h5-datax-manager/.env.test
Normal file
@@ -0,0 +1,3 @@
|
||||
NODE_ENV = 'test'
|
||||
VUE_CURRENTMODE = 'test'
|
||||
VUE_PROXY = true
|
||||
3
h5-datax-manager/.env.wang
Normal file
@@ -0,0 +1,3 @@
|
||||
NODE_ENV = 'wang'
|
||||
VUE_CURRENTMODE = 'wang'
|
||||
VUE_PROXY = true
|
||||
12
h5-datax-manager/.eslintrc.js
Normal file
@@ -0,0 +1,12 @@
|
||||
// {
|
||||
// "presets": [
|
||||
// ["env", {
|
||||
// "modules": false,
|
||||
// "targets": {
|
||||
// "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
|
||||
// }
|
||||
// }],
|
||||
// "stage-2"
|
||||
// ],
|
||||
// "plugins": ["transform-remove-strict-mode"]
|
||||
// }
|
||||
22
h5-datax-manager/.gitignore
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
example.html
|
||||
favicon.ico
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw*
|
||||
6
h5-datax-manager/.prettierrc
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"tabWidth": 4,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"printWidth": 140
|
||||
}
|
||||
21
h5-datax-manager/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016-2019 vue-manage-system
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
0
h5-datax-manager/README.md
Normal file
6
h5-datax-manager/babel.config.js
Normal file
@@ -0,0 +1,6 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/app'
|
||||
],
|
||||
|
||||
}
|
||||
89
h5-datax-manager/baseUrl.js
Normal file
@@ -0,0 +1,89 @@
|
||||
// console.log(process.env)
|
||||
var proxyObj = {}
|
||||
// console.log(process.env.VUE_PROXY)
|
||||
switch (process.env.NODE_ENV) {
|
||||
case 'development': // 开发环境代理地址
|
||||
proxyObj = {
|
||||
'/Riskmanage': {
|
||||
target: 'http://47.102.125.25:80', // 开发环境
|
||||
changeOrigin: true, // 是否跨域
|
||||
pathRewrite: {
|
||||
'^/Riskmanage': '/Riskmanage'
|
||||
},
|
||||
|
||||
},
|
||||
'/trading': {
|
||||
target: 'http://47.242.85.45:80', // 开发环境
|
||||
changeOrigin: true, // 是否跨域
|
||||
pathRewrite: {
|
||||
'^/trading': '/trading'
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
break
|
||||
case 'test': // 测试环境代理地址
|
||||
proxyObj = {
|
||||
'/Riskmanage': {
|
||||
target: 'http://localhost:8080', // 测试环境
|
||||
changeOrigin: true, // 是否跨域
|
||||
pathRewrite: {
|
||||
'^/Riskmanage': '/Riskmanage'
|
||||
}
|
||||
}
|
||||
}
|
||||
break
|
||||
case 'release': // 军环境
|
||||
proxyObj = {
|
||||
'/Riskmanage': {
|
||||
target: 'http://192.168.3.155:8080', // 谭环境
|
||||
changeOrigin: true, // 是否跨域
|
||||
pathRewrite: {
|
||||
'^/Riskmanage': '/Riskmanage'
|
||||
}
|
||||
}
|
||||
}
|
||||
break
|
||||
case 'niu': // 牛环境
|
||||
proxyObj = {
|
||||
'/Riskmanage': {
|
||||
target: 'http://dx.fibo.cn:80', // 生产环境
|
||||
changeOrigin: true, // 是否跨域
|
||||
pathRewrite: {
|
||||
'^/Riskmanage': '/Riskmanage'
|
||||
}
|
||||
}
|
||||
}
|
||||
break
|
||||
case 'jia': // 贾环境
|
||||
proxyObj = {
|
||||
'/Riskmanage': {
|
||||
target: 'http://zhangzj.vip:8000', // 生产环境
|
||||
changeOrigin: true, // 是否跨域
|
||||
pathRewrite: {
|
||||
'^/Riskmanage': '/Riskmanage'
|
||||
}
|
||||
}
|
||||
// '/list': {
|
||||
// target: 'http://127.0.0.1:8888', // 生产环境
|
||||
// changeOrigin: true, // 是否跨域
|
||||
// pathRewrite: {
|
||||
// '^/list': '/list'
|
||||
// }
|
||||
// },
|
||||
}
|
||||
break
|
||||
case 'wang': // 汪环境
|
||||
proxyObj = {
|
||||
'/Riskmanage': {
|
||||
target: 'http://192.168.50.228:8080', // 生产环境
|
||||
changeOrigin: true, // 是否跨域
|
||||
pathRewrite: {
|
||||
'^/Riskmanage': '/Riskmanage'
|
||||
}
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
module.exports = proxyObj
|
||||
BIN
h5-datax-manager/favicon.icon
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
9
h5-datax-manager/h5-enginex-manager.iml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
14
h5-datax-manager/index.html
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite App</title>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="./src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
BIN
h5-datax-manager/logo.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
13840
h5-datax-manager/package-lock.json
generated
Normal file
57
h5-datax-manager/package.json
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"name": "vue-manage-system",
|
||||
"version": "4.2.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"serve:test": "vue-cli-service serve --mode test",
|
||||
"serve:jia": "vue-cli-service serve --mode jia",
|
||||
"serve:niu": "vue-cli-service serve --mode niu",
|
||||
"serve:wang": "vue-cli-service serve --mode wang",
|
||||
"serve:release": "vue-cli-service serve --mode release",
|
||||
"serve:produce": "vue-cli-service serve --mode produce",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint",
|
||||
"eslint": "eslint --fix --ext .js,.vue src",
|
||||
"stylelint": "stylelint **/*.{vue,css,scss,less} --fix",
|
||||
"standard": "standard",
|
||||
"standfix": "standard --fix",
|
||||
"dev": "vite",
|
||||
"start": "vite",
|
||||
"preview": "vite preview",
|
||||
"vite-build": "vite build"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.18.1",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"echarts": "^5.1.2",
|
||||
"element-ui": "^2.11.0",
|
||||
"js-cookie": "^2.2.1",
|
||||
"less": "^4.1.1",
|
||||
"less-loader": "^5.0.0",
|
||||
"mavon-editor": "^2.6.17",
|
||||
"node-sass": "^4.14.1",
|
||||
"vue": "^2.6.10",
|
||||
"vue-codemirror": "^4.0.6",
|
||||
"vue-cropperjs": "^3.0.0",
|
||||
"vue-i18n": "^8.10.0",
|
||||
"vue-quill-editor": "^3.0.6",
|
||||
"vue-router": "^3.0.3",
|
||||
"vuedraggable": "^2.17.0",
|
||||
"vuex": "^3.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "^3.9.0",
|
||||
"@vue/cli-service": "^3.9.0",
|
||||
"babel-plugin-transform-remove-strict-mode": "0.0.2",
|
||||
"mockjs": "^1.1.0",
|
||||
"sass-loader": "^7.3.1",
|
||||
"sass-resources-loader": "^2.1.1",
|
||||
"style-loader": "^2.0.0",
|
||||
"vue-template-compiler": "^2.6.10",
|
||||
"vite": "2",
|
||||
"@vitejs/plugin-legacy": "^1.4.4",
|
||||
"vite-plugin-mock": "2",
|
||||
"vite-plugin-vue2": "latest"
|
||||
}
|
||||
}
|
||||
5
h5-datax-manager/postcss.config.js
Normal file
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
plugins: {
|
||||
autoprefixer: {}
|
||||
}
|
||||
}
|
||||
BIN
h5-datax-manager/public/img/baimingdan.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
h5-datax-manager/public/img/blackName.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
h5-datax-manager/public/img/champion.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
h5-datax-manager/public/img/childEngine.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
h5-datax-manager/public/img/createBlackName.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
h5-datax-manager/public/img/createCrediteLevel.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
h5-datax-manager/public/img/createDcisionOption.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
h5-datax-manager/public/img/createRiverRate.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
h5-datax-manager/public/img/createRuleGroup.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
h5-datax-manager/public/img/createScoreLevel.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
h5-datax-manager/public/img/createUserGroup.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
h5-datax-manager/public/img/createWhiteName.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
h5-datax-manager/public/img/dcisionOption.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
h5-datax-manager/public/img/decisionBcg.jpg
Normal file
|
After Width: | Height: | Size: 684 KiB |
BIN
h5-datax-manager/public/img/gettogether.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
h5-datax-manager/public/img/guizeji.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
h5-datax-manager/public/img/heimingdan.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
h5-datax-manager/public/img/juecebiao.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
h5-datax-manager/public/img/juecebiaonode.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
h5-datax-manager/public/img/jueceshu.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
h5-datax-manager/public/img/jueceshuNode.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
h5-datax-manager/public/img/models.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
h5-datax-manager/public/img/moxing.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
h5-datax-manager/public/img/parallelNode.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
h5-datax-manager/public/img/pingfenka.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
h5-datax-manager/public/img/rpc.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
h5-datax-manager/public/img/rpcnode.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
h5-datax-manager/public/img/ruleGroup.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
h5-datax-manager/public/img/scoreLevel.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
h5-datax-manager/public/img/start.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
h5-datax-manager/public/img/userGroup.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
h5-datax-manager/public/img/whiteName.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
h5-datax-manager/public/img/ziyinqing.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
290
h5-datax-manager/public/index.html
Normal file
BIN
h5-datax-manager/public/logo.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
40
h5-datax-manager/public/table.json
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"list": [{
|
||||
"id": 1,
|
||||
"name": "张三",
|
||||
"money": 123,
|
||||
"address": "广东省东莞市长安镇",
|
||||
"state": "成功",
|
||||
"date": "2019-11-1",
|
||||
"thumb": "https://lin-xin.gitee.io/images/post/wms.png"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": "李四",
|
||||
"money": 456,
|
||||
"address": "广东省广州市白云区",
|
||||
"state": "成功",
|
||||
"date": "2019-10-11",
|
||||
"thumb": "https://lin-xin.gitee.io/images/post/node3.png"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"name": "王五",
|
||||
"money": 789,
|
||||
"address": "湖南省长沙市",
|
||||
"state": "失败",
|
||||
"date": "2019-11-11",
|
||||
"thumb": "https://lin-xin.gitee.io/images/post/parcel.png"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"name": "赵六",
|
||||
"money": 1011,
|
||||
"address": "福建省厦门市鼓浪屿",
|
||||
"state": "成功",
|
||||
"date": "2019-10-20",
|
||||
"thumb": "https://lin-xin.gitee.io/images/post/notice.png"
|
||||
}
|
||||
],
|
||||
"pageTotal": 4
|
||||
}
|
||||
63
h5-datax-manager/src/App.vue
Normal file
@@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
|
||||
<!-- <keep-alive include="history"> -->
|
||||
<router-view></router-view>
|
||||
<!-- </keep-alive> -->
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
// import {
|
||||
// fieldusing
|
||||
// } from '@/api/index.js'
|
||||
export default {
|
||||
name: 'App',
|
||||
created() {
|
||||
|
||||
// getV({page:2}).then(res=>{
|
||||
|
||||
// console.log(String(res))
|
||||
// })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
@import "./assets/css/main.css";
|
||||
@import "./assets/css/color-dark.css";
|
||||
|
||||
/*深色主题*/
|
||||
/*@import "./assets/css/theme-green/color-green.css"; 浅绿色主题*/
|
||||
.setting-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.setting-wrapper .line {
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.call-mode-wrapper,
|
||||
.setting-wrapper {
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.conditions-wrapper {
|
||||
/* display: flex; */
|
||||
margin: 15px 0;
|
||||
/* align-items: center; */
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.type3_submit_home {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
left: 80%;
|
||||
margin-top: 30px;
|
||||
top: 74.5vh;
|
||||
z-index: 999;
|
||||
}
|
||||
</style>
|
||||
111
h5-datax-manager/src/api/index.js
Normal file
@@ -0,0 +1,111 @@
|
||||
import request from '../utils/request';
|
||||
// console.log(request)
|
||||
|
||||
// export const getV = (params) => request.get(`${window.location.origin}/index.html?time=${new Date().getTime()}`)
|
||||
|
||||
|
||||
|
||||
export const fetchData = (params) => request.get('./table.json',{params})
|
||||
// 登录接口
|
||||
export const getLogin = (params) => request.post('Riskmanage/v2/login/login',params)
|
||||
// 登出接口
|
||||
export const getLogout = (params) => request.post('Riskmanage/v2/login/logout',params)
|
||||
// 查询菜单权限接口
|
||||
export const getMenus = (params) => request.post('Riskmanage/v2/sysMenu/getMenus',params)
|
||||
// 查询首页统计信息
|
||||
export const getIndexInfo = (params) => request.post('Riskmanage/DataX/home/getIndexInfo',params)
|
||||
// 获取调用最多的10条
|
||||
export const getFieldCallCountList = (params) => request.post('Riskmanage/DataX/statistics/getFieldCallCountList',params)
|
||||
|
||||
|
||||
|
||||
// 数据源 数据库列表
|
||||
export const getDataSourcelist = (params) => request.post('/Riskmanage/datasource/getDataSourceList',params)
|
||||
// 数据源 修改以及创建数据库
|
||||
export const setDataSource = (params) => request.post('/Riskmanage/datasource/save',params)
|
||||
// 数据源 删除
|
||||
export const deleteDataSource = (id) => request.delete('/Riskmanage/datasource/'+id)
|
||||
// 数据源 修改数据源
|
||||
export const updataDataSource = (params) => request.post('/Riskmanage/datasource/update',params)
|
||||
|
||||
|
||||
// 指标管理 listTree 获取
|
||||
export const getfieldListTree = (params) => request.post('/Riskmanage/v2/datamanage/field/newListTree',params)
|
||||
|
||||
// 指标管理 指标列表 获取
|
||||
export const getfieldList = (params) => request.post('/Riskmanage/v2/datamanage/field/list',params)
|
||||
|
||||
// 指标管理 指标列表 获取
|
||||
export const addfieldList = (params) => request.post('/Riskmanage/v2/datamanage/field/addTree',params)
|
||||
// 指标管理 更新类型 名称
|
||||
export const updatafieldList = (params) => request.post('/Riskmanage/v2/datamanage/field/updateTree',params)
|
||||
// 指标管理 更新类型 名称
|
||||
export const getFieldUser = (params) => request.post('/Riskmanage/v2/datamanage/field/findFieldByUser',params)
|
||||
|
||||
// 保存 增加属性
|
||||
export const getfieldsave = (params) => request.post('/Riskmanage/v2/datamanage/field/save',params)
|
||||
// 编辑保存
|
||||
export const updatafield = (params) => request.post('/Riskmanage/v2/datamanage/field/update',params)
|
||||
// 启用等
|
||||
export const fieldusing = (params) => request.post('/Riskmanage/v2/datamanage/field/updateStatus',params)
|
||||
// 指标导入模板下载
|
||||
export const fielddownTemplate = (params) => request.post('/Riskmanage/v2/datamanage/field/downTemplate',params)
|
||||
// 指标批量模板上传
|
||||
export const fieldupdata = (params) => request.post('/Riskmanage/v2/datamanage/field/upload',params)
|
||||
// 获取指标管理
|
||||
export const getfieldInfo = (id,params) => request.post('/Riskmanage/v2/datamanage/field/getFieldInfo/'+id,{params})
|
||||
|
||||
// 指标文件夹移动
|
||||
export const updateFieldFolder = (params) => request.post('/Riskmanage/v2/datamanage/field/updateFieldFolder',params)
|
||||
|
||||
|
||||
// =====================接口管理==============================
|
||||
// 获取list
|
||||
export const getInterfaceList = (params) => request.post('/Riskmanage/v3/interface/getInterfaceList',params)
|
||||
// 新增list
|
||||
export const addInterface = (params) => request.post('/Riskmanage/v3/interface/addInterface',params)
|
||||
// 修改list
|
||||
export const updateInterface = (params) => request.post('/Riskmanage/v3/interface/updateInterface',params)
|
||||
// 删除list
|
||||
export const deleteInterface = (params) => request.post('/Riskmanage/v3/interface/deleteInterface',params)
|
||||
// 测试接口
|
||||
export const getHttpResponse = (params) => request.post('/Riskmanage/v3/interface/getHttpResponse',params)
|
||||
|
||||
// =====================消息队列管理==============================
|
||||
// 获取list
|
||||
export const getMqSourceList = (params) => request.post('/Riskmanage/mqSource/getMqSourceList',params)
|
||||
// 新增list
|
||||
export const addMqSource = (params) => request.post('/Riskmanage/mqSource/addMqSource',params)
|
||||
// 修改list
|
||||
export const updateMqSource = (params) => request.post('/Riskmanage/mqSource/updateMqSource',params)
|
||||
// 删除list
|
||||
export const MqupdateStatus = (params) => request.post('/Riskmanage/mqSource/updateStatus',params)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ======================接口管理 ==============================
|
||||
|
||||
export const getengineSummaryList = (params) => request.post('/Riskmanage/v3/1',params)
|
||||
|
||||
|
||||
// =====================指标统计========================
|
||||
// 获取指标调用次数
|
||||
export const getFieldCallList = (params) => request.post('/Riskmanage/DataX/statistics/getFieldCallList',params)
|
||||
|
||||
// 获取指标日志
|
||||
export const getFieldCallLogList = (params) => request.post('/Riskmanage/DataX/statistics/getFieldCallLogList',params)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getV = (params) => request.post('/list/product',params)
|
||||
|
||||
|
||||
|
||||
159
h5-datax-manager/src/assets/css/ManageRedact.css
Normal file
@@ -0,0 +1,159 @@
|
||||
.dataManageRedact {
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.MR_header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
padding:20px;
|
||||
box-sizing: border-box;
|
||||
border-bottom: 1px solid #ddd;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.MR_header>div:nth-of-type(1) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 12%;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.MR_input {
|
||||
|
||||
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
border-bottom: 1px solid #ddd;
|
||||
transition: all 0.2s;
|
||||
|
||||
padding: 20px 0 20px 0;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.MR_input input {
|
||||
|
||||
|
||||
transition: all 0.2s;
|
||||
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.MR_scope {
|
||||
border-bottom: 1px solid #ddd;
|
||||
transition: all 0.2s;
|
||||
padding: 20px 0 20px 0;
|
||||
font-size: 16px;
|
||||
/* display: flex; */
|
||||
}
|
||||
|
||||
.MR_scope input {
|
||||
height: 40px;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.MR_headerSmall {
|
||||
padding:8px 20px 8px 20px;
|
||||
|
||||
}
|
||||
.MR_inputSmall {
|
||||
padding: 0;
|
||||
font-size: 14px;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.MR_inputSmall input {
|
||||
height: 25px;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.MR_scopeSmall input {
|
||||
height: 25px;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.MR_scopeSmall {
|
||||
padding:0;
|
||||
font-size: 14px;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.MR_input>div {
|
||||
width: 30%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
margin-left: 2%;
|
||||
}
|
||||
|
||||
.MR_input>div>p {
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.MR_checkbox {
|
||||
padding: 20px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.MR_scope>div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 2%;
|
||||
}
|
||||
|
||||
.MR_scope>div>p {
|
||||
width: 7.6%;
|
||||
}
|
||||
|
||||
.MR_derive {
|
||||
|
||||
margin: 0 40px 0 40px;
|
||||
|
||||
}
|
||||
|
||||
.MR_rule_home {
|
||||
overflow: scroll;
|
||||
overflow-x: hidden;
|
||||
height: 350px;
|
||||
}
|
||||
|
||||
.MR_rule_home::-webkit-scrollbar {
|
||||
display: none;
|
||||
/* Chrome Safari */
|
||||
}
|
||||
|
||||
.MR_toolbar {
|
||||
background-color: #F0F0F0;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
user-select: none;
|
||||
|
||||
}
|
||||
|
||||
.MR_toolbar>p:hover {
|
||||
color: #fff;
|
||||
|
||||
}
|
||||
265
h5-datax-manager/src/assets/css/alicdn.css
Normal file
28
h5-datax-manager/src/assets/css/color-dark.css
Normal file
@@ -0,0 +1,28 @@
|
||||
.header{
|
||||
background-color: #242f42;
|
||||
}
|
||||
.login-wrap{
|
||||
background: #324157;
|
||||
}
|
||||
.plugins-tips{
|
||||
background: #eef1f6;
|
||||
}
|
||||
.plugins-tips a{
|
||||
color: #20a0ff;
|
||||
}
|
||||
.el-upload--text em {
|
||||
color: #20a0ff;
|
||||
}
|
||||
.pure-button{
|
||||
background: #20a0ff;
|
||||
}
|
||||
.tags-li.active {
|
||||
border: 1px solid #409EFF;
|
||||
background-color: #409EFF;
|
||||
}
|
||||
.message-title{
|
||||
color: #20a0ff;
|
||||
}
|
||||
.collapse-btn:hover{
|
||||
background: rgb(40,52,70);
|
||||
}
|
||||
124
h5-datax-manager/src/assets/css/cont.css
Normal file
@@ -0,0 +1,124 @@
|
||||
.cont_cont {
|
||||
display: flex;
|
||||
border-radius: 20px;
|
||||
height: 85vh;
|
||||
}
|
||||
|
||||
.cont_left {
|
||||
width: 200px;
|
||||
flex-shrink: 0;
|
||||
background-color: #fff;
|
||||
border-radius: 10px 0 0 10px;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.cont_list {
|
||||
height: 70vh;
|
||||
overflow: scroll;
|
||||
scrollbar-width: none;
|
||||
/* Firefox */
|
||||
-ms-overflow-style: none;
|
||||
/* IE 10+ */
|
||||
overflow-x: hidden;
|
||||
/* position: relative; */
|
||||
}
|
||||
|
||||
.cont_list::-webkit-scrollbar {
|
||||
display: none;
|
||||
/* Chrome Safari */
|
||||
}
|
||||
|
||||
.cont_left::-webkit-scrollbar-track {
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
||||
border-radius: 10px;
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.cont_header {
|
||||
margin-left: 20px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.cont_header_title {
|
||||
color: #444;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.cont_header_subtitle {
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.cont_new_file {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
font-size: 16px;
|
||||
border-top: 1px solid #ddd;
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding: 10px 0 10px 15px;
|
||||
box-sizing: border-box;
|
||||
margin-top: 15px;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.cont_new_file>div{
|
||||
margin-left: 10px;
|
||||
}
|
||||
.file_select {
|
||||
border: #409EFF 2px solid;
|
||||
border-radius: 2px;
|
||||
color: #409EFF;
|
||||
}
|
||||
|
||||
.cont_right {
|
||||
flex-grow: 1;
|
||||
overflow: hidden;
|
||||
background-color: #fafafa;
|
||||
border-radius: 10px 10px 10px 10px;
|
||||
}
|
||||
|
||||
.cont_right_hint {
|
||||
font-size: 100px;
|
||||
color: #00000011;
|
||||
text-align: center;
|
||||
line-height: 80vh;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.cont_right_top {
|
||||
padding: 21px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 2px solid #eee;
|
||||
}
|
||||
.contText{
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: block;
|
||||
}
|
||||
.contText:hover{
|
||||
white-space:inherit !important
|
||||
}
|
||||
.fileHint{
|
||||
position: fixed;
|
||||
background-color: #fafafa;
|
||||
padding: 5px;
|
||||
|
||||
}
|
||||
.fileHint>p{
|
||||
border-bottom: 1px solid #000;
|
||||
}
|
||||
.fileHint>p:hover{
|
||||
color: #409EFF;
|
||||
}
|
||||
4
h5-datax-manager/src/assets/css/icon.css
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
[class*=" el-icon-lx"], [class^=el-icon-lx] {
|
||||
font-family: lx-iconfont!important;
|
||||
}
|
||||
185
h5-datax-manager/src/assets/css/main.css
Normal file
@@ -0,0 +1,185 @@
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html,
|
||||
body,
|
||||
#app,
|
||||
.wrapper {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
|
||||
.content-box {
|
||||
position: absolute;
|
||||
left: 250px;
|
||||
right: 0;
|
||||
top: 70px;
|
||||
bottom: 0;
|
||||
padding-bottom: 30px;
|
||||
-webkit-transition: left .3s ease-in-out;
|
||||
transition: left .3s ease-in-out;
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: auto;
|
||||
height: 100%;
|
||||
padding: 10px;
|
||||
/* overflow-y: scroll; */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.content-collapse {
|
||||
left: 65px;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 30px;
|
||||
background: #fff;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.crumbs {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.el-table th {
|
||||
background-color: #f5f7fa !important;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
margin: 20px 0;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.plugins-tips {
|
||||
padding: 20px 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.el-button+.el-tooltip {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.el-table tr:hover {
|
||||
background: #f6faff;
|
||||
}
|
||||
|
||||
.mgb20 {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.move-enter-active,
|
||||
.move-leave-active {
|
||||
transition: opacity .5s;
|
||||
}
|
||||
|
||||
.move-enter,
|
||||
.move-leave {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
/*BaseForm*/
|
||||
|
||||
.form-box {
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
.form-box .line {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.el-time-panel__content::after,
|
||||
.el-time-panel__content::before {
|
||||
margin-top: -7px;
|
||||
}
|
||||
|
||||
.el-time-spinner__wrapper .el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default) {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
/*Upload*/
|
||||
|
||||
.pure-button {
|
||||
width: 150px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.g-core-image-corp-container .info-aside {
|
||||
height: 45px;
|
||||
}
|
||||
|
||||
.el-upload--text {
|
||||
background-color: #fff;
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
box-sizing: border-box;
|
||||
width: 360px;
|
||||
height: 180px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.el-upload--text .el-icon-upload {
|
||||
font-size: 67px;
|
||||
color: #97a8be;
|
||||
margin: 40px 0 16px;
|
||||
line-height: 50px;
|
||||
}
|
||||
|
||||
.el-upload--text {
|
||||
color: #97a8be;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.el-upload--text em {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
/*VueEditor*/
|
||||
|
||||
.ql-container {
|
||||
min-height: 400px;
|
||||
}
|
||||
|
||||
.ql-snow .ql-tooltip {
|
||||
transform: translateX(117.5px) translateY(10px) !important;
|
||||
}
|
||||
|
||||
.editor-btn {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
/*markdown*/
|
||||
|
||||
.v-note-wrapper .v-note-panel {
|
||||
min-height: 500px;
|
||||
}
|
||||
|
||||
.content-wrapper{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
padding: 21px;
|
||||
}
|
||||
29
h5-datax-manager/src/assets/css/theme-green/color-green.css
Normal file
@@ -0,0 +1,29 @@
|
||||
.header{
|
||||
background-color: #07c4a8;
|
||||
}
|
||||
.login-wrap{
|
||||
background: rgba(56, 157, 170, 0.82);;
|
||||
}
|
||||
.plugins-tips{
|
||||
background: #f2f2f2;
|
||||
}
|
||||
.plugins-tips a{
|
||||
color: #00d1b2;
|
||||
}
|
||||
.el-upload--text em {
|
||||
color: #00d1b2;
|
||||
}
|
||||
.pure-button{
|
||||
background: #00d1b2;
|
||||
}
|
||||
.pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, .pagination > .active > span, .pagination > .active > span:hover, .pagination > .active > span:focus {
|
||||
background-color: #00d1b2 !important;
|
||||
border-color: #00d1b2 !important;
|
||||
}
|
||||
.tags-li.active {
|
||||
border: 1px solid #00d1b2;
|
||||
background-color: #00d1b2;
|
||||
}
|
||||
.collapse-btn:hover{
|
||||
background: #00d1b2;
|
||||
}
|
||||
1
h5-datax-manager/src/assets/css/theme-green/index.css
Normal file
BIN
h5-datax-manager/src/assets/img/img.jpg
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
h5-datax-manager/src/assets/img/img(1).jpg
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
h5-datax-manager/src/assets/img/login-bg.jpg
Normal file
|
After Width: | Height: | Size: 69 KiB |
BIN
h5-datax-manager/src/assets/logo.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
24
h5-datax-manager/src/assets/utils.js
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
export function formatDate (date, fmt) {
|
||||
if (/(y+)/.test(fmt)) {
|
||||
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
|
||||
}
|
||||
let o = {
|
||||
'M+': date.getMonth() + 1,
|
||||
'd+': date.getDate(),
|
||||
'h+': date.getHours(),
|
||||
'm+': date.getMinutes(),
|
||||
's+': date.getSeconds()
|
||||
};
|
||||
for (let k in o) {
|
||||
if (new RegExp(`(${k})`).test(fmt)) {
|
||||
let str = o[k] + '';
|
||||
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
|
||||
}
|
||||
}
|
||||
return fmt;
|
||||
};
|
||||
|
||||
function padLeftZero (str) {
|
||||
return ('00' + str).substr(str.length);
|
||||
};
|
||||
328
h5-datax-manager/src/components/common/Header.vue
Normal file
@@ -0,0 +1,328 @@
|
||||
<template>
|
||||
<div class="header">
|
||||
<!-- 折叠按钮 -->
|
||||
<div class="collapse-btn" @click="collapseChage">
|
||||
<i v-if="!collapse" class="el-icon-s-fold"></i>
|
||||
<i v-else class="el-icon-s-unfold"></i>
|
||||
</div>
|
||||
<div class="logo">数据中心</div>
|
||||
<div class="header-right">
|
||||
<!-- {{fielduser}} -->
|
||||
<!-- {{ruleList}} -->
|
||||
|
||||
<!-- {{fielduser==''}} -->
|
||||
<!-- {{ruleList==null}} -->
|
||||
<div class="header-user-con">
|
||||
<div style="display: flex;font-size: 14px;">
|
||||
|
||||
|
||||
<div v-for="value in link.d" class="header_link" @click="go(value)">
|
||||
{{value.title}}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<!-- -->
|
||||
<div class="btn-fullscreen" @click="ReGetStorage">
|
||||
<!-- {{fielduser}} -->
|
||||
<!-- {{ruleList=='[]'}} -->
|
||||
<el-tooltip effect="dark" content="刷新缓存" placement="bottom">
|
||||
|
||||
<i :class="Loading?'el-icon-loading':'el-icon-refresh'"></i>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
|
||||
<!-- 全屏显示 -->
|
||||
<div class="btn-fullscreen" @click="handleFullScreen">
|
||||
<el-tooltip effect="dark" :content="fullscreen?`取消全屏`:`全屏`" placement="bottom">
|
||||
<i class="el-icon-rank"></i>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<!-- 消息中心
|
||||
<div class="btn-bell">
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
:content="message?`有${message}条未读消息`:`消息中心`"
|
||||
placement="bottom"
|
||||
>
|
||||
<router-link to="/tabs">
|
||||
<i class="el-icon-bell"></i>
|
||||
</router-link>
|
||||
</el-tooltip>
|
||||
<span class="btn-bell-badge" v-if="message"></span>
|
||||
</div> -->
|
||||
<!-- 用户头像 -->
|
||||
<div class="user-avator">
|
||||
<img src="../../assets/img/img.jpg" />
|
||||
</div>
|
||||
<!-- 用户名下拉菜单 -->
|
||||
<el-dropdown class="user-name" trigger="click" @command="handleCommand">
|
||||
<span class="el-dropdown-link">
|
||||
{{username}}
|
||||
<i class="el-icon-caret-bottom"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item divided command="loginout">退出登录</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import bus from '../common/bus';
|
||||
import {
|
||||
getLogout
|
||||
} from '../../api/index';
|
||||
import linkOr from '@/utils/link.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
collapse: false,
|
||||
fullscreen: false,
|
||||
name: '',
|
||||
message: 2,
|
||||
link:[]
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
||||
this.link = linkOr
|
||||
bus.$on('collapseHeader', res => {
|
||||
this.busCollapseChage(res)
|
||||
})
|
||||
bus.$on('regetcache',res=>{
|
||||
|
||||
this.$store.dispatch('regetcache',res)
|
||||
})
|
||||
|
||||
this.$store.dispatch('getfielduser')
|
||||
|
||||
|
||||
|
||||
Object.keys(this.$store.state.cacheList).forEach(value => {
|
||||
|
||||
this.$store.dispatch('getcache', value)
|
||||
})
|
||||
|
||||
this.$store.commit('setbarShrink', this.collapse)
|
||||
},
|
||||
computed: {
|
||||
username() {
|
||||
if (localStorage.getItem('ms_username')) {
|
||||
return localStorage.getItem('ms_username');
|
||||
} else {
|
||||
return "未命名"
|
||||
}
|
||||
},
|
||||
fielduser() {
|
||||
if (this.$store.state.FieldUser) {
|
||||
return this.$store.state.FieldUser.data.fieldList
|
||||
} else {
|
||||
|
||||
return null
|
||||
}
|
||||
},
|
||||
ruleList() {
|
||||
if (this.$store.state.RuleList) {
|
||||
return this.$store.state.RuleList
|
||||
|
||||
} else {
|
||||
|
||||
return null
|
||||
}
|
||||
},
|
||||
Loading() {
|
||||
if (this.$store.state.FieldUser == null) {
|
||||
return true
|
||||
}
|
||||
|
||||
let is = false
|
||||
Object.keys(this.$store.state.cacheList).forEach(value => {
|
||||
if (this.$store.state[value] == null) {
|
||||
is = true
|
||||
}
|
||||
})
|
||||
if(is) return true
|
||||
|
||||
|
||||
|
||||
|
||||
return false
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
go(value) {
|
||||
var url = window.location.href
|
||||
|
||||
if (value[url.split('#')[0]]) {
|
||||
window.open(value[url.split('#')[0]])
|
||||
} else {
|
||||
this.$message.error('请检查跳转配置')
|
||||
}
|
||||
},
|
||||
ReGetStorage() {
|
||||
|
||||
if (this.Loading) {
|
||||
return
|
||||
}
|
||||
|
||||
this.mixinReGetStorage()
|
||||
},
|
||||
// 用户名下拉菜单选择事件
|
||||
handleCommand(command) {
|
||||
if (command == 'loginout') {
|
||||
// 调用退出登录接口
|
||||
getLogout();
|
||||
localStorage.removeItem("engineId");
|
||||
// localStorage.removeItem("token");
|
||||
localStorage.removeItem('ms_username');
|
||||
this.$router.push('/login');
|
||||
}
|
||||
},
|
||||
// Bus侧边栏折叠
|
||||
busCollapseChage(res) {
|
||||
this.collapse = res;
|
||||
this.$store.commit('setbarShrink', this.collapse)
|
||||
bus.$emit('collapse', this.collapse);
|
||||
},
|
||||
// 侧边栏折叠
|
||||
collapseChage() {
|
||||
this.collapse = !this.collapse;
|
||||
this.$store.commit('setbarShrink', this.collapse)
|
||||
bus.$emit('collapse', this.collapse);
|
||||
},
|
||||
// 全屏事件
|
||||
handleFullScreen() {
|
||||
let element = document.documentElement;
|
||||
if (this.fullscreen) {
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
} else if (document.webkitCancelFullScreen) {
|
||||
document.webkitCancelFullScreen();
|
||||
} else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen();
|
||||
} else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen();
|
||||
}
|
||||
} else {
|
||||
if (element.requestFullscreen) {
|
||||
element.requestFullscreen();
|
||||
} else if (element.webkitRequestFullScreen) {
|
||||
element.webkitRequestFullScreen();
|
||||
} else if (element.mozRequestFullScreen) {
|
||||
element.mozRequestFullScreen();
|
||||
} else if (element.msRequestFullscreen) {
|
||||
// IE11
|
||||
element.msRequestFullscreen();
|
||||
}
|
||||
}
|
||||
this.fullscreen = !this.fullscreen;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (document.body.clientWidth < 1500) {
|
||||
this.collapseChage();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.header {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
height: 70px;
|
||||
font-size: 22px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.collapse-btn {
|
||||
float: left;
|
||||
padding: 0 21px;
|
||||
cursor: pointer;
|
||||
line-height: 70px;
|
||||
}
|
||||
.header_link {
|
||||
padding: 4px;
|
||||
margin-right: 20px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.header_link:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
.header .logo {
|
||||
float: left;
|
||||
width: 250px;
|
||||
line-height: 70px;
|
||||
}
|
||||
|
||||
.header-right {
|
||||
float: right;
|
||||
padding-right: 50px;
|
||||
}
|
||||
|
||||
.header-user-con {
|
||||
display: flex;
|
||||
height: 70px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.btn-fullscreen {
|
||||
transform: rotate(45deg);
|
||||
margin-right: 5px;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.btn-bell,
|
||||
.btn-fullscreen {
|
||||
position: relative;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
text-align: center;
|
||||
border-radius: 15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn-bell-badge {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: -2px;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 4px;
|
||||
background: #f56c6c;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-bell .el-icon-bell {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.user-name {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.user-avator {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.user-avator img {
|
||||
display: block;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.el-dropdown-link {
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.el-dropdown-menu__item {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
51
h5-datax-manager/src/components/common/Home.vue
Normal file
@@ -0,0 +1,51 @@
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
<v-head></v-head>
|
||||
<v-sidebar></v-sidebar>
|
||||
<div class="content-box" :class="{'content-collapse':collapse}">
|
||||
<v-tags></v-tags>
|
||||
<div class="content" >
|
||||
<transition name="move" mode="out-in">
|
||||
<keep-alive :include="tagsList">
|
||||
<router-view></router-view>
|
||||
</keep-alive>
|
||||
</transition>
|
||||
<el-backtop target=".content"></el-backtop>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import vHead from './Header.vue';
|
||||
import vSidebar from './Sidebar.vue';
|
||||
import vTags from './Tags.vue';
|
||||
import bus from './bus';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tagsList: [],
|
||||
collapse: false
|
||||
};
|
||||
},
|
||||
components: {
|
||||
vHead,
|
||||
vSidebar,
|
||||
vTags
|
||||
},
|
||||
created() {
|
||||
bus.$on('collapse-content', msg => {
|
||||
this.collapse = msg;
|
||||
});
|
||||
|
||||
// 只有在标签页列表里的页面才使用keep-alive,即关闭标签之后就不保存到内存中了。
|
||||
bus.$on('tags', msg => {
|
||||
let arr = [];
|
||||
for (let i = 0, len = msg.length; i < len; i++) {
|
||||
msg[i].name && arr.push(msg[i].name);
|
||||
}
|
||||
this.tagsList = arr;
|
||||
});
|
||||
},
|
||||
};
|
||||
</script>
|
||||
103
h5-datax-manager/src/components/common/Sidebar.vue
Normal file
@@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<div class="sidebar">
|
||||
<el-menu class="sidebar-el-menu" :default-active="onRoutes" :collapse="collapse" background-color="#324157"
|
||||
text-color="#bfcbd9" active-text-color="#20a0ff" unique-opened :router="true">
|
||||
<template v-for="item in items">
|
||||
<template v-if="item.subs">
|
||||
<el-submenu :index="item.index" :key="item.index">
|
||||
<template slot="title">
|
||||
<i :class="item.icon"></i>
|
||||
<span slot="title">{{ item.title }}</span>
|
||||
</template>
|
||||
<template v-for="subItem in item.subs">
|
||||
<el-submenu v-if="subItem.subs" :index="subItem.index" :key="subItem.index">
|
||||
<template slot="title">{{ subItem.title }}</template>
|
||||
<el-menu-item v-for="(threeItem,i) in subItem.subs" :key="i" :index="threeItem.index">{{ threeItem.title }}</el-menu-item>
|
||||
</el-submenu>
|
||||
<el-menu-item v-else :index="subItem.index" :key="subItem.index">{{ subItem.title }}</el-menu-item>
|
||||
</template>
|
||||
</el-submenu>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-menu-item :index="item.index" :key="item.index">
|
||||
<i :class="item.icon"></i>
|
||||
<span slot="title">{{ item.title }}</span>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
</template>
|
||||
</el-menu>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import bus from './bus';
|
||||
import {
|
||||
getMenus
|
||||
} from '../../api/index';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
collapse: false,
|
||||
items: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
onRoutes() {
|
||||
return this.$route.path
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 通过 Event Bus 进行组件间通信,来折叠侧边栏
|
||||
bus.$on('collapse', msg => {
|
||||
this.collapse = msg;
|
||||
// bus.$emit('setcanvasn',msg)
|
||||
bus.$emit('collapse-content', msg);
|
||||
});
|
||||
|
||||
// 获取菜单接口
|
||||
this.getMenus()
|
||||
},
|
||||
methods: {
|
||||
async getMenus() {
|
||||
const data = await getMenus({entity:{resourceSystem:'DataX'}});
|
||||
// console.log('菜单接口返回的数据',data);
|
||||
if (data.status === "0") {
|
||||
this.$message.error(data.msg);
|
||||
if (data.error === "01000103") {
|
||||
this.$router.push('/login')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.items = data.data;
|
||||
if(this.items.length == 0){
|
||||
this.$message.error('您没有导航权限,请联系管理员');
|
||||
}
|
||||
// console.log("items", this.items);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.sidebar {
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 70px;
|
||||
bottom: 0;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.sidebar::-webkit-scrollbar {
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.sidebar-el-menu:not(.el-menu--collapse) {
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
.sidebar>ul {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
186
h5-datax-manager/src/components/common/Tags.vue
Normal file
@@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<div class="tags" v-if="showTags">
|
||||
<ul>
|
||||
<li class="tags-li" v-for="(item,index) in tagsList" :class="{'active': isActive(item.path)}" :key="index">
|
||||
<router-link :to="item.path" class="tags-li-title">
|
||||
{{item.title}}
|
||||
</router-link>
|
||||
<span class="tags-li-icon" @click="closeTags(index)"><i class="el-icon-close"></i></span>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tags-close-box">
|
||||
<el-dropdown @command="handleTags">
|
||||
<el-button size="mini" type="primary">
|
||||
标签选项<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</el-button>
|
||||
<el-dropdown-menu size="small" slot="dropdown">
|
||||
<el-dropdown-item command="other">关闭其他</el-dropdown-item>
|
||||
<el-dropdown-item command="all">关闭所有</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import bus from './bus';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tagsList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isActive(path) {
|
||||
return path === this.$route.fullPath;
|
||||
},
|
||||
// 关闭单个标签
|
||||
closeTags(index) {
|
||||
const delItem = this.tagsList.splice(index, 1)[0];
|
||||
const item = this.tagsList[index] ? this.tagsList[index] : this.tagsList[index - 1];
|
||||
if (item) {
|
||||
delItem.path === this.$route.fullPath && this.$router.push(item.path);
|
||||
}else{
|
||||
this.$router.push('/');
|
||||
}
|
||||
},
|
||||
// 关闭全部标签
|
||||
closeAll(){
|
||||
this.tagsList = [];
|
||||
this.$router.push('/');
|
||||
},
|
||||
// 关闭其他标签
|
||||
closeOther(){
|
||||
const curItem = this.tagsList.filter(item => {
|
||||
return item.path === this.$route.fullPath;
|
||||
})
|
||||
this.tagsList = curItem;
|
||||
},
|
||||
// 设置标签
|
||||
setTags(route){
|
||||
const isExist = this.tagsList.some(item => {
|
||||
return item.path === route.fullPath;
|
||||
})
|
||||
if(!isExist){
|
||||
if(this.tagsList.length >= 8){
|
||||
this.tagsList.shift();
|
||||
}
|
||||
this.tagsList.push({
|
||||
title: route.meta.title,
|
||||
path: route.fullPath,
|
||||
name: route.matched[1].components.default.name
|
||||
})
|
||||
}
|
||||
bus.$emit('tags', this.tagsList);
|
||||
},
|
||||
handleTags(command){
|
||||
command === 'other' ? this.closeOther() : this.closeAll();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
showTags() {
|
||||
return this.tagsList.length > 0;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
$route(newValue, oldValue){
|
||||
this.setTags(newValue);
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.setTags(this.$route);
|
||||
// 监听关闭当前页面的标签页
|
||||
bus.$on('close_current_tags', () => {
|
||||
for (let i = 0, len = this.tagsList.length; i < len; i++) {
|
||||
const item = this.tagsList[i];
|
||||
if(item.path === this.$route.fullPath){
|
||||
if(i < len - 1){
|
||||
this.$router.push(this.tagsList[i+1].path);
|
||||
}else if(i > 0){
|
||||
this.$router.push(this.tagsList[i-1].path);
|
||||
}else{
|
||||
this.$router.push('/');
|
||||
}
|
||||
this.tagsList.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<style>
|
||||
.tags {
|
||||
position: relative;
|
||||
height: 30px;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
padding-right: 120px;
|
||||
box-shadow: 0 5px 10px #ddd;
|
||||
}
|
||||
|
||||
.tags ul {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.tags-li {
|
||||
float: left;
|
||||
margin: 3px 5px 2px 3px;
|
||||
border-radius: 3px;
|
||||
font-size: 12px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
height: 23px;
|
||||
line-height: 23px;
|
||||
border: 1px solid #e9eaec;
|
||||
background: #fff;
|
||||
padding: 0 5px 0 12px;
|
||||
vertical-align: middle;
|
||||
color: #666;
|
||||
-webkit-transition: all .3s ease-in;
|
||||
-moz-transition: all .3s ease-in;
|
||||
transition: all .3s ease-in;
|
||||
}
|
||||
|
||||
.tags-li:not(.active):hover {
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.tags-li.active {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.tags-li-title {
|
||||
float: left;
|
||||
max-width: 80px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
margin-right: 5px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.tags-li.active .tags-li-title {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.tags-close-box {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
box-sizing: border-box;
|
||||
padding-top: 1px;
|
||||
text-align: center;
|
||||
width: 110px;
|
||||
height: 30px;
|
||||
background: #fff;
|
||||
box-shadow: -3px 0 15px 3px rgba(0, 0, 0, .1);
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
</style>
|
||||
94
h5-datax-manager/src/components/common/bindParam.vue
Normal file
@@ -0,0 +1,94 @@
|
||||
<template>
|
||||
<div>
|
||||
<p style="margin-top: 20px;padding-top: 10px;display: flex;align-items: center;">
|
||||
变量:<i class="el-icon-circle-plus-outline" style="color:#409EFF;font-size: 24px;" @click="addVariable"></i>
|
||||
</p>
|
||||
|
||||
<div v-for="(value,index) in Variable" style="display: flex;align-items: center;margin-top: 10px;">
|
||||
<el-input v-model="value.key" style="width: 200px;" placeholder="键" :size="size"></el-input>
|
||||
<p style="margin:10px;">:</p>
|
||||
<el-input v-model="value.value" style="width: 200px;" placeholder="默认值" :size="size"></el-input>
|
||||
<i class="el-icon-circle-close" :style="{color:'#F56C6C',fontSize: '24px',marginLeft:'10px'}"
|
||||
@click="delectVariable(index)"></i>
|
||||
</div>
|
||||
|
||||
|
||||
<p style="margin-top: 20px;display: flex;align-items: center;">
|
||||
字典变量:<i class="el-icon-circle-plus-outline" style="color:#409EFF;font-size: 24px;"
|
||||
@click="addDictVariable"></i></p>
|
||||
|
||||
<div v-for="(value,index) in dictVariable" style="display: flex;align-items: center;margin-top: 10px;">
|
||||
<el-input v-model="value.key" style="width: 200px;" placeholder="键" :size="size"></el-input>
|
||||
<p style="margin:10px;">:</p>
|
||||
<el-select v-model="value.type" placeholder="请选择类型" :size="size">
|
||||
<el-option v-for="item in dictVariableType" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-input v-model="value.value" style="width: 200px;margin-left: 20px;" placeholder="格式" :size="size"></el-input>
|
||||
<i class="el-icon-circle-close" :style="{color:'#F56C6C',fontSize: '24px',marginLeft:'10px'}"
|
||||
@click="delectDictVariable(index)"></i>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
Variable: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
dictVariable: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
size:{
|
||||
type: String,
|
||||
default:''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dictVariableType: [{
|
||||
label: '时间',
|
||||
value: 'date'
|
||||
}]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addVariable() {
|
||||
this.Variable.push({
|
||||
value: '',
|
||||
key: ''
|
||||
})
|
||||
},
|
||||
delectVariable(index) {
|
||||
this.Variable.splice(index, 1)
|
||||
},
|
||||
addDictVariable() {
|
||||
this.dictVariable.push({
|
||||
key: '',
|
||||
type: '',
|
||||
value: ''
|
||||
})
|
||||
},
|
||||
delectDictVariable(index) {
|
||||
|
||||
this.dictVariable.splice(index, 1)
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
6
h5-datax-manager/src/components/common/bus.js
Normal file
@@ -0,0 +1,6 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
// 使用 Event Bus
|
||||
const bus = new Vue();
|
||||
|
||||
export default bus;
|
||||
55
h5-datax-manager/src/components/common/charts.vue
Normal file
@@ -0,0 +1,55 @@
|
||||
<template>
|
||||
<div :id="sid" :style="{height: height,width:width}">
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from 'echarts';
|
||||
export default {
|
||||
props: {
|
||||
sid: {
|
||||
type: String,
|
||||
default: 'echartsId'
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '300px'
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '300px'
|
||||
},
|
||||
option: {
|
||||
type: Object,
|
||||
default () {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chartDom: null,
|
||||
myChart: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.chartDom = document.getElementById(this.sid);
|
||||
this.myChart = echarts.init(this.chartDom);
|
||||
this.myChart.setOption(this.option);
|
||||
},
|
||||
watch: {
|
||||
option: {
|
||||
handler: function() {
|
||||
this.myChart.clear()
|
||||
this.myChart.setOption(this.option);
|
||||
},
|
||||
// 开启深度监听:只要obj中的任何一个属性发生改变,都会触发相应的代码
|
||||
deep: true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
102
h5-datax-manager/src/components/common/codemirror.vue
Normal file
@@ -0,0 +1,102 @@
|
||||
<template>
|
||||
|
||||
<textarea :ref="MYname" class="codesql" :value="value" style="height:200px;width:600px;" :key="keynum"></textarea>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import "codemirror/theme/ambiance.css";
|
||||
import "codemirror/theme/ayu-dark.css";
|
||||
import "codemirror/lib/codemirror.css";
|
||||
import "codemirror/addon/hint/show-hint.css";
|
||||
|
||||
let CodeMirror = require("codemirror/lib/codemirror");
|
||||
require("codemirror/addon/edit/matchbrackets");
|
||||
require("codemirror/addon/selection/active-line");
|
||||
require("codemirror/mode/javascript/javascript");
|
||||
require("codemirror/mode/sql/sql");
|
||||
require("codemirror/mode/lua/lua");
|
||||
require("codemirror/addon/hint/show-hint");
|
||||
require("codemirror/addon/hint/sql-hint");
|
||||
require("codemirror/addon/hint/javascript-hint");
|
||||
export default {
|
||||
name: "codeMirror",
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
default: '123'
|
||||
},
|
||||
mime: {
|
||||
type: String,
|
||||
default: 'text/javascript'
|
||||
},
|
||||
autocomplete: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
MYname: {
|
||||
type: String,
|
||||
default: 'mycode'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
keynum: 0,
|
||||
editor: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.keynum = 1
|
||||
this.keynum = 0
|
||||
// console.log(this.value)
|
||||
},
|
||||
watch:{
|
||||
mime() {
|
||||
|
||||
this.editor.setOption("mode", this.mime)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// let mime = 'text/x-sql'
|
||||
let mime = this.mime
|
||||
let theme = 'ayu-dark' //设置主题,不设置的会使用默认主题
|
||||
let extraKeys = this.autocomplete ? {
|
||||
'Ctrl': 'autocomplete'
|
||||
} : {}
|
||||
|
||||
this.editor = CodeMirror.fromTextArea(this.$refs[this.MYname], {
|
||||
mode: mime, //选择对应代码编辑器的语言,我这边选的是数据库,根据个人情况自行设置即可
|
||||
indentWithTabs: true,
|
||||
smartIndent: true,
|
||||
lineNumbers: true,
|
||||
matchBrackets: true,
|
||||
theme: theme,
|
||||
// autofocus: true,
|
||||
extraKeys: extraKeys, //自定义快捷键
|
||||
hintOptions: { //自定义提示选项
|
||||
tables: {
|
||||
users: ['name', 'score', 'birthDate'],
|
||||
countries: ['name', 'population', 'size']
|
||||
}
|
||||
}
|
||||
})
|
||||
this.editor.on('changes', (e,e2) => {
|
||||
|
||||
this.$emit('input', e.getValue())
|
||||
})
|
||||
|
||||
//
|
||||
},
|
||||
beforeUnmount() {
|
||||
// console.log(1)
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.codesql {
|
||||
font-size: 11pt;
|
||||
font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;
|
||||
}
|
||||
</style>
|
||||
351
h5-datax-manager/src/components/common/cont.vue
Normal file
@@ -0,0 +1,351 @@
|
||||
|
||||
|
||||
<template>
|
||||
<div class="cont_cont">
|
||||
|
||||
<div class="cont_left" v-loading="leftloading">
|
||||
<div class="cont_header">
|
||||
<p class="cont_header_title">{{title}}</p>
|
||||
<p class="cont_header_subtitle">{{title}}</p>
|
||||
</div>
|
||||
|
||||
<contNewFule v-model="tempNewF" :newf.sync="newf" @newFileSure="newFileSure" @newFile="newFile" ></contNewFule>
|
||||
<div class="cont_list">
|
||||
<fileHome :data="list" @curr="clickCurrid" :currid="currid" @RenameFun="RenameFun" @RenameClose="RenameClose"
|
||||
@updatafilelist="updatafilelist" @delectFun="delectFun">
|
||||
</fileHome>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cont_right" v-loading="contloading" @click="tempHintLeft=null;tempHintTop=null;">
|
||||
<div v-if="!listRedact">
|
||||
<div v-if="showRight===false" class="cont_right_hint">
|
||||
请先选择左侧文件夹
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="cont_right_top">
|
||||
<div>
|
||||
<el-button type="primary" @click="listRedact=true" :disabled="currid!=99999999?false:'disabled'">新增</el-button>
|
||||
<el-button type="danger" @click="using(-1)" :disabled="this.selection.length>0?false:'disabled'">删除</el-button>
|
||||
<el-button type="success" @click="using(1)" :disabled="this.selection.length>0?false:'disabled'">启用</el-button>
|
||||
<el-button type="warning" @click="using(0)" :disabled="this.selection.length>0?false:'disabled'">停用</el-button>
|
||||
<!-- <el-select v-model="tempMove" placeholder="移动到:" style="margin-left: 10px;" :disabled="this.selection.length>0?false:'disabled'" filterable @change="mixinMoveChange"> -->
|
||||
<el-select v-model="tempMove" placeholder="移动到:" style="margin-left: 10px;" :disabled="this.selection.length>0?false:'disabled'"
|
||||
filterable @change="moveChange">
|
||||
<el-option v-for="value in listunfold" :key="value.id" :label="value.name" :value="value.id" v-show="value.id!=99999999"></el-option>
|
||||
</el-select>
|
||||
<!-- 断点 准备移动 -->
|
||||
</div>
|
||||
<div v-if="getData.type==1">
|
||||
<el-button @click="upShow=true">批量导入</el-button>
|
||||
<el-button @click="down">模板下载</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cont_right_cont">
|
||||
<div v-if="data">
|
||||
<el-table border :data="data.data.klist" @select-all="selectAll" @select="select" style="width: 100%"
|
||||
:cell-style="{padding: '10px'}">
|
||||
<el-table-column type="selection" width="70">
|
||||
</el-table-column>
|
||||
<el-table-column v-for="item in getData.row" :key="item.id" :prop="item.row" :label="item.label" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="item.type==='Blooen'">
|
||||
{{scope.row[item.row]?"是":"否"}}
|
||||
</span>
|
||||
<span v-else-if="item.type==='State'">
|
||||
{{scope.row[item.row]=="1"?'启用':'未启用'}}
|
||||
</span>
|
||||
<span v-else-if="item.type==='type'">
|
||||
{{scope.row[item.row]=="1"?'数值型':(scope.row[item.row]=="2"?'字符型':(scope.row[item.row]=="3"?'枚举型':(scope.row[item.row]=="4"?'小数型':(scope.row[item.row]=="5"?'数组型':(scope.row[item.row]=="6"?'JSON型':'')))))}}
|
||||
</span>
|
||||
<span v-else-if="item.fn">
|
||||
{{item.fn(scope.row[item.row])}}
|
||||
</span>
|
||||
<span v-else-if="item.type==='Time'" style="white-space: nowrap;" class="contText">{{
|
||||
new Date(scope.row[item.row]).toLocaleDateString().replace(/\//g, "-") + " " + new Date(scope.row[item.row]).toTimeString().substr(0, 8)
|
||||
}}</span>
|
||||
<span class="contText" v-else>
|
||||
{{scope.row[item.row]}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" size="s">
|
||||
<template slot-scope="scope">
|
||||
<el-button icon="el-icon-setting" circle size="mini" @click="dialogShow(scope.row.id)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination style="float: right;margin-right: 40px;margin-top: 40px;" :current-page="currPage"
|
||||
@current-change="clickpage" background layout="prev, pager, next" :total="data.data.pager.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<template v-else>
|
||||
<dataManageRedact @close="listRedact=false;tempRedactId=0" @Ok="listRedact=false;tempRedactId=0;getlist();currPage=1"
|
||||
:updata="getData.updatafield" :id='tempRedactId' :fieldTypeId="currid" :setsave="getData.setsave" :getInfo="getData.getInfo"
|
||||
:ftype="getData.type"></dataManageRedact>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<el-dialog title="上传文件" :visible.sync="upShow" width="30%" :before-close="upShowClose">
|
||||
<div style="margin: 0 auto;display: flex;justify-content: center;">
|
||||
<el-upload class="upload-demo" ref="upload" action="doUpload" :limit="1" :file-list="fileList" :before-upload="beforeUpload"
|
||||
v-loading="Uploadloading">
|
||||
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
||||
<div slot="tip" class="el-upload__tip">只能上传excel文件,且不超过5MB</div>
|
||||
<div slot="tip" class="el-upload-list__item-name">{{fileName}}</div>
|
||||
</el-upload>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="upShow = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitUpload()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import contNewFule from '@/components/common/contNewFile.vue'
|
||||
import '@/assets/css/cont.css'
|
||||
import fileHome from '@/components/common/fileHome.vue'
|
||||
import dataManageRedact from '@/components/common/dataManageRedact.vue'
|
||||
import contmixin from '@/utils/contminxin/contmixin.js'
|
||||
import {
|
||||
updateFieldFolder
|
||||
} from '@/api/index.js'
|
||||
export default {
|
||||
mixins: [
|
||||
contmixin
|
||||
],
|
||||
components: {
|
||||
fileHome,
|
||||
dataManageRedact,
|
||||
updateFieldFolder,
|
||||
contNewFule
|
||||
},
|
||||
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
getData: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
|
||||
},
|
||||
watch: {
|
||||
list() {
|
||||
if (this.list.length > 0) {
|
||||
this.leftloading = false
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
Uploadloading: false,
|
||||
tempMove: '',
|
||||
leftloading: true,
|
||||
fileName: "",
|
||||
fileList: [],
|
||||
upShow: false,
|
||||
currPage: 1,
|
||||
currid: null,
|
||||
data: null,
|
||||
contloading: false,
|
||||
newf: false,
|
||||
tempNewF: "",
|
||||
tempHintTop: null,
|
||||
tempHintLeft: null,
|
||||
tempId: null,
|
||||
listRedact: false, //新增页面开启
|
||||
tempRedactId: 0,
|
||||
selection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getData.getTree({
|
||||
type: this.getData.type
|
||||
}).then(res => {
|
||||
this.list = this.listTreeDeep(res.data, 1)
|
||||
this.clickCurrid(99999999)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
moveChange(e) { //移动文件夹
|
||||
let arr = this.selection.map((value) => {
|
||||
return value.id
|
||||
})
|
||||
if (arr.length < 1) {
|
||||
this.$message.error('未选择任何文件');
|
||||
return
|
||||
}
|
||||
let params = {
|
||||
ids: arr,
|
||||
folderId: e
|
||||
}
|
||||
updateFieldFolder(params).then(res => {
|
||||
if (res.status == "1") {
|
||||
this.clickCurrid(this.currid)
|
||||
this.$message({
|
||||
message: '移动成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.selection = []
|
||||
}
|
||||
})
|
||||
this.tempMove = ""
|
||||
},
|
||||
|
||||
down() {
|
||||
window.open(window.origin + '/Riskmanage/v2/datamanage/field/downTemplate')
|
||||
},
|
||||
delectFun(id) {
|
||||
let name
|
||||
this.deepGetCurr(id, this.list, (value) => {
|
||||
name = value.name
|
||||
})
|
||||
let params = {
|
||||
status: -1,
|
||||
id: id,
|
||||
fieldType: name
|
||||
}
|
||||
this.getData.updatalist(params).then(res => {
|
||||
if (res.status === "1") {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
});
|
||||
|
||||
this.deepGetCurr(id, this.list, (value, item, index) => {
|
||||
item.splice(index, 1)
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
this.leftloading = false
|
||||
this.currid = 99999999
|
||||
this.getlist()
|
||||
|
||||
}).catch(() => {
|
||||
this.$message.error("请求失败了" + '-_-');
|
||||
this.leftloading = false
|
||||
})
|
||||
},
|
||||
updatafilelist(params) {
|
||||
this.leftloading = true
|
||||
let tempNum = null
|
||||
|
||||
this.deepGetCurr(params.id, this.list, (value) => {
|
||||
tempNum = value.parentId
|
||||
})
|
||||
params.parentId = tempNum == 99999999 ? 0 : tempNum
|
||||
tempNum = null
|
||||
let obj = {
|
||||
fieldType: params.name,
|
||||
id: params.id,
|
||||
parentId: params.parentId
|
||||
}
|
||||
this.getData.updatalist(obj).then(res => {
|
||||
if (res.status === "1") {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.deepGetCurr(params.id, this.list, (value) => {
|
||||
value.name = params.name
|
||||
value.Rename = false
|
||||
})
|
||||
this.leftloading = false
|
||||
} else {
|
||||
this.leftloading = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message.error("请求失败了" + '-_-');
|
||||
this.leftloading = false
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
getlist() {
|
||||
this.contloading = true
|
||||
this.listRedact = false
|
||||
let params = {
|
||||
"isCommon": 1,
|
||||
"fieldTypeId": String(this.currid),
|
||||
"pageNo": 1
|
||||
}
|
||||
this.getData.getlist(params).then(res => {
|
||||
this.data = res
|
||||
this.contloading = false
|
||||
})
|
||||
|
||||
},
|
||||
clickpage(e) {
|
||||
this.currPage = e
|
||||
this.contloading = true
|
||||
let params = {
|
||||
"isCommon": 1,
|
||||
"fieldTypeId": String(this.currid),
|
||||
"pageNo": e
|
||||
}
|
||||
this.getData.getlist(params).then(res => {
|
||||
if (res.status == "1") {
|
||||
this.data = res
|
||||
this.selection = []
|
||||
this.contloading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
using(id) {
|
||||
|
||||
let arr = this.selection.map((value) => {
|
||||
return value.id
|
||||
})
|
||||
if (arr.length < 1) {
|
||||
this.$message.error('未选择任何文件');
|
||||
return
|
||||
}
|
||||
let params = {
|
||||
status: id,
|
||||
ids: arr.join(','),
|
||||
fieldTypeId: this.currid
|
||||
}
|
||||
|
||||
this.getData.fieldusing(params).then(res => {
|
||||
if (res.status == "1") {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.getlist()
|
||||
this.$store.dispatch('reGetfielduser')
|
||||
}
|
||||
})
|
||||
},
|
||||
newFileSure() {
|
||||
this.leftloading = true
|
||||
let params = {
|
||||
parentId: this.currid,
|
||||
fieldType: this.tempNewF,
|
||||
type: this.getData.type
|
||||
}
|
||||
if(this.mixnewFileZindexVerify(this.list,this.currid)==6){
|
||||
this.$message.error('已达到最深层级')
|
||||
this.leftloading = false
|
||||
return
|
||||
}
|
||||
|
||||
this.mixnewFileSure(params)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
45
h5-datax-manager/src/components/common/contNewFile.vue
Normal file
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<div class="cont_new_file">
|
||||
<div v-if="!newf" @click="newFile"><i class="el-icon-folder-add" @click="newFile" style="margin-right: 10px;"></i>新建文件夹</div>
|
||||
<div v-else style="padding: 5px;box-sizing:border-box;">
|
||||
<div style="display: flex;align-items: center;">
|
||||
<i class="el-icon-folder-add" @click="newFile" style="margin-right: 10px;"></i>
|
||||
<el-input :value="value" @input="$emit('input',$event)" placeholder="请输入新文件夹名字,最长20个字符" size="small" @keyup.enter.native="newFileSure"></el-input>
|
||||
</div>
|
||||
<el-button style="margin-left: 60px;margin-top: 10px;" type="danger" icon="el-icon-close" circle size="mini"
|
||||
@click="newFileClose"></el-button>
|
||||
<el-button type="success" icon="el-icon-check" circle size="mini" @click="newFileSure"></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default{
|
||||
props:{
|
||||
newf:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
value:{
|
||||
type:String,
|
||||
default:''
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
newFile(){
|
||||
this.$emit('newFile')
|
||||
},
|
||||
newFileSure(){
|
||||
this.$emit('newFileSure')
|
||||
},
|
||||
newFileClose(){
|
||||
this.$emit('input','')
|
||||
this.$emit('update:newf',false)
|
||||
// newf=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
903
h5-datax-manager/src/components/common/dataManageRedact.vue
Normal file
@@ -0,0 +1,903 @@
|
||||
<style>
|
||||
.dataManageRedact {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.MR_checkbox {
|
||||
padding: 20px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.MR_scope {
|
||||
padding: 20px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.MR_scope>div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.MR_scope>div>p {
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
.MR_derive {
|
||||
|
||||
margin: 0 40px 0 30px;
|
||||
|
||||
}
|
||||
|
||||
.MR_rule_home {
|
||||
overflow: scroll;
|
||||
overflow-x: hidden;
|
||||
height: 350px;
|
||||
}
|
||||
|
||||
.MR_rule_home::-webkit-scrollbar {
|
||||
display: none;
|
||||
/* Chrome Safari */
|
||||
}
|
||||
|
||||
.MR_toolbar {
|
||||
background-color: #F0F0F0;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
user-select: none;
|
||||
|
||||
}
|
||||
|
||||
.MR_toolbar>p:hover {
|
||||
color: #fff;
|
||||
|
||||
}
|
||||
|
||||
.codemirrirPs {
|
||||
padding: 5px;
|
||||
margin: 30px 0;
|
||||
background-color: #999;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.codemirrirPs>span:nth-of-type(1) {
|
||||
font-size: 12px;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="dataManageRedact" v-loading="loading">
|
||||
<div :class="smallHeader?'MR_header MR_headerSmall':'MR_header'">
|
||||
<div>
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-arrow-left" circle @click="$emit('close')"></el-button>
|
||||
</div>
|
||||
<div>
|
||||
<span v-if="id===0">新增字段 :</span>
|
||||
<span v-else>编辑字段 :</span>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
<el-button :icon="smallHeader?'el-icon-bottom':'el-icon-top'" circle @click="openHeader">
|
||||
</el-button>
|
||||
<el-button type="success" icon="el-icon-check" circle @click="submit"></el-button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div :class="smallHeader?'MR_input MR_inputSmall':'MR_input'">
|
||||
<div>
|
||||
<p>字段名称: </p>
|
||||
<el-input placeholder="请输入字段名" maxlength="30" v-model="fieldEn" clearable></el-input>
|
||||
</div>
|
||||
<div>
|
||||
<p>字段中文名: </p>
|
||||
<el-input placeholder="请输入字段中文名" maxlength="20" v-model="fieldCn" clearable></el-input>
|
||||
</div>
|
||||
<div>
|
||||
<p>值类型 : </p>
|
||||
<el-select v-model="valueType" placeholder="请选择">
|
||||
<el-option label="数值型" :value="1" v-if="ftype!=5" />
|
||||
<el-option label="字符型" :value="2" v-if="ftype!=5" />
|
||||
<!-- <el-option label="枚举型" :value="3" /> -->
|
||||
<!-- <el-option label="小数型" :value="4" /> -->
|
||||
<!-- <el-option label="数组型" :value="5" /> -->
|
||||
<el-option label="JSON型" :value="6" />
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div style="flex: 1;overflow: auto;">
|
||||
|
||||
<div v-show="isDerivative=='Derivative'" class="MR_derive">
|
||||
|
||||
<el-tabs v-model="activeName">
|
||||
<!-- <el-tab-pane label="条件区域" name="first">
|
||||
<div class="MR_rule_home">
|
||||
<rule :Data="ruledata" @faadd="faadd" @fadelect="fadelect" @sonadd="sonadd"
|
||||
@sondelect="sondelect" @change="change"></rule>
|
||||
</div>
|
||||
</el-tab-pane> -->
|
||||
<el-tab-pane label="公式编辑" name="second">
|
||||
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="groovy脚本" name="third">
|
||||
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div v-show="activeName!=='first'">
|
||||
<teV2 v-model="formula" :hint="activeName=='second'">
|
||||
|
||||
</teV2>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div v-if="Sourcelist">
|
||||
<div v-if="isDerivative=='SQL'" class="MR_derive">
|
||||
|
||||
<el-select v-model="SQLType" placeholder="请选择数据源类型" style="margin-top: 20px;width: 200px;"
|
||||
@change="SQLName = ''">
|
||||
<el-option v-for="item in SourcelistType" :key="item.type" :label="item.type"
|
||||
:value="item.type">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<el-select v-model="SQLName" placeholder="请选择数据源" style="margin-top: 20px;margin-left: 20px;">
|
||||
<el-option v-for="item in Sourcelist" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<br />
|
||||
|
||||
|
||||
<bindParam :Variable="sqlVariable" :dictVariable="dictVariable"></bindParam>
|
||||
|
||||
<div class="codemirrirPs">
|
||||
<span>
|
||||
{{sqlplaceholder[SQLType]&&sqlplaceholder[SQLType].placeholder}} 按Ctrl唤醒提示
|
||||
|
||||
|
||||
</span>
|
||||
<codemirror v-model="SQLItem" :MYname="sqlplaceholder[SQLType]&&sqlplaceholder[SQLType].mime"
|
||||
:mime="sqlplaceholder[SQLType]&&sqlplaceholder[SQLType].mime"></codemirror>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="ftype==4">
|
||||
<el-select v-model="interfaceId" placeholder="请选择接口" style="margin-top: 20px;margin-left: 20px;">
|
||||
<el-option v-for="item in interfaceList" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-cascader style="margin-left: 20px;" placeholder="请选择接口下的字段" v-model="interfaceParseField"
|
||||
:key="keynum" :options="dataJson" :props="{ checkStrictly: true }" clearable></el-cascader>
|
||||
</div>
|
||||
<div v-if="valueType==6" class="MR_derive">
|
||||
<p style="margin-top: 20px;">JSON:</p>
|
||||
<!-- <el-input type="textarea" v-model="jsonValue" :rows="9" style="margin-top: 20px;"
|
||||
placeholder="请输入格式JSON">
|
||||
</el-input> -->
|
||||
<div class="codemirrirPs">
|
||||
<span>
|
||||
请输入 JSON 按住Ctrl键再按删除可以删掉固定语法
|
||||
</span>
|
||||
<codemirror v-model="jsonValue" MYname="json" mime="text/javascript" :autocomplete="false">
|
||||
</codemirror>
|
||||
<!-- <p style="background-color: #fff;padding: 5px;border-radius: 3px;"> -->
|
||||
<!-- <el-checkbox v-model="isStaticJsonValue" style="color: #fff;"></el-checkbox><span style="color: #fff;font-size: 12px;margin-left: 10px;">静态</span> -->
|
||||
<!-- </p> -->
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="ftype==6">
|
||||
<div v-if="codeKey" class="MR_derive">
|
||||
|
||||
<el-select v-model="MqType" placeholder="请选择类型" style="margin-top: 20px;width: 200px;"
|
||||
@change="MqId = ''">
|
||||
<el-option v-for="item in MqlistType" :key="item.type" :label="item.type"
|
||||
:value="item.type">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<el-select v-model="MqId" placeholder="请选择消息队列源" style="margin-top: 20px;margin-left: 20px;">
|
||||
<el-option v-for="item in Mqlist" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<br />
|
||||
|
||||
|
||||
|
||||
<!-- <bindParam :Variable="sqlVariable" :dictVariable="dictVariable"></bindParam> -->
|
||||
|
||||
<div class="codemirrirPs">
|
||||
<span>
|
||||
sql 按Ctrl唤醒提示
|
||||
|
||||
</span>
|
||||
<codemirror v-model="SQLItem" :MYname="'text/x-sql2'" :mime="'text/x-sql'"></codemirror>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import codemirror from '@/components/common/codemirror.vue'
|
||||
// import fieldUserTable from './fieldUserTable.vue'
|
||||
import bindParam from '@/components/common/bindParam.vue'
|
||||
import '@/assets/css/ManageRedact.css'
|
||||
import teV2 from '@/components/common/teV2.vue'
|
||||
import mangeRedactMixin from '@/utils/contminxin/MangeRedactMixin.js'
|
||||
// import {
|
||||
// getInterfaceList
|
||||
// } from '@/api/index.js'
|
||||
import rule from './rule.vue'
|
||||
export default {
|
||||
mixins: [mangeRedactMixin],
|
||||
components: {
|
||||
// getInterfaceList,
|
||||
// fieldUserTable,
|
||||
rule,
|
||||
teV2,
|
||||
bindParam,
|
||||
codemirror
|
||||
},
|
||||
props: {
|
||||
fieldTypeId: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
setsave: {
|
||||
type: Function,
|
||||
default: () => {}
|
||||
},
|
||||
id: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
getInfo: {
|
||||
type: Function,
|
||||
default: () => {}
|
||||
},
|
||||
updata: {
|
||||
type: Function,
|
||||
default: () => {}
|
||||
},
|
||||
ftype: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
codeKey:0, //方便code输入框重新渲染
|
||||
sqlVariable: [],
|
||||
interfaceParseField: [],
|
||||
keynum: 1,
|
||||
interfaceId: '',
|
||||
jsonValue: '',
|
||||
loading: false,
|
||||
SQLItem: '',
|
||||
SQLName: '',
|
||||
tempFormula: '',
|
||||
formula: '',
|
||||
fieldEn: '',
|
||||
fieldCn: '',
|
||||
valueType: '',
|
||||
SQLType: '',
|
||||
MqType: '',
|
||||
MqId: '',
|
||||
isDerivative: "",
|
||||
isOutput: false,
|
||||
activeName: 'second',
|
||||
isrecord: false, //开始记录
|
||||
text: '', //剪出的字符串
|
||||
tempIndex: null, //暂存index
|
||||
lest: "", //暂存末尾
|
||||
isshow: false,
|
||||
islest: true,
|
||||
isStaticJsonValue: 0, //json是否为静态的 0为否
|
||||
// interfaceList: [],
|
||||
ruledata: [{
|
||||
"fieldSubCond": [{
|
||||
"fieldId": '',
|
||||
"operator": "",
|
||||
"fieldValue": "",
|
||||
"logical": ""
|
||||
}],
|
||||
"conditionValue": "",
|
||||
"fieldValue": ""
|
||||
}],
|
||||
dictVariable: [],
|
||||
sqlplaceholder: {
|
||||
MySQL: {
|
||||
placeholder: '请输入sql语句',
|
||||
mime: 'text/x-sql'
|
||||
},
|
||||
Redis: {
|
||||
placeholder: '请输入lua脚本',
|
||||
mime: 'text/x-lua'
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
|
||||
this.$store.dispatch('getfielduser')
|
||||
if (this.id != 0) {
|
||||
this.loading = true
|
||||
this.getInfo(this.id, {}).then(res => {
|
||||
this.loading = false
|
||||
|
||||
if (res.status === "1") {
|
||||
this.jsonValue = JSON.stringify(JSON.parse(res.data.fieldVo.jsonValue), null, 4)
|
||||
|
||||
this.fieldCn = res.data.fieldVo.fieldCn
|
||||
// this.isStaticJsonValue = res.data.fieldVo.isStaticJsonValue
|
||||
|
||||
|
||||
|
||||
this.fieldEn = res.data.fieldVo.fieldEn
|
||||
this.valueType = res.data.fieldVo.valueType
|
||||
this.interfaceId = res.data.fieldVo.interfaceId
|
||||
this.interfaceParseField = res.data.fieldVo.interfaceParseField ? res.data.fieldVo
|
||||
.interfaceParseField.split('.') : ''
|
||||
this.fid = res.data.fieldVo.fieldTypeId
|
||||
this.isOutput = res.data.fieldVo.isOutput == 1 ? true : false
|
||||
|
||||
if (res.data.fieldVo.isDerivative) {
|
||||
this.isDerivative = 'Derivative'
|
||||
} else if (res.data.fieldVo.useSql) {
|
||||
this.isDerivative = 'SQL'
|
||||
this.SQLType = this.$store.state.Sourcelist.find(x => x.id == res.data.fieldVo
|
||||
.dataSourceId).type
|
||||
|
||||
this.SQLName = res.data.fieldVo.dataSourceId
|
||||
this.SQLItem = res.data.fieldVo.sqlStatement
|
||||
}
|
||||
if (res.data.hasFormula == "y" || res.data.hasGroovy == "y") {
|
||||
this.formula = JSON.parse(res.data.fieldVo.formula)[0].formula
|
||||
if (res.data.hasFormula == "y") {
|
||||
this.activeName = "second"
|
||||
}
|
||||
if (res.data.hasGroovy == "y") {
|
||||
this.activeName = "third"
|
||||
}
|
||||
} else if (res.data.fieldVo.fieldCondList.length > 0) {
|
||||
|
||||
this.ruledata = res.data.fieldVo.fieldCondList
|
||||
}
|
||||
if (this.ftype == 2) {
|
||||
if (res.data.fieldVo.sqlVariable == null) {
|
||||
this.sqlVariable = []
|
||||
} else {
|
||||
this.sqlVariable = JSON.parse(res.data.fieldVo.sqlVariable)
|
||||
}
|
||||
if (res.data.fieldVo.dictVariable == null) {
|
||||
this.dictVariable = []
|
||||
} else {
|
||||
this.dictVariable = JSON.parse(res.data.fieldVo.dictVariable)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
if(this.ftype ==6){
|
||||
this.MqType = this.$store.state.Mqlist.find(x => x.id == res.data.fieldVo
|
||||
.mqSourceId).type
|
||||
this.MqId = res.data.fieldVo.mqSourceId
|
||||
this.SQLItem = res.data.fieldVo.sqlStatement
|
||||
console.log(res.data.fieldVo.sqlStatement,this.SQLItem)
|
||||
}
|
||||
// console.log(res.data.fieldVo.fieldCondList)
|
||||
}
|
||||
if (this.ftype == 2) {
|
||||
this.isDerivative = 'SQL'
|
||||
console.log(1)
|
||||
} else if (this.ftype == 3) {
|
||||
this.isDerivative = 'Derivative'
|
||||
}
|
||||
this.codeKey = 1
|
||||
|
||||
})
|
||||
} else {
|
||||
if (this.ftype == 2) {
|
||||
this.isDerivative = 'SQL'
|
||||
} else if (this.ftype == 3) {
|
||||
this.isDerivative = 'Derivative'
|
||||
}
|
||||
this.codeKey = 1
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
computed: {
|
||||
interfaceList() {
|
||||
return this.$store.state.Interface
|
||||
},
|
||||
dataJson() {
|
||||
if (this.ftype != 4) {
|
||||
return {}
|
||||
}
|
||||
let obj = {}
|
||||
this.interfaceList.forEach(value => {
|
||||
if (value.id == this.interfaceId) {
|
||||
obj = JSON.parse(value.responseBody)
|
||||
}
|
||||
})
|
||||
|
||||
obj = this.deepGetLayout(obj)
|
||||
console.log(obj)
|
||||
return obj
|
||||
},
|
||||
FieldUser() {
|
||||
return this.$store.state.FieldUser
|
||||
},
|
||||
SourcelistType() {
|
||||
let arr = []
|
||||
if (this.$store.state.Sourcelist) {
|
||||
this.$store.state.Sourcelist.forEach(value => {
|
||||
let sarr = arr.find(x => x.type == value.type)
|
||||
if (sarr) {
|
||||
sarr.data.push(value)
|
||||
} else {
|
||||
arr.push({
|
||||
type: value.type,
|
||||
data: [value]
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
console.log(arr)
|
||||
return arr
|
||||
},
|
||||
Sourcelist() {
|
||||
let arr = this.SourcelistType.find(x => x.type == this.SQLType)
|
||||
if (arr) {
|
||||
return arr.data
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
|
||||
},
|
||||
MqlistType() {
|
||||
let arr = []
|
||||
if (this.$store.state.Mqlist) {
|
||||
this.$store.state.Mqlist.forEach(value => {
|
||||
let sarr = arr.find(x => x.type == value.type)
|
||||
if (sarr) {
|
||||
sarr.data.push(value)
|
||||
} else {
|
||||
arr.push({
|
||||
type: value.type,
|
||||
data: [value]
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
console.log(arr)
|
||||
return arr
|
||||
},
|
||||
Mqlist() {
|
||||
let arr = this.MqlistType.find(x => x.type == this.MqType)
|
||||
if (arr) {
|
||||
return arr.data
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// this.$refs.textarea.$refs.textarea.onkeydown = (e) => {
|
||||
// if (e.key === 'Backspace') {
|
||||
// this.text = ""
|
||||
// }
|
||||
// }
|
||||
},
|
||||
methods: {
|
||||
|
||||
deepGetLayout(obj) {
|
||||
let sobj = []
|
||||
for (let key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
if (typeof obj[key] == 'object' && !Array.isArray(obj[key]) && obj[key] != null) {
|
||||
sobj.push({
|
||||
label: key,
|
||||
value: key,
|
||||
children: this.deepGetLayout(obj[key])
|
||||
})
|
||||
|
||||
} else if (typeof obj[key] == 'object' && Array.isArray(obj[key]) && obj[key] != null) {
|
||||
sobj.push({
|
||||
label: key,
|
||||
value: key,
|
||||
children: [{
|
||||
label: '元素',
|
||||
value: '[]',
|
||||
children: this.deepGetLayout(obj[key][0])
|
||||
}]
|
||||
})
|
||||
} else {
|
||||
sobj.push({
|
||||
label: key,
|
||||
value: key,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
return sobj
|
||||
},
|
||||
submit() {
|
||||
let reg = /[\u4e00-\u9fa5]+/g;
|
||||
if (this.fieldEn.match(reg) != null) {
|
||||
this.$message.error('代码不允许出现中文');
|
||||
return
|
||||
}
|
||||
if (this.verificationCode(this.fieldEn) || this.verificationName(this.fieldCn)) {
|
||||
return
|
||||
}
|
||||
if (this.fieldEn.trim() == '' || this.fieldCn.trim() == '' || this.valueType == '') {
|
||||
this.$message.error('请填入所有字段,并检查空格');
|
||||
return
|
||||
}
|
||||
if (this.isDerivative == 'SQL' && (!this.SQLName || !this.SQLType)) {
|
||||
this.$message.error('请选择数据源');
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (this.ftype == 4 && (!this.interfaceId || this.interfaceParseField.length == 0)) {
|
||||
this.$message.error('请选择接口');
|
||||
return
|
||||
}
|
||||
if (this.ftype == 6 && (!this.MqType || !this.MqId)) {
|
||||
this.$message.error('请选择队列');
|
||||
return
|
||||
}
|
||||
|
||||
let is = {
|
||||
is: true,
|
||||
msg: '请填入页面中未填的部分'
|
||||
}
|
||||
if (this.isDerivative == "Derivative" && this.activeName == 'first') {
|
||||
this.ruledata.forEach(value => {
|
||||
if (value.conditionValue.length < 1) {
|
||||
is.is = false
|
||||
}
|
||||
value.fieldSubCond.forEach((item, inde) => {
|
||||
if (item.fieldId == "" || item.operator == "" || item.fieldValue.length < 1) {
|
||||
is.is = false
|
||||
}
|
||||
if (item.logical == "" && inde !== value.fieldSubCond.length - 1) {
|
||||
is.is = false
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
if (this.ftype == 2) {
|
||||
this.sqlVariable.forEach(value => {
|
||||
if (value.value.trim() === "" || value.key.trim() === "") {
|
||||
is.is = false
|
||||
}
|
||||
})
|
||||
|
||||
this.dictVariable.forEach(value => {
|
||||
if (value.key.trim() === "" || value.type === "" || value.value.trim() === "") {
|
||||
is.is = false
|
||||
}
|
||||
})
|
||||
|
||||
let arr = []
|
||||
arr.push(...this.sqlVariable.map(value => value.key))
|
||||
arr.push(...this.dictVariable.map(value => value.key))
|
||||
|
||||
if (arr.length != Array.from(new Set(arr)).length) {
|
||||
is.is = false
|
||||
is.msg = '不允许出现重复的变量'
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (this.ftype == 4 && !this.interfaceId) {
|
||||
is.is = false
|
||||
}
|
||||
if (is.is === false) {
|
||||
this.$message.error(is.msg);
|
||||
return
|
||||
}
|
||||
|
||||
if (this.valueType == 6 && !this.isJSON(this.jsonValue)) {
|
||||
this.$message.error('请检查JSON格式');
|
||||
return
|
||||
}
|
||||
|
||||
let obj = {
|
||||
searchKey: '',
|
||||
fieldEn: this.fieldEn,
|
||||
fieldCn: this.fieldCn,
|
||||
valueType: this.valueType, //字段值类型
|
||||
isDerivative: this.isDerivative == "Derivative" ? 1 : 0, //是否衍生字段
|
||||
isOutput: this.isOutput ? 1 : 0, //是否输出字段
|
||||
// valueScope: this.valueScope, //字段约束范围
|
||||
fieldCondList: '',
|
||||
isStaticJsonValue: this.valueType == 6 ? this.isStaticJsonValue : 0,
|
||||
formulaHidden: '',
|
||||
isUseSql: this.isDerivative == "SQL" ? true : false, //是否使用sql
|
||||
dataSourceId: 0,
|
||||
sqlStatement: '', //sql语句
|
||||
sourceType: this.ftype,
|
||||
|
||||
}
|
||||
if (this.valueType == 6) {
|
||||
obj.jsonValue = this.jsonValue
|
||||
}
|
||||
if (this.ftype == 2) {
|
||||
if (this.sqlVariable.length == 0) {
|
||||
obj.sqlVariable = null
|
||||
} else {
|
||||
obj.sqlVariable = JSON.stringify(this.sqlVariable)
|
||||
}
|
||||
obj.dictVariable = JSON.stringify(this.dictVariable)
|
||||
}
|
||||
if (this.ftype == 4) {
|
||||
obj.isInterface = 1
|
||||
obj.interfaceId = this.interfaceId
|
||||
obj.interfaceParseField = this.interfaceParseField.join('.')
|
||||
} else {
|
||||
obj.isInterface = 0
|
||||
}
|
||||
// console.log(this.isDerivative)
|
||||
if (this.isDerivative == "Derivative") {
|
||||
if (this.activeName == "first") {
|
||||
obj.fieldCondList = JSON.stringify(this.ruledata)
|
||||
} else if (this.activeName == "second" || this.activeName == "third") {
|
||||
let tempArr = []
|
||||
let num = 0
|
||||
for (let i of this.formula) {
|
||||
if (i === "@") {
|
||||
num++
|
||||
}
|
||||
}
|
||||
if (num % 2 === 0 && num != 0) {
|
||||
this.formula.match(/@.*?@/g).forEach(value => {
|
||||
let tempObj = {
|
||||
fieldCN: value.substring(1, value.length - 1),
|
||||
fieldCond: ''
|
||||
}
|
||||
tempArr.push(tempObj)
|
||||
})
|
||||
}
|
||||
obj.formulaHidden = JSON.stringify([{
|
||||
fvalue: '',
|
||||
formula: this.formula.trim(),
|
||||
idx: '0',
|
||||
farr: tempArr,
|
||||
}])
|
||||
}
|
||||
|
||||
} else if (this.isDerivative == "SQL") {
|
||||
obj.dataSourceId = this.SQLName
|
||||
obj.sqlStatement = this.SQLItem
|
||||
|
||||
}
|
||||
if(this.ftype == 6){
|
||||
obj.mqSourceId = this.MqId
|
||||
obj.sqlStatement = this.SQLItem
|
||||
}
|
||||
|
||||
let isT = true;
|
||||
if (this.isDerivative == "SQL") {
|
||||
let sqlCheck = obj.sqlStatement.match(/(create|update|delete|truncate|alert|drop)\s+/im);
|
||||
if (sqlCheck != null) {
|
||||
isT = false;
|
||||
this.$message.error('存在有风险sql关键词:' + sqlCheck[0].toUpperCase());
|
||||
}
|
||||
}
|
||||
if (isT) {
|
||||
if (this.id == 0) {
|
||||
obj.fieldTypeId = this.fieldTypeId == 99999999 ? 0 : this.fieldTypeId,
|
||||
this.loading = true
|
||||
this.setsave(obj).then(res => {
|
||||
this.loading = false
|
||||
if (res.status === "1") {
|
||||
this.$message({
|
||||
message: '添加成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.$emit('Ok')
|
||||
// this.$store.dispatch('reGetisOutput')
|
||||
this.$store.dispatch('reGetfielduser')
|
||||
}
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
this.$message.error('网络出现问题-_-');
|
||||
})
|
||||
} else {
|
||||
obj.id = this.id
|
||||
obj.fieldTypeId = this.fid
|
||||
this.loading = true
|
||||
this.updata(obj).then(res => {
|
||||
this.loading = false
|
||||
if (res.status === "1") {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.$emit('Ok')
|
||||
|
||||
// this.$store.dispatch('reGetisOutput')
|
||||
this.$store.dispatch('reGetfielduser')
|
||||
|
||||
}
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
this.$message.error('网络出现问题-_-');
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
isJSON(str) {
|
||||
if (typeof str == 'string') {
|
||||
try {
|
||||
var obj = JSON.parse(str);
|
||||
if (typeof obj == 'object' && obj) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.log('error:' + str + '!!!' + e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
change(index, inde) {
|
||||
this.ruledata[index].fieldSubCond[inde].operator = ""
|
||||
this.ruledata[index].fieldSubCond[inde].fieldValue = ""
|
||||
},
|
||||
sondelect(index, inde) {
|
||||
this.ruledata[index].fieldSubCond.splice(inde, 1)
|
||||
},
|
||||
sonadd(index, inde) {
|
||||
this.ruledata[index].fieldSubCond.splice(inde + 1, 0, {
|
||||
"fieldId": "",
|
||||
"operator": "",
|
||||
"fieldValue": "",
|
||||
"logical": ""
|
||||
})
|
||||
},
|
||||
faadd(index) { //rule父节点添加
|
||||
this.ruledata.splice(index + 1, 0, {
|
||||
"conditionValue": "",
|
||||
"fieldSubCond": [{
|
||||
"fieldId": "",
|
||||
"operator": "",
|
||||
"fieldValue": "",
|
||||
"logical": "",
|
||||
|
||||
|
||||
|
||||
}]
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
fadelect(index) {
|
||||
this.ruledata.splice(index, 1)
|
||||
},
|
||||
textareaAdd(text) {
|
||||
if (text === "fx") {
|
||||
this.formula = "def main(_){\n\n}"
|
||||
} else {
|
||||
this.formula += text
|
||||
}
|
||||
},
|
||||
dbclick(e) {
|
||||
let T = ""
|
||||
T = this.formula.split("")
|
||||
|
||||
T.splice(this.tempIndex, this.text.length + 1, '@' + e + '@')
|
||||
this.formula = T.join("")
|
||||
this.isshow = false
|
||||
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
jsonValue() {
|
||||
// console.log(this.jsonValue)
|
||||
},
|
||||
SQLItem() {
|
||||
// console.log(this.SQLItem)
|
||||
},
|
||||
interfaceId() {
|
||||
this.keynum++
|
||||
},
|
||||
formula() {
|
||||
let num = 0
|
||||
for (let i of this.formula) {
|
||||
if (i === "@") {
|
||||
num++
|
||||
}
|
||||
}
|
||||
if (num % 2 === 1) {
|
||||
this.isshow = true
|
||||
for (let i in this.formula) {
|
||||
if (this.formula[i] !== this.tempFormula[i] && this.formula[i] == "@") {
|
||||
|
||||
if (this.islest) {
|
||||
this.tempIndex = i
|
||||
|
||||
this.lest = this.formula.substring(parseInt(this.tempIndex) + 1, this.formula.length)
|
||||
this.islest = false
|
||||
}
|
||||
// console.log('字段:' + this.formula[i] + "暂存字段:" + this.tempFormula[i])
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
let T = this.formula.substring(parseInt(this.tempIndex) + 1, this.formula.length)
|
||||
if (this.lest !== "") {
|
||||
// console.log(T)
|
||||
T = T.substring(0, T.indexOf(this.lest))
|
||||
|
||||
} else {
|
||||
T = T.substring(0, T.length)
|
||||
}
|
||||
|
||||
this.text = T
|
||||
|
||||
// console.log('lest:' + this.lest, 'index:' + this.tempIndex, "T:" + T)
|
||||
|
||||
} else {
|
||||
this.islest = true
|
||||
this.text = ""
|
||||
this.tempIndex = null
|
||||
this.isshow = false
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
this.tempFormula = this.formula
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
80
h5-datax-manager/src/components/common/directives.js
Normal file
@@ -0,0 +1,80 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
// v-dialogDrag: 弹窗拖拽属性
|
||||
Vue.directive('dialogDrag', {
|
||||
bind(el, binding, vnode, oldVnode) {
|
||||
const dialogHeaderEl = el.querySelector('.el-dialog__header');
|
||||
const dragDom = el.querySelector('.el-dialog');
|
||||
|
||||
dialogHeaderEl.style.cssText += ';cursor:move;'
|
||||
dragDom.style.cssText += ';top:0px;'
|
||||
|
||||
// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
|
||||
const sty = (() => {
|
||||
if (window.document.currentStyle) {
|
||||
return (dom, attr) => dom.currentStyle[attr];
|
||||
} else {
|
||||
return (dom, attr) => getComputedStyle(dom, false)[attr];
|
||||
}
|
||||
})()
|
||||
|
||||
dialogHeaderEl.onmousedown = (e) => {
|
||||
// 鼠标按下,计算当前元素距离可视区的距离
|
||||
const disX = e.clientX - dialogHeaderEl.offsetLeft;
|
||||
const disY = e.clientY - dialogHeaderEl.offsetTop;
|
||||
|
||||
const screenWidth = document.body.clientWidth; // body当前宽度
|
||||
const screenHeight = document.documentElement.clientHeight; // 可见区域高度(应为body高度,可某些环境下无法获取)
|
||||
|
||||
const dragDomWidth = dragDom.offsetWidth; // 对话框宽度
|
||||
const dragDomheight = dragDom.offsetHeight; // 对话框高度
|
||||
|
||||
const minDragDomLeft = dragDom.offsetLeft;
|
||||
const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth;
|
||||
|
||||
const minDragDomTop = dragDom.offsetTop;
|
||||
const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomheight;
|
||||
|
||||
|
||||
// 获取到的值带px 正则匹配替换
|
||||
let styL = sty(dragDom, 'left');
|
||||
let styT = sty(dragDom, 'top');
|
||||
|
||||
// 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
|
||||
if (styL.includes('%')) {
|
||||
styL = +document.body.clientWidth * (+styL.replace(/\%/g, '') / 100);
|
||||
styT = +document.body.clientHeight * (+styT.replace(/\%/g, '') / 100);
|
||||
} else {
|
||||
styL = +styL.replace(/\px/g, '');
|
||||
styT = +styT.replace(/\px/g, '');
|
||||
};
|
||||
|
||||
document.onmousemove = function (e) {
|
||||
// 通过事件委托,计算移动的距离
|
||||
let left = e.clientX - disX;
|
||||
let top = e.clientY - disY;
|
||||
|
||||
// 边界处理
|
||||
if (-(left) > minDragDomLeft) {
|
||||
left = -(minDragDomLeft);
|
||||
} else if (left > maxDragDomLeft) {
|
||||
left = maxDragDomLeft;
|
||||
}
|
||||
|
||||
if (-(top) > minDragDomTop) {
|
||||
top = -(minDragDomTop);
|
||||
} else if (top > maxDragDomTop) {
|
||||
top = maxDragDomTop;
|
||||
}
|
||||
|
||||
// 移动当前元素
|
||||
dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`;
|
||||
};
|
||||
|
||||
document.onmouseup = function (e) {
|
||||
document.onmousemove = null;
|
||||
document.onmouseup = null;
|
||||
};
|
||||
}
|
||||
}
|
||||
})
|
||||
208
h5-datax-manager/src/components/common/fieldUserTable.vue
Normal file
@@ -0,0 +1,208 @@
|
||||
<style>
|
||||
.fieldUserTable {
|
||||
background-color: #fff;
|
||||
position: fixed;
|
||||
width: 400px;
|
||||
height: 400px;
|
||||
overflow: hidden;
|
||||
z-index: 9;
|
||||
border: 6px solid #9bcdff;
|
||||
border-radius: 5px;
|
||||
box-sizing: border-box;
|
||||
|
||||
}
|
||||
.FUT_header {
|
||||
background-color: #3584d3;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 3px;
|
||||
box-sizing: border-box;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
height: 30px;
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
.FUT_table::-webkit-scrollbar {
|
||||
display: none;
|
||||
/* Chrome Safari */
|
||||
}
|
||||
.FUT_table{
|
||||
height: 93%;
|
||||
overflow: scroll;
|
||||
overflow-x: hidden;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
user-select: none;
|
||||
margin-top: 30px;
|
||||
|
||||
}
|
||||
.FUT_table>p {
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.FUT_table>p:hover {
|
||||
color: #fff;
|
||||
background-color: #9bcdff;
|
||||
}
|
||||
#fieldUserTabletempcurr{
|
||||
background-color: #d9ebff;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div v-show="show" class="fieldUserTable" @mousedown="mousedowm" ref="UserTable" :style="{top:this.tempTop+'px',left:this.tempLeft+'px'}">
|
||||
<div class="FUT_header" >
|
||||
<p>字段列表</p>
|
||||
<p><i class="el-icon-close" @click="$emit('close')"></i></p>
|
||||
</div>
|
||||
<div class="FUT_table" v-show="fieldUserRemind.length>0" id="FUT_table">
|
||||
<p v-for="(item,index) in fieldUserRemind" @dblclick="dbc(item.fieldCn)" :id="index==tempCurIndex?'fieldUserTabletempcurr':''">{{item.fieldCn?item.fieldCn:item.fieldEn}}</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
text: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
fieldUser: {
|
||||
type: Array||Boolean,
|
||||
default: false
|
||||
},
|
||||
show:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tempCurIndex:0,
|
||||
tempTop:300,
|
||||
tempLeft:800,
|
||||
drag:false,
|
||||
tempClientX:0,
|
||||
tempClientY:0,
|
||||
tempOffsetLeft:0,
|
||||
tempOffsetTop:0,
|
||||
temptext:"",
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
beforeUnmount() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
window.onmousemove=(e)=>{
|
||||
if(this.drag){
|
||||
this.tempTop=e.clientY-(this.tempClientY-this.tempOffsetTop)
|
||||
this.tempLeft=e.clientX-(this.tempClientX-this.tempOffsetLeft)
|
||||
}
|
||||
},
|
||||
window.onmouseup=()=>{
|
||||
this.drag=false
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
computed: {
|
||||
fieldUserRemind() {
|
||||
if (this.show === true) {
|
||||
let arr = []
|
||||
|
||||
this.fieldUser.forEach(value => {
|
||||
|
||||
if (value.fieldCn.indexOf(this.text) !== -1) {
|
||||
arr.push({ ...value
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
return arr
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
show(){
|
||||
// console.log(this.show)
|
||||
if(this.show){
|
||||
window.onkeydown=(e)=>{
|
||||
if(e.key=='ArrowUp'||e.key=='ArrowDown'){
|
||||
e.preventDefault()
|
||||
var tempcurrDom = document.getElementById('fieldUserTabletempcurr')
|
||||
var FUTTable = document.getElementById('FUT_table')
|
||||
if(e.key=='ArrowUp'&&this.tempCurIndex>0){
|
||||
this.tempCurIndex--
|
||||
}
|
||||
if(e.key=='ArrowDown'&&this.tempCurIndex<this.fieldUserRemind.length-1){
|
||||
this.tempCurIndex++
|
||||
}
|
||||
FUTTable.scrollTop = tempcurrDom.offsetTop-180
|
||||
}
|
||||
if(e.key=='Enter'){
|
||||
e.preventDefault()
|
||||
this.dbc(this.fieldUserRemind[this.tempCurIndex].fieldCn)
|
||||
}
|
||||
|
||||
}
|
||||
}else{
|
||||
window.onkeydown=()=>{
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
text(){
|
||||
this.tempCurIndex = 0
|
||||
var FUTTable = document.getElementById('FUT_table')
|
||||
FUTTable.scrollTop =0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
mousedowm(e){
|
||||
this.tempClientX = e.clientX;
|
||||
this.tempClientY = e.clientY;
|
||||
this.tempOffsetLeft=this.$refs.UserTable.offsetLeft
|
||||
this.tempOffsetTop=this.$refs.UserTable.offsetTop
|
||||
|
||||
|
||||
|
||||
this.drag=true
|
||||
|
||||
},
|
||||
dbc(e){
|
||||
this.$emit('dbc',e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
139
h5-datax-manager/src/components/common/file.vue
Normal file
@@ -0,0 +1,139 @@
|
||||
<template>
|
||||
|
||||
<div :style="{display:show?'block':'none',position:'relative'}">
|
||||
<div @click="opening()" :style="{marginLeft:(5+retract*10)+'px',display:show?'flex':'none'}" class="file_file" @contextmenu.prevent="opening();$emit('fileRight',{e:$event,item:item})">
|
||||
<p style="width: 16px;">
|
||||
<i :class="open?'el-icon-arrow-down':'el-icon-arrow-right'" :style="{display:iconshow?'inline':'none'}"></i>
|
||||
</p>
|
||||
<i :class="iconshow?open?'el-icon-folder-opened file_icon':'el-icon-folder file_icon':'el-icon-folder file_icon'"></i>
|
||||
<span class="file_name" v-show="Rename">
|
||||
<el-input v-model="inputValue" placeholder="回车键确认,esc取消" size="mini" ref="input" @keyup.enter="submit"></el-input>
|
||||
</span>
|
||||
<span class="file_name" v-show="!Rename">{{name}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import bus from '@/components/common/bus.js'
|
||||
export default {
|
||||
props: {
|
||||
item: {
|
||||
type: Object,
|
||||
default () {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
name: '',
|
||||
Rename: '',
|
||||
retract: '',
|
||||
open: '',
|
||||
show: '',
|
||||
|
||||
id: '',
|
||||
inputValue: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs.input.$refs.input.onkeydown = (e) => {
|
||||
this.keyDown(e)
|
||||
}
|
||||
this.setItem(this.item)
|
||||
},
|
||||
methods: {
|
||||
setItem(e){
|
||||
this.name =e.name
|
||||
this.Rename=e.Rename
|
||||
this.retract=e.ZIndex
|
||||
this.open=e.open
|
||||
this.show=e.show
|
||||
this.id=e.id
|
||||
},
|
||||
keyDown(e) {
|
||||
// console.log(e)
|
||||
if (e.key === "Enter") {
|
||||
if (this.inputValue.length > 20) {
|
||||
this.$message({
|
||||
message: '最大长度20个字符',
|
||||
type: 'warning'
|
||||
});
|
||||
} else {
|
||||
let params = {
|
||||
name: this.inputValue.trim(),
|
||||
id: this.id
|
||||
}
|
||||
this.$emit("updatafilelist", params)
|
||||
|
||||
|
||||
}
|
||||
} else if (e.key === "Escape") {
|
||||
this.inputValue = ""
|
||||
this.$emit('RenameClose', this.id)
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
opening() {
|
||||
if (!this.Rename) {
|
||||
this.$emit('curr', this.id)
|
||||
}
|
||||
|
||||
},
|
||||
submit(e) {
|
||||
console.log(1)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
Rename() {
|
||||
if (this.Rename === true) {
|
||||
setTimeout(() => {
|
||||
this.$refs.input.focus()
|
||||
}, 10)
|
||||
}
|
||||
},
|
||||
item: {
|
||||
deep: true, //深度监听设置为 true
|
||||
handler: function(e) {
|
||||
this.setItem(e)
|
||||
}
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
iconshow(){
|
||||
return !!this.item.children.length
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.file_file {
|
||||
transition: all .3s;
|
||||
align-items: center;
|
||||
padding: 5px;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.file_icon {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.file_name {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
</style>
|
||||
147
h5-datax-manager/src/components/common/fileHome.vue
Normal file
@@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-for="item in data">
|
||||
<file :class="item.id===currid?'file_select':''" @curr="curr" :item="item"
|
||||
@RenameClose="RenameClose" @updatafilelist="updatafilelist" @fileRight="fileRight"></file>
|
||||
|
||||
<div v-for="value in item.children">
|
||||
|
||||
<file :class="value.id===currid?'file_select':''" @curr="curr" :item="value"
|
||||
@RenameClose="RenameClose" @updatafilelist="updatafilelist" @fileRight="fileRight"></file>
|
||||
|
||||
<div v-for="cont in value.children">
|
||||
|
||||
<file :class="cont.id===currid?'file_select':''" @curr="curr" :item="cont"
|
||||
@RenameClose="RenameClose" @updatafilelist="updatafilelist" @fileRight="fileRight"></file>
|
||||
|
||||
<div v-for="cont1 in cont.children">
|
||||
|
||||
<file :class="cont1.id===currid?'file_select':''" @curr="curr" :item="cont1"
|
||||
@RenameClose="RenameClose" @updatafilelist="updatafilelist" @fileRight="fileRight"></file>
|
||||
<div v-for="cont2 in cont1.children">
|
||||
|
||||
<file :class="cont2.id===currid?'file_select':''" @curr="curr" :item="cont2"
|
||||
@RenameClose="RenameClose" @updatafilelist="updatafilelist" @fileRight="fileRight"></file>
|
||||
<div v-for="cont3 in cont2.children">
|
||||
|
||||
<file :class="cont3.id===currid?'file_select':''" @curr="curr" :item="cont3"
|
||||
@RenameClose="RenameClose" @updatafilelist="updatafilelist" @fileRight="fileRight"></file>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="fileHint" :style="{top:tempHintTop+'px',left:tempHintLeft+'px',display:tempHintTop&&tempHintLeft?'block':'none'}">
|
||||
<p>
|
||||
<el-button type="text" size="mini" @click="RenameFun">重命名</el-button>
|
||||
</p>
|
||||
<p>
|
||||
<el-button type="text" size="mini" @click="delectFun">删除</el-button>
|
||||
</p>
|
||||
<p>
|
||||
<el-button type="text" size="mini" @click="tempHintLeft=null;tempHintTop=null">取消</el-button>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import file from './file.vue'
|
||||
export default {
|
||||
components: {
|
||||
file
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
tempHintTop : null,
|
||||
tempHintLeft :null,
|
||||
tempId:null
|
||||
}
|
||||
},
|
||||
props: {
|
||||
data: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
currid:{
|
||||
type:Number,
|
||||
default : 99999999
|
||||
}
|
||||
},
|
||||
created() {
|
||||
setTimeout(() => {
|
||||
console.log(this.data)
|
||||
}, 1000)
|
||||
},
|
||||
methods: {
|
||||
curr(e) {
|
||||
this.tempHintLeft = null
|
||||
this.tempHintTop = null
|
||||
this.tempId = null
|
||||
this.$emit('curr',e)
|
||||
},
|
||||
RenameClose() {
|
||||
this.$emit('RenameClose',this.tempId )
|
||||
},
|
||||
updatafilelist(e) {
|
||||
this.$emit('updatafilelist',e)
|
||||
},
|
||||
fileRight(e){
|
||||
this.tempHintLeft = e.e.x
|
||||
this.tempHintTop = e.e.y
|
||||
this.tempId = e.item.id
|
||||
},
|
||||
RenameFun(){
|
||||
this.$emit('RenameFun',this.tempId )
|
||||
this.tempHintTop = null,
|
||||
this.tempHintLeft =null,
|
||||
this.tempId=null
|
||||
},
|
||||
delectFun(){
|
||||
this.$confirm('确定删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$emit('delectFun',this.tempId )
|
||||
this.tempHintTop = null,
|
||||
this.tempHintLeft =null,
|
||||
this.tempId=null
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
});
|
||||
this.tempHintTop = null
|
||||
this.tempHintLeft = null
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
109
h5-datax-manager/src/components/common/rule.vue
Normal file
@@ -0,0 +1,109 @@
|
||||
<style>
|
||||
.rule_home {
|
||||
display: flex;
|
||||
|
||||
}
|
||||
|
||||
.rule_fa {
|
||||
display: flex;
|
||||
width: 20%;
|
||||
height: 30%;
|
||||
margin: 10px 10px 0 0;
|
||||
}
|
||||
|
||||
.rule_son {
|
||||
display: flex;
|
||||
margin-top: 10px;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="Data&&FieldUser">
|
||||
<div v-for="(item,index) in Data" class="rule_home">
|
||||
<div class="rule_fa">
|
||||
<el-button icon="el-icon-plus" circle @click="$emit('faadd',index)"></el-button>
|
||||
<el-button icon="el-icon-close" circle @click="$emit('fadelect',index)" :disabled="index===0?'disabled':false" style="margin-right: 10px;"></el-button>
|
||||
<el-input v-model="item.conditionValue" style="width: 200px;" maxlength="20" placeholder="请输入内容"></el-input>
|
||||
</div>
|
||||
<div>
|
||||
<div v-for="(value,inde) in item.fieldSubCond" class="rule_son">
|
||||
<el-button icon="el-icon-plus" circle @click="$emit('sonadd',index,inde)" ></el-button>
|
||||
<el-button icon="el-icon-close" circle @click="$emit('sondelect',index,inde)" :disabled="inde===0?'disabled':false" style="margin-right: 10px;"></el-button>
|
||||
<el-select v-model="value.fieldId" placeholder="请选择" filterable style="width: 200px;" @change="$emit('change',index,inde)">
|
||||
<el-option v-for="cont in FieldUser.data.fieldList" :key="cont.id" :label="cont.fieldCn" :value="cont.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<ruleRelation v-model="value.operator" :value2.sync="value.fieldValue" :valueType="getvalueType(value.fieldId)" ></ruleRelation>
|
||||
<!-- <el-input v-model="value.fieldValue" maxlength="30" placeholder="请输入内容,最长30位" style="width: 300px;margin-left: 10px;" v-show="getvalueType(value.fieldId)!==3">
|
||||
</el-input>
|
||||
<el-select v-model="value.fieldValue" placeholder="请选择" style="width: 300px;margin-left: 10px;" v-show="getvalueType(value.fieldId)===3">
|
||||
<el-option label="是" value="1"></el-option>
|
||||
<el-option label="否" value="0"></el-option>
|
||||
</el-select> -->
|
||||
<el-select v-model="value.logical" placeholder="请选择" style="width: 100px;margin-left: 10px;" v-show="inde!==item.fieldSubCond.length-1">
|
||||
<el-option label="and" value="&&"></el-option>
|
||||
<el-option label="or" value="or"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ruleRelation from '@/components/common/ruleRelation.vue'
|
||||
export default {
|
||||
components:{
|
||||
ruleRelation
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log(this.Data)
|
||||
},
|
||||
computed: {
|
||||
FieldUser() {
|
||||
return this.$store.state.FieldUser
|
||||
}
|
||||
},
|
||||
props: {
|
||||
Data: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
getvalueType(cont){
|
||||
let num
|
||||
this.FieldUser.data.fieldList.forEach(value=>{
|
||||
if(value.id===cont){
|
||||
num = value.valueType
|
||||
}
|
||||
})
|
||||
return num
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
140
h5-datax-manager/src/components/common/ruleRelation.vue
Normal file
@@ -0,0 +1,140 @@
|
||||
<template>
|
||||
<div style="display: inline;">
|
||||
<div style="display: flex;align-items: center;">
|
||||
<el-select v-model="data" :size="size" :filterable="type==2?'filterable':false" placeholder="请选择"
|
||||
ref="select" style="width: 100px;margin-left: 10px;" @change="change" @blur="$emit('blur')">
|
||||
<el-option label="大于" value=">" v-show="[2,3,5,6].indexOf(valueType)==-1"></el-option>
|
||||
<el-option label="大于等于" value=">=" v-show="[2,3,5,6].indexOf(valueType)==-1"></el-option>
|
||||
<el-option label="等于" value="==" v-show="[5].indexOf(valueType)==-1"></el-option>
|
||||
<el-option label="小于" value="<" v-show="[2,3,5,6].indexOf(valueType)==-1"></el-option>
|
||||
<el-option label="小于等于" value="<=" v-show="[2,3,5,6].indexOf(valueType)==-1"></el-option>
|
||||
<el-option label="不等于" value="!=" v-show="[5].indexOf(valueType)==-1"></el-option>
|
||||
<el-option label="包含" value="contains" v-show="[2,5,6].indexOf(valueType)!=-1"></el-option>
|
||||
<el-option label="不包含" value="not contains" v-show="[2,5,6].indexOf(valueType)!=-1"></el-option>
|
||||
<el-option label="为空" value="is empty" v-show="[6].indexOf(valueType)!=-1"></el-option>
|
||||
<el-option label="不为空" value="not empty" v-show="[6].indexOf(valueType)!=-1"></el-option>
|
||||
<el-option label="正则匹配" value="regex" v-show="[2].indexOf(valueType)!=-1"></el-option>
|
||||
</el-select>
|
||||
|
||||
<el-input :value="value2" @input="$emit('update:value2',$event)" maxlength="30" :size="size"
|
||||
placeholder="请输入内容,最长30位" style="width: 100px;margin-left: 10px;"
|
||||
v-if="!variableType&&openValue2&&valueType!==3&&['is empty','not empty'].indexOf(data)==-1">
|
||||
</el-input>
|
||||
<el-select :value="value2" @input="$emit('update:value2',$event)" placeholder="请选择" :size="size"
|
||||
style="width: 100px;margin-left: 10px;" v-if="!variableType&&openValue2&&valueType===3">
|
||||
<el-option label="是" value="="></el-option>
|
||||
<el-option label="否" value="!="></el-option>
|
||||
</el-select>
|
||||
<varialeSelect v-if="variableType" :valueType="valueType"
|
||||
:disabled="variableDisList" :variableType="variableType"
|
||||
@update:variableType="$emit('update:variableType',$event)" :value="value2"
|
||||
@input="$emit('update:value2',$event)" v-bind="$attrs" @CustomCallback="$emit('CustomCallback',$event)" style="margin-left: 10px;"></varialeSelect>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import varialeSelect from '@/components/models/varialeSelect.vue'
|
||||
export default {
|
||||
components: {
|
||||
varialeSelect
|
||||
},
|
||||
props: {
|
||||
openValue2: { //是否打开后半截输入框
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
value2: { //后半截输入框的Key
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
type: { //是否打开搜索
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
openSelect: { //是否自动打开下拉选择框
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
value: { //大于小于等信息
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
valueType: { //数字 或者字符串 或者 JSON
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
size: { //大小
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
variableType: { //是否打开 常量变量自定义 以及默认为哪个 0为不打开
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
variableDis: { //禁用常量变量自定义
|
||||
type: Array || null,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
data: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.data = this.value
|
||||
// console.log(this.$listeners)
|
||||
},
|
||||
methods: {
|
||||
change() {
|
||||
this.$emit('change')
|
||||
if (['is empty', 'not empty'].indexOf(this.data) == -1) {
|
||||
if (this.data == 'regex') {
|
||||
this.$emit('update:value2', '')
|
||||
} else {
|
||||
this.$emit('update:value2', '0')
|
||||
}
|
||||
}
|
||||
if (this.data == 'regex') { //如果选择正则匹配 则只能为变量
|
||||
this.$emit('update:variableType', 1)
|
||||
}
|
||||
|
||||
|
||||
this.$emit('input', this.data)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
variableDisList() {
|
||||
|
||||
let arr = []
|
||||
if (this.variableDis) {
|
||||
|
||||
arr.push(...this.variableDis)
|
||||
}
|
||||
if (this.data == 'regex') {
|
||||
arr.push(...[2, 3])
|
||||
}
|
||||
arr = Array.from(new Set(arr))
|
||||
return arr
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value() {
|
||||
this.data = this.value
|
||||
},
|
||||
openSelect() {
|
||||
if (this.openSelect) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.select.focus()
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
372
h5-datax-manager/src/components/common/teV2.vue
Normal file
@@ -0,0 +1,372 @@
|
||||
<style>
|
||||
.te_top {
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
background-color: #aaa;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
|
||||
}
|
||||
|
||||
.te_top>p {
|
||||
color: #eee;
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.te_top>p:hover {
|
||||
color: #fff;
|
||||
cursor: pointer
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div style="width: 100%;">
|
||||
|
||||
<p style="font-size:14px;margin-bottom: 5px;color: #aaa;">
|
||||
‘@’字符选择变量
|
||||
</p>
|
||||
<slot></slot>
|
||||
<div class="te_top" v-if="hint==true">
|
||||
<p @click="textareaAdd('+')">+</p>
|
||||
<p @click="textareaAdd('-')">-</p>
|
||||
<p @click="textareaAdd('*')">*</p>
|
||||
<p @click="textareaAdd('/')">/</p>
|
||||
<p @click="textareaAdd('sqrt(,)')">sqrt</p>
|
||||
<p @click="textareaAdd('In(,)')">In</p>
|
||||
<p @click="textareaAdd('avg(,)')">avg()</p>
|
||||
<p @click="textareaAdd('(,)')">()</p>
|
||||
<p @click="textareaAdd('abs(,)')">abs</p>
|
||||
<p @click="textareaAdd('max(,)')">max</p>
|
||||
<p @click="textareaAdd('min(,)')">min</p>
|
||||
<p @click="textareaAdd('lg(,)')">lg</p>
|
||||
<p @click="textareaAdd('exp(,)')">exp</p>
|
||||
<p @click="textareaAdd('ceil(,)')">ceil</p>
|
||||
<p @click="textareaAdd('floor(,)')">floor</p>
|
||||
</div>
|
||||
<el-input type="textarea" rows="9" placeholder="请输入内容" v-model="formula_show" ref="textarea"
|
||||
@input="$emit('input',formula_show)">
|
||||
</el-input>
|
||||
<fieldUserTable :text="text" :fieldUser="FieldUser" refs="t" @dbc="dbclick" :show="isshow"
|
||||
@close="isshow=false"></fieldUserTable>
|
||||
<!-- <el-dialog :title="'当前编辑'+nowCurr" :visible.sync="dialogVisible" width="30%" append-to-body>
|
||||
<el-button @click="delect">删除字段</el-button>
|
||||
</el-dialog> -->
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import fieldUserTable from '@/components/common/fieldUserTable.vue'
|
||||
|
||||
// import bus from './SCO/bus.js'
|
||||
export default {
|
||||
components: {
|
||||
fieldUserTable
|
||||
},
|
||||
props: {
|
||||
data: {
|
||||
type: Object,
|
||||
default () {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
value: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
hint:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
tempsection: [],
|
||||
sectionVisible: false, //区间编辑弹窗
|
||||
nowCurr: '',
|
||||
dialogVisible: false,
|
||||
isshow: false,
|
||||
text: '',
|
||||
tempIndex: '',
|
||||
lest: '',
|
||||
islest: false,
|
||||
tempFormula: '',
|
||||
formula_show: '',
|
||||
cursorfront: '',
|
||||
cursorlest: '',
|
||||
lastKeyDown: '',
|
||||
// fields: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs.textarea.$refs.textarea.onkeydown = (e) => {
|
||||
|
||||
|
||||
this.cursorfront = this.formula_show.substring(0, this.$refs.textarea.$refs.textarea.selectionStart)
|
||||
this.cursorlest = this.formula_show.substring(this.$refs.textarea.$refs.textarea.selectionStart)
|
||||
if (e.key == "Backspace" || e.key == "Delete") {
|
||||
this.lastKeyDown = e.key
|
||||
|
||||
if (e.key == "Backspace" && this.formula_show.substring(this.$refs.textarea.$refs.textarea
|
||||
.selectionStart - 1,
|
||||
this.$refs.textarea.$refs.textarea.selectionStart) == '@' && (this.isodd(this.formula_show,
|
||||
'@') == false)) {
|
||||
e.preventDefault()
|
||||
this.countCurr()
|
||||
this.delect("Backspace")
|
||||
}
|
||||
if (e.key == "Delete" && this.formula_show.substring(this.$refs.textarea.$refs.textarea
|
||||
.selectionStart, this.$refs
|
||||
.textarea.$refs.textarea.selectionStart + 1) == '@') {
|
||||
e.preventDefault()
|
||||
this.countCurr()
|
||||
this.delect("Delete")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
computed: {
|
||||
FieldUser() {
|
||||
return this.$store.state.FieldUser.data.fieldList
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.formula_show = this.value
|
||||
|
||||
// console.log(this.formula_show, this.value)
|
||||
// bus.$on('getOk', (e) => {
|
||||
// this.formula_show = e.formula_show
|
||||
// this.tempFormula = e.formula_show
|
||||
|
||||
// })
|
||||
},
|
||||
methods: {
|
||||
setCaretPosition(ctrl, pos) { //设置光标位置函数
|
||||
if (ctrl.setSelectionRange) {
|
||||
ctrl.focus();
|
||||
this.$nextTick(() => {
|
||||
ctrl.setSelectionRange(pos, pos);
|
||||
})
|
||||
} else if (ctrl.createTextRange) {
|
||||
var range = ctrl.createTextRange();
|
||||
range.collapse(true);
|
||||
range.moveEnd('character', pos);
|
||||
range.moveStart('character', pos);
|
||||
range.select();
|
||||
}
|
||||
},
|
||||
textareaAdd(e) {
|
||||
this.cursorfront = this.formula_show.substring(0, this.$refs.textarea.$refs.textarea
|
||||
.selectionStart)
|
||||
this.cursorlest = this.formula_show.substring(this.$refs.textarea.$refs.textarea.selectionStart)
|
||||
|
||||
if (e.split(',')[1]) {
|
||||
this.formula_show = this.cursorfront + e.split(',')[0] + e.split(',')[1] + this.cursorlest
|
||||
} else {
|
||||
this.formula_show = this.cursorfront + e.split(',')[0] + this.cursorlest
|
||||
}
|
||||
this.setCaretPosition(this.$refs.textarea.$refs.textarea, (this.cursorfront + e.split(',')[0])
|
||||
.length)
|
||||
},
|
||||
|
||||
// 获取 字符串中 有 多少个指定字符
|
||||
getTempIndex(string, str) {
|
||||
let temp = 0
|
||||
for (let num = 0;;) {
|
||||
|
||||
|
||||
if (string.indexOf(str, temp) != -1) {
|
||||
temp = string.indexOf(str, temp)
|
||||
temp++
|
||||
num++
|
||||
} else {
|
||||
return num
|
||||
}
|
||||
}
|
||||
// console.log(string, str)
|
||||
},
|
||||
getTempArreyIndex(array, str) {
|
||||
let num = 0
|
||||
array.forEach((value) => {
|
||||
if (value.field_name == "str") {
|
||||
num++
|
||||
}
|
||||
})
|
||||
return num
|
||||
|
||||
|
||||
},
|
||||
countCurr() {
|
||||
if ((this.isodd(this.cursorfront, '@') == true) && (this.isodd(this.cursorlest, '@') == true)) {} else if (
|
||||
this.lastKeyDown == "Backspace") {
|
||||
this.cursorfront = this.cursorfront.substring(0, this.cursorfront.length - 1)
|
||||
this.cursorlest = '@' + this.cursorlest
|
||||
|
||||
} else if (this.lastKeyDown == "Delete") {
|
||||
this.cursorfront = this.cursorfront + '@'
|
||||
this.cursorlest = this.cursorlest.substr(1);
|
||||
|
||||
}
|
||||
let str = this.cursorfront.substring(this.cursorfront.lastIndexOf('@')) + this.cursorlest
|
||||
.substring(0, this.cursorlest
|
||||
.indexOf('@') + 1)
|
||||
|
||||
this.nowCurr = str + '|' + this.getTempIndex(this.cursorfront, str)
|
||||
// console.log(this.nowCurr)
|
||||
|
||||
},
|
||||
delect(type) {
|
||||
let str = this.nowCurr.split('|')[0]
|
||||
let index = this.nowCurr.split('|')[1]
|
||||
|
||||
// this.cursorfront = this.formula_show.substring(0, this.$refs.textarea.$refs.textarea.selectionStart)
|
||||
// this.cursorlest = this.formula_show.substring(this.$refs.textarea.$refs.textarea.selectionStart)
|
||||
|
||||
this.delectShow(str, parseInt(index))
|
||||
if(type=='Backspace'){
|
||||
|
||||
this.setCaretPosition(this.$refs.textarea.$refs.textarea, (this.cursorfront.length-str.length+1))
|
||||
}else if(type=='Delete'){
|
||||
this.setCaretPosition(this.$refs.textarea.$refs.textarea, (this.cursorfront.length-1))
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.cursorfront = ""
|
||||
this.cursorlest = ""
|
||||
this.nowCurr = ""
|
||||
this.lastKeyDown = ""
|
||||
|
||||
},
|
||||
|
||||
delectShow(str, index) { // 回显删除
|
||||
|
||||
this.formula_show = this.formula_show.substring(0, this.cursorfront.lastIndexOf('@')) + this
|
||||
.formula_show.substring(
|
||||
this.cursorfront.lastIndexOf('@') + str.length, )
|
||||
this.tempFormula = this.formula_show
|
||||
|
||||
|
||||
},
|
||||
isodd(text, str) { // 判断某个字符串中 某个字符是否是奇数
|
||||
let num = 0
|
||||
for (let i of text) {
|
||||
if (i === str) {
|
||||
num++
|
||||
}
|
||||
}
|
||||
if (num % 2 === 1) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
dbclick(e) {
|
||||
this.cursorfront = this.formula_show.substring(0, this.$refs.textarea.$refs.textarea.selectionStart)
|
||||
// console.log(this.cursorfront)
|
||||
let T = ""
|
||||
T = this.formula_show.split("")
|
||||
T.splice(this.tempIndex, this.text.length + 1, '@' + e + '@')
|
||||
this.formula_show = T.join("")
|
||||
this.setCaretPosition(this.$refs.textarea.$refs.textarea, (this.cursorfront.length+e.length+1-this.text.length))
|
||||
this.isshow = false
|
||||
// console.log(1)
|
||||
},
|
||||
deepClone(obj) {
|
||||
if (this.getType(obj) === 'Array') {
|
||||
var res = []
|
||||
} else if (this.getType(obj) === 'Object') {
|
||||
var res = {}
|
||||
} else {
|
||||
return obj
|
||||
}
|
||||
for (var i in obj) {
|
||||
res[i] = this.deepClone(obj[i])
|
||||
}
|
||||
return res
|
||||
},
|
||||
getType(obj) {
|
||||
var res = Object.prototype.toString.call(obj)
|
||||
//截取注意[] 符号,和空格
|
||||
return res.slice(8, -1) // 也可以res.length-1
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
formula_show() {
|
||||
let num = 0
|
||||
|
||||
for (let i of this.formula_show) {
|
||||
if (i === "@") {
|
||||
num++
|
||||
}
|
||||
}
|
||||
if (num % 2 === 1) {
|
||||
this.isshow = true
|
||||
for (let i in this.formula_show) {
|
||||
if (this.formula_show[i] !== this.tempFormula[i] && this.formula_show[i] == "@") {
|
||||
|
||||
if (this.islest) {
|
||||
this.tempIndex = i
|
||||
|
||||
this.lest = this.formula_show.substring(parseInt(this.tempIndex) + 1, this
|
||||
.formula_show.length)
|
||||
this.islest = false
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
let T = this.formula_show.substring(parseInt(this.tempIndex) + 1, this.formula_show.length)
|
||||
if (this.lest !== "") {
|
||||
// console.log(T)
|
||||
T = T.substring(0, T.indexOf(this.lest))
|
||||
|
||||
} else {
|
||||
T = T.substring(0, T.length)
|
||||
}
|
||||
|
||||
this.text = T
|
||||
if (this.text === "@") {
|
||||
this.text = ""
|
||||
}
|
||||
// console.log('lest:' + this.lest, 'index:' + this.tempIndex, "T:" + T)
|
||||
|
||||
} else {
|
||||
this.islest = true
|
||||
this.text = ""
|
||||
this.tempIndex = null
|
||||
this.isshow = false
|
||||
// console.log(1)
|
||||
}
|
||||
this.tempFormula = this.formula_show
|
||||
this.data.formula_show = this.formula_show
|
||||
this.$emit('input', this.formula_show)
|
||||
},
|
||||
fields: {
|
||||
handler: function() {
|
||||
this.data.fields = this.fields
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
value(value){
|
||||
console.log(value)
|
||||
this.formula_show = this.value
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
229
h5-datax-manager/src/components/models/varialeSelect.vue
Normal file
@@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<div class="variateSelect" :style="{width:width,height:height}">
|
||||
<div style="width: 35%;" class="variateSelectLeft" :style="{height:height}">
|
||||
<el-dropdown trigger="click" @command="em">
|
||||
<span class="el-dropdown-link" style="color: #fff;">
|
||||
{{variableType==1?"常量":variableType==2?"变量":variableType==3?"自定义":"错误"}}<i
|
||||
class="el-icon-arrow-down el-icon--right"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item icon="el-icon-caret-right" :command="1" :disabled="disabled.indexOf(1)!=-1">常量
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-caret-right" :command="2" :disabled="disabled.indexOf(2)!=-1">变量
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-caret-right" :command="3" :disabled="disabled.indexOf(3)!=-1">自定义
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
<!-- 常量 -->
|
||||
<el-input style="margin-left: -10%;width: 75%;" :value="value" :size="size" placeholder="请输入内容"
|
||||
v-if="variableType===1" @input="$emit('input',$event)"></el-input>
|
||||
|
||||
|
||||
<!-- 变量 -->
|
||||
<el-select style="margin-left: -10%;width: 75%;" :size="size" :value="value" filterable
|
||||
@change="$emit('input',$event)" v-else-if="variableType===2&&!variableCascader">
|
||||
<el-option v-for="item in MyFieldUser" :key="item.id" :label="item.fieldCn" :value="item.fieldEn">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<!-- 变量级联 -->
|
||||
|
||||
<el-cascader style="margin-left: -10%;width: 75%;" :value="value" :size="size" v-else-if="variableType===2&&variableCascader" filterable :options="FieldUserObj"
|
||||
:key="(value.random?value.random:0)" @visible-change="randomAdd(value,$event)" @change="$emit('input',$event)"
|
||||
:props="{ expandTrigger: 'hover' }" ></el-cascader>
|
||||
|
||||
<!-- 自定义按钮 -->
|
||||
<el-button plain @click="CustomClick" v-else-if="variableType===3"
|
||||
:style="{height:height}" class="varialeType3Button" :size="size">
|
||||
{{value==""||JSON.parse(value).formula===""?'请输入自定义内容':JSON.parse(value).formula}}</el-button>
|
||||
<!-- 自定义的弹框 -->
|
||||
<el-dialog title="自定义" v-if="dialogVisible" :visible.sync="dialogVisible" width="70%"
|
||||
:close-on-click-modal="false" append-to-body>
|
||||
<teV2 v-model="tempValue"></teV2>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible=false;tempValue=''">取 消</el-button>
|
||||
<el-button type="primary" @click="sectionSure" :disabled="type3Sure">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import teV2 from '@/components/common/teV2.vue'
|
||||
export default {
|
||||
components: {
|
||||
teV2
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tempValue: ''
|
||||
}
|
||||
},
|
||||
props: {
|
||||
size: {
|
||||
type: String,
|
||||
default: 'mini'
|
||||
},
|
||||
variableType: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
value: {
|
||||
type: String|Array,
|
||||
default: ""
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '300px'
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '28px'
|
||||
},
|
||||
disabled: {
|
||||
type: Array,
|
||||
default(){
|
||||
return []
|
||||
}
|
||||
},
|
||||
valueType: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
interceptCustom: { //是否拦截自定义点击
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
variableCascader:{
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
variableCascaderValue:{
|
||||
type: Array,
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// console.log(this.variableType)
|
||||
if (!this.variableType) {
|
||||
this.$emit('update:variableType', 1)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
CustomClick() {
|
||||
if(this.interceptCustom){
|
||||
this.$emit('CustomCallback',this.value)
|
||||
return
|
||||
}
|
||||
this.tempValue = this.value === '' ? this.value : JSON.parse(this.value).formula;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
sectionSure(e) {
|
||||
let arr = String(this.tempValue).match(/@(.|\n)*?@/g) === null ? [] : this.tempValue.match(/@(.|\n)*?@/g);
|
||||
let is = false
|
||||
// console.log(arr,this.tempValue)
|
||||
arr = Array.from(new Set(arr))
|
||||
// console.log(arr)
|
||||
arr = arr.map(value => {
|
||||
console.log(value)
|
||||
value = value.split('')
|
||||
value.pop()
|
||||
value.shift()
|
||||
value = value.join('')
|
||||
if (this.mixinGetValueByCn(value)) {
|
||||
return this.mixinGetValueByCn(value)
|
||||
} else {
|
||||
is = true
|
||||
this.$message.error(`没有找到指标:${value}`);
|
||||
return this.mixinGetValueByCn(value)
|
||||
}
|
||||
|
||||
})
|
||||
// console.log(arr)
|
||||
// console.log(e)
|
||||
if (is) {
|
||||
return
|
||||
}
|
||||
let obj = {
|
||||
farr: arr,
|
||||
formula: this.tempValue.trim()
|
||||
}
|
||||
|
||||
|
||||
// console.log(this.tempValue)
|
||||
this.$emit('input', JSON.stringify(obj))
|
||||
this.dialogVisible = false
|
||||
},
|
||||
em(e) {
|
||||
this.$emit('update:variableType', e)
|
||||
this.$emit('input', "")
|
||||
},
|
||||
isodd(text, str) { // 判断某个字符串中 某个字符是否是奇数
|
||||
let num = 0
|
||||
for (let i of text) {
|
||||
if (i === str) {
|
||||
num++
|
||||
}
|
||||
}
|
||||
if (num % 2 === 1) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
FieldUserObj(){
|
||||
|
||||
if(this.variableCascaderValue===undefined){
|
||||
|
||||
if(this.$store.state.FieldUserObj){
|
||||
return this.$store.state.FieldUserObj.data.fieldList
|
||||
}else{
|
||||
return []
|
||||
}
|
||||
}
|
||||
return this.variableCascaderValue
|
||||
|
||||
},
|
||||
MyFieldUser(e) {
|
||||
if (this.valueType) {
|
||||
return this.FieldUser.filter(x => x.valueType == this.valueType)
|
||||
} else {
|
||||
return this.FieldUser
|
||||
}
|
||||
},
|
||||
type3Sure() {
|
||||
return this.isodd(this.tempValue, '@')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.variateSelect {
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.variateSelectLeft {
|
||||
background-color: #ddd;
|
||||
border-radius: 5px;
|
||||
padding-right: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 6px;
|
||||
padding-right: 30px;
|
||||
justify-content: center;
|
||||
}
|
||||
.varialeType3Button{
|
||||
flex-shrink: 0;flex-grow: 1; margin-left: -10%;width: 75%;overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
56
h5-datax-manager/src/components/page/403.vue
Normal file
@@ -0,0 +1,56 @@
|
||||
<template>
|
||||
<div class="error-page">
|
||||
<div class="error-code">4<span>0</span>3</div>
|
||||
<div class="error-desc">啊哦~ 你没有权限访问该页面哦</div>
|
||||
<div class="error-handle">
|
||||
<router-link to="/">
|
||||
<el-button type="primary" size="large">返回首页</el-button>
|
||||
</router-link>
|
||||
<el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
goBack(){
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.error-page{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f3f3f3;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.error-code{
|
||||
line-height: 1;
|
||||
font-size: 250px;
|
||||
font-weight: bolder;
|
||||
color: #f02d2d;
|
||||
}
|
||||
.error-code span{
|
||||
color: #00a854;
|
||||
}
|
||||
.error-desc{
|
||||
font-size: 30px;
|
||||
color: #777;
|
||||
}
|
||||
.error-handle{
|
||||
margin-top: 30px;
|
||||
padding-bottom: 200px;
|
||||
}
|
||||
.error-btn{
|
||||
margin-left: 100px;
|
||||
}
|
||||
</style>
|
||||
56
h5-datax-manager/src/components/page/404.vue
Normal file
@@ -0,0 +1,56 @@
|
||||
<template>
|
||||
<div class="error-page">
|
||||
<div class="error-code">4<span>0</span>4</div>
|
||||
<div class="error-desc">啊哦~ 你所访问的页面不存在</div>
|
||||
<div class="error-handle">
|
||||
<router-link to="/">
|
||||
<el-button type="primary" size="large">返回首页</el-button>
|
||||
</router-link>
|
||||
<el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
goBack(){
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.error-page{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f3f3f3;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.error-code{
|
||||
line-height: 1;
|
||||
font-size: 250px;
|
||||
font-weight: bolder;
|
||||
color: #2d8cf0;
|
||||
}
|
||||
.error-code span{
|
||||
color: #00a854;
|
||||
}
|
||||
.error-desc{
|
||||
font-size: 30px;
|
||||
color: #777;
|
||||
}
|
||||
.error-handle{
|
||||
margin-top: 30px;
|
||||
padding-bottom: 200px;
|
||||
}
|
||||
.error-btn{
|
||||
margin-left: 100px;
|
||||
}
|
||||
</style>
|
||||
420
h5-datax-manager/src/components/page/Dashboard.vue
Normal file
@@ -0,0 +1,420 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-card shadow="hover" class="mgb20" style="height:252px;">
|
||||
<div class="user-info">
|
||||
<img src="../../assets/img/img.jpg" class="user-avator" alt />
|
||||
<div class="user-info-cont">
|
||||
<div class="user-info-name">{{name}}</div>
|
||||
<!-- <div>{{role}}</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="user-info-list">
|
||||
上次登录时间:
|
||||
<span>{{lastLoginTime | formatDate}}</span>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card shadow="hover" style="height:252px;">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>指标详情</span>
|
||||
</div>
|
||||
|
||||
<charts sid="dashboardLeft" height='250px' width='100%' :option="options"></charts>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-row :gutter="20" class="mgb20">
|
||||
<el-col :span="8">
|
||||
<el-card shadow="hover" :body-style="{padding: '0px'}">
|
||||
<div class="grid-content grid-con-1">
|
||||
<i class="el-icon-lx-people grid-con-icon"></i>
|
||||
<div class="grid-cont-right">
|
||||
<div class="grid-num">{{fieldCount}}</div>
|
||||
<div>指标数量</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-card shadow="hover" :body-style="{padding: '0px'}">
|
||||
<div class="grid-content grid-con-2">
|
||||
<i class="el-icon-lx-notice grid-con-icon"></i>
|
||||
<div class="grid-cont-right">
|
||||
<div class="grid-num">{{interfaceCount}}</div>
|
||||
<div>接口数量</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-card shadow="hover" :body-style="{padding: '0px'}">
|
||||
<div class="grid-content grid-con-3">
|
||||
<i class="el-icon-lx-goods grid-con-icon"></i>
|
||||
<div class="grid-cont-right">
|
||||
<div class="grid-num">{{databaseCount}}</div>
|
||||
<div>数据源数量</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-card shadow="hover" style="height:403px;">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>活动日志</span>
|
||||
</div>
|
||||
<el-table :show-header="false" :data="todoList" style="width:100%;">
|
||||
<el-table-column>
|
||||
<template slot-scope="scope">
|
||||
<div class="todo-item">{{scope.row.opUserName}} {{scope.row.ip}}
|
||||
在{{scope.row.startTime | formatDate}}
|
||||
{{scope.row.opName}}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-card shadow="hover">
|
||||
<p style="text-align: center;font-size: 18px;font-weight: bold;color: #666;">指标调用次数</p>
|
||||
<div style="display: flex;flex-wrap: wrap;">
|
||||
<p v-for="value in CallCountList" style="width: 50%;font-size: 16px;text-align: center;">{{value.name}}:{{value.value}}次</p>
|
||||
|
||||
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-card shadow="hover">
|
||||
<charts sid="dashboardRight" height='250px' width='100%' :option="options2"></charts>
|
||||
</el-card>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import charts from '@/components/common/charts.vue'
|
||||
import bus from '../common/bus';
|
||||
import {
|
||||
getIndexInfo,
|
||||
getFieldCallCountList
|
||||
} from '../../api/index';
|
||||
export default {
|
||||
name: 'dashboard',
|
||||
components: {
|
||||
// Schart,
|
||||
charts
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
name: localStorage.getItem('ms_username'),
|
||||
lastLoginTime: null,
|
||||
fieldCount: null,
|
||||
interfaceCount: null,
|
||||
databaseCount: null,
|
||||
fieldTypeName:{
|
||||
1:'基础指标',
|
||||
2:'数据库指标',
|
||||
3:'衍生指标',
|
||||
4:'接口指标',
|
||||
5:'常量指标',
|
||||
6:'实时指标',
|
||||
|
||||
},
|
||||
CallCountList:[],
|
||||
todoList: [],
|
||||
options: {
|
||||
|
||||
grid: {
|
||||
// top:'20%'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{b} : {c} ({d}%)'
|
||||
},
|
||||
|
||||
legend: {
|
||||
left: 'center',
|
||||
top: 'bottom',
|
||||
},
|
||||
series: [{
|
||||
name: 'Area Mode',
|
||||
type: 'pie',
|
||||
radius: [10, 60],
|
||||
center: ['50%', '30%'],
|
||||
roseType: 'area',
|
||||
itemStyle: {
|
||||
borderRadius: 5
|
||||
},
|
||||
data: [
|
||||
|
||||
]
|
||||
}]
|
||||
|
||||
},
|
||||
options2: {
|
||||
title: {
|
||||
text: '最近几个月引擎使用趋势图',
|
||||
left: 'center'
|
||||
},
|
||||
grid: {
|
||||
bottom: '10% '
|
||||
},
|
||||
xAxis: [{
|
||||
type: 'category',
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
data: []
|
||||
}],
|
||||
yAxis: [{
|
||||
type: 'value'
|
||||
}],
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
series: []
|
||||
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
role() {
|
||||
return this.name === 'admin' ? '超级管理员' : '普通用户';
|
||||
}
|
||||
},
|
||||
// created() {
|
||||
// this.handleListener();
|
||||
// this.changeDate();
|
||||
// },
|
||||
// activated() {
|
||||
// this.handleListener();
|
||||
// },
|
||||
// deactivated() {
|
||||
// window.removeEventListener('resize', this.renderChart);
|
||||
// bus.$off('collapse', this.handleBus);
|
||||
// },
|
||||
|
||||
created() {
|
||||
this.getIndexInfos();
|
||||
getFieldCallCountList({}).then(res=>{
|
||||
if(res.status=='1'){
|
||||
this.CallCountList=res.data.map(value=>{
|
||||
return {
|
||||
name:value.fieldCn,
|
||||
value:value.callCount
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
changeDate() {
|
||||
const now = new Date().getTime();
|
||||
this.data.forEach((item, index) => {
|
||||
const date = new Date(now - (6 - index) * 86400000);
|
||||
item.name = `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`;
|
||||
});
|
||||
},
|
||||
|
||||
async getIndexInfos() {
|
||||
const result = await getIndexInfo();
|
||||
const data = result.data;
|
||||
|
||||
|
||||
// 引擎基本信息
|
||||
this.fieldCount = data.fieldCount;
|
||||
this.interfaceCount = data.interfaceCount;
|
||||
this.databaseCount = data.databaseCount;
|
||||
|
||||
// 引擎使用占比
|
||||
|
||||
|
||||
// 最近几天引擎使用情况
|
||||
|
||||
|
||||
|
||||
// var labelOption = {
|
||||
// show: true,
|
||||
// position: 'insideBottomRight',
|
||||
// distance: 10,
|
||||
// align: 'left',
|
||||
// verticalAlign: 'middle',
|
||||
// rotate: 90,
|
||||
// // formatter: '{c} {name|{a}}',
|
||||
// fontSize: 12,
|
||||
// rich: {
|
||||
// name: {}
|
||||
// }
|
||||
// };
|
||||
|
||||
|
||||
this.options.series[0].data=data.fieldTypeGroup.map(value=>{
|
||||
return {
|
||||
value:value.fieldCount,
|
||||
name:this.fieldTypeName[value.fieldType]
|
||||
}
|
||||
})
|
||||
|
||||
// // 最近几个月引擎使用情况
|
||||
// this.options2.xAxis[0].data = data.recentMonthMap.labels;
|
||||
// this.options2.series = data.recentMonthMap.datasets.map(value => {
|
||||
// return {
|
||||
// name: value.label,
|
||||
// type: 'line',
|
||||
// barGap: 0,
|
||||
// label: labelOption,
|
||||
// emphasis: {
|
||||
// focus: 'series'
|
||||
// },
|
||||
// data: value.data
|
||||
// }
|
||||
// })
|
||||
|
||||
// 上次登录时间
|
||||
this.lastLoginTime = data.lastLoginTime;
|
||||
|
||||
|
||||
// 活动日志
|
||||
this.todoList = data.logList;
|
||||
}
|
||||
},
|
||||
|
||||
filters: {
|
||||
formatDate: function(value) {
|
||||
let date = new Date(value);
|
||||
let y = date.getFullYear();
|
||||
let MM = date.getMonth() + 1;
|
||||
MM = MM < 10 ? ('0' + MM) : MM;
|
||||
let d = date.getDate();
|
||||
d = d < 10 ? ('0' + d) : d;
|
||||
let h = date.getHours();
|
||||
h = h < 10 ? ('0' + h) : h;
|
||||
let m = date.getMinutes();
|
||||
m = m < 10 ? ('0' + m) : m;
|
||||
let s = date.getSeconds();
|
||||
s = s < 10 ? ('0' + s) : s;
|
||||
return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.el-row {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.grid-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.grid-cont-right {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.grid-num {
|
||||
font-size: 30px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.grid-con-icon {
|
||||
font-size: 50px;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
text-align: center;
|
||||
line-height: 100px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.grid-con-1 .grid-con-icon {
|
||||
background: rgb(45, 140, 240);
|
||||
}
|
||||
|
||||
.grid-con-1 .grid-num {
|
||||
color: rgb(45, 140, 240);
|
||||
}
|
||||
|
||||
.grid-con-2 .grid-con-icon {
|
||||
background: rgb(100, 213, 114);
|
||||
}
|
||||
|
||||
.grid-con-2 .grid-num {
|
||||
color: rgb(45, 140, 240);
|
||||
}
|
||||
|
||||
.grid-con-3 .grid-con-icon {
|
||||
background: rgb(242, 94, 67);
|
||||
}
|
||||
|
||||
.grid-con-3 .grid-num {
|
||||
color: rgb(242, 94, 67);
|
||||
}
|
||||
|
||||
.user-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 2px solid #ccc;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.user-avator {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.user-info-cont {
|
||||
padding-left: 50px;
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.user-info-cont div:first-child {
|
||||
font-size: 30px;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
.user-info-list {
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
line-height: 25px;
|
||||
}
|
||||
|
||||
.user-info-list span {
|
||||
margin-left: 70px;
|
||||
}
|
||||
|
||||
.mgb20 {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.todo-item {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.todo-item-del {
|
||||
text-decoration: line-through;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.schart {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
}
|
||||
</style>
|
||||
706
h5-datax-manager/src/components/page/DataSource.vue
Normal file
@@ -0,0 +1,706 @@
|
||||
<template>
|
||||
<div style="height: 90%; ">
|
||||
<!-- 创建和搜索 -->
|
||||
<div class="datasou_top" style="height: 10%;">
|
||||
<el-row style="margin-bottom: 30px;margin-top: 20px;">
|
||||
<el-col :span="15">
|
||||
<el-button style="margin-right:20px;" type="primary" @click="createEngine">创建数据源</el-button>
|
||||
<el-select v-model="sourceType" placeholder="请选择数据源类型" @change="changeSource">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<div class="datasou_cont" style="height: 80%;" v-if="data">
|
||||
<div class="datasou_table">
|
||||
<el-row>
|
||||
|
||||
|
||||
<el-table border :data="data.data.data" style="width: 100%" v-loading="loading">
|
||||
|
||||
<el-table-column label="序号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{((pageNo-1)*10+scope.$index+1)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="name" align="center" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="sourceType == 'Spark'" prop="sparkHome" label="park-home" align="center"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="sourceType == 'Spark'" prop="appName" label="app-name" align="center"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="sourceType == 'Spark'" prop="masterUrl" label="master" align="center"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column v-if="sourceType == 'Hive'" prop="url" label="url" align="center"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column v-if="sourceType != 'Hive'&&sourceType!='Spark'" prop="host" label="host"
|
||||
align="center" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="sourceType != 'Hive'&&sourceType!='Spark'" prop="port" label="port"
|
||||
align="center">
|
||||
</el-table-column>
|
||||
<el-table-column v-if="sourceType !='Hive'&&sourceType!='Spark'" prop="dbName" label="db-name"
|
||||
align="center" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="sourceType!='Spark'" prop="userName"
|
||||
label="user-name" align="center" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="updataTime" label="最后更新时间" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span style="white-space: nowrap;">{{
|
||||
new Date(scope.row.updateTime).toLocaleDateString().replace(/\//g, "-") + " " + new Date(scope.row.updateTime).toTimeString().substr(0, 8)
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" size="s">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-button icon="el-icon-search" circle size="mini"
|
||||
@click="dialogShow(scope.$index)"></el-button>
|
||||
<el-button type="primary" icon="el-icon-edit" circle size="mini"
|
||||
@click="modificationShow(scope.row.id)"></el-button>
|
||||
<el-button type="danger" icon="el-icon-delete" circle size="mini"
|
||||
@click="deletelistsor(scope.row.id)"></el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
</el-row>
|
||||
|
||||
</div>
|
||||
<div style="float: right;margin-right: 120px;margin-top: 40px;">
|
||||
<el-pagination :current-page="pageNo" @current-change="currpage" background layout="prev, pager, next"
|
||||
:total="data.data.pager.total" v-if="data!==null">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog title="数据库详情" :visible.sync="dialogVisible" width="40%" :before-close="handleClose"
|
||||
class="DataSource_look">
|
||||
<div v-if="tempDialogData!==null">
|
||||
<div class="textLayout">
|
||||
<p>连接名称:</p>
|
||||
<p v-if="tempDialogData.name">{{tempDialogData.name}}</p>
|
||||
</div>
|
||||
|
||||
<div class="textLayout" v-if="tempDialogData.type == 'Spark'">
|
||||
<p>spark-home:</p>
|
||||
<p v-if="tempDialogData.sparkHome">{{tempDialogData.sparkHome}}</p>
|
||||
</div>
|
||||
<div class="textLayout" v-if="tempDialogData.type == 'Spark'">
|
||||
<p>app-name:</p>
|
||||
<p v-if="tempDialogData.appName">{{tempDialogData.appName}}</p>
|
||||
</div>
|
||||
<div class="textLayout" v-if="tempDialogData.type == 'Spark'">
|
||||
<p>master:</p>
|
||||
<p v-if="tempDialogData.masterUrl">{{tempDialogData.masterUrl}}</p>
|
||||
</div>
|
||||
|
||||
<div class="textLayout" v-if="tempDialogData.type == 'Hive'">
|
||||
<p>地址:</p>
|
||||
<p v-if="tempDialogData.url">{{tempDialogData.url}}</p>
|
||||
</div>
|
||||
|
||||
<div class="textLayout" v-if="tempDialogData.type != 'Hive'&&tempDialogData.type!='Spark'">
|
||||
<p>主机地址:</p>
|
||||
<p v-if="tempDialogData.host">{{tempDialogData.host}}</p>
|
||||
</div>
|
||||
<div class="textLayout" v-if="tempDialogData.type != 'Hive'&&tempDialogData.type!='Spark'">
|
||||
<p>端口:</p>
|
||||
<p v-if="tempDialogData.port">{{tempDialogData.port}}</p>
|
||||
</div>
|
||||
|
||||
<div class="textLayout" v-if="tempDialogData.type !='Hive'&&tempDialogData.type!='Spark'">
|
||||
<p>数据库名称:</p>
|
||||
<p v-if="tempDialogData.dbName">{{tempDialogData.dbName}}</p>
|
||||
</div>
|
||||
|
||||
<div class="textLayout" v-if="tempDialogData.type!='Spark'">
|
||||
<p>用户名:</p>
|
||||
<p v-if="tempDialogData.userName">{{tempDialogData.userName}}</p>
|
||||
</div>
|
||||
|
||||
<div class="textLayout">
|
||||
<p>创建时间:</p>
|
||||
<p v-if="tempDialogData.createTime">
|
||||
{{new Date(tempDialogData.updateTime).toLocaleDateString().replace(/\//g, "-") + " " + new Date(tempDialogData.updateTime).toTimeString().substr(0, 8)}}
|
||||
</p>
|
||||
</div>
|
||||
<div class="textLayout">
|
||||
<p>创建人:</p>
|
||||
<p v-if="tempDialogData.creator">{{tempDialogData.creatorName}}</p>
|
||||
</div>
|
||||
<div class="textLayout">
|
||||
<p>修改时间:</p>
|
||||
<p v-if="tempDialogData.updateTime">
|
||||
{{new Date(tempDialogData.updateTime).toLocaleDateString().replace(/\//g, "-") + " " + new Date(tempDialogData.updateTime).toTimeString().substr(0, 8)}}
|
||||
</p>
|
||||
</div>
|
||||
<div class="textLayout">
|
||||
<p>修改人:</p>
|
||||
<p v-if="tempDialogData.modifier">{{tempDialogData.modifierName}}</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="textLayout">
|
||||
<p>数据库类型:</p>
|
||||
<p v-if="tempDialogData.type">{{tempDialogData.type}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
数据错误 请重新尝试
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
|
||||
<el-button type="primary" @click="dialogVisible = false;tempDialogData=null">确 定</el-button>
|
||||
</span>
|
||||
|
||||
</el-dialog>
|
||||
<el-dialog :title="modificationId===null?'创建'+sourceType+'数据源':'修改'+sourceType+'数据源'"
|
||||
:visible.sync="modificationVisible" width="35%" :before-close="handleClose">
|
||||
<div>
|
||||
<div class="textLayout">
|
||||
<p>name:</p>
|
||||
<p>
|
||||
<el-input placeholder="名称" v-model="modificationData.name" clearable maxlength="20">
|
||||
</el-input>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="textLayout" v-if="sourceType == 'Spark'">
|
||||
<p>spark-home:</p>
|
||||
<p>
|
||||
<el-input placeholder="如:/opt/soft/spark-2.4.6-bin-hadoop2.7"
|
||||
v-model="modificationData.sparkHome" clearable>
|
||||
</el-input>
|
||||
</p>
|
||||
</div>
|
||||
<div class="textLayout" v-if="sourceType == 'Spark'">
|
||||
<p>app-name:</p>
|
||||
<p>
|
||||
<el-input placeholder="如:sparkTest" v-model="modificationData.appName" clearable>
|
||||
</el-input>
|
||||
</p>
|
||||
</div>
|
||||
<div class="textLayout" v-if="sourceType == 'Spark'">
|
||||
<p>master:</p>
|
||||
<p>
|
||||
<el-input placeholder="如:local[4]" v-model="modificationData.masterUrl" clearable>
|
||||
</el-input>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="textLayout" v-if="sourceType != 'Hive'&&sourceType!='Spark'">
|
||||
<p>host:</p>
|
||||
<p>
|
||||
<el-input placeholder="如:192.168.1.1" v-model="modificationData.host" clearable maxlength="20">
|
||||
</el-input>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="textLayout" v-if="sourceType == 'Hive'">
|
||||
<p>url:</p>
|
||||
<p>
|
||||
<el-input placeholder="请输入地址" v-model="modificationData.url" clearable maxlength="50">
|
||||
</el-input>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="textLayout" v-if="sourceType != 'Hive'&&sourceType!='Spark'">
|
||||
<p>port:</p>
|
||||
<p>
|
||||
<el-input :placeholder="sourceType=='Redis'?'如:6379':'如:3306'" v-model="modificationData.port"
|
||||
clearable maxlength="20">
|
||||
</el-input>
|
||||
</p>
|
||||
</div>
|
||||
<div class="textLayout" v-if="sourceType !='Hive'&&sourceType!='Spark'">
|
||||
<p>db:</p>
|
||||
<p v-if="sourceType =='MySQL'||sourceType =='Oracle'||sourceType =='Sqlserver'">
|
||||
<el-input placeholder="请输入数据库名称" v-model="modificationData.dbName" clearable maxlength="50">
|
||||
</el-input>
|
||||
</p>
|
||||
<p v-if="sourceType =='Redis'">
|
||||
<el-input placeholder="0~15" type="number" v-model="modificationData.dbName" clearable>
|
||||
</el-input>
|
||||
</p>
|
||||
</div>
|
||||
<div class="textLayout" v-if="sourceType!='Spark'">
|
||||
<p>user-name:</p>
|
||||
<p>
|
||||
<el-input placeholder="请输入用户名" v-model="modificationData.userName" clearable maxlength="50">
|
||||
</el-input>
|
||||
</p>
|
||||
</div>
|
||||
<div class="textLayout" v-if="sourceType!='Spark'">
|
||||
<p>password:</p>
|
||||
<p>
|
||||
<el-input placeholder="请输入密码" v-model="modificationData.password" clearable maxlength="50"
|
||||
auto-complete="new-password" show-password>
|
||||
</el-input>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
<el-button type="primary" @click="modificationSure">确 定</el-button>
|
||||
</span>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getDataSourcelist
|
||||
} from '../../api/index';
|
||||
import {
|
||||
setDataSource
|
||||
} from '../../api/index';
|
||||
import {
|
||||
deleteDataSource,
|
||||
updataDataSource
|
||||
} from '../../api/index';
|
||||
export default {
|
||||
name: 'datasource',
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
searchString: "",
|
||||
data: null,
|
||||
currentPage: null,
|
||||
dialogVisible: false,
|
||||
tempDialogData: null,
|
||||
pageNo: 1,
|
||||
modificationId: null,
|
||||
modificationVisible: false,
|
||||
modificationData: {
|
||||
name: "",
|
||||
host: "",
|
||||
url: "",
|
||||
port: "",
|
||||
dbName: "",
|
||||
userName: "",
|
||||
password: "",
|
||||
sparkHome: "",
|
||||
appName: "",
|
||||
masterUrl: ""
|
||||
},
|
||||
options: [{
|
||||
value: 'MySQL',
|
||||
label: 'MySQL'
|
||||
}, {
|
||||
value: 'Redis',
|
||||
label: 'Redis'
|
||||
}, {
|
||||
value: 'Hive',
|
||||
label: 'Hive'
|
||||
}, {
|
||||
value: 'Spark',
|
||||
label: 'Spark'
|
||||
}, {
|
||||
value: 'Oracle',
|
||||
label: 'Oracle'
|
||||
}, {
|
||||
value: 'Sqlserver',
|
||||
label: 'Sqlserver'
|
||||
}],
|
||||
sourceType: 'MySQL'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
let params = {
|
||||
pageNo: this.pageNo,
|
||||
pageSize: 10,
|
||||
typeList: [this.sourceType]
|
||||
}
|
||||
this.getDataSourcelists(params)
|
||||
},
|
||||
changeSource(e) {
|
||||
this.initData();
|
||||
},
|
||||
// 关闭弹窗所有弹窗 且清除临时数据
|
||||
handleClose() {
|
||||
this.dialogVisible = false
|
||||
this.modificationVisible = false
|
||||
|
||||
this.tempDialogData = null
|
||||
this.modificationData = {
|
||||
host: "",
|
||||
userName: "",
|
||||
dbName: "",
|
||||
name: "",
|
||||
password: "",
|
||||
port: "",
|
||||
}
|
||||
|
||||
this.modificationId = null
|
||||
},
|
||||
// 查看 弹窗显示
|
||||
dialogShow(index) {
|
||||
this.tempDialogData = this.data.data.data[index]
|
||||
this.dialogVisible = true
|
||||
},
|
||||
// 修改 弹窗显示
|
||||
modificationShow(id) {
|
||||
this.modificationId = id
|
||||
this.data.data.data.forEach(value => {
|
||||
if (value.id === id) {
|
||||
this.modificationData = {
|
||||
...value
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
this.modificationVisible = true
|
||||
},
|
||||
checkMySql() {
|
||||
if (this.modificationData.name.indexOf(' ') !== -1 || String(this.modificationData.host).indexOf(' ') !== -
|
||||
1 ||
|
||||
this.modificationData.userName.indexOf(' ') !== -1 || this.modificationData.password.indexOf(' ') !== -
|
||||
1 || this.modificationData
|
||||
.port.indexOf(' ') !== -1 || this.modificationData.dbName.indexOf(' ') !== -1) {
|
||||
this.$message.error('不允许出现空格!')
|
||||
return false;
|
||||
} else {
|
||||
if (this.modificationData.name.length < 4 || this.modificationData.host.length < 4 || this
|
||||
.modificationData.userName
|
||||
.length < 4 || this.modificationData.password.length < 4 || this.modificationData.port.length <
|
||||
4 || this.modificationData
|
||||
.dbName.length < 4) {
|
||||
this.$message.error('均为必填项且长度不小于4!')
|
||||
return false;
|
||||
} else {
|
||||
if (this.isChinese(this.modificationData.host) || this.isChinese(this.modificationData.userName) ||
|
||||
this.isChinese(this.modificationData.port)) {
|
||||
this.$message.error('主机地址,端口,用户名 不允许出现中文')
|
||||
return
|
||||
}
|
||||
|
||||
let params = {}
|
||||
params.name = this.modificationData.name
|
||||
params.host = this.modificationData.host
|
||||
params.userName = this.modificationData.userName
|
||||
params.password = this.modificationData.password
|
||||
params.port = this.modificationData.port
|
||||
params.dbName = this.modificationData.dbName
|
||||
return params;
|
||||
}
|
||||
}
|
||||
},
|
||||
checkRedis() {
|
||||
if (this.modificationData.name.indexOf(' ') !== -1 || String(this.modificationData.host).indexOf(' ') !== -
|
||||
1 ||
|
||||
this.modificationData.password.indexOf(' ') !== -1 || this.modificationData
|
||||
.port.indexOf(' ') !== -1 || this.modificationData.dbName.indexOf(' ') !== -1) {
|
||||
this.$message.error('不允许出现空格!')
|
||||
return false;
|
||||
} else {
|
||||
if (this.modificationData.name.length < 4 || this.modificationData.host.length < 4 || this
|
||||
.modificationData.password.length < 4 || this.modificationData.port.length < 4) {
|
||||
this.$message.error('均为必填项且长度不小于4!')
|
||||
return false;
|
||||
} else {
|
||||
if (this.isChinese(this.modificationData.host) || this.isChinese(this.modificationData.port)) {
|
||||
this.$message.error('主机地址,端口 不允许出现中文')
|
||||
return
|
||||
}
|
||||
if (this.modificationData.dbName < 0 || this.modificationData.dbName > 15) {
|
||||
this.$message.error('db超出有效范围!')
|
||||
return
|
||||
}
|
||||
console.log(this.modificationData.dbName);
|
||||
let params = {}
|
||||
params.name = this.modificationData.name
|
||||
params.host = this.modificationData.host
|
||||
params.userName = this.modificationData.userName
|
||||
params.password = this.modificationData.password
|
||||
params.port = this.modificationData.port
|
||||
params.dbName = this.modificationData.dbName ? this.modificationData.dbName : 0;
|
||||
return params;
|
||||
}
|
||||
}
|
||||
},
|
||||
checkHive() {
|
||||
|
||||
if (this.modificationData.name.indexOf(' ') !== -1 || this.modificationData.userName.indexOf(' ') !== -1 ||
|
||||
this.modificationData.password.indexOf(' ') !== -1 || this.modificationData
|
||||
.url.indexOf(' ') !== -1) {
|
||||
this.$message.error('不允许出现空格!')
|
||||
return false;
|
||||
} else {
|
||||
if (this.modificationData.name.length < 4 || this.modificationData.url.length < 4 || this
|
||||
.modificationData.password.length < 4 || this.modificationData.userName.length < 4) {
|
||||
this.$message.error('均为必填项且长度不小于4!')
|
||||
return false;
|
||||
} else {
|
||||
if (this.isChinese(this.modificationData.url) || this.isChinese(this.modificationData.userName)) {
|
||||
this.$message.error('连接地址,用户名 不允许出现中文')
|
||||
return false
|
||||
}
|
||||
|
||||
let params = {}
|
||||
params.name = this.modificationData.name
|
||||
params.url = this.modificationData.url
|
||||
params.userName = this.modificationData.userName
|
||||
params.password = this.modificationData.password
|
||||
return params;
|
||||
}
|
||||
}
|
||||
},
|
||||
checkSpark() {
|
||||
if (this.modificationData.name.indexOf(' ') !== -1 || this.modificationData.sparkHome.indexOf(' ') !== -
|
||||
1 ||
|
||||
this.modificationData.appName.indexOf(' ') !== -1 || this.modificationData.masterUrl.indexOf(' ') !== -
|
||||
1) {
|
||||
this.$message.error('不允许出现空格!')
|
||||
return false;
|
||||
} else {
|
||||
if (this.modificationData.name.length < 4 || this.modificationData.sparkHome.length < 4 || this
|
||||
.modificationData.appName.length < 4 || this.modificationData.masterUrl.length < 4) {
|
||||
this.$message.error('均为必填项且长度不小于4!')
|
||||
return false;
|
||||
} else {
|
||||
if (this.isChinese(this.modificationData.sparkHome) || this.isChinese(this.modificationData
|
||||
.appName) || this.isChinese(this.modificationData.masterUrl)) {
|
||||
this.$message.error('spark-home,app-name,master 不允许出现中文')
|
||||
return false
|
||||
}
|
||||
|
||||
let params = {}
|
||||
params.name = this.modificationData.name
|
||||
params.sparkHome = this.modificationData.sparkHome
|
||||
params.appName = this.modificationData.appName
|
||||
params.masterUrl = this.modificationData.masterUrl
|
||||
return params;
|
||||
}
|
||||
}
|
||||
},
|
||||
// 确定修改或者添加
|
||||
modificationSure() {
|
||||
let params = null;
|
||||
switch (this.sourceType) {
|
||||
case 'MySQL':
|
||||
params = this.checkMySql();
|
||||
break;
|
||||
case 'Redis':
|
||||
params = this.checkRedis();
|
||||
break;
|
||||
case 'Hive':
|
||||
params = this.checkHive();
|
||||
break;
|
||||
case 'Spark':
|
||||
params = this.checkSpark();
|
||||
break;
|
||||
case 'Oracle':
|
||||
params = this.checkMySql();
|
||||
break;
|
||||
case 'Sqlserver':
|
||||
params = this.checkMySql();
|
||||
break;
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
if (params) {
|
||||
params.type = this.sourceType;
|
||||
if (this.modificationId !== null) {
|
||||
params.id = this.modificationData.id
|
||||
this.updataDataSource(params).then(res => {
|
||||
if (res.status === "1") {
|
||||
this.data.data.data.forEach((value, index) => {
|
||||
if (value.id === this.modificationData.id) {
|
||||
console.log(value.id, this.modificationData.id)
|
||||
this.$set(this.data.data.data, index, {
|
||||
...this.modificationData
|
||||
})
|
||||
}
|
||||
})
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.handleClose()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
params.id = ""
|
||||
this.setDataSources(params).then(res => {
|
||||
if (res.status === "1") {
|
||||
// 创建成功方法
|
||||
this.initData();
|
||||
// this.pageNo = 1
|
||||
// this.getDataSourcelists({
|
||||
// pageNo: this.pageNo,
|
||||
// pageSize: 10
|
||||
// })
|
||||
this.$message({
|
||||
message: '创建成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.handleClose()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// }
|
||||
|
||||
// }
|
||||
// console.log(this.modificationData.name.indexOf(' '))
|
||||
},
|
||||
// 新增数据源
|
||||
async setDataSources(params) {
|
||||
this.loading = true
|
||||
const data = await setDataSource(params)
|
||||
this.loading = false
|
||||
return data
|
||||
},
|
||||
// 修改数据源信息
|
||||
async updataDataSource(params) {
|
||||
this.loading = true
|
||||
const data = await updataDataSource(params)
|
||||
this.loading = false;
|
||||
return data
|
||||
},
|
||||
createEngine() {
|
||||
this.modificationVisible = true
|
||||
},
|
||||
searchEngine() {},
|
||||
async getDataSourcelists(params) {
|
||||
this.loading = true
|
||||
const data = await getDataSourcelist(params)
|
||||
if (data.status === "1") {
|
||||
this.data = data
|
||||
this.pageSize = data.data.pager.pages
|
||||
} else {
|
||||
this.$message.error('访问出错了-_-');
|
||||
}
|
||||
this.loading = false
|
||||
},
|
||||
deletelistsor(id) {
|
||||
|
||||
this.$confirm('确定删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'error'
|
||||
}).then(() => {
|
||||
this.deletelists(id)
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
});
|
||||
});
|
||||
},
|
||||
deletelists(id) {
|
||||
this.deletelist(id).then(res => {
|
||||
if (res.status === "1") {
|
||||
this.initData();
|
||||
// this.getDataSourcelists({
|
||||
// pageNo: this.pageNo,
|
||||
// pageSize: 10
|
||||
// })
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
async deletelist(id) {
|
||||
this.loading = true
|
||||
return await deleteDataSource(id)
|
||||
this.loading = false
|
||||
},
|
||||
currpage(num) {
|
||||
this.pageNo = num
|
||||
this.getDataSourcelists({
|
||||
pageNo: this.pageNo,
|
||||
pageSize: 10,
|
||||
typeList:[this.sourceType]
|
||||
})
|
||||
console.log(this.pageNo)
|
||||
},
|
||||
isChinese(temp) {
|
||||
// var re = /[\u4E00-\u9FA5]|[\uFE30-\uFFA0]/gi;
|
||||
// if (re.test(temp)) {
|
||||
// console.log(temp)
|
||||
// return false
|
||||
// };
|
||||
// return true;
|
||||
if (escape(temp).indexOf("%u") < 0) {
|
||||
return false
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-pagination.is-background .btn-next,
|
||||
.el-pagination.is-background .btn-prev,
|
||||
.el-pagination.is-background .el-pager li {
|
||||
background-color: #fff !important;
|
||||
}
|
||||
|
||||
.el-pagination.is-background .el-pager li:not(.disabled).active {
|
||||
background-color: #409EFF !important;
|
||||
}
|
||||
|
||||
.textLayout {
|
||||
display: flex;
|
||||
font-size: 16px;
|
||||
height: 40px;
|
||||
padding-left: 30px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.textLayout>p {
|
||||
height: 100%;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.textLayout>p:nth-of-type(1) {
|
||||
width: 42%;
|
||||
text-align: right;
|
||||
margin-right: 20px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
.DataSource_look .textLayout>p:nth-of-type(2) {
|
||||
border-radius: 5px;
|
||||
line-height: 40px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.el-dialog {
|
||||
border-radius: 20px !important;
|
||||
}
|
||||
</style>
|
||||
119
h5-datax-manager/src/components/page/Datamanage.vue
Normal file
@@ -0,0 +1,119 @@
|
||||
<template>
|
||||
|
||||
<div>
|
||||
<cont title="指标管理" :getData="getDataFun"></cont>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import cont from '@/components/common/cont.vue'
|
||||
import {
|
||||
getfieldList,addfieldList,getfieldListTree,updatafieldList,getfieldsave,getfieldInfo,updatafield,fieldusing,fielddownTemplate,fieldupdata
|
||||
} from '@/api/index.js'
|
||||
|
||||
export default {
|
||||
name:'datamanage',
|
||||
components: {
|
||||
cont
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
getDataFun: {
|
||||
type:1,
|
||||
row: [ {
|
||||
label: '序号',
|
||||
row: 'id'
|
||||
}, {
|
||||
label: '字段名称',
|
||||
row: 'fieldEn'
|
||||
}, {
|
||||
label: '字段中文名',
|
||||
row: 'fieldCn'
|
||||
}, {
|
||||
label: '字段类型',
|
||||
row: 'valueType',
|
||||
type: 'type'
|
||||
}, {
|
||||
label: '状态',
|
||||
row: 'status',
|
||||
type: 'State'
|
||||
}, {
|
||||
label: '创建人',
|
||||
row: 'nickName'
|
||||
},{
|
||||
label: '创建时间',
|
||||
row: 'created',
|
||||
type: 'Time'
|
||||
} ],
|
||||
redact: "dataManageRedact",
|
||||
async getTree(e){
|
||||
return await getfieldListTree(e).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
async getlist(e) {
|
||||
e.fType = 1
|
||||
return await getfieldList(e).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
async addlist(e) {
|
||||
return await addfieldList(e).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
async updatalist(e) {
|
||||
|
||||
return await updatafieldList(e).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
async setsave(e) {
|
||||
|
||||
return await getfieldsave(e).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
async getInfo(e) {
|
||||
|
||||
// console.log(e)
|
||||
return await getfieldInfo(e).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
async updatafield(e) {
|
||||
|
||||
return await updatafield(e).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
async fieldusing(e) {
|
||||
|
||||
return await fieldusing(e).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
async down(e) {
|
||||
|
||||
return await fielddownTemplate(e).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
async fieldsubmit(e) {
|
||||
|
||||
return await fieldupdata(e).then(res => {
|
||||
return res
|
||||
})
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
124
h5-datax-manager/src/components/page/DeriveManage.vue
Normal file
@@ -0,0 +1,124 @@
|
||||
<template>
|
||||
<div>
|
||||
<cont title="衍生指标" :getData="getDataFun"></cont>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import cont from '@/components/common/cont.vue'
|
||||
import {
|
||||
getfieldList,
|
||||
addfieldList,
|
||||
getfieldListTree,
|
||||
updatafieldList,
|
||||
getfieldsave,
|
||||
getfieldInfo,
|
||||
updatafield,
|
||||
fieldusing,
|
||||
fielddownTemplate,
|
||||
fieldupdata
|
||||
} from '@/api/index.js'
|
||||
|
||||
export default {
|
||||
name:'derivemanage',
|
||||
components: {
|
||||
cont
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
getDataFun: {
|
||||
type: 3,
|
||||
row: [{
|
||||
label: '序号',
|
||||
row: 'id'
|
||||
}, {
|
||||
label: '字段名称',
|
||||
row: 'fieldEn'
|
||||
}, {
|
||||
label: '字段中文名',
|
||||
row: 'fieldCn'
|
||||
}, {
|
||||
label: '字段类型',
|
||||
row: 'valueType',
|
||||
type:'type'
|
||||
}, {
|
||||
label: '状态',
|
||||
row: 'status',
|
||||
type: 'State'
|
||||
}, {
|
||||
label: '创建人',
|
||||
row: 'nickName'
|
||||
}, {
|
||||
label: '创建时间',
|
||||
row: 'created',
|
||||
type: 'Time'
|
||||
}, ],
|
||||
redact: "dataManageRedact",
|
||||
async getTree(e){
|
||||
return await getfieldListTree(e).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
async getlist(e) {
|
||||
e.fType = 3
|
||||
return await getfieldList(e).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
async addlist(e) {
|
||||
|
||||
return await addfieldList(e).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
async updatalist(e) {
|
||||
|
||||
return await updatafieldList(e).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
async setsave(e) {
|
||||
|
||||
return await getfieldsave(e).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
async getInfo(e) {
|
||||
|
||||
return await getfieldInfo(e).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
async updatafield(e) {
|
||||
|
||||
return await updatafield(e).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
async fieldusing(e) {
|
||||
|
||||
return await fieldusing(e).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
async down(e) {
|
||||
|
||||
return await fielddownTemplate(e).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
async fieldsubmit(e) {
|
||||
|
||||
return await fieldupdata(e).then(res => {
|
||||
return res
|
||||
})
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
247
h5-datax-manager/src/components/page/FieldStatistics.vue
Normal file
@@ -0,0 +1,247 @@
|
||||
<template>
|
||||
<div style="height: 100%;overflow: scroll;">
|
||||
<div style="background-color: #fff;border-radius: 10px;padding: 10px;">
|
||||
<span style="font-size: 20px;font-weight: bold;">
|
||||
计算指标统计:
|
||||
</span>
|
||||
<div>
|
||||
<div v-for="value in from" style="border-top:1px dotted #ddd;margin-top: 20px;" v-loading="value.loading">
|
||||
{{value.name}}
|
||||
<div style="display: flex;justify-content: flex-end;">
|
||||
|
||||
<el-input v-model="value.searchKey" placeholder="请输入搜索" size="mini"
|
||||
style="width: 200px;margin-right: 20px;"></el-input>
|
||||
|
||||
<el-date-picker v-model="value.time" type="daterange" range-separator="至"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期" size="mini" style="margin-right: 20px;">
|
||||
</el-date-picker>
|
||||
|
||||
<el-button icon="el-icon-search" circle size="mini" @click="getData(value)"></el-button>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div style="display: flex;flex-wrap: wrap;margin: 10px;">
|
||||
<div v-for="item in value.data">
|
||||
<div
|
||||
style="display: flex;font-size: 14px;border-right: 1px solid #ddd;align-items: center;">
|
||||
<div style="width: 200px;text-align: center;">
|
||||
<el-button type="text" @click="getlogData(value,item.id)" :disabled="!item.callCount">{{item.fieldCn}}</el-button>
|
||||
<!-- <el-button type="text" @click="getlogData(value)" :disabled="!item.callCount">{{item.fieldCn}}</el-button> -->
|
||||
</div>
|
||||
:
|
||||
<div style="width: 150px;text-align: center;" >{{item.callCount}}次</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div style="display: flex;justify-content: flex-end;padding-right: 20px;padding-top: 20px;">
|
||||
<el-pagination @size-change="getData(value)" @current-change="getData(value)"
|
||||
:current-page.sync="value.pageNum" :page-sizes="[10,100, 200, 300, 400]"
|
||||
:page-size.sync="value.pageSize" layout="sizes, prev, pager, next" :total="value.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog title="调用日志" :visible.sync="dialogVisible" width="40%" :close-on-click-modal="false"
|
||||
@close="resetlogfrom">
|
||||
|
||||
<div v-loading="logfrom.loading">
|
||||
<el-table :data="logfrom.data" style="width: 100%">
|
||||
<el-table-column prop="duration" label="耗时/ms" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="调用时间" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{new Date(scope.row.createTime).format('yyyy-MM-dd hh:mm:ss')}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="fieldValue" label="调用结果" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="请求参数" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showinputParam(scope.row.inputParam)">查看入参</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="display: flex;justify-content: flex-end;padding-right: 20px;">
|
||||
<el-pagination layout="prev, pager, next" :current-page.sync="logfrom.pageNum" @current-change="getlogData(logfrom)" :total="logfrom.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
||||
<el-dialog width="60%" title="查看入参" :visible.sync="innerVisible" append-to-body @close="inputParam=''">
|
||||
<div>
|
||||
<el-input type="textarea" :rows="20" placeholder="" v-model="inputParam" disabled>
|
||||
</el-input>
|
||||
</div>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getFieldCallList,
|
||||
getFieldCallLogList
|
||||
} from '@/api/index.js'
|
||||
const logfromOr = {
|
||||
"loading":false,
|
||||
"data": [],
|
||||
"pageSize": 10,
|
||||
"pageNum": 1,
|
||||
"total": 0,
|
||||
time:[],
|
||||
fieldType:'',
|
||||
fieldCn:'',
|
||||
fieldId:0
|
||||
}
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
from: [{
|
||||
"loading":false,
|
||||
"name": '数据源指标统计:',
|
||||
"time": [new Date().getTomorrow(-1), new Date()],
|
||||
"fieldType": 2,
|
||||
"searchKey": "",
|
||||
"data": [],
|
||||
"pageSize": 10,
|
||||
"pageNum": 1,
|
||||
"total": 0
|
||||
},
|
||||
{
|
||||
"loading":false,
|
||||
"name": '接口指标统计:',
|
||||
"time": [new Date().getTomorrow(-1), new Date()],
|
||||
"fieldType": 4,
|
||||
"searchKey": "",
|
||||
"data": [],
|
||||
"pageSize": 10,
|
||||
"pageNum": 1,
|
||||
"total": 0
|
||||
},
|
||||
{
|
||||
"loading":false,
|
||||
"name": '衍生指标统计:',
|
||||
"time": [new Date().getTomorrow(-1), new Date()],
|
||||
"fieldType": 3,
|
||||
"searchKey": "",
|
||||
"data": [],
|
||||
"pageSize": 10,
|
||||
"pageNum": 1,
|
||||
"total": 0
|
||||
},
|
||||
],
|
||||
logfrom: Object.assign({}, JSON.parse(JSON.stringify(logfromOr))),
|
||||
dialogVisible: false,
|
||||
inputParam: '',
|
||||
innerVisible: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.from.forEach(value => {
|
||||
this.getData(value)
|
||||
})
|
||||
|
||||
},
|
||||
methods: {
|
||||
resetlogfrom() {
|
||||
this.logfrom = Object.assign({}, JSON.parse(JSON.stringify(logfromOr)))
|
||||
},
|
||||
getData(param) {
|
||||
param.loading = true
|
||||
getFieldCallList({
|
||||
"entity": {
|
||||
"queryTimeStart": new Date(param.time[0]),
|
||||
"queryTimeEnd": new Date(param.time[1]),
|
||||
"fieldType": param.fieldType,
|
||||
"searchKey": param.searchKey
|
||||
},
|
||||
"pageSize": param.pageSize,
|
||||
"pageNum": param.pageNum
|
||||
|
||||
}).then(res => {
|
||||
if (res.status == '1') {
|
||||
param.total = res.data.total
|
||||
param.data = res.data.list
|
||||
}
|
||||
param.loading = false
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
showinputParam(inputParam) {
|
||||
// console.log(inputParam)
|
||||
this.inputParam = JSON.stringify(JSON.parse(inputParam), null, 4)
|
||||
// console.log(this.inputParam)
|
||||
this.innerVisible = true
|
||||
},
|
||||
getlogData(param,id) {
|
||||
console.log(param)
|
||||
this.dialogVisible = true
|
||||
this.logfrom.loading=true
|
||||
getFieldCallLogList({
|
||||
"entity": {
|
||||
"queryTimeStart": new Date(param.time[0]),
|
||||
"queryTimeEnd": new Date(param.time[1]),
|
||||
"fieldType": param.fieldType,
|
||||
"fieldId":id
|
||||
},
|
||||
"pageSize": this.logfrom.pageSize,
|
||||
"pageNum": this.logfrom.pageNum
|
||||
|
||||
}).then(res => {
|
||||
if (res.status == '1') {
|
||||
this.logfrom.total = res.data.total
|
||||
this.logfrom.data = res.data.list
|
||||
this.logfrom.time = JSON.parse(JSON.stringify(param.time))
|
||||
this.logfrom.fieldType = param.fieldType
|
||||
this.logfrom.fieldCn = param.fieldCn
|
||||
this.logfrom.fieldId = id
|
||||
|
||||
|
||||
|
||||
}
|
||||
this.logfrom.loading=false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||