From 2d5d60d5f165546299d1b42004b1469cb6d2b3ef Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 09 三月 2023 11:53:13 +0800
Subject: [PATCH] 2023-03-09

---
 src/tabviews/custom/popview/index.jsx                        |    2 
 src/tabviews/custom/index.jsx                                |    2 
 src/menu/components/editor/braft-editor/index.jsx            |    2 
 src/menu/components/editor/braft-editor/options.jsx          |   27 ++++++++
 src/pc/bgcontroller/index.jsx                                |   72 +++++++++++++++++++++++-
 src/tabviews/custom/components/editor/braft-editor/index.jsx |   26 ++++++++
 src/views/pcdesign/index.jsx                                 |    2 
 src/views/mobdesign/index.jsx                                |    2 
 src/views/mobdesign/popview/index.jsx                        |    4 
 9 files changed, 125 insertions(+), 14 deletions(-)

diff --git a/src/menu/components/editor/braft-editor/index.jsx b/src/menu/components/editor/braft-editor/index.jsx
index 21d0ab9..edc3cba 100644
--- a/src/menu/components/editor/braft-editor/index.jsx
+++ b/src/menu/components/editor/braft-editor/index.jsx
@@ -170,7 +170,7 @@
         <NormalHeader hideSearch="true" config={card} updateComponent={this.updateComponent}/>
         <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
           <div className="mk-popover-control">
-            <NormalForm title="瀵屾枃鏈缃�" width={700} update={this.updateWrap} getForms={this.getWrapForms}>
+            <NormalForm title="瀵屾枃鏈缃�" width={750} update={this.updateWrap} getForms={this.getWrapForms}>
               <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/>
             </NormalForm>
             <CopyComponent type="normaltable" card={card}/>
