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 | 1107 ++++++++++++++++++++++++++++----------------------------- 1 files changed, 545 insertions(+), 562 deletions(-) diff --git a/src/pages/ai/index/App.vue b/src/pages/ai/index/App.vue index 324e7a1..e466408 100644 --- a/src/pages/ai/index/App.vue +++ b/src/pages/ai/index/App.vue @@ -19,71 +19,93 @@ @click="pickMenu(name)" > {{ name }} - <el-badge - v-if="index == 3" - class="update-badge" - :value="updateNum" - :hidden="updateNum == 0" - ></el-badge> + <sup v-if="index == 3 && updateNum != 0">{{ updateNum }}</sup> </div> </div> <div class="nav-box-search"> + <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> <el-select v-model="select" slot="append" - placeholder="鎵�鏈夊満鏅�" + placeholder="閫夋嫨鍦烘櫙" + :popper-append-to-body="false" > - <el-option label="閾佽矾鍦烘櫙" value="1"></el-option> - <el-option label="瀹夊叏鍦烘櫙" value="2"></el-option> - <el-option label="閫氱敤鍦烘櫙" value="3"></el-option> - <el-option label="鏍″洯鍥尯" value="4"></el-option> + <el-option label="閾佽矾鍦烘櫙" value="1"> + <span class="icon iconfont"></span> + <span>閾佽矾鍦烘櫙</span> + </el-option> + <el-option label="瀹夊叏鍦烘櫙" value="2"> + <span class="icon iconfont"></span> + <span>瀹夊叏鍦烘櫙</span> + </el-option> + <el-option label="閫氱敤鍦烘櫙" value="3"> + <span class="icon iconfont"></span> + <span>閫氱敤鍦烘櫙</span> + </el-option> + <el-option label="鏍″洯鍥尯" value="4"> + <span class="icon iconfont"></span> + <span>鏍″洯鍥尯</span> + </el-option> </el-select> </el-input> </div> <div class="bg-img-wrap"> - <img src="/images/appCenter/app-banner.jpg" alt="" /> + <img src="/images/appCenter/Group-112.png" alt="" /> </div> </div> <div class="quick-path" v-if="showQuickPath"> - <div - class="quick-item" - v-for="(item, index) in recomandUpdateList" - :key="index" - @click="checkDetail(item, 'active')" - > - <div class="icon-img"> - <img - v-if="item.iconBlob" - :src=" - item.iconBlob.indexOf(',') > 0 - ? item.iconBlob - : `data:image/png;base64,${item.iconBlob}` - " - alt - /> - <img v-else :src="item.icon" alt /> - </div> - <div class="desc"> - <div class="desc-1">{{ item.sdk_name || item.name }}</div> - <div class="desc-2">鐗堟湰 {{ item.version }}</div> - </div> - <div class="right-icon"> - <span class="icon iconfont"></span> + <div class="left-items"> + <div + class="quick-item" + v-for="(item, index) in recomandUpdateList" + :key="index" + @click="checkDetail(item, 'inactive', item.sdk_name)" + > + <div class="icon-img"> + <span class="icon iconfont" v-if="item.isUpgrade" + ></span + > + <img + v-if="item.iconBlob" + :src=" + item.iconBlob.indexOf(',') > 0 + ? item.iconBlob + : `data:image/png;base64,${item.iconBlob}` + " + alt + /> + <img v-else :src="item.icon" alt /> + </div> + <div class="desc"> + <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"> + <el-tooltip effect="dark" content="涓嬭浇" placement="bottom"> + <span class="icon iconfont"></span> + </el-tooltip> + </div> </div> </div> - <div class="down-all-btn"> + <!-- <div class="down-all-btn"> <el-button plain size="small" @click="batchUpdate('both')" round >鍏ㄩ儴鏇存柊</el-button > - </div> + </div> --> </div> <div class="main-content"> @@ -119,14 +141,23 @@ > </div> </div> - <div class="front-page-items" v-if="activeName != '绂荤嚎鍗囩骇/瀹夎'"> + <div + class="front-page-items" + v-if="activeName != '绂荤嚎鍗囩骇/瀹夎'" + > <div 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" + ></span + > <img v-if="item.iconBlob" :src=" @@ -139,34 +170,51 @@ <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"> <el-button size="small" type="primary" + class="other-btn" round - @click="checkDetail(item)" - v-if="activeName == '搴旂敤涓績'" + @click="checkDetail(item, null, item.sdk_name)" + v-if="activeName == '搴旂敤涓績' && item.price > 0" >婵�娲�</el-button > <el-button size="small" type="primary" + class="update-btn" round - v-if=" - activeName == '宸叉縺娲�' && - (activeTab == 'sdk' || - (activeTab == 'app' && !item.isDefault)) - " - @click.stop="unLoadSdkOrApp(item)" - >鍗歌浇</el-button + @click.stop="actived(item)" + v-if="activeName == '搴旂敤涓績' && item.price == 0" + >瀹夎</el-button > - <el-button size="small" type="primary" + class="check-btn" + round + v-if=" + activeName == '宸叉縺娲�' && + ((activeTab == 'sdk' && !item.isUpgrade) || + (activeTab == 'app' && + !item.isUpgrade && + !item.isDefault)) + " + >鏌ョ湅</el-button + > + <el-button + size="small" + type="primary" + class="check-btn" round v-if=" activeName == '宸叉縺娲�' && @@ -179,6 +227,7 @@ <el-button size="small" type="primary" + class="other-btn" round v-if=" activeName == '宸叉縺娲�' && @@ -188,6 +237,58 @@ " >鍗囩骇</el-button > + <el-button + size="small" + type="primary" + class="update-btn" + round + @click.stop="donwloadSDK(item)" + v-if=" + (activeName == '鏇存柊' || activeName == '宸叉縺娲�') && + activeTab == 'sdk' && + item.isUpgrade && + !item.upgradeLoading + " + >鏇存柊</el-button + > + <span + class="icon iconfont rocket-icon" + v-if=" + activeName == '鏇存柊' && + item.isUpgrade && + item.upgradeLoading && + rocketIf + " + ></span + > + <span + class="icon iconfont rocket-icon" + v-if=" + activeName == '鏇存柊' && + item.isUpgrade && + item.upgradeLoading && + !rocketIf + " + ></span + > + <el-button + size="small" + type="primary" + class="update-btn" + round + @click.stop="downloadApp(item, 'upgrade')" + v-if=" + (activeName == '鏇存柊' || activeName == '宸叉縺娲�') && + activeTab == 'app' && + item.isUpgrade && + !item.upgradeLoading + " + >鏇存柊</el-button + > + + <div class="status"> + {{ item.progressMsg }} + </div> </div> </div> @@ -195,6 +296,7 @@ class="front-page-item item-dimmed" v-for="(item, index) in tempDarkList" :key="index" + @click="checkDetail(item, 'activeNotInstall', item.sdk_name)" > <div class="icon-img"> <img @@ -209,50 +311,132 @@ <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"> <el-button size="small" type="primary" + class="other-btn" round - @click="donwload(item)" + v-if="activeTab == 'sdk' && !item.upgradeLoading" + @click.stop="donwloadSDK(item)" >瀹夎</el-button > + <el-button + size="small" + type="primary" + class="other-btn" + round + v-if="activeTab == 'app' && !item.upgradeLoading" + @click.stop="downloadApp(item)" + >瀹夎</el-button + > + <div class="spin-icon"> + <span + class="icon iconfont anz-font" + v-if="item.upgradeLoading" + ></span + > + </div> + <div class="status"> + {{ item.progressMsg }} + </div> </div> </div> </div> - <div class="upload-pkg"> - + <div class="upload-pkg" v-if="activeName == '绂荤嚎鍗囩骇/瀹夎'"> <div class="upload-head"> <div class="left"> <span class="icon iconfont"></span> <span class="txt">涓婁紶瀹夎杞欢</span> </div> - <div class="right"> - <span class="icon iconfont"></span> - <span class="icon iconfont"></span> - </div> - </div> - + <FileUploader + class="upload-demo" + single + tip + :sourceType="3" + :isDrag="true" + :attrs="{ accept: '.zip,.tar,.gz,.tar.gz' }" + tipWords="鐐瑰嚮涓婁紶" + uploadPlaceholder="绠楁硶杞欢" + url="/data/api-v/sdk/upload" + @complete="onFileUpload" + @file-added="onFileAdded" + /> </div> - </div> </div> <detailPage :detailProductID="detailProductID" :detailType="detailType" + :detailPrice="detailPrice" + :isSdk="isSdk" v-if="inDetail" + @flushSdk="getAllSdk" + @flushApp="getAllApps" @goback="goback" ></detailPage> </div> </div> </div> + + <el-dialog + title="瀹夎鍖呬俊鎭�" + :visible.sync="installDialogVisible" + width="40%" + :close-on-click-modal="false" + > + <div class="installInfo"> + <template v-if="installAppPackage != null"> + <div> + <div> + <span>瀹夎鍖呭悕绉帮細</span> + <span>{{ installAppPackage.productName }}</span> + </div> + <div> + <span>瀹夎鐗堟湰锛�</span> + <span>{{ installAppPackage.version }}</span> + </div> + <div> + <span>鏇存柊鍐呭锛�</span> + <span>{{ installAppPackage.installContent }}</span> + </div> + </div> + </template> + <template v-if="installSdkPackage != null"> + <div> + <div> + <span>瀹夎鍖呭悕绉帮細</span> + <span>{{ installSdkPackage.productName }}</span> + </div> + <div> + <span>瀹夎鐗堟湰锛�</span> + <span>{{ installSdkPackage.version }}</span> + </div> + <div> + <span>鏇存柊鍐呭锛�</span> + <span>{{ installSdkPackage.installContent }}</span> + </div> + </div> + </template> + <p>纭畾瀹夎锛�</p> + </div> + <div slot="footer" class="dialog-footer"> + <el-button @click="installDialogVisible = false">鍙� 娑�</el-button> + <el-button type="primary" @click="offlineInstall">瀹� 瑁�</el-button> + </div> + </el-dialog> </div> </template> <script> @@ -262,6 +446,7 @@ installSdk, getInstallInfo, removeSdk, + uploadSDK, } from "./api"; import { getApps, @@ -274,7 +459,7 @@ actApp, } from "@/api/app"; import { getUrlKey } from "@/api/utils"; -import FileUploader from "@/components/subComponents/FileUpload/index"; +import FileUploader from "../FileUpload/index"; import detailPage from "./detail"; export default { name: "algorithmManage", @@ -296,24 +481,20 @@ } return false; }, - recomandUpdateList() { - if (this.activeTab == "sdk") { - return this.hasNewVersionSdk.slice(0, 3); - } else { - return this.hasNewVersionApp.slice(0, 3); - } - }, }, data() { return { installedList: [], + recomandUpdateList: [], hasNewVersionSdk: [], activeTab: "sdk", hasNewVersionApp: [], tempDarkList: [], notInstalledList: [], + showUpload: false, detailType: "", detailProductID: "", + detailPrice: "", buttonAuthority: sessionStorage.getItem("buttonAuthoritys") || [], activeName: "搴旂敤涓績", patchUpdateStatus: "", @@ -335,7 +516,7 @@ isSDKDialog: true, actType: "", actId: "", - input3: "", + inputText: "", tempList: [], select: "", activedSdkOrApp: { @@ -349,8 +530,8 @@ installedApps: [], storeApps: [], installFile: {}, - appUpgreading: true, - sdkUpgreading: true, + appUpgreading: false, + sdkUpgreading: false, autoRefresh: true, productDetailVisible: false, isUpgrading: false, @@ -359,6 +540,7 @@ backStack: [], toUpdateArr1: [], forwardStack: [], + rocketIf: false, backDisable: true, forwardDisable: true, showInputCode: false, @@ -387,13 +569,14 @@ this.autoRefresh = false; }, methods: { + searchAll() { + this.getAllApps(); + this.getAllSdk(); + this.getUnActivedList(1); + this.getUnActivedAppList(); + }, goback() { this.inDetail = false; - }, - isShow(authority) { - return ( - this.isAdmin || this.buttonAuthority.indexOf("," + authority + ",") > -1 - ); }, batchUpdate(s) { if (s == "both") { @@ -407,7 +590,7 @@ }, batchUpdateSDK() { this.hasNewVersionSdk.forEach((sdk) => { - this.donwload(sdk, 0); + this.donwloadSDK(sdk); }); }, batchUpdateApp() { @@ -428,7 +611,6 @@ this.tempList = this.installedList; this.tempDarkList = this.notInstalledList; break; - case "鏇存柊": this.showQuickPath = false; this.tempList = this.hasNewVersionSdk; @@ -441,7 +623,9 @@ } }, pickTab(val) { - this.activeTab = val; + if (val) { + this.activeTab = val; + } if (this.activeName == "搴旂敤涓績") { this.tempList = this.activeTab == "sdk" @@ -458,77 +642,26 @@ this.activeTab == "sdk" ? this.hasNewVersionSdk : this.hasNewVersionApp; + this.tempDarkList = []; } }, - closeDial() { - this.productDetailVisible = false; - this.productDetail = {}; - this.otherProducts = []; - }, - 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 { this.detailType = this.activeName == "搴旂敤涓績" ? "inactive" : "active"; } }, - resetStack() { - this.forwardStack = []; - this.backStack = []; - this.backDisable = true; - this.forwardDisable = true; - }, - checkInWindow(item) { - this.backStack.push([this.productDetail, this.otherProducts]); - this.backDisable = false; - this.checkIsDefOrNot(item.id); - - let _this = this; - getAppDetail({ id: item.id }).then((res) => { - _this.productDetail = res.data.detail; - _this.productDetail.iconBlob = item.iconBlob; - this.actId = _this.productDetail.productBaseId; - let flag = false; - const allNeedToNew = [ - ...this.hasNewVersionSdk, - ...this.hasNewVersionApp, - ]; - for (let i = 0; i < allNeedToNew.length; i++) { - const item = allNeedToNew[i]; - if (item.id == _this.productDetail.productBaseId) { - flag = true; - } - } - this.needToUpgradeInWin = flag; - _this.productDetail.isUpgrade = flag; - - _this.otherProducts = res.data.randoms; - }); - }, checkIsDefOrNot(id) { - if (id.length > 10) { - this.isDefaultApp = false; - } else { - this.isDefaultApp = true; - } - }, - backwards() { - if (this.backStack.length == 0) { - this.backDisable = true; - return; - } - this.forwardStack.push([this.productDetail, this.otherProducts]); - let item = this.backStack.pop(); - this.productDetail = item[0]; - this.checkIsDefOrNot(this.productDetail.productBaseId); - this.otherProducts = item[1]; - this.forwardDisable = false; - if (this.backStack.length == 0) { - this.backDisable = true; - } + this.isDefaultApp = id.length <= 10; }, forwards() { if (this.forwardStack.length == 0) { @@ -553,66 +686,44 @@ .then((res) => { if (res.success) { this.isInstall = false; - this.$message({ - type: "success", - message: '瀹夎鎴愬姛,灏嗚烦杞嚦"宸叉縺娲�"涓煡鐪�', - }); + this.$message.success('瀹夎鎴愬姛,灏嗚烦杞嚦"宸叉縺娲�"涓煡鐪�'); setTimeout(() => { this.getAllSdk(); window.parent.postMessage({ msg: "AppUpdate" }, "*"); - this.activeName = "宸叉縺娲�"; }, 3000); } }) .catch((e) => { this.isInstall = false; - this.$message({ - type: "error", - message: e.data, - }); + this.$message.error(e.msg); }); }, downloadApp(app, action) { - if (action == "upgrade") { - app.upgradeLoading = true; - } else { - app.installLoading = true; - } - let _this = this; + let timer = null; + app.upgradeLoading = true; + timer = setInterval(() => { + this.rocketIf = !this.rocketIf; + }, 350); + let _this = this; installApp({ path: app.id }) .then((res) => { if (res && res.success) { - _this.$notify({ - title: "鎴愬姛", - message: "瀹夎搴旂敤鎴愬姛", - type: "success", - }); + _this.$notify.success("瀹夎搴旂敤鎴愬姛"); + clearInterval(timer); + app.upgradeLoading = false; setTimeout(() => { - if (action == "upgrade") { - app.upgradeLoading = false; - } else { - app.installLoading = false; - } window.parent.postMessage({ msg: "AppUpdate" }, "*"); }, 3000); } else { } }) .catch((e) => { - _this.$notify({ - title: "瀹夎澶辫触", - message: e.data, - type: "warning", - }); - if (action == "upgrade") { - app.upgradeLoading = false; - } else { - app.installLoading = false; - } + _this.$notify.warning(e.msg); + clearInterval(timer); + app.upgradeLoading = false; }); - // 寮�鍚嚜鍔ㄥ埛鏂� this.appUpgreading = true; }, @@ -620,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; @@ -630,17 +741,17 @@ { unloadLoading: false, upgradeLoading: false }, item ); - if (obj.progressMsg !== "" && obj.progressMsg !== "宸插畨瑁�") { + if ( + obj.progressMsg !== "" && + obj.progressMsg !== "宸插畨瑁�" && + obj.progressMsg != "100%" + ) { obj.upgradeLoading = true; - this.appUpgreading = true; } if (obj.upgradeDone) { - this.$notify({ - type: "success", - message: 1 ? "绠楁硶瀹夎鎴愬姛" : "绠楁硶鍗囩骇鎴愬姛", - }); + this.$notify.success(1 ? "绠楁硶瀹夎鎴愬姛" : "绠楁硶鍗囩骇鎴愬姛"); } item.installed ? iArry.push(obj) : sArry.push(obj); @@ -664,12 +775,7 @@ app.unloadLoading = false; _this.getAllApps(); window.parent.postMessage({ msg: "AppUpdate" }, "*"); - - _this.$notify({ - title: "鎴愬姛", - message: "鍗歌浇搴旂敤鎴愬姛", - type: "success", - }); + _this.$notify.success("鍗歌浇搴旂敤鎴愬姛"); } }) .catch((e) => { @@ -677,18 +783,6 @@ }); }) .catch((e) => {}); - }, - toActivatePage(item) { - this.checkDetail(item, "inactive"); - this.actType = this.activeTab; - this.actId = item.id; - this.actStep = 0; - this.activeCode = ""; - this.activedSdkOrApp = this.newActInfo(); - }, - cancelActivate() { - this.showInputCode = false; - this.activeCode = ""; }, newActInfo() { return { @@ -701,47 +795,60 @@ }; }, getUnActivedList(v) { - getUnActivedSdk().then((res) => { + getUnActivedSdk({ sdkName: this.inputText }).then((res) => { if (res.code == 200) { this.unActivedSDKList = res.data; + const len = this.unActivedSDKList.length; + const set = new Set(); + if (len <= 3) { + this.recomandUpdateList = [...this.unActivedSDKList]; + } else { + for (let i = 0; i < 3; i++) { + const pickI = Math.floor(Math.random() * len); + if (set.has(pickI)) { + i--; + continue; + } + set.add(pickI); + this.recomandUpdateList.push(this.unActivedSDKList[pickI]); + } + } v == 1 ? (this.tempList = res.data) : null; } }); }, getUnActivedAppList() { - getUnActivedApp().then((res) => { + getUnActivedApp({ appName: this.inputText }).then((res) => { if (res.code == 200) { this.unActivedAppList = res.data; + this.pickTab(); } }); }, - actived() { - let _this = this; - if (this.activeCode.trim() == "") { - this.$notify.error("婵�娲荤爜涓嶈兘涓虹┖"); - return; + actived(item) { + if (!item.canUpOrIns) { + return false; } - if (this.actType == "sdk") { - //婵�娲荤畻娉� - actPageAlg(this.actId, this.activeCode) + + let _this = this; + if (this.activeTab == "sdk") { + actPageAlg(item.id, "") .then((res) => { if (res.data.isSuccess) { this.productDetailVisible = false; _this.activedSdkOrApp = res.data.successMsg; this.showActivateSuccess = true; _this.actStep++; - _this.getUnActivedList(); + _this.getUnActivedList(1); _this.getAllSdk(); } else { _this.$notify.error(res.data.failMsg.failMsg); } }) - .catch((e) => { - console.log(e); - }); - } else if (this.actType == "app") { + .catch((e) => {}); + } else if (this.activeTab == "app") { //婵�娲诲簲鐢� - actApp(this.actId, this.activeCode) + actApp(item.id, "") .then((res) => { if (res.data.isSuccess) { this.productDetailVisible = false; @@ -754,14 +861,8 @@ _this.$notify.error(res.data.failMsg.failMsg); } }) - .catch((e) => { - console.log(e); - }); + .catch((e) => {}); } - }, - checkMyAlgorith() { - this.showActivateSuccess = false; - this.activeName = "宸叉縺娲�"; }, onFileUpload(file) { this.patchFile = { ...file }; @@ -798,12 +899,6 @@ this.$message.error(e.msg); }); }, - openApp() { - window.parent.postMessage( - { msg: "toOpenApp?" + this.productDetail.productBaseId }, - "*" - ); - }, onFileAdded(f) { this.patchUpdateStatus = ""; }, @@ -811,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; @@ -820,9 +915,12 @@ { unloadLoading: false, upgradeLoading: false }, item ); - if (obj.progressMsg !== "" && obj.progressMsg !== "宸插畨瑁�") { + if ( + obj.progressMsg !== "" && + obj.progressMsg !== "宸插畨瑁�" && + obj.progressMsg !== "100%" + ) { obj.upgradeLoading = true; - this.sdkUpgreading = true; } @@ -835,24 +933,7 @@ this.notInstalledList = unInstalledList; this.toUpdateArr1 = this.installedList.slice(0, 10); this.hasNewVersionSdk = hasNewVersionList; - }, - unloadSDKinWin() { - let appToUnload; - let sdkToUnload; - if (this.productDetail.productTypeName == "搴旂敤") { - appToUnload = this.installedApps.find((item) => { - return item.id == this.productDetail.productBaseId; - }); - this.unloadApp(appToUnload); - } else { - sdkToUnload = this.installedList.find((item) => { - return item.id == this.productDetail.productBaseId; - }); - this.unloadSdk(sdkToUnload); - } - }, - unLoadSdkOrApp(item) { - this.activeTab == "sdk" ? this.unloadSdk(item) : this.unloadApp(item); + this.pickTab(); }, unloadSdk(sdk) { let _this = this; @@ -875,66 +956,19 @@ }) .catch((e) => {}); }, - upgradeSDKinWin() { - this.isUpgrading = !this.isUpgrading; - let _this = this; - if (this.productDetail.productTypeName == "搴旂敤") { - installApp({ path: this.productDetail.productBaseId }) - .then((res) => { - if (res && res.success) { - this.$notify.success("鍗囩骇瀹屾垚"); - this.needToUpgradeInWin = false; - this.productDetail.isUpgrade = false; - this.isUpgrading = !this.isUpgrading; - } - }) - .catch((e) => { - this.$notify.warning("鍗囩骇澶辫触"); - this.isUpgrading = !this.isUpgrading; - }); - - // 寮�鍚嚜鍔ㄥ埛鏂� - this.appUpgreading = true; - } else { - downloadSdk({ path: this.productDetail.productBaseId }) - .then((res) => { - this.needToUpgradeInWin = false; - this.productDetail.isUpgrade = false; - this.isUpgrading = !this.isUpgrading; - this.$notify.success("鍗囩骇瀹屾垚"); - }) - .catch((err) => { - this.$notify.warning("鍗囩骇澶辫触"); - this.isUpgrading = !this.isUpgrading; - }); - this.sdkUpgreading = true; - } - }, - downloadSdkInSide() { - this.downloadItem = this.productDetail.productBaseId; - this.isUpgrading = true; - downloadSdk({ path: this.productDetail.productBaseId }) - .then((rsp) => { - this.productDetailVisible = false; - this.downloadItem = ""; - this.$notify.success("绠楁硶宸插畨瑁�"); - this.isUpgrading = false; - }) - .catch((err) => { - this.$notify.warning(err.data); - this.downloadItem = ""; - this.isUpgrading = false; - }); - // 寮�鍚嚜鍔ㄥ埛鏂� - this.sdkUpgreading = true; - }, - donwload(item) { + donwloadSDK(item) { + let timer = null; item.upgradeLoading = true; + timer = setInterval(() => { + this.rocketIf = !this.rocketIf; + }, 350); this.downloadItem = item.id; downloadSdk({ path: item.id }) .then((rsp) => { + clearInterval(timer); item.upgradeLoading = false; this.downloadItem = ""; + window.parent.postMessage({ msg: "AppUpdate" }, "*"); }) .catch((err) => { @@ -945,24 +979,20 @@ // 寮�鍚嚜鍔ㄥ埛鏂� this.sdkUpgreading = true; }, - inputBlur(item) { - this.$set(item, "isEdit", false); - }, autoRefreshAppAndSdkState() { - // 鍏抽棴鍚庨��鍑� + this.getAllApps(); + this.getAllSdk(); if (!this.autoRefresh) { return; } - if (this.appUpgreading) { - this.getAllApps(); - } - if (this.sdkUpgreading) { - this.getAllSdk(); - } - let _this = this; setTimeout(() => { - _this.autoRefreshAppAndSdkState(); - }, 500); + if (this.appUpgreading) { + this.getAllApps(); + } + if (this.sdkUpgreading) { + this.getAllSdk(); + } + }, 1000); }, }, }; @@ -970,34 +1000,11 @@ <style lang="scss"> .s-task-manage { width: 100% !important; + min-width: 754px !important; height: 100%; box-sizing: border-box; text-align: left; - min-width: 1106px; -} -.el-loading-mask .el-loading-spinner { - top: 40px !important; -} -.el-loading-mask .el-loading-spinner svg { - transform: none !important; - top: 20px !important; - left: 40% !important; -} -.el-loading-mask .el-loading-spinner p.el-loading-text { - display: block !important; - text-align: center !important; - bottom: 10px !important; - top: 80px !important; - right: 0 !important; - color: #78adf7; -} -.el-loading-mask .el-loading-spinner .path { - stroke: #78adf7; -} - -.update-badge .el-badge__content.is-fixed { - top: 10px; - right: 4px; + background-color: #fff; } .task-manage { @@ -1067,12 +1074,14 @@ border-left: 3px solid #f3f6fc; cursor: pointer; caret-color: transparent; - .el-badge__content { - border-radius: 50%; + sup { + background-color: #f52323; font-size: 12px; - height: 14px; - line-height: 14px; - padding: 0px 3px; + color: #fff; + height: 18px; + line-height: 18px; + padding: 0 3.5px; + border-radius: 50%; } } .menu-item:hover { @@ -1084,12 +1093,20 @@ border-left: 3px solid #23d7ee; font-weight: 700; font-size: 16px; - // transition: transform .3s cubic-bezier(.645,.045,.355,1); color: #333; } } .nav-box-search { z-index: 99; + position: relative; + .all-scene { + position: absolute; + z-index: 100; + right: 64px; + + top: 10px; + font-size: 12px; + } .el-input { position: relative; font-size: 12px; @@ -1099,17 +1116,19 @@ border: none; height: 30px; line-height: 30px; + padding: 0 12px; } .el-input-group__prepend { border-right: 0; border: none; border-radius: 20px; background: #fff; - padding: 0 25px; + padding: 0 0 0 15px; + i { font-weight: 600; color: #333; - font-size: 19px; + font-size: 16px; } } .el-input-group--append .el-input__inner, @@ -1122,7 +1141,7 @@ border-left: 0; border: none; border-radius: 20px; - width: 64px; + width: 52px; background: linear-gradient( 180deg, #ecfcfe 0%, @@ -1138,11 +1157,38 @@ font-size: 12px; font-weight: bold; letter-spacing: 0.5px; + padding: 0 0px 0 30px; + color: #474747; + } + .el-input__suffix { + display: none; } } .el-input__inner::placeholder { color: rgb(71, 71, 71); - // font-weight: 600; + } + .el-select-dropdown { + min-width: 120px !important; + left: -26px !important; + background: rgba(236, 245, 253, 0.6); + border-radius: 2px; + border: none; + .el-select-dropdown__item { + height: 22px; + line-height: 22px; + font-size: 12px; + letter-spacing: 0.4px; + color: #333333; + .icon { + margin-right: 5px; + font-size: 15px; + } + } + .el-select-dropdown__item.hover, + .el-select-dropdown__item:hover { + background-color: #ebf4fd; + font-weight: 600; + } } } .el-input-group__prepend .el-select { @@ -1163,8 +1209,8 @@ position: absolute; z-index: 1; right: 0; - top: 70px; - height: 200px; + top: 41px; + height: 229px; img { height: 100%; } @@ -1185,16 +1231,26 @@ height: 75px; display: flex; align-items: center; + .left-items { + display: flex; + } .quick-item { display: flex; cursor: pointer; padding: 2px 20px; height: 52px; box-sizing: border-box; - border-right: 1px solid #e0e0e0; + .icon-img { width: 48px; height: 48px; + position: relative; + .icon { + position: absolute; + right: -7px; + top: -7px; + font-size: 13px; + } img { width: 48px; height: 48px; @@ -1219,11 +1275,17 @@ } } .right-icon { - padding: 5px 0; + padding: 2px 0; + + .icon { + font-size: 21px; + } } } + .quick-item:not(:last-child) { + border-right: 1px solid #e0e0e0; + } .down-all-btn { - // margin-left: 25px; position: absolute; right: 30px; .el-button { @@ -1236,7 +1298,7 @@ } } .main-content { - padding: 35px 60px; + padding: 35px 82px; z-index: 99; .main-title { line-height: 25px; @@ -1250,7 +1312,7 @@ .group-left { display: flex; .tab { - font-size: 15px; + font-size: 14px; margin-right: 25px; line-height: 28px; cursor: pointer; @@ -1279,30 +1341,47 @@ } } .front-page-items { - padding-top: 30px; + padding-top: 25px; .front-page-item { float: left; display: flex; - margin-bottom: 30px; - padding: 2px 0; - height: 60px; + margin: 0 5px; + margin-bottom: 15px; box-sizing: border-box; - width: 278px; + width: 274px; + justify-content: center; cursor: pointer; - border-radius: 6px; + + padding: 10px 0; + height: 76px; + border-radius: 4px; + + /* &.disabled { + cursor: default; + } */ + .icon-img { width: 58px; height: 58px; + position: relative; + .icon { + position: absolute; + right: -9px; + top: -9px; + font-size: 16px; + } img { width: 58px; height: 58px; + border-radius: 10px; } } .desc { box-sizing: border-box; padding: 0 12px; - width: 140px; + width: 147px; + .desc-1 { font-size: 14px; font-weight: bold; @@ -1320,26 +1399,67 @@ } } .right-btn { - padding: 5px 0; - .el-button { - padding: 3px 12px; + padding: 2px 0; + width: 50px; + text-align: center; + position: relative; + .check-btn { + background-color: #ffffff !important; + border-color: #bdbdbd !important; + color: #333333; + } + .update-btn { + border-color: #23d7ee !important; + background-color: rgba(29, 212, 236, 0.1) !important; + color: #4f4f4f; + } + .other-btn { background-color: #1dd4ec !important; border-color: #1dd4ec !important; - border-radius: 22px; + color: #ffffff; } - .el-button--primary:hover { - background: #089fb3 !important; - border-color: #089fb3 !important; + @keyframes spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } + } + .anz-font { + font-size: 28px; + color: #333; + } + + .spin-icon { + animation: spin 0.8s linear infinite; + } + .status { + font-size: 12px; + color: #828282; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + min-width: 100px; + text-align: end; + position: absolute; + right: 0; + width: 120px; + margin-top: 2px; + } + .rocket-icon { + font-size: 20px; + } + .el-button { + padding: 3px 12px; + border-radius: 22px; + font-weight: bold; + letter-spacing: 0.5px; } } } .front-page-item:hover { - background: linear-gradient( - 180deg, - #ecfcfe 0%, - #ebf4fd 47.92%, - #f4f4fe 100% - ); + background-color: #f2f2f7; } .item-dimmed { color: gray; @@ -1353,29 +1473,53 @@ clear: both; visibility: hidden; } - .upload-pkg{ - .upload-head{ + .upload-pkg { + .upload-head { display: flex; - justify-content: space-between; - align-items: center; - .left{ + justify-content: space-between; + align-items: center; + .left { display: flex; align-items: center; - .iconfont{ + .iconfont { font-size: 18px; margin-right: 6px; } - .txt{ - font-size: 16px; - + .txt { + font-size: 16px; } } - .right{ - .icon{ - margin-right: 10px; + .right { + .icon { + margin-right: 11px; font-size: 17px; + cursor: pointer; } } + } + } + .upload-demo { + margin: 30px 0px; + .drag-txt { + width: 340px; + height: 45px; + border: 1px dashed #bdbdbd; + display: flex; + margin-top: 30px; + align-items: center; + justify-content: center; + color: #828282; + font-size: 14px; + } + .txt-btn { + width: 78px; + margin-top: 18px; + height: 19px; + background: #23d7ee; + border-radius: 22px; + color: #ffffff; + font-weight: bold; + font-size: 12px; } } } @@ -1415,148 +1559,11 @@ } } - .list-choose-item { - cursor: pointer; - position: relative; - font-size: 14px; - display: inline-block; - @media screen and(min-width: 1640px) { - margin: 30px 20px 20px 20px; - } - @media screen and(min-width: 1460px) and(max-width: 1640px) { - margin: 30px 20px 20px 10px; - } - @media screen and(max-width: 1460px) { - margin: 30px 10px 20px 10px; - } - min-width: 126px; - height: 120px; - transition: all 1s; - background: #fff; - border: 1px solid #e2e2e2; - box-shadow: 0 5px 12px 0 rgba(0, 0, 0, 0.07); - border-radius: 4px; - } - .list-choose-item:hover { - .mask { - display: block; - } - } - - .list-choose-item-left { - cursor: pointer; - position: relative; - font-size: 14px; - - transition: all 1s; - border-radius: 4px; - p { - display: none; - text-align: right; - width: 100%; - position: absolute; - right: 10px; - top: 5px; - } - .click-download { - position: absolute; - left: 80%; - top: 5%; - } - } - .list-choose-item-left:hover { - .mask { - display: flex; - align-items: flex-end; - flex-wrap: wrap; - justify-content: center; - top: 0; - - .bot-btn { - flex: 1; - } - &.flex-center { - align-items: center; - justify-content: center; - } - } - } - .list-choose-item-left-uninstal { - color: gray; - filter: grayscale(100%); - } - .list-complete-item.sortable-chosen { - background: #4ab7bd; - } - .list-choose-item.sortable-ghost { - background: #30b08f; - } - - .list-choose-header { - position: relative; - width: 74px; - height: 74px; - background-image: linear-gradient(-137deg, #7076f2 0%, #3d63e1 100%); - box-shadow: 0 5px 12px 0 rgba(0, 0, 0, 0.07); - border-radius: 37px; - margin: 10px 25px; - } - - .b-top { - width: 100%; - padding-top: 10px; - } - .b-bottom { - width: 100%; - border-bottom: 1px solid rgba(24, 28, 33, 0.5); - } - .i-set-right { - position: absolute; - left: 80px; - top: -11px; - font-size: 24px; - } - .i-remove-right { - position: absolute; - right: -1px; - top: -11px; - font-size: 24px; - color: red; - } - .alg-t { - line-height: 31px; - font-family: PingFangSC-Medium; - font-size: 14px; - color: #222222; - } - .alg-name { - line-height: 20px; - font-family: PingFangSC-Regular; - font-size: 14px; - letter-spacing: 0.05em; - color: #333; - .el-input { - position: relative; - font-size: 14px; - display: inline-block; - width: 100%; - } - } - .el-input { position: relative; font-size: 14px; // display: inline-block; // width: 80%; - } - - .drag-info { - min-width: 126px; - height: 120px; - border: 1px dashed #3d68e1; - box-shadow: 0 5px 12px 0 rgba(0, 0, 0, 0.07); - border-radius: 4px; - margin: 30px 10px 20px 10px; } .el-button--cancle { @@ -1568,39 +1575,15 @@ color: #222222; margin-right: 12px; } + } +} - .task-name-google { - position: relative; - top: 30px; - width: 126px; - height: 120px; - border: 1px solid #fff; - background: #fff; - border-radius: 4px; - cursor: pointer; - .set-task { - display: none; - cursor: pointer; - } - - .el-switch__core { - width: 27px !important; - height: 14px; - } - .el-switch__core:after { - width: 10px; - height: 10px; - } - .el-switch.is-checked .el-switch__core::after { - left: 100%; - margin-left: -11px; - } - } - .task-name-google:hover { - .mask { - display: block; - } - } +@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