SanHQin 5 mēneši atpakaļ
vecāks
revīzija
efae45872e

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/index.html


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
dist/report.html


+ 0 - 0
dist/static/css/chunk-b265f6f8.bcaf1064.css → dist/static/css/chunk-18bc0912.bcaf1064.css


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/css/chunk-4ffa13c8.3bc7baec.css


+ 4 - 0
dist/static/img/copy.e71f523d.svg

@@ -0,0 +1,4 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M2 2.5C2 2.22386 2.22386 2 2.5 2H10C10.2761 2 10.5 2.22386 10.5 2.5C10.5 2.77614 10.2761 3 10 3H3V10C3 10.2761 2.77614 10.5 2.5 10.5C2.22386 10.5 2 10.2761 2 10V2.5Z" fill="black" fill-opacity="0.9"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M5 5.5C5 5.22386 5.22386 5 5.5 5H13.5C13.7761 5 14 5.22386 14 5.5V13.5C14 13.7761 13.7761 14 13.5 14H5.5C5.22386 14 5 13.7761 5 13.5V5.5ZM6 6V13H13V6H6Z" fill="black" fill-opacity="0.9"/>
+</svg>

+ 6 - 0
dist/static/img/del.66aa9e0b.svg

@@ -0,0 +1,6 @@
+<svg t="1735179126172" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7200"
+  width="200" height="200">
+  <path
+    d="M623.077 748.923c-17.598 0-31.82-14.223-31.82-31.82V367.025c0-17.598 14.222-31.827 31.82-31.827s31.827 14.23 31.827 31.827v350.075c0 17.6-14.228 31.822-31.827 31.822z m-190.945 0c-17.604 0-31.827-14.223-31.827-31.82V367.025c0-17.598 14.223-31.827 31.827-31.827 17.598 0 31.82 14.23 31.82 31.827v350.075c0 17.6-14.222 31.822-31.82 31.822z m509.193-541.02H782.201v-63.65c0-52.64-42.486-95.475-94.742-95.475H368.477c-52.634 0-95.47 42.836-95.47 95.475v63.65H113.885c-17.604 0-31.827 14.222-31.827 31.826 0 17.598 14.223 31.82 31.827 31.82h827.441c17.598 0 31.827-14.222 31.827-31.82 0-17.604-14.228-31.827-31.827-31.827z m-604.669-63.65c0-17.536 14.287-31.826 31.821-31.826H687.46c17.444 0 31.094 13.972 31.094 31.826v63.65H336.656v-63.65z m413.85 795.621H304.892c-52.635 0-95.47-42.836-95.47-95.475V366.55c0-17.569 14.257-31.826 31.822-31.826 17.57 0 31.826 14.257 31.826 31.826V844.4c0 17.569 14.288 31.826 31.823 31.826h445.613c17.565 0 31.823-14.257 31.823-31.826V367.852c0-17.565 14.228-31.823 31.826-31.823 17.599 0 31.827 14.258 31.827 31.823v476.547c0 52.64-42.841 95.475-95.476 95.475z"
+    p-id="7201" fill="#000000" fill-opacity="0.9"></path>
+</svg>

+ 6 - 0
dist/static/img/edit.fbee6006.svg

@@ -0,0 +1,6 @@
+<svg t="1735179175069" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9354"
+  width="200" height="200">
+  <path
+    d="M128 544a32 32 0 0 1 10.176-23.424l480-448a32 32 0 0 1 44.48 0.768l192 192a32 32 0 0 1-0.832 46.08l-480 448A32 32 0 0 1 352 768h-192a32 32 0 0 1-32-32v-192z m64 13.888V704h147.392l446.528-416.768-146.688-146.752L192 557.888zM64 928v-64h896v64H64z"
+    fill="#000000" p-id="9355" fill-opacity="0.9"></path>
+</svg>

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/js/app.51204698.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/js/chunk-18bc0912.49354672.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/js/chunk-3dfdcba8.fa5cb1ca.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/js/chunk-4ffa13c8.21f4a665.js


+ 24 - 2
src/api/appStore.js

@@ -17,7 +17,7 @@ export function getStore(params) {
     url: '/select_appStore',
     method: 'get',
     params,
-    hideloading: false
+    hideloading: true
   })
 }
 
@@ -28,7 +28,7 @@ export function addApp(params) {
     url: '/insert_appStore',
     method: 'post',
     data: params,
-    hideloading: false
+    hideloading: true
   })
 }
 
@@ -41,4 +41,26 @@ export function editApp(params) {
     data: params,
     hideloading: false
   })
+}
+
+//添加appSave
+
+export function insertSave(params) {
+  return request({
+    url: '/insert_appStoreSave',
+    method: 'post',
+    data: params,
+    hideloading: true
+  })
+}
+
+//删除app
+
+export function deleteApp(params) {
+  return request({
+    url: '/delete_appStore',
+    method: 'post',
+    data: params,
+    hideloading: false
+  })
 }

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 0
src/assets/images/appStore/agent.svg


