Merge remote-tracking branch 'origin/master'
commit
1efe47c331
|
@ -38,6 +38,15 @@ export function getInfo(id){
|
|||
|
||||
|
||||
//测试连接
|
||||
export function structure(data){
|
||||
return request({
|
||||
url: "/source/source/structure",
|
||||
method: "post",
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
//同步资产结构
|
||||
export function connectionTest(data){
|
||||
return request({
|
||||
url: "/source/source/connectionTest",
|
||||
|
@ -52,7 +61,16 @@ export function deleteSource(ids){
|
|||
return request({
|
||||
url: "/source/source/"+ids,
|
||||
method: "delete",
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//修改
|
||||
export function update(data){
|
||||
return request({
|
||||
url: "/source/source/update",
|
||||
method: "post",
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ export function listUser(query) {
|
|||
// 用户余额
|
||||
export function userRecharge(data) {
|
||||
return request({
|
||||
url: '/money/alipay/recharge',
|
||||
url: '/system/alipay/recharge',
|
||||
method: 'post',
|
||||
params: data
|
||||
})
|
||||
|
@ -23,7 +23,7 @@ export function userRecharge(data) {
|
|||
// 查询用户余额
|
||||
export function userBalance(userId) {
|
||||
return request({
|
||||
url: '/money/balance/' + userId,
|
||||
url: '/system/user/balance/' + userId,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
|
|
@ -69,6 +69,7 @@ const user = {
|
|||
commit('SET_ROLES', ['ROLE_DEFAULT'])
|
||||
}
|
||||
commit('SET_ID', user.userId)
|
||||
localStorage.setItem('userId', user.userId)
|
||||
commit('SET_NAME', user.userName)
|
||||
commit('SET_AVATAR', avatar)
|
||||
resolve(res)
|
||||
|
|
|
@ -56,9 +56,9 @@
|
|||
</el-button>
|
||||
|
||||
|
||||
<el-dialog title="添加数据源接入" :visible.sync="dialogFormVisible" append-to-body width="60%">
|
||||
<el-dialog title="title" :visible.sync="dialogFormVisible" append-to-body width="60%">
|
||||
|
||||
<el-form ref="form" :model="sourceAddReq" label-width="140px" :inline="true" class="demo-form-inline">
|
||||
<el-form ref="form" :model="sourceAddReq" :rules="rules" label-width="140px" :inline="true" class="demo-form-inline">
|
||||
<el-form-item label="接入源名称">
|
||||
<el-input v-model="sourceAddReq.dataResourceName"></el-input>
|
||||
</el-form-item>
|
||||
|
@ -262,12 +262,13 @@
|
|||
<script>
|
||||
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||
//例如:import 《组件名称》 from '《组件路径》,
|
||||
import {selectSourceList} from "@/api/etl/switch";
|
||||
import {selectSourceList, update} from "@/api/etl/switch";
|
||||
import {selectSourceExport} from "@/api/etl/switch";
|
||||
import {connectionTest} from "@/api/etl/switch";
|
||||
import {insertAdd} from "@/api/etl/switch";
|
||||
import {deleteSource} from "@/api/etl/switch";
|
||||
import {getInfo} from "@/api/etl/switch";
|
||||
import {structure} from "@/api/etl/switch";
|
||||
|
||||
export default {
|
||||
//import引入的组件需要注入到对象中才能使用"
|
||||
|
@ -277,6 +278,17 @@ export default {
|
|||
//这里存放数据"
|
||||
|
||||
return {
|
||||
rules: {
|
||||
dataResourceName: [
|
||||
{required: true, message: "接入源名称不能为空", trigger: "blur"}
|
||||
],
|
||||
dataSourcesSystemName: [
|
||||
{required: true, message: "数据来源系统名称不能为空", trigger: "blur"}
|
||||
],
|
||||
host: [
|
||||
{required: true, message: "主机地址不能为空", trigger: "blur"}
|
||||
]
|
||||
},
|
||||
ids:[],
|
||||
dialogFormVisible:false,
|
||||
SourceReq:{
|
||||
|
@ -294,6 +306,27 @@ export default {
|
|||
watch: {},
|
||||
//方法集合",
|
||||
methods: {
|
||||
reset() {
|
||||
this.sourceAddReq = {
|
||||
};
|
||||
this.resetForm("sourceAddReq");
|
||||
},
|
||||
//修改
|
||||
update(row){
|
||||
this.reset();
|
||||
getInfo(row.id).then(res=>{
|
||||
this.sourceAddReq=res.data;
|
||||
this.dialogFormVisible=true;
|
||||
this.title="修改岗位"
|
||||
})
|
||||
},
|
||||
struceure(row){
|
||||
structure(row).then(res=>{
|
||||
if (res ===200){
|
||||
alert("同步资产成功")
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteSourceByIds(){
|
||||
deleteSource(this.ids).then(res=>{
|
||||
if(res.code===200){
|
||||
|
@ -318,11 +351,21 @@ export default {
|
|||
})
|
||||
},
|
||||
addSource(){
|
||||
insertAdd(this.sourceAddReq).then(res=>{
|
||||
if(res.code===200){
|
||||
if (this.sourceAddReq.id!=undefined){
|
||||
update(this.sourceAddReq).then(res=>{
|
||||
if (res.code===200){
|
||||
alert("修改成功")
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
}else {
|
||||
insertAdd(this.sourceAddReq).then(res=>{
|
||||
if(res.code===200){
|
||||
alert("添加成功")
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
//测试连接
|
||||
textConnect(row){
|
||||
|
@ -335,7 +378,9 @@ export default {
|
|||
})
|
||||
},
|
||||
|
||||
//新增
|
||||
insertAdd(){
|
||||
this.reset();
|
||||
this.dialogFormVisible=true
|
||||
},
|
||||
findSelectSourceList(){
|
||||
|
|
|
@ -1,30 +1,45 @@
|
|||
<template>
|
||||
<div>
|
||||
<span style="text-align: center">账户余额: {{ balance }}</span>
|
||||
<h1>用户余额</h1>
|
||||
<p>余额:{{ userBalanceData.userBalance || '加载中...' }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {userBalance} from "@/api/system/user";
|
||||
import { userBalance } from "@/api/system/user"; // 假设你的userBalance函数在@/api/money目录下
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
balance: null, // 用于存储用户余额
|
||||
userBalanceData: {
|
||||
userBalance: '加载中...'
|
||||
}
|
||||
};
|
||||
},
|
||||
async created() {
|
||||
created() {
|
||||
this.fetchUserBalance();
|
||||
},
|
||||
methods: {
|
||||
async fetchUserBalance() {
|
||||
try {
|
||||
const userId = 1; // 根据实际情况获取用户 ID
|
||||
const userId = localStorage.getItem('userId');
|
||||
console.log(userId)// 登录后把userId存到了localStorage
|
||||
if (!userId) {
|
||||
this.userBalanceData = {userBalance: '未登录'};
|
||||
return;
|
||||
}
|
||||
const response = await userBalance(userId);
|
||||
this.balance = response.data.balance; // 假设响应数据中包含余额信息
|
||||
if (response.data) {
|
||||
console.log(response.data)
|
||||
this.userBalanceData.userBalance = response.data; // 假设response.data直接返回了余额信息
|
||||
} else {
|
||||
this.userBalanceData.userBalance = {userBalance: '获取失败'};
|
||||
}
|
||||
} catch (error) {
|
||||
this.userBalanceData = {userBalance: '获取失败'};
|
||||
console.error('Error fetching user balance:', error);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 添加样式 */
|
||||
</style>
|
||||
|
|
|
@ -144,6 +144,12 @@
|
|||
size="mini"
|
||||
type="text"
|
||||
@click="handleDelete(scope.row)">删除</el-button>
|
||||
|
||||
<el-button
|
||||
icon="el-icon-update"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="updateById(scope.row)">修改</el-button>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
@ -269,9 +275,9 @@
|
|||
width="180">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px" v-if="scope.row.weigh ==1 ">非空规则</span>
|
||||
<span style="margin-left: 10px" v-if="scope.row.weigh ==2 ">非空规则</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>
|
||||
<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>
|
||||
|
||||
|
@ -279,7 +285,7 @@
|
|||
label="表别名"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
<input type="text">
|
||||
<el-input v-model="scope.row.fieldAsEngineId"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -336,6 +342,7 @@ export default {
|
|||
watch: {},
|
||||
//方法集合",
|
||||
methods: {
|
||||
|
||||
executeTask(){
|
||||
this.taskInputAdd = true;
|
||||
},
|
||||
|
@ -350,6 +357,7 @@ export default {
|
|||
this.dialogFormVisible = true;
|
||||
},
|
||||
|
||||
|
||||
//添加任务
|
||||
addTask(){
|
||||
addTask(this.taskAddReq).then(res=>{
|
||||
|
@ -374,7 +382,7 @@ export default {
|
|||
},
|
||||
|
||||
handleDelete(row){
|
||||
deleteByTaskId(row.getId).then(res=>{
|
||||
deleteByTaskId(row.id).then(res=>{
|
||||
alert(res.msg);
|
||||
if(res.code == 200){
|
||||
location.reload();
|
||||
|
|
Loading…
Reference in New Issue