全局搜素框增加自动聚焦功能
Showing
14 changed files
with
56 additions
and
7 deletions
| ... | @@ -61,6 +61,13 @@ var self = new Vue({ | ... | @@ -61,6 +61,13 @@ var self = new Vue({ |
| 61 | isActive:1, | 61 | isActive:1, |
| 62 | } | 62 | } |
| 63 | }, | 63 | }, |
| 64 | directives:{ | ||
| 65 | focus: { | ||
| 66 | inserted:function f(el) { | ||
| 67 | el.focus() | ||
| 68 | } | ||
| 69 | } | ||
| 70 | }, | ||
| 64 | methods:{ | 71 | methods:{ |
| 65 | handleSizeChange(){ | 72 | handleSizeChange(){ |
| 66 | 73 | ... | ... |
| ... | @@ -113,7 +113,7 @@ | ... | @@ -113,7 +113,7 @@ |
| 113 | <div style="float: right" class="div-search"> | 113 | <div style="float: right" class="div-search"> |
| 114 | <!-- <el-input style="width:300px;margin-right: 20px" placeholder="请输入搜索的内容"></el-input>--> | 114 | <!-- <el-input style="width:300px;margin-right: 20px" placeholder="请输入搜索的内容"></el-input>--> |
| 115 | <!-- <el-button type ="primary" size="mini" icon="el-icon-search">查询</el-button>--> | 115 | <!-- <el-button type ="primary" size="mini" icon="el-icon-search">查询</el-button>--> |
| 116 | <input id="searchInput" type="text" placeholder="搜索待办项目" style="width: 82%;" v-model="search" @keyup.enter="SearchInfo"> | 116 | <input id="searchInput" type="text" placeholder="搜索待办项目" style="width: 82%;" v-model="search" @keyup.enter="SearchInfo" v-focus> |
| 117 | <img id="searchBtn" src="../../../../image/projecttask/search.png" style="margin-right: 10px; margin-top: 4px; width: 20px; height: 20px; float: right;"> | 117 | <img id="searchBtn" src="../../../../image/projecttask/search.png" style="margin-right: 10px; margin-top: 4px; width: 20px; height: 20px; float: right;"> |
| 118 | </div> | 118 | </div> |
| 119 | </div> | 119 | </div> | ... | ... |
| ... | @@ -32,6 +32,13 @@ var self = new Vue({ | ... | @@ -32,6 +32,13 @@ var self = new Vue({ |
| 32 | return `${y}-${m}-${d} ${hh}:${mm}:${ss}` | 32 | return `${y}-${m}-${d} ${hh}:${mm}:${ss}` |
| 33 | } | 33 | } |
| 34 | }, | 34 | }, |
| 35 | directives:{ | ||
| 36 | focus: { | ||
| 37 | inserted:function f(el) { | ||
| 38 | el.focus() | ||
| 39 | } | ||
| 40 | } | ||
| 41 | }, | ||
| 35 | methods: { | 42 | methods: { |
| 36 | getData() { | 43 | getData() { |
| 37 | axios.post(CONF_NEWGHSC_SERVERURL + '/dblb/list/workings', null,{ | 44 | axios.post(CONF_NEWGHSC_SERVERURL + '/dblb/list/workings', null,{ | ... | ... |
| ... | @@ -115,7 +115,7 @@ | ... | @@ -115,7 +115,7 @@ |
| 115 | <div style="float: right" class="div-search" > | 115 | <div style="float: right" class="div-search" > |
| 116 | <!-- <el-input style="width:300px;margin-right: 20px" placeholder="请输入搜索的内容"></el-input>--> | 116 | <!-- <el-input style="width:300px;margin-right: 20px" placeholder="请输入搜索的内容"></el-input>--> |
| 117 | <!-- <el-button type ="primary" size="mini" icon="el-icon-search">查询</el-button>--> | 117 | <!-- <el-button type ="primary" size="mini" icon="el-icon-search">查询</el-button>--> |
| 118 | <input id="searchInput" type="text" placeholder="搜索待办项目" style="width: 82%;" v-model="search" @keyup.enter="SearchInfo"> | 118 | <input id="searchInput" type="text" placeholder="搜索待办项目" style="width: 82%;" v-model="search" @keyup.enter="SearchInfo" v-focus> |
| 119 | <img id="searchBtn" src="../../../../image/projecttask/search.png" style="margin-right: 10px; margin-top: 4px; width: 20px; height: 20px; float: right;"> | 119 | <img id="searchBtn" src="../../../../image/projecttask/search.png" style="margin-right: 10px; margin-top: 4px; width: 20px; height: 20px; float: right;"> |
| 120 | </div> | 120 | </div> |
| 121 | </div> | 121 | </div> | ... | ... |
| ... | @@ -61,6 +61,13 @@ var self = new Vue({ | ... | @@ -61,6 +61,13 @@ var self = new Vue({ |
| 61 | isActive:1, | 61 | isActive:1, |
| 62 | } | 62 | } |
| 63 | }, | 63 | }, |
| 64 | directives:{ | ||
| 65 | focus: { | ||
| 66 | inserted:function f(el) { | ||
| 67 | el.focus() | ||
| 68 | } | ||
| 69 | } | ||
| 70 | }, | ||
| 64 | methods:{ | 71 | methods:{ |
| 65 | handleSizeChange(){ | 72 | handleSizeChange(){ |
| 66 | 73 | ... | ... |
| ... | @@ -113,7 +113,7 @@ | ... | @@ -113,7 +113,7 @@ |
| 113 | <div style="float: right" class="div-search"> | 113 | <div style="float: right" class="div-search"> |
| 114 | <!-- <el-input style="width:300px;margin-right: 20px" placeholder="请输入搜索的内容"></el-input>--> | 114 | <!-- <el-input style="width:300px;margin-right: 20px" placeholder="请输入搜索的内容"></el-input>--> |
| 115 | <!-- <el-button type ="primary" size="mini" icon="el-icon-search">查询</el-button>--> | 115 | <!-- <el-button type ="primary" size="mini" icon="el-icon-search">查询</el-button>--> |
| 116 | <input id="searchInput" type="text" placeholder="搜索待办项目" style="width: 82%;" v-model="search" @keyup.enter="SearchInfo"> | 116 | <input id="searchInput" type="text" placeholder="搜索待办项目" style="width: 82%;" v-model="search" @keyup.enter="SearchInfo" v-focus> |
| 117 | <img id="searchBtn" src="../../../../image/projecttask/search.png" style="margin-right: 10px; margin-top: 4px; width: 20px; height: 20px; float: right;"> | 117 | <img id="searchBtn" src="../../../../image/projecttask/search.png" style="margin-right: 10px; margin-top: 4px; width: 20px; height: 20px; float: right;"> |
| 118 | </div> | 118 | </div> |
| 119 | </div> | 119 | </div> | ... | ... |
| ... | @@ -83,6 +83,13 @@ var self = new Vue({ | ... | @@ -83,6 +83,13 @@ var self = new Vue({ |
| 83 | return `${y}-${m}-${d} ${hh}:${mm}:${ss}` | 83 | return `${y}-${m}-${d} ${hh}:${mm}:${ss}` |
| 84 | } | 84 | } |
| 85 | }, | 85 | }, |
| 86 | directives:{ | ||
| 87 | focus: { | ||
| 88 | inserted:function f(el) { | ||
| 89 | el.focus() | ||
| 90 | } | ||
| 91 | } | ||
| 92 | }, | ||
| 86 | methods:{ | 93 | methods:{ |
| 87 | getData() { | 94 | getData() { |
| 88 | axios.get(CONF_NEWGHSC_SERVERURL + '/dblb/list/worked', { | 95 | axios.get(CONF_NEWGHSC_SERVERURL + '/dblb/list/worked', { | ... | ... |
| ... | @@ -119,7 +119,7 @@ | ... | @@ -119,7 +119,7 @@ |
| 119 | <div style="float: right" class="div-search"> | 119 | <div style="float: right" class="div-search"> |
| 120 | <!-- <el-input style="width:300px;margin-right: 20px" placeholder="请输入搜索的内容"></el-input>--> | 120 | <!-- <el-input style="width:300px;margin-right: 20px" placeholder="请输入搜索的内容"></el-input>--> |
| 121 | <!-- <el-button type ="primary" size="mini" icon="el-icon-search">查询</el-button>--> | 121 | <!-- <el-button type ="primary" size="mini" icon="el-icon-search">查询</el-button>--> |
| 122 | <input id="searchInput" type="text" placeholder="搜索待办项目" style="width: 82%;" v-model="search" @keyup.enter="SearchInfo"> | 122 | <input id="searchInput" type="text" placeholder="搜索待办项目" style="width: 82%;" v-model="search" @keyup.enter="SearchInfo" v-focus> |
| 123 | <img id="searchBtn" src="../../../../image/projecttask/search.png" style="margin-right: 10px; margin-top: 4px; width: 20px; height: 20px; float: right;"> | 123 | <img id="searchBtn" src="../../../../image/projecttask/search.png" style="margin-right: 10px; margin-top: 4px; width: 20px; height: 20px; float: right;"> |
| 124 | </div> | 124 | </div> |
| 125 | </div> | 125 | </div> | ... | ... |
| ... | @@ -36,6 +36,13 @@ var self = new Vue({ | ... | @@ -36,6 +36,13 @@ var self = new Vue({ |
| 36 | return `${y}-${m}-${d} ${hh}:${mm}:${ss}` | 36 | return `${y}-${m}-${d} ${hh}:${mm}:${ss}` |
| 37 | } | 37 | } |
| 38 | }, | 38 | }, |
| 39 | directives:{ | ||
| 40 | focus: { | ||
| 41 | inserted:function f(el) { | ||
| 42 | el.focus() | ||
| 43 | } | ||
| 44 | } | ||
| 45 | }, | ||
| 39 | methods:{ | 46 | methods:{ |
| 40 | handleSizeChange(){ | 47 | handleSizeChange(){ |
| 41 | 48 | ... | ... |
| ... | @@ -115,7 +115,7 @@ | ... | @@ -115,7 +115,7 @@ |
| 115 | </el-col> | 115 | </el-col> |
| 116 | <el-col :span="6"> | 116 | <el-col :span="6"> |
| 117 | <div class="div-search"> | 117 | <div class="div-search"> |
| 118 | <input id="searchInput" type="text" placeholder="搜索待办项目" style="width: 82%;" v-model="search" @keyup.enter="SearchInfo"> | 118 | <input id="searchInput" type="text" placeholder="搜索待办项目" style="width: 82%;" v-model="search" @keyup.enter="SearchInfo" v-focus> |
| 119 | <img id="searchBtn" src="../../../../image/projecttask/search.png" style="margin-right: 10px; margin-top: 4px; width: 20px; height: 20px; float: right;"> | 119 | <img id="searchBtn" src="../../../../image/projecttask/search.png" style="margin-right: 10px; margin-top: 4px; width: 20px; height: 20px; float: right;"> |
| 120 | </div> | 120 | </div> |
| 121 | </el-col> | 121 | </el-col> | ... | ... |
| ... | @@ -33,6 +33,13 @@ var self = new Vue({ | ... | @@ -33,6 +33,13 @@ var self = new Vue({ |
| 33 | return `${y}-${m}-${d} ${hh}:${mm}:${ss}` | 33 | return `${y}-${m}-${d} ${hh}:${mm}:${ss}` |
| 34 | } | 34 | } |
| 35 | }, | 35 | }, |
| 36 | directives:{ | ||
| 37 | focus: { | ||
| 38 | inserted:function f(el) { | ||
| 39 | el.focus() | ||
| 40 | } | ||
| 41 | } | ||
| 42 | }, | ||
| 36 | methods:{ | 43 | methods:{ |
| 37 | getData() { | 44 | getData() { |
| 38 | axios.get(CONF_NEWGHSC_SERVERURL + '/dblb/list/worked', { | 45 | axios.get(CONF_NEWGHSC_SERVERURL + '/dblb/list/worked', { | ... | ... |
| ... | @@ -115,7 +115,7 @@ | ... | @@ -115,7 +115,7 @@ |
| 115 | </el-col> | 115 | </el-col> |
| 116 | <el-col :span="6"> | 116 | <el-col :span="6"> |
| 117 | <div class="div-search"> | 117 | <div class="div-search"> |
| 118 | <input id="searchInput" type="text" placeholder="搜索已办项目" style="width: 82%;" v-model="search" @keyup.enter="SearchInfo"> | 118 | <input id="searchInput" type="text" placeholder="搜索已办项目" style="width: 82%;" v-model="search" @keyup.enter="SearchInfo" v-focus> |
| 119 | <img id="searchBtn" src="../../../../image/projecttask/search.png" style="margin-right: 10px; margin-top: 4px; width: 20px; height: 20px; float: right;"> | 119 | <img id="searchBtn" src="../../../../image/projecttask/search.png" style="margin-right: 10px; margin-top: 4px; width: 20px; height: 20px; float: right;"> |
| 120 | </div> | 120 | </div> |
| 121 | </el-col> | 121 | </el-col> | ... | ... |
| ... | @@ -41,6 +41,13 @@ var self = new Vue({ | ... | @@ -41,6 +41,13 @@ var self = new Vue({ |
| 41 | mounted(){ | 41 | mounted(){ |
| 42 | this.getData(); | 42 | this.getData(); |
| 43 | }, | 43 | }, |
| 44 | directives:{ | ||
| 45 | focus: { | ||
| 46 | inserted:function f(el) { | ||
| 47 | el.focus() | ||
| 48 | } | ||
| 49 | } | ||
| 50 | }, | ||
| 44 | methods:{ | 51 | methods:{ |
| 45 | getData() { | 52 | getData() { |
| 46 | axios.get(CONF_NEWGHSC_SERVERURL + '/ghjg/backlog/'+this.pageNum+'/'+this.pageSize, { | 53 | axios.get(CONF_NEWGHSC_SERVERURL + '/ghjg/backlog/'+this.pageNum+'/'+this.pageSize, { | ... | ... |
| ... | @@ -116,7 +116,7 @@ | ... | @@ -116,7 +116,7 @@ |
| 116 | </el-col> | 116 | </el-col> |
| 117 | <el-col :span="6"> | 117 | <el-col :span="6"> |
| 118 | <div class="div-search"> | 118 | <div class="div-search"> |
| 119 | <input id="searchInput" type="text" placeholder="搜索待办项目" style="width: 82%;" v-model="search" @keyup.enter="SearchInfo"> | 119 | <input id="searchInput" type="text" placeholder="搜索待办项目" style="width: 82%;" v-model="search" @keyup.enter="SearchInfo" v-focus> |
| 120 | <img id="searchBtn" src="../../../../image/projecttask/search.png" style="margin-right: 10px; margin-top: 4px; width: 20px; height: 20px; float: right;"> | 120 | <img id="searchBtn" src="../../../../image/projecttask/search.png" style="margin-right: 10px; margin-top: 4px; width: 20px; height: 20px; float: right;"> |
| 121 | </div> | 121 | </div> |
| 122 | </el-col> | 122 | </el-col> | ... | ... |
-
Please register or sign in to post a comment