|
@@ -0,0 +1,765 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="appStore">
|
|
|
|
+ <div class="topC">
|
|
|
|
+ <img
|
|
|
|
+ style="width: 24px;height: 24px;object-fit: contain;"
|
|
|
|
+ src="../../assets/images/appStoreCopy/topR.svg"
|
|
|
|
+ @click.stop="openCe"
|
|
|
|
+ alt=""
|
|
|
|
+ />
|
|
|
|
+ <img
|
|
|
|
+ @click="searchPage"
|
|
|
|
+ style="width: 24px;height: 24px;object-fit: contain;"
|
|
|
|
+ src="../../assets/images/appStoreCopy/topl.svg"
|
|
|
|
+ alt=""
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div id="appStoreCon" class="bodyCon">
|
|
|
|
+ <van-popup
|
|
|
|
+ round
|
|
|
|
+ v-model="CeShow"
|
|
|
|
+ :overlay="false"
|
|
|
|
+ get-container="#appStoreCon"
|
|
|
|
+ position="left"
|
|
|
|
+ :overlay-style="{ opacity: 0 }"
|
|
|
|
+ :style="{ height: '92vh', transform: 'translate3d(0,0%, 0)', width: '45%', minWidth: '150px', opacity: 0.9 }"
|
|
|
|
+ >
|
|
|
|
+ <div class="popupCon">
|
|
|
|
+ <div class="popTop">
|
|
|
|
+ <div style="color: #0663FE;">【{{ userinfo.orgName }}】</div>
|
|
|
|
+ <div>CocoFlow</div>
|
|
|
|
+ <div @click="comShow = true">使用电脑端</div>
|
|
|
|
+ <div>关注公众号</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="popupBot" @click="goInfo">
|
|
|
|
+ <img style="width: 24px;height: 100%;" src="../../assets/images/appStoreCopy/popimg.svg" alt="" />
|
|
|
|
+ <div>
|
|
|
|
+ <div>李老师</div>
|
|
|
|
+ <div>cococlass341683</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </van-popup>
|
|
|
|
+
|
|
|
|
+ <van-tabs
|
|
|
|
+ @change="getData"
|
|
|
|
+ @touchmove.stop="handleTouchMove"
|
|
|
|
+ background="#F9F8F8"
|
|
|
|
+ :line-height="0"
|
|
|
|
+ title-active-color="#0663FE"
|
|
|
|
+ v-model="tabType"
|
|
|
|
+ >
|
|
|
|
+ <van-tab v-for="(i, index) in typeList" class="appBlocks" :key="index" :name="i.id" :title="i.name">
|
|
|
|
+ <template v-if="dataList.length">
|
|
|
|
+ <div v-for="(i, ind) in dataList" @click="openUrl(i.url)" :key="ind + 'a'" class="appBlock">
|
|
|
|
+ <div class="appBlockTop">
|
|
|
|
+ <img class="appBlockTopImg" :src="i.json.icon" alt="" />
|
|
|
|
+ <div class="appBlockTopTit">{{ i.name }}</div>
|
|
|
|
+ <div style="display: flex;align-items: center;">
|
|
|
|
+ <img src="../../assets/images/appStoreCopy/appde.svg" alt="" />
|
|
|
|
+ <div style="display: flex;gap: 5px;margin-left: 8px;">
|
|
|
|
+ <span class="ATag">{{ i.label == 'workflow' ? '工作流' :'智能体' }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="appBlockBot">
|
|
|
|
+ <span>{{ i.username }}</span>
|
|
|
|
+ <div class="appBlockBotCol">
|
|
|
|
+ <div @click.stop="addLike(i.id)" style="display: flex;align-items: center;">
|
|
|
|
+ <img src="../../assets/images/appStoreCopy/star.svg" alt="" />
|
|
|
|
+ {{ i.likeCount }}
|
|
|
|
+ </div>
|
|
|
|
+ <div @click.stop="addColl(i.id)" style="display: flex;align-items: center;">
|
|
|
|
+ <img src="../../assets/images/appStoreCopy/xin.svg" alt="" />
|
|
|
|
+ {{ i.collectCount }}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ <div v-else style="position: absolute;left: 50%;top: 30%;transform: translate(-50%,-50%);">
|
|
|
|
+ 暂无数据哦~
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="isShow"
|
|
|
|
+ class="zzcl"
|
|
|
|
+ >
|
|
|
|
+ 加载中...
|
|
|
|
+ </div>
|
|
|
|
+ </van-tab>
|
|
|
|
+ </van-tabs>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- 侧边栏遮罩层 -->
|
|
|
|
+ <div
|
|
|
|
+ v-if="CeShow"
|
|
|
|
+ @click="openCeY"
|
|
|
|
+ style="position: fixed;top: 0;left: 0;width: 100%;height: 100%;background-color: #000;opacity: 0"
|
|
|
|
+ ></div>
|
|
|
|
+
|
|
|
|
+ <van-popup
|
|
|
|
+ overlay-class="comCss"
|
|
|
|
+ v-model="comShow"
|
|
|
|
+ round
|
|
|
|
+ :closeable="true"
|
|
|
|
+ position="bottom"
|
|
|
|
+ class="Vpop"
|
|
|
|
+ >
|
|
|
|
+ <div class="comCssTit">
|
|
|
|
+ 电脑端开启更多高效体验
|
|
|
|
+ </div>
|
|
|
|
+ <img style="width: 170px;" src="../../assets/images/appStoreCopy/comp.svg" alt="">
|
|
|
|
+ <div class="cpmUrl" @click="copyUrl">
|
|
|
|
+ <div>
|
|
|
|
+ https://cloud.cocorobo.cn/
|
|
|
|
+ </div>
|
|
|
|
+ <img style="margin-left: 5px;height: 16.8px;" src="../../assets/images/appStoreCopy/copyIco.svg" alt="">
|
|
|
|
+ </div>
|
|
|
|
+ <div class="comBot">
|
|
|
|
+ 复制网址,去电脑端浏览器访问吧
|
|
|
|
+ </div>
|
|
|
|
+ </van-popup>
|
|
|
|
+ <!-- <div class="as_header">
|
|
|
|
+ <div class="as_h_top">
|
|
|
|
+ <span>应用管理</span>
|
|
|
|
+ <div class="exit" @click="exitLogin">退出</div>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ <div class="as_h_bottom">
|
|
|
|
+ <el-input v-model="searchText" style="width:40%;" placeholder="请输入应用名称" size="small"></el-input>
|
|
|
|
+ <el-select v-model="selectJuri" placeholder="请选择权限" size="small" style="width:39%;margin-left:10px;font-size: 16px;" @change="getData()">
|
|
|
|
+ <el-option v-for="item in selectList" :key="item.index" :label="item.label" :value="item.index"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ size="mini"
|
|
|
|
+ @click="getData()"
|
|
|
|
+ icon="el-icon-search"
|
|
|
|
+ style="margin-left: 10px;"
|
|
|
|
+ ></el-button>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="as_h_typeList">
|
|
|
|
+ <span :class="{'typeActive':showType==''}" @click="changeType('')">全部</span>
|
|
|
|
+ <span v-for="(item,index) in typeList" :key="item.id" :class="{'typeActive':item.id==showType}" @click="changeType(item.id)">{{item.name}}</span>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="as_content">
|
|
|
|
+ <div class="as_c_item" v-for="(item, index) in dataList" :key="item.id" @click="closeCard()">
|
|
|
|
+ <div class="as_c_i_top">
|
|
|
|
+ <div class="as_c_i_t_icon">
|
|
|
|
+ <svg
|
|
|
|
+ t="1732605901531"
|
|
|
|
+ class="icon"
|
|
|
|
+ viewBox="0 0 1024 1024"
|
|
|
|
+ version="1.1"
|
|
|
|
+ xmlns="http://www.w3.org/2000/svg"
|
|
|
|
+ p-id="4275"
|
|
|
|
+ width="200"
|
|
|
|
+ height="200"
|
|
|
|
+ v-if="!item.json.icon"
|
|
|
|
+ >
|
|
|
|
+ <path
|
|
|
|
+ d="M179.2 153.6a51.2 51.2 0 0 0-51.2 51.2v128a51.2 51.2 0 0 0 51.2 51.2h128a51.2 51.2 0 0 0 51.2-51.2V204.8a51.2 51.2 0 0 0-51.2-51.2H179.2z m0-102.4h128a153.6 153.6 0 0 1 153.6 153.6v128a153.6 153.6 0 0 1-153.6 153.6H179.2a153.6 153.6 0 0 1-153.6-153.6V204.8a153.6 153.6 0 0 1 153.6-153.6z m0 614.4a51.2 51.2 0 0 0-51.2 51.2v128a51.2 51.2 0 0 0 51.2 51.2h128a51.2 51.2 0 0 0 51.2-51.2V716.8a51.2 51.2 0 0 0-51.2-51.2H179.2z m0-102.4h128a153.6 153.6 0 0 1 153.6 153.6v128a153.6 153.6 0 0 1-153.6 153.6H179.2a153.6 153.6 0 0 1-153.6-153.6V716.8a153.6 153.6 0 0 1 153.6-153.6z m611.84-403.4048a51.2 51.2 0 0 0-72.3968 0L646.144 232.2432a51.2 51.2 0 0 0 0 72.3968l72.448 72.3968a51.2 51.2 0 0 0 72.3968 0l72.3968-72.3968a51.2 51.2 0 0 0 0-72.3968L791.04 159.744z m72.3968-72.3968l72.3968 72.3968a153.6 153.6 0 0 1 0 217.2416l-72.3968 72.3968a153.6 153.6 0 0 1-217.2416 0l-72.3968-72.3968a153.6 153.6 0 0 1 0-217.2416l72.3968-72.3968a153.6 153.6 0 0 1 217.2416 0zM699.7504 896a51.2 51.2 0 0 1 0 102.4A162.1504 162.1504 0 0 1 537.6 836.2496v-110.8992A162.1504 162.1504 0 0 1 699.7504 563.2h110.8992a162.1504 162.1504 0 0 1 162.1504 162.1504v8.448a51.2 51.2 0 0 1-102.4 0v-8.448c0-33.024-26.7264-59.7504-59.7504-59.7504h-110.8992c-33.024 0-59.7504 26.7264-59.7504 59.7504v110.8992c0 33.024 26.7264 59.7504 59.7504 59.7504z"
|
|
|
|
+ fill="#2C6DD2"
|
|
|
|
+ p-id="4276"
|
|
|
|
+ ></path>
|
|
|
|
+ <path
|
|
|
|
+ d="M791.4496 160a51.2 51.2 0 0 0-72.3968 0l-72.448 72.3968a51.2 51.2 0 0 0 0 72.3968l72.448 72.3968a51.2 51.2 0 0 0 72.3968 0l72.3968-72.3968a51.2 51.2 0 0 0 0-72.3968l-72.3968-72.3968z"
|
|
|
|
+ fill="#20C997"
|
|
|
|
+ p-id="4277"
|
|
|
|
+ ></path>
|
|
|
|
+ </svg>
|
|
|
|
+ <img :src="item.json.icon" alt="" v-else>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="as_c_i_t_message">
|
|
|
|
+ <div>{{ item.name }}</div>
|
|
|
|
+ <span v-if="item.label==='agent'">智能体</span>
|
|
|
|
+ <span v-if="item.label==='workflow'">工作流</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="ac_c_i_t_popover" v-if="showMenu(item)">
|
|
|
|
+ <svg t="1732786015570" @click.stop="showCard(item.id)" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9199" width="200" height="200"><path d="M192 443.733333c-38.4 0-68.266667 29.866667-68.266667 68.266667 0 38.4 29.866667 68.266667 68.266667 68.266667s68.266667-29.866667 68.266667-68.266667c0-38.4-29.866667-68.266667-68.266667-68.266667zM512 443.733333c-38.4 0-68.266667 29.866667-68.266667 68.266667 0 38.4 29.866667 68.266667 68.266667 68.266667s68.266667-29.866667 68.266667-68.266667c0-38.4-29.866667-68.266667-68.266667-68.266667zM832 443.733333c-38.4 0-68.266667 29.866667-68.266667 68.266667 0 38.4 29.866667 68.266667 68.266667 68.266667s68.266667-29.866667 68.266667-68.266667c0-38.4-34.133333-68.266667-68.266667-68.266667z" fill="#111111" p-id="9200"></path></svg>
|
|
|
|
+ <div class="popoverBox" v-if="showCardId===item.id">
|
|
|
|
+ <div v-if="item.userid===userinfo.userid" @click="editAppFn(item)">
|
|
|
|
+ <img src="../../assets/images/appStore/edit.svg">
|
|
|
|
+ <span>编辑</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="item.json && item.json.copy==='1'" @click="copyAppFn(item)">
|
|
|
|
+ <img src="../../assets/images/appStore/copy.svg">
|
|
|
|
+ <span>复制</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="item.userid===userinfo.userid" @click="deleteAppFn(item)">
|
|
|
|
+ <img src="../../assets/images/appStore/del.svg">
|
|
|
|
+ <span>删除</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="as_c_i_bottom">
|
|
|
|
+ <div>{{ item.detail }}</div>
|
|
|
|
+ <span @click="openUrl(item.url)">{{ item.url }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <span class="as_c_empty" v-if="dataList.length === 0">
|
|
|
|
+ 暂无应用...
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ <appStorePopup ref="appStorePopupRef" :typeList="typeList" @success="appStorePopupSuccess"/> -->
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
|
+import { getStoreType, getStore, addApp, editApp, insertSave, deleteApp } from '@/api/appStore'
|
|
|
|
+import appStorePopup from './components/appStorePopup.vue'
|
|
|
|
+import { Dialog, Toast } from 'vant'
|
|
|
|
+const clickOutside = {
|
|
|
|
+ bind(el, binding) {
|
|
|
|
+ // 在元素上绑定一个点击事件监听器
|
|
|
|
+ el.clickOutsideEvent = function(event) {
|
|
|
|
+ console.log('event', event)
|
|
|
|
+ console.log('村上春树')
|
|
|
|
+
|
|
|
|
+ // 检查点击事件是否发生在元素的内部
|
|
|
|
+ if (!(el === event.target || el.contains(event.target))) {
|
|
|
|
+ // 如果点击事件发生在元素的外部,则触发指令绑定的方法,将点击的event数据传过去
|
|
|
|
+ binding.value(event)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 在文档上添加点击事件监听器
|
|
|
|
+ document.addEventListener('tap', el.clickOutsideEvent)
|
|
|
|
+ },
|
|
|
|
+ unbind(el) {
|
|
|
|
+ // 在元素上解除点击事件监听器
|
|
|
|
+ document.removeEventListener('tap', el.clickOutsideEvent)
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export default {
|
|
|
|
+ name: 'appStore',
|
|
|
|
+ components: {
|
|
|
|
+ appStorePopup
|
|
|
|
+ },
|
|
|
|
+ directives: {
|
|
|
|
+ 'click-outside': clickOutside // 注册自定义指令
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ tabType: 0,
|
|
|
|
+ CeShow: false,
|
|
|
|
+ isShow: false, //loading
|
|
|
|
+ comShow:false, //电脑端链接
|
|
|
|
+ dataList: [],
|
|
|
|
+ typeList: [],
|
|
|
|
+ showType: '',
|
|
|
|
+ searchText: '',
|
|
|
|
+ selectJuri: 3,
|
|
|
|
+ selectList: [
|
|
|
|
+ { index: 1, label: '我的' },
|
|
|
|
+ { index: 2, label: '组织' },
|
|
|
|
+ { index: 3, label: '所有人' }
|
|
|
|
+ ],
|
|
|
|
+ showCardId: null
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapGetters(['userinfo']),
|
|
|
|
+ showMenu() {
|
|
|
|
+ return data => {
|
|
|
|
+ let _result = false
|
|
|
|
+ if (data && this.userinfo.userid) {
|
|
|
|
+ if (data.userid === this.userinfo.userid || (data.json && data.json.copy === '1')) {
|
|
|
|
+ _result = true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return _result
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+
|
|
|
|
+ async copyUrl() {
|
|
|
|
+ const url = "https://cloud.cocorobo.cn/";
|
|
|
|
+ try {
|
|
|
|
+ await navigator.clipboard.writeText(url);
|
|
|
|
+ Toast({
|
|
|
|
+ message: '链接已复制!',
|
|
|
|
+ position: 'top',
|
|
|
|
+ });
|
|
|
|
+ } catch (err) {
|
|
|
|
+ console.error("复制失败:", err);
|
|
|
|
+ Toast({
|
|
|
|
+ message: '复制失败,请手动复制',
|
|
|
|
+ position: 'top',
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 跳转个人信息页
|
|
|
|
+ goInfo(){
|
|
|
|
+ this.$router.push('/userInfoPage')
|
|
|
|
+ },
|
|
|
|
+ // 跳转查询页面
|
|
|
|
+ searchPage(){
|
|
|
|
+ this.$router.push('/searchL')
|
|
|
|
+ },
|
|
|
|
+ // 阻止触摸移动事件的默认行为
|
|
|
|
+ handleTouchMove(event) {
|
|
|
|
+ event.preventDefault()
|
|
|
|
+ },
|
|
|
|
+ // 打开与关闭侧边栏
|
|
|
|
+ openCe() {
|
|
|
|
+ this.CeShow = !this.CeShow
|
|
|
|
+ },
|
|
|
|
+ // 点击遮罩层关闭侧边栏
|
|
|
|
+ openCeY() {
|
|
|
|
+ this.CeShow = false
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 查询应用数据
|
|
|
|
+ getData(val = '') {
|
|
|
|
+ this.isShow = true
|
|
|
|
+ let params = {
|
|
|
|
+ uid: this.userinfo.userid,
|
|
|
|
+ name: this.searchText,
|
|
|
|
+ label: '',
|
|
|
|
+ type: val,
|
|
|
|
+ juri: this.selectJuri,
|
|
|
|
+ stand: 'cn'
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ getStore(params)
|
|
|
|
+ .then(res => {
|
|
|
|
+ let _data = res[0]
|
|
|
|
+ if (_data.length > 0) {
|
|
|
|
+ _data.forEach(i => {
|
|
|
|
+ if (i.json) {
|
|
|
|
+ i.json = JSON.parse(i.json)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ this.dataList = _data
|
|
|
|
+ } else {
|
|
|
|
+ this.dataList = []
|
|
|
|
+ }
|
|
|
|
+ this.isShow = false
|
|
|
|
+ })
|
|
|
|
+ .catch(err => {
|
|
|
|
+ this.isShow = false
|
|
|
|
+ this.$toast.error('获取应用数据失败')
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 喜欢
|
|
|
|
+ addLike(){
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ // 收藏
|
|
|
|
+ addColl(){
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ getAllStoreType() {
|
|
|
|
+ let params = {
|
|
|
|
+ suserid: this.userinfo.userid,
|
|
|
|
+ sorg: this.userinfo.org,
|
|
|
|
+ soid: this.userinfo.organizeid,
|
|
|
|
+ sstand: 'cn'
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ getStoreType(params)
|
|
|
|
+ .then(res => {
|
|
|
|
+ let _data = res[0]
|
|
|
|
+ if (_data.length > 0) {
|
|
|
|
+ this.typeList = _data
|
|
|
|
+ this.typeList.unshift({ id: '', name: '全部' })
|
|
|
|
+ } else {
|
|
|
|
+ this.typeList = []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch(err => {
|
|
|
|
+ console.log(err)
|
|
|
|
+ this.$toast.error('获取应用类型失败')
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ openUrl(url) {
|
|
|
|
+ window.open(url, '_blank')
|
|
|
|
+ },
|
|
|
|
+ addAppFn() {
|
|
|
|
+ this.$refs.appStorePopupRef.open({ type: 1 })
|
|
|
|
+ },
|
|
|
|
+ editAppFn(data) {
|
|
|
|
+ this.$refs.appStorePopupRef.open({
|
|
|
|
+ type: 2,
|
|
|
|
+ form: {
|
|
|
|
+ id: data.id,
|
|
|
|
+ nname: data.name,
|
|
|
|
+ nlabel: data.label,
|
|
|
|
+ ndetail: data.detail,
|
|
|
|
+ nurl: data.url,
|
|
|
|
+ ntype: data.type,
|
|
|
|
+ njuri: data.juri,
|
|
|
|
+ nstand: data.stand,
|
|
|
|
+ njson: data.json
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ copyAppFn(item) {
|
|
|
|
+ Dialog.confirm({
|
|
|
|
+ title: '复制应用',
|
|
|
|
+ message: `确定复制《${item.name}》这个应用吗?`
|
|
|
|
+ })
|
|
|
|
+ .then(_ => {
|
|
|
|
+ let params = [
|
|
|
|
+ {
|
|
|
|
+ name: `${item.name}_copy`,
|
|
|
|
+ userid: this.userinfo.userid,
|
|
|
|
+ label: item.label,
|
|
|
|
+ detail: item.detail,
|
|
|
|
+ url: item.url,
|
|
|
|
+ type: item.type,
|
|
|
|
+ juri: '1',
|
|
|
|
+ stand: 'cn',
|
|
|
|
+ json: JSON.stringify(item.json)
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+
|
|
|
|
+ addApp(params)
|
|
|
|
+ .then(res => {
|
|
|
|
+ if (res == 1) {
|
|
|
|
+ this.insertSaveFn(item, 3)
|
|
|
|
+ Toast.success('已复制到我的列表')
|
|
|
|
+ } else {
|
|
|
|
+ this.$toast.fail('复制失败')
|
|
|
|
+ }
|
|
|
|
+ this.getData()
|
|
|
|
+ })
|
|
|
|
+ .catch(e => {
|
|
|
|
+ console.log(e)
|
|
|
|
+ this.$toast.fail('复制失败')
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ .catch(_ => {})
|
|
|
|
+ },
|
|
|
|
+ deleteAppFn(item) {
|
|
|
|
+ Dialog.confirm({
|
|
|
|
+ title: '删除应用',
|
|
|
|
+ message: `确定删除《${item.name}》这个应用吗?`
|
|
|
|
+ })
|
|
|
|
+ .then(_ => {
|
|
|
|
+ let params = [
|
|
|
|
+ {
|
|
|
|
+ uid: this.userinfo.userid,
|
|
|
|
+ aid: item.id
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ deleteApp(params)
|
|
|
|
+ .then(res => {
|
|
|
|
+ if (res == 1) {
|
|
|
|
+ this.$toast.success('删除应用成功')
|
|
|
|
+ } else {
|
|
|
|
+ this.$toast.fail('删除应用失败')
|
|
|
|
+ }
|
|
|
|
+ this.getData()
|
|
|
|
+ })
|
|
|
|
+ .catch(e => {
|
|
|
|
+ console.log(e)
|
|
|
|
+ this.$toast.fail('删除应用失败')
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ .catch(_ => {
|
|
|
|
+ console.log('取消删除')
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ insertSaveFn(item, type) {
|
|
|
|
+ return new Promise(resolve => {
|
|
|
|
+ let params = [
|
|
|
|
+ {
|
|
|
|
+ uid: this.userinfo.userid,
|
|
|
|
+ type: type,
|
|
|
|
+ aid: item.id,
|
|
|
|
+ json: ''
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ insertSave(params)
|
|
|
|
+ .then(res => {
|
|
|
|
+ if (res) {
|
|
|
|
+ resolve(1)
|
|
|
|
+ } else {
|
|
|
|
+ resolve(0)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch(e => {
|
|
|
|
+ console.log(e)
|
|
|
|
+ resolve(0)
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ appStorePopupSuccess(data, type) {
|
|
|
|
+ if (type === 1) {
|
|
|
|
+ //添加
|
|
|
|
+ let params = [
|
|
|
|
+ {
|
|
|
|
+ nname: data.nname, //app名称
|
|
|
|
+ nuserid: this.userinfo.userid, //创建的用户ID
|
|
|
|
+ nlabel: data.nlabel, //app标签
|
|
|
|
+ ndetail: data.ndetail, //app简介
|
|
|
|
+ nurl: data.nurl, //app链接
|
|
|
|
+ ntype: data.ntype, //app类型
|
|
|
|
+ njuri: data.njuri, //app权限 1:我的 2:组织 3:所有人
|
|
|
|
+ nstand: 'cn', //语言
|
|
|
|
+ njson: '' //其他信息
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ addApp(params)
|
|
|
|
+ .then(res => {
|
|
|
|
+ if (res == 1) {
|
|
|
|
+ this.$message.success('添加成功')
|
|
|
|
+ this.$refs.appStorePopupRef.close(true)
|
|
|
|
+ this.getData()
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error('添加失败')
|
|
|
|
+ this.$refs.appStorePopupRef.loading = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch(err => {
|
|
|
|
+ console.log(err)
|
|
|
|
+ this.$message.error('添加失败')
|
|
|
|
+ })
|
|
|
|
+ } else if (type === 2) {
|
|
|
|
+ let params = [
|
|
|
|
+ {
|
|
|
|
+ aid: data.id,
|
|
|
|
+ nname: data.nname, //app名称
|
|
|
|
+ nuserid: this.userinfo.userid, //创建的用户ID
|
|
|
|
+ nlabel: data.nlabel, //app标签
|
|
|
|
+ ndetail: data.ndetail, //app简介
|
|
|
|
+ nurl: data.nurl, //app链接
|
|
|
|
+ ntype: data.ntype, //app类型
|
|
|
|
+ njuri: data.njuri, //app权限 1:我的 2:组织 3:所有人
|
|
|
|
+ nstand: 'cn', //语言
|
|
|
|
+ njson: data.njson //其他信息
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ editApp(params)
|
|
|
|
+ .then(res => {
|
|
|
|
+ if (res == 1) {
|
|
|
|
+ this.$message.success('修改成功')
|
|
|
|
+ this.$refs.appStorePopupRef.close(true)
|
|
|
|
+ this.getData()
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error('修改失败')
|
|
|
|
+ this.$refs.appStorePopupRef.loading = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch(err => {
|
|
|
|
+ console.log(err)
|
|
|
|
+ this.$message.error('修改失败')
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ showCard(id) {
|
|
|
|
+ if (this.showCardId == id) return (this.showCardId = null)
|
|
|
|
+ this.showCardId = id
|
|
|
|
+ },
|
|
|
|
+ changeType(id) {
|
|
|
|
+ if (this.showType !== id) {
|
|
|
|
+ this.showType = id
|
|
|
|
+ this.getData()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ closeCard() {
|
|
|
|
+ this.showCardId = null
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ this.getData()
|
|
|
|
+ this.getAllStoreType()
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+.appStore {
|
|
|
|
+ width: 100vw;
|
|
|
|
+ height: 100vh;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ // padding: 5px;
|
|
|
|
+ background-color: #f9f8f8;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ overflow: auto;
|
|
|
|
+}
|
|
|
|
+.topC {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ width: 100%;
|
|
|
|
+ align-items: center;
|
|
|
|
+ height: 80px;
|
|
|
|
+ padding: 0px 12px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+}
|
|
|
|
+.bodyCon {
|
|
|
|
+ height: 100%;
|
|
|
|
+}
|
|
|
|
+:deep .van-popup--left {
|
|
|
|
+ top: auto !important;
|
|
|
|
+}
|
|
|
|
+.popupCon {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ padding: 20px 20px 40px 20px;
|
|
|
|
+ height: 100%;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ .popTop {
|
|
|
|
+ color: #000;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ gap: 15px;
|
|
|
|
+ font-family: PingFang SC;
|
|
|
|
+ font-weight: 600;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .popupBot {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ gap: 10px;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.appBlocks {
|
|
|
|
+ display: grid;
|
|
|
|
+ position: relative;
|
|
|
|
+ grid-template-columns: repeat(2, 1fr);
|
|
|
|
+ // grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
|
|
|
|
+ padding: 10px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ gap: 10px;
|
|
|
|
+ grid-auto-rows: 150px; /* 统一高度 */
|
|
|
|
+ background: #f9f8f8;
|
|
|
|
+ overflow: auto;
|
|
|
|
+ .appBlock {
|
|
|
|
+ min-width: 100px;
|
|
|
|
+ max-height: 145px;
|
|
|
|
+ background: #f8f8f8;
|
|
|
|
+ border-radius: 10px;
|
|
|
|
+ box-shadow: 0px 4px 10px 0px #00000033;
|
|
|
|
+ .appBlockTop {
|
|
|
|
+ border-radius: 10px;
|
|
|
|
+ padding: 10px;
|
|
|
|
+ background: #fff;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ .appBlockTopImg {
|
|
|
|
+ width: 30px;
|
|
|
|
+ height: 30px;
|
|
|
|
+ object-fit: contain;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ padding: 3px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ border: 0.5px #d9d9d9 solid;
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
+ }
|
|
|
|
+ .appBlockTopTit {
|
|
|
|
+ font-family: PingFang SC;
|
|
|
|
+ font-weight: 600;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ line-height: 15px;
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ }
|
|
|
|
+ .ATag {
|
|
|
|
+ font-family: PingFang SC;
|
|
|
|
+ font-weight: 400;
|
|
|
|
+ font-size: 10px;
|
|
|
|
+ line-height: 16px;
|
|
|
|
+ background: #f3f3f3;
|
|
|
|
+ padding: 2px;
|
|
|
|
+ border-radius: 2px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .appBlockBot {
|
|
|
|
+ background: #f8f8f8;
|
|
|
|
+ display: flex;
|
|
|
|
+ padding: 10px;
|
|
|
|
+ border-radius: 0 0 10px 10px;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ .appBlockBotCol {
|
|
|
|
+ display: flex;
|
|
|
|
+ gap: 8px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+// /deep/ .van-tab {
|
|
|
|
+// width: 100px;
|
|
|
|
+// text-align: center;
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+// /deep/ .van-tabs__line {
|
|
|
|
+// width: 90px;
|
|
|
|
+// height: 2px;
|
|
|
|
+// flex-shrink: 0;
|
|
|
|
+// background: #4a8efc;
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+/deep/ .van-tab__pane {
|
|
|
|
+ height: calc(92vh - 44px);
|
|
|
|
+ overflow-y: auto;
|
|
|
|
+ overflow-x: hidden;
|
|
|
|
+ width: 100%;
|
|
|
|
+}
|
|
|
|
+/deep/ .comCss{
|
|
|
|
+ background: rgba(158, 152, 152, 0.4);
|
|
|
|
+ backdrop-filter: blur(3px);
|
|
|
|
+}
|
|
|
|
+.Vpop{
|
|
|
|
+ padding: 20px 30px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ height: 350px;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
|
|
+}
|
|
|
|
+.comCssTit{
|
|
|
|
+ font-family: PingFang HK;
|
|
|
|
+ font-weight: 600;
|
|
|
|
+ font-size: 20px;
|
|
|
|
+ line-height: 20px;
|
|
|
|
+ color: #0663FE;
|
|
|
|
+ margin-bottom: 20px;
|
|
|
|
+}
|
|
|
|
+.cpmUrl{
|
|
|
|
+ background: #3681FC;
|
|
|
|
+ border-radius: 12px;
|
|
|
|
+ padding: 10px 20px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ color: #fff;
|
|
|
|
+ font-family: PingFang HK;
|
|
|
|
+ font-weight: 600;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ margin: 10px 0 20px;
|
|
|
|
+}
|
|
|
|
+.comBot{
|
|
|
|
+ font-family: PingFang HK;
|
|
|
|
+ font-weight: 400;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ line-height: 20px;
|
|
|
|
+ color: #000;
|
|
|
|
+}
|
|
|
|
+.zzcl{
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: 0%;top: 0%;
|
|
|
|
+ background: #fff;
|
|
|
|
+ width: 100%;height: 100%;opacity: .6;
|
|
|
|
+ display: flex;justify-content: center;line-height: 350px;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ color: #000;
|
|
|
|
+}
|
|
|
|
+</style>
|