PageSourceSearch

https://www.zywell.net/src/package/cell.js

js zywell.net collected 2026-10-04 04:34:50 UTC 1,369 bytes, 41 lines download raw bytes

1import Package from './package.js'
2import Unit from './unit.js'
3import HookCell from '../hooks/cell.js'
4
5class Cell extends Package {
6  /**
7   * 构造函数
8   * @param {JSON} config
9   */
10  constructor({ ctx, params, sequence, parent_attr_id, parent_hide_phone }) {
11    super({ ctx, params, type: 'cell', sequence, parent_attr_id, parent_hide_phone })
12  }
13  /** 处理接口返回的差异 */
14  initCloudData(thisPackage, isLocal) {
15    this.cols_col = thisPackage.cols_col || 12
16    this.cols_md = thisPackage.cols_md || 12
17    this.cols_xl = thisPackage.cols_xl || 12
18    this.children = (isLocal ? thisPackage.unit : null) || thisPackage.children || []
19    this.is_customize = thisPackage.is_customize || 0
20    this.generate_config = thisPackage.generate_config || {}
21    this.transfer = thisPackage.transfer || ''
22  }
23  /** 把子级都实例化 */
24  initSelf() {
25    this.initHooks()
26    const ctx = this.getCtx()
27    let i = 0
28    this.children = this.children.map(signOrData => {
29      const sequence = [...this.sequence]
30      sequence.push(i ++)
31      return new Unit({ ctx, params: signOrData, sequence, parent_attr_id: this.attr_id, parent_hide_phone: this.current_hide_phone || this.hide_phone })
32    })
33  }
34  /** 初始化钩子函数 */
35  initHooks() {
36    const ctx = this.getCtx()
37    this.hook = new HookCell(ctx, {}, this)
38  }
39}
40
41export default Cell

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.