From 6e7388ddf4d3b91b00cc2705fe317e7539c8830d Mon Sep 17 00:00:00 2001 From: lxyer <237809796@qq.com> Date: Wed, 10 Apr 2019 18:08:50 +0800 Subject: [PATCH] . --- root/api/db.js | 12 ++++ root/api/meta.js | 64 ++----------------- root/api/plat.js | 5 +- root/api/user.js | 2 +- root/index.html | 1 + root/metadata/dataList.html | 4 +- root/metadata/metatable/import.html | 55 ++++++++++++---- root/plat/db.html | 3 +- .../java/net/tccn/service/_QtaskService.java | 6 ++ 9 files changed, 71 insertions(+), 81 deletions(-) create mode 100644 root/api/db.js diff --git a/root/api/db.js b/root/api/db.js new file mode 100644 index 0000000..4900d7c --- /dev/null +++ b/root/api/db.js @@ -0,0 +1,12 @@ +const db = { + catalogList({dbAccount, dbPlatId}) { // database列表 + console.log(dbAccount) + return red.postX('/_db/catalog_list', {dbAccount: JSON.stringify(dbAccount), dbPlatId}) + }, + tableList({dbPlatId, catalog}) { // 数据库表列表 + return red.postX('/_db/table_list', {dbPlatId, catalog}) + }, + tableInfo({dbPlatId, catalog, tableName}) { + return red.postX('/_db/table_info', {dbPlatId, catalog, tableName}) + } +} \ No newline at end of file diff --git a/root/api/meta.js b/root/api/meta.js index ded5851..85988d1 100644 --- a/root/api/meta.js +++ b/root/api/meta.js @@ -1,50 +1,5 @@ -/*import red from '../res/js/red'*/ -/*const getPlats = (callback) => { - red.getJSON("/meta/plat_list", {}, json => callback(json)); -} - -const getTableList = (callback) => { - red.getJSON("/meta/tablelist",{}, function (json) { - callback(json); - }); -} - -const getTableDetail = ({name}, callback) => { - red.getJSON("/meta/tableinfo",{name}, function (json) { - callback(json); - }); -} - -const getServiceList = (callback) => { - red.getJSON("/meta/service_list",{}, function (json) { - json = red.replacePoint(json); - callback(json); - }); -} - -const getServiceInfo = ({name}, callback) => { - red.getJSON("/meta/service_info",{name}, res => { - let row = red.replacePoint(res); - row.shows = row.shows || []; - row.exports = row.exports || []; - row.imports = row.imports || []; - row.filters = row.filters || []; - - callback(row); - }); -} - -function getServiceDetail({name}, callback) { - red.getJSON("/meta/service_detail",{name}, function (json) { - json = red.replacePoint(json) - callback(json); - }); -}*/ const meta = { - /*getPlats: (callback) => { - red.getJSON("/meta/plat_list", {}, json => callback(json)); - },*/ getTableList(callback) { red.getJSON("/meta/tablelist",{}, json => callback(json)); }, @@ -82,10 +37,9 @@ const meta = { callback(json); }); }, - getCfg({name}, callback) { - red.getJSON("/meta/cfg",{name}, json => { - json = red.replacePoint(json) - callback(json); + getCfg({name}) { + return red.postX("/meta/cfg",{name}, res => { + return red.replacePoint(res) }); }, getDataList({name, filters, orders, limit}, callback) { @@ -94,14 +48,4 @@ const meta = { callback(json) }) } -} - -/* -export { - getTableList, - getPlats, - getServiceDetail, - getServiceInfo, - getServiceList, - getTableDetail -}*/ +} \ No newline at end of file diff --git a/root/api/plat.js b/root/api/plat.js index c28d24c..7e1bb1f 100644 --- a/root/api/plat.js +++ b/root/api/plat.js @@ -15,8 +15,5 @@ const plat = { dbSave({plat}) { return red.postX('/plat/db_save', {plat}) }, - catalogList({dbAccount, dbPlatId}) { // database列表 - console.log(dbAccount) - return red.postX('/_db/catalog_list', {dbAccount: JSON.stringify(dbAccount), dbPlatId}) - } + } \ No newline at end of file diff --git a/root/api/user.js b/root/api/user.js index e2c0ded..2aa54a2 100644 --- a/root/api/user.js +++ b/root/api/user.js @@ -6,7 +6,7 @@ const login = ({username, pwd}) => { const logout = () => { red.getJSON("/user/logout",{}, function () { - red.showMsg({msg:"退出成功"}); + red.showOk('退出成功') setTimeout(() => { location.href = "/user/login.html"; }, 2000) diff --git a/root/index.html b/root/index.html index 57397d3..330113f 100644 --- a/root/index.html +++ b/root/index.html @@ -92,6 +92,7 @@ + diff --git a/root/metadata/dataList.html b/root/metadata/dataList.html index ba3ee5b..bf4d8c9 100644 --- a/root/metadata/dataList.html +++ b/root/metadata/dataList.html @@ -228,9 +228,7 @@ }); }, loadCfg() { - getCfg({name: this.service}, json => { - vm.cfg = json; - }); + getCfg({name: this.service}).then(res => this.cfg = res); }, dealField(bean, field) { var str = ""; diff --git a/root/metadata/metatable/import.html b/root/metadata/metatable/import.html index 50f584b..9fea4d2 100644 --- a/root/metadata/metatable/import.html +++ b/root/metadata/metatable/import.html @@ -56,12 +56,12 @@