From 3189457a622eccd3bfd17d9b001a5969b2210c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=AC=A3=E6=82=A6?= <2289014031@qq.com> Date: Sun, 8 Sep 2024 16:59:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=9A=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/background/apimanage.js | 7 - src/api/market/workbench.js | 9 - src/api/property/astr.js | 14 ++ src/api/property/property.js | 7 + src/router/index.js | 26 +-- src/views/background/apimanage/index.vue | 59 +------ src/views/background/apiupdmessage/index.vue | 25 +-- src/views/market/myapi/index.vue | 19 +- src/views/market/pay/index.vue | 176 +++++++++---------- src/views/market/product/index.vue | 9 +- src/views/property/asDisplay/index.vue | 55 +++--- src/views/property/astr/index.vue | 28 ++- 12 files changed, 194 insertions(+), 240 deletions(-) diff --git a/src/api/background/apimanage.js b/src/api/background/apimanage.js index c9f90b9..6b04e0b 100644 --- a/src/api/background/apimanage.js +++ b/src/api/background/apimanage.js @@ -47,10 +47,3 @@ export function delapi(productId){ }) } -export function getprice(productId){ - return request({ - url:"/background/apimanage/getprice/"+productId, - method: "POST", - }) -} - diff --git a/src/api/market/workbench.js b/src/api/market/workbench.js index 5479913..21ed163 100644 --- a/src/api/market/workbench.js +++ b/src/api/market/workbench.js @@ -7,12 +7,3 @@ export function gethostportList(){ method: "GET", }) } - -export function getcompany(){ - return request({ - url:"/market/company/selectcompany", - method: "POST", - }) -} - - diff --git a/src/api/property/astr.js b/src/api/property/astr.js index c2dc1cd..7a69bbb 100644 --- a/src/api/property/astr.js +++ b/src/api/property/astr.js @@ -6,3 +6,17 @@ export function getExtractDataTableNameList() { method: 'post', }) } + +export function findTableValue(dataId,name) { + return request({ + url: '/property/dataRunName/findTableValue?dataId='+dataId+"&tableName="+name, + method: 'post', + }) +} + +export function selectBasicList() { + return request({ + url: '/property/dataRunName/selectBasicList', + method: 'post', + }) +} diff --git a/src/api/property/property.js b/src/api/property/property.js index 9b0a876..95b5b53 100644 --- a/src/api/property/property.js +++ b/src/api/property/property.js @@ -48,3 +48,10 @@ export function selectHandleClick(data) { }) } +export function extractDataName(data) { + return request({ + url: '/property/dataRunName/extractDataName', + method: 'post', + data: data + }) +} diff --git a/src/router/index.js b/src/router/index.js index 1e7b554..815bfcf 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -148,31 +148,7 @@ export const constantRoutes = [ path: 'index', name: 'apiupdmessage', component: () => import('@/views/background/apiupdmessage/index.vue'), - meta: { title: '接口信息修改页面', icon: 'form' } - } - ] - }, - { - path: '/product', - component: Layout, - children: [ - { - path: 'index', - name: 'product', - component: () => import('@/views/market/product/index.vue'), - meta: { title: '数据块', icon: 'form' } - } - ] - }, - { - path: '/Workbench', - component: Layout, - children: [ - { - path: 'index', - name: 'Workbench', - component: () => import('@/views/market/workbench/index.vue'), - meta: { title: '信息', icon: 'form' } + meta: { title: '接口列表', icon: 'form' } } ] }, diff --git a/src/views/background/apimanage/index.vue b/src/views/background/apimanage/index.vue index 53a7aed..638d6c4 100644 --- a/src/views/background/apimanage/index.vue +++ b/src/views/background/apimanage/index.vue @@ -116,12 +116,10 @@ :total="total"> - -
@@ -134,6 +132,9 @@ + + + @@ -149,28 +150,6 @@ - - - - - - - - - - 价格 - - - - - - - - - - - -
@@ -192,13 +171,14 @@ //例如:import 《组件名称》 from '《组件路径》, import { addproduct, - delapi, getprice, + delapi, + productStateLis, + productStateList, selectapiList, UpdproductState } from "@/api/background/apimanage"; import {resetForm} from "@/utils/muyu"; import {add} from "lodash/math"; -import api from "js-cookie"; export default { name: "Apimanage", @@ -209,13 +189,6 @@ export default { //这里存放数据" return { tableData:[], - moneyData:[], - money:{ - timemoney:'', - daymoney:'', - monthmoney:'', - yearmoney:'' - }, ruleForm:{ pageNum:1, pageSize:9, @@ -280,21 +253,7 @@ export default { }, //修改 handleEdit(row){ - //查询中间表,获取不同规格对应的价格 - getprice(row.productId).then(response=>{ - this.moneyData=response.data - this.money.timemoney=this.moneyData[0].middlePrice - this.money.daymoney=this.moneyData[1].middlePrice - this.money.monthmoney=this.moneyData[2].middlePrice - this.money.yearmoney=this.moneyData[3].middlePrice - row.timemoney = this.money.timemoney; - row.daymoney = this.money.daymoney; - row.monthmoney = this.money.monthmoney; - row.yearmoney = this.money.yearmoney; - this.$router.push({path:"/apiupdmessage/index",query:{api:row}}) - }) - - + this.$router.push({path:"/apiupdmessage/index",query:{api:row}}) }, //删除 handleDelete(row){ diff --git a/src/views/background/apiupdmessage/index.vue b/src/views/background/apiupdmessage/index.vue index 55a38b7..97fdbba 100644 --- a/src/views/background/apiupdmessage/index.vue +++ b/src/views/background/apiupdmessage/index.vue @@ -20,6 +20,9 @@ + + + @@ -35,28 +38,6 @@ - - - - - - - - - - 价格 - - - - - - - - - - - - 修改 重置 diff --git a/src/views/market/myapi/index.vue b/src/views/market/myapi/index.vue index 7644a11..5564560 100644 --- a/src/views/market/myapi/index.vue +++ b/src/views/market/myapi/index.vue @@ -8,18 +8,19 @@
- - - - - - - - + + + + 提交
+
新增数据
@@ -38,7 +39,7 @@
- 使用 + 测试
diff --git a/src/views/market/pay/index.vue b/src/views/market/pay/index.vue index 6479413..5c145b6 100644 --- a/src/views/market/pay/index.vue +++ b/src/views/market/pay/index.vue @@ -17,94 +17,94 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/market/product/index.vue b/src/views/market/product/index.vue index 9b81cc8..ba66ab7 100644 --- a/src/views/market/product/index.vue +++ b/src/views/market/product/index.vue @@ -73,13 +73,14 @@ //例如:import 《组件名称》 from '《组件路径》, -import {ifbuy, selectList, selectTypeList} from "@/api/market/product"; +import {selectList, selectTypeList} from "@/api/market/product"; export default { name: 'Product', //import引入的组件需要注入到对象中才能使用" components: {}, props: {}, + data() { //这里存放数据" return { @@ -131,12 +132,6 @@ export default { }, //接口测试页面 test(product){ - //判断是否已购买 - ifbuy(product).then(response=>{ - if (response.code!=200) { - alert(response.msg) - } - }) this.$router.push({path:"/apitest/index",query:{myapi:JSON.stringify(product)}}) }, // test(product) { diff --git a/src/views/property/asDisplay/index.vue b/src/views/property/asDisplay/index.vue index 42d6a15..427e934 100644 --- a/src/views/property/asDisplay/index.vue +++ b/src/views/property/asDisplay/index.vue @@ -1,6 +1,6 @@ @@ -51,13 +51,13 @@ - - + - {{ DataValue.dataMapping}} + {{ DataValue.type }} - {{ DataValue.dataValue }} + {{ DataValue.value }} @@ -65,15 +65,15 @@ @@ -82,10 +82,11 @@ label="type"> + @@ -111,10 +112,10 @@ export default { return { data:[], defaultProps: { - children: 'tableNames', - label: 'name' + children: 'children', + label: 'tableName' }, - tableBasic:[], + tableBasic:{}, tableStructure:[], assetShowList: [ // {key: "测试.sys_user.id", type: "String", value: 1}, @@ -123,8 +124,9 @@ export default { // {key: "测试.sys_user.email", type: "String", value: "123@136.com"}, // {key: "测试.sys_user.sex", type: "String", value: "Y"}, ], + kvtList: [], DataValue:[], - dataNum:'', + }; }, //计算属性 类似于data概念", @@ -141,12 +143,23 @@ export default { }, handleNodeClick(data){ + console.log("...."+data) this.tableBasic=data - console.log(this.tableBasic) - this.dataNum=data.tableFie.length - this.tableStructure=data.tableFie - console.log(this.tableStructure) - }, + + // findStructureByTableId(data.id).then((res)=>{ + // this.tableStructure=res.data + // }) + if (data.children==null){ + findTableValueList(data.basicId,data.tableName).then(res=>{ + this.assetShowList=res.data; + this.DataValue=res.data; + }) + } + console.log("-----"+this.DataValue); + console.log("...."+data.basicId) + + + } }, //生命周期 - 创建完成(可以访问当前this实例)", created() { diff --git a/src/views/property/astr/index.vue b/src/views/property/astr/index.vue index 4030a76..9d606df 100644 --- a/src/views/property/astr/index.vue +++ b/src/views/property/astr/index.vue @@ -62,7 +62,7 @@ - + @@ -87,7 +87,7 @@ //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等), //例如:import 《组件名称》 from '《组件路径》, -import { getExtractDataTableNameList } from '@/api/property/astr' +import { findTableValue, getExtractDataTableNameList } from '@/api/property/astr' export default { //import引入的组件需要注入到对象中才能使用" @@ -124,10 +124,34 @@ export default { }) }, handleNodeClick(data){ + // console.log(data) this.tableBasic=data this.dataNum=data.tableFie.length this.tableStructure=data.tableFie + // console.log(this.tableStructure) + findTableValue(data.dataId,data.name).then(res=>{ + let tableMapping=res.data + // console.log(res.data) + for (const index in tableMapping) { + for (const i in this.tableStructure) { + if (tableMapping[index].key === this.tableStructure[i].field) { + + this.tableStructure[i].types.push(tableMapping[index].type) + + console.log(this.tableStructure[i].types) + if (i!== 0&& this.tableStructure[i].types==this.tableStructure[0].types){ + + alert("dawdwadad") + return + } + } + } + + } + + + }) },