Merge remote-tracking branch 'origin/master'
commit
00167769d7
12
package.json
12
package.json
|
@ -36,15 +36,27 @@
|
||||||
"url": "https://gitee.com/y_project/MuYu-Cloud.git"
|
"url": "https://gitee.com/y_project/MuYu-Cloud.git"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@antv/x6": "^2.18.1",
|
||||||
|
"@antv/x6-plugin-clipboard": "^2.1.6",
|
||||||
|
"@antv/x6-plugin-history": "^2.2.4",
|
||||||
|
"@antv/x6-plugin-keyboard": "^2.2.3",
|
||||||
|
"@antv/x6-plugin-selection": "^2.2.2",
|
||||||
|
"@antv/x6-plugin-snapline": "^2.1.7",
|
||||||
|
"@antv/x6-plugin-stencil": "^2.1.5",
|
||||||
|
"@antv/x6-plugin-transform": "^2.1.8",
|
||||||
|
"@antv/x6-vue-shape": "^2.1.2",
|
||||||
"@riophae/vue-treeselect": "0.4.0",
|
"@riophae/vue-treeselect": "0.4.0",
|
||||||
|
"@vue/composition-api": "^1.7.2",
|
||||||
"axios": "0.24.0",
|
"axios": "0.24.0",
|
||||||
"clipboard": "2.0.8",
|
"clipboard": "2.0.8",
|
||||||
|
"codemirror": "^5.65.12",
|
||||||
"core-js": "3.25.3",
|
"core-js": "3.25.3",
|
||||||
"echarts": "5.4.0",
|
"echarts": "5.4.0",
|
||||||
"element-ui": "^2.15.14",
|
"element-ui": "^2.15.14",
|
||||||
"file-saver": "2.0.5",
|
"file-saver": "2.0.5",
|
||||||
"fuse.js": "6.4.3",
|
"fuse.js": "6.4.3",
|
||||||
"highlight.js": "9.18.5",
|
"highlight.js": "9.18.5",
|
||||||
|
"insert-css": "^2.0.0",
|
||||||
"js-beautify": "1.13.0",
|
"js-beautify": "1.13.0",
|
||||||
"js-cookie": "3.0.1",
|
"js-cookie": "3.0.1",
|
||||||
"jsencrypt": "3.0.0-rc.1",
|
"jsencrypt": "3.0.0-rc.1",
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 33 KiB |
11
src/App.vue
11
src/App.vue
|
@ -10,7 +10,7 @@ import ThemePicker from "@/components/ThemePicker";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "App",
|
name: "App",
|
||||||
components: {ThemePicker},
|
components: { ThemePicker },
|
||||||
metaInfo() {
|
metaInfo() {
|
||||||
return {
|
return {
|
||||||
title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
|
title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
|
||||||
|
@ -25,4 +25,13 @@ export default {
|
||||||
#app .theme-picker {
|
#app .theme-picker {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#app {
|
||||||
|
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
color: #2c3e50;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -9,7 +9,7 @@ export function selectEngineList(data){
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//添加规则数据
|
||||||
export function insert(data){
|
export function insert(data){
|
||||||
return request({
|
return request({
|
||||||
url: "/engine/engine/insert",
|
url: "/engine/engine/insert",
|
||||||
|
@ -17,14 +17,8 @@ export function insert(data){
|
||||||
data:data
|
data:data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
export function inserts(data){
|
|
||||||
return request({
|
|
||||||
url: "/engine/engine/insert",
|
|
||||||
method: "post",
|
|
||||||
data:data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//修改规则数据
|
||||||
export function update(data){
|
export function update(data){
|
||||||
return request({
|
return request({
|
||||||
url: "/engine/engine/update",
|
url: "/engine/engine/update",
|
||||||
|
@ -33,8 +27,7 @@ export function update(data){
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//通过id删除数据
|
||||||
|
|
||||||
export function del(id){
|
export function del(id){
|
||||||
return request({
|
return request({
|
||||||
url: "/engine/engine/delete/" + id,
|
url: "/engine/engine/delete/" + id,
|
||||||
|
@ -43,7 +36,23 @@ export function del(id){
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//开启
|
||||||
|
export function onEngine(id){
|
||||||
|
return request({
|
||||||
|
url: "/engine/version/open/" + id,
|
||||||
|
method: "post"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//禁用
|
||||||
|
export function forbiddenEngine(id){
|
||||||
|
return request({
|
||||||
|
url: "/engine/version/close/" + id,
|
||||||
|
method: "post"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//查看等级列表信息
|
||||||
export function selectLevel(){
|
export function selectLevel(){
|
||||||
return request({
|
return request({
|
||||||
url: "/engine/level/selectLevelList",
|
url: "/engine/level/selectLevelList",
|
||||||
|
@ -59,4 +68,52 @@ export function getRuleEngineInfo(id) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 通过id查询
|
||||||
|
export function findById(id) {
|
||||||
|
return request({
|
||||||
|
url: '/engine/engine/findByIdsfindByIds/' + id,
|
||||||
|
method:'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//通过id删除数据
|
||||||
|
export function dels(id) {
|
||||||
|
return request({
|
||||||
|
url: '/engine/version/delete/' + id,
|
||||||
|
method: 'post',
|
||||||
|
data: id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//天机规则数据
|
||||||
|
export function add(data){
|
||||||
|
return request({
|
||||||
|
url: "/engine/version/insertVersion",
|
||||||
|
method: "post",
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export function selectEngineById(id){
|
||||||
|
return request({
|
||||||
|
url: "/engine/engine/selectEngineById/" + id,
|
||||||
|
method: "post",
|
||||||
|
data:id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据版本id查询版本信息
|
||||||
|
export function sel(id){
|
||||||
|
return request({
|
||||||
|
url: "/engine/version/selectListById/" + id,
|
||||||
|
method: "post"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,5 @@
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export function getPhonePlace(tel) {
|
|
||||||
return request({
|
|
||||||
url: '/mart/list/getPhonePlace?tel='+tel,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function findConnectorList(data) {
|
export function findConnectorList(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/mart/connector/findConnectorList',
|
url: '/mart/connector/findConnectorList',
|
||||||
|
@ -14,6 +7,13 @@ export function findConnectorList(data) {
|
||||||
data:data
|
data:data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function findApiList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mart/connector/findApiList',
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
export function addConnector(data) {
|
export function addConnector(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/mart/connector/addConnector',
|
url: '/mart/connector/addConnector',
|
||||||
|
@ -36,5 +36,61 @@ export function updateConnector(data) {
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data:data
|
data:data
|
||||||
})
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
export function phonePlace(tel) {
|
||||||
|
return request({
|
||||||
|
url: '/port/list/phonePlace?tel='+tel,
|
||||||
|
method: 'GET'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getIpPlace(ip) {
|
||||||
|
return request({
|
||||||
|
url: '/port/list/getIpPlace?ip='+ip,
|
||||||
|
method: 'GET'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function getHeadlines() {
|
||||||
|
return request({
|
||||||
|
url: '/port/list/getHeadlines',
|
||||||
|
method: 'GET'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function getBirthday(data) {
|
||||||
|
return request({
|
||||||
|
url: '/port/list/getBirthday',
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getPostcode(code) {
|
||||||
|
return request({
|
||||||
|
url: '/port/list/getPostcode?code='+code,
|
||||||
|
method: 'GET'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function getWeather() {
|
||||||
|
return request({
|
||||||
|
url: '/port/list/getWeather',
|
||||||
|
method: 'GET'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//购买
|
||||||
|
export function doBuyInterface(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/buy/doBuyInterface',
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//资产列表
|
||||||
|
export function findConnectorUserList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mart/connector/findConnectorUserList',
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -12,6 +12,15 @@ export function listUser(query) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//充值用户记录
|
||||||
|
export function userPayinfo(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/user/userPayinfo',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 充值用户余额
|
// 充值用户余额
|
||||||
export function userRecharge(data) {
|
export function userRecharge(data) {
|
||||||
return request({
|
return request({
|
||||||
|
@ -21,6 +30,42 @@ export function userRecharge(data) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 调用第三方实名认证
|
||||||
|
export function checkRealNameAuth(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/aliyun/pay/doPost',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 发送验证码
|
||||||
|
export function sendCode(phonenumber) {
|
||||||
|
return request({
|
||||||
|
url: '/system/aliyun/pay/sendCode/' + phonenumber,
|
||||||
|
method: 'post',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//检查验证码
|
||||||
|
export function checkCode(phonenumber,code) {
|
||||||
|
return request({
|
||||||
|
url: '/system/aliyun/pay/checkCode/'+ phonenumber +"/" + code,
|
||||||
|
method: 'post',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 充值用户余额记录
|
||||||
|
export function createRechargeRecord(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/aliyun/pay/records',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 查询用户余额
|
// 查询用户余额
|
||||||
export function userBalance(userId) {
|
export function userBalance(userId) {
|
||||||
return request({
|
return request({
|
||||||
|
@ -63,6 +108,15 @@ export function delUser(userId) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//修改手机号
|
||||||
|
export function updatePhone(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/user/profile/updatePhonenumber/'+data,
|
||||||
|
method: 'POST'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 用户密码重置
|
// 用户密码重置
|
||||||
export function resetUserPwd(userId, password) {
|
export function resetUserPwd(userId, password) {
|
||||||
const data = {
|
const data = {
|
||||||
|
|
|
@ -60,4 +60,32 @@ export function findStructureList(tableId) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//添加节点任务记录
|
||||||
|
export function addTaskInput(data) {
|
||||||
|
return request({
|
||||||
|
url: "/task/taskInput/addTaskInput",
|
||||||
|
method: "POST",
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据节点id查询信息
|
||||||
|
export function findByNodeId(nodeId) {
|
||||||
|
return request({
|
||||||
|
url: "/task/taskInput/findByNodeId/"+nodeId,
|
||||||
|
method: "get",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//联查记录添加
|
||||||
|
export function addTaskJoin(data) {
|
||||||
|
return request({
|
||||||
|
url: "/task/taskJoin/addTaskJoin/",
|
||||||
|
method: "POST",
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
//查询规则引擎列表
|
||||||
|
export function list(){
|
||||||
|
return request({
|
||||||
|
url: "/engine/type/list",
|
||||||
|
method: "post"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//添加类型数据
|
||||||
|
export function insert(data){
|
||||||
|
return request({
|
||||||
|
url: "/engine/type/add",
|
||||||
|
method: "post",
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改类型数据
|
||||||
|
export function update(data){
|
||||||
|
return request({
|
||||||
|
url: "/engine/type/update",
|
||||||
|
method: "post",
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除类型数据
|
||||||
|
export function del(id){
|
||||||
|
return request({
|
||||||
|
url: "/engine/type/delete/" + id,
|
||||||
|
method: "post",
|
||||||
|
data:id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//导出类型数据
|
||||||
|
export function exports(data){
|
||||||
|
return request({
|
||||||
|
url: "/engine/type/export",
|
||||||
|
method: "post",
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -9,9 +9,7 @@ export function list(data){
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//添加规则引擎版本数据
|
||||||
|
|
||||||
|
|
||||||
export function insert(data){
|
export function insert(data){
|
||||||
return request({
|
return request({
|
||||||
url: "/engine/version/insert",
|
url: "/engine/version/insert",
|
||||||
|
@ -20,16 +18,7 @@ export function insert(data){
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// export function update(data){
|
//删除规则引擎版本信息
|
||||||
// return request({
|
|
||||||
// url: "/engine/engine/update",
|
|
||||||
// method: "post",
|
|
||||||
// data:data
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export function del(id){
|
export function del(id){
|
||||||
return request({
|
return request({
|
||||||
url: "/engine/version/delete/" + id,
|
url: "/engine/version/delete/" + id,
|
||||||
|
@ -38,7 +27,7 @@ export function del(id){
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//查看等级列表
|
||||||
export function selectLevel(){
|
export function selectLevel(){
|
||||||
return request({
|
return request({
|
||||||
url: "/engine/level/selectLevelList",
|
url: "/engine/level/selectLevelList",
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 5.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 117 KiB |
Binary file not shown.
After Width: | Height: | Size: 170 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.9 MiB |
|
@ -1 +0,0 @@
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 201 201"><defs><style>.cls-1{fill:#d8f4e9;}.cls-2{fill:#3ec791;}.cls-3{opacity:0;}.cls-4,.cls-5{fill:none;stroke:#092370;stroke-miterlimit:10;}.cls-5{stroke-width:0.83px;}</style></defs><title>1.开始</title><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><rect class="cls-1" x="44.97" y="55.64" width="111.13" height="91.88" rx="0.87" ry="0.87"/><polygon class="cls-2" points="85.38 78 85.38 125.16 125.79 101.58 85.38 78"/><g class="cls-3"><path class="cls-4" d="M100.5.5h0a100,100,0,0,1,100,100h0a100,100,0,0,1-100,100h0a100,100,0,0,1-100-100h0A100,100,0,0,1,100.5.5Z"/><rect class="cls-4" x="33.83" y="33.83" width="133.33" height="133.33"/><rect class="cls-5" x="44.93" y="44.93" width="111.13" height="111.13"/></g></g></g></svg>
|
|
Before Width: | Height: | Size: 820 B |
|
@ -0,0 +1,57 @@
|
||||||
|
<template>
|
||||||
|
<codemirror ref="mycode" :value="curCode" :options="cmOptions" class="code" v-show="aaa">
|
||||||
|
</codemirror>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { codemirror } from 'vue-codemirror'
|
||||||
|
import "codemirror/theme/ambiance.css"; // 这里引入的是主题样式,根据设置的theme的主题引入,一定要引入!!
|
||||||
|
require("codemirror/mode/javascript/javascript"); // 这里引入的模式的js,根据设置的mode引入,一定要引入!!
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ExecuteAction',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
curCode: '测试',
|
||||||
|
cmOptions: {
|
||||||
|
// autorefresh: true,
|
||||||
|
// tabSize: 4,
|
||||||
|
// mode: 'text/x-properties',
|
||||||
|
// theme: 'ayu-mirage',
|
||||||
|
// line: true,
|
||||||
|
// viewportMargin: Infinity, //处理高度自适应时搭配使用
|
||||||
|
// highlightDifferences: true,
|
||||||
|
// autofocus: false,
|
||||||
|
// indentUnit: 2,
|
||||||
|
// smartIndent: true,
|
||||||
|
// readOnly: true, // 只读
|
||||||
|
// showCursorWhenSelecting: true,
|
||||||
|
// firstLineNumber: 1
|
||||||
|
lineNumbers: true, // 显示行号
|
||||||
|
mode: 'text/x-yaml', // 语法model
|
||||||
|
gutters: ['CodeMirror-lint-markers'], // 语法检查器
|
||||||
|
theme: "ambiance",
|
||||||
|
lint: true, // 开启语法检查
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
codemirror
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.information-box>>>.CodeMirror {
|
||||||
|
font-family: monospace;
|
||||||
|
height: 71vh;
|
||||||
|
direction: ltr;
|
||||||
|
}
|
||||||
|
</style>
|
17
src/main.js
17
src/main.js
|
@ -1,6 +1,23 @@
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
|
|
||||||
import Cookies from 'js-cookie'
|
import Cookies from 'js-cookie'
|
||||||
|
//引入文件、、
|
||||||
|
import VueCodeMirror from 'vue-codemirror'
|
||||||
|
import 'codemirror/lib/codemirror.css'
|
||||||
|
Vue.use(VueCodeMirror)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
//codemirror
|
||||||
|
import VueCodemirror from 'vue-codemirror'
|
||||||
|
import 'codemirror/lib/codemirror.css'
|
||||||
|
Vue.use(VueCodemirror)
|
||||||
|
|
||||||
|
import 'codemirror/lib/codemirror.css'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import Element from 'element-ui'
|
import Element from 'element-ui'
|
||||||
import './assets/styles/element-variables.scss'
|
import './assets/styles/element-variables.scss'
|
||||||
|
|
|
@ -47,7 +47,7 @@ export const constantRoutes = [
|
||||||
children: [// 父级路由下面还有子路由
|
children: [// 父级路由下面还有子路由
|
||||||
{
|
{
|
||||||
path: 'index/:id',// 这个index可以自己定义
|
path: 'index/:id',// 这个index可以自己定义
|
||||||
component: () => import('@/views/task/task/easyFlow.vue'),
|
component: () => import('@/views/task/task/antvX6.vue'),
|
||||||
name: "easyFlow",
|
name: "easyFlow",
|
||||||
meta: { title: '设计', icon: 'dashboard', activeMenu: '/task/task' }
|
meta: { title: '设计', icon: 'dashboard', activeMenu: '/task/task' }
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,12 +7,12 @@ module.exports = {
|
||||||
/**
|
/**
|
||||||
* 是否系统布局配置
|
* 是否系统布局配置
|
||||||
*/
|
*/
|
||||||
showSettings: false,
|
showSettings: true,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否显示顶部导航
|
* 是否显示顶部导航
|
||||||
*/
|
*/
|
||||||
topNav: false,
|
topNav: true,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否显示 tagsView
|
* 是否显示 tagsView
|
||||||
|
@ -22,7 +22,7 @@ module.exports = {
|
||||||
/**
|
/**
|
||||||
* 是否固定头部
|
* 是否固定头部
|
||||||
*/
|
*/
|
||||||
fixedHeader: false,
|
fixedHeader: true,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否显示logo
|
* 是否显示logo
|
||||||
|
@ -32,7 +32,7 @@ module.exports = {
|
||||||
/**
|
/**
|
||||||
* 是否显示动态标题
|
* 是否显示动态标题
|
||||||
*/
|
*/
|
||||||
dynamicTitle: false,
|
dynamicTitle: true,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {string | array} 'production' | ['production', 'development']
|
* @type {string | array} 'production' | ['production', 'development']
|
||||||
|
|
|
@ -0,0 +1,292 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!-- 添加任务详情设计-->
|
||||||
|
<span v-if="taskInputForm">
|
||||||
|
<el-form label-width="80px" :model="tableInfo" ref="queryForm" :inline="true" class="demo-form-inline" size="small">
|
||||||
|
<el-form-item label="任务id">
|
||||||
|
<el-input v-model="tableInfo.taskId" readonly></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="数据库id">
|
||||||
|
<el-input v-model="tableInfo.databaseId" readonly></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-select v-model="tableInfo.tableName" placeholder="请选择数据库">
|
||||||
|
<el-option style="height: 100%" :value="tableInfo.tableName">
|
||||||
|
<el-aside width="100%">
|
||||||
|
<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
|
||||||
|
</el-aside>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="表别名">
|
||||||
|
<el-input v-model="tableInfo.tableAsName"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="taskInputAdd = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="addTaskInput()">下一步</el-button>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!-- 所选表内的字段信息-->
|
||||||
|
<span v-if="taskInputTable">
|
||||||
|
<el-table
|
||||||
|
ref="multipleTable"
|
||||||
|
:data="tableInfo.structureList"
|
||||||
|
style="width: 100%"
|
||||||
|
@selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="100%"></el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column label="字段" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.columnName }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="注释" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.columnRemark }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="是否主键" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.isPrimary }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="字段类型" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.columnType }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="字段长度" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.columnLength }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="小数" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.columnDecimals }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="非空" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.isNull }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="默认值" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.defaultValue }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="是否字典" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.isDictionary }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="处理规则" width="200">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-select v-model="taskInputReq.fieldAsEngineId" multiple placeholder="请选择">
|
||||||
|
<el-option value="">请选择</el-option>
|
||||||
|
<el-option
|
||||||
|
v-for="engine in engineList"
|
||||||
|
:key="engine.id"
|
||||||
|
:label="engine.name"
|
||||||
|
:value="engine.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="字段别名"
|
||||||
|
width="200">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.tableAsField = tableInfo.tableAsName+'_'+scope.row.columnName"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="cancelColumn()">上一步</el-button>
|
||||||
|
<el-button type="primary" @click="columnAddGood()">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { addTaskInput} from '@/api/task/task'
|
||||||
|
import { findStructureByTableId, findTableInfoList } from '@/api/etl/switch'
|
||||||
|
import { selectEngineList } from '@/api/engine/engine'
|
||||||
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||||
|
//例如:import 《组件名称》 from '《组件路径》,
|
||||||
|
export default {
|
||||||
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
|
components: {},
|
||||||
|
props:['graph','nodeId','taskInputForm','tableInfo','nodeName'],
|
||||||
|
data() {
|
||||||
|
//这里存放数据"
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
taskInputJoin:false,
|
||||||
|
dialogFormVisible:true,
|
||||||
|
//任务设计添加表弹窗
|
||||||
|
taskInputAdd:false,
|
||||||
|
//选择字段弹窗
|
||||||
|
taskInputFieldAdd:false,
|
||||||
|
taskInputTable:false,
|
||||||
|
taskReq:{
|
||||||
|
|
||||||
|
},
|
||||||
|
joinSelect:{},
|
||||||
|
taskAddReq:{},
|
||||||
|
taskInputReq:{},
|
||||||
|
engineReq:{
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 100
|
||||||
|
},
|
||||||
|
taskList:[],
|
||||||
|
//级联选择器
|
||||||
|
value:[],
|
||||||
|
|
||||||
|
engineList:[],
|
||||||
|
|
||||||
|
//树状图
|
||||||
|
data:[],
|
||||||
|
defaultProps:{
|
||||||
|
children:"children",
|
||||||
|
label:'tableName'
|
||||||
|
},
|
||||||
|
|
||||||
|
tableList:[],
|
||||||
|
columnList:[],
|
||||||
|
structureList:[],
|
||||||
|
itemId:0,
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//计算属性 类似于data概念",
|
||||||
|
computed: {},
|
||||||
|
//监控data中的数据变化",
|
||||||
|
watch: {},
|
||||||
|
//方法集合",
|
||||||
|
methods: {
|
||||||
|
//规则引擎下拉框
|
||||||
|
selectEngineList(){
|
||||||
|
selectEngineList(this.engineReq).then(res=>{
|
||||||
|
this.engineList = res.data.list;
|
||||||
|
console.log(this.engineList);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//关闭字段信息
|
||||||
|
cancelColumn(){
|
||||||
|
this.taskInputTable = false;
|
||||||
|
this.taskInputForm = true;
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
//确定选择的字段
|
||||||
|
columnAddGood(){
|
||||||
|
this.taskInputTable = false;
|
||||||
|
this.tableInfo.fieldAsEngineId = "[{1,3,4},{1,2,3}]";
|
||||||
|
this.$emit('taskInputForm', false);
|
||||||
|
addTaskInput({
|
||||||
|
"nodeId":this.nodeId,
|
||||||
|
"nodeName":this.nodeName,
|
||||||
|
"taskId":this.tableInfo.taskId,
|
||||||
|
"databaseId":this.tableInfo.parentId,
|
||||||
|
"tableName":this.tableInfo.tableName,
|
||||||
|
"tableAsName":this.tableInfo.tableAsName,
|
||||||
|
"tableField": this.tableInfo.tableField.substring(1),
|
||||||
|
"tableAsField":this.tableInfo.tableAsField.substring(1),
|
||||||
|
"fieldAsEngineId":this.tableInfo.fieldAsEngineId
|
||||||
|
}).then(res=>{
|
||||||
|
|
||||||
|
alert(res.msg);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//选择完下拉框的表后点击下一步
|
||||||
|
addTaskInput(){
|
||||||
|
this.taskInputForm = false;
|
||||||
|
this.selectEngineList();
|
||||||
|
this.taskInputTable = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
//选中需要的字段后将需要的值赋在tableInfo中
|
||||||
|
handleSelectionChange(val) {
|
||||||
|
if(val.length<=0){
|
||||||
|
val = this.tableInfo.columnList;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.tableInfo.tableField = "";
|
||||||
|
this.tableInfo.tableAsField = "";
|
||||||
|
val.forEach(item=>{
|
||||||
|
this.tableInfo.tableField +=','+ item.columnName;
|
||||||
|
this.tableInfo.tableAsField +=','+ item.tableAsField;
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log(this.tableInfo.tableField);
|
||||||
|
},
|
||||||
|
|
||||||
|
//根据树状下拉的选择赋值字段信息
|
||||||
|
handleNodeClick(data) {
|
||||||
|
this.tableInfo = data;
|
||||||
|
findStructureByTableId(data.id).then((res)=>{
|
||||||
|
this.tableInfo.structureList=res.data;
|
||||||
|
})
|
||||||
|
this.tableInfo.taskId = this.$route.params.id;
|
||||||
|
const cellById = this.graph.getCellById(this.nodeId)
|
||||||
|
cellById.setData(this.tableInfo);
|
||||||
|
},
|
||||||
|
|
||||||
|
//弹出选择表界面给树状下拉框赋值
|
||||||
|
findTAbleInfoList(){
|
||||||
|
findTableInfoList().then(res=>{
|
||||||
|
this.data=res.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
created() {
|
||||||
|
this.findTAbleInfoList();
|
||||||
|
this.tableInfo.taskId = this.$route.params.id;
|
||||||
|
},
|
||||||
|
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
beforeCreate() {
|
||||||
|
}, //生命周期 - 创建之前",
|
||||||
|
beforeMount() {
|
||||||
|
}, //生命周期 - 挂载之前",
|
||||||
|
beforeUpdate() {
|
||||||
|
}, //生命周期 - 更新之前",
|
||||||
|
updated() {
|
||||||
|
}, //生命周期 - 更新之后",
|
||||||
|
beforeDestroy() {
|
||||||
|
}, //生命周期 - 销毁之前",
|
||||||
|
destroyed() {
|
||||||
|
}, //生命周期 - 销毁完成",
|
||||||
|
activated() {
|
||||||
|
} //如果页面有keep-alive缓存功能,这个函数会触发",
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -0,0 +1,75 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!-- 数据输出表单-->
|
||||||
|
<span v-if="taskDataOutPut">
|
||||||
|
<el-select v-model="tableInfo.tableName" placeholder="请选择数据库">
|
||||||
|
<el-option style="height: 100%" :value="tableInfo.tableName">
|
||||||
|
<el-aside width="100%">
|
||||||
|
<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
|
||||||
|
</el-aside>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||||
|
//例如:import 《组件名称》 from '《组件路径》,
|
||||||
|
export default {
|
||||||
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
|
components: {},
|
||||||
|
props:['graph','nodeId','nodeName','taskId','taskDataOutPut'],
|
||||||
|
data() {
|
||||||
|
//这里存放数据"
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
//树状图
|
||||||
|
data:[],
|
||||||
|
defaultProps:{
|
||||||
|
children:"children",
|
||||||
|
label:'tableName'
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//计算属性 类似于data概念",
|
||||||
|
computed: {},
|
||||||
|
//监控data中的数据变化",
|
||||||
|
watch: {},
|
||||||
|
//方法集合",
|
||||||
|
methods: {
|
||||||
|
//字段多选框选择赋值
|
||||||
|
handleSelectionChange(val) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
created() {
|
||||||
|
this.findAllTable();
|
||||||
|
},
|
||||||
|
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
},
|
||||||
|
beforeCreate() {
|
||||||
|
}, //生命周期 - 创建之前",
|
||||||
|
beforeMount() {
|
||||||
|
}, //生命周期 - 挂载之前",
|
||||||
|
beforeUpdate() {
|
||||||
|
}, //生命周期 - 更新之前",
|
||||||
|
updated() {
|
||||||
|
}, //生命周期 - 更新之后",
|
||||||
|
beforeDestroy() {
|
||||||
|
}, //生命周期 - 销毁之前",
|
||||||
|
destroyed() {
|
||||||
|
}, //生命周期 - 销毁完成",
|
||||||
|
activated() {
|
||||||
|
} //如果页面有keep-alive缓存功能,这个函数会触发",
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -0,0 +1,135 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!-- 联查模块表单-->
|
||||||
|
<span v-if="taskInputJoin">
|
||||||
|
<el-form label-width="80px" :model="formJoin" ref="queryForm" :inline="true" class="demo-form-inline" size="small">
|
||||||
|
<el-form-item label="联查方式">
|
||||||
|
<el-select v-model="formJoin.joinType" placeholder="请选择">
|
||||||
|
<el-option style="height: 100%" label="左联查" value="1"/>
|
||||||
|
<el-option style="height: 100%" label="右联查" value="2"/>
|
||||||
|
<el-option style="height: 100%" label="内联查" value="3"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<el-form-item label="关联字段">
|
||||||
|
<el-select v-model="formJoin.leftJoinField" placeholder="请选择">
|
||||||
|
<span v-for="item in oneFieldList.split(',')">
|
||||||
|
<el-option style="height: 100%"
|
||||||
|
:label="item"
|
||||||
|
:value="item"
|
||||||
|
:key="item"/>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</el-select>
|
||||||
|
|
||||||
|
<el-select v-model="formJoin.rightJoinField" placeholder="请选择">
|
||||||
|
<span v-for="item in twoFieldList.split(',')">
|
||||||
|
<el-option style="height: 100%"
|
||||||
|
:label="item"
|
||||||
|
:value="item"
|
||||||
|
:key="item"/>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="taskInputJoin == false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="saveTaskJoin()">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <div slot="footer" class="dialog-footer">-->
|
||||||
|
<!-- <el-button @click="taskInputAdd = false">取 消</el-button>-->
|
||||||
|
<!-- <el-button type="primary" @click="addTaskInput()">下一步</el-button>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { addTaskJoin, findByNodeId } from '@/api/task/task'
|
||||||
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||||
|
//例如:import 《组件名称》 from '《组件路径》,
|
||||||
|
export default {
|
||||||
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
|
components: {},
|
||||||
|
props:['graph','nodeId','nodeName','taskId','taskInputJoin','neighbors'],
|
||||||
|
data() {
|
||||||
|
//这里存放数据"
|
||||||
|
|
||||||
|
return {
|
||||||
|
taskInputJoin: true,
|
||||||
|
formJoin: {},
|
||||||
|
oneFieldList:'',
|
||||||
|
twoFieldList:'',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//计算属性 类似于data概念",
|
||||||
|
computed: {},
|
||||||
|
//监控data中的数据变化",
|
||||||
|
watch: {},
|
||||||
|
//方法集合",
|
||||||
|
methods: {
|
||||||
|
//添加任务联查方式
|
||||||
|
saveTaskJoin(){
|
||||||
|
this.taskInputJoin = false;
|
||||||
|
this.$emit('saveTaskJoin', false);
|
||||||
|
addTaskJoin(
|
||||||
|
{
|
||||||
|
"nodeId":this.nodeId,
|
||||||
|
"nodeName":this.nodeName,
|
||||||
|
"taskId":this.taskId,
|
||||||
|
"joinType":this.formJoin.joinType,
|
||||||
|
"leftJoinField":this.formJoin.leftJoinField,
|
||||||
|
"rightJoinField":this.formJoin.rightJoinField
|
||||||
|
}
|
||||||
|
).then(res=>{
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//拿到连线节点的数据
|
||||||
|
findAllTable(){
|
||||||
|
alert(this.neighbors)
|
||||||
|
findByNodeId(this.neighbors[0]).then(res=>{
|
||||||
|
this.oneFieldList = res.data.tableAsField;
|
||||||
|
console.log(this.oneFieldList)
|
||||||
|
})
|
||||||
|
findByNodeId(this.neighbors[1]).then(res=>{
|
||||||
|
this.twoFieldList = res.data.tableAsField;
|
||||||
|
console.log(this.twoFieldList)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
created() {
|
||||||
|
this.findAllTable();
|
||||||
|
},
|
||||||
|
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
},
|
||||||
|
beforeCreate() {
|
||||||
|
}, //生命周期 - 创建之前",
|
||||||
|
beforeMount() {
|
||||||
|
}, //生命周期 - 挂载之前",
|
||||||
|
beforeUpdate() {
|
||||||
|
}, //生命周期 - 更新之前",
|
||||||
|
updated() {
|
||||||
|
}, //生命周期 - 更新之后",
|
||||||
|
beforeDestroy() {
|
||||||
|
}, //生命周期 - 销毁之前",
|
||||||
|
destroyed() {
|
||||||
|
}, //生命周期 - 销毁完成",
|
||||||
|
activated() {
|
||||||
|
} //如果页面有keep-alive缓存功能,这个函数会触发",
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -1,356 +1,707 @@
|
||||||
<template>
|
<template>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<el-form label-width="80px" :model="engineReq" :inline="true" class="demo-form-inline" size="small">
|
|
||||||
|
<el-form label-width="80px" :model="engineReq" :inline="true" class="demo-form-inline" size="small">
|
||||||
|
|
||||||
<el-form-item label="规则名称">
|
<el-form-item label="规则名称">
|
||||||
|
|
||||||
<el-input v-model="engineReq.name"></el-input>
|
<el-input v-model="engineReq.name"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="规则类型">
|
<el-form-item label="规则类型">
|
||||||
<el-input v-model="engineReq.type"></el-input>
|
|
||||||
|
<el-select v-model="engineReq.type" placeholder="请选择类型">
|
||||||
|
|
||||||
|
<el-option label="字段类型" value="1"></el-option>
|
||||||
|
|
||||||
|
<el-option label="基本类型" value="2"></el-option>
|
||||||
|
|
||||||
|
<el-option label="引用类型" value="3"></el-option>
|
||||||
|
|
||||||
|
<el-option label="时间类型" value="4"></el-option>
|
||||||
|
|
||||||
|
<el-option label="转换类型" value="5"></el-option>
|
||||||
|
|
||||||
|
</el-select>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="是否激活">
|
<el-form-item label="是否激活">
|
||||||
<el-input v-model="engineReq.isActivate"></el-input>
|
|
||||||
|
<el-select v-model="engineReq.isActivate" placeholder="是否激活">
|
||||||
|
|
||||||
|
<el-option label="已激活" value="1"></el-option>
|
||||||
|
|
||||||
|
<el-option label="未激活" value="2"></el-option>
|
||||||
|
|
||||||
|
</el-select>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="规则状态">
|
<el-form-item label="规则状态">
|
||||||
<el-input v-model="engineReq.status"></el-input>
|
|
||||||
|
<el-select v-model="engineReq.status" placeholder="规则状态">
|
||||||
|
|
||||||
|
<el-option label="开启" value="1"></el-option>
|
||||||
|
|
||||||
|
<el-option label="关闭" value="2"></el-option>
|
||||||
|
|
||||||
|
</el-select>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-button @click="select()">
|
<el-button @click="select()">
|
||||||
|
|
||||||
查询
|
查询
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
|
<el-button @click="clears()">
|
||||||
|
|
||||||
|
重置
|
||||||
|
|
||||||
|
</el-button>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-button
|
|
||||||
type="warning"
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="findSelectSourceExport"
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
v-hasPermi="['source:data:export']">导出
|
||||||
size="mini"
|
|
||||||
@click="findSelectSourceExport"
|
|
||||||
v-hasPermi="['source:data:export']"
|
|
||||||
>导出
|
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
<!-- 添加按钮 /-->
|
<!-- 添加按钮 /-->
|
||||||
<el-button
|
|
||||||
type="primary"
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['source:data:add']">
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
新增
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['source:data:add']"
|
|
||||||
>新增
|
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
<!-- 添加或修改规则引擎对话框 -->
|
<!-- 添加或修改规则引擎对话框 -->
|
||||||
|
|
||||||
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
|
||||||
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|
||||||
<el-form-item label="规则名称" prop="name">
|
<el-form-item label="规则名称" prop="name">
|
||||||
|
|
||||||
<el-input v-model="form.name" placeholder="请输入规则名称"/>
|
<el-input v-model="form.name" placeholder="请输入规则名称"/>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|
||||||
<el-form-item label="规则编码" prop="engineCode">
|
<el-form-item label="规则编码" prop="engineCode">
|
||||||
|
|
||||||
<el-input v-model="form.engineCode" placeholder="请输入规则编码"/>
|
<el-input v-model="form.engineCode" placeholder="请输入规则编码"/>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|
||||||
<el-form-item label="规则类型" prop="type">
|
<el-form-item label="规则类型" prop="type">
|
||||||
|
|
||||||
<el-select v-model="form.type" placeholder="请选择规则类型" style="width: 100%">
|
<el-select v-model="form.type" placeholder="请选择规则类型" style="width: 100%">
|
||||||
|
|
||||||
<el-option
|
<el-option
|
||||||
|
|
||||||
v-for="dict in dict.type.rule_engine_type"
|
v-for="dict in dict.type.rule_engine_type"
|
||||||
|
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
|
|
||||||
:value="Number(dict.value)"
|
:value="Number(dict.value)"
|
||||||
|
|
||||||
></el-option>
|
></el-option>
|
||||||
|
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|
||||||
<el-form-item label="规则级别" prop="scope">
|
<el-form-item label="规则级别" prop="scope">
|
||||||
|
|
||||||
<el-select v-model="form.scope" placeholder="请选择规则级别" style="width: 100%">
|
<el-select v-model="form.scope" placeholder="请选择规则级别" style="width: 100%">
|
||||||
|
|
||||||
<el-option
|
<el-option
|
||||||
|
|
||||||
v-for="dict in dict.type.rule_engine_level"
|
v-for="dict in dict.type.rule_engine_level"
|
||||||
|
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
|
|
||||||
:value="Number(dict.value)"
|
:value="Number(dict.value)"
|
||||||
|
|
||||||
></el-option>
|
></el-option>
|
||||||
|
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|
||||||
<el-form-item label="是否激活" prop="isActivate">
|
<el-form-item label="是否激活" prop="isActivate">
|
||||||
|
|
||||||
<el-radio-group v-model="form.isActivate">
|
<el-radio-group v-model="form.isActivate">
|
||||||
|
|
||||||
<el-radio
|
<el-radio
|
||||||
|
|
||||||
v-for="dict in dict.type.rule_engine_activate_status"
|
v-for="dict in dict.type.rule_engine_activate_status"
|
||||||
|
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
|
|
||||||
>{{ dict.label }}
|
>{{ dict.label }}
|
||||||
|
|
||||||
</el-radio>
|
</el-radio>
|
||||||
|
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|
||||||
<el-form-item label="规则状态" prop="status">
|
<el-form-item label="规则状态" prop="status">
|
||||||
|
|
||||||
<el-radio-group v-model="form.status">
|
<el-radio-group v-model="form.status">
|
||||||
|
|
||||||
<el-radio
|
<el-radio
|
||||||
|
|
||||||
v-for="dict in dict.type.sys_normal_disable"
|
v-for="dict in dict.type.sys_normal_disable"
|
||||||
|
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
|
|
||||||
>{{ dict.label }}
|
>{{ dict.label }}
|
||||||
|
|
||||||
</el-radio>
|
</el-radio>
|
||||||
|
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
|
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
|
|
||||||
<el-form-item label="规则描述">
|
<el-form-item label="规则描述">
|
||||||
|
|
||||||
<editor v-model="form.description" :min-height="192"/>
|
<editor v-model="form.description" :min-height="192"/>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
|
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
|
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<el-table :data="arr" style="width: 100%">
|
<el-table :data="arr" style="width: 100%">
|
||||||
|
|
||||||
<el-table-column label="编号" prop="id"></el-table-column>
|
<el-table-column label="编号" prop="id"></el-table-column>
|
||||||
|
|
||||||
<el-table-column label="名称" prop="name"></el-table-column>
|
<el-table-column label="名称" prop="name"></el-table-column>
|
||||||
|
|
||||||
<el-table-column label="类型" style="color: #13ce66" prop="type">
|
<el-table-column label="类型" style="color: #13ce66" prop="type">
|
||||||
|
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
|
|
||||||
<span v-if="scope.row.type==1">数据字段</span>
|
<span v-if="scope.row.type==1">数据字段</span>
|
||||||
|
|
||||||
<span v-if="scope.row.type==2">基本类型</span>
|
<span v-if="scope.row.type==2">基本类型</span>
|
||||||
|
|
||||||
<span v-if="scope.row.type==3">时间类型</span>
|
<span v-if="scope.row.type==3">时间类型</span>
|
||||||
|
|
||||||
<span v-if="scope.row.type==4">普通类型</span>
|
<span v-if="scope.row.type==4">普通类型</span>
|
||||||
|
|
||||||
<span v-if="scope.row.type==4">介入类型</span>
|
<span v-if="scope.row.type==4">介入类型</span>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="作用域" style="color: blue" prop="scope">
|
|
||||||
|
<el-table-column label="作用域" style="color: blue" prop="scope">
|
||||||
|
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
|
|
||||||
<span v-if="scope.row.scope==1">数据字段</span>
|
<span v-if="scope.row.scope==1">数据字段</span>
|
||||||
|
|
||||||
<span v-if="scope.row.scope==2">记录</span>
|
<span v-if="scope.row.scope==2">记录</span>
|
||||||
|
|
||||||
<span v-if="scope.row.scope==3">数据集</span>
|
<span v-if="scope.row.scope==3">数据集</span>
|
||||||
|
|
||||||
<span v-if="scope.row.scope==4">数据类型</span>
|
<span v-if="scope.row.scope==4">数据类型</span>
|
||||||
|
|
||||||
<span v-if="scope.row.scope==5">日志</span>
|
<span v-if="scope.row.scope==5">日志</span>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="引擎编码" prop="engineCode"></el-table-column>
|
<el-table-column label="引擎编码" prop="engineCode"></el-table-column>
|
||||||
|
|
||||||
<el-table-column label="是否激活" style="color: red" prop="isActivate">
|
<el-table-column label="是否激活" style="color: red" prop="isActivate">
|
||||||
|
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
|
|
||||||
<span v-if="scope.row.isActivate==1">已激活</span>
|
<span v-if="scope.row.isActivate==1">已激活</span>
|
||||||
|
|
||||||
<span v-if="scope.row.isActivate==2">未激活</span>
|
<span v-if="scope.row.isActivate==2">未激活</span>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="状态" style="color: #787be8" prop="status">
|
|
||||||
|
<el-table-column label="状态" style="color: #787be8" prop="status">
|
||||||
|
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
|
|
||||||
<span v-if="scope.row.status==1">开启</span>
|
<span v-if="scope.row.status==1">开启</span>
|
||||||
|
|
||||||
<span v-if="scope.row.status==2">关闭</span>
|
<span v-if="scope.row.status==2">关闭</span>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="描述" prop="description"></el-table-column>
|
<el-table-column label="描述" prop="description"></el-table-column>
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|
||||||
align="right">
|
align="right">
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
@click="handleDelete(scope.row.id)">删除</el-button>
|
|
||||||
<el-button
|
|
||||||
icon="el-icon-service"
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
@click="handleUpdate(scope.row)">修改规则配置</el-button>
|
|
||||||
|
|
||||||
<el-button
|
<el-button
|
||||||
icon="el-icon-service"
|
|
||||||
|
icon="el-icon-delete"
|
||||||
|
|
||||||
size="mini"
|
size="mini"
|
||||||
|
|
||||||
type="text"
|
type="text"
|
||||||
@click="engineRuleMaintenance(scope.row)">规则维护</el-button>
|
|
||||||
|
@click="handleDelete(scope.row.id)">删除
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
|
||||||
|
icon="el-icon-service"
|
||||||
|
|
||||||
|
size="mini"
|
||||||
|
|
||||||
|
type="text"
|
||||||
|
|
||||||
|
@click="handleUpdate(scope.row)">修改规则配置
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
|
||||||
|
icon="el-icon-service"
|
||||||
|
|
||||||
|
size="mini"
|
||||||
|
|
||||||
|
type="text"
|
||||||
|
|
||||||
|
@click="engineRuleMaintenance(scope.row)">规则维护
|
||||||
|
</el-button>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
</el-table>
|
</el-table>
|
||||||
<!-- 分页-->
|
|
||||||
|
<!-- 分页-->
|
||||||
|
|
||||||
<el-pagination
|
<el-pagination
|
||||||
|
|
||||||
@size-change="handleSizeChange"
|
@size-change="handleSizeChange"
|
||||||
|
|
||||||
@current-change="handleCurrentChange"
|
@current-change="handleCurrentChange"
|
||||||
|
|
||||||
:current-page="engineReq.pageNum"
|
:current-page="engineReq.pageNum"
|
||||||
|
|
||||||
:page-sizes="[1, 2, 3, 4, 5]"
|
:page-sizes="[1, 2, 3, 4, 5]"
|
||||||
|
|
||||||
:page-size="engineReq.pageSize"
|
:page-size="engineReq.pageSize"
|
||||||
|
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
|
||||||
:total="total">
|
:total="total">
|
||||||
|
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||||
|
|
||||||
import {del, insert, selectEngineList, update} from "@/api/engine/engine";
|
import {del, insert, selectEngineList, update} from "@/api/engine/engine";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
name: "maintenance",
|
name: "maintenance",
|
||||||
|
|
||||||
dicts: ['rule_engine_activate_status', 'rule_engine_type', 'sys_normal_disable', 'rule_engine_level'],
|
dicts: ['rule_engine_activate_status', 'rule_engine_type', 'sys_normal_disable', 'rule_engine_level'],
|
||||||
|
|
||||||
//import引入的组件需要注入到对象中才能使用"
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
|
|
||||||
components: {},
|
components: {},
|
||||||
|
|
||||||
props: {},
|
props: {},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|
||||||
//这里存放数据"
|
//这里存放数据"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
engineReq:{
|
|
||||||
pageNum:1,
|
engineReq: {
|
||||||
pageSize:5
|
|
||||||
},
|
pageNum: 1,
|
||||||
engine:{
|
|
||||||
|
pageSize: 5
|
||||||
|
|
||||||
},
|
},
|
||||||
|
engine: {},
|
||||||
|
|
||||||
title: "",
|
title: "",
|
||||||
arr:[],
|
|
||||||
dialogFormVisible:false,
|
arr: [],
|
||||||
total:0,
|
|
||||||
|
dialogFormVisible: false,
|
||||||
|
|
||||||
|
total: 0,
|
||||||
|
|
||||||
form: {},
|
form: {},
|
||||||
open:false,
|
|
||||||
|
open: false,
|
||||||
|
|
||||||
// 表单校验
|
// 表单校验
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
|
|
||||||
name: [
|
name: [
|
||||||
|
|
||||||
{required: true, message: "规则名称不能为空", trigger: "blur"}
|
{required: true, message: "规则名称不能为空", trigger: "blur"}
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
type: [
|
type: [
|
||||||
|
|
||||||
{required: true, message: "规则类型不能为空", trigger: "change"}
|
{required: true, message: "规则类型不能为空", trigger: "change"}
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
engineCode: [
|
engineCode: [
|
||||||
|
|
||||||
{required: true, message: "规则编码不能为空", trigger: "blur"}
|
{required: true, message: "规则编码不能为空", trigger: "blur"}
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
isActivate: [
|
isActivate: [
|
||||||
|
|
||||||
{required: true, message: "是否激活不能为空", trigger: "change"}
|
{required: true, message: "是否激活不能为空", trigger: "change"}
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
status: [
|
status: [
|
||||||
|
|
||||||
{required: true, message: "规则状态不能为空", trigger: "change"}
|
{required: true, message: "规则状态不能为空", trigger: "change"}
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
createBy: [
|
createBy: [
|
||||||
|
|
||||||
{required: true, message: "创建者不能为空", trigger: "blur"}
|
{required: true, message: "创建者不能为空", trigger: "blur"}
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
createTime: [
|
createTime: [
|
||||||
|
|
||||||
{required: true, message: "创建时间不能为空", trigger: "blur"}
|
{required: true, message: "创建时间不能为空", trigger: "blur"}
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//计算属性 类似于data概念",
|
//计算属性 类似于data概念",
|
||||||
|
|
||||||
computed: {},
|
computed: {},
|
||||||
|
|
||||||
//监控data中的数据变化",
|
//监控data中的数据变化",
|
||||||
|
|
||||||
watch: {},
|
watch: {},
|
||||||
|
|
||||||
//方法集合",
|
//方法集合",
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
|
|
||||||
console.log(`每页 ${val} 条`);
|
console.log(`每页 ${val} 条`);
|
||||||
|
|
||||||
this.engineReq.pageSize = val;
|
this.engineReq.pageSize = val;
|
||||||
|
|
||||||
this.findSelectSourceList();
|
this.findSelectSourceList();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
|
|
||||||
console.log(`当前页: ${val}`);
|
console.log(`当前页: ${val}`);
|
||||||
|
|
||||||
this.engineReq.pageNum = val;
|
this.engineReq.pageNum = val;
|
||||||
|
|
||||||
this.findSelectSourceList();
|
this.findSelectSourceList();
|
||||||
|
|
||||||
},
|
},
|
||||||
findSelectSourceList(){
|
|
||||||
selectEngineList(this.engineReq).then(res=>{
|
findSelectSourceList() {
|
||||||
this.arr=res.data.list;
|
|
||||||
this.total=res.data.total;
|
selectEngineList(this.engineReq).then(res => {
|
||||||
|
|
||||||
|
this.arr = res.data.list;
|
||||||
|
|
||||||
|
this.total = res.data.total;
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
handleDelete(id){
|
|
||||||
if (confirm("是否删除这条数据?")){
|
handleDelete(id) {
|
||||||
del(id).then(res =>{
|
|
||||||
|
if (confirm("是否删除这条数据?")) {
|
||||||
|
|
||||||
|
del(id).then(res => {
|
||||||
|
|
||||||
//判断删除是否成功
|
//判断删除是否成功
|
||||||
this.$message.success(res.msg || "删除成功")
|
|
||||||
})
|
this.$message.success(res.msg || "删除成功")
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
findSelectSourceExport(){
|
|
||||||
|
findSelectSourceExport() {
|
||||||
|
|
||||||
this.download('engine/engine/export', {
|
this.download('engine/engine/export', {
|
||||||
...this.engineReq
|
|
||||||
},
|
...this.engineReq
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
`source_${new Date().getTime()}.xlsx`)
|
`source_${new Date().getTime()}.xlsx`)
|
||||||
|
|
||||||
},
|
},
|
||||||
select(){
|
|
||||||
|
select() {
|
||||||
|
|
||||||
this.findSelectSourceList();
|
this.findSelectSourceList();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
|
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
// this.reset();
|
|
||||||
this.open = true;
|
this.open = true;
|
||||||
|
|
||||||
this.title = "添加规则引擎";
|
this.title = "添加规则引擎";
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
|
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
// this.reset();
|
|
||||||
this.form = row;
|
this.form = row;
|
||||||
|
|
||||||
this.open = true;
|
this.open = true;
|
||||||
|
|
||||||
this.title = "修改规则引擎";
|
this.title = "修改规则引擎";
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
|
|
||||||
submitForm() {
|
submitForm() {
|
||||||
|
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
|
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
|
|
||||||
update(this.form).then(response => {
|
update(this.form).then(response => {
|
||||||
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
|
||||||
this.findSelectSourceList();
|
this.findSelectSourceList();
|
||||||
|
|
||||||
this.open = false;
|
this.open = false;
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
insert(this.form).then(response => {
|
insert(this.form).then(response => {
|
||||||
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
|
||||||
this.findSelectSourceList();
|
this.findSelectSourceList();
|
||||||
|
|
||||||
this.open = false;
|
this.open = false;
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
engineRuleMaintenance(row){
|
|
||||||
|
engineRuleMaintenance(row) {
|
||||||
|
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path:'list',
|
|
||||||
query:{id:row.id}
|
path: 'list',
|
||||||
|
|
||||||
|
query: {id: row.id}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
clears() {
|
||||||
|
|
||||||
|
this.engineReq = {
|
||||||
|
|
||||||
|
name: '',
|
||||||
|
|
||||||
|
type: '',
|
||||||
|
|
||||||
|
isActivate: '',
|
||||||
|
|
||||||
|
status: ''
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//生命周期 - 创建完成(可以访问当前this实例)",
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
|
|
||||||
this.findSelectSourceList();
|
this.findSelectSourceList();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//生命周期 - 挂载完成(可以访问DOM元素)",
|
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeCreate() {
|
beforeCreate() {
|
||||||
|
|
||||||
}, //生命周期 - 创建之前",
|
}, //生命周期 - 创建之前",
|
||||||
|
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
|
|
||||||
}, //生命周期 - 挂载之前",
|
}, //生命周期 - 挂载之前",
|
||||||
|
|
||||||
beforeUpdate() {
|
beforeUpdate() {
|
||||||
|
|
||||||
}, //生命周期 - 更新之前",
|
}, //生命周期 - 更新之前",
|
||||||
|
|
||||||
updated() {
|
updated() {
|
||||||
|
|
||||||
}, //生命周期 - 更新之后",
|
}, //生命周期 - 更新之后",
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
|
||||||
}, //生命周期 - 销毁之前",
|
}, //生命周期 - 销毁之前",
|
||||||
|
|
||||||
destroyed() {
|
destroyed() {
|
||||||
|
|
||||||
}, //生命周期 - 销毁完成",
|
}, //生命周期 - 销毁完成",
|
||||||
|
|
||||||
activated() {
|
activated() {
|
||||||
|
|
||||||
} //如果页面有keep-alive缓存功能,这个函数会触发",
|
} //如果页面有keep-alive缓存功能,这个函数会触发",
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,142 +1,500 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
|
||||||
<el-table :data="scopeList" style="width: 100%">
|
|
||||||
|
|
||||||
<el-table-column label="日期" width="180">
|
<div>
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<el-button type="text" @click="addVersion()">新增</el-button>
|
||||||
<span style="margin-left: 10px">{{ scope.row.date }}</span>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</el-table-column>
|
<el-dialog title="添加版本信息" :visible.sync="dialogFormVisible">
|
||||||
|
|
||||||
<el-table-column label="日期" width="180">
|
<el-form :model="versions">
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<el-form-item label="版本类名" :label-width="formLabelWidth">
|
||||||
<span style="margin-left: 10px">{{ scope.row.date }}</span>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</el-table-column>
|
<el-input v-model="versions.versionClass" autocomplete="off"></el-input>
|
||||||
|
|
||||||
<el-table-column label="日期" width="180">
|
</el-form-item>
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<el-form-item label="版本名称" :label-width="formLabelWidth">
|
||||||
<span style="margin-left: 10px">{{ scope.row.date }}</span>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</el-table-column>
|
<el-input v-model="versions.name" autocomplete="off"></el-input>
|
||||||
|
|
||||||
<el-table-column label="日期" width="180">
|
</el-form-item>
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<el-form-item label="版本编码" :label-width="formLabelWidth">
|
||||||
<span style="margin-left: 10px">{{ scope.row.date }}</span>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</el-table-column>
|
<el-input v-model="versions.versionCode" autocomplete="off"></el-input>
|
||||||
|
|
||||||
<el-table-column label="日期" width="180">
|
</el-form-item>
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<el-form-item label="是否激活" :label-width="formLabelWidth">
|
||||||
<span style="margin-left: 10px">{{ scope.row.date }}</span>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</el-table-column>
|
<el-input v-model="versions.isActivate" disabled autocomplete="off"></el-input>
|
||||||
|
|
||||||
<el-table-column label="日期" width="180">
|
</el-form-item>
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<el-form-item label="版本状态" :label-width="formLabelWidth">
|
||||||
<span style="margin-left: 10px">{{ scope.row.date }}</span>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</el-table-column>
|
<el-input v-model="versions.status" disabled autocomplete="off"></el-input>
|
||||||
|
|
||||||
<el-table-column label="日期" width="180">
|
</el-form-item>
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<el-form-item label="是否测试" :label-width="formLabelWidth">
|
||||||
<span style="margin-left: 10px">{{ scope.row.date }}</span>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</el-table-column>
|
<el-input v-model="versions.testStatus" disabled autocomplete="off"></el-input>
|
||||||
|
|
||||||
<el-table-column label="日期" width="180">
|
</el-form-item>
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<el-form-item label="版本描述" :label-width="formLabelWidth">
|
||||||
<span style="margin-left: 10px">{{ scope.row.date }}</span>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</el-table-column>
|
<el-input v-model="versions.description" autocomplete="off"></el-input>
|
||||||
|
|
||||||
<el-table-column label="日期" width="180">
|
</el-form-item>
|
||||||
|
<!-- ref="mycode" :value="curCode" class="code"-->
|
||||||
<template slot-scope="scope">
|
<codemirror :options="cmOptions" v-show="opens">
|
||||||
<span style="margin-left: 10px">{{ scope.row.date }}</span>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column label="日期" width="180">
|
|
||||||
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span style="margin-left: 10px">{{ scope.row.date }}</span>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column label="日期" width="180">
|
|
||||||
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span style="margin-left: 10px">{{ scope.row.date }}</span>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <el-table-column label="操作">-->
|
</codemirror>
|
||||||
<!-- <template slot-scope="scope">-->
|
|
||||||
<!-- <el-button-->
|
</el-form>
|
||||||
<!-- size="mini"-->
|
|
||||||
<!-- @click="handleEdit(scope.$index, scope.row)">编辑</el-button>-->
|
<div slot="footer" class="dialog-footer">
|
||||||
<!-- <el-button-->
|
|
||||||
<!-- size="mini"-->
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||||
<!-- type="danger"-->
|
|
||||||
<!-- @click="handleDelete(scope.$index, scope.row)">删除</el-button>-->
|
<el-button type="primary" @click=handleInsert()>确 定</el-button>
|
||||||
<!-- </template>-->
|
|
||||||
<!-- </el-table-column>-->
|
<el-button type="primary" @click=showCode()>生成引擎类</el-button>
|
||||||
<!-- -->
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-table :data="maintenance.engineMaintenanceList" style="width: 100%">
|
||||||
|
|
||||||
|
<el-table-column prop="versionClass" label="版本类名"></el-table-column>
|
||||||
|
|
||||||
|
<el-table-column prop="name" label="版本名称"></el-table-column>
|
||||||
|
|
||||||
|
<el-table-column prop="versionCode" label="版本编码"></el-table-column>
|
||||||
|
|
||||||
|
<el-table-column prop="isActivate" label="是否激活">
|
||||||
|
|
||||||
|
<template v-slot="scope">
|
||||||
|
|
||||||
|
<span v-if="scope.row.isActivate==1">正常</span>
|
||||||
|
|
||||||
|
<span v-if="scope.row.isActivate==2">停用</span>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column prop="status" label="版本状态">
|
||||||
|
|
||||||
|
<template v-slot="scope">
|
||||||
|
|
||||||
|
<span v-if="scope.row.status===1">正常</span>
|
||||||
|
|
||||||
|
<span v-if="scope.row.status===2">异常</span>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column prop="testStatus" label="版本测试状态">
|
||||||
|
|
||||||
|
<template v-slot="scope">
|
||||||
|
|
||||||
|
<span v-if="scope.row.testStatus===1">数据字段</span>
|
||||||
|
|
||||||
|
<span v-if="scope.row.testStatus===2">数据类型</span>
|
||||||
|
|
||||||
|
<span v-if="scope.row.testStatus===3">数据格式</span>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column fixed="right" label="操作" width="120">
|
||||||
|
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
<el-button @click.native.prevent="del(scope.row.id)" type="text" size="small">
|
||||||
|
|
||||||
|
删除
|
||||||
|
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button v-show="scope.row.isActivate==1" @click="forbiddenEngines(scope.row.id)" type="text" size="small">
|
||||||
|
|
||||||
|
关闭引擎
|
||||||
|
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button v-show="scope.row.isActivate==2" @click="onEngines(scope.row.id)" type="text" size="small">
|
||||||
|
|
||||||
|
开启引擎
|
||||||
|
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column fixed="right" label="操作" width="120">
|
||||||
|
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
<el-button @click.native.prevent="selectEngineById(scope.row.id)" type="text" size="small">
|
||||||
|
|
||||||
|
规则详情
|
||||||
|
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<!--回显-->
|
||||||
|
|
||||||
|
<el-dialog title="收货地址" :visible.sync="versionFormVisible">
|
||||||
|
|
||||||
|
<el-form :model="versions">
|
||||||
|
|
||||||
|
<el-form-item label="版本类名" :label-width="formLabelWidth">
|
||||||
|
|
||||||
|
<el-input v-model="versions.versionClass" disabled autocomplete="off"></el-input>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="版本名称" :label-width="formLabelWidth">
|
||||||
|
|
||||||
|
<el-input v-model="versions.name" disabled autocomplete="off"></el-input>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="版本编码" :label-width="formLabelWidth">
|
||||||
|
|
||||||
|
<el-input v-model="versions.versionCode" disabled autocomplete="off"></el-input>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="是否激活" :label-width="formLabelWidth">
|
||||||
|
|
||||||
|
<el-input v-model="versions.isActivate" disabled autocomplete="off"></el-input>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="版本状态" :label-width="formLabelWidth">
|
||||||
|
|
||||||
|
<el-input v-model="versions.status" disabled autocomplete="off"></el-input>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="版本测试" :label-width="formLabelWidth">
|
||||||
|
|
||||||
|
<el-input v-model="versions.testStatus" disabled autocomplete="off"></el-input>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
</el-table>
|
</el-form>
|
||||||
</div>
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
|
||||||
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||||
|
|
||||||
|
<el-button type="primary" @click="back()">确 定</el-button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getRuleEngineInfo} from "@/api/engine/engine";
|
|
||||||
|
import {add, dels, findById, forbiddenEngine, onEngine, sel, selectEngineById} from "@/api/engine/engine";
|
||||||
|
|
||||||
|
import Java from "@/components/JavaIDE.vue/java.vue";
|
||||||
|
|
||||||
|
import {codemirror} from 'vue-codemirror'
|
||||||
|
|
||||||
|
import "codemirror/theme/ambiance.css"; // 这里引入的是主题样式,根据设置的theme的主题引入,一定要引入!!
|
||||||
|
|
||||||
|
require("codemirror/mode/javascript/javascript"); // 这里引入的模式的js,根据设置的mode引入,一定要引入!!
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
|
dicts: ['rule_engine_activate_status', 'rule_engine_type', 'sys_normal_disable', 'rule_engine_level'],
|
||||||
|
|
||||||
//import引入的组件需要注入到对象中才能使用"
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
components: {},
|
|
||||||
|
components: {
|
||||||
|
codemirror,
|
||||||
|
Java
|
||||||
|
},
|
||||||
|
|
||||||
props: {},
|
props: {},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|
||||||
//这里存放数据"
|
//这里存放数据"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
scopeList: [],
|
|
||||||
maintenance:{}
|
direction: 'rtl',
|
||||||
|
|
||||||
|
versionFormVisible: false,
|
||||||
|
|
||||||
|
maintenance: {
|
||||||
|
|
||||||
|
engineMaintenanceList: [],
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
opens: false,
|
||||||
|
|
||||||
|
javaClass: "package com.muyu.rule.engine.custom;\n" +
|
||||||
|
"\n" +
|
||||||
|
"import com.muyu.engine.action.ActionDiscard;\n" +
|
||||||
|
"import com.muyu.engine.scope.DataModelEngine;\n" +
|
||||||
|
"\n" +
|
||||||
|
"/**\n" +
|
||||||
|
" * @Author: DongZeLiang\n" +
|
||||||
|
" * @date: 2024/5/6\n" +
|
||||||
|
" * @Description: 231-231\n" +
|
||||||
|
" * @Version: 1.0\n" +
|
||||||
|
" */\n" +
|
||||||
|
"public class undefined_231 extends DataModelEngine {\n" +
|
||||||
|
" @Override\n" +
|
||||||
|
" public void execution () {\n" +
|
||||||
|
" Object value = getValue();\n" +
|
||||||
|
"\n" +
|
||||||
|
" if (value == null || \"\".equals(value) || \"null\".equals(value)) {\n" +
|
||||||
|
" throw new ActionDiscard();\n" +
|
||||||
|
" }\n" +
|
||||||
|
" }\n" +
|
||||||
|
"}",
|
||||||
|
|
||||||
|
title: "",
|
||||||
|
|
||||||
|
open: false,
|
||||||
|
|
||||||
|
handleClose: false,
|
||||||
|
|
||||||
|
versions: {
|
||||||
|
|
||||||
|
isActivate: '未激活',
|
||||||
|
|
||||||
|
testStatus: '未测试',
|
||||||
|
|
||||||
|
status: '初始化'
|
||||||
|
},
|
||||||
|
|
||||||
|
cmOptions: {
|
||||||
|
|
||||||
|
// autorefresh: true,
|
||||||
|
|
||||||
|
// tabSize: 4,
|
||||||
|
|
||||||
|
// mode: 'text/x-properties',
|
||||||
|
|
||||||
|
// theme: 'ayu-mirage',
|
||||||
|
|
||||||
|
// line: true,
|
||||||
|
|
||||||
|
// viewportMargin: Infinity, //处理高度自适应时搭配使用
|
||||||
|
|
||||||
|
// highlightDifferences: true,
|
||||||
|
|
||||||
|
// autofocus: false,
|
||||||
|
|
||||||
|
// indentUnit: 2,
|
||||||
|
|
||||||
|
// smartIndent: true,
|
||||||
|
|
||||||
|
// readOnly: true, // 只读
|
||||||
|
|
||||||
|
// showCursorWhenSelecting: true,
|
||||||
|
|
||||||
|
// firstLineNumber: 1
|
||||||
|
|
||||||
|
lineNumbers: true, // 显示行号
|
||||||
|
|
||||||
|
mode: 'text/x-yaml', // 语法model
|
||||||
|
|
||||||
|
gutters: ['CodeMirror-lint-markers'], // 语法检查器
|
||||||
|
|
||||||
|
theme: "ambiance",
|
||||||
|
|
||||||
|
lint: true, // 开启语法检查
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
size: '',
|
||||||
|
|
||||||
|
dialogFormVisible: false,
|
||||||
|
|
||||||
|
formLabelWidth: '120px',
|
||||||
|
|
||||||
|
arr: []
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
List(){
|
|
||||||
getRuleEngineInfo().then(res =>{
|
showCode() {
|
||||||
this.scopeList = res.data;
|
|
||||||
|
this.opens = true
|
||||||
|
|
||||||
|
this.javaClass;
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
//添加弹窗
|
||||||
|
|
||||||
|
addVersion() {
|
||||||
|
|
||||||
|
this.versions = {},
|
||||||
|
|
||||||
|
this.versions.isActivate = '未激活',
|
||||||
|
|
||||||
|
this.versions.testStatus = '未测试',
|
||||||
|
|
||||||
|
this.versions.status = '初始化';
|
||||||
|
|
||||||
|
this.dialogFormVisible = true
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
back() {
|
||||||
|
|
||||||
|
this.versionFormVisible = false;
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
//根据id查询回显
|
||||||
|
|
||||||
|
selectEngineById(id) {
|
||||||
|
|
||||||
|
this.versionFormVisible = true;
|
||||||
|
|
||||||
|
sel(id).then(res => {
|
||||||
|
|
||||||
|
this.versions = res.data;
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
handleInsert() {
|
||||||
|
|
||||||
|
this.dialogFormVisible = false;
|
||||||
|
|
||||||
|
this.versions.isActivate = 1
|
||||||
|
|
||||||
|
this.versions.testStatus = 1
|
||||||
|
|
||||||
|
this.versions.status = 1
|
||||||
|
|
||||||
|
add(this.versions).then(res => {
|
||||||
|
|
||||||
|
this.$modal.msgSuccess(res.msg || "新增成功")
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
this.findById();
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
onEngines(id) {
|
||||||
|
|
||||||
|
onEngine(id).then(res => {
|
||||||
|
|
||||||
|
this.$message.success(res.msg || "开启成功")
|
||||||
|
|
||||||
|
})
|
||||||
|
this.findById();
|
||||||
|
|
||||||
|
},
|
||||||
|
forbiddenEngines(id) {
|
||||||
|
|
||||||
|
forbiddenEngine(id).then(res => {
|
||||||
|
|
||||||
|
this.$message.success(res.msg || "关闭成功")
|
||||||
|
|
||||||
|
})
|
||||||
|
this.List();
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
List() {
|
||||||
|
|
||||||
|
findById(this.maintenance.id).then(res => {
|
||||||
|
|
||||||
|
this.maintenance.engineMaintenanceList = res.data
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
selectEngine() {
|
||||||
|
selectEngineById(this.maintenance.id).then(res => {
|
||||||
|
this.arr = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
del(id) {
|
||||||
|
|
||||||
|
if (confirm("你确定删除吗?")) {
|
||||||
|
|
||||||
|
dels(id).then(res => {
|
||||||
|
|
||||||
|
this.$message.success(res.msg || "删除成功");
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//生命周期 - 创建完成(可以访问当前this实例)",
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.scopeList.id = this.$route.query.id
|
|
||||||
|
this.maintenance.id = this.$route.query.id
|
||||||
|
|
||||||
this.List();
|
this.List();
|
||||||
|
|
||||||
|
this.selectEngine();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
|
.information-box >>> .CodeMirror {
|
||||||
|
|
||||||
|
font-family: monospace;
|
||||||
|
|
||||||
|
height: 71vh;
|
||||||
|
|
||||||
|
direction: ltr;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,385 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<h1 style="text-align: center; margin-bottom: 30px;">安全设置</h1>
|
||||||
|
<el-divider></el-divider>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="card left-card">
|
||||||
|
<el-card style="margin-top: 50px;">
|
||||||
|
<h2>登录密码</h2>
|
||||||
|
<div class="container">
|
||||||
|
<label>安全性高的密码可以使帐号更安全.建议你定期更换密码,设置6-20位登录密码</label>
|
||||||
|
<div class="button-wrapper">
|
||||||
|
<button @click="openModal">修改密码</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card right-card">
|
||||||
|
<el-card style="margin-top: 50px;">
|
||||||
|
<h2>手机号码</h2>
|
||||||
|
<label>安全手机可以用于登录帐号,重置密码或其他安全验证</label>
|
||||||
|
<button @click="openCurrentPhoneModal">修改手机号</button>
|
||||||
|
|
||||||
|
<!-- 输入当前手机号的弹出框 -->
|
||||||
|
<div v-if="isCurrentPhoneModalVisible" class="modal-overlay">
|
||||||
|
<div class="modal-content">
|
||||||
|
<h3>当前手机号</h3>
|
||||||
|
<div>旧手机号({{ user.phonenumber }})</div>
|
||||||
|
<button @click="sendVerificationCode">发送验证码</button>
|
||||||
|
<button @click="closeCurrentPhoneModal">取消</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 输入验证码的弹出框 -->
|
||||||
|
<div v-if="isVerificationModalVisible" class="modal-overlay">
|
||||||
|
<div class="modal-content">
|
||||||
|
<h3>输入验证码</h3>
|
||||||
|
<input v-model="code" placeholder="验证码" />
|
||||||
|
<button @click="verCode">验证并输入新手机号</button>
|
||||||
|
<button @click="closeVerificationModal">取消</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 输入新手机号的弹出框 -->
|
||||||
|
<div v-if="isNewPhoneModalVisible" class="modal-overlay">
|
||||||
|
<div class="modal-content">
|
||||||
|
<h3>输入新手机号</h3>
|
||||||
|
<input v-model="newPhone" placeholder="新手机号" @input="validatePhone" />
|
||||||
|
<p v-if="phoneError" style="color: red" class="error">{{ phoneError }}</p>
|
||||||
|
<button @click="updatePhoneNumber">提交修改</button>
|
||||||
|
<button @click="closeNewPhoneModal">取消</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<el-card>
|
||||||
|
<img src="/123456789.jpg" style="width: 40%; height: auto;" alt="Big Image">
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 弹出框 -->
|
||||||
|
<div v-if="showModal" class="modal">
|
||||||
|
<div class="modal-content">
|
||||||
|
<h2>身份验证</h2>
|
||||||
|
<el-divider></el-divider>
|
||||||
|
|
||||||
|
<!-- 手机号和验证码 -->
|
||||||
|
<div v-if="!verificationSent">
|
||||||
|
<label for="phonenumber">身份验证方式:</label>
|
||||||
|
<div><h3>通过手机({{ user.phonenumber }})获取验证</h3></div>
|
||||||
|
<button @click="sendCode">发送验证码</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="verificationSent && !codeVerified">
|
||||||
|
<label for="code">验证码:</label>
|
||||||
|
<input v-model="code" id="code" type="text" placeholder="请输入验证码" />
|
||||||
|
<button @click="verifyCode">验证验证码</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="codeVerified">
|
||||||
|
<el-form ref="form" :model="user" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="旧密码" prop="oldPassword">
|
||||||
|
<el-input v-model="user.oldPassword" placeholder="请输入旧密码" show-password type="password"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="新密码" prop="newPassword">
|
||||||
|
<el-input v-model="user.newPassword" placeholder="请输入新密码" show-password type="password"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="确认密码" prop="confirmPassword">
|
||||||
|
<el-input v-model="user.confirmPassword" placeholder="请确认新密码" show-password type="password"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<button @click="submit" :disabled="!user.newPassword">提交修改</button>
|
||||||
|
</div>
|
||||||
|
<button @click="closeModal" class="close-button">关闭</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import axios from 'axios';
|
||||||
|
import {getUserProfile,sendCode,checkCode,updatePhone} from "@/api/system/user";
|
||||||
|
import {updateUserPwd} from "@/api/system/user";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
const equalToPassword = (rule, value, callback) => {
|
||||||
|
if (this.user.newPassword !== value) {
|
||||||
|
callback(new Error("两次输入的密码不一致"));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
isVisible: false,
|
||||||
|
currentPhone: '',
|
||||||
|
newPhone: '',
|
||||||
|
phoneError: '',
|
||||||
|
verificationCode: '',
|
||||||
|
isCurrentPhoneModalVisible: false,
|
||||||
|
isVerificationModalVisible: false,
|
||||||
|
isNewPhoneModalVisible: false,
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
oldPassword: [
|
||||||
|
{required: true, message: "旧密码不能为空", trigger: "blur"}
|
||||||
|
],
|
||||||
|
newPassword: [
|
||||||
|
{required: true, message: "新密码不能为空", trigger: "blur"},
|
||||||
|
{min: 6, max: 20, message: "长度在 6 到 20 个字符", trigger: "blur"}
|
||||||
|
],
|
||||||
|
confirmPassword: [
|
||||||
|
{required: true, message: "确认密码不能为空", trigger: "blur"},
|
||||||
|
{required: true, validator: equalToPassword, trigger: "blur"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
user: {
|
||||||
|
oldPassword: undefined,
|
||||||
|
newPassword: undefined,
|
||||||
|
confirmPassword: undefined
|
||||||
|
},
|
||||||
|
showModal: false,
|
||||||
|
aModel: false,
|
||||||
|
phonenumber: '',
|
||||||
|
code: '',
|
||||||
|
oldPassword: '',
|
||||||
|
newPassword: '',
|
||||||
|
verificationSent: false,
|
||||||
|
codeVerified: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getUser();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
validatePhone() {
|
||||||
|
const phonePattern = /^[0-9]{11}$/; // 只允许11位数字
|
||||||
|
if (!this.newPhone) {
|
||||||
|
this.phoneError = '手机号不能为空';
|
||||||
|
} else if (!phonePattern.test(this.newPhone)) {
|
||||||
|
this.phoneError = '请输入有效的11位手机号';
|
||||||
|
} else {
|
||||||
|
this.phoneError = '';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
updatePhoneNumber() {
|
||||||
|
updatePhone(this.newPhone).then(response => {
|
||||||
|
this.closeNewPhoneModal();
|
||||||
|
this.$message({
|
||||||
|
message: '修改成功',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
closeNewPhoneModal() {
|
||||||
|
this.isNewPhoneModalVisible = false;
|
||||||
|
},
|
||||||
|
closeVerificationModal() {
|
||||||
|
this.isVerificationModalVisible = false;
|
||||||
|
},
|
||||||
|
sendVerificationCode() {
|
||||||
|
try {
|
||||||
|
sendCode(this.user.phonenumber)
|
||||||
|
this.closeCurrentPhoneModal();
|
||||||
|
this.isVerificationModalVisible = true;
|
||||||
|
alert('验证码已发送');
|
||||||
|
} catch (error) {
|
||||||
|
console.error('发送验证码失败', error);
|
||||||
|
alert('发送验证码失败');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
openCurrentPhoneModal() {
|
||||||
|
this.isCurrentPhoneModalVisible = true;
|
||||||
|
},
|
||||||
|
closeCurrentPhoneModal() {
|
||||||
|
this.isCurrentPhoneModalVisible = false;
|
||||||
|
},
|
||||||
|
getUser() {
|
||||||
|
getUserProfile().then(response => {
|
||||||
|
this.user = response.data.sysUser;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
openModal() {
|
||||||
|
this.showModal = true;
|
||||||
|
},
|
||||||
|
closeModal() {
|
||||||
|
this.showModal = false;
|
||||||
|
this.resetForm();
|
||||||
|
},
|
||||||
|
async sendCode() {
|
||||||
|
try {
|
||||||
|
sendCode(this.user.phonenumber)
|
||||||
|
this.verificationSent = true;
|
||||||
|
alert('验证码已发送');
|
||||||
|
} catch (error) {
|
||||||
|
console.error('发送验证码失败', error);
|
||||||
|
alert('发送验证码失败');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async verCode() {
|
||||||
|
checkCode(this.user.phonenumber, this.code).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.closeVerificationModal();
|
||||||
|
this.isNewPhoneModalVisible = true; // 验证成功后弹出新手机号输入框
|
||||||
|
alert('验证码验证成功');
|
||||||
|
} else {
|
||||||
|
alert('验证码验证失败');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async verifyCode() {
|
||||||
|
checkCode(this.user.phonenumber, this.code).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.codeVerified = true;
|
||||||
|
alert('验证码验证成功');
|
||||||
|
} else {
|
||||||
|
alert('验证码验证失败');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
resetForm() {
|
||||||
|
this.phonenumber = '';
|
||||||
|
this.code = '';
|
||||||
|
this.oldPassword = '';
|
||||||
|
this.newPassword = '';
|
||||||
|
this.verificationSent = false;
|
||||||
|
this.codeVerified = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
/* 简单样式,仅供参考 */
|
||||||
|
.modal {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(0, 0, 0, 0.5);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-wrapper {
|
||||||
|
margin-left: auto; /* 将按钮移动到右侧 */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.modal-content {
|
||||||
|
background: #fff;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 8px;
|
||||||
|
width: 400px;
|
||||||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
display: block;
|
||||||
|
margin-top: 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px;
|
||||||
|
margin-top: 5px;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.card {
|
||||||
|
width: 50%;
|
||||||
|
padding: 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal {
|
||||||
|
/* 样式设置 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content {
|
||||||
|
/* 样式设置 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.left-card {
|
||||||
|
background-color: #f1f1f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right-card {
|
||||||
|
background-color: #e1e1e1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.modal-overlay {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(0, 0, 0, 0.5);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content {
|
||||||
|
background: white;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
button {
|
||||||
|
margin-top: 20px;
|
||||||
|
padding: 10px 15px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: #007bff;
|
||||||
|
color: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:disabled {
|
||||||
|
background-color: #6c757d;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-button {
|
||||||
|
background-color: #dc3545;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-button:hover {
|
||||||
|
background-color: #c82333;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,110 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row class="center-row" :gutter="20">
|
||||||
|
<el-col :span="12" :xs="24">
|
||||||
|
<el-card style="margin-top: 50px;">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>个人信息</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="text-center">
|
||||||
|
<userAvatar/>
|
||||||
|
</div>
|
||||||
|
<ul class="list-group list-group-striped">
|
||||||
|
<li class="list-group-item">
|
||||||
|
<svg-icon icon-class="user"/>
|
||||||
|
用户名称
|
||||||
|
<div class="pull-right">{{ user.userName }}</div>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<svg-icon icon-class="phone"/>
|
||||||
|
手机号码
|
||||||
|
<div class="pull-right">{{ user.phonenumber }}</div>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<svg-icon icon-class="email"/>
|
||||||
|
用户邮箱
|
||||||
|
<div class="pull-right">{{ user.email }}</div>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<svg-icon icon-class="tree"/>
|
||||||
|
所属部门
|
||||||
|
<div v-if="user.dept" class="pull-right">{{ user.dept.deptName }} / {{ postGroup }}</div>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<svg-icon icon-class="peoples"/>
|
||||||
|
职位
|
||||||
|
<div class="pull-right">{{ roleGroup }}</div>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<svg-icon icon-class="date"/>
|
||||||
|
创建日期
|
||||||
|
<div class="pull-right">{{ user.createTime }}</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {getUserProfile} from "@/api/system/user";
|
||||||
|
import userAvatar from "/src/views/system/user/profile/userAvatar";
|
||||||
|
import userInfo from "/src/views/system/user/profile/userInfo";
|
||||||
|
import resetPwd from "/src/views/system/user/profile/resetPwd";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Profile",
|
||||||
|
components: {userAvatar, userInfo, resetPwd},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
user: {},
|
||||||
|
roleGroup: {},
|
||||||
|
postGroup: {},
|
||||||
|
activeTab: "userinfo"
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getUser();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getUser() {
|
||||||
|
getUserProfile().then(response => {
|
||||||
|
this.user = response.data.sysUser;
|
||||||
|
this.roleGroup = response.data.roleGroup;
|
||||||
|
this.postGroup = response.data.postGroup;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.app-container {
|
||||||
|
padding: 20px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.center-row {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-card {
|
||||||
|
border: 1px solid #dcdfe6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-group-item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<script setup>
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
|
||||||
|
</style>
|
|
@ -0,0 +1,128 @@
|
||||||
|
<template>
|
||||||
|
<div style="padding: 20px;">
|
||||||
|
<h1 style="text-align: center; margin-bottom: 30px;">充值明细</h1>
|
||||||
|
<el-divider></el-divider>
|
||||||
|
<el-form ref="queryForm" :inline="true" :model="queryParams" size="small">
|
||||||
|
<el-form-item label="创建时间">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dateRange"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
style="width: 240px"
|
||||||
|
type="daterange"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-row>
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['system:pay:export']"
|
||||||
|
icon="el-icon-download"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
type="warning"
|
||||||
|
@click="handleExport"
|
||||||
|
>导出
|
||||||
|
</el-button>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
:data="listDate"
|
||||||
|
style="width: 100%; border-collapse: collapse;">
|
||||||
|
<el-table-column
|
||||||
|
label="序号"
|
||||||
|
width="300"
|
||||||
|
style="border: 1px solid #ccc; padding: 10px; text-align: center;">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.id }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="充值编号"
|
||||||
|
width="300"
|
||||||
|
style="border: 1px solid #ccc; padding: 10px; text-align: center;">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.outTradeNo }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="充值金额"
|
||||||
|
width="300"
|
||||||
|
style="border: 1px solid #ccc; padding: 10px; text-align: center;">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.totalAmount }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="充值类型"
|
||||||
|
width="300"
|
||||||
|
style="border: 1px solid #ccc; padding: 10px; text-align: center;">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.productCode }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="充值时间"
|
||||||
|
width="300"
|
||||||
|
style="border: 1px solid #ca8a8a; padding: 10px; text-align: center;">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.createTime }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:total="total"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { userPayinfo } from "@/api/system/user";
|
||||||
|
import PanelGroup from "@/views/dashboard/PanelGroup.vue";
|
||||||
|
export default {
|
||||||
|
components: {PanelGroup},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dateRange: [],
|
||||||
|
listDate: [],
|
||||||
|
total: 0,
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('system/user/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `pay_${new Date().getTime()}.xlsx`)
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
userPayinfo(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
|
this.listDate = response.data.rows;
|
||||||
|
this.total = response.data.total;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -3,9 +3,8 @@
|
||||||
<ul class="msg-box">
|
<ul class="msg-box">
|
||||||
<li>
|
<li>
|
||||||
<h1 style="margin-bottom: 15px;">充值说明</h1>
|
<h1 style="margin-bottom: 15px;">充值说明</h1>
|
||||||
<h4>你敢充钱,我就敢让你没钱</h4>
|
<h4>请输入支付宝沙箱账号</h4>
|
||||||
<h4>子龙说你得有个小目标</h4>
|
<h4>西伯利亚龙</h4>
|
||||||
<h4>什么小目标,得一个亿</h4>
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<h4 style="margin-bottom: 15px;">支付金额</h4>
|
<h4 style="margin-bottom: 15px;">支付金额</h4>
|
||||||
|
@ -37,8 +36,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {addUserMoney, userRecharge} from "@/api/system/user";
|
import { addUserMoney, userRecharge ,createRechargeRecord} from "@/api/system/user";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -46,7 +44,7 @@ export default {
|
||||||
addSysUser: {},
|
addSysUser: {},
|
||||||
disabled: false,
|
disabled: false,
|
||||||
// 同步跳转页面地址
|
// 同步跳转页面地址
|
||||||
returnUrl: 'http://172.13.1.1/money/money',
|
returnUrl:'http://172.13.1.1//money/money',
|
||||||
//充值参数
|
//充值参数
|
||||||
rechargeParams: {
|
rechargeParams: {
|
||||||
"totalAmt": '', //金额
|
"totalAmt": '', //金额
|
||||||
|
@ -86,7 +84,7 @@ export default {
|
||||||
// 传递同步跳转地址
|
// 传递同步跳转地址
|
||||||
returnUrl: this.returnUrl,
|
returnUrl: this.returnUrl,
|
||||||
// 商品名称
|
// 商品名称
|
||||||
subject: '充值金额',
|
subject: '支付金额',
|
||||||
// 支付类型
|
// 支付类型
|
||||||
productCode: 'FAST_INSTANT_TRADE_PAY'
|
productCode: 'FAST_INSTANT_TRADE_PAY'
|
||||||
}
|
}
|
||||||
|
@ -109,6 +107,7 @@ export default {
|
||||||
let userId = localStorage.getItem('userId');
|
let userId = localStorage.getItem('userId');
|
||||||
this.addSysUser.userId = userId;
|
this.addSysUser.userId = userId;
|
||||||
addUserMoney(this.addSysUser).then(res => {
|
addUserMoney(this.addSysUser).then(res => {
|
||||||
|
createRechargeRecord(praem);
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.error('Error updating user balance:', error);
|
console.error('Error updating user balance:', error);
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,6 +4,25 @@
|
||||||
<h1>用户余额</h1>
|
<h1>用户余额</h1>
|
||||||
<p>余额:{{ userBalanceData.userBalance || '加载中...' }}</p>
|
<p>余额:{{ userBalanceData.userBalance || '加载中...' }}</p>
|
||||||
<el-button type="primary" @click="navigateToRecharge">充值</el-button>
|
<el-button type="primary" @click="navigateToRecharge">充值</el-button>
|
||||||
|
<el-dialog
|
||||||
|
title="实名认证"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
width="30%"
|
||||||
|
@close="handleDialogClose"
|
||||||
|
>
|
||||||
|
<el-form :model="authForm" :rules="rules" ref="authFormRef">
|
||||||
|
<el-form-item label="姓名" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="authForm.name"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="身份证号" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="authForm.idCard"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="handleCancel">取消</el-button>
|
||||||
|
<el-button type="primary" @click="handleConfirm">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,17 +31,17 @@
|
||||||
<h1>余额预警</h1>
|
<h1>余额预警</h1>
|
||||||
<el-button type="text" @click="dialogFormVisible = true">开启</el-button>
|
<el-button type="text" @click="dialogFormVisible = true">开启</el-button>
|
||||||
<el-dialog title="添加预警号码" :visible.sync="dialogFormVisible">
|
<el-dialog title="添加预警号码" :visible.sync="dialogFormVisible">
|
||||||
<el-divider style="color: #00afff">
|
<el-divider style="border-color: #00afff;">
|
||||||
<el-tag content-position="right" type="warning">
|
<el-tag content-position="right" type="warning">
|
||||||
账户可用余额小于该值时,每天短信通知一次(最多连续提醒5天)
|
账户可用余额小于该值时,每天短信通知一次(最多连续提醒5天)
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</el-divider>
|
</el-divider>
|
||||||
<el-form :model="form">
|
<el-form :model="form">
|
||||||
<el-form-item label="预警阈值:" :label-width="formLabelWidth">
|
<el-form-item label="预警阈值:" :label-width="formLabelWidth">
|
||||||
<el-input v-model="form.name" autocomplete="off"></el-input>
|
<el-input v-model="form.userBalance" autocomplete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="预警号码:" :label-width="formLabelWidth">
|
<el-form-item label="预警号码:" :label-width="formLabelWidth">
|
||||||
<el-input v-model="form.phone" autocomplete="off"></el-input>
|
<el-input v-model="form.phonenumber" autocomplete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
@ -44,22 +63,36 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { userBalance } from "@/api/system/user"; //
|
import {userBalance} from "@/api/system/user"; //
|
||||||
import * as echarts from 'echarts' //引用echarts
|
import * as echarts from 'echarts' //引用echarts
|
||||||
|
import {checkRealNameAuth} from "@/api/system/user";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
charts: "",
|
charts: "",
|
||||||
|
dialogVisible: false,
|
||||||
dialogFormVisible: false,
|
dialogFormVisible: false,
|
||||||
formLabelWidth: '120px',
|
formLabelWidth: '120px',
|
||||||
opinionData: ["155", "400", "900", "800", "300", "900", "270","684","165","0","300","150"], // 数据
|
opinionData: ["155", "400", "900", "800", "300", "900", "270", "684", "165", "0", "300", "150"], // 数据
|
||||||
userBalanceData: {
|
userBalanceData: {
|
||||||
userBalance: '加载中...'
|
userBalance: '加载中...'
|
||||||
},
|
},
|
||||||
form:{
|
authForm: {
|
||||||
|
name: '',
|
||||||
}
|
idCard: ''
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
name: [
|
||||||
|
{required: true, message: '请输入姓名', trigger: 'blur'},
|
||||||
|
{min: 2, max: 10, message: '姓名长度在 2 到 10 个字符', trigger: 'blur'}
|
||||||
|
],
|
||||||
|
idCard: [
|
||||||
|
{required: true, message: '请输入身份证号', trigger: 'blur'},
|
||||||
|
{pattern: /^\d{17}[\dXx]$/, message: '身份证号格式不正确', trigger: 'blur'}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
form: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -69,8 +102,51 @@ export default {
|
||||||
this.drawLine();
|
this.drawLine();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
navigateToRecharge() {
|
handleCancel() {
|
||||||
this.$router.push('/money/zfb');
|
this.dialogVisible = false;
|
||||||
|
},
|
||||||
|
handleDialogClose() {
|
||||||
|
this.authForm.name = '';
|
||||||
|
this.authForm.idCard = '';
|
||||||
|
},
|
||||||
|
async navigateToRecharge() {
|
||||||
|
try {
|
||||||
|
const response = await checkRealNameAuth(this.authForm);
|
||||||
|
if (response.data && response.data.desc) {
|
||||||
|
// 如果已实名认证,直接跳转页面
|
||||||
|
this.$router.push('/money/zfb');
|
||||||
|
} else {
|
||||||
|
// 如果未实名认证,显示对话框
|
||||||
|
this.dialogVisible = true;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
this.$message.error('实名认证检查失败,请稍后再试');
|
||||||
|
console.error('实名认证检查失败:', error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async handleConfirm() {
|
||||||
|
this.$refs.authFormRef.validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
try {
|
||||||
|
const {name, idCard} = this.authForm;
|
||||||
|
const authResponse = await checkRealNameAuth(this.authForm);
|
||||||
|
if (authResponse.data && authResponse.data.desc) {
|
||||||
|
this.$message.success('实名认证成功');
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$router.push('/money/zfb');
|
||||||
|
} else {
|
||||||
|
this.$message.error('实名认证失败,请检查您的信息');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
this.$message.error('实名认证验证失败,请稍后再试');
|
||||||
|
console.error('实名认证验证失败:', error);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('error submit!!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
async fetchUserBalance() {
|
async fetchUserBalance() {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -0,0 +1,140 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<p style="font-weight: bold;font-size: 20px">余额:{{ userBalanceData.userBalance || '加载中...' }}</p>
|
||||||
|
<el-table
|
||||||
|
:data="tableData"
|
||||||
|
style="width: 100%">
|
||||||
|
<el-table-column
|
||||||
|
label="编号"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.connectorUserId }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="用户"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.userName }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="接口"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.connectorName }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="剩余次数"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.connectorResidueDegree }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="购买次数"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.connectorFrequency }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
@click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.$index, scope.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||||
|
//例如:import 《组件名称》 from '《组件路径》,
|
||||||
|
import {findConnectorUserList} from "@/api/port/port";
|
||||||
|
import {userBalance} from "@/api/system/user";
|
||||||
|
export default {
|
||||||
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
|
components: {},
|
||||||
|
props: {},
|
||||||
|
data() {
|
||||||
|
//这里存放数据"
|
||||||
|
|
||||||
|
return {
|
||||||
|
userBalanceData: {
|
||||||
|
userBalance: '加载中...'
|
||||||
|
},
|
||||||
|
tableData:[],
|
||||||
|
form:{},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//计算属性 类似于data概念",
|
||||||
|
computed: {},
|
||||||
|
//监控data中的数据变化",
|
||||||
|
watch: {},
|
||||||
|
//方法集合",
|
||||||
|
methods: {
|
||||||
|
findConnectorUserList(){
|
||||||
|
findConnectorUserList(this.form).then((res)=>{
|
||||||
|
this.tableData=res.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async fetchUserBalance() {
|
||||||
|
try {
|
||||||
|
const userId = localStorage.getItem('userId');
|
||||||
|
console.log(userId)// 登录后把userId存到了localStorage
|
||||||
|
if (!userId) {
|
||||||
|
this.userBalanceData = {userBalance: '未登录'};
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const response = await userBalance(userId);
|
||||||
|
if (response.data) {
|
||||||
|
console.log(response.data)
|
||||||
|
this.userBalanceData.userBalance = response.data;
|
||||||
|
} else {
|
||||||
|
this.userBalanceData.userBalance = {userBalance: '获取失败'};
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
this.userBalanceData = {userBalance: '获取失败'};
|
||||||
|
console.error('Error fetching user balance:', error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
created() {
|
||||||
|
this.fetchUserBalance();
|
||||||
|
this.findConnectorUserList();
|
||||||
|
},
|
||||||
|
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
beforeCreate() {
|
||||||
|
}, //生命周期 - 创建之前",
|
||||||
|
beforeMount() {
|
||||||
|
}, //生命周期 - 挂载之前",
|
||||||
|
beforeUpdate() {
|
||||||
|
}, //生命周期 - 更新之前",
|
||||||
|
updated() {
|
||||||
|
}, //生命周期 - 更新之后",
|
||||||
|
beforeDestroy() {
|
||||||
|
}, //生命周期 - 销毁之前",
|
||||||
|
destroyed() {
|
||||||
|
}, //生命周期 - 销毁完成",
|
||||||
|
activated() {
|
||||||
|
} //如果页面有keep-alive缓存功能,这个函数会触发",
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -1,5 +1,195 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<el-button type="primary">+申请新数据</el-button>
|
||||||
|
<el-row :gutter="50">
|
||||||
|
<el-col :span="7" v-for="connector in connectorList" :key="connector.connectorId" v-if="connectorList.length !== 0">
|
||||||
|
<el-card class="box-card" style="margin-top: 15px;width: 500px; height: 600px;" shadow="hover">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<h1 style="font-weight: bold">{{connector.connectorName}}</h1>
|
||||||
|
<el-button type="primary" style="float: right; padding: 10px 10px" @click="buy(connector)">购买</el-button>
|
||||||
|
</div>
|
||||||
|
<span style="font-weight: bold;font-size: 20px">产品图片:</span><br>
|
||||||
|
<el-image style="width: 300px; height: 300px" :src="connector.connectorPicture" :fit="fit"></el-image><br>
|
||||||
|
<span style="font-weight: bold;font-size: 20px">产品介绍:</span>
|
||||||
|
{{connector.connectorDescribe}}<br>
|
||||||
|
<span style="font-weight: bold;font-size: 20px">价格:</span>
|
||||||
|
{{connector.connectorPrice}}/次<br>
|
||||||
|
|
||||||
|
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testPhone()" v-if="connector.connectorName=='手机号查询归属地'">测试API</el-button>
|
||||||
|
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testIP()" v-if="connector.connectorName=='IP查询归属地'">测试API</el-button>
|
||||||
|
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testNews()" v-if="connector.connectorName=='新闻头条'">测试API</el-button>
|
||||||
|
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testWeather()" v-if="connector.connectorName=='气象预警'">测试API</el-button>
|
||||||
|
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testBirthdate()" v-if="connector.connectorName=='生辰助手'">测试API</el-button>
|
||||||
|
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testMailbox()" v-if="connector.connectorName=='邮编查询'">测试API</el-button>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<!-- 手机号查询归属地-->
|
||||||
|
<el-dialog title="手机查询归属地" :visible.sync="dialogFormVisible">
|
||||||
|
<el-form :model="formInline">
|
||||||
|
<el-form-item label="手机号" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="formInline.tel" autocomplete="off" placeholder="请输入手机号"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<span style="font-weight: bold;font-size: 20px" v-if="formInline.reason==true">
|
||||||
|
省份:{{this.formInline.province}}<br>
|
||||||
|
城市:{{this.formInline.city}}<br>
|
||||||
|
区号:{{this.formInline.areacode}}<br>
|
||||||
|
邮编:{{this.formInline.zip}}<br>
|
||||||
|
运营商:{{this.formInline.company}}<br>
|
||||||
|
</span>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="phonePlace()">发起请求</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!--IP查询归属地-->
|
||||||
|
<el-dialog title="IP查询归属地" :visible.sync="dialogFormVisible1">
|
||||||
|
<el-form :model="formIp">
|
||||||
|
<el-form-item label="IP" >
|
||||||
|
<el-input v-model="formIp.ip" autocomplete="off" placeholder="请输入ip"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<span style="font-weight: bold;font-size: 20px" v-if="formIp.reason==true">
|
||||||
|
国家:{{this.formIp.country}}<br>
|
||||||
|
省份:{{this.formIp.province}}<br>
|
||||||
|
城市:{{this.formIp.city}}<br>
|
||||||
|
运营商:{{this.formIp.isp}}<br>
|
||||||
|
</span>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="getIpPlace()">发起请求</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<!-- 新闻头条-->
|
||||||
|
<el-dialog title="新闻头条" :visible.sync="dialogTableVisible">
|
||||||
|
<el-table :data="gridData">
|
||||||
|
<el-table-column property="title" label="新闻标题" width="150"></el-table-column>
|
||||||
|
<el-table-column property="date" label="新闻时间" width="200"></el-table-column>
|
||||||
|
<el-table-column property="category" label="新闻分类"></el-table-column>
|
||||||
|
<el-table-column property="authorName" label="新闻来源"></el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!--生辰助手-->
|
||||||
|
<el-dialog title="生辰助手" :visible.sync="dialogFormVisible2">
|
||||||
|
<el-form :model="formBirthday">
|
||||||
|
<el-form-item label="年" >
|
||||||
|
<el-input v-model="formBirthday.year" autocomplete="off" placeholder="请输入年份"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="月" >
|
||||||
|
<el-input v-model="formBirthday.month" autocomplete="off" placeholder="请输入月份"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="日" >
|
||||||
|
<el-input v-model="formBirthday.day" autocomplete="off" placeholder="请输入几号"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="时" >
|
||||||
|
<el-input v-model="formBirthday.hour" autocomplete="off" placeholder="请输入几点"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<span style="font-weight: bold;font-size: 20px" v-if="formBirthday.reason==true">
|
||||||
|
years: {{this.formBirthday.years}}<br>
|
||||||
|
months: {{this.formBirthday.months}}<br>
|
||||||
|
days: {{this.formBirthday.days}}<br>
|
||||||
|
animal: {{this.formBirthday.animal}}<br>
|
||||||
|
imonthcn: {{this.formBirthday.imonthcn}}<br>
|
||||||
|
idaycn: {{this.formBirthday.idaycn}}<br>
|
||||||
|
cyear: {{this.formBirthday.cyear}}<br>
|
||||||
|
cmonth: {{this.formBirthday.cmonth}}<br>
|
||||||
|
cday: {{this.formBirthday.cday}}<br>
|
||||||
|
gzyear: {{this.formBirthday.gzyear}}<br>
|
||||||
|
gzmonth: {{this.formBirthday.gzmonth}}<br>
|
||||||
|
gzday: {{this.formBirthday.gzday}}<br>
|
||||||
|
isleap: {{this.formBirthday.isleap}}<br>
|
||||||
|
ncweek: {{this.formBirthday.ncweek}}<br>
|
||||||
|
isterm: {{this.formBirthday.isterm}}<br>
|
||||||
|
term: {{this.formBirthday.term}}<br>
|
||||||
|
astro: {{this.formBirthday.astro}}<br>
|
||||||
|
eightall: {{this.formBirthday.eightall}}<br>
|
||||||
|
fiveall: {{this.formBirthday.fiveall}}
|
||||||
|
</span>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="getBirthday()">发起请求</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!--邮编查询-->
|
||||||
|
<el-dialog title="邮编查询" :visible.sync="dialogFormVisible3">
|
||||||
|
<el-form :model="formPostCode">
|
||||||
|
<el-form-item label="邮编" >
|
||||||
|
<el-input v-model="formPostCode.code" autocomplete="off" placeholder="请输入邮编"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-table :data="gridData2" v-if="formPostCode.reason==true">
|
||||||
|
<el-table-column property="postNumber" label="邮编" width="150"></el-table-column>
|
||||||
|
<el-table-column property="province" label="省" width="200"></el-table-column>
|
||||||
|
<el-table-column property="city" label="市"></el-table-column>
|
||||||
|
<el-table-column property="district" label="区"></el-table-column>
|
||||||
|
<el-table-column property="address" label="县"></el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="getPostcode()">发起请求</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 气象预警-->
|
||||||
|
<el-dialog title="气象预警" :visible.sync="dialogFormVisible4">
|
||||||
|
<el-aside width="100%">
|
||||||
|
<el-tree :data="data" :props="defaultProps">
|
||||||
|
<template slot-scope="{data,node}">
|
||||||
|
<span>{{data.provinceName}}{{data.cityName}}--{{data.cityCode}}</span>
|
||||||
|
</template>
|
||||||
|
</el-tree>
|
||||||
|
</el-aside>
|
||||||
|
</el-dialog>
|
||||||
|
<!-- 购买-->
|
||||||
|
<el-dialog title="购买API" :visible.sync="dialogFormVisible5">
|
||||||
|
<el-form :model="buyForm">
|
||||||
|
<el-form-item label="产品编号" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="buyForm.connectorId" autocomplete="off" readonly></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="产品名称" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="buyForm.connectorName" autocomplete="off" readonly></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="产品介绍" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="buyForm.connectorDescribe" autocomplete="off" readonly></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="产品价格" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="buyForm.connectorPrice" autocomplete="off" readonly></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="产品公司" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="buyForm.connectorCompany" autocomplete="off" readonly></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="API_URL" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="buyForm.connectorApiurl" autocomplete="off" readonly></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="API_EYE" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="buyForm.connectorApikey" autocomplete="off" readonly></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="请求方式" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="buyForm.connectorRequest" autocomplete="off" readonly></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="购买次数" :label-width="formLabelWidth">
|
||||||
|
<el-input-number v-model="buyForm.connectorFrequency" controls-position="right" @change="handleChange" :min="1"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<p style="font-weight: bold;font-size: 20px">余额:{{ userBalanceData.userBalance || '加载中...' }}</p>
|
||||||
|
<span style="font-weight: bold;font-size: 20px">共计:{{buyForm.connectorPrice*buyForm.connectorFrequency}}元</span>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="buyInterface()">购 买</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -7,6 +197,16 @@
|
||||||
<script>
|
<script>
|
||||||
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||||
//例如:import 《组件名称》 from '《组件路径》,
|
//例如:import 《组件名称》 from '《组件路径》,
|
||||||
|
import {findApiList} from "@/api/port/port";
|
||||||
|
import index from "vuex";
|
||||||
|
import {phonePlace} from "@/api/port/port";
|
||||||
|
import {getIpPlace} from "@/api/port/port";
|
||||||
|
import {getHeadlines} from "@/api/port/port";
|
||||||
|
import {getBirthday} from "@/api/port/port";
|
||||||
|
import {getPostcode} from "@/api/port/port";
|
||||||
|
import {getWeather} from "@/api/port/port";
|
||||||
|
import {doBuyInterface} from "@/api/port/port";
|
||||||
|
import {userBalance} from "@/api/system/user";
|
||||||
export default {
|
export default {
|
||||||
//import引入的组件需要注入到对象中才能使用"
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
components: {},
|
components: {},
|
||||||
|
@ -14,16 +214,234 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
//这里存放数据"
|
//这里存放数据"
|
||||||
|
|
||||||
return {};
|
return {
|
||||||
|
userBalanceData: {
|
||||||
|
userBalance: '加载中...'
|
||||||
|
},
|
||||||
|
formWeather:{},
|
||||||
|
data:[],
|
||||||
|
defaultProps: {
|
||||||
|
children:"citys",
|
||||||
|
label:'provinceName',
|
||||||
|
},
|
||||||
|
connectorList:[],
|
||||||
|
gridData:[],
|
||||||
|
gridData2:[],
|
||||||
|
form:{},
|
||||||
|
// 邮编查询
|
||||||
|
formPostCode:{
|
||||||
|
code:"",
|
||||||
|
// postNumber:"",
|
||||||
|
// province:"",
|
||||||
|
// city:"",
|
||||||
|
// district:"",
|
||||||
|
// address:"",
|
||||||
|
reason:"",
|
||||||
|
},
|
||||||
|
// 手机号查询归属地formInline
|
||||||
|
formInline:{
|
||||||
|
tel:"",
|
||||||
|
province:"",
|
||||||
|
city:"",
|
||||||
|
areacode:"",
|
||||||
|
zip:"",
|
||||||
|
company:"",
|
||||||
|
reason:"",
|
||||||
|
},
|
||||||
|
|
||||||
|
formIp:{
|
||||||
|
ip:"",
|
||||||
|
country:"",
|
||||||
|
province:"",
|
||||||
|
city:"",
|
||||||
|
isp:"",
|
||||||
|
reason:"",
|
||||||
|
},
|
||||||
|
formBirthday:{
|
||||||
|
year:"",
|
||||||
|
month:"",
|
||||||
|
day:"",
|
||||||
|
hour:"",
|
||||||
|
years:"",
|
||||||
|
months:"",
|
||||||
|
days:"",
|
||||||
|
animal:"",
|
||||||
|
imonthcn:"",
|
||||||
|
idaycn:"",
|
||||||
|
cyear:"",
|
||||||
|
cmonth:"",
|
||||||
|
cday:"",
|
||||||
|
gzyear:"",
|
||||||
|
gzmonth:"",
|
||||||
|
gzday:"",
|
||||||
|
isleap:"",
|
||||||
|
ncweek:"",
|
||||||
|
isterm:"",
|
||||||
|
term:"",
|
||||||
|
astro:"",
|
||||||
|
eightall:"",
|
||||||
|
fiveall:"",
|
||||||
|
reason:"",
|
||||||
|
},
|
||||||
|
formNews:{
|
||||||
|
news:"",
|
||||||
|
reason:"",
|
||||||
|
},
|
||||||
|
buyForm:{},
|
||||||
|
// IP查询归属地
|
||||||
|
dialogFormVisible:false,
|
||||||
|
dialogFormVisible1:false,
|
||||||
|
dialogFormVisible2:false,
|
||||||
|
dialogFormVisible3:false,
|
||||||
|
dialogFormVisible4:false,
|
||||||
|
dialogFormVisible5:false,
|
||||||
|
dialogTableVisible:false,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
//计算属性 类似于data概念",
|
//计算属性 类似于data概念",
|
||||||
computed: {},
|
computed: {
|
||||||
|
index() {
|
||||||
|
return index
|
||||||
|
},
|
||||||
|
node() {
|
||||||
|
return node
|
||||||
|
}
|
||||||
|
},
|
||||||
//监控data中的数据变化",
|
//监控data中的数据变化",
|
||||||
watch: {},
|
watch: {},
|
||||||
//方法集合",
|
//方法集合",
|
||||||
methods: {},
|
methods: {
|
||||||
|
async fetchUserBalance() {
|
||||||
|
try {
|
||||||
|
const userId = localStorage.getItem('userId');
|
||||||
|
console.log(userId)// 登录后把userId存到了localStorage
|
||||||
|
if (!userId) {
|
||||||
|
this.userBalanceData = {userBalance: '未登录'};
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const response = await userBalance(userId);
|
||||||
|
if (response.data) {
|
||||||
|
console.log(response.data)
|
||||||
|
this.userBalanceData.userBalance = response.data;
|
||||||
|
} else {
|
||||||
|
this.userBalanceData.userBalance = {userBalance: '获取失败'};
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
this.userBalanceData = {userBalance: '获取失败'};
|
||||||
|
console.error('Error fetching user balance:', error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
buyInterface(){
|
||||||
|
doBuyInterface(this.buyForm).then((res)=>{
|
||||||
|
console.log(res);
|
||||||
|
alert(res.msg);
|
||||||
|
this.dialogFormVisible5=false;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//购买
|
||||||
|
buy(connector){
|
||||||
|
this.buyForm=connector;
|
||||||
|
this.dialogFormVisible5=true;
|
||||||
|
},
|
||||||
|
// 气象预警
|
||||||
|
testWeather(){
|
||||||
|
|
||||||
|
getWeather().then((res)=>{
|
||||||
|
this.data=res.data;
|
||||||
|
|
||||||
|
this.dialogFormVisible4=true;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 邮编查询
|
||||||
|
getPostcode(){
|
||||||
|
getPostcode(this.formPostCode.code).then((res)=>{
|
||||||
|
console.log(res.data);
|
||||||
|
this.gridData2=res.data;
|
||||||
|
this.formPostCode.reason=true;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
testMailbox(){
|
||||||
|
this.dialogFormVisible3=true;
|
||||||
|
},
|
||||||
|
getBirthday(){
|
||||||
|
getBirthday(this.formBirthday).then((res)=>{
|
||||||
|
console.log(res.data);
|
||||||
|
this.formBirthday.reason=true;
|
||||||
|
this.formBirthday.years=res.data.years;
|
||||||
|
this.formBirthday.months=res.data.months;
|
||||||
|
this.formBirthday.days=res.data.days;
|
||||||
|
this.formBirthday.animal=res.data.animal;
|
||||||
|
this.formBirthday.imonthcn=res.data.imonthcn;
|
||||||
|
this.formBirthday.idaycn=res.data.idaycn;
|
||||||
|
this.formBirthday.cyear=res.data.cyear;
|
||||||
|
this.formBirthday.cmonth=res.data.cmonth;
|
||||||
|
this.formBirthday.cday=res.data.cday;
|
||||||
|
this.formBirthday.gzyear=res.data.gzyear;
|
||||||
|
this.formBirthday.gzmonth=res.data.gzmonth;
|
||||||
|
this.formBirthday.gzday=res.data.gzday;
|
||||||
|
this.formBirthday.isleap=res.data.isleap;
|
||||||
|
this.formBirthday.ncweek=res.data.ncweek;
|
||||||
|
this.formBirthday.isterm=res.data.isterm;
|
||||||
|
this.formBirthday.term=res.data.term;
|
||||||
|
this.formBirthday.astro=res.data.astro;
|
||||||
|
this.formBirthday.eightall=res.data.eightall;
|
||||||
|
this.formBirthday.fiveall=res.data.fiveall;
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
testBirthdate(){
|
||||||
|
this.dialogFormVisible2=true;
|
||||||
|
},
|
||||||
|
testNews(){
|
||||||
|
getHeadlines().then((res)=>{
|
||||||
|
this.gridData=res.data;
|
||||||
|
this.dialogTableVisible=true;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getIpPlace(){
|
||||||
|
getIpPlace(this.formIp.ip).then((res)=>{
|
||||||
|
console.log(res.data);
|
||||||
|
if (200==res.code){
|
||||||
|
this.formIp.country=res.data.country;
|
||||||
|
this.formIp.province=res.data.province;
|
||||||
|
this.formIp.city=res.data.city;
|
||||||
|
this.formIp.isp=res.data.isp;
|
||||||
|
this.formIp.reason=true;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
testIP(ip){
|
||||||
|
this.formIp.ip=ip;
|
||||||
|
this.dialogFormVisible1=true;
|
||||||
|
},
|
||||||
|
testPhone(tel){
|
||||||
|
this.formInline.tel=tel;
|
||||||
|
this.dialogFormVisible=true;
|
||||||
|
},
|
||||||
|
phonePlace(){
|
||||||
|
phonePlace(this.formInline.tel).then((res)=>{
|
||||||
|
console.log(res.data);
|
||||||
|
if (200==res.code){
|
||||||
|
this.formInline.province=res.data.province;
|
||||||
|
this.formInline.city=res.data.city;
|
||||||
|
this.formInline.areacode=res.data.areacode;
|
||||||
|
this.formInline.zip=res.data.zip;
|
||||||
|
this.formInline.company=res.data.company;
|
||||||
|
this.formInline.reason=true;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
findApiList(){
|
||||||
|
findApiList(this.form).then((res)=>{
|
||||||
|
this.connectorList=res.data;
|
||||||
|
console.log(res.data);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
//生命周期 - 创建完成(可以访问当前this实例)",
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
created() {
|
created() {
|
||||||
|
this.fetchUserBalance();
|
||||||
|
this.findApiList();
|
||||||
},
|
},
|
||||||
//生命周期 - 挂载完成(可以访问DOM元素)",
|
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
|
@ -62,22 +62,6 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column
|
|
||||||
label="剩余次数"
|
|
||||||
width="150">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span style="margin-left: 10px">{{ scope.row.connectorResidueDegree }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column
|
|
||||||
label="购买次数"
|
|
||||||
width="150">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span style="margin-left: 10px">{{ scope.row.connectorFrequency }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="状态"
|
label="状态"
|
||||||
width="150">
|
width="150">
|
||||||
|
@ -140,17 +124,22 @@
|
||||||
<el-input v-model="formLabelAlign.connectorCompany" autocomplete="off"></el-input>
|
<el-input v-model="formLabelAlign.connectorCompany" autocomplete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="剩余次数" :label-width="formLabelWidth">
|
<el-form-item label="价格" :label-width="formLabelWidth">
|
||||||
<el-input v-model="formLabelAlign.connectorResidueDegree" autocomplete="off"></el-input>
|
<el-input v-model="formLabelAlign.connectorPrice" autocomplete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="购买次数" :label-width="formLabelWidth">
|
<el-form-item label="API_URL" :label-width="formLabelWidth">
|
||||||
<el-input v-model="formLabelAlign.connectorFrequency" autocomplete="off"></el-input>
|
<el-input v-model="formLabelAlign.connectorApiurl" autocomplete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="测试地址" :label-width="formLabelWidth">
|
<el-form-item label="API_EYE" :label-width="formLabelWidth">
|
||||||
<el-input v-model="formLabelAlign.connectorAddress" autocomplete="off"></el-input>
|
<el-input v-model="formLabelAlign.connectorApikey" autocomplete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="请求方式" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="formLabelAlign.connectorRequest" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="addConnector">确 定</el-button>
|
<el-button type="primary" @click="addConnector">确 定</el-button>
|
||||||
|
@ -184,22 +173,34 @@
|
||||||
<el-input v-model="formInline.connectorCompany" autocomplete="off"></el-input>
|
<el-input v-model="formInline.connectorCompany" autocomplete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="剩余次数" :label-width="formLabelWidth">
|
<!-- <el-form-item label="剩余次数" :label-width="formLabelWidth">-->
|
||||||
<el-input v-model="formInline.connectorResidueDegree" autocomplete="off"></el-input>
|
<!-- <el-input v-model="formInline.connectorResidueDegree" autocomplete="off"></el-input>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
|
||||||
|
<!-- <el-form-item label="购买次数" :label-width="formLabelWidth">-->
|
||||||
|
<!-- <el-input v-model="formInline.connectorFrequency" autocomplete="off"></el-input>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
|
||||||
|
<el-form-item label="API_URL" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="formInline.connectorApiurl" autocomplete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="购买次数" :label-width="formLabelWidth">
|
<el-form-item label="API_EYE" :label-width="formLabelWidth">
|
||||||
<el-input v-model="formInline.connectorFrequency" autocomplete="off"></el-input>
|
<el-input v-model="formInline.connectorApikey" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="请求方式" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="formInline.connectorRequest" autocomplete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="状态" :label-width="formLabelWidth">
|
<el-form-item label="状态" :label-width="formLabelWidth">
|
||||||
|
|
||||||
<el-select v-model="formInline.connectorStatus" placeholder="请审核">
|
<el-select v-model="formInline.connectorStatus" placeholder="请审核">
|
||||||
<el-option label="审核中" value="0">审核中</el-option>
|
<el-option label="审核中" value="0">审核中</el-option>
|
||||||
<el-option label="审核成功" value="1">审核成功</el-option>
|
<el-option label="审核成功" value="1">审核成功</el-option>
|
||||||
<el-option label="审核失败" value="2">审核失败</el-option>
|
<el-option label="审核失败" value="2">审核失败</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="updateConnector">确 定</el-button>
|
<el-button type="primary" @click="updateConnector">确 定</el-button>
|
||||||
|
|
|
@ -0,0 +1,495 @@
|
||||||
|
<template>
|
||||||
|
<div class="dashboard-container">
|
||||||
|
<p>选择节点</p>
|
||||||
|
<div class="antvBox">
|
||||||
|
<div class="menu-list">
|
||||||
|
<div v-for="item in moduleList"
|
||||||
|
:key="item.id"
|
||||||
|
draggable="true"
|
||||||
|
@dragend="handleDragEnd($event, item)">
|
||||||
|
<img :src="item.image" alt="" />
|
||||||
|
<p>{{ item.name }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="canvas-card">
|
||||||
|
<div id="container" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-button @click="save()">提交</el-button>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 添加任务详情设计-->
|
||||||
|
<el-dialog title="添加表" :visible.sync="taskInputForm" width="70%">
|
||||||
|
<formData v-if="formData" :group="graph" :node-id="nodeId" :taskInputForm="taskInputForm"
|
||||||
|
:nodeName="nodeName" :tableInfo="tableInfo" @taskInputForm="findFormValue"></formData>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 联查弹窗-->
|
||||||
|
<el-dialog title="联查" :visible.sync="taskInputJoin" width="70%">
|
||||||
|
<formJoin v-if="formJoin" :group="graph" :node-id="nodeId"
|
||||||
|
:nodeName="nodeName" :neighbors="neighbors"
|
||||||
|
:taskId="taskId" :taskInputJoin="taskInputJoin" @saveTaskJoin="findFormValue"></formJoin>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 数据输出弹窗-->
|
||||||
|
<el-dialog title="数据输出" :visible.sync="taskDataOutPut" width="70%">
|
||||||
|
<dataOutInput v-if="formOut" taskDataOutPut:taskDataOutPut></dataOutInput>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import { Graph } from "@antv/x6";
|
||||||
|
import { findByNodeId } from '@/api/task/task'
|
||||||
|
import formData from '/src/views/components/task/formData.vue'
|
||||||
|
import formJoin from '/src/views/components/task/formJoin.vue'
|
||||||
|
import dataOutInput from '/src/views/components/task/formDataOut.vue'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "antvX6",
|
||||||
|
components:{
|
||||||
|
formData,
|
||||||
|
formJoin,
|
||||||
|
dataOutInput,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
//数据输出弹窗界面
|
||||||
|
taskDataOutPut:false,
|
||||||
|
//任务设计添加表弹窗
|
||||||
|
taskInputAdd:false,
|
||||||
|
//联查界面
|
||||||
|
taskInputJoin:false,
|
||||||
|
//选择字段弹窗
|
||||||
|
taskInputFieldAdd:false,
|
||||||
|
//连再联查的节点id
|
||||||
|
neighbors:[],
|
||||||
|
//记录表信息
|
||||||
|
tableInfo:{},
|
||||||
|
//画布节点选项
|
||||||
|
moduleList: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
name: "开始",
|
||||||
|
image: require("@/assets/img/1.png"),
|
||||||
|
data:{}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
name: "表",
|
||||||
|
image: require("@/assets/img/2.png"),
|
||||||
|
data:{
|
||||||
|
databaseId:null,
|
||||||
|
tableName:null,
|
||||||
|
zd:null,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
name: "联查",
|
||||||
|
image: require("@/assets/img/3.png"),
|
||||||
|
data:{}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
name: "数据输出",
|
||||||
|
image: require("@/assets/img/4.png"),
|
||||||
|
data:{}
|
||||||
|
},
|
||||||
|
],
|
||||||
|
//画布
|
||||||
|
graph:null,
|
||||||
|
//节点id
|
||||||
|
nodeId:null,
|
||||||
|
nodeName:null,
|
||||||
|
|
||||||
|
//添加表弹窗
|
||||||
|
taskInputForm:false,
|
||||||
|
formData:false,
|
||||||
|
formJoin:false,
|
||||||
|
formOut:false,
|
||||||
|
taskId:this.$route.params.id,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//初始化
|
||||||
|
mounted() {
|
||||||
|
this.initGraph();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
findFormValue(){
|
||||||
|
this.formData=false;
|
||||||
|
this.taskInputForm=false;
|
||||||
|
this.taskInputJoin=false;
|
||||||
|
},
|
||||||
|
|
||||||
|
//保存画布,并提交
|
||||||
|
save() {
|
||||||
|
console.log(this.graph.toJSON(), "graph");
|
||||||
|
console.log(this.graph.getNodes(), "node");
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
nodeAddEvent() {
|
||||||
|
const { graph } = this;
|
||||||
|
const container = document.getElementById("container");
|
||||||
|
const changePortsVisible = (visible) => {
|
||||||
|
const ports = container.querySelectorAll(".x6-port-body");
|
||||||
|
for (let i = 0, len = ports.length; i < len; i = i + 1) {
|
||||||
|
ports[i].style.visibility = visible ? "visible" : "hidden";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//左键单击事件
|
||||||
|
this.graph.on("node:click",(evt)=>{
|
||||||
|
const data = evt.node.store.data;
|
||||||
|
const thisData = data.attrs.label.textWrap.text;
|
||||||
|
this.nodeId = data.id;
|
||||||
|
this.nodeName = thisData;
|
||||||
|
if(thisData == "表"){
|
||||||
|
findByNodeId(this.nodeId).then(res=>{
|
||||||
|
this.tableInfo={};
|
||||||
|
this.tableInfo.taskId = this.taskId;
|
||||||
|
if(res.code == 200 && res.data!=null){
|
||||||
|
this.tableInfo = res.data;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
//TODO man
|
||||||
|
this.taskInputForm = true;
|
||||||
|
this.formData = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(thisData == "联查"){
|
||||||
|
// 获取与当前节点相连的所有边
|
||||||
|
const edges = this.graph.getEdges().filter(edge => {
|
||||||
|
return edge.getSourceNode().id === data.id || edge.getTargetNode().id === data.id;
|
||||||
|
});
|
||||||
|
// 遍历边,找到相连的节点(注意排除当前节点本身)
|
||||||
|
const neighbors = [];
|
||||||
|
edges.forEach(edge => {
|
||||||
|
const otherNodeId = edge.getSourceNode().id === data.id ? edge.getTargetNode().id : edge.getSourceNode().id;
|
||||||
|
if (!neighbors.includes(otherNodeId)) {
|
||||||
|
neighbors.push(otherNodeId); // 或者你可以推送整个节点对象,而不是仅ID
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 现在neighbors数组包含了所有与当前节点相连的节点的ID
|
||||||
|
console.log('相连节点的ID:', neighbors);
|
||||||
|
this.neighbors = neighbors;
|
||||||
|
this.taskInputJoin = true;
|
||||||
|
this.formJoin = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(thisData == "数据输出"){
|
||||||
|
this.taskDataOutPut = true;
|
||||||
|
this.formOut = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
this.graph.on("node:mouseenter", () => {
|
||||||
|
changePortsVisible(true);
|
||||||
|
});
|
||||||
|
this.graph.on("node:mouseleave", () => {
|
||||||
|
changePortsVisible(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 节点绑定右键点击事件
|
||||||
|
this.graph.on("node:contextmenu", ({ e, x, y, node, view }) => {
|
||||||
|
console.log("点击!!!", node);
|
||||||
|
// 判断是否有选中过节点
|
||||||
|
if (this.curSelectNode) {
|
||||||
|
// 移除选中状态
|
||||||
|
this.curSelectNode.removeTools();
|
||||||
|
// 判断两次选中节点是否相同
|
||||||
|
if (this.curSelectNode !== node) {
|
||||||
|
node.addTools([
|
||||||
|
{
|
||||||
|
name: "boundary",
|
||||||
|
args: {
|
||||||
|
attrs: {
|
||||||
|
fill: "#16B8AA",
|
||||||
|
stroke: "#2F80EB",
|
||||||
|
strokeWidth: 1,
|
||||||
|
fillOpacity: 0.1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "button-remove",
|
||||||
|
args: {
|
||||||
|
x: "100%",
|
||||||
|
y: 0,
|
||||||
|
offset: {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
this.curSelectNode = node;
|
||||||
|
} else {
|
||||||
|
this.curSelectNode = null;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.curSelectNode = node;
|
||||||
|
node.addTools([
|
||||||
|
{
|
||||||
|
name: "boundary",
|
||||||
|
args: {
|
||||||
|
attrs: {
|
||||||
|
fill: "#16B8AA",
|
||||||
|
stroke: "#2F80EB",
|
||||||
|
strokeWidth: 1,
|
||||||
|
fillOpacity: 0.1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "button-remove",
|
||||||
|
args: {
|
||||||
|
x: "100%",
|
||||||
|
y: 0,
|
||||||
|
offset: {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//双击事件
|
||||||
|
this.graph.on('node:dblclick', (evt) => {
|
||||||
|
const data = evt.node.store.data;
|
||||||
|
console.log(data);
|
||||||
|
// this.showNodeForm(data);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 连线绑定悬浮事件
|
||||||
|
this.graph.on("cell:mouseenter", ({ cell }) => {
|
||||||
|
if (cell.shape == "edge") {
|
||||||
|
cell.addTools([
|
||||||
|
{
|
||||||
|
name: "button-remove",
|
||||||
|
args: {
|
||||||
|
x: "100%",
|
||||||
|
y: 0,
|
||||||
|
offset: {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
cell.setAttrs({
|
||||||
|
line: {
|
||||||
|
stroke: "#409EFF",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
cell.zIndex = 99; // 保证当前悬停的线在最上层,不会被遮挡
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.graph.on("cell:mouseleave", ({ cell }) => {
|
||||||
|
if (cell.shape === "edge") {
|
||||||
|
cell.removeTools();
|
||||||
|
cell.setAttrs({
|
||||||
|
line: {
|
||||||
|
stroke: "black",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
cell.zIndex = 1; // 保证未悬停的线在下层,不会遮挡悬停的线
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 拖动后松开鼠标触发事件
|
||||||
|
handleDragEnd(e, item) {
|
||||||
|
// console.log(e); // 可以获取到最后拖动后松开鼠标时的坐标和拖动的节点相关信息
|
||||||
|
this.addHandleNode(
|
||||||
|
e.pageX - 500,
|
||||||
|
e.pageY - 200,
|
||||||
|
new Date().getTime(),
|
||||||
|
item.image,
|
||||||
|
item.name,
|
||||||
|
item.data
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
//添加节点到画布
|
||||||
|
addHandleNode(x, y, id, image, name ,data) {
|
||||||
|
this.graph.addNode({
|
||||||
|
id: id,
|
||||||
|
shape: "image", // 指定使用何种图形,默认值为 'rect'
|
||||||
|
x: x,
|
||||||
|
y: y,
|
||||||
|
width: 60,
|
||||||
|
height: 60,
|
||||||
|
imageUrl: image,
|
||||||
|
attrs: {
|
||||||
|
body: {
|
||||||
|
stroke: "#ffa940",
|
||||||
|
fill: "#ffd591",
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
textWrap: {
|
||||||
|
width: 90,
|
||||||
|
text: name,
|
||||||
|
},
|
||||||
|
fill: "black",
|
||||||
|
fontSize: 12,
|
||||||
|
refX: 0.5,
|
||||||
|
refY: "100%",
|
||||||
|
refY2: 4,
|
||||||
|
textAnchor: "middle",
|
||||||
|
textVerticalAnchor: "top",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ports: {
|
||||||
|
groups: {
|
||||||
|
group1: {
|
||||||
|
position: [30, 30],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
group: "group1",
|
||||||
|
id: "port1",
|
||||||
|
attrs: {
|
||||||
|
circle: {
|
||||||
|
r: 6,
|
||||||
|
magnet: true,
|
||||||
|
stroke: "#ffffff",
|
||||||
|
strokeWidth: 2,
|
||||||
|
fill: "#5F95FF",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
zIndex: 10,
|
||||||
|
data:data,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//初始化
|
||||||
|
initGraph() {
|
||||||
|
const container = document.getElementById("container");
|
||||||
|
this.graph = new Graph({
|
||||||
|
container: container, // 画布容器
|
||||||
|
width: container.offsetWidth, // 画布宽
|
||||||
|
height: container.offsetHeight, // 画布高
|
||||||
|
background: false, // 背景(透明)
|
||||||
|
snapline: true, // 对齐线
|
||||||
|
// 配置连线规则
|
||||||
|
connecting: {
|
||||||
|
snap: true, // 自动吸附
|
||||||
|
allowBlank: false, // 是否允许连接到画布空白位置的点
|
||||||
|
allowMulti: true, // 是否允许在相同的起始节点和终止之间创建多条边
|
||||||
|
allowLoop: true, // 是否允许创建循环连线,即边的起始节点和终止节点为同一节点
|
||||||
|
highlight: true, // 拖动边时,是否高亮显示所有可用的节点
|
||||||
|
highlighting: {
|
||||||
|
magnetAdsorbed: {
|
||||||
|
name: "stroke",
|
||||||
|
args: {
|
||||||
|
attrs: {
|
||||||
|
fill: "#5F95FF",
|
||||||
|
stroke: "#5F95FF",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
router: {
|
||||||
|
// 对路径添加额外的点
|
||||||
|
name: "orth",
|
||||||
|
},
|
||||||
|
connector: {
|
||||||
|
// 边渲染到画布后的样式
|
||||||
|
name: "rounded",
|
||||||
|
args: {
|
||||||
|
radius: 8,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
panning: {
|
||||||
|
enabled: false,
|
||||||
|
},
|
||||||
|
mousewheel: {
|
||||||
|
enabled: true, // 支持滚动放大缩小
|
||||||
|
zoomAtMousePosition: true,
|
||||||
|
modifiers: "ctrl",
|
||||||
|
minScale: 0.5,
|
||||||
|
maxScale: 3,
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
type: "dot",
|
||||||
|
size: 20, // 网格大小 10px
|
||||||
|
visible: true, // 渲染网格背景
|
||||||
|
args: {
|
||||||
|
color: "#a0a0a0", // 网格线/点颜色
|
||||||
|
thickness: 2, // 网格线宽度/网格点大小
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
this.nodeAddEvent();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.dashboard-container {
|
||||||
|
.antvBox {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
color: black;
|
||||||
|
padding-top: 20px;
|
||||||
|
.menu-list {
|
||||||
|
height: 100%;
|
||||||
|
width: 300px;
|
||||||
|
padding: 0 10px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-content: flex-start;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
> div {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 0 10px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
cursor: pointer;
|
||||||
|
color: black;
|
||||||
|
width: 105px;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
justify-content: center;
|
||||||
|
img {
|
||||||
|
height: 50px;
|
||||||
|
width: 50px;
|
||||||
|
}
|
||||||
|
P {
|
||||||
|
width: 90px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.canvas-card {
|
||||||
|
width: 1700px;
|
||||||
|
height: 750px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
> div {
|
||||||
|
width: 1400px;
|
||||||
|
height: 750px;
|
||||||
|
border: 2px dashed #2149ce;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,733 @@
|
||||||
|
<template>
|
||||||
|
<div class="dashboard-container">
|
||||||
|
<p>选择节点</p>
|
||||||
|
<div class="antvBox">
|
||||||
|
<div class="menu-list">
|
||||||
|
<div v-for="item in moduleList"
|
||||||
|
:key="item.id"
|
||||||
|
draggable="true"
|
||||||
|
@dragend="handleDragEnd($event, item)">
|
||||||
|
<img :src="item.image" alt="" />
|
||||||
|
<p>{{ item.name }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="canvas-card">
|
||||||
|
<div id="container" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-button @click="save()">提交</el-button>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 添加任务详情设计-->
|
||||||
|
<el-dialog title="添加表" :visible.sync="taskInputForm" width="70%">
|
||||||
|
<formData v-if="this.formData" :group="graph" :node-id="nodeId" :formData="taskInputForm" @taskInputAdd="taskInputAdd"></formData>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- <el-form label-width="80px" :model="tableInfo" ref="queryForm" :inline="true" class="demo-form-inline" size="small">-->
|
||||||
|
<!-- <el-form-item label="任务id">-->
|
||||||
|
<!-- <el-input v-model="tableInfo.taskId"></el-input>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
|
||||||
|
<!-- <el-form-item label="数据库id">-->
|
||||||
|
<!-- <el-input v-model="tableInfo.basicId"></el-input>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!--<!– <el-form-item label="数据表">–>-->
|
||||||
|
|
||||||
|
<!--<!– <div class="block">–>-->
|
||||||
|
<!--<!– <span class="demonstration">选择数据表</span>–>-->
|
||||||
|
<!--<!– <el-cascader–>-->
|
||||||
|
<!--<!– v-model="value"–>-->
|
||||||
|
<!--<!– :options="tableList"–>-->
|
||||||
|
<!--<!– @change="handleChange(value)"></el-cascader>–>-->
|
||||||
|
<!--<!– </div>–>-->
|
||||||
|
|
||||||
|
<!--<!– <el-aside width="30%">-->
|
||||||
|
<!-- <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>-->
|
||||||
|
<!-- </el-aside>–>-->
|
||||||
|
<!-- <el-form-item>-->
|
||||||
|
<!-- <el-select v-model="tableInfo.tableName" placeholder="请选择等级">-->
|
||||||
|
<!-- <el-option style="height: 100%" :value="tableInfo.tableName">-->
|
||||||
|
<!-- <el-aside width="100%">-->
|
||||||
|
<!-- <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>-->
|
||||||
|
<!-- </el-aside>-->
|
||||||
|
<!-- </el-option>-->
|
||||||
|
|
||||||
|
<!--<!– <el-option label="请选择" value="0"></el-option>–>-->
|
||||||
|
<!--<!– <span v-for="table in tableList">–>-->
|
||||||
|
<!--<!– <el-option :label=table.tableName :value=table.id :key=table.id></el-option>–>-->
|
||||||
|
<!--<!– </span>–>-->
|
||||||
|
<!-- </el-select>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!-- <el-form-item label="表别名">-->
|
||||||
|
<!-- <el-input v-model="tableInfo.tableAsName"></el-input>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!-- </el-form>-->
|
||||||
|
|
||||||
|
<!-- <div slot="footer" class="dialog-footer">-->
|
||||||
|
<!-- <el-button @click="taskInputAdd = false">取 消</el-button>-->
|
||||||
|
<!-- <el-button type="primary" @click="addTaskInput()">下一步</el-button>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
|
||||||
|
<!-- </el-dialog>-->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <!– 字段选择列表–>-->
|
||||||
|
<!-- <el-dialog title="添加表" :visible.sync="taskInputFieldAdd">-->
|
||||||
|
|
||||||
|
<!-- <el-table-->
|
||||||
|
<!-- :data="tableInfo.structureList"-->
|
||||||
|
<!-- style="width: 100%"-->
|
||||||
|
|
||||||
|
<!-- @selection-change="handleSelectionChange">-->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <el-table-column-->
|
||||||
|
<!-- type="selection"-->
|
||||||
|
<!-- width="100%">-->
|
||||||
|
<!-- </el-table-column>-->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <el-table-column-->
|
||||||
|
<!-- label="字段"-->
|
||||||
|
<!-- width="100">-->
|
||||||
|
<!-- <template slot-scope="scope">-->
|
||||||
|
<!-- <i class="el-icon-time"></i>-->
|
||||||
|
<!-- <span style="margin-left: 10px">{{ scope.row.columnName }}</span>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-table-column>-->
|
||||||
|
|
||||||
|
<!-- <el-table-column-->
|
||||||
|
<!-- label="注释"-->
|
||||||
|
<!-- width="100">-->
|
||||||
|
<!-- <template slot-scope="scope">-->
|
||||||
|
<!-- <i class="el-icon-time"></i>-->
|
||||||
|
<!-- <span style="margin-left: 10px">{{ scope.row.columnRemark }}</span>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-table-column>-->
|
||||||
|
|
||||||
|
<!-- <el-table-column-->
|
||||||
|
<!-- label="是否主键"-->
|
||||||
|
<!-- width="100">-->
|
||||||
|
<!-- <template slot-scope="scope">-->
|
||||||
|
<!-- <i class="el-icon-time"></i>-->
|
||||||
|
<!-- <span style="margin-left: 10px">{{ scope.row.isPrimary }}</span>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-table-column>-->
|
||||||
|
|
||||||
|
<!-- <el-table-column-->
|
||||||
|
<!-- label="字段类型"-->
|
||||||
|
<!-- width="100">-->
|
||||||
|
<!-- <template slot-scope="scope">-->
|
||||||
|
<!-- <i class="el-icon-time"></i>-->
|
||||||
|
<!-- <span style="margin-left: 10px">{{ scope.row.columnType }}</span>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-table-column>-->
|
||||||
|
|
||||||
|
<!-- <el-table-column-->
|
||||||
|
<!-- label="字段长度"-->
|
||||||
|
<!-- width="100">-->
|
||||||
|
<!-- <template slot-scope="scope">-->
|
||||||
|
<!-- <i class="el-icon-time"></i>-->
|
||||||
|
<!-- <span style="margin-left: 10px">{{ scope.row.columnLength }}</span>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-table-column>-->
|
||||||
|
|
||||||
|
<!-- <el-table-column-->
|
||||||
|
<!-- label="小数"-->
|
||||||
|
<!-- width="100">-->
|
||||||
|
<!-- <template slot-scope="scope">-->
|
||||||
|
<!-- <i class="el-icon-time"></i>-->
|
||||||
|
<!-- <span style="margin-left: 10px">{{ scope.row.columnDecimals }}</span>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-table-column>-->
|
||||||
|
|
||||||
|
<!-- <el-table-column-->
|
||||||
|
<!-- label="非空"-->
|
||||||
|
<!-- width="100">-->
|
||||||
|
<!-- <template slot-scope="scope">-->
|
||||||
|
<!-- <i class="el-icon-time"></i>-->
|
||||||
|
<!-- <span style="margin-left: 10px">{{ scope.row.isNull }}</span>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-table-column>-->
|
||||||
|
|
||||||
|
<!-- <el-table-column-->
|
||||||
|
<!-- label="默认值"-->
|
||||||
|
<!-- width="100">-->
|
||||||
|
<!-- <template slot-scope="scope">-->
|
||||||
|
<!-- <i class="el-icon-time"></i>-->
|
||||||
|
<!-- <span style="margin-left: 10px">{{ scope.row.defaultValue }}</span>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-table-column>-->
|
||||||
|
|
||||||
|
<!-- <el-table-column-->
|
||||||
|
<!-- label="是否字典"-->
|
||||||
|
<!-- width="100">-->
|
||||||
|
<!-- <template slot-scope="scope">-->
|
||||||
|
<!-- <i class="el-icon-time"></i>-->
|
||||||
|
<!-- <span style="margin-left: 10px">{{ scope.row.isDictionary }}</span>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-table-column>-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <el-table-column-->
|
||||||
|
<!-- label="处理规则"-->
|
||||||
|
<!-- width="100">-->
|
||||||
|
<!-- <template slot-scope="scope">-->
|
||||||
|
|
||||||
|
<!-- <el-select v-model="tableInfo.fieldAsEngineId" multiple placeholder="请选择">-->
|
||||||
|
<!-- <el-option value="">请选择</el-option>-->
|
||||||
|
<!-- <el-option-->
|
||||||
|
<!-- v-for="engine in engineList"-->
|
||||||
|
<!-- :key="engine.id"-->
|
||||||
|
<!-- :label="engine.name"-->
|
||||||
|
<!-- :value="engine.id">-->
|
||||||
|
<!-- </el-option>-->
|
||||||
|
<!-- </el-select>-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!--<!– <span style="margin-left: 10px" v-if="scope.row.weigh ==1 ">非空规则</span>–>-->
|
||||||
|
<!--<!– <span style="margin-left: 10px" v-if="scope.row.weigh ==2 ">aa规则</span>–>-->
|
||||||
|
<!--<!– <span style="margin-left: 10px" v-if="scope.row.weigh ==3 ">我啊规则</span>–>-->
|
||||||
|
<!--<!– <span style="margin-left: 10px" v-if="scope.row.weigh ==4 ">收到规则</span>–>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-table-column>-->
|
||||||
|
|
||||||
|
<!-- <el-table-column-->
|
||||||
|
<!-- label="表别名"-->
|
||||||
|
<!-- width="100">-->
|
||||||
|
<!-- <template slot-scope="scope">-->
|
||||||
|
<!-- <el-input v-model="scope.row.fieldAsEngineId"></el-input>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-table-column>-->
|
||||||
|
<!-- </el-table>-->
|
||||||
|
|
||||||
|
<!-- <div slot="footer" class="dialog-footer">-->
|
||||||
|
<!-- <el-button @click="cancelColumn()">取 消</el-button>-->
|
||||||
|
<!-- <el-button type="primary" @click="columnAddGood()">确 定</el-button>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </el-dialog>-->
|
||||||
|
<!-- <formData>-->
|
||||||
|
|
||||||
|
<!-- </formData>-->
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import { Graph } from "@antv/x6";
|
||||||
|
import { addTaskInput, findByTableId, findStructureList, tableInfoList } from '@/api/task/task'
|
||||||
|
import { findStructureByTableId, findTableInfoList } from '@/api/etl/switch'
|
||||||
|
import { selectEngineList } from '@/api/engine/engine'
|
||||||
|
import formData from '/src/views/components/task/formData.vue'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "antvX6",
|
||||||
|
components:{
|
||||||
|
formData
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogFormVisible:false,
|
||||||
|
//任务设计添加表弹窗
|
||||||
|
taskInputAdd:false,
|
||||||
|
formData:null,
|
||||||
|
//选择字段弹窗
|
||||||
|
taskInputFieldAdd:false,
|
||||||
|
taskReq:{
|
||||||
|
|
||||||
|
},
|
||||||
|
taskAddReq:{},
|
||||||
|
taskInputReq:{},
|
||||||
|
engineReq:{
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 100
|
||||||
|
},
|
||||||
|
taskList:[],
|
||||||
|
//级联选择器
|
||||||
|
value:[],
|
||||||
|
|
||||||
|
engineList:[],
|
||||||
|
|
||||||
|
//树状图
|
||||||
|
data:[],
|
||||||
|
defaultProps:{
|
||||||
|
children:"children",
|
||||||
|
label:'tableName'
|
||||||
|
},
|
||||||
|
|
||||||
|
tableList:[],
|
||||||
|
columnList:[],
|
||||||
|
structureList:[],
|
||||||
|
tableInfo:{
|
||||||
|
taskId:this.$route.params.taskId,
|
||||||
|
},
|
||||||
|
itemId:0,
|
||||||
|
moduleList: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
name: "开始",
|
||||||
|
image: require("@/assets/img/1.png"),
|
||||||
|
data:{}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
name: "表",
|
||||||
|
image: require("@/assets/img/2.png"),
|
||||||
|
data:{
|
||||||
|
databaseId:null,
|
||||||
|
tableName:null,
|
||||||
|
zd:null,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
name: "联查",
|
||||||
|
image: require("@/assets/img/3.png"),
|
||||||
|
data:{}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
name: "结束",
|
||||||
|
image: require("@/assets/img/4.png"),
|
||||||
|
data:{}
|
||||||
|
},
|
||||||
|
],
|
||||||
|
graph:null,
|
||||||
|
nodeId:null,
|
||||||
|
nodeName:null,
|
||||||
|
taskInputForm:false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//初始化
|
||||||
|
created() {
|
||||||
|
alert(this.$route.params.taskId);
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.initGraph();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
taskInputForm(data){
|
||||||
|
this.formData=data;
|
||||||
|
this.taskInputForm=data;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// //规则引擎下拉框
|
||||||
|
// selectEngineList(){
|
||||||
|
// selectEngineList(this.engineReq).then(res=>{
|
||||||
|
// this.engineList = res.data.list;
|
||||||
|
// console.log(this.engineList);
|
||||||
|
// })
|
||||||
|
// },
|
||||||
|
//
|
||||||
|
// //根据树状下拉的选择赋值字段信息
|
||||||
|
// handleNodeClick(data) {
|
||||||
|
// this.tableInfo = data;
|
||||||
|
// findStructureByTableId(data.id).then((res)=>{
|
||||||
|
// this.tableInfo.structureList=res.data;
|
||||||
|
// })
|
||||||
|
// const cellById = this.graph.getCellById(this.nodeId)
|
||||||
|
// cellById.setData(this.tableInfo);
|
||||||
|
// },
|
||||||
|
//
|
||||||
|
// //弹出选择表界面给树状下拉框赋值
|
||||||
|
// findTAbleInfoList(){
|
||||||
|
// findTableInfoList().then(res=>{
|
||||||
|
// this.data=res.data;
|
||||||
|
// })
|
||||||
|
// },
|
||||||
|
//
|
||||||
|
// //确定选择的字段
|
||||||
|
// columnAddGood(){
|
||||||
|
// this.taskInputFieldAdd = false;
|
||||||
|
// const cellById = this.graph.getCellById(this.nodeId);
|
||||||
|
// this.tableInfo.tableField = JSON.stringify(this.tableInfo.columnList);
|
||||||
|
// console.log(this.tableInfo.tableField);
|
||||||
|
// this.tableInfo.fieldAsEngineId = "1,2,3";
|
||||||
|
// this.tableInfo.nodeId = this.nodeId;
|
||||||
|
// cellById.setData(this.tableInfo);
|
||||||
|
// addTaskInput(this.tableInfo).then(res=>{
|
||||||
|
// alert("11")
|
||||||
|
// alert(res.msg);
|
||||||
|
// // console.log(this.tableInfo.fieldAsEngineId)
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
//
|
||||||
|
// //关闭字段信息
|
||||||
|
// cancelColumn(){
|
||||||
|
// this.taskInputFieldAdd = false;
|
||||||
|
// },
|
||||||
|
//
|
||||||
|
// //选中字段
|
||||||
|
// handleSelectionChange(val) {
|
||||||
|
// if(val.length<=0){
|
||||||
|
// val = this.tableInfo.columnList;
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// this.tableInfo.columnList = val;
|
||||||
|
// console.log(this.tableInfo.columnList );
|
||||||
|
// },
|
||||||
|
//
|
||||||
|
// //跳转到任务设计界面
|
||||||
|
// toDesign(row){
|
||||||
|
// this.$router.push({path:'/easyFlow'});
|
||||||
|
// },
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// //打开选择数据表弹窗
|
||||||
|
// executeTask(){
|
||||||
|
// this.findTAbleInfoList();
|
||||||
|
// this.taskInputAdd = true;
|
||||||
|
// },
|
||||||
|
//
|
||||||
|
// //选择完下拉框的表后的下一步
|
||||||
|
// addTaskInput(){
|
||||||
|
// this.taskInputAdd = false;
|
||||||
|
// this.selectEngineList();
|
||||||
|
// this.taskInputFieldAdd = true;
|
||||||
|
// },
|
||||||
|
|
||||||
|
//保存画布,并提交
|
||||||
|
save() {
|
||||||
|
console.log(this.graph.toJSON(), "graph");
|
||||||
|
console.log(this.graph.getNodes(), "node");
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 拖动后松开鼠标触发事件
|
||||||
|
handleDragEnd(e, item) {
|
||||||
|
// console.log(e); // 可以获取到最后拖动后松开鼠标时的坐标和拖动的节点相关信息
|
||||||
|
this.addHandleNode(
|
||||||
|
e.pageX - 500,
|
||||||
|
e.pageY - 200,
|
||||||
|
new Date().getTime(),
|
||||||
|
item.image,
|
||||||
|
item.name,
|
||||||
|
item.data
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
nodeAddEvent() {
|
||||||
|
const { graph } = this;
|
||||||
|
const container = document.getElementById("container");
|
||||||
|
const changePortsVisible = (visible) => {
|
||||||
|
const ports = container.querySelectorAll(".x6-port-body");
|
||||||
|
for (let i = 0, len = ports.length; i < len; i = i + 1) {
|
||||||
|
ports[i].style.visibility = visible ? "visible" : "hidden";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this.graph.on("node:mouseenter", () => {
|
||||||
|
changePortsVisible(true);
|
||||||
|
});
|
||||||
|
this.graph.on("node:mouseleave", () => {
|
||||||
|
changePortsVisible(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 节点绑定右键点击事件
|
||||||
|
this.graph.on("node:contextmenu", ({ e, x, y, node, view }) => {
|
||||||
|
console.log("点击!!!", node);
|
||||||
|
// 判断是否有选中过节点
|
||||||
|
if (this.curSelectNode) {
|
||||||
|
// 移除选中状态
|
||||||
|
this.curSelectNode.removeTools();
|
||||||
|
// 判断两次选中节点是否相同
|
||||||
|
if (this.curSelectNode !== node) {
|
||||||
|
node.addTools([
|
||||||
|
{
|
||||||
|
name: "boundary",
|
||||||
|
args: {
|
||||||
|
attrs: {
|
||||||
|
fill: "#16B8AA",
|
||||||
|
stroke: "#2F80EB",
|
||||||
|
strokeWidth: 1,
|
||||||
|
fillOpacity: 0.1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "button-remove",
|
||||||
|
args: {
|
||||||
|
x: "100%",
|
||||||
|
y: 0,
|
||||||
|
offset: {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
this.curSelectNode = node;
|
||||||
|
} else {
|
||||||
|
this.curSelectNode = null;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.curSelectNode = node;
|
||||||
|
node.addTools([
|
||||||
|
{
|
||||||
|
name: "boundary",
|
||||||
|
args: {
|
||||||
|
attrs: {
|
||||||
|
fill: "#16B8AA",
|
||||||
|
stroke: "#2F80EB",
|
||||||
|
strokeWidth: 1,
|
||||||
|
fillOpacity: 0.1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "button-remove",
|
||||||
|
args: {
|
||||||
|
x: "100%",
|
||||||
|
y: 0,
|
||||||
|
offset: {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//左键单击事件
|
||||||
|
this.graph.on("node:click",(evt)=>{
|
||||||
|
const data = evt.node.store.data;
|
||||||
|
const thisData = data.attrs.label.textWrap.text;
|
||||||
|
if(thisData == "表"){
|
||||||
|
this.nodeId = data.id;
|
||||||
|
const node = this.graph.getCellById(this.nodeId);
|
||||||
|
var data1 = node.getData();
|
||||||
|
this.tableInfo = data1;
|
||||||
|
console.log(this.tableInfo);
|
||||||
|
this.taskInputForm = true;
|
||||||
|
this.executeTask();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//双击事件
|
||||||
|
this.graph.on('node:dblclick', (evt) => {
|
||||||
|
const data = evt.node.store.data;
|
||||||
|
console.log(data);
|
||||||
|
// this.showNodeForm(data);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 连线绑定悬浮事件
|
||||||
|
this.graph.on("cell:mouseenter", ({ cell }) => {
|
||||||
|
if (cell.shape == "edge") {
|
||||||
|
cell.addTools([
|
||||||
|
{
|
||||||
|
name: "button-remove",
|
||||||
|
args: {
|
||||||
|
x: "100%",
|
||||||
|
y: 0,
|
||||||
|
offset: {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
cell.setAttrs({
|
||||||
|
line: {
|
||||||
|
stroke: "#409EFF",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
cell.zIndex = 99; // 保证当前悬停的线在最上层,不会被遮挡
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.graph.on("cell:mouseleave", ({ cell }) => {
|
||||||
|
if (cell.shape === "edge") {
|
||||||
|
cell.removeTools();
|
||||||
|
cell.setAttrs({
|
||||||
|
line: {
|
||||||
|
stroke: "black",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
cell.zIndex = 1; // 保证未悬停的线在下层,不会遮挡悬停的线
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//添加节点到画布
|
||||||
|
addHandleNode(x, y, id, image, name ,data) {
|
||||||
|
this.graph.addNode({
|
||||||
|
id: id,
|
||||||
|
shape: "image", // 指定使用何种图形,默认值为 'rect'
|
||||||
|
x: x,
|
||||||
|
y: y,
|
||||||
|
width: 60,
|
||||||
|
height: 60,
|
||||||
|
imageUrl: image,
|
||||||
|
attrs: {
|
||||||
|
body: {
|
||||||
|
stroke: "#ffa940",
|
||||||
|
fill: "#ffd591",
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
textWrap: {
|
||||||
|
width: 90,
|
||||||
|
text: name,
|
||||||
|
},
|
||||||
|
fill: "black",
|
||||||
|
fontSize: 12,
|
||||||
|
refX: 0.5,
|
||||||
|
refY: "100%",
|
||||||
|
refY2: 4,
|
||||||
|
textAnchor: "middle",
|
||||||
|
textVerticalAnchor: "top",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ports: {
|
||||||
|
groups: {
|
||||||
|
group1: {
|
||||||
|
position: [30, 30],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
group: "group1",
|
||||||
|
id: "port1",
|
||||||
|
attrs: {
|
||||||
|
circle: {
|
||||||
|
r: 6,
|
||||||
|
magnet: true,
|
||||||
|
stroke: "#ffffff",
|
||||||
|
strokeWidth: 2,
|
||||||
|
fill: "#5F95FF",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
zIndex: 10,
|
||||||
|
data:data,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//初始化
|
||||||
|
initGraph() {
|
||||||
|
const container = document.getElementById("container");
|
||||||
|
this.graph = new Graph({
|
||||||
|
container: container, // 画布容器
|
||||||
|
width: container.offsetWidth, // 画布宽
|
||||||
|
height: container.offsetHeight, // 画布高
|
||||||
|
background: false, // 背景(透明)
|
||||||
|
snapline: true, // 对齐线
|
||||||
|
// 配置连线规则
|
||||||
|
connecting: {
|
||||||
|
snap: true, // 自动吸附
|
||||||
|
allowBlank: false, // 是否允许连接到画布空白位置的点
|
||||||
|
allowMulti: true, // 是否允许在相同的起始节点和终止之间创建多条边
|
||||||
|
allowLoop: true, // 是否允许创建循环连线,即边的起始节点和终止节点为同一节点
|
||||||
|
highlight: true, // 拖动边时,是否高亮显示所有可用的节点
|
||||||
|
highlighting: {
|
||||||
|
magnetAdsorbed: {
|
||||||
|
name: "stroke",
|
||||||
|
args: {
|
||||||
|
attrs: {
|
||||||
|
fill: "#5F95FF",
|
||||||
|
stroke: "#5F95FF",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
router: {
|
||||||
|
// 对路径添加额外的点
|
||||||
|
name: "orth",
|
||||||
|
},
|
||||||
|
connector: {
|
||||||
|
// 边渲染到画布后的样式
|
||||||
|
name: "rounded",
|
||||||
|
args: {
|
||||||
|
radius: 8,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
panning: {
|
||||||
|
enabled: false,
|
||||||
|
},
|
||||||
|
mousewheel: {
|
||||||
|
enabled: true, // 支持滚动放大缩小
|
||||||
|
zoomAtMousePosition: true,
|
||||||
|
modifiers: "ctrl",
|
||||||
|
minScale: 0.5,
|
||||||
|
maxScale: 3,
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
type: "dot",
|
||||||
|
size: 20, // 网格大小 10px
|
||||||
|
visible: true, // 渲染网格背景
|
||||||
|
args: {
|
||||||
|
color: "#a0a0a0", // 网格线/点颜色
|
||||||
|
thickness: 2, // 网格线宽度/网格点大小
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
this.nodeAddEvent();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.dashboard-container {
|
||||||
|
.antvBox {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
color: black;
|
||||||
|
padding-top: 20px;
|
||||||
|
.menu-list {
|
||||||
|
height: 100%;
|
||||||
|
width: 300px;
|
||||||
|
padding: 0 10px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-content: flex-start;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
> div {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 0 10px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
cursor: pointer;
|
||||||
|
color: black;
|
||||||
|
width: 105px;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
justify-content: center;
|
||||||
|
img {
|
||||||
|
height: 50px;
|
||||||
|
width: 50px;
|
||||||
|
}
|
||||||
|
P {
|
||||||
|
width: 90px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.canvas-card {
|
||||||
|
width: 1700px;
|
||||||
|
height: 750px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
> div {
|
||||||
|
width: 1400px;
|
||||||
|
height: 750px;
|
||||||
|
border: 2px dashed #2149ce;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -399,7 +399,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
//跳转到任务设计界面
|
//跳转到任务设计界面
|
||||||
toDesign(row){
|
toDesign(row){
|
||||||
this.$router.push({path:'/easyFlow'});
|
this.$router.push({path:'/easyFlow/index/'+row.id, query:{name:row.name}});
|
||||||
},
|
},
|
||||||
|
|
||||||
//选择数据表改变数据
|
//选择数据表改变数据
|
||||||
|
|
|
@ -0,0 +1,156 @@
|
||||||
|
<template>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<!-- 添加或修改规则引擎对话框 -->
|
||||||
|
<el-button type="text" @click="dialogFormVisible = true">添加规则类型</el-button>
|
||||||
|
|
||||||
|
<el-dialog title="添加规则" :visible.sync="dialogFormVisible">
|
||||||
|
|
||||||
|
<el-form :model="type">
|
||||||
|
|
||||||
|
<el-form-item label="规则名称" :label-width="formLabelWidth">
|
||||||
|
|
||||||
|
<el-input v-model="type.name" autocomplete="off"></el-input>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
|
||||||
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||||
|
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-table :data="arr" style="width: 100%">
|
||||||
|
|
||||||
|
<el-table-column label="类型编号" width="180">
|
||||||
|
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.id }}</span>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="类型名称" width="180">
|
||||||
|
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.name }}</span>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="操作">
|
||||||
|
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
<el-button size="mini" type="danger" @click="handleDelete(scope.row.id)">删除</el-button>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import {del, insert, list} from "@/api/type/type";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
|
||||||
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
|
|
||||||
|
components: {},
|
||||||
|
|
||||||
|
props: {},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
|
||||||
|
//这里存放数据"
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
arr: [],
|
||||||
|
|
||||||
|
type: {},
|
||||||
|
|
||||||
|
rules: {
|
||||||
|
|
||||||
|
name: [{required: true, message: '请输入规则名称', trigger: 'blur'}]
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
dialogFormVisible: false,
|
||||||
|
|
||||||
|
formLabelWidth: '120px'
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
List() {
|
||||||
|
|
||||||
|
list().then(res => {
|
||||||
|
|
||||||
|
this.arr = res;
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
handleDelete(id) {
|
||||||
|
|
||||||
|
if (confirm("你确定删除吗?")) {
|
||||||
|
|
||||||
|
del(id).then(res => {
|
||||||
|
|
||||||
|
this.$message.success(res.msg || "删除成功")
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
submitForm() {
|
||||||
|
|
||||||
|
this.dialogFormVisible = true
|
||||||
|
|
||||||
|
insert(this.type).then(res => {
|
||||||
|
|
||||||
|
this.$message.success(res.msg || "添加成功")
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
this.dialogFormVisible = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
|
||||||
|
created() {
|
||||||
|
|
||||||
|
this.List();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
</style>
|
|
@ -1,27 +1,39 @@
|
||||||
<template>
|
<template>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<!--条件查询-->
|
|
||||||
<el-form :model="version" >
|
<!--条件查询-->
|
||||||
|
|
||||||
|
<el-form :model="version">
|
||||||
|
|
||||||
<el-form-item label="版本编码" prop="pass">
|
<el-form-item label="版本编码" prop="pass">
|
||||||
|
|
||||||
<el-input type="text" v-model="version.versionCode" autocomplete="off"></el-input>
|
<el-input type="text" v-model="version.versionCode" autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="规则内容" prop="checkPass">
|
<el-form-item label="规则内容" prop="checkPass">
|
||||||
|
|
||||||
<el-input type="text" v-model="version.ruleContent" autocomplete="off"></el-input>
|
<el-input type="text" v-model="version.ruleContent" autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="引擎维护编号" prop="checkPass">
|
<el-form-item label="引擎维护编号" prop="checkPass">
|
||||||
|
|
||||||
<el-input type="text" v-model="version.engineMaintenanceId" autocomplete="off"></el-input>
|
<el-input type="text" v-model="version.engineMaintenanceId" autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
|
|
||||||
<el-button type="primary" @click="submitForm">查询</el-button>
|
<el-button type="primary" @click="submitForm">查询</el-button>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
|
|
||||||
<!-- 添加版本信息-->
|
<!-- 添加版本信息-->
|
||||||
<el-button type="text" @click="dialogFormVisible = true">添加版本信息</el-button>
|
<el-button type="text" @click="dialogFormVisible = true">添加版本信息</el-button>
|
||||||
|
|
||||||
<el-dialog title="添加信息" :visible.sync="dialogFormVisible">
|
<el-dialog title="添加信息" :visible.sync="dialogFormVisible">
|
||||||
|
@ -29,183 +41,290 @@
|
||||||
<el-form :model="version">
|
<el-form :model="version">
|
||||||
|
|
||||||
<el-form-item label="版本类名" :label-width="formLabelWidth">
|
<el-form-item label="版本类名" :label-width="formLabelWidth">
|
||||||
|
|
||||||
<el-input v-model="version.versionClass" autocomplete="off"></el-input>
|
<el-input v-model="version.versionClass" autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="版本名称" :label-width="formLabelWidth">
|
<el-form-item label="版本名称" :label-width="formLabelWidth">
|
||||||
|
|
||||||
<el-input v-model="version.name" autocomplete="off"></el-input>
|
<el-input v-model="version.name" autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
<el-form-item label="版本编码" :label-width="formLabelWidth">
|
<el-form-item label="版本编码" :label-width="formLabelWidth">
|
||||||
|
|
||||||
<el-input v-model="version.versionCode" autocomplete="off"></el-input>
|
<el-input v-model="version.versionCode" autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
<el-form-item label="是否激活" :label-width="formLabelWidth">
|
<el-form-item label="是否激活" :label-width="formLabelWidth">
|
||||||
|
|
||||||
<el-input v-model="version.isActivate" autocomplete="off"></el-input>
|
<el-input v-model="version.isActivate" autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
<el-form-item label="版本状态" :label-width="formLabelWidth">
|
<el-form-item label="版本状态" :label-width="formLabelWidth">
|
||||||
|
|
||||||
<el-input v-model="version.status" autocomplete="off"></el-input>
|
<el-input v-model="version.status" autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
<el-form-item label="版本测试状态" :label-width="formLabelWidth">
|
<el-form-item label="版本测试状态" :label-width="formLabelWidth">
|
||||||
|
|
||||||
<el-input v-model="version.testStatus" autocomplete="off"></el-input>
|
<el-input v-model="version.testStatus" autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
<el-form-item label="规则内容" :label-width="formLabelWidth">
|
<el-form-item label="规则内容" :label-width="formLabelWidth">
|
||||||
|
|
||||||
<el-input v-model="version.ruleContent" autocomplete="off"></el-input>
|
<el-input v-model="version.ruleContent" autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
<el-form-item label="引擎维护编号" :label-width="formLabelWidth">
|
<el-form-item label="引擎维护编号" :label-width="formLabelWidth">
|
||||||
|
|
||||||
<el-input v-model="version.engineMaintenanceId" autocomplete="off"></el-input>
|
<el-input v-model="version.engineMaintenanceId" autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
<el-form-item label="描述" :label-width="formLabelWidth">
|
<el-form-item label="描述" :label-width="formLabelWidth">
|
||||||
|
|
||||||
<el-input v-model="version.description" autocomplete="off"></el-input>
|
<el-input v-model="version.description" autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
|
||||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||||
|
|
||||||
<el-button type="primary" @click="insert">确 定</el-button>
|
<el-button type="primary" @click="insert">确 定</el-button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 列表-->
|
||||||
|
|
||||||
|
|
||||||
<!-- 列表-->
|
|
||||||
<el-table :data="arr" style="width: 100%">
|
<el-table :data="arr" style="width: 100%">
|
||||||
|
|
||||||
<el-table-column label="编号" width="180">
|
<el-table-column label="编号" width="180">
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
<span style="margin-left: 10px">{{ scope.row.id }}</span>
|
<span style="margin-left: 10px">{{ scope.row.id }}</span>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="版本类名" width="180">
|
<el-table-column label="版本类名" width="180">
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
<span style="margin-left: 10px">{{ scope.row.versionClass }}</span>
|
<span style="margin-left: 10px">{{ scope.row.versionClass }}</span>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="版本名称" width="180">
|
<el-table-column label="版本名称" width="180">
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
<span style="margin-left: 10px">{{ scope.row.name }}</span>
|
<span style="margin-left: 10px">{{ scope.row.name }}</span>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="版本编码" width="180">
|
<el-table-column label="版本编码" width="180">
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
<span style="margin-left: 10px">{{ scope.row.versionCode }}</span>
|
<span style="margin-left: 10px">{{ scope.row.versionCode }}</span>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="是否激活" width="180">
|
<el-table-column label="是否激活" width="180">
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
<span style="margin-left: 10px">{{ scope.row.isActivate }}</span>
|
<span style="margin-left: 10px">{{ scope.row.isActivate }}</span>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="版本状态" width="180">
|
<el-table-column label="版本状态" width="180">
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
<span style="margin-left: 10px">{{ scope.row.status }}</span>
|
<span style="margin-left: 10px">{{ scope.row.status }}</span>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="版本测试状态" width="180">
|
<el-table-column label="版本测试状态" width="180">
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
<span style="margin-left: 10px">{{ scope.row.testStatus }}</span>
|
<span style="margin-left: 10px">{{ scope.row.testStatus }}</span>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="规则内容" width="180">
|
<el-table-column label="规则内容" width="180">
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
<span style="margin-left: 10px">{{ scope.row.ruleContent }}</span>
|
<span style="margin-left: 10px">{{ scope.row.ruleContent }}</span>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="引擎维护编号" width="180">
|
<el-table-column label="引擎维护编号" width="180">
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
<span style="margin-left: 10px">{{ scope.row.engineMaintenanceId }}</span>
|
<span style="margin-left: 10px">{{ scope.row.engineMaintenanceId }}</span>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="描述" width="180">
|
<el-table-column label="描述" width="180">
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
<span style="margin-left: 10px">{{ scope.row.description }}</span>
|
<span style="margin-left: 10px">{{ scope.row.description }}</span>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
<el-table-column label="操作">
|
<el-table-column label="操作">
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
|
||||||
size="mini"
|
<el-button size="mini" type="danger" @click="handleDelete(scope.row.id)">删除
|
||||||
type="danger"
|
|
||||||
@click="handleDelete(scope.row.id)">删除</el-button>
|
</el-button>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import {list} from "@/api/version/version";
|
import {list} from "@/api/version/version";
|
||||||
|
|
||||||
import {del, insert} from "@/api/version/version";
|
import {del, insert} from "@/api/version/version";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
//import引入的组件需要注入到对象中才能使用"
|
|
||||||
components: {},
|
|
||||||
props: {},
|
|
||||||
data() {
|
|
||||||
//这里存放数据"
|
|
||||||
return {
|
|
||||||
arr:[],
|
|
||||||
version:{
|
|
||||||
|
|
||||||
},
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
dialogFormVisible:false,
|
|
||||||
|
components: {},
|
||||||
|
|
||||||
|
props: {},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
|
||||||
|
//这里存放数据"
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
arr: [],
|
||||||
|
|
||||||
|
version: {},
|
||||||
|
|
||||||
|
dialogFormVisible: false,
|
||||||
|
|
||||||
formLabelWidth: '120px'
|
formLabelWidth: '120px'
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
List(){
|
|
||||||
list(this.version).then(res =>{
|
List() {
|
||||||
|
|
||||||
|
list(this.version).then(res => {
|
||||||
|
|
||||||
this.arr = res.data;
|
this.arr = res.data;
|
||||||
|
|
||||||
console.log(res)
|
console.log(res)
|
||||||
|
|
||||||
console.log(this.arr)
|
console.log(this.arr)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
submitForm(){
|
|
||||||
|
submitForm() {
|
||||||
|
|
||||||
this.List();
|
this.List();
|
||||||
|
|
||||||
},
|
},
|
||||||
insert(){
|
|
||||||
insert(this.version).then(res =>{
|
insert() {
|
||||||
|
|
||||||
|
insert(this.version).then(res => {
|
||||||
|
|
||||||
this.$message.success("添加成功");
|
this.$message.success("添加成功");
|
||||||
|
|
||||||
})
|
})
|
||||||
this.dialogFormVisible=false;
|
|
||||||
|
this.dialogFormVisible = false;
|
||||||
|
|
||||||
},
|
},
|
||||||
handleDelete(id){
|
|
||||||
if (confirm("你确定删除吗?")){
|
handleDelete(id) {
|
||||||
del(id).then(res =>{
|
|
||||||
this.$message.success(res.msg || "删除成功")
|
if (confirm("你确定删除吗?")) {
|
||||||
|
|
||||||
|
del(id).then(res => {
|
||||||
|
|
||||||
|
this.$message.success(res.msg || "删除成功")
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//生命周期 - 创建完成(可以访问当前this实例)",
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
|
|
||||||
this.List();
|
this.List();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
|
@ -0,0 +1,98 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="container">
|
||||||
|
<div class="card left-card">
|
||||||
|
<el-card style="margin-top: 50px;">
|
||||||
|
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
<div class="card right-card">
|
||||||
|
<el-card style="margin-top: 50px;">
|
||||||
|
<h3>账户余额</h3>
|
||||||
|
<h1>¥:{{ userBalanceData.userBalance || '加载中...' }}</h1>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-card style="margin-top: 50px;">
|
||||||
|
<h3>接口列表</h3>
|
||||||
|
<el-divider></el-divider>
|
||||||
|
<!-- <el-table :data="tableData">-->
|
||||||
|
<!-- <el-table-column label="">-->
|
||||||
|
<!-- <template slot-scope="scope">-->
|
||||||
|
<!-- <span style="margin-left: 10px">{{ scope.row.connectorName }}</span>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-table-column>-->
|
||||||
|
<!-- </el-table>-->
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {userBalance} from "@/api/system/user";
|
||||||
|
import {getInfo} from '@/api/login'
|
||||||
|
import {findConnectorList} from "@/api/port/port";
|
||||||
|
export default {
|
||||||
|
name: 'Cards',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
form:{},
|
||||||
|
tableData:[],
|
||||||
|
userBalanceData: {
|
||||||
|
userBalance: '加载中...',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.fetchUserBalance();
|
||||||
|
this.findConnectorList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
findConnectorList(){
|
||||||
|
findConnectorList(this.form).then((res)=>{
|
||||||
|
this.tableData=res.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async fetchUserBalance() {
|
||||||
|
try {
|
||||||
|
const userId = localStorage.getItem('userId');
|
||||||
|
console.log(userId)// 登录后把userId存到了localStorage
|
||||||
|
if (!userId) {
|
||||||
|
this.userBalanceData = { userBalance: '未登录' };
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const response = await userBalance(userId);
|
||||||
|
if (response.data ) {
|
||||||
|
console.log(response.data)
|
||||||
|
this.userBalanceData.userBalance = response.data;
|
||||||
|
} else {
|
||||||
|
this.userBalanceData.userBalance = { userBalance: '获取失败' };
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
this.userBalanceData = { userBalance: '获取失败' };
|
||||||
|
console.error('Error fetching user balance:', error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
width: 50%;
|
||||||
|
padding: 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left-card {
|
||||||
|
background-color: #f1f1f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right-card {
|
||||||
|
background-color: #e1e1e1;
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue