From 4a800a8fc83c6bd1f86a8e847b079a51a7532c09 Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@smartai.com> Date: 星期三, 20 七月 2022 15:05:58 +0800 Subject: [PATCH] 修复国标配置的bug --- src/pages/ai/index/App.vue | 99 +++++++++++++++++++++++++++++++++++++------------ 1 files changed, 75 insertions(+), 24 deletions(-) diff --git a/src/pages/ai/index/App.vue b/src/pages/ai/index/App.vue index 0c04f9f..e466408 100644 --- a/src/pages/ai/index/App.vue +++ b/src/pages/ai/index/App.vue @@ -26,7 +26,8 @@ <span class="icon iconfont all-scene"></span> <el-input placeholder="鎼滅储" - v-model="input3" + v-model="inputText" + @change="searchAll" class="input-with-select" > <i class="el-icon-search" slot="prepend"></i> @@ -66,7 +67,7 @@ class="quick-item" v-for="(item, index) in recomandUpdateList" :key="index" - @click="checkDetail(item, 'inactive')" + @click="checkDetail(item, 'inactive', item.sdk_name)" > <div class="icon-img"> <span class="icon iconfont" v-if="item.isUpgrade" @@ -84,11 +85,18 @@ <img v-else :src="item.icon" alt /> </div> <div class="desc"> - <div class="desc-1">{{ item.sdk_name || item.name }}</div> + <el-tooltip + :content="item.sdk_name || item.name" + effect="light" + > + <div class="desc-1">{{ item.sdk_name || item.name }}</div> + </el-tooltip> <div class="desc-2">鐗堟湰 {{ item.version }}</div> </div> <div class="right-icon"> - <span class="icon iconfont"></span> + <el-tooltip effect="dark" content="涓嬭浇" placement="bottom"> + <span class="icon iconfont"></span> + </el-tooltip> </div> </div> </div> @@ -141,7 +149,10 @@ class="front-page-item" v-for="(item, index) in tempList" :key="index" - @click="checkDetail(item)" + @click="checkDetail(item, null, item.sdk_name)" + :class="{ + disabled: activeName == '搴旂敤涓績' && !item.canUpOrIns, + }" > <div class="icon-img"> <span class="icon iconfont" v-if="item.isUpgrade" @@ -159,7 +170,12 @@ <img v-else :src="item.icon" alt /> </div> <div class="desc"> - <div class="desc-1">{{ item.sdk_name || item.name }}</div> + <el-tooltip + :content="item.sdk_name || item.name" + effect="light" + > + <div class="desc-1">{{ item.sdk_name || item.name }}</div> + </el-tooltip> <div class="desc-2">鐗堟湰 {{ item.version }}</div> </div> <div class="right-btn"> @@ -168,7 +184,7 @@ type="primary" class="other-btn" round - @click="checkDetail(item)" + @click="checkDetail(item, null, item.sdk_name)" v-if="activeName == '搴旂敤涓績' && item.price > 0" >婵�娲�</el-button > @@ -280,7 +296,7 @@ class="front-page-item item-dimmed" v-for="(item, index) in tempDarkList" :key="index" - @click="checkDetail(item, 'activeNotInstall')" + @click="checkDetail(item, 'activeNotInstall', item.sdk_name)" > <div class="icon-img"> <img @@ -295,7 +311,12 @@ <img v-else :src="item.icon" alt /> </div> <div class="desc"> - <div class="desc-1">{{ item.sdk_name || item.name }}</div> + <el-tooltip + :content="item.sdk_name || item.name" + effect="light" + > + <div class="desc-1">{{ item.sdk_name || item.name }}</div> + </el-tooltip> <div class="desc-2">鐗堟湰 {{ item.version }}</div> </div> <div class="right-btn"> @@ -343,7 +364,9 @@ class="upload-demo" single tip + :sourceType="3" :isDrag="true" + :attrs="{ accept: '.zip,.tar,.gz,.tar.gz' }" tipWords="鐐瑰嚮涓婁紶" uploadPlaceholder="绠楁硶杞欢" url="/data/api-v/sdk/upload" @@ -357,6 +380,8 @@ <detailPage :detailProductID="detailProductID" :detailType="detailType" + :detailPrice="detailPrice" + :isSdk="isSdk" v-if="inDetail" @flushSdk="getAllSdk" @flushApp="getAllApps" @@ -469,6 +494,7 @@ showUpload: false, detailType: "", detailProductID: "", + detailPrice: "", buttonAuthority: sessionStorage.getItem("buttonAuthoritys") || [], activeName: "搴旂敤涓績", patchUpdateStatus: "", @@ -490,7 +516,7 @@ isSDKDialog: true, actType: "", actId: "", - input3: "", + inputText: "", tempList: [], select: "", activedSdkOrApp: { @@ -543,6 +569,12 @@ this.autoRefresh = false; }, methods: { + searchAll() { + this.getAllApps(); + this.getAllSdk(); + this.getUnActivedList(1); + this.getUnActivedAppList(); + }, goback() { this.inDetail = false; }, @@ -614,9 +646,14 @@ this.tempDarkList = []; } }, - checkDetail(item, typ) { + checkDetail(item, typ, sdkName) { + /* if (!item.canUpOrIns && typ == "Appcenter") { + return false; + } */ + this.isSdk = Boolean(sdkName); this.inDetail = true; this.detailProductID = item.id; + this.detailPrice = item.price; if (typ) { this.detailType = typ; } else { @@ -659,7 +696,7 @@ }) .catch((e) => { this.isInstall = false; - this.$message.error(e.data); + this.$message.error(e.msg); }); }, downloadApp(app, action) { @@ -683,7 +720,7 @@ } }) .catch((e) => { - _this.$notify.warning(e.data); + _this.$notify.warning(e.msg); clearInterval(timer); app.upgradeLoading = false; }); @@ -694,7 +731,7 @@ let iArry = []; let sArry = []; let nArry = []; - let rsp = await getApps(); + let rsp = await getApps({ appName: this.inputText }); if (rsp && rsp.success) { // 閬嶅巻app鐨勮繃绋嬮噸缃� this.appUpgreading = false; @@ -758,7 +795,7 @@ }; }, getUnActivedList(v) { - getUnActivedSdk().then((res) => { + getUnActivedSdk({ sdkName: this.inputText }).then((res) => { if (res.code == 200) { this.unActivedSDKList = res.data; const len = this.unActivedSDKList.length; @@ -781,7 +818,7 @@ }); }, getUnActivedAppList() { - getUnActivedApp().then((res) => { + getUnActivedApp({ appName: this.inputText }).then((res) => { if (res.code == 200) { this.unActivedAppList = res.data; this.pickTab(); @@ -789,6 +826,10 @@ }); }, actived(item) { + if (!item.canUpOrIns) { + return false; + } + let _this = this; if (this.activeTab == "sdk") { actPageAlg(item.id, "") @@ -804,9 +845,7 @@ _this.$notify.error(res.data.failMsg.failMsg); } }) - .catch((e) => { - console.log(e); - }); + .catch((e) => {}); } else if (this.activeTab == "app") { //婵�娲诲簲鐢� actApp(item.id, "") @@ -822,9 +861,7 @@ _this.$notify.error(res.data.failMsg.failMsg); } }) - .catch((e) => { - console.log(e); - }); + .catch((e) => {}); } }, onFileUpload(file) { @@ -844,7 +881,6 @@ version: res.data.apps[0].version, productName: res.data.productName, installContent: res.data.apps[0].installContent, - }; } if (res.data.sdks.length > 0) { @@ -870,7 +906,7 @@ let installedList = []; let unInstalledList = []; let hasNewVersionList = []; - let res = await findAllSdk(); + let res = await findAllSdk({ sdkName: this.inputText }); if (res && res.success) { this.sdkUpgreading = false; @@ -964,6 +1000,7 @@ <style lang="scss"> .s-task-manage { width: 100% !important; + min-width: 754px !important; height: 100%; box-sizing: border-box; text-align: left; @@ -1320,6 +1357,10 @@ height: 76px; border-radius: 4px; + /* &.disabled { + cursor: default; + } */ + .icon-img { width: 58px; height: 58px; @@ -1403,6 +1444,7 @@ text-align: end; position: absolute; right: 0; + width: 120px; margin-top: 2px; } .rocket-icon { @@ -1535,5 +1577,14 @@ } } } + +@media screen and (max-width: 800px) { + .quick-path .left-items .quick-item:last-child { + display: none !important; + } + .quick-path .left-items .quick-item:nth-child(2) { + border: none !important; + } +} </style> -- Gitblit v1.8.0