waibu-db 2.18.2 → 2.18.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -23,7 +23,8 @@ async function table () {
|
|
|
23
23
|
const { req } = this.component
|
|
24
24
|
const { escape, attrToArray } = this.app.waibu
|
|
25
25
|
const { groupAttrs } = this.app.waibuMpa
|
|
26
|
-
const {
|
|
26
|
+
const { isHtmlLink } = this.app.bajoExtra
|
|
27
|
+
const { get, omit, set, find, isEmpty, without, merge } = this.app.lib._
|
|
27
28
|
const group = groupAttrs(this.params.attr, ['body', 'head', 'foot'])
|
|
28
29
|
this.params.attr = group._
|
|
29
30
|
const prettyUrl = this.params.attr.prettyUrl
|
|
@@ -131,12 +132,7 @@ async function table () {
|
|
|
131
132
|
else if (['array', 'object'].includes(prop.type)) dataValue = escape(JSON.stringify(dataValue))
|
|
132
133
|
const refName = get(schema, `view.widget.${f}.attr.refName`)
|
|
133
134
|
let value = this.getRefValue({ field: f, data: d, refName }) ?? get(d, `_fmt.${f}`, d[f])
|
|
134
|
-
if (!get(schema, 'view.noEscape', []).includes(f)) value = escape(value)
|
|
135
135
|
const attr = { dataValue, dataKey: prop.name, dataType: prop.type }
|
|
136
|
-
if (isString(d[f]) && d[f].startsWith('<a ')) {
|
|
137
|
-
delete attr.dataValue
|
|
138
|
-
value = d[f]
|
|
139
|
-
}
|
|
140
136
|
if (!disableds.includes('get')) attr.style = { cursor: 'pointer' }
|
|
141
137
|
const formatCell = get(schema, `view.formatCell.${f}`)
|
|
142
138
|
if (formatCell) merge(attr, await formatCell.call(this, value, d, { params: this.params, req }))
|
|
@@ -145,6 +141,7 @@ async function table () {
|
|
|
145
141
|
else attr.text = `${noWrap}`
|
|
146
142
|
const format = get(schema, `view.format.${f}`)
|
|
147
143
|
if (format) value = await format.call(this, value, d, { params: this.params, req })
|
|
144
|
+
if (!get(schema, 'view.noEscape', []).includes(f) && !isHtmlLink(value)) value = escape(value)
|
|
148
145
|
const line = await this.component.buildTag({ tag: 'td', attr, html: value })
|
|
149
146
|
lines.push(line)
|
|
150
147
|
}
|
package/package.json
CHANGED