From 32973f90869ff466401759c23681fc06fa65c71a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 10 六月 2025 23:06:50 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/menu/components/share/sourcecomponent/inputform/index.jsx |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 54 insertions(+), 6 deletions(-)

diff --git a/src/menu/components/share/sourcecomponent/inputform/index.jsx b/src/menu/components/share/sourcecomponent/inputform/index.jsx
index 4881a3f..4d4a477 100644
--- a/src/menu/components/share/sourcecomponent/inputform/index.jsx
+++ b/src/menu/components/share/sourcecomponent/inputform/index.jsx
@@ -13,7 +13,6 @@
 const { Search } = Input
 const FileUpload = asyncComponent(() => import('@/tabviews/zshare/fileupload'))
 const Video = asyncComponent(() => import('@/menu/picturecontroller/video'))
-const Image = asyncComponent(() => import('@/components/Image'))
 const EditForm = asyncComponent(() => import('@/menu/picturecontroller/editform'))
 
 class PopSource extends Component {
@@ -24,6 +23,7 @@
   state = {
     url: '',
     list: [],
+    icons: [],
     searchKey: '',
     selectId: '',
     editvisible: false,
@@ -84,7 +84,36 @@
   }
 
   init = (originlist) => {
-    this.setState({list: originlist, url: '', searchKey: ''})
+    const { type } = this.props
+    this.setState({list: originlist, icons: window.GLOB.sIcons || [], url: '', searchKey: ''})
+
+    if (type !== 'video' && !window.GLOB.sIcons && sessionStorage.getItem('getIcons') !== 'fail') {
+      fetch(window.GLOB.baseurl + 'Content/static/data.json')
+        .then(response => response.json())
+        .catch(() => {
+          sessionStorage.setItem('getIcons', 'fail')
+        })
+        .then(res => {
+          if (res && res.list) {
+            let icons = []
+            res.list.forEach(item => {
+              if (!item.url) return
+
+              icons.push({
+                linkurl: window.GLOB.baseurl + 'Content/static/' + item.url,
+                remark: item.remark || '',
+                id: Utils.getuuid()
+              })
+            })
+
+            window.GLOB.sIcons = icons
+
+            this.setState({icons})
+          } else {
+            sessionStorage.setItem('getIcons', 'fail')
+          }
+        })
+    }
   }
 
   changeValue = (e) => {
@@ -96,8 +125,15 @@
   }
 
   selectItem = (item) => {
+    const { type } = this.props
+    const { icons } = this.state
+
     if (item.linkurl) {
-      this.setState({url: item.linkurl, selectId: item.id})
+      if (type !== 'video' && icons.findIndex(n => n.id === item.id) > -1) {
+        this.setState({url: item.linkurl.replace(window.GLOB.baseurl, '@mywebsite@/'), selectId: item.id})
+      } else {
+        this.setState({url: item.linkurl, selectId: item.id})
+      }
     }
   }
 
@@ -149,7 +185,7 @@
 
   render () {
     const { type, keyword } = this.props
-    const { list, url, searchKey, selectId, editvisible, card } = this.state
+    const { list, icons, url, searchKey, selectId, editvisible, card } = this.state
     
     if (keyword === 'input') {
       return <div className="mk-source-pop-wrap">
@@ -171,9 +207,11 @@
     }
 
     let pagelist = list
+    let iconlist = icons
 
     if (searchKey) {
       pagelist = list.filter(item => item.remark && item.remark.indexOf(searchKey) > -1)
+      iconlist = icons.filter(item => item.remark && item.remark.indexOf(searchKey) > -1)
     }
 
     return (
@@ -187,12 +225,22 @@
             <Col span={3} key={item.id}>
               <div className={'image-video-box' + (selectId === item.id ? ' active' : '')} onClick={() => this.selectItem(item)}>
                 <div className="image-video-box-body">
-                  {type !== 'video' ? <Image url={item.linkurl} /> : <Video value={item.linkurl} />}
+                  {type !== 'video' ? <img src={item.linkurl} alt=""/> : <Video value={item.linkurl} />}
                 </div>
               </div>
             </Col>
           ))}
-          {!pagelist.length ? <Empty description={null}/> : null}
+          {iconlist.length ? <div className="static-source">闈欐�佽祫婧�</div> : null}
+          {iconlist.map(item => (
+            <Col span={3} key={item.id}>
+              <div className={'image-video-box' + (selectId === item.id ? ' active' : '')} onClick={() => this.selectItem(item)}>
+                <div className="image-video-box-body">
+                  <img src={item.linkurl} alt=""/>
+                </div>
+              </div>
+            </Col>
+          ))}
+          {!pagelist.length && !iconlist.length ? <Empty description={null}/> : null}
         </Row>
         <Modal
           title="鏂板缓"

--
Gitblit v1.8.0