上传组件,发现模板自带组件用不了
@ -99,6 +99,7 @@ namespace MineTec.ProManager.GalleryFiles
|
||||
query.FileName = input.FileName;
|
||||
query.SubCode = input.SubCode;
|
||||
query.FileNum = input.FileNum;
|
||||
query.PictureFrame = input.PictureFrame;
|
||||
query.Remark = input.Remark;
|
||||
result.code = 1;//1成功0失败
|
||||
}
|
||||
|
BIN
Pages/lib/jq-module/zyupload/images/Thumbs.db
Normal file
BIN
Pages/lib/jq-module/zyupload/images/add_img.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
Pages/lib/jq-module/zyupload/images/bg.png
Normal file
After Width: | Height: | Size: 63 KiB |
BIN
Pages/lib/jq-module/zyupload/images/delete_blue.png
Normal file
After Width: | Height: | Size: 627 B |
BIN
Pages/lib/jq-module/zyupload/images/delete_white.png
Normal file
After Width: | Height: | Size: 447 B |
BIN
Pages/lib/jq-module/zyupload/images/fileType/Thumbs.db
Normal file
BIN
Pages/lib/jq-module/zyupload/images/fileType/file.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
Pages/lib/jq-module/zyupload/images/fileType/rar.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
Pages/lib/jq-module/zyupload/images/fileType/txt.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
Pages/lib/jq-module/zyupload/images/fileType/zip.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
Pages/lib/jq-module/zyupload/images/success.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
@ -86,16 +86,22 @@
|
||||
defaultToolbar: ['filter', 'exports'],
|
||||
cols: [[
|
||||
{ type: "checkbox", width: 50 },
|
||||
{ type: "numbers", title: '序号', width: 50 },
|
||||
{ type: "numbers", title: '序号', width: 30 },
|
||||
{ field: 'id', hide: true, width: 300, title: 'ID' },
|
||||
{ field: 'fileNum', width: 350, title: '图纸编号', sort: true, align: "left" },
|
||||
{ field: 'fileName', width: 350, title: '图纸名称', align: "left" },
|
||||
{ field: 'isDelete', width: 150, title: '状态', align: "center", templet: '#GalleryFilesList_isDelete' },
|
||||
{ field: 'createTime', hide: true, width: 200, title: '创建时间' },
|
||||
{ field: 'fileNum', width: 130, title: '产品编号', sort: true, align: "center" },
|
||||
{ field: 'subCode', width: 110, title: '附加尾号', align: "center" },
|
||||
{ field: 'patternType', width: 110, title: '图样类型', sort: true, align: "center", templet: '#patternType' },
|
||||
{ field: 'fileName', width: 150, title: '图样名称', align: "left" },
|
||||
{ field: 'pictureFrame', width: 80, title: '图幅', sort: true, align: "center" },
|
||||
{ field: 'isAnnex', width: 110, title: '图纸查看', align: "center", templet: '#isAnnex' },
|
||||
{ field: 'isCard', width: 110, title: '检验卡片', align: "center", templet: '#isCard' },
|
||||
{ field: 'remark', width: 200, title: '备注', sort: true, align: "left" },
|
||||
{ title: '操作', width: 200, toolbar: '#currentTableBar', align: "center" }
|
||||
]],
|
||||
initSort: {
|
||||
field: 'fileNum', //排序字段,对应 cols 设定的各字段名
|
||||
type: 'asc' //排序方式 asc: 升序、desc: 降序、null: 默认排序
|
||||
field: 'createTime', //排序字段,对应 cols 设定的各字段名
|
||||
type: 'desc' //排序方式 asc: 升序、desc: 降序、null: 默认排序
|
||||
},
|
||||
limits: [10, 15, 20, 25, 50, 100],
|
||||
limit: 15,
|
||||
@ -269,11 +275,31 @@
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script type="text/html" id="GalleryFilesList_isDelete">
|
||||
{{# if(d.isDelete ==1 ){ }}
|
||||
<span>废弃</span>
|
||||
<script type="text/html" id="patternType">
|
||||
{{# if(d.patternType ==0 ){ }}
|
||||
<span>原理图</span>
|
||||
{{# } else if(d.patternType ==2 ){ }}
|
||||
<span>总装图号</span>
|
||||
{{# } else if(d.patternType ==5 ){ }}
|
||||
<span>部件</span>
|
||||
{{# } else if(d.patternType ==6 ){ }}
|
||||
<span>可销售部件</span>
|
||||
{{# } else if(d.patternType ==8 ){ }}
|
||||
<span>零件</span>
|
||||
{{# } }}
|
||||
</script>
|
||||
<script type="text/html" id="isAnnex">
|
||||
{{# if(d.isAnnex ==0 ){ }}
|
||||
<span>未上传</span>
|
||||
{{# } else { }}
|
||||
<span>在用</span>
|
||||
<span>查看</span>
|
||||
{{# } }}
|
||||
</script>
|
||||
<script type="text/html" id="isCard">
|
||||
{{# if(d.isCard ==0 ){ }}
|
||||
<span>未上传</span>
|
||||
{{# } else { }}
|
||||
<span>查看</span>
|
||||
{{# } }}
|
||||
</script>
|
||||
</body>
|
||||
|
@ -8,6 +8,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" href="../../../lib/layui-v2.5.5/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="../../../lib/jq-module/zyupload/zyupload-1.0.0.min.css" media="all">
|
||||
<link rel="stylesheet" href="../../../css/public.css" media="all">
|
||||
<style>
|
||||
body {
|
||||
@ -62,8 +63,8 @@
|
||||
<div class="layui-form-item" id="supNum_div" hidden>
|
||||
<label class="layui-form-label">附加尾号</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="supNum" maxlength="2" id="supNum" lay-filter="supNum" placeholder="请输入附加尾号" value=""
|
||||
class="layui-input">
|
||||
<input type="text" name="supNum" maxlength="2" id="supNum" lay-filter="supNum" placeholder="请输入附加尾号"
|
||||
value="" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
@ -87,15 +88,31 @@
|
||||
class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">图纸上传</label>
|
||||
<div class="layui-input-block">
|
||||
<div id="annex" class="zyupload"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">检验卡片上传</label>
|
||||
<div class="layui-input-block">
|
||||
<div id="card" class="zyupload"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
|
||||
<script src="../../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
|
||||
<script src="../../../js/md5/md5.js" charset="utf-8"></script>
|
||||
<script src="../../../js/PublicParameters/PublicParameters.js" charset="utf-8"></script>
|
||||
<script src="../../../lib/jq-module/zyupload/zyupload-1.0.0.min.js" charset="utf-8"></script>
|
||||
<script>
|
||||
layui.use(['form'], function () {
|
||||
var form = layui.form,
|
||||
@ -296,7 +313,49 @@
|
||||
}
|
||||
});
|
||||
|
||||
//图纸上传
|
||||
$(function () {
|
||||
// 初始化插件
|
||||
$("#annex").zyUpload({
|
||||
width: "100%", // 宽度
|
||||
height: "200px", // 高度
|
||||
itemWidth: "140px", // 文件项的宽度
|
||||
itemHeight: "115px", // 文件项的高度
|
||||
url: "api/upload", // 上传文件的路径
|
||||
fileType: ["jpg", "png", "txt", "js", "exe"],// 上传文件的类型
|
||||
fileSize: 51200000, // 上传文件的大小
|
||||
multiple: false, // 是否可以多个文件上传
|
||||
dragDrop: false, // 是否可以拖动上传文件
|
||||
tailor: false, // 是否可以裁剪图片
|
||||
del: true, // 是否可以删除文件
|
||||
finishDel: false, // 是否在上传文件完成后删除预览
|
||||
/* 外部获得的回调接口 */
|
||||
onSelect: function (selectFiles, allFiles) { // 选择文件的回调方法 selectFile:当前选中的文件 allFiles:还没上传的全部文件
|
||||
console.info("当前选择了以下文件:");
|
||||
console.info(selectFiles);
|
||||
},
|
||||
onDelete: function (file, files) { // 删除一个文件的回调方法 file:当前删除的文件 files:删除之后的文件
|
||||
console.info("当前删除了此文件:");
|
||||
console.info(file.name);
|
||||
},
|
||||
onSuccess: function (file, response) { // 文件上传成功的回调方法
|
||||
console.info("此文件上传成功:");
|
||||
console.info(file.name);
|
||||
console.info("此文件上传到服务器地址:");
|
||||
console.info(response);
|
||||
$("#uploadInf").append("<p>上传成功,文件地址是:" + response + "</p>");
|
||||
},
|
||||
onFailure: function (file, response) { // 文件上传失败的回调方法
|
||||
console.info("此文件上传失败:");
|
||||
console.info(file.name);
|
||||
},
|
||||
onComplete: function (response) { // 上传完成的回调方法
|
||||
console.info("文件上传完成");
|
||||
console.info(response);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
//监听提交
|
||||
form.on('submit(saveBtn)', function (data) {
|
||||
@ -318,16 +377,16 @@
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify({
|
||||
projectID: ProjectID,
|
||||
projectCode:ProjectCode,
|
||||
patternType:data.field.productType,
|
||||
projectCode: ProjectCode,
|
||||
patternType: data.field.productType,
|
||||
fileNum: data.field.fileNum,
|
||||
subCode:data.field.supNum,
|
||||
subCode: data.field.supNum,
|
||||
fileName: data.field.fileName,
|
||||
pictureFrame:data.field.pictureFrame,
|
||||
remark:data.field.remark,
|
||||
isAnnex:0,
|
||||
isCard:0,
|
||||
isDelete:0,
|
||||
pictureFrame: data.field.pictureFrame,
|
||||
remark: data.field.remark,
|
||||
isAnnex: 0,
|
||||
isCard: 0,
|
||||
isDelete: 0,
|
||||
createTime: getDatetime(),
|
||||
createUserID: CurrUserInfo.data.userid,
|
||||
createUserName: CurrUserInfo.data.userName
|
||||
|
@ -188,11 +188,11 @@
|
||||
id: PatternID,
|
||||
updateUserID: CurrUserInfo.data.userid,
|
||||
updateUserName: CurrUserInfo.data.userName,
|
||||
fileName: data.fileName,
|
||||
subCode: data.supNum,
|
||||
fileNum: data.fileNum,
|
||||
pictureFrame: data.pictureFrame,
|
||||
remark: data.remark,
|
||||
fileName: data.field.fileName,
|
||||
subCode: data.field.supNum,
|
||||
fileNum: data.field.fileNum,
|
||||
pictureFrame: data.field.pictureFrame,
|
||||
remark: data.field.remark,
|
||||
isCard: 0,
|
||||
isAnnex: 0
|
||||
}), //参数值
|
||||
|
1
代码解决方法/上传扩展组件.txt
Normal file
@ -0,0 +1 @@
|
||||
https://gitee.com/CandyPop/layui-plugin
|