From d17368d4a5bdec6db2d8a85c7901cdb25cc59cd4 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 11 十月 2021 15:16:25 +0800
Subject: [PATCH] 2021-10-11

---
 src/assets/css/viewstyle.scss                                                     |    3 
 src/menu/components/table/edit-table/columns/tableIn/index.jsx                    |   12 +
 src/menu/components/table/normal-table/options.jsx                                |   46 +++---
 src/tabviews/zshare/actionList/popupbutton/index.jsx                              |    4 
 src/tabviews/zshare/normalTable/index.jsx                                         |   10 +
 src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx    |   23 +++
 src/utils/utils-custom.js                                                         |   47 +++++-
 src/templates/zshare/verifycard/customscript/index.jsx                            |    3 
 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx             |   55 +++++--
 src/views/menudesign/menuform/index.jsx                                           |    3 
 src/menu/components/share/actioncomponent/actionform/index.jsx                    |    3 
 src/menu/components/table/edit-table/options.jsx                                  |   66 ++++++---
 src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx |    2 
 src/menu/components/table/edit-table/columns/index.scss                           |    9 +
 src/tabviews/subtable/index.jsx                                                   |   13 +
 src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx       |    2 
 src/tabviews/subtabtable/index.jsx                                                |   13 +
 src/tabviews/commontable/index.jsx                                                |   13 +
 src/menu/components/table/edit-table/index.jsx                                    |    9 -
 src/menu/components/table/edit-table/columns/index.jsx                            |   27 +++
 src/tabviews/custom/components/table/edit-table/index.scss                        |    2 
 21 files changed, 274 insertions(+), 91 deletions(-)

diff --git a/src/assets/css/viewstyle.scss b/src/assets/css/viewstyle.scss
index a580f3e..361fccf 100644
--- a/src/assets/css/viewstyle.scss
+++ b/src/assets/css/viewstyle.scss
@@ -394,6 +394,9 @@
   .mk-form-split-line {
     color: $color6;
   }
+  .system-color {
+    color: $color6;
+  }
 }
 
 body.hidden-split-line #root { // 鍘婚櫎鐧诲綍椤靛垎鍓茬嚎
diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx
index 5213db6..a1d74e9 100644
--- a/src/menu/components/share/actioncomponent/actionform/index.jsx
+++ b/src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -146,7 +146,7 @@
 
   getOptions = (_opentype, _intertype, _funcType, _pageTemplate, _procMode, _Ot) => {
     let _options = actionTypeOptions[_opentype] ? fromJS(actionTypeOptions[_opentype]).toJS() : [] // 閫夐」鍒楄〃
-    
+
     if (_opentype === 'innerpage') {         // 鏂伴〉闈紝鍙�夋ā鏉�(鑷畾涔夋椂锛屽彲濉叆澶栭儴閾炬帴)
       if (_pageTemplate === 'custom') {
         _options.push('url', 'joint')
@@ -301,6 +301,7 @@
       }
 
       this.setState({
+        funcType: value,
         formlist: this.state.formlist.map(item => {
           item.hidden = !_options.includes(item.key)
 
diff --git a/src/menu/components/table/edit-table/columns/index.jsx b/src/menu/components/table/edit-table/columns/index.jsx
index 569b68d..fdf0b84 100644
--- a/src/menu/components/table/edit-table/columns/index.jsx
+++ b/src/menu/components/table/edit-table/columns/index.jsx
@@ -315,10 +315,24 @@
     MKEmitter.emit('changeStyle', [col.uuid], ['font', 'padding'], col.style || {})
   }
 
+  changeSubmitStyle = () => {
+    const { config } = this.props
+
+    MKEmitter.emit('changeStyle', [config.uuid, 'submit'], ['font', 'background', 'border', 'margin', 'padding'], config.submit.style || {})
+  }
+
   getStyle = (comIds, style) => {
+    const { config } = this.props
     const { editStyleCard } = this.state
 
-    if (!editStyleCard || comIds[0] !== editStyleCard.uuid || comIds.length !== 1) return
+    if (comIds.length === 2 && comIds[0] === config.uuid && comIds[1] === 'submit') {
+      let submit = {...config.submit, style}
+
+      this.props.updatecolumn({...config, submit: submit})
+
+      return
+    }
+    if (comIds.length !== 1 || !editStyleCard || comIds[0] !== editStyleCard.uuid) return
 
     let _card = {...editStyleCard, style}
     
@@ -451,6 +465,7 @@
     const { config } = this.props
     
     this.verifyRef.handleConfirm().then(res => {
+      res.style = config.submit.style || {}
       this.setState({
         visible: false
       }, () => {
@@ -486,8 +501,12 @@
     }
 
     const columns = this.state.columns.map((col, index) => {
+      let title = col.label
+      if (col.editable === 'true') {
+        title = <span>{col.label}<Icon style={{position: 'absolute', bottom: 0, right: 0, color: '#1890ff'}} type="edit" /></span>
+      }
       return {
-        title: col.label,
+        title: title,
         dataIndex: col.uuid,
         align: col.Align,
         sorter: col.IsSort === 'true',
@@ -526,9 +545,10 @@
           <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
             <div className="mk-popover-control">
               <Icon className="edit" title="缂栬緫" type="edit" onClick={() => this.setState({visible: true})} />
+              <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeSubmitStyle} type="font-colors" />
             </div>
           } trigger="hover">
-            <Button style={{height: '24px', marginRight: '10px', backgroundColor: '#1890ff'}} onDoubleClick={() => this.setState({visible: true})} type="primary">鎻愪氦</Button>
+            <Button className="submit-btn" style={config.submit.style} onDoubleClick={() => this.setState({visible: true})} type="primary">鎻愪氦</Button>
           </Popover>
           <Icon title="澶嶅埗鏄剧ず鍒�" type="copy" onClick={this.copycolumn} />
           <MarkColumn columns={fields} type="line" marks={lineMarks} onSubmit={this.updateLineMarks} />
@@ -568,6 +588,7 @@
         >
           <TableVerify
             card={config.submit}
+            setting={config.setting}
             dict={dict}
             cols={config.cols}
             columns={config.columns}
diff --git a/src/menu/components/table/edit-table/columns/index.scss b/src/menu/components/table/edit-table/columns/index.scss
index 87fdab7..320709e 100644
--- a/src/menu/components/table/edit-table/columns/index.scss
+++ b/src/menu/components/table/edit-table/columns/index.scss
@@ -4,6 +4,15 @@
     color: inherit;
     font-size: inherit;
   }
+  .submit-btn {
+    height: 24px;
+    margin-right: 10px;
+    background-color: #1890ff;
+    border-width: 0;
+  }
+  .ant-table-thead > tr > th .ant-table-header-column .ant-table-column-sorters > .ant-table-column-title {
+    position: unset;
+  }
   .ant-table-body {
     overflow-x: auto;
     tr {
diff --git a/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx b/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx
index eb03544..103a7b8 100644
--- a/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx
+++ b/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx
@@ -299,7 +299,7 @@
               <Select
                 showSearch
                 filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
-                onChange={this.selectScript}
+                onSelect={this.selectScript}
                 getPopupContainer={() => document.getElementById('verify-excelin-custom-scripts')}
               >
                 <Select.Option key="default" value={'default'}>
diff --git a/src/menu/components/table/edit-table/columns/tableIn/index.jsx b/src/menu/components/table/edit-table/columns/tableIn/index.jsx
index 662c798..8079458 100644
--- a/src/menu/components/table/edit-table/columns/tableIn/index.jsx
+++ b/src/menu/components/table/edit-table/columns/tableIn/index.jsx
@@ -167,8 +167,9 @@
   }
 
   UNSAFE_componentWillMount() {
-    const { columns, cols, card } = this.props
+    const { columns, cols, card, setting } = this.props
     let _verify = fromJS(card).toJS()
+    _verify.sheet = _verify.sheet || setting.tableName
 
     let fieldLabel = {}
     let _columns = []
@@ -521,6 +522,7 @@
         sm: { span: 16 }
       }
     }
+    let isPop = sessionStorage.getItem('editMenuType') === 'popview'
 
     return (
       <div id="verify-excel-box-tab">
@@ -572,6 +574,14 @@
                     </Radio.Group>
                   </Form.Item>
                 </Col>
+                {isPop ? <Col span={8}>
+                  <Form.Item label={'鎴愬姛鍚�'}>
+                    <Radio.Group style={{whiteSpace: 'nowrap'}} value={verify.closetab || 'false'} onChange={(e) => this.onOptionChange(e.target.value, 'closetab')}>
+                      <Radio value="false">鏍囩涓嶅叧闂�</Radio>
+                      <Radio value="true">鏍囩鍏抽棴</Radio>
+                    </Radio.Group>
+                  </Form.Item>
+                </Col> : null}
               </Row>
             </Form>
           </TabPane>
diff --git a/src/menu/components/table/edit-table/index.jsx b/src/menu/components/table/edit-table/index.jsx
index addec1d..09982b8 100644
--- a/src/menu/components/table/edit-table/index.jsx
+++ b/src/menu/components/table/edit-table/index.jsx
@@ -181,14 +181,9 @@
   getStyle = (comIds, style) => {
     const { card } = this.state
 
-    if (comIds[0] !== card.uuid) return
+    if (comIds[0] !== card.uuid || comIds.length !== 1) return
 
-    let _card = {}
-    if (comIds.length === 1) {
-      _card = {...card, style}
-    } else {
-      return
-    }
+    let _card = {...card, style}
 
     this.setState({
       card: _card
diff --git a/src/menu/components/table/edit-table/options.jsx b/src/menu/components/table/edit-table/options.jsx
index 69d7d70..3dcd8b3 100644
--- a/src/menu/components/table/edit-table/options.jsx
+++ b/src/menu/components/table/edit-table/options.jsx
@@ -32,6 +32,28 @@
       required: true
     },
     {
+      type: 'number',
+      field: 'width',
+      label: '瀹藉害',
+      initval: wrap.width || 24,
+      tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��',
+      min: 1,
+      max: 24,
+      precision: 0,
+      required: true
+    },
+    {
+      type: 'number',
+      field: 'height',
+      label: '楂樺害',
+      initval: wrap.height || '',
+      tooltip: '琛ㄦ牸楂樺害锛岀┖鍊兼椂楂樺害鑷�傚簲銆�',
+      min: 10,
+      max: 3000,
+      precision: 0,
+      required: false
+    },
+    {
       type: 'radio',
       field: 'bordered',
       label: '杈规',
@@ -102,6 +124,28 @@
       ]
     },
     {
+      type: 'radio',
+      field: 'delable',
+      label: '鍙垹闄�',
+      initval: wrap.delable || 'true',
+      required: false,
+      options: [
+        {value: 'true', label: '鏄�'},
+        {value: 'false', label: '鍚�'},
+      ]
+    },
+    {
+      type: 'radio',
+      field: 'editable',
+      label: '鍒濆鍖�',
+      initval: wrap.editable || 'false',
+      required: false,
+      options: [
+        {value: 'true', label: '鍙紪杈�'},
+        {value: 'false', label: '涓嶅彲缂栬緫'},
+      ]
+    },
+    {
       type: 'color',
       field: 'borderColor',
       label: '杈规棰滆壊',
@@ -119,33 +163,11 @@
     },
     {
       type: 'number',
-      field: 'width',
-      label: '瀹藉害',
-      initval: wrap.width || 24,
-      tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��',
-      min: 1,
-      max: 24,
-      precision: 0,
-      required: true
-    },
-    {
-      type: 'number',
       field: 'fontSize',
       label: '瀛椾綋澶у皬',
       initval: wrap.fontSize || 14,
       min: 12,
       max: 30,
-      precision: 0,
-      required: false
-    },
-    {
-      type: 'number',
-      field: 'height',
-      label: '楂樺害',
-      initval: wrap.height || '',
-      tooltip: '琛ㄦ牸楂樺害锛岀┖鍊兼椂楂樺害鑷�傚簲銆�',
-      min: 10,
-      max: 3000,
       precision: 0,
       required: false
     },
diff --git a/src/menu/components/table/normal-table/options.jsx b/src/menu/components/table/normal-table/options.jsx
index 374a6bf..5ce6944 100644
--- a/src/menu/components/table/normal-table/options.jsx
+++ b/src/menu/components/table/normal-table/options.jsx
@@ -32,6 +32,29 @@
       required: true
     },
     {
+      type: 'number',
+      field: 'width',
+      label: '瀹藉害',
+      initval: wrap.width || 24,
+      tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��',
+      min: 1,
+      max: 24,
+      precision: 0,
+      required: true
+    },
+    {
+      type: 'number',
+      field: 'height',
+      label: '楂樺害',
+      initval: wrap.height || '',
+      tooltip: '琛ㄦ牸楂樺害锛岀┖鍊兼椂楂樺害鑷�傚簲銆�',
+      min: 10,
+      max: 3000,
+      precision: 0,
+      required: false,
+      forbid: appType === 'mob'
+    },
+    {
       type: 'radio',
       field: 'tableType',
       label: '琛ㄦ牸灞炴��',
@@ -147,17 +170,6 @@
     },
     {
       type: 'number',
-      field: 'width',
-      label: '瀹藉害',
-      initval: wrap.width || 24,
-      tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��',
-      min: 1,
-      max: 24,
-      precision: 0,
-      required: true
-    },
-    {
-      type: 'number',
       field: 'fontSize',
       label: '瀛椾綋澶у皬',
       initval: wrap.fontSize || 14,
@@ -165,18 +177,6 @@
       max: 30,
       precision: 0,
       required: false
-    },
-    {
-      type: 'number',
-      field: 'height',
-      label: '楂樺害',
-      initval: wrap.height || '',
-      tooltip: '琛ㄦ牸楂樺害锛岀┖鍊兼椂楂樺害鑷�傚簲銆�',
-      min: 10,
-      max: 3000,
-      precision: 0,
-      required: false,
-      forbid: appType === 'mob'
     },
     {
       type: 'number',
diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx
index f847541..c759561 100644
--- a/src/tabviews/commontable/index.jsx
+++ b/src/tabviews/commontable/index.jsx
@@ -365,6 +365,10 @@
         _columns.push(config.gridBtn)
       }
 
+      if (config.setting.selected === 'init' && config.setting.onload === 'false') {
+        config.setting.selected = 'false'
+      }
+
       this.setState({
         loadingview: false,
         absFields,
@@ -676,6 +680,15 @@
         start = pageSize * (pageIndex - 1) + 1
       }
 
+      if (setting.selected !== 'false') {
+        setTimeout(() => {
+          MKEmitter.emit('mkTableCheckTopLine', this.props.MenuID)
+        }, 200)
+        if (setting.selected === 'init') {
+          this.setState({setting: {...setting, selected: 'false'}})
+        }
+      }
+
       this.setState({
         data: result.data.map((item, index) => {
           if (absFields.length) {
diff --git a/src/tabviews/custom/components/table/edit-table/index.scss b/src/tabviews/custom/components/table/edit-table/index.scss
index 6a1b8a3..0519a10 100644
--- a/src/tabviews/custom/components/table/edit-table/index.scss
+++ b/src/tabviews/custom/components/table/edit-table/index.scss
@@ -49,6 +49,7 @@
       height: 24px;
       color: #ffffff;
       background-color: #1890ff;
+      border-width: 0;
     }
     .custom-control {
       position: absolute;
@@ -83,6 +84,7 @@
       background-color: #1890ff;
       margin-right: 15px;
       margin-bottom: 2px;
+      border-width: 0;
     }
   }
   .ant-collapse {
diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
index 58d0e67..30e8586 100644
--- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
+++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -192,6 +192,7 @@
 
   tdFocus = (id) => {
     const { col, record } = this.props
+
     if (id !== col.uuid + record.$Index) return
     this.focus()
   }
@@ -419,7 +420,8 @@
     fields: [],
     pickup: false,        // 鏀惰捣鏈�夋嫨椤�
     orderfields: {},      // 鎺掑簭id涓巉ield杞崲
-    loading: false
+    loading: false,
+    editable: 'false'
   }
 
   UNSAFE_componentWillMount () {
@@ -474,22 +476,28 @@
       if (item.type !== 'action') {
         let _copy = fromJS(_item).toJS()
         _copy.sorter = false
+
+        if (item.editable === 'true') {
+          _copy.title = <span>{item.label}<Icon className="system-color" style={{position: 'absolute', bottom: 0, right: 0}} type="edit" /></span>
+        }
         edColumns.push(_copy)
       }
       _columns.push(_item)
     })
 
-    edColumns.push({
-      align: 'center',
-      dataIndex: 'mkoperation',
-      title: '鎿嶄綔',
-      sorter: false,
-      width: 100,
-      onCell: record => ({
-        record,
-        col: {type: 'operation', tableId: tableId},
+    if (setting.delable !== 'false') {
+      edColumns.push({
+        align: 'center',
+        dataIndex: 'mkoperation',
+        title: '鎿嶄綔',
+        sorter: false,
+        width: 100,
+        onCell: record => ({
+          record,
+          col: {type: 'operation', tableId: tableId},
+        })
       })
-    })
+    }
 
     if (setting.borderColor) { // 杈规棰滆壊
       let style = `#${tableId} table, #${tableId} tr, #${tableId} th, #${tableId} td {border-color: ${setting.borderColor}}`
@@ -504,7 +512,8 @@
       edColumns,
       tableId,
       orderfields,
-      initEditLine
+      initEditLine,
+      editable: setting.editable
     })
   }
 
@@ -514,6 +523,7 @@
 
   componentDidMount () {
     const { fields, columns } = this.props
+    const { data, editable } = this.state
 
     let _fields = []
 
@@ -531,6 +541,12 @@
     this.setState({
       fields: _fields,
     })
+
+    if (editable === 'true' && data && data.length > 0) {
+      setTimeout(() => {
+        this.pickupChange()
+      }, 200)
+    }
 
     MKEmitter.addListener('nextLine', this.nextLine)
     MKEmitter.addListener('delRecord', this.delRecord)
@@ -554,6 +570,11 @@
   UNSAFE_componentWillReceiveProps(nextProps) {
     if (!is(fromJS(this.props.data), fromJS(nextProps.data))) {
       this.setState({data: nextProps.data || []})
+      if (this.state.editable === 'true') {
+        setTimeout(() => {
+          this.pickupChange()
+        }, 200)
+      }
     }
   }
   
@@ -844,6 +865,9 @@
       loading: false
     })
 
+    if (submit.closetab === 'true') {
+      MKEmitter.emit('popclose')
+    }
     if (submit.execSuccess !== 'never') {
       this.repick()
       MKEmitter.emit('refreshByButtonResult', submit.$menuId, submit.execSuccess, submit)
@@ -961,7 +985,8 @@
         data: [],
         edData: [],
         pickup,
-        loading: false
+        loading: false,
+        editable: 'false'
       }, () => {
         this.setState({
           data: data,
@@ -972,7 +997,7 @@
   }
 
   render() {
-    const { setting, statFValue, lineMarks } = this.props
+    const { setting, statFValue, lineMarks, submit } = this.props
     const { pickup, tableId, data, edData, columns, edColumns, loading } = this.state
 
     const components = {
@@ -1015,7 +1040,7 @@
     return (
       <div className={`edit-custom-table ${pickup ? 'editable' : ''} ${setting.tableHeader || ''} ${height ? 'fixed-height' : ''} ${setting.mode || ''}`} id={tableId}>
         <Switch title="缂栬緫" className="main-pickup" checkedChildren="寮�" unCheckedChildren="鍏�" checked={pickup} onChange={this.pickupChange} />
-        {pickup ? <Button onClick={() => setTimeout(() => {this.checkData()}, 10)} loading={loading} className="submit-table" type="link">鎻愪氦</Button> : null}
+        {pickup ? <Button style={submit.style} onClick={() => setTimeout(() => {this.checkData()}, 10)} loading={loading} className="submit-table" type="link">鎻愪氦</Button> : null}
         <Table
           components={components}
           style={setting.style}
diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx
index 929b19f..cc10afa 100644
--- a/src/tabviews/subtable/index.jsx
+++ b/src/tabviews/subtable/index.jsx
@@ -320,6 +320,10 @@
         })
       }
 
+      if (config.setting.selected === 'init' && config.setting.onload === 'false') {
+        config.setting.selected = 'false'
+      }
+
       this.setState({
         loadingview: false,
         chartId,
@@ -606,6 +610,15 @@
         start = pageSize * (pageIndex - 1) + 1
       }
 
+      if (setting.selected !== 'false') {
+        setTimeout(() => {
+          MKEmitter.emit('mkTableCheckTopLine', this.props.MenuID)
+        }, 200)
+        if (setting.selected === 'init') {
+          this.setState({setting: {...setting, selected: 'false'}})
+        }
+      }
+
       this.setState({
         data: result.data.map((item, index) => {
           if (absFields.length) {
diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx
index de85084..a64f042 100644
--- a/src/tabviews/subtabtable/index.jsx
+++ b/src/tabviews/subtabtable/index.jsx
@@ -294,6 +294,10 @@
         })
       }
 
+      if (config.setting.selected === 'init' && config.setting.onload === 'false') {
+        config.setting.selected = 'false'
+      }
+
       this.setState({
         loadingview: false,
         chartId,
@@ -568,6 +572,15 @@
         start = pageSize * (pageIndex - 1) + 1
       }
 
+      if (setting.selected !== 'false') {
+        setTimeout(() => {
+          MKEmitter.emit('mkTableCheckTopLine', this.props.MenuID)
+        }, 200)
+        if (setting.selected === 'init') {
+          this.setState({setting: {...setting, selected: 'false'}})
+        }
+      }
+
       this.setState({
         data: result.data.map((item, index) => {
           if (absFields.length) {
diff --git a/src/tabviews/zshare/actionList/popupbutton/index.jsx b/src/tabviews/zshare/actionList/popupbutton/index.jsx
index 779669f..0705de6 100644
--- a/src/tabviews/zshare/actionList/popupbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/popupbutton/index.jsx
@@ -54,6 +54,7 @@
   }
 
   componentDidMount () {
+    MKEmitter.addListener('popclose', this.popclose)
     MKEmitter.addListener('triggerBtnId', this.actionTrigger)
     MKEmitter.addListener('openNewTab', this.openNewTab)
     MKEmitter.addListener('refreshPopButton', this.refreshPopButton)
@@ -81,6 +82,7 @@
     this.setState = () => {
       return
     }
+    MKEmitter.removeListener('popclose', this.popclose)
     MKEmitter.removeListener('openNewTab', this.openNewTab)
     MKEmitter.removeListener('triggerBtnId', this.actionTrigger)
     MKEmitter.removeListener('refreshPopButton', this.refreshPopButton)
@@ -264,7 +266,7 @@
             BID={popData ? primaryId : this.props.BID}
             BData={popData || this.props.BData}
           /> : null}
-          {btn.$view === 'CustomPage' ? <CustomPage Tab={btn} MenuID={btn.uuid} param={{$BID: (popData ? primaryId : this.props.BID), ...(popData || this.props.BData || {})}} /> : null}
+          {btn.$view === 'CustomPage' ? <CustomPage Tab={btn} MenuName={btn.label} MenuID={btn.uuid} param={{$BID: (popData ? primaryId : this.props.BID), ...(popData || this.props.BData || {})}} /> : null}
           <div className="close-drawer">
             <Button onClick={this.popclose}>
               鍏抽棴
diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx
index 56a792b..02a78f8 100644
--- a/src/tabviews/zshare/normalTable/index.jsx
+++ b/src/tabviews/zshare/normalTable/index.jsx
@@ -237,6 +237,7 @@
 
   componentDidMount () {
     MKEmitter.addListener('resetTable', this.resetTable)
+    MKEmitter.addListener('mkTableCheckTopLine', this.mkTableCheckTopLine)
   }
 
   /**
@@ -247,6 +248,15 @@
       return
     }
     MKEmitter.removeListener('resetTable', this.resetTable)
+    MKEmitter.removeListener('mkTableCheckTopLine', this.mkTableCheckTopLine)
+  }
+
+  mkTableCheckTopLine = (id) => {
+    if (id !== this.props.MenuID) return
+
+    if (this.props.data.length > 0) {
+      this.changeRow(null, 0)
+    }
   }
 
   // 瀛楁閫忚
diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx
index 2f6e6e5..4ad72d8 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx
@@ -308,7 +308,7 @@
               <Select
                 showSearch
                 filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
-                onChange={this.selectScript}
+                onSelect={this.selectScript}
                 getPopupContainer={() => document.getElementById('verify-excelin-custom-scripts')}
               >
                 <Select.Option key="default" value={'default'}>
diff --git a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx
index 9919da3..67b0e77 100644
--- a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx
+++ b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx
@@ -28,6 +28,7 @@
     interType: 'system',
     procMode: 'script',
     requestMode: 'system',
+    tableType: '',
     funcTooltip: '',
     funcRules: []
   }
@@ -64,6 +65,7 @@
       interType: setting.interType || 'system',
       procMode: setting.procMode || 'script',
       requestMode: setting.requestMode || 'system',
+      tableType: setting.tableType,
       funcTooltip: tooltip,
       funcRules: rules
     })
@@ -192,7 +194,7 @@
   render() {
     const { setting, dict, menu, config, columns } = this.props
     const { getFieldDecorator } = this.props.form
-    const { interType, funcRules, funcTooltip, procMode, requestMode } = this.state
+    const { interType, funcRules, funcTooltip, procMode, requestMode, tableType } = this.state
 
     const formItemLayout = {
       labelCol: {
@@ -231,7 +233,7 @@
                 {getFieldDecorator('tableType', {
                   initialValue: setting.tableType
                 })(
-                  <Radio.Group>
+                  <Radio.Group onChange={(e) => this.setState({tableType: e.target.value})}>
                     <Radio value="">涓嶅彲閫�</Radio>
                     <Radio value="radio">鍗曢��</Radio>
                     <Radio value="checkbox">澶氶��</Radio>
@@ -693,6 +695,23 @@
                 </Radio.Group>)}
               </Form.Item>
             </Col>
+            {tableType !== '' ? <Col span={12}>
+              <Form.Item label={
+                <Tooltip placement="topLeft" title="鍦ㄥ惎鐢ㄦ棤浜哄�煎畧鍔熻兘鏃舵棤鏁堛��">
+                  <Icon type="question-circle" />
+                  棣栬閫変腑
+                </Tooltip>
+              }>
+                {getFieldDecorator('selected', {
+                  initialValue: setting.selected || 'false'
+                })(
+                <Radio.Group>
+                  <Radio value="false">鏃�</Radio>
+                  <Radio value="init">鍒濆鍖�</Radio>
+                  <Radio value="always">鏁版嵁鍔犺浇</Radio>
+                </Radio.Group>)}
+              </Form.Item>
+            </Col> : null}
             <Col span={12}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title="楂樼骇鎼滅储寮圭獥鐨勫搴︼紝娉細褰撳搴﹀�煎皬浜�100鏃惰〃绀哄崰绐楀彛鐨勭櫨鍒嗘瘮锛屽ぇ浜�100鏃惰〃绀哄搴︾殑缁濆鍊笺��">
diff --git a/src/templates/zshare/verifycard/customscript/index.jsx b/src/templates/zshare/verifycard/customscript/index.jsx
index a5a1162..1b758d4 100644
--- a/src/templates/zshare/verifycard/customscript/index.jsx
+++ b/src/templates/zshare/verifycard/customscript/index.jsx
@@ -271,9 +271,8 @@
             <Form.Item label={'蹇嵎娣诲姞'} style={{marginBottom: 0}}>
               <Select
                 showSearch
-                allowClear
                 filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
-                onChange={this.selectScript}
+                onSelect={this.selectScript}
                 getPopupContainer={() => document.getElementById('verify-custom-scripts')}
               >
                 <Select.Option key="default" value={this.props.defaultsql}>榛樿sql</Select.Option>
diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js
index ee48e7c..a5f307f 100644
--- a/src/utils/utils-custom.js
+++ b/src/utils/utils-custom.js
@@ -274,8 +274,8 @@
           uuids.push(act.uuid)
         })
 
-        if (card.type === 'card' || item.type === 'carousel' || (card.type === 'table' && card.subtype === 'tablecard')) {
-          card.subcards.forEach(_card => {
+        if (item.type === 'card' || item.type === 'carousel' || (item.type === 'table' && item.subtype === 'tablecard')) {
+          item.subcards.forEach(_card => {
             _card.elements && _card.elements.forEach(cell => {
               if (cell.eleType !== 'button') return
               if (appType === 'pc' && cell.OpenType !== 'popview') return
@@ -289,8 +289,8 @@
               uuids.push(cell.uuid)
             })
           })
-        } else if (card.type === 'table' && card.subtype === 'normaltable') {
-          card.cols && card.cols.forEach(col => {
+        } else if (item.type === 'table' && (item.subtype === 'normaltable' || item.subtype === 'editable')) {
+          item.cols && item.cols.forEach(col => {
             if (col.type !== 'action') return
             col.elements && col.elements.forEach(cell => {
               if (appType === 'pc' && cell.OpenType !== 'popview') return
@@ -298,8 +298,8 @@
               uuids.push(cell.uuid)
             })
           })
-        } else if (card.type === 'balcony') {
-          card.elements && card.elements.forEach(cell => {
+        } else if (item.type === 'balcony') {
+          item.elements && item.elements.forEach(cell => {
             if (appType === 'pc' && cell.OpenType !== 'popview') return
 
             uuids.push(cell.uuid)
@@ -386,7 +386,7 @@
             return cell
           })
         }
-      } else if (item.type === 'table' && item.subtype === 'normaltable' && item.cols) {
+      } else if (item.type === 'table' && (item.subtype === 'normaltable' || item.subtype === 'editable') && item.cols) {
         let loopCol = (col) => {
           col.subcols = col.subcols.map(c => {
             c.uuid = this.getuuid()
@@ -409,9 +409,12 @@
   
           return col
         }
-  
+        let _uuids = {}
         item.cols = item.cols.map(col => {
-          col.uuid = this.getuuid()
+          let uuid = this.getuuid()
+
+          _uuids[col.uuid] = uuid
+          col.uuid = uuid
   
           if (col.type === 'colspan' && col.subcols) {
             col = loopCol(col)
@@ -428,6 +431,15 @@
           }
           return col
         })
+
+        if (item.subtype === 'editable') {
+          item.cols = item.cols.map(col => {
+            if (col.editable === 'true' && col.enter && _uuids[col.enter]) {
+              col.enter = _uuids[col.enter]
+            }
+            return col
+          })
+        }
       }
   
       if (item.btnlog) {
@@ -582,7 +594,7 @@
           return cell
         })
       }
-    } else if (item.type === 'table' && item.subtype === 'normaltable' && item.cols) {
+    } else if (item.type === 'table' && (item.subtype === 'normaltable' || item.subtype === 'editable') && item.cols) {
       let loopCol = (col) => {
         col.subcols = col.subcols.map(c => {
           c.uuid = this.getuuid()
@@ -601,8 +613,12 @@
         return col
       }
 
+      let _uuids = {}
       item.cols = item.cols.map(col => {
-        col.uuid = this.getuuid()
+        let uuid = this.getuuid()
+
+        _uuids[col.uuid] = uuid
+        col.uuid = uuid
 
         if (col.type === 'colspan' && col.subcols) {
           col = loopCol(col)
@@ -629,6 +645,15 @@
         }
         return col
       })
+
+      if (item.subtype === 'editable') {
+        item.cols = item.cols.map(col => {
+          if (col.editable === 'true' && col.enter && _uuids[col.enter]) {
+            col.enter = _uuids[col.enter]
+          }
+          return col
+        })
+      }
     } else if (item.type === 'form') {
       item.subcards = item.subcards.map(cell => {
         cell.uuid = this.getuuid()
diff --git a/src/views/menudesign/menuform/index.jsx b/src/views/menudesign/menuform/index.jsx
index 09643fe..598a89e 100644
--- a/src/views/menudesign/menuform/index.jsx
+++ b/src/views/menudesign/menuform/index.jsx
@@ -65,7 +65,8 @@
                     value: trd.MenuID,
                     label: trd.MenuName,
                     type: 'CommonTable',
-                    disabled: trd.MenuID === MenuId
+                    // disabled: trd.MenuID === MenuId
+                    disabled: false
                   }
 
                   if (MenuId === trd.MenuID) {

--
Gitblit v1.8.0