1import {mods_object_search} from "/global_assets/js/mods_object.js" 2 3 4 5if (jsParams.tag === undefined) jsParams.tag = '' 6console.log(jsParams.tag) 7 8 9 10/* 11 * app 12 */ 13const app = new Vue({ 14 el: "#app", 15 16 data(){ 17 return { 18 all: [], 19 result: [], 20 result_num: 0, 21 parPage: 20, // 1ãã¼ã¸ã«è¡¨ç¤ºããä»¶æ° 22 currentPage: 1, // ç¾å¨ã®ãã¼ã¸ 23 24 category: { 25 "ãã¹ã¦": true, 26 "製åã»ãµã¼ãã¹": false, 27 "å±ç¤ºä¼": false, 28 "åè³ã»èªå®": false, 29 "ãã®ä»": false, 30 }, 31 32 categorys: {}, 33 34 tag: { 35 "ãã¹ã¦": true, 36 "ãªãã£ã¹": false, 37 "æè²æåæ½è¨": false, 38 "å»çç¦ç¥æ½è¨": false, 39 "ç ç©¶æ½è¨": false, 40 "忥æ½è¨": false, 41 "ç©æµã·ã¹ãã æ©å¨": false, 42 "ã»ãã¥ãªãã£": false, 43 "éä»å建æ": false, 44 "ãã¼ã ã¤ã³ããªã¢": false, 45 }, 46 47 tags: "", 48 param_tag: "", 49 50 year: "", 51 word: "", 52 53 search_categorys: [], 54 search_tags: [], 55 56 } 57 }, 58 59 60 61 /* == components == */ 62 components: { 63 'paginate': VuejsPaginate, 64 }, 65 66 67 68 /* == created == */ 69 created(){ 70 71 this.param_tag = this.getUrlParam('tag') 72 if (jsParams.tag) this.param_tag = jsParams.tag 73
74 axios.get('/corporate/news/json/topics.json?ver=20260917-135536') 75 .then((response) => { 76 77 this.all = response.data 78 79 // -- hidden_flag 80 if (jsParams.hidden_flag){ 81 this.all = response.data.filter((item) => {return !item.hidden_flag}) 82 } 83 84 // -- flag 85 if (jsParams.flag){ 86 this.all = this.all.filter((item) => {return item.flag == jsParams.flag}) 87 } 88 89 // console.log('RowData = ' + response.data.length, ': all = ' + this.all.length) 90 91 let i = 0; 92 this.all.forEach((val) => { 93 val.sn = i 94 i++ 95 }) 96 97 this.result = this.all 98 this.result_num = this.result.length 99 100 if (this.param_tag){ 101 this.search('tag', this.param_tag) 102 } 103 104 }) 105 .catch((error) => { 106 console.log(error) 107 }) 108 109 }, 110 111 112 113 /* == mounted == */ 114 mounted(){ 115 //console.log('mounted') 116 }, 117 118 119 120 /* == watch ==*/ 121 watch: { 122 year(old, val) { this.search('year', val) }, 123 // word(old, val) { this.search('word', val) }, 124 }, 125 126 127 128 /* == computed ==*/ 129 computed: { 130 getItems: function(){ 131 let current = this.currentPage * this.parPage; 132 let start = current - this.parPage; 133 return this.result.slice(start, current); 134 }, 135 getPageCount: function(){ 136 return Math.ceil(this.result.length / this.parPage); 137 } 138 }, 139 140 141 142 /* == methods == */ 143 methods: { 144 145 ex_date(date){ 146 date = date.replace(/å¹´|æ/g, '.') 147 return date.replace('æ¥', '') 148 }, 149 150 split_tag(tag){ 151 return tag.split(',') 152 153 }, 154 155 search(index, value){ 156 157 switch(index){ 158 159 // -------------------------- category
160 case "category": 161 162 this.search_categorys = [] 163 164 Object.keys(this.category).forEach((idx) => { 165 this.category[idx] = false 166 }) 167 168 this.category[value] = true 169 170 if (value !== 'ãã¹ã¦'){ 171 this.search_categorys.push(value) 172 } 173 174 // ã«ãã´ãªã¼ã鏿ãããå ´åãä»ã®é¸æé ç®ãã¯ãªã¢ 175 this.search_tags = [] 176 Object.keys(this.tag).forEach((idx) => { 177 this.tag[idx] = false 178 }) 179 180 this.tag['ãã¹ã¦'] = true 181 182 this.year = "" 183 this.word = "" 184 185 break; 186 187 // -------------------------- tag 188 case "tag": 189 190 this.tags_param = "" 191 this.search_tags = [] 192 193 if (value == 'ãã¹ã¦'){ 194 195 Object.keys(this.tag).forEach((idx) => { 196 this.tag[idx] = false 197 }) 198 this.tag['ãã¹ã¦'] = true 199 200 }else{ 201 202 this.tag['ãã¹ã¦'] = false 203 if (this.tag[value]){ 204 this.tag[value] = false 205 }else{ 206 this.tag[value] = true 207 } 208 Object.keys(this.tag).forEach((idx) => { 209 if (this.tag[idx]){ 210 this.search_tags.push(`@_${idx}_@`) 211 } 212 }) 213 214 } 215 216 break; 217 218 // -------------------------- year 219 case "year": 220 value = this.year 221 break; 222 223 /// -------------------------- word 224 case "word": 225 value = this.word 226 break; 227 } 228 229 this.result = this.all 230 231 // -- category 232 if (this.search_categorys.length){ 233 this.result = mods_object_search({ 234 obj: this.result, 235 key: 'cateogory', 236 word: this.search_categorys, 237 incl: false 238 }) 239 } 240 241 // -- tag 242 if (this.search_tags.length){ 243 this.result = mods_object_search({ 244 obj: this.result, 245 key: 'search_tag', 246 word: this.search_tags, 247 incl: true 248 }) 249 } 250 251 // -- year 252 if (this.year){ 253 this.result = mods_object_search({ 254 obj: this.result, 255 key: 'year', 256 word: this.year, 257 incl: false 258 }) 259 } 260 261 // -- word 262 if (this.word){ 263 this.result = mods_object_search({ 264 obj: this.result, 265 key: 'search_words', 266 word: this.word, 267 incl: true 268 }) 269 } 270 271 this.result_num = this.result.length 272 273 // ãã¼ã¸ãã¼ã·ã§ã³ã®ã«ã¬ã³ããå¼·å¶çã«å¤æ´ãã 274 this.$refs.paginate.selected = 1 275 this.currentPage = 1 276 277 }, 278 279 // -- ãã¼ã¸ãã¼ã·ã§ã³ãã¯ãªãã¯ãããã 280 // https://github.com/lokyoung/vuejs-paginate#props 281 pagination_click(pageNum) { 282 this.currentPage = Number(pageNum); 283 const el = document.getElementById('wrapper') 284 el.scrollIntoView({ behavior: 'smooth'}) 285 }, 286 287 /* 288 * URLã®ãã©ã¡ã¼ã¿ãåå¾ 289 */ 290 getUrlParam(arg){ 291 if (location.search){ 292 293 const _arg = new Object; 294 const pair = location.search.substring(1).split('&'); 295 296 for(var i=0; i < pair.length; i++) { 297 var kv = pair[i].split('=') 298 kv[1] = decodeURIComponent(kv[1]) 299 if (kv[1] === 'undefined') kv[1] = "" 300 _arg[kv[0]] = kv[1] 301 } 302 303 if (arg) return _arg[arg]; else return _arg 304 305 }else{ 306 return "" 307 } 308 }, 309 310 /* 311 * mods_url_addParam URLã«ãã©ã¡ã¼ã¿ã追å 312 */ 313 addUrlParam(param){ 314 history.pushState('', '', param) 315 }, 316 317 }, 318 319 320 321})
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.