+ 3 - 0
src/assets/images/appStore/collect_active.svg

@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M8 2L10.0086 5.95016L14.5 6.58359L11.25 9.65836L12.0172 14L8 11.9502L3.98278 14L4.75 9.65836L1.5 6.58359L5.99139 5.95016L8 2Z" fill="#FFD324"/>
+</svg>

+ 3 - 0
src/assets/images/appStore/collect_default.svg

@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M8.00001 1.5C8.1894 1.5 8.36253 1.61128 8.44723 1.78745L10.3276 5.69853L14.062 6.18401C14.2515 6.20865 14.411 6.34338 14.4729 6.53124C14.5349 6.71909 14.4886 6.92726 14.3536 7.06769L11.5537 9.9795L12.4851 13.8539C12.5302 14.0413 12.4715 14.2393 12.3329 14.368C12.1942 14.4967 11.9984 14.5347 11.8245 14.4669L8.00001 12.9754L4.17558 14.4669C4.0016 14.5347 3.80578 14.4967 3.66714 14.368C3.52849 14.2393 3.46988 14.0413 3.51494 13.8539L4.44628 9.9795L1.64646 7.06769C1.51143 6.92726 1.4651 6.71909 1.52708 6.53124C1.58905 6.34338 1.7485 6.20865 1.938 6.18401L5.67247 5.69853L7.5528 1.78745C7.6375 1.61128 7.81063 1.5 8.00001 1.5ZM8.00001 3.18275L6.44723 6.41255C6.37246 6.56806 6.22792 6.67442 6.06203 6.69598L3.07646 7.08411L5.35357 9.4523C5.47776 9.58146 5.52768 9.76891 5.48509 9.94611L4.71603 13.1454L7.82445 11.9331C7.93764 11.889 8.06238 11.889 8.17558 11.9331L11.284 13.1454L10.5149 9.94611C10.4723 9.76891 10.5223 9.58146 10.6465 9.4523L12.9236 7.08411L9.938 6.69598C9.77211 6.67442 9.62756 6.56806 9.5528 6.41255L8.00001 3.18275Z" fill="black" fill-opacity="0.6"/>
+</svg>

+ 4 - 0
src/assets/images/appStore/copy.svg

@@ -0,0 +1,4 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M2 2.5C2 2.22386 2.22386 2 2.5 2H10C10.2761 2 10.5 2.22386 10.5 2.5C10.5 2.77614 10.2761 3 10 3H3V10C3 10.2761 2.77614 10.5 2.5 10.5C2.22386 10.5 2 10.2761 2 10V2.5Z" fill="black" fill-opacity="0.9"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M5 5.5C5 5.22386 5.22386 5 5.5 5H13.5C13.7761 5 14 5.22386 14 5.5V13.5C14 13.7761 13.7761 14 13.5 14H5.5C5.22386 14 5 13.7761 5 13.5V5.5ZM6 6V13H13V6H6Z" fill="black" fill-opacity="0.9"/>
+</svg>

+ 6 - 0
src/assets/images/appStore/del.svg

@@ -0,0 +1,6 @@
+<svg t="1735179126172" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7200"
+  width="200" height="200">
+  <path
+    d="M623.077 748.923c-17.598 0-31.82-14.223-31.82-31.82V367.025c0-17.598 14.222-31.827 31.82-31.827s31.827 14.23 31.827 31.827v350.075c0 17.6-14.228 31.822-31.827 31.822z m-190.945 0c-17.604 0-31.827-14.223-31.827-31.82V367.025c0-17.598 14.223-31.827 31.827-31.827 17.598 0 31.82 14.23 31.82 31.827v350.075c0 17.6-14.222 31.822-31.82 31.822z m509.193-541.02H782.201v-63.65c0-52.64-42.486-95.475-94.742-95.475H368.477c-52.634 0-95.47 42.836-95.47 95.475v63.65H113.885c-17.604 0-31.827 14.222-31.827 31.826 0 17.598 14.223 31.82 31.827 31.82h827.441c17.598 0 31.827-14.222 31.827-31.82 0-17.604-14.228-31.827-31.827-31.827z m-604.669-63.65c0-17.536 14.287-31.826 31.821-31.826H687.46c17.444 0 31.094 13.972 31.094 31.826v63.65H336.656v-63.65z m413.85 795.621H304.892c-52.635 0-95.47-42.836-95.47-95.475V366.55c0-17.569 14.257-31.826 31.822-31.826 17.57 0 31.826 14.257 31.826 31.826V844.4c0 17.569 14.288 31.826 31.823 31.826h445.613c17.565 0 31.823-14.257 31.823-31.826V367.852c0-17.565 14.228-31.823 31.826-31.823 17.599 0 31.827 14.258 31.827 31.823v476.547c0 52.64-42.841 95.475-95.476 95.475z"
+    p-id="7201" fill="#000000" fill-opacity="0.9"></path>
+</svg>

+ 6 - 0
src/assets/images/appStore/edit.svg

