検索バーをカスタマイズし、ボタンを使用して検索バーを折りたたみます。カスタマイズ効果は以下のとおりです。 折りたたむ前: 折り畳んだ後: 1. 検索バーの内容をカスタマイズする実際、これも簡単です。対応する vue ファイル \src\views\admin\sysxxfsjl.vue のテンプレートの slot-scope="scope" 属性と slot="search" 属性を設定するだけで、検索バーの内容をカスタマイズできます。 <テンプレート スロット スコープ="スコープ" スロット="検索"> <el-form ref="form" :model="searchForm" style="width: 830px;margin-left: -10px; display: inline-block;" label-width="100px"> <el-行> <el-form-item label="件名:"> <el-input v-model="searchForm.xxbt" style="width: 238px;margin-left: -100px" @change="getList()"></el-input> </el-form-item> <el-form-item label="送信者:"> <エルカスケーダー v-model="fsrid" :options="オプション" クリア可能 スタイル="幅: 242px !important;左マージン: -100px" :props="{ expandTrigger: 'hover' }" @change="getList()"></el-cascader> </el-form-item> </el-row> <el-row v-show="続きを表示"> <el-form-item label="送信時間:"> <el-日付ピッカー スタイル="幅: 238px !重要; 左余白: -100px" v-model="timeSlot" タイプ="日付範囲" align="right" パネルのリンクを解除 フォーマット="yyyy-MM-dd HH:mm:ss" 値の形式="yyyy-MM-dd HH:mm:ss" 範囲区切り文字="to" start-placeholder="開始日" end-placeholder="終了日" :picker-options="ピッカーオプション" @change="getList()"> </el-date-picker> </el-form-item> <el-form-item label="メソッド:" > <el-radio-group v-model="searchForm.fsfs" size="small" style="margin-left: -100px" @change="getList()"> <el-radio-button label="4">システムメッセージ</el-radio-button> <el-radio-button label="1">モバイル SMS</el-radio-button> <el-radio-button label="3">WeChat 経由で送信</el-radio-button> </el-ラジオグループ> </el-form-item> </el-row> <el-row v-show="続きを表示"> <el-form-item label="読み取りステータス:"> <el-radio-group v-model="sfyd" size="small" style="margin-left: -100px;width: 238px" @change="getList()"> <el-radio-button label="2">すべて</el-radio-button> <el-radio-button label="1">読む</el-radio-button> <el-radio-button label="0">未読</el-radio-button> </el-ラジオグループ> </el-form-item> <el-form-item label="ToDo に転送:"> <el-radio-group v-model="チェックリスト" スタイル="margin-left: -100px" @change="getList()"> <el-radio-button label="1">はい</el-radio-button> <el-radio-button label="0">いいえ</el-radio-button> </el-ラジオグループ> </el-form-item> </el-row> </el-form> </テンプレート> 検索ボタンはgetListのメソッドを呼び出してテーブルにデータを割り当てます getList(ページ、パラメータ) { this.tableData = [] if (this.timeSlot && this.timeSlot.length == 2){//送信時間 this.searchForm.startTime = this.timeSlot[0].replace(/\+/g, ' ') this.searchForm.endTime = this.timeSlot[1].replace(/\+/g, ' ') }それ以外 { this.searchForm.startTime を削除します this.searchForm.endTime を削除します } if (this.fsrid.length){//送信者 this.searchForm.fsrid = this.fsrid[this.fsrid.length-1] }それ以外 { this.searchForm.fsrid を削除します } if (this.sfyd.length>0){//ToDoに転送するかどうか if (this.sfyd== 1){ this.searchForm.sfyd = 1 }それ以外の場合 (this.sfyd == 0){ this.searchForm.sfyd = 0 }それ以外 { this.searchForm.sfyd を削除します } }それ以外 { this.searchForm.sfyd を削除します } if (this.checkList!=''){//ToDoに転送するかどうか if (this.checkList== '1'){ this.searchForm.sfdb = 1 }それ以外 { this.searchForm.sfdb = 0 } }それ以外 { this.searchForm.sfdb を削除します } ページの場合 ページ = this.page } this.tableLoading = true fetchList(オブジェクト.assign({ 現在の: page.currentPage、 サイズ: page.pageSize }, パラメータ、this.searchForm )).then(response => { for(var i=0;i<response.data.data.records.length;i++){ レスポンス.データ.データ.レコード[i].チェックボックス=[] if(response.data.data.records[i].sfyd==0){ response.data.data.records[i].checkbox.push('未読') }それ以外{ レスポンス.data.data.records[i].checkbox.push('read') } if(response.data.data.records[i].sfdb==1){ response.data.data.records[i].checkbox.push('実行予定') } if(response.data.data.records[i].sfsc==1){ response.data.data.records[i].checkbox.push('コレクション') } if(response.data.data.records[i].sfhf==1){ response.data.data.records[i].checkbox.push('返信しました') } if(response.data.data.records[i].xxfjmc){ レスポンス.データ.データ.レコード[i].xxfjmc=レスポンス.データ.データ.レコード[i].xxfjmc.split(',') }それ以外{ レスポンス.データ.データ.レコード[i].xxfjmc=[] } this.tableData.push(レスポンスデータ.データ.レコード[i]) } this.page.total = レスポンスデータデータ合計 this.tableLoading = false }).catch(() => { this.tableLoading=false }) }, 2. 検索ボタンをカスタマイズするテンプレート slot-scope="scope" および slot="searchMenu" 属性を設定すると、検索ボタンをカスタマイズし、さらにボタンを追加できます。 <テンプレート スロット スコープ="スコープ" スロット="検索メニュー"> <el-button v-if="moreshow" type="success" class="el-button--small" icon="el-icon-caret-top" @click="getmoreshow(1)">非表示</el-button> <el-button v-else class="el-button--small" icon="el-icon-caret-bottom" @click="getmoreshow(2)">もっと見る</el-button> </テンプレート> 詳細ボタンと非表示ボタンは、検索項目を表示または非表示にするメソッドを呼び出します。 getmoreshow(タイプ){ if(type==1){ this.moreshow=false }それ以外{ this.moreshow=true } }, ボタンをクリアするには、avue-crud に @search-reset イベントを追加します。オプションをクリアし、this.getList(this.page); を呼び出します。 //検索クリアボタンイベント searchReset(){ this.searchForm = {} this.searchForm.sfyd = '' if (this.searchForm.sfyd!=''){//ToDoに転送するかどうか if (this.searchForm.sfyd== '1'){ this.searchForm.sfyd = 1 }それ以外 { this.searchForm.sfyd = 0 } }それ以外 { this.searchForm.sfyd を削除します } this.fsrid = [] this.timeSlot = [] this.checkList = '' this.sfyd = '' this.$refs.crud.toggleSelection(); this.getList(このページ); }, この記事は、Avue のカスタム検索バーの実装と検索イベントのクリアの実践について説明したもので、これで終わりです。Avue のカスタム検索バーと検索コンテンツのクリアに関する詳細については、123WORDPRESS.COM の以前の記事を検索するか、以下の関連記事を引き続き参照してください。今後とも 123WORDPRESS.COM をよろしくお願いいたします。 以下もご興味があるかもしれません:
|
<<: CSSの幅と高さのデフォルト値の詳細な説明:autoと%
>>: Firefoxでリンクをクリックしたときに点線の枠線を削除する方法
1. Docker環境を構築する1. Dockerfileを作成する Centos:latest か...
まず、MySQLをskip-grant-tablesモードで起動します: mysqld --skip...
目次ブラウザ同一生成元ポリシー1. VUEフロントエンド構成プロキシはクロスドメインの問題を解決しま...
この記事では、Element-uiを使用してメニューナビゲーションを実装するVueの具体的なコードを...
目次バイト機能使用環境プロジェクトを構築する構成vite.config.ts tsconfig.js...
1. オンラインインストール現在、Linux x86アーキテクチャのオンラインインストールのみを試し...
目次概要プロパティ設定処理ロジック概要具体的な需要シナリオは次のとおりです。 Excel ファイルを...
Yum経由でJenkinsをインストールする1. インストール # yum ソースをインポート wg...
目次ディレクトリ構造binディレクトリconfディレクトリlibディレクトリwebapps ディレク...
スプライトカウダウンロード CSS リントダウンロード プレフィックスダウンロード 1140px C...
目次PagodaをインストールするPythonランタイム環境を構成するPythonをインストールする...
最近、業務上のボタンの増加により、ページレイアウトにボタンが多すぎて、ページが美しくなく、ユーザーエ...
この記事では、例を使用して、replace と regexp を使用して MySQL で正規表現を置...
目次Tomcat ダウンロードチュートリアルTomcat インストールチュートリアルTomcat の...
目次1. テスト環境1.1 CentOS 7をインストールする1.2 Docker CE 19.03...