feat: 新增阿里云OSS适配器及分类图标优化
- 新增阿里云OSS SDK核心类库文件 - 新增OSS插件配置文件及钩子监听 - 新增分类图标SVG资源并优化为轻量化格式 - 替换定位接口为天地图逆地理编码接口 - 新增OSS图片缩略处理工具方法
这个提交包含在:
@@ -218,3 +218,31 @@ test('frontend metadata is escaped without double-encoding upload filenames', ()
|
||||
assert.equal(typeof column.formatter, 'function', field + ' has a frontend formatter');
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 校验附件列表图片点击放大预览特性配置
|
||||
*/
|
||||
test('attachment image preview adds img-preview class and preview event handler', () => {
|
||||
const imgRow = attachment({
|
||||
filename: 'test-pic.jpg',
|
||||
fullurl: '/uploads/test-pic.jpg',
|
||||
mimetype: 'image/jpeg'
|
||||
});
|
||||
const html = formatters.thumb('', imgRow, 0);
|
||||
assert.ok(html.includes('class="img-preview"'), 'Image preview link should have img-preview class');
|
||||
assert.ok(html.includes('data-caption="test-pic.jpg"'), 'Image preview link should contain caption');
|
||||
|
||||
const nonImgRow = attachment({
|
||||
filename: 'document.pdf',
|
||||
fullurl: '/uploads/document.pdf',
|
||||
mimetype: 'application/pdf',
|
||||
imagetype: 'pdf'
|
||||
});
|
||||
const nonImgHtml = formatters.thumb('', nonImgRow, 0);
|
||||
assert.ok(!nonImgHtml.includes('class="img-preview"'), 'Non-image file should not have img-preview class');
|
||||
|
||||
const previewColumn = columns.find(column => column.field === 'preview');
|
||||
assert.ok(previewColumn, 'Preview column exists');
|
||||
assert.ok(previewColumn.events, 'Preview column has events defined');
|
||||
assert.equal(typeof previewColumn.events['click .img-preview'], 'function', 'Preview column has click .img-preview event handler');
|
||||
});
|
||||
|
||||
在新工单中引用
屏蔽一个用户