@@ -0,0 +1,6 @@
+<svg t="1735179175069" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9354"
+  width="200" height="200">
+  <path
+    d="M128 544a32 32 0 0 1 10.176-23.424l480-448a32 32 0 0 1 44.48 0.768l192 192a32 32 0 0 1-0.832 46.08l-480 448A32 32 0 0 1 352 768h-192a32 32 0 0 1-32-32v-192z m64 13.888V704h147.392l446.528-416.768-146.688-146.752L192 557.888zM64 928v-64h896v64H64z"
+    fill="#000000" p-id="9355" fill-opacity="0.9"></path>
+</svg>

+ 3 - 0
src/assets/images/appStore/praise_active.svg

@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+  <path d="M10 6H13.2192C13.8698 6 14.3472 6.61139 14.1894 7.24254L12.6894 13.2425C12.5781 13.6877 12.1781 14 11.7192 14H3C2.44772 14 2 13.5523 2 13V8C2 7.44772 2.44772 7 3 7H5L7 2H9C9.55228 2 10 2.44772 10 3V6ZM6 7H9V13H6Z" fill="#FFD324" fill-rule="nonzero"/>
+</svg>

+ 3 - 0
src/assets/images/appStore/praise_default.svg

@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M10 6H13.2192C13.8698 6 14.3472 6.61139 14.1894 7.24254L12.6894 13.2425C12.5781 13.6877 12.1781 14 11.7192 14H3C2.44772 14 2 13.5523 2 13V8C2 7.44772 2.44772 7 3 7H5L7 2H9C9.55228 2 10 2.44772 10 3V6ZM6 7.19258V13H11.7192L13.2192 7H9V3H7.67703L6 7.19258ZM5 8H3V13H5V8Z" fill="black" fill-opacity="0.6"/>
+</svg>

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 0
src/assets/images/appStore/user_copy.svg


+ 4 - 0
src/assets/images/appStore/workflow.svg

@@ -0,0 +1,4 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M5 2.5C5 2.22386 5.22386 2 5.5 2H13.5C13.7761 2 14 2.22386 14 2.5V4.5C14 4.77614 13.7761 5 13.5 5H5.5C5.22386 5 5 4.77614 5 4.5V4H3V7H5.5C5.77614 7 6 7.22386 6 7.5C6 7.77614 5.77614 8 5.5 8H2.5C2.22386 8 2 7.77614 2 7.5V3.5C2 3.22386 2.22386 3 2.5 3H5V2.5ZM6 4H13V3H6V4ZM10 8.5C10 8.22386 10.2239 8 10.5 8H13.5C13.7761 8 14 8.22386 14 8.5V12.5C14 12.7761 13.7761 13 13.5 13H11V13.5C11 13.7761 10.7761 14 10.5 14H4.5C4.22386 14 4 13.7761 4 13.5V11.5C4 11.2239 4.22386 11 4.5 11H10.5C10.7761 11 11 11.2239 11 11.5V12H13V9H10.5C10.2239 9 10 8.77614 10 8.5ZM10 12H5V13H10V12Z" fill="black" fill-opacity="0.4"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M7.3 6.1C7.14849 5.98637 6.94579 5.96809 6.77639 6.05279C6.607 6.13749 6.5 6.31062 6.5 6.5V9.5C6.5 9.68939 6.607 9.86252 6.77639 9.94722C6.94579 10.0319 7.14849 10.0136 7.3 9.9L9.3 8.4C9.4259 8.30558 9.5 8.15738 9.5 8C9.5 7.84262 9.4259 7.69443 9.3 7.6L7.3 6.1Z" fill="#0354D7"/>
+</svg>

+ 117 - 6
src/views/appStore/index.vue

@@ -57,10 +57,21 @@
             <span v-if="item.label==='agent'">智能体</span>
 						<span v-if="item.label==='workflow'">工作流</span>
           </div>
-					<div class="ac_c_i_t_popover" v-if="item.userid == userinfo.userid">
+					<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">
-							<span @click="editAppFn(item)">编辑</span>
+							<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>
@@ -79,8 +90,9 @@
 
 <script>
 import { mapGetters } from 'vuex'
-import { getStoreType, getStore,addApp,editApp } from '@/api/appStore';
+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) {
     // 在元素上绑定一个点击事件监听器
@@ -128,7 +140,19 @@ export default {
     }
   },
   computed: {
-    ...mapGetters(['userinfo'])
+    ...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: {
     getData() {
@@ -204,6 +228,88 @@ export default {
           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) {
         //添加
@@ -503,15 +609,20 @@ export default {
 	top:calc(100% - 5px)
 }
 
-.popoverBox>span{
+.popoverBox>div{
 	display: flex;
 	justify-content: center;
 	align-items: center;
 	padding:5px 10px;
+}
 
+.popoverBox>div>img{
+	width: 12px;
+	height: 12px;
+	margin-right: 4px;
 }
 
-.popoverBox>span:hover{
+.popoverBox>div:hover{
 	color: #409eff;
 }
 </style>

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels