更新数据关联查询,以及基本的数据的编辑,部分有待进一步完善。
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<div class="layui-form">
|
||||
<!-- // 自定义搜索参数 -->
|
||||
<div id="laytable-search" class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<!-- <div class="layui-inline">
|
||||
<div class="layui-form-label">{:__('ID')}</div>
|
||||
<div class="layui-input-inline ">
|
||||
<input name="id" class="layui-input" type="text" placeholder="{:__('ID')}" />
|
||||
@@ -26,7 +26,7 @@
|
||||
<div class="layui-input-inline ">
|
||||
<input name="sort" class="layui-input" type="text" placeholder="{:__('排序')}" />
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="layui-inline">
|
||||
<div class="layui-form-label">{:__('ParttypeID')}</div>
|
||||
@@ -172,6 +172,47 @@
|
||||
|
||||
<script type="text/html" id="tableButton"></script>
|
||||
|
||||
<!-- 文件预览模板 -->
|
||||
<!-- 内部模板的嵌套 {-{ }-} 会有问题-->
|
||||
<script type="text/html" id="filepreviewtpl">
|
||||
{{#
|
||||
|
||||
if(d.datasheet) {
|
||||
|
||||
|
||||
var fileExt = d.datasheet.split('.').pop().toLowerCase();
|
||||
|
||||
var imageExts = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'];
|
||||
|
||||
if (imageExts.indexOf(fileExt) !== -1) {
|
||||
}}
|
||||
<!-- 图片文件:显示图片并链接到原文件 -->
|
||||
<a href="/upload/datasheet/{{d.datasheet}}" target="_blank">
|
||||
<img class="filesuffix" src="/upload/datasheet/{{d.datasheet}}" alt="Image Preview" style="max-width: 100px; height: auto;" />
|
||||
</a>
|
||||
{{#
|
||||
} else if (fileExt === 'pdf') {
|
||||
}}
|
||||
<!-- PDF 文件:显示 PDF 图标并链接到 PDF 文件 -->
|
||||
<a href="/upload/datasheet/{{d.datasheet}}" target="_blank" style="display: flex; align-items: center;">
|
||||
<i class="layui-icon layui-icon-file" style="font-size: 24px; color: #e64340; margin-right: 5px;"></i>
|
||||
<span>PDF:{{d.datasheet}}</span>
|
||||
</a>
|
||||
{{#
|
||||
} else {
|
||||
}}
|
||||
<!-- 其他文件类型:显示通用文件图标并链接到文件 -->
|
||||
<a href="/upload/datasheet/{{d.datasheet}}" target="_blank" style="display: flex; align-items: center;">
|
||||
<i class="layui-icon layui-icon-file" style="font-size: 24px; color: #1E9FFF; margin-right: 5px;"></i>
|
||||
<span>Other:{{d.datasheet}}</span>
|
||||
</a>
|
||||
{{#
|
||||
}
|
||||
}
|
||||
}}
|
||||
</script>
|
||||
|
||||
|
||||
<include file="/public/footer" />
|
||||
<script>
|
||||
layui.use(['admin', 'table'], function () {
|
||||
@@ -187,28 +228,31 @@
|
||||
, url: "{:url('/PdmPartitemIndex/index')}"
|
||||
, toolbar: '#tableButton'
|
||||
, defaultToolbar: ['filter', 'exports', 'print', 'search']
|
||||
, cellMinWidth: 160
|
||||
, cellMinWidth: 80
|
||||
, page: true
|
||||
, limit: 18
|
||||
, cols: [[
|
||||
<!-- { type: 'checkbox', width: 50 }, -->
|
||||
<!-- { type: 'checkbox', width: 60 }, -->
|
||||
{ field: 'id', align: 'center', sort: true, width: 60, title: 'ID' },
|
||||
{ field: 'partnumber',width: 100, title: '{:__("PartNumber")}' },
|
||||
<!-- { field: 'parttypeid', width: 80, title: '{:__("ParttypeID")}' }, -->
|
||||
{ field: 'parttype', width: 60, title: '{:__("Parttype")}' },
|
||||
{ field: 'purchasecode', width: 100, title: '{:__("采购编码")}' },
|
||||
{ field: 'value', title: '{:__("Value")}' },
|
||||
{ field: 'description',width: 250, title: '{:__("描述")}' },
|
||||
<!-- { field: 'mfg_id', title: '{:__("MFGID")}' }, -->
|
||||
{ field: 'mfg_name', title: '{:__("MFG")}' },
|
||||
{ field: 'partnumber', width: 180, title: '{:__("PartNumber")}' },
|
||||
//{ field: 'parttypeid', width: 80, title: '{:__("ParttypeID")}' },
|
||||
{ field: 'parttype', width: 80, title: '{:__("Parttype")}' },
|
||||
{ field: 'purchasecode', width: 150, title: '{:__("采购编码")}' },
|
||||
{ field: 'value', width: 120, title: '{:__("Value")}' },
|
||||
{ field: 'description', width: 250, title: '{:__("描述")}' },
|
||||
//{ field: 'mfg_id', title: '{:__("MFGID")}' },
|
||||
{ field: 'mpn',width: 160, title: '{:__("MPN")}' },
|
||||
{ field: 'mfg_name',width: 120, title: '{:__("MFG")}' },
|
||||
|
||||
{ field: 'datasheet',templet: function (d) {
|
||||
return '<a href="/upload/' + d.datasheet + '" target="_blank" ><img class="filesuffix" src="/upload/' + d.datasheet + '"></a>';
|
||||
}, title: '{:__("规格书")}' },
|
||||
|
||||
<!-- { field: 'creatorid', title: '{:__("创建者")}' }, -->
|
||||
{ field: 'nickname', title: '{:__("创建者")}' },
|
||||
{ field: 'status', templet: '#columnStatus', title: '{:__("状态")}' },
|
||||
//{
|
||||
// field: 'datasheet', width: 160, templet: function (d) {
|
||||
// return '<a href="/upload/' + d.datasheet + '" target="_blank" ><img class="filesuffix" src="/upload/' + d.datasheet + '"></a>';
|
||||
// }, title: '{:__("规格书")}'
|
||||
//},
|
||||
{ field: 'datasheet', width: 160, templet: '#filepreviewtpl', title: '{:__("规格书")}' },
|
||||
//{ field: 'creatorid', title: '{:__("创建者")}' },
|
||||
{ field: 'nickname',width: 120, title: '{:__("创建者")}' },
|
||||
{ field: 'status',width: 80, templet: '#columnStatus', title: '{:__("状态")}' },
|
||||
{ align: 'center', toolbar: '#tableBar', width: 160, fixed: 'right', title: '{:__("操作")}' },
|
||||
]]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user