diff --git a/src/menu/components/editor/braft-editor/options.jsx b/src/menu/components/editor/braft-editor/options.jsx
index f788ef9..134bf6a 100644
--- a/src/menu/components/editor/braft-editor/options.jsx
+++ b/src/menu/components/editor/braft-editor/options.jsx
@@ -4,6 +4,19 @@
 export default function (wrap, columns) {
   let appType = sessionStorage.getItem('appType')
   let roleList = sessionStorage.getItem('sysRoles')
+  let menu = window.GLOB.customMenu
+
+  let interfaces = []
+  if (menu.interfaces) {
+    menu.interfaces.forEach(item => {
+      if (item.status === 'true') {
+        interfaces.push({
+          value: item.uuid,
+          label: item.name
+        })
+      }
+    })
+  }
 
   if (roleList) {
     try {
@@ -52,14 +65,24 @@
       options: [
         {value: 'dynamic', label: '鍔ㄦ��'},
         {value: 'static', label: '闈欐��'},
+        {value: 'public', label: '鍏叡鏁版嵁婧�'},
       ],
       controlFields: [
-        {field: 'field', values: ['dynamic']},
-        {field: 'encryption', values: ['dynamic']},
+        {field: 'field', values: ['dynamic', 'public']},
+        {field: 'publicId', values: ['public']},
+        {field: 'encryption', values: ['dynamic', 'public']},
       ]
     },
     {
       type: 'select',
+      field: 'publicId',
+      label: '鏁版嵁婧�',
+      initval: wrap.publicId || '',
+      required: true,
+      options: interfaces
+    },
+    {
+      type: 'select',
       field: 'field',
       label: '鏂囨湰瀛楁',
       initval: wrap.field || '',
diff --git a/src/pc/bgcontroller/index.jsx b/src/pc/bgcontroller/index.jsx
index 35def8d..35f3fd0 100644
--- a/src/pc/bgcontroller/index.jsx
+++ b/src/pc/bgcontroller/index.jsx
@@ -2,13 +2,14 @@
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
 import { Form, Select, Input } from 'antd'
-import { ArrowUpOutlined, ArrowDownOutlined, ArrowLeftOutlined, ArrowRightOutlined } from '@ant-design/icons'
+import { ArrowUpOutlined, ArrowDownOutlined, ArrowLeftOutlined, ArrowRightOutlined, BgColorsOutlined, ColumnWidthOutlined } from '@ant-design/icons'
 
 import asyncComponent from '@/utils/asyncComponent'
 import './index.scss'
 
 const ColorSketch = asyncComponent(() => import('@/mob/colorsketch'))
 const StyleInput = asyncComponent(() => import('@/menu/stylecontroller/styleInput'))
+const SysColorSketch = asyncComponent(() => import('@/menu/stylecontroller/syscolorsketch'))
 const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent'))
 const { Option } = Select
 
@@ -150,8 +151,52 @@
     }
   }
 
+  /**
+   * @description 淇敼闃村奖棰滆壊 锛岄鑹叉帶浠�
+   */
+  changeShadowColor = (val) => {
+    let config = fromJS(this.props.config).toJS()
+    config.style.shadowColor = val
+    config.style.boxShadow = `${config.style.hShadow || '0px'} ${config.style.vShadow || '0px'} ${config.style.shadowBlur || '0px'} ${config.style.shadowColor || 'transparent'}`
+
+    this.props.updateConfig(config)
+  }
+
+  /**
+   * @description 淇敼闃村奖棰滆壊 锛岄鑹叉帶浠�
+   */
+  changeShadowBlur = (val) => {
+    let config = fromJS(this.props.config).toJS()
+    config.style.shadowBlur = val
+    config.style.boxShadow = `${config.style.hShadow || '0px'} ${config.style.vShadow || '0px'} ${config.style.shadowBlur || '0px'} ${config.style.shadowColor || 'transparent'}`
+
+    this.props.updateConfig(config)
+  }
+
+  /**
+   * @description 淇敼闃村奖棰滆壊 锛岄鑹叉帶浠�
+   */
+  changeHShadow = (val) => {
+    let config = fromJS(this.props.config).toJS()
+    config.style.hShadow = val
+    config.style.boxShadow = `${config.style.hShadow || '0px'} ${config.style.vShadow || '0px'} ${config.style.shadowBlur || '0px'} ${config.style.shadowColor || 'transparent'}`
+
+    this.props.updateConfig(config)
+  }
+
+  /**
+   * @description 淇敼闃村奖棰滆壊 锛岄鑹叉帶浠�
+   */
+  changeVShadow = (val) => {
+    let config = fromJS(this.props.config).toJS()
+    config.style.vShadow = val
+    config.style.boxShadow = `${config.style.hShadow || '0px'} ${config.style.vShadow || '0px'} ${config.style.shadowBlur || '0px'} ${config.style.shadowColor || 'transparent'}`
+
+    this.props.updateConfig(config)
+  }
+
   render () {
-    const { config } = this.props
+    const { config, type } = this.props
     const { backgroundColor, backgroundImage, backgroundSize, backgroundRepeat, backgroundPosition, background } = this.state
     const formItemLayout = {
       labelCol: {
@@ -174,8 +219,11 @@
           >
             <StyleInput defaultValue={config.style.width || '100%'} options={['px', '%', 'vw']} onChange={(val) => this.changePadding(val, 'width')}/>
           </Form.Item> */}
-          <Form.Item className="color-control" colon={false} label="鑳屾櫙鑹�">
+          <Form.Item className="color-control" style={{marginBottom: '0px'}} colon={false} label="鑳屾櫙鑹�">
             <ColorSketch value={backgroundColor} onChange={this.changeBackgroundColor} />
+          </Form.Item>
+          <Form.Item colon={false} label="绯荤粺鑹�">
+            <SysColorSketch onChange={this.changeBackgroundColor} />
           </Form.Item>
           {window.develop === true ? <Form.Item colon={false} label="棰滆壊">
             <Input value={background} onChange={(e) => this.changeBackground(e.target.value)} />
@@ -209,6 +257,24 @@
               <Option value="bottom">bottom</Option>
             </Select>
           </Form.Item>
+          {type === 'mob_popview' ? <p className="normal-view" style={{borderBottom: '1px solid #eaeaea', color: '#40a9ff'}}>闃村奖</p> : null}
+          {type === 'mob_popview' ? <>
+            <Form.Item colon={false} label={<BgColorsOutlined title="闃村奖棰滆壊"/>}>
+              <ColorSketch value={config.style.shadowColor || 'transparent'} onChange={this.changeShadowColor} />
+            </Form.Item>
+            <Form.Item colon={false} label={<BgColorsOutlined title="绯荤粺鑹�"/>}>
+              <SysColorSketch onChange={this.changeShadowColor} />
+            </Form.Item>
+            <Form.Item colon={false} label={<ColumnWidthOutlined title="妯$硦璺濈"/>}>
+              <StyleInput defaultValue={config.style.shadowBlur || '0px'} options={['px']} onChange={this.changeShadowBlur}/>
+            </Form.Item>
+            <Form.Item colon={false} label={<ArrowRightOutlined title="姘村钩浣嶇疆"/>}>
+              <StyleInput defaultValue={config.style.hShadow || '0px'} options={['px']} onChange={this.changeHShadow}/>
+            </Form.Item>
+            <Form.Item colon={false} label={<ArrowDownOutlined title="鍨傜洿浣嶇疆"/>}>
+              <StyleInput defaultValue={config.style.vShadow || '0px'} options={['px']} onChange={this.changeVShadow}/>
+            </Form.Item>
+          </> : null}
           <p className="normal-view" style={{borderBottom: '1px solid #eaeaea', color: '#40a9ff'}}>鍐呰竟璺�</p>
           <Form.Item
             colon={false}
diff --git a/src/tabviews/custom/components/editor/braft-editor/index.jsx b/src/tabviews/custom/components/editor/braft-editor/index.jsx
index 5c41173..d6c7450 100644
--- a/src/tabviews/custom/components/editor/braft-editor/index.jsx
+++ b/src/tabviews/custom/components/editor/braft-editor/index.jsx
@@ -46,7 +46,7 @@
       BID = BData.$BID || ''
     }
     
-    if (_config.setting && _config.wrap.datatype !== 'static') {
+    if (_config.setting && _config.wrap.datatype === 'dynamic') {
       _sync = _config.setting.sync === 'true'
 
       if (_sync && data) {
@@ -77,7 +77,7 @@
       config: _config,
       arr_field: _config.columns.map(col => col.field).join(','),
     }, () => {
-      if (_config.wrap.datatype !== 'static' && _config.setting && _config.setting.sync !== 'true' && _config.setting.onload === 'true') {
+      if (_config.wrap.datatype === 'dynamic' && _config.setting && _config.setting.sync !== 'true' && _config.setting.onload === 'true') {
         setTimeout(() => {
           this.loadData()
         }, _config.setting.delay || 0)
@@ -86,8 +86,14 @@
   }
 
   componentDidMount () {
+    const { config } = this.state
+
     MKEmitter.addListener('reloadData', this.reloadData)
     MKEmitter.addListener('resetSelectLine', this.resetParentParam)
+
+    if (config.wrap.datatype === 'public') {
+      MKEmitter.addListener('mkPublicData', this.mkPublicData)
+    }
   }
 
   shouldComponentUpdate (nextProps, nextState) {
@@ -99,6 +105,7 @@
       return
     }
     MKEmitter.removeListener('reloadData', this.reloadData)
+    MKEmitter.removeListener('mkPublicData', this.mkPublicData)
     MKEmitter.removeListener('resetSelectLine', this.resetParentParam)
   }
 
@@ -125,6 +132,16 @@
     }
   }
 
+  mkPublicData = (publicId, data) => {
+    const { config } = this.state
+
+    if (config.wrap.datatype === 'public' && config.wrap.publicId === publicId) {
+      let _data = fromJS(data).toJS()
+
+      this.setState({data: _data})
+    }
+  }
+
   resetParentParam = (MenuID, id) => {
     const { config } = this.state
 
@@ -148,6 +165,11 @@
     const { mainSearch } = this.props
     const { config, arr_field, BID } = this.state
 
+    if (config.wrap.datatype === 'public') {
+      MKEmitter.emit('reloadData', config.wrap.publicId)
+      return
+    }
+    
     if (config.wrap.datatype === 'static') {
       this.setState({
         data: {},
diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx
index 9af6162..cbf6415 100644
--- a/src/tabviews/custom/index.jsx
+++ b/src/tabviews/custom/index.jsx
@@ -516,7 +516,7 @@
       if (item.wrap && item.wrap.supType === 'multi') { // 鏁版嵁鍗″涓婄骇缁勪欢
         mutil = true
         item.setting.supModule = item.supNodes[0].componentId
-      } else if (item.setting && item.setting.supModule) {
+      } else if (item.setting && item.setting.supModule && typeof(item.setting.supModule) !== 'string') {
         let pid = item.setting.supModule.pop()
         if (pid && pid !== 'empty') {
           item.setting.supModule = pid
diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx
index 496f920..6149fc0 100644
--- a/src/tabviews/custom/popview/index.jsx
+++ b/src/tabviews/custom/popview/index.jsx
@@ -363,7 +363,7 @@
       if (item.wrap && item.wrap.supType === 'multi') { // 鏁版嵁鍗″涓婄骇缁勪欢
         mutil = true
         item.setting.supModule = item.supNodes[0].componentId
-      } else if (item.setting && item.setting.supModule) {
+      } else if (item.setting && item.setting.supModule && typeof(item.setting.supModule) !== 'string') {
         let pid = item.setting.supModule.pop()
         if (pid && pid !== 'empty') {
           item.setting.supModule = pid
diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx
index 1a9388a..7e740f5 100644
--- a/src/views/mobdesign/index.jsx
+++ b/src/views/mobdesign/index.jsx
@@ -2023,7 +2023,7 @@
                   <Panel header="鍏冪礌" key="element">
                     <Modulecell />
                   </Panel>
-                  <Panel header={'椤甸潰鏍峰紡'} key="background">
+                  <Panel header="椤甸潰鏍峰紡" key="background">
                     {config ? <BgController config={config} updateConfig={this.updateConfig} /> : null}
                   </Panel>
                 </Collapse>
diff --git a/src/views/mobdesign/popview/index.jsx b/src/views/mobdesign/popview/index.jsx
index 7cb6973..316deca 100644
--- a/src/views/mobdesign/popview/index.jsx
+++ b/src/views/mobdesign/popview/index.jsx
@@ -272,8 +272,8 @@
               <Panel header="鍏冪礌" key="element">
                 <Modulecell />
               </Panel>
-              <Panel header={'椤甸潰鏍峰紡'} key="background">
-                <BgController config={config} updateConfig={this.updateConfig} />
+              <Panel header="椤甸潰鏍峰紡" key="background">
+                <BgController config={config} type="mob_popview" updateConfig={this.updateConfig} />
               </Panel>
             </Collapse>
           </div>
diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx
index 4da0e5e..c524734 100644
--- a/src/views/pcdesign/index.jsx
+++ b/src/views/pcdesign/index.jsx
@@ -1651,7 +1651,7 @@
                   <Panel header="鍏冪礌" key="element">
                     <Modulecell />
                   </Panel>
-                  <Panel header={'椤甸潰鏍峰紡'} key="background">
+                  <Panel header="椤甸潰鏍峰紡" key="background">
                     {config ? <BgController config={config} updateConfig={this.updateConfig} /> : null}
                   </Panel>
                 </Collapse>

--
Gitblit v1.8.0