<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                # JS增強觸發彈窗表單 >[info] JS增強觸發彈出的表單可以是 `online表單` 也可以是 `自定義開發的表單`。 [TOC=2,3] ## 使用說明 - 支持按鈕 :按鈕樣式[button]+按鈕類型[js] 或者 按鈕樣式[link]+按鈕類型[js] - js增強彈框方法:`this.openCustomModal`,方法參數如下表 | 參數名 | 類型| 描述 | | --- | --- | --- | | title |string | 彈框標題,默認 '自定義彈框' | | width| int| 彈框寬度,默認600 | | row | object| 操作的數據,如果是button按鈕,不設置則默認為當前選中行的數據,如果是link按鈕,需要傳入函數自帶參數row | | **formComponent**| string | **自定義彈框內表單組件地址**,設置的格式和系統菜單組件值的配置一樣,如果沒有設置,則彈框默認打開的是當前表單 | | requestUrl| string | 表單提交地址,如不設置,則默認表單提交地址為原online編輯地址,formComponent未設置時生效 | | hide|array| 隱藏的表單控件名, formComponent未設置時生效,可以使原表單的某些控件隱藏 | | show|array| 顯示的表單控件名, formComponent未設置時生效 ,如果設置,hide參數失效(show與hide互斥),且只有該數組內的控件才會顯示 | ## 具體場景 ### 場景一、button按鈕觸發彈窗online表單 1.添加按鈕:按鈕樣式[button],按鈕類型[js],按鈕編碼`test1`對應增強函數名 ![](https://img.kancloud.cn/a1/e4/a1e4301e982aa28a3c94144a0f1bb51c_792x404.png) 2.添加 list頁面的js增強 ``` test1(){ this.openCustomModal({ title: '測試自定義彈框1', width: 800 }); } ``` 3.效果演示 ![](https://img.kancloud.cn/3e/ba/3eba8207a1cfd3050af360164b8b18c3_1924x756.png) ------- ### 場景二、link按鈕觸發彈窗online表單,并控制字段顯隱 1.添加按鈕:按鈕樣式\[link\],按鈕類型\[js\],按鈕編碼`test2`對應增強函數名 ![](https://img.kancloud.cn/4b/9e/4b9e36ca72965607d31e8ff09b580880_788x469.png) 2.添加 list頁面的js增強 ``` test2(row){ this.openCustomModal({ row: row, title: '測試自定義彈框2', width: 800, hide: ['age', 'sex'] }); } ``` 3.效果演示 ![](https://img.kancloud.cn/69/04/690428413ccb3b2f14714df6983cdbc6_1890x756.png) >[info] link按鈕和button的區別在于,link按鈕需要手動傳入參數:row,button按鈕默認不需要傳入,但是操作的時候需要先選中數據。 ----- ### 場景三、button按鈕觸發彈窗渲染自定義開發頁面 >[info] 目前自定義開發頁面,開源版本暫時不支持。 1.添加按鈕:按鈕樣式[button],按鈕類型[js],按鈕編碼`test3`對應增強函數名 ![](https://img.kancloud.cn/78/d0/78d08c84541c9843ac73abcf10052005_786x451.png) 2.添加 list頁面的js增強 ``` test3(){ this.openCustomModal({ formComponent: 'demo/hello/index.vue', title: '測試自定義彈框3', width: 800 }); } ``` 3.效果演示 ![](https://img.kancloud.cn/b0/91/b091bcf0c66e4c034be49e40ccd93948_1890x756.png) **備注:** 上述formComponent用到一個自定義的表單頁 文件地址:`src/views/demo/hello/index.vue` 文件內容: ``` <template> <a-form :labelCol="{span:3}"> <a-form-item label="名稱" > <a-input placeholder="請輸入名稱" v-model:value="name"/> </a-form-item> </a-form> </template> <script> import { ref, onMounted } from 'vue' import { defHttp } from '/@/utils/http/axios' import { useMessage } from '/@/hooks/web/useMessage'; export default { name: "hello", props: { // 行數據 row: { type: Object, default: () => { }, required: false }, // 該地址是online默認的編輯提交地址 如不滿足要求需自定義 url: { type: String, default: '', required: false } }, setup(props, {emit}) { const name = ref('') const { createMessage } = useMessage(); onMounted(() => { name.value = props.row.name }); /** * 自定義的表單頁面 彈窗確定按鈕觸發函數名必須寫:handleSubmit */ function handleSubmit() { let params = Object.assign({}, props.row, { name: name.value }); defHttp.put({ url: props.url, params }, { isTransformResponse: false }).then((res) => { if (res.success) { // 提交完畢 關閉彈窗 調用事件:emit('close') emit('close') } else { createMessage.warning(res.message) } }); } return { name, handleSubmit } } } </script> ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看