Merge remote-tracking branch 'origin/master'

master
陈思豪 2024-09-05 01:11:18 +08:00
commit 967c82c997
22 changed files with 2236 additions and 611 deletions

View File

@ -49,9 +49,10 @@
"@vue/composition-api": "^1.7.2",
"axios": "0.24.0",
"clipboard": "2.0.8",
"codemirror": "^5.65.12",
"core-js": "3.25.3",
"echarts": "5.4.0",
"element-ui": "2.9.1",
"element-ui": "^2.15.14",
"file-saver": "2.0.5",
"fuse.js": "6.4.3",
"highlight.js": "9.18.5",

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -79,7 +79,7 @@ export function findById(id) {
//通过id删除数据
export function dels(id) {
return request({
url: '/engine/engine/delete/' + id,
url: '/engine/version/delete/' + id,
method: 'post',
data: id
})
@ -87,7 +87,7 @@ export function dels(id) {
//天机规则数据
//添加规则数据
export function add(data){
return request({
url: "/engine/version/insertVersion",
@ -107,5 +107,27 @@ export function selectEngineById(id){
})
}
//根据版本id查询版本信息
export function sel(id){
return request({
url: "/engine/version/selectListById/" + id,
method: "post"
})
}
//根据版本id查询版本信息
export function generate(data){
return request({
url: "/engine/engine/generate",
method: "post",
data:data
})
}

View File

@ -91,6 +91,15 @@ export function findTableInfoList(){
})
}
export function findTableInfoListAccredit(){
return request({
url: "/source/tableInfo/findTableInfoListAccredit",
method: "get",
})
}
export function findStructureByTableId(id){
return request({
url: "/source/tableInfo/findStruceure/"+id,
@ -99,3 +108,51 @@ export function findStructureByTableId(id){
}
export function findTableValueList(basicId,tableName){
return request({
url: "/source/DataValue/findTableValueList?basicId="+basicId+"&tableName="+tableName,
method: "post",
})
}
export function findAccredit(id){
return request({
url: "/source/accredit/findAccredit?tableId="+id,
method: "get",
})
}
export function findDeptListStatus(tableId,basicId){
return request({
url: "/source/accredit/findDeptListStatus?tableId="+tableId+"&basicId="+basicId,
method: "get",
})
}
export function findUserListStatus(tableId,basicId){
return request({
url: "/source/accredit/findUserListStatus?tableId="+tableId+"&basicId="+basicId,
method: "get",
})
}
export function addMiddle(data){
return request({
url: "/source/accredit/addMiddle",
method: "post",
data :data
})
}
export function remove(data){
return request({
url: "/source/accredit/remove",
method: "post",
data :data
})
}

View File

@ -7,6 +7,13 @@ export function findConnectorList(data) {
data:data
})
}
export function findApiList(data) {
return request({
url: '/mart/connector/findApiList',
method: 'post',
data:data
})
}
export function addConnector(data) {
return request({
url: '/mart/connector/addConnector',
@ -70,6 +77,13 @@ export function getWeather() {
method: 'GET'
})
}
//天气预报
export function getWeatherForecast(cityName) {
return request({
url: '/port/list/getWeatherForecast?cityName='+cityName,
method: 'GET'
})
}
//购买
export function doBuyInterface(data) {
@ -79,3 +93,18 @@ export function doBuyInterface(data) {
data:data
})
}
//资产列表
export function findConnectorUserList(data) {
return request({
url: '/mart/connector/findConnectorUserList',
method: 'post',
data:data
})
}
//API页面类型分类
export function findConnectSort() {
return request({
url: '/mart/connector/findConnectSort',
method: 'get'
})
}

View File

@ -12,6 +12,24 @@ export function listUser(query) {
//购买用户记录
export function userloginfo(query) {
return request({
url: '/system/user/purchaseRecord',
method: 'get',
params: query
})
}
//查询12个月的总消费
export function months() {
return request({
url: '/system/user/months',
method: 'get',
})
}
//充值用户记录
export function userPayinfo(query) {
return request({
@ -108,6 +126,15 @@ export function delUser(userId) {
})
}
//修改手机号
export function updatePhone(data) {
return request({
url: '/system/user/profile/updatePhonenumber/'+data,
method: 'POST'
})
}
// 用户密码重置
export function resetUserPwd(userId, password) {
const data = {

View File

@ -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"); // jsmode
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>

View File

@ -1,6 +1,23 @@
import Vue from 'vue'
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 './assets/styles/element-variables.scss'

View File

@ -66,17 +66,21 @@
</el-form>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="findSelectSourceExport"
v-hasPermi="['source:data:export']">导出
</el-button>
<!-- 添加按钮 /-->
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['source:data:add']">
新增
</el-button>
<!-- 添加或修改规则引擎对话框 -->
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
@ -239,8 +243,6 @@
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
@ -564,8 +566,6 @@ export default {
handleAdd() {
// this.reset();
this.open = true;
this.title = "添加规则引擎";
@ -576,8 +576,6 @@ export default {
handleUpdate(row) {
// this.reset();
this.form = row;
this.open = true;
@ -628,11 +626,12 @@ export default {
engineRuleMaintenance(row) {
this.$router.push({
path: 'list',
query: {id: row.id}
query: {"id": row.id}
})
@ -673,20 +672,35 @@ export default {
beforeCreate() {
}, // - ",
beforeMount() {
}, // - ",
beforeUpdate() {
}, // - ",
updated() {
}, // - ",
beforeDestroy() {
}, // - ",
destroyed() {
}, // - ",
activated() {
} //keep-alive",
};
</script>
<style scoped>
</style>

View File

@ -2,119 +2,233 @@
<div>
<el-button type="text" @click="dialogFormVisible = true">新增</el-button>
<el-button type="text" @click="addVersion()"></el-button>
<el-dialog title="添加版本信息" :visible.sync="dialogFormVisible">
<el-form :model="versions">
<el-form-item label="版本类名" :label-width="formLabelWidth">
<el-input v-model="versions.versionClass" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="版本名称" :label-width="formLabelWidth">
<el-input v-model="versions.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="版本编码" :label-width="formLabelWidth">
<el-input v-model="versions.versionCode" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="是否激活" :label-width="formLabelWidth">
<el-input v-model="versions.isActivate" autocomplete="off"></el-input>
<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" autocomplete="off"></el-input>
<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" autocomplete="off"></el-input>
<el-form-item label="是否测试" :label-width="formLabelWidth">
<el-input v-model="versions.testStatus" disabled autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="规则内容" :label-width="formLabelWidth">
<el-input v-model="versions.ruleContent" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="版本描述" :label-width="formLabelWidth">
<el-form-item label="引擎维护编号" :label-width="formLabelWidth">
<el-input v-model="versions.engineMaintenanceId" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="描述" :label-width="formLabelWidth">
<el-input v-model="versions.description" autocomplete="off"></el-input>
</el-form-item>
<div v-show="opens">
<codemirror v-model="versions.ruleContent" :value="this.versions.ruleContent" :options="cmOptions" >
</codemirror>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button @click=closes()> </el-button>
<el-button type="primary" @click=handleInsert()> </el-button>
<el-button type="primary" @click=showCode(versions)>生成引擎类</el-button>
</div>
</el-dialog>
<el-table :data="maintenance.engineMaintenanceList" style="width: 100%">
<el-table-column prop="id" label="编号"></el-table-column>
<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 prop="ruleContent" label="规则内容"></el-table-column>
<el-table-column prop="engineMaintenanceId" label="引擎维护编号"></el-table-column>
<el-table-column prop="description" label="描述"></el-table-column>
</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 v-show="scope.row.isActivate==1" @click="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==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 v-show="scope.row.isActivate==2" @click="onEngines(scope.row.id)" type="text" size="small"></el-button>
</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-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="back()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {add, dels, findById, forbiddenEngine, onEngine, selectEngineById} from "@/api/engine/engine";
import {add, dels, findById, forbiddenEngine, generate, 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"); // jsmode
export default {
@ -122,7 +236,10 @@ export default {
//import使"
components: {},
components: {
codemirror,
Java
},
props: {},
@ -133,12 +250,17 @@ export default {
return {
direction: 'rtl',
versionFormVisible: false,
maintenance: {
engineMaintenanceList: [],
},
opens: false,
title: "",
open: false,
@ -147,6 +269,28 @@ export default {
versions: {
isActivate: '未激活',
testStatus: '未测试',
status: '初始化',
ruleContent:''
},
cmOptions: {
lineNumbers: true, //
mode: 'text/x-yaml', // model
gutters: ['CodeMirror-lint-markers'], //
theme: "ambiance",
lint: true, //
},
size: '',
@ -155,24 +299,97 @@ export default {
formLabelWidth: '120px',
arr:[]
arr: []
}
},
methods: {
selectEngineById,
closes(){
this.dialogFormVisible = false;
},
showCode() {
this.opens=true
this.versions.isActivate = 1
this.versions.testStatus = 1
this.versions.status = 1
this.versions.id = this.$route.query.id
generate(this.versions).then(res =>{
this.versions.ruleContent=res.ruleContent;
this.$message.success(res.msg || "成功");
})
},
//
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 = true
this.dialogFormVisible = false;
this.versions.isActivate = 1
this.versions.testStatus = 1
this.versions.status = 1
console.log(this.versions)
add(this.versions).then(res => {
this.$modal.msgSuccess(res.msg || "新增成功")
this.$message.success(res.msg || "新增成功")
})
this.dialogFormVisible=false;
this.List();
},
@ -184,9 +401,11 @@ export default {
this.$message.success(res.msg || "开启成功")
})
this.List();
},
forbiddenEngines(id) {
forbiddenEngine(id).then(res => {
@ -194,6 +413,7 @@ export default {
this.$message.success(res.msg || "关闭成功")
})
this.List();
},
@ -208,15 +428,20 @@ export default {
},
selectEngine(){
selectEngineById(this.maintenance.id).then(res =>{
selectEngine() {
selectEngineById(this.maintenance.id).then(res => {
this.arr = res.data
})
},
del(id) {
if (confirm("你确定删除吗?")) {
if (confirm("你确定" +
"删除吗?")) {
dels(id).then(res => {
@ -247,4 +472,16 @@ export default {
<style scoped>
.information-box >>> .CodeMirror {
font-family: monospace;
height: 71vh;
direction: ltr;
}
</style>

View File

@ -0,0 +1,168 @@
<template>
<div>
<el-container>
<el-aside width="30%">
<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
</el-aside>
<el-main>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>资产详情</span>
</div>
<table>
<tr><td>表名称:</td><td>{{ tableBasic.tableName }}</td></tr>
<tr><td>表备注:</td><td>{{ tableBasic.tableRemark }}</td></tr>
<tr><td>数据量:</td><td>{{ tableBasic.dataNum }}</td></tr>
<tr><td>是否核心:</td><td><dict-tag :options="dict.type.yes_no" :value="tableBasic.isCenter"/></td></tr>
</table>
<!-- <el-descriptions class="margin-top" title="带边框列表" :column="2" border>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">表名称</template>-->
<!-- {{ tableBasic.tableName }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">表备注</template>-->
<!-- {{ tableBasic.tableRemark }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">数据量</template>-->
<!-- {{ tableBasic.dataNum }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">是否核心</template>-->
<!-- <dict-tag :options="dict.type.yes_no" :value="tableBasic.isCenter"/>-->
<!-- </el-descriptions-item>-->
<!-- </el-descriptions>-->
</el-card>
<el-card>
<el-table
:data="DataValue"
style="width: 100%">
<el-table-column
prop="key"
label="key"
width="180">
</el-table-column>
<el-table-column
prop="label"
label="label"
width="180">
</el-table-column>
<el-table-column
prop="type"
label="type">
</el-table-column>
<el-table-column
prop="value"
label="value">
</el-table-column>
</el-table>
<!-- <div v-for="data in DataValue">-->
<!-- {{data.key}}-->
<!-- <el-descriptions title="数据" direction="vertical" :column="4" border>-->
<!-- <el-descriptions-item label="用户名">{{data.type}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="手机号">{{data.value}}</el-descriptions-item>-->
<!-- </el-descriptions>-->
<!-- </div>-->
</el-card>
</el-main>
</el-container>
</div>
</template>
<script>
//jsjsjson,
//import from ',
import {findTableValueList} from "@/api/etl/switch";
import {findTableInfoListAccredit} from "@/api/etl/switch";
import {findStructureByTableId} from "@/api/etl/switch";
export default {
dicts: ['yes_no'],
//import使"
components: {},
props: {},
data() {
//"
return {
DataValue:[],
data:{
},
defaultProps:{
children:"children",
label:'tableName'
},
tableBasic:{
},
};
},
// data",
computed: {},
//data",
watch: {},
//",
methods: {
findTAbleInfoList(){
findTableInfoListAccredit().then(res=>{
this.data=res.data;
})
},
handleNodeClick(data) {
this.tableBasic=data
if (data.children==null){
findTableValueList(data.basicId,data.tableName).then(res=>{
this.DataValue=res.data;
})
}
console.log(data);
},
},
// - 访this",
created() {
this.findTAbleInfoList();
},
// - 访DOM",
mounted() {
},
beforeCreate() {
}, // - ",
beforeMount() {
}, // - ",
beforeUpdate() {
}, // - ",
updated() {
}, // - ",
beforeDestroy() {
}, // - ",
destroyed() {
}, // - ",
activated() {
} //keep-alive",
};
</script>

View File

@ -11,29 +11,37 @@
<el-main>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>资产模型基本信息</span>
</div>
<el-descriptions class="margin-top" title="带边框列表" :column="2" border>
<el-descriptions-item>
<template slot="label">表名称</template>
{{ tableBasic.tableName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">表备注</template>
{{ tableBasic.tableRemark }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">数据量</template>
{{ tableBasic.dataNum }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">是否核心</template>
<dict-tag :options="dict.type.yes_no" :value="tableBasic.isCenter"/>
</el-descriptions-item>
<table>
<tr><td>表名称:</td><td>{{ tableBasic.tableName }}</td></tr>
<tr><td>表备注:</td><td>{{ tableBasic.tableRemark }}</td></tr>
<tr><td>数据量:</td><td>{{ tableBasic.dataNum }}</td></tr>
<tr><td>是否核心:</td><td><dict-tag :options="dict.type.yes_no" :value="tableBasic.isCenter"/></td></tr>
</table>
</el-descriptions>
<!-- <el-descriptions class="margin-top" title="带边框列表" :column="2" border>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">表名称</template>-->
<!-- {{ tableBasic.tableName }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">表备注</template>-->
<!-- {{ tableBasic.tableRemark }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">数据量</template>-->
<!-- {{ tableBasic.dataNum }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">是否核心</template>-->
<!-- <dict-tag :options="dict.type.yes_no" :value="tableBasic.isCenter"/>-->
<!-- </el-descriptions-item>-->
<!-- </el-descriptions>-->
</el-card>
@ -146,6 +154,4 @@ export default {
} //keep-alive",
};
</script>
<style scoped>
</style>

View File

@ -0,0 +1,306 @@
<template>
<div>
<el-container>
<el-aside width="30%">
<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
</el-aside>
<!-- {-->
<!-- "dataResourceName": "黑鬼",-->
<!-- "dataBaseName": "text",-->
<!-- "tableNameB": "engine_version",-->
<!-- "dataNum": 4,-->
<!-- "tableRemark": "",-->
<!-- "dataSourceSystemName": null-->
<!-- }-->
<el-main>
<el-card class="box-card">
<el-descriptions title="基本信息">
<el-descriptions-item label="数据接入名称">{{tableBasic.dataResourceName}}</el-descriptions-item>
<el-descriptions-item label="系统名称">{{tableBasic.dataSourceSystemName}}</el-descriptions-item>
<el-descriptions-item label="数据库名称">{{tableBasic.dataBaseName}}</el-descriptions-item>
<el-descriptions-item label="表名称">{{tableBasic.tableNameB}}</el-descriptions-item>
<el-descriptions-item label="表中文名称">{{tableBasic.tableRemark}}</el-descriptions-item>
<el-descriptions-item label="数据量">{{tableBasic.dataNum}}</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="部门授权" name="first">
<el-table
v-if="refreshTable"
v-loading="loading"
:data="deptList"
:default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
row-key="deptId"
>
<el-table-column label="部门名称" prop="deptName" width="260"></el-table-column>
<el-table-column label="部门负责人" prop="leader" width="200"></el-table-column>
<el-table-column label="邮箱" prop="email" width="200"></el-table-column>
<el-table-column align="center" label="创建时间" prop="createTime" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="状态" prop="status" width="200"></el-table-column>
<el-table-column label="状态" width="200">
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
active-color="#13ce66"
inactive-color="#ff4949"
:active-value='0'
:inactive-value='1'
active-text="已授权"
inactive-text="未授权"
@change="updateDeptStatus(scope.row)"
>
</el-switch>
</template>
</el-table-column>-->
</el-table>
</el-tab-pane>
<el-tab-pane label="用户授权" name="second">
<el-table
:data="userList"
>
<el-table-column label="用户名称" prop="userName" width="260"></el-table-column>
<el-table-column label="用户昵称" prop="nickName" width="200"></el-table-column>
<el-table-column label="用户部门" prop="deptName" width="200"></el-table-column>
<el-table-column label="用户邮箱" prop="email" width="200"></el-table-column>
<el-table-column label="用户手机号" prop="phoneNumber" width="200"></el-table-column>
<el-table-column align="center" label="创建时间" prop="createTime" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="状态" width="200">
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
active-color="#13ce66"
inactive-color="#ff4949"
:active-value='0'
:inactive-value='1'
@change="updateDeptStatus(scope.row)"
>
</el-switch>
</template>
</el-table-column>-->
</el-table>
</el-tab-pane>
<!-- <el-tab-pane label="用户授权" name="second">-->
<!-- <el-table-->
<!-- v-if="refreshTable"-->
<!-- v-loading="loading"-->
<!-- :data="deptList"-->
<!-- :default-expand-all="isExpandAll"-->
<!-- :tree-props="{children: 'children', hasChildren: 'hasChildren'}"-->
<!-- row-key="deptId"-->
<!-- >-->
<!-- <el-table-column label="用户名称" prop="deptName" width="260"></el-table-column>-->
<!-- <el-table-column label="用户昵称" prop="orderNum" width="200"></el-table-column>-->
<!-- <el-table-column label="用户名称" prop="orderNum" width="200"></el-table-column>-->
<!-- <el-table-column label="用户部门" prop="orderNum" width="200"></el-table-column>-->
<!-- <el-table-column label="用户邮箱" prop="orderNum" width="200"></el-table-column>-->
<!-- <el-table-column label="用户手机号" prop="orderNum" width="200"></el-table-column>-->
<!-- <el-table-column label="创建时间" prop="orderNum" width="200"></el-table-column>-->
<!-- <template slot-scope="scope">-->
<!-- <el-switch-->
<!-- v-model="scope.row.status"-->
<!-- active-color="#13ce66"-->
<!-- inactive-color="#ff4949"-->
<!-- active-value="0"-->
<!-- inactive-value="1">-->
<!-- </el-switch>-->
<!-- </template>-->
<!-- </el-table>-->
<!-- </el-tab-pane>-->
</el-tabs>
</el-card>
</el-main>
</el-container>
</div>
</template>
<script>
//jsjsjson,
//import from ',
import {findDeptListStatus, findTableValueList, findUserListStatus} from "@/api/etl/switch";
import {findTableInfoList} from "@/api/etl/switch";
import {findAccredit} from "@/api/etl/switch";
import {addMiddle} from "@/api/etl/switch";
import {remove} from "@/api/etl/switch";
import {shouldAdd} from "script-ext-html-webpack-plugin/lib/custom-attributes";
// import {findStructureByTableId} from "@/api/etl/switch";
export default {
dicts: ['yes_no'],
//import使"
components: {},
props: {},
data() {
//"
return {
accredit:{
deptId:'',
basicId:'',
tableId:'',
userId:'',
},
userList:[
],
activeName: 'first',
//
refreshTable: true,
//
isExpandAll: true,
//
loading: true,
//
deptList:[
],
DataValue:[],
data:{
},
defaultProps:{
children:"children",
label:'tableName'
},
tableBasic:{
},
};
},
// data",
computed: {},
//data",
watch: {},
//",
methods: {
updateDeptStatus(row){
this.accredit.deptId=row.deptId
this.accredit.userId=row.userId
if (row.status===0){
addMiddle(this.accredit).then(res=>{
if (res.code===200){
alert("授权成功")
}
})
}
if (row.status===1){
remove(this.accredit).then(res=>{
if (res.code===200){
alert("取消授权成功")
}
})
}
console.log(row);
},
toggleExpandAll() {
this.refreshTable = false;
this.isExpandAll = !this.isExpandAll;
this.$nextTick(() => {
this.refreshTable = true;
});
},
handleClick(tab, event) {
console.log(tab, event);
},
findTAbleInfoList(){
findTableInfoList().then(res=>{
this.data=res.data;
})
},
handleNodeClick(data) {
this.accredit.tableId = data.id;
this.accredit.basicId = data.basicId;
this.loading = true;
// if (data.children==null){
findDeptListStatus(data.id, data.basicId).then(res => {
this.deptList = this.handleTree(res.data, "deptId");
this.loading = false;
})
findUserListStatus(data.id, data.basicId).then(res => {
this.userList = res.data;
})
findAccredit(data.id).then(res => {
this.tableBasic = res;
})
// }
console.log(data);
},
},
// - 访this",
created() {
this.findTAbleInfoList();
},
// - 访DOM",
mounted() {
},
beforeCreate() {
}, // - ",
beforeMount() {
}, // - ",
beforeUpdate() {
}, // - ",
updated() {
}, // - ",
beforeDestroy() {
}, // - ",
destroyed() {
}, // - ",
activated() {
} //keep-alive",
};
</script>

View File

@ -1,114 +1,197 @@
<template>
<div>
<el-form label-width="80px" :model="SourceReq" ref="queryForm" :inline="true" class="demo-form-inline" size="small">
<el-form-item label="数据源名称">
<el-input v-model="SourceReq.dataResourceName"></el-input>
<div class="app-container">
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px" size="small">
<el-form-item label="数据来源名称" prop="name">
<el-input
v-model="queryParams.dataSourcesSystemName"
clearable
placeholder="请输入数据来源名称"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="数据来源系统名称">
<el-input v-model="SourceReq.dataSourcesSystemName"></el-input>
<el-form-item label="存放数据库名称" prop="databaseName">
<el-input
v-model="queryParams.databaseName"
clearable
placeholder="请输入存放数据库名称"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="数据库名称">
<el-input v-model="SourceReq.databaseName"></el-input>
<el-form-item>
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
<el-button @click="findSelectSourceList()">
查询
</el-button>
</el-form>
<el-button
v-hasPermi="['tool:gen:import']"
icon="el-icon-download"
plain
size="mini"
type="warning"
@click="findSelectSourceExport"
>导出
</el-button>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
v-hasPermi="['system:post:add']"
icon="el-icon-plus"
plain
size="mini"
type="primary"
@click="handleAdd"
>新增
</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- v-hasPermi="['system:post:remove']"-->
<!-- :disabled="multiple"-->
<!-- icon="el-icon-delete"-->
<!-- plain-->
<!-- size="mini"-->
<!-- type="danger"-->
<!-- @click="handleDelete"-->
<!-- >删除-->
<!-- </el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
v-hasPermi="['system:post:export']"
icon="el-icon-download"
plain
size="mini"
type="warning"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
<el-table-column align="center" type="selection" width="55"/>
<el-table-column align="name" label="数据来源名称" prop="dataSourcesSystemName"/>
<el-table-column align="ip" label="数据来源地址" prop="host"/>
<el-table-column align="port" label="来源地址端口号" prop="port"/>
<el-table-column align="type" label="数据接入类型" prop="databaseType"/>
<el-table-column align="databaseName" label="存放数据库名称" prop="databaseName"/>
<el-table-column align="center" label="是否初始化" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.yes_no" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
<template slot-scope="scope">
<el-button
v-hasPermi="['system:post:remove']"
icon="el-icon-delete"
size="mini"
type="text"
@click="handleDelete(scope.row)"
>删除
</el-button>
<el-button
icon="el-icon-delete"
plain
size="mini"
type="danger"
@click="insertAdd()"
>新增
</el-button>
<el-button
icon="el-icon-caret-right"
size="mini"
type="text"
@click="connectDataSources(scope.row)"
>测试
</el-button>
<el-button
icon="el-icon-delete"
plain
size="mini"
type="danger"
@click="deleteSourceByIds()"
>删除
</el-button>
<el-button
v-hasPermi="['system:post:remove']"
icon="el-icon-edit"
size="mini"
type="text"
@click="handleUpdate(scope.row)"
>修改
</el-button>
<el-button
v-hasPermi="['system:post:remove']"
icon="el-icon-paperclip"
size="mini"
type="text"
@click="syncAssetStructure(scope.row)"
>同步资产结构
</el-button>
<el-dialog title="title" :visible.sync="dialogFormVisible" append-to-body width="60%">
</template>
</el-table-column>
</el-table>
<el-form ref="sourceAddReq" :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>
<el-form-item label="数据来源系统名称">
<el-input v-model="sourceAddReq.dataSourcesSystemName"></el-input>
</el-form-item>
<el-form-item label="主机地址">
<el-input v-model="sourceAddReq.host"></el-input>
</el-form-item>
<el-form-item label="主机端口">
<el-input v-model="sourceAddReq.port"></el-input>
</el-form-item>
<el-form-item label="数据接入类型">
<el-input v-model="sourceAddReq.databaseType"></el-input>
</el-form-item>
<el-form-item label="数据库名称">
<el-input v-model="sourceAddReq.databaseName"></el-input>
</el-form-item>
<el-form-item label="数据库用户">
<el-input v-model="sourceAddReq.username"></el-input>
</el-form-item>
<el-form-item label="数据库密码">
<el-input v-model="sourceAddReq.password"></el-input>
</el-form-item>
<el-form-item label="数据连接参数">
<el-input v-model="sourceAddReq.connectionParams"></el-input>
</el-form-item>
<pagination
v-show="total>0"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
<!-- 添加或修改岗位对话框 -->
<el-dialog :title="title" :visible.sync="open" append-to-body width="60%">
<el-form ref="form" :model="form" :rules="rules" label-width="80px" :inline="true" class="demo-form-inline">
<el-form-item label="接入来源系统名称" prop="dataSourcesSystemName">
<el-input v-model="form.dataSourcesSystemName" placeholder="请输入数据来源系统名称"/>
</el-form-item>
<el-form-item label="ip" prop="host">
<el-input v-model="form.host" placeholder="请输入ip"/>
</el-form-item>
<el-form-item label="port" prop="port">
<el-input v-model="form.port" placeholder="请输入port"/>
</el-form-item>
<el-form-item label="type" prop="databaseType">
<el-select v-model="form.databaseType" placeholder="请选择类型">
<el-option label="mysql" value="mysql"></el-option>
<el-option label="redis" value="redis"></el-option>
<el-option label="oracle" value="oracle"></el-option>
</el-select>
</el-form-item>
<el-form-item label="数据库名称" prop="databaseName">
<el-input v-model="form.databaseName" placeholder="请输入数据库名称"/>
</el-form-item>
<el-form-item label="userName" prop="username">
<el-input v-model="form.username" placeholder="请输入数据库用户"/>
</el-form-item>
<el-form-item label="userPwd" prop="password">
<el-input v-model="form.password" placeholder="请输入数据库密码"/>
</el-form-item>
</el-form>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>数据连接参数</span>
</div>
<el-form ref="form" :model="form" :rules="rules" label-width="80px" >
<el-form-item label="数据连接参数" prop="name">
<el-input v-model="form.connectionParams" placeholder="请输入数据连接参数"/>
</el-form-item>
</el-form>
</el-card>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>连接池配置</span>
</div>
<el-form :model="sourceAddReq" label-width="120px" :inline="true" class="demo-form-inline">
<el-form-item label="初始连接数量:" prop="initCount">
<el-input v-model="sourceAddReq.initLinkNum" placeholder="初始连接数量"/>
<el-form ref="form" :model="form" :rules="rules" label-width="80px" :inline="true" class="demo-form-inline">
<el-form-item label="初始连接数量" prop="initCount">
<el-input v-model="form.initLinkNum" placeholder="初始连接数量"/>
</el-form-item>
<el-form-item label="最大连接数量:" prop="maxCount">
<el-input v-model="sourceAddReq.maxLinkNum" placeholder="最大连接数量"/>
<el-form-item label="最大连接数量" prop="maxCount">
<el-input v-model="form.maxLinkNum" placeholder="最大连接数量"/>
</el-form-item>
<el-form-item label="最大等待时间:" prop="maxTime">
<el-input v-model="sourceAddReq.maxWaitTime" placeholder="最大等待时间"/>
<el-form-item label="最大等待时间" prop="maxTime">
<el-input v-model="form.maxWaitTime" placeholder="最大等待时间"/>
</el-form-item>
<el-form-item label="最大等待次数:" prop="maxFrequency">
<el-input v-model="sourceAddReq.maxWaitTimes" placeholder="最大等待次数"/>
<el-form-item label="最大等待次数" prop="initCount">
<el-input v-model="form.maxWaitTimes" placeholder="最大等待次数"/>
</el-form-item>
</el-form>
</el-card>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>其他信息</span>
</div>
<el-form :model="sourceAddReq" label-width="140px" :inline="true" class="demo-form-inline">
<el-form-item label="是否初始化" prop="status">
<el-radio-group v-model="sourceAddReq.status">
<el-form ref="form" :model="form" :rules="rules" label-width="80px" :inline="true" class="demo-form-inline">
<el-form-item label="是否初始化" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in dict.type.yes_no"
:key="dict.value"
@ -117,303 +200,195 @@
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注">
<el-input type="textarea" v-model="sourceAddReq.remark"></el-input>
<el-form-item label="备注">
<el-input type="textarea" v-model="form.remark"></el-input>
</el-form-item>
</el-form>
</el-card>
<div slot="footer" class="dialog-footer">
<el-button @click="textP()"></el-button>
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="addSource()"> </el-button>
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-table
:data="source"
style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
label="接入源名称"
prop="dataResourceName">
</el-table-column>
<el-table-column
label="数据来源系统名称"
prop="dataSourcesSystemName">
</el-table-column>
<el-table-column
label="主机地址"
prop="host">
</el-table-column>
<el-table-column
label="端口号"
prop="port">
</el-table-column>
<el-table-column
label="数据接入类型"
prop="databaseType">
</el-table-column>
<el-table-column
label="数据库名称"
prop="databaseName">
</el-table-column>
<el-table-column align="status" label="是否初始化" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.yes_no" :value="scope.row.status"/>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- label="是否初始化"-->
<!-- prop="status">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.yes_no" :value="scope.row.status"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
label="备注"
prop="remark">
</el-table-column>
<el-table-column
align="right">
<template slot-scope="scope">
<el-button
icon="el-icon-pear"
size="mini"
type="text"
@click="update(scope.row)">修改</el-button>
<el-button
icon="el-icon-delete"
size="mini"
type="text"
@click="handleDelete(scope.row)">删除</el-button>
<el-button
icon="el-icon-service"
size="mini"
type="text"
@click="struceure(scope.row)">同步资产结构</el-button>
<el-button
icon="el-icon-aim"
size="mini"
type="text"
@click="textConnect(scope.row)">测试连接</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
//jsjsjson,
//import from ',
import {selectSourceList, update} 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";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import {
selectSourceList,
insertAdd,
connectDataSources,
deleteDataSourcesById,
syncAssetStructure, update, getInfo, connectionTest, structure, deleteSource
} from "@/api/etl/switch";
export default {
dicts: ['yes_no', 'sys_normal_disable'],
//import使"
components: {
},
props: {},
name: "switch",
dicts: ['sys_normal_disable','yes_no'],
data() {
//"
return {
sourceAddReq:{
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dataList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
name: undefined,
databaseName: undefined
},
//
form: {},
//
rules: {
dataResourceName: [{required: true, message: "接入源名称不能为空", trigger: "blur"}],
dataSourcesSystemName: [{required: true, message: "数据来源系统名称不能为空", trigger: "blur"}],
host: [{required: true, message: "主机地址不能为空", trigger: "blur"}]
},
ids:[],
dialogFormVisible:false,
SourceReq:{
},
source:[],
dataSourcesSystemName: [{required: true, message: "数据来源名称不能为空", trigger: "blur"}],
host: [{required: true, message: "数据来源ip不能为空", trigger: "blur"}],
port: [{required: true, message: "来源地址端口号不能为空", trigger: "blur"}],
databaseType: [{required: true, message: "类型不能为空", trigger: "change"}],
initLinkNum: [{required: true, message: "初始连接数量不能为空", trigger: "blur"}],
maxLinkNum: [{required: true, message: "最大连接数量不能为空", trigger: "blur"}],
maxWaitTime: [{required: true, message: "最大等待时间不能为空", trigger: "blur"}],
maxWaitTimes: [{required: true, message: "最大等待次数不能为空", trigger: "blur"}],
status: [{required: true, message: "是否初始化不能为空", trigger: "change"}],
}
};
},
// data",
computed: {},
//data",
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.code ===200){
alert("同步资产成功,请查询数据库")
}
})
},
deleteSourceByIds(){
deleteSource(this.ids).then(res=>{
if(res.code===200){
alert("删除成功");
}
})
},
handleDelete(row){
deleteSource(row.id).then(res=>{
if (res.code===200){
location.reload();
}
})
},
textP(){
connectionTest(this.sourceAddReq).then(res=>{
if (res.code===200){
alert("测试连接成功")
}else{
alert("连接失败")
}
})
},
addSource: function (){
this.$refs["sourceAddReq"].validate(valid=> {
if (valid){
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){
connectionTest(row).then(res=>{
if (res.code===200){
alert("测试连接成功");
}else {
alert("测试连接失败");
}
})
},
//
insertAdd(){
this.reset();
this.dialogFormVisible=true
},
findSelectSourceList(){
selectSourceList(this.SourceReq).then(res=>{
this.source=res.data.rows;
})
},
findSelectSourceExport(){
this.download('source/source/export', {
...this.SourceReq
}, `source_${new Date().getTime()}.xlsx`)
},
handleSelectionChange(row){
this.ids=[];
for (let rowKey in row) {
this.ids.push(row[rowKey].id)
}
},
},
// - 访this",
created() {
this.findSelectSourceList();
this.getList();
},
// - 访DOM",
mounted() {
},
beforeCreate() {
}, // - ",
beforeMount() {
}, // - ",
beforeUpdate() {
}, // - ",
updated() {
}, // - ",
beforeDestroy() {
}, // - ",
destroyed() {
}, // - ",
activated() {
} //keep-alive",
methods: {
syncAssetStructure(row){
connectionTest(row).then((res)=>{
console.log(res)
if (res.code===200){
this.$modal.msgSuccess("同步成功");
}else {
this.$modal.msgError("同步失败");
}
})
},
/** 连接数据源 */
connectDataSources(row){
structure(row).then(res=>{
if (res.code===200){
this.$modal.msgSuccess("连接成功");
}else {
this.$modal.msgError("连接失败");
}
})
},
/** 查询列表 */
getList() {
this.loading = true;
selectSourceList(this.queryParams).then(response => {
this.dataList = response.data.rows;
this.total = response.data.total;
this.loading = false;
console.log(response)
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加岗位";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getInfo(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改岗位";
});
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate(valid => {
if (valid) {
alert(this.form.id)
if (this.form.id != undefined) {
update(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
insertAdd(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id || this.ids;
this.$modal.confirm('是否确认删除该数据项?').then(function () {
return deleteSource(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('source/source/export', {
...this.queryParams
}, `post_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<style scoped>
</style>

View File

@ -2,9 +2,66 @@
<div>
<h1 style="text-align: center; margin-bottom: 30px;">安全设置</h1>
<el-divider></el-divider>
<label>登录密码</label>
<label>安全性高的密码可以使帐号更安全</label>
<button @click="openModal"></button>
<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">
@ -47,7 +104,7 @@
<script>
import axios from 'axios';
import {getUserProfile,sendCode,checkCode} from "@/api/system/user";
import {getUserProfile,sendCode,checkCode,updatePhone} from "@/api/system/user";
import {updateUserPwd} from "@/api/system/user";
export default {
@ -60,6 +117,14 @@ export default {
}
};
return {
isVisible: false,
currentPhone: '',
newPhone: '',
phoneError: '',
verificationCode: '',
isCurrentPhoneModalVisible: false,
isVerificationModalVisible: false,
isNewPhoneModalVisible: false,
//
rules: {
oldPassword: [
@ -80,6 +145,7 @@ export default {
confirmPassword: undefined
},
showModal: false,
aModel: false,
phonenumber: '',
code: '',
oldPassword: '',
@ -92,6 +158,48 @@ export default {
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;
@ -123,6 +231,17 @@ export default {
}
});
},
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) {
@ -135,6 +254,7 @@ export default {
}
},
resetForm() {
this.phonenumber = '';
this.code = '';
@ -160,6 +280,16 @@ export default {
justify-content: center;
}
.container {
display: flex;
justify-content: space-between;
}
.button-wrapper {
margin-left: auto; /* 将按钮移动到右侧 */
}
.modal-content {
background: #fff;
padding: 20px;
@ -186,6 +316,50 @@ input {
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;

View File

@ -1,11 +1,234 @@
<script setup>
</script>
<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:purchaseRecord: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.dataName }}
</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.amount }}
</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"
/>
<el-card style="margin-top: 50px">
<div>
<!-- 装ECharts的容器 -->
<div id="main" style="width: 100%; height: 520px; background: #fff">
</div>
</div>
</el-card>
</div>
</template>
<style scoped lang="scss">
</style>
<script>
import * as echarts from 'echarts' //echarts
import { userloginfo } from "@/api/system/user";
import PanelGroup from "@/views/dashboard/PanelGroup.vue";
export default {
components: {PanelGroup},
data() {
return {
charts: "",
opinionData: [], //
b: [],
dateRange: [],
listDate: [],
total: 0,
queryParams: {
pageNum: 1,
pageSize: 10,
}
}
},
created() {
this.getList();
},
mounted() {
this.drawLine();
},
methods: {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 导出按钮操作 */
handleExport() {
this.download('system/user/purchaseRecord/export', {
...this.queryParams
}, `pay_${new Date().getTime()}.xlsx`)
},
getList() {
userloginfo(this.addDateRange(this.queryParams,this.dateRange)).then(response => {
this.listDate = response.data.rows;
this.total = response.data.total;
this.drawLine();
}
);},
drawLine() {
// 线
this.charts = echarts.init(document.getElementById('main'));
this.b = this.listDate.map(item => item.dataName);
this.opinionData = this.listDate.map(item => item.amount);
// 线
this.charts.setOption({
title: {
left: "3%",
top: "5%",
text: "消费趋势", //
},
tooltip: {
trigger: "axis",
},
legend: {
align: "right",
left: "3%",
top: "15%",
data: ["消费金额"], //
},
grid: {
top: "30%",
left: "5%",
right: "5%",
bottom: "5%",
containLabel: true,
},
toolbox: {
feature: {
saveAsImage: {},
},
},
// x
xAxis: {
type: "category",
boundaryGap: true,
axisTick: {
alignWithLabel: true,
},
//
data:this.b
// data: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
},
// y
yAxis: {
type: "value",
boundaryGap: true,
splitNumber: 4,
interval: 250,
},
//
series: [
{
name: "消费金额", //
type: "line",
stack: "总量", //
data: this.opinionData, //
areaStyle: {
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgb(255,200,213)",
},
{
offset: 1,
color: "#ffffff",
},
],
global: false,
},
},
itemStyle: {
color: "rgb(255,96,64)",
lineStyle: {
color: "rgb(255,96,64)",
},
},
},
],
});
},
},
}
</script>

View File

@ -44,7 +44,7 @@ export default {
addSysUser: {},
disabled: false,
//
returnUrl:'http://172.13.1.1//money/money',
returnUrl:'http://172.13.1.1/money/money',
//
rechargeParams: {
"totalAmt": '', //

View File

@ -63,18 +63,22 @@
</template>
<script>
import {userBalance} from "@/api/system/user"; //
import {userBalance,months} from "@/api/system/user"; //
import * as echarts from 'echarts' //echarts
import {checkRealNameAuth} from "@/api/system/user";
import item from "@/layout/components/Sidebar/Item.vue";
export default {
data() {
return {
charts: "",
dialogVisible: false,
listDate:[],
a:[],
b:[],
dialogFormVisible: false,
formLabelWidth: '120px',
opinionData: ["155", "400", "900", "800", "300", "900", "270", "684", "165", "0", "300", "150"], //
opinionData: [],
userBalanceData: {
userBalance: '加载中...'
},
@ -97,11 +101,25 @@ export default {
},
created() {
this.fetchUserBalance();
this.getList()
},
mounted() {
this.drawLine();
},
methods: {
getList(){
months().then(response => {
const responseDate = response;
responseDate.forEach(item => {
console.log('月',item.month, '总金额:', item.totalAmount)
});
this.listDate = responseDate;
this.drawLine();
this.$nextTick( () => {
console.log(JSON.stringify(this.listDate))
});
});
},
handleCancel() {
this.dialogVisible = false;
},
@ -172,6 +190,10 @@ export default {
// 线
this.charts = echarts.init(document.getElementById('main'));
this.a = this.listDate.map(item => item.month)
this.b = this.listDate.map(item => item.totalAmount)
// 线
this.charts.setOption({
title: {
@ -213,7 +235,7 @@ export default {
alignWithLabel: true,
},
//
data: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
data: this.a,
},
// y
@ -230,7 +252,7 @@ export default {
name: "消费金额", //
type: "line",
stack: "总量", //
data: this.opinionData, //
data: this.b,
areaStyle: {
color: {
type: "linear",

View File

@ -0,0 +1,148 @@
<template>
<div>
<el-form :model="form" label-width="80px">
<el-form-item>
<input v-model="form.userName" style="padding: 10px 10px;float: initial;" placeholder=>
<input v-model="form.connectorName" style="padding: 10px 10px;float: initial;margin-left: 20px" placeholder=>
<el-button @click="findConnectorUserList()" style="padding: 10px 20px;margin-left: 40px">查询</el-button>
</el-form-item>
</el-form>
<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>
//jsjsjson,
//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)=>{
console.log(res.data);
this.tableData=res.data;
})
},
async fetchUserBalance() {
try {
const userId = localStorage.getItem('userId');
console.log(userId)// userIdlocalStorage
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>

View File

@ -1,193 +1,244 @@
<template>
<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-container style="height: 1000px; border: 1px solid #eee">
<el-aside width="180px">
<el-menu :default-openeds="['1', '3']">
<el-menu-item-group>
<span style="font-weight: bold;font-size: 25px;">全部类型</span>
</el-menu-item-group>
<el-menu-item-group >
<el-link type="primary" style="font-weight: bold;font-size: 20px;" v-for="(connectSort, index) in connectSort"
:key="index"
@click="findApiList(connectSort.connectorSort)">
{{ connectSort.connectorSort }}
</el-link>
</el-menu-item-group>
</el-menu>
</el-aside>
<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">
<el-container>
<el-main>
<el-form label-width="40px" :model="form">
<el-form-item>
<input v-model="form.connectorName" style="padding: 10px 10px;float: initial;" placeholder=>
<el-button @click="findApiList()" style="padding: 10px 20px;margin-left: 40px">查询</el-button>
</el-form-item>
</el-form>
<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: 400px; height: 600px;" shadow="hover">
<div slot="header" class="clearfix">
<span style="font-weight: bold;font-size: 30px">{{connector.connectorName}}</span>
<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-button type="primary" style="float: right; padding: 10px 10px" @click="testWeatherForecast()" 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>
</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">
<!--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-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-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.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.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-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="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-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="天气预报" :visible.sync="dialogFormVisible6">
<el-form :model="formWeatherForecast">
<el-form-item label="城市名" >
<el-input v-model="formWeatherForecast.cityName" autocomplete="off" placeholder="请输入城市名"></el-input>
</el-form-item>
<span style="font-weight: bold;font-size: 20px" v-if="formWeatherForecast.reason==true">
城市{{this.formWeatherForecast.city}}<br>
天气{{this.formWeatherForecast.info}}<br>
温度{{this.formWeatherForecast.temperature}}<br>
湿度{{this.formWeatherForecast.humidity}}<br>
风向{{this.formWeatherForecast.direct}}<br>
风力{{this.formWeatherForecast.power}}<br>
空气质量{{this.formWeatherForecast.aqi}}<br>
</span>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="getWeatherForecast(cityName)"></el-button>
</div>
</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" disabled 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.connectorName" disabled 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.connectorDescribe" disabled 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.connectorPrice" disabled 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="产品公司" :label-width="formLabelWidth">
<el-input v-model="buyForm.connectorCompany" disabled 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_URL" :label-width="formLabelWidth">
<el-input v-model="buyForm.connectorApiurl" disabled 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="API_EYE" :label-width="formLabelWidth">
<el-input v-model="buyForm.connectorApikey" disabled 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 v-model="buyForm.connectorRequest" disabled 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" :max="10"></el-input-number>
</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>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="buyInterface()"> </el-button>
</div>
</el-dialog>
</el-main>
</el-container>
</el-container>
<!-- <el-button type="primary">+申请新数据</el-button>-->
</div>
</template>
@ -195,7 +246,7 @@
<script>
//jsjsjson,
//import from ',
import {findConnectorList} from "@/api/port/port";
import {findApiList} from "@/api/port/port";
import index from "vuex";
import {phonePlace} from "@/api/port/port";
import {getIpPlace} from "@/api/port/port";
@ -204,6 +255,9 @@ 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";
import {findConnectSort} from "@/api/port/port";
import {getWeatherForecast} from "@/api/port/port";
export default {
//import使"
components: {},
@ -212,16 +266,33 @@ export default {
//"
return {
userBalanceData: {
userBalance: '加载中...'
},
formWeatherForecast:{
cityName:"",
city:"",
info:"",
temperature:"",
humidity:"",
direct:"",
power:"",
aqi:"",
reason:"",
},
formWeather:{},
data:[],
defaultProps: {
children:"citys",
label:'provinceName',
},
connectSort:[],
connectorList:[],
gridData:[],
gridData2:[],
form:{},
form:{
connectorSort:"",
},
//
formPostCode:{
code:"",
@ -289,6 +360,7 @@ export default {
dialogFormVisible3:false,
dialogFormVisible4:false,
dialogFormVisible5:false,
dialogFormVisible6:false,
dialogTableVisible:false,
};
},
@ -305,12 +377,49 @@ export default {
watch: {},
//",
methods: {
async fetchUserBalance() {
try {
const userId = localStorage.getItem('userId');
console.log(userId)// userIdlocalStorage
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;
})
this.$prompt('请输入支付密码', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /\d{6}?/,
inputErrorMessage: '密码格式不正确'
}).then(({ value }) => {
this.$message({
type: 'success',
message: '你的密码是: ' + value
});
doBuyInterface(this.buyForm).then((res)=>{
console.log(res);
alert(res.msg);
this.dialogFormVisible5=false;
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消输入'
});
});
},
//
buy(connector){
@ -334,6 +443,24 @@ export default {
this.formPostCode.reason=true;
})
},
//
getWeatherForecast(){
getWeatherForecast(this.formWeatherForecast.cityName).then((res)=>{
console.log(res.data);
this.formWeatherForecast.city=res.data.city;
this.formWeatherForecast.info=res.data.info;
this.formWeatherForecast.temperature=res.data.temperature;
this.formWeatherForecast.humidity=res.data.humidity;
this.formWeatherForecast.direct=res.data.direct;
this.formWeatherForecast.power=res.data.power;
this.formWeatherForecast.aqi=res.data.aqi;
this.formWeatherForecast.reason=true;
})
},
//
testWeatherForecast(){
this.dialogFormVisible6=true;
},
testMailbox(){
this.dialogFormVisible3=true;
},
@ -384,12 +511,10 @@ export default {
}
})
},
testIP(ip){
this.formIp.ip=ip;
testIP(){
this.dialogFormVisible1=true;
},
testPhone(tel){
this.formInline.tel=tel;
testPhone(){
this.dialogFormVisible=true;
},
phonePlace(){
@ -405,16 +530,25 @@ export default {
}
})
},
findConnectorList(){
findConnectorList(this.form).then((res)=>{
findApiList(connectorSort){
this.form.connectorSort=connectorSort;
findApiList(this.form).then((res)=>{
this.connectorList=res.data;
console.log(res.data);
})
},
findConnectSort(){
findConnectSort().then((res)=>{
this.connectSort=res.data;
console.log(this.connectSort);
})
}
},
// - 访this",
created() {
this.findConnectorList();
this.fetchUserBalance();
this.findApiList();
this.findConnectSort()
},
// - 访DOM",
mounted() {

View File

@ -54,6 +54,14 @@
</template>
</el-table-column>
<el-table-column
label="更新时间"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.connectorUptime }}</span>
</template>
</el-table-column>
<el-table-column
label="更新时间"
width="180">

View File

@ -10,7 +10,7 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户名称" prop="userName">
<el-form-item label="" prop="userName">
<el-input
v-model="queryParams.userName"
clearable