Pārlūkot izejas kodu

数据应用审批管理

wangzhe 2 gadi atpakaļ
vecāks
revīzija
fa959761df

+ 1 - 1
mybusiness/src/main/resources/templates/apply/record/add.html

@@ -57,7 +57,7 @@
                             <label class="col-sm-2 control-label is-required">接口提供部门</label>
                             <div class="col-sm-4">
                                 <div class="input-group">
-                                    <input name="provideDeptName" onclick="selectDeptTree()" id="treeName" type="text" placeholder="请选择归属部门" class="form-control" required>
+                                    <input name="provideDeptName" onclick="selectDeptTree()" id="treeName" type="text" placeholder="请选择提供部门" class="form-control" required>
                                     <input name="provideDeptId" type="hidden" id="treeId"/>
                                     <span class="input-group-addon"><i class="fa fa-search"></i></span>
                                 </div>

+ 1 - 1
mybusiness/src/main/resources/templates/apply/record/edit.html

@@ -55,7 +55,7 @@
                             <label class="col-sm-2 control-label is-required">接口提供部门</label>
                             <div class="col-sm-4">
                                 <div class="input-group">
-                                    <input name="provideDeptName" th:value="${intRecord.provideDeptName}" onclick="selectDeptTree()" id="treeName" type="text" placeholder="请选择归属部门" class="form-control" required>
+                                    <input name="provideDeptName" th:value="${intRecord.provideDeptName}" onclick="selectDeptTree()" id="treeName" type="text" placeholder="请选择提供部门" class="form-control" required>
                                     <input name="provideDeptId" th:value="${intRecord.provideDeptId}" type="hidden" id="treeId"/>
                                     <span class="input-group-addon"><i class="fa fa-search"></i></span>
                                 </div>

+ 5 - 5
mybusiness/src/main/resources/templates/applyData/record/add.html

@@ -54,17 +54,17 @@
                             <!--</div>-->
                         </div>
                         <div class="form-group">
-                            <label class="col-sm-2 control-label is-required">接口来源</label>
+                            <label class="col-sm-2 control-label is-required">数据应用来源</label>
                             <div class="col-sm-4">
                                 <select class='form-control' id="shareType" name='shareType' onchange="changeShareType()">
                                     <option value="share_type_1">市共享</option>
                                     <option value="share_type_4">省共享</option>
                                 </select>
                             </div>
-                            <label class="col-sm-2 control-label is-required">接口提供部门</label>
+                            <label class="col-sm-2 control-label is-required">数据应用提供部门</label>
                             <div class="col-sm-4">
                                 <div class="input-group">
-                                    <input name="provideDeptName" onclick="selectDeptTree()" id="treeName" type="text" placeholder="请选择归属部门" class="form-control" required>
+                                    <input name="provideDeptName" onclick="selectDeptTree()" id="treeName" type="text" placeholder="请选择提供部门" class="form-control" required>
                                     <input name="provideDeptId" type="hidden" id="treeId"/>
                                     <span class="input-group-addon"><i class="fa fa-search"></i></span>
                                 </div>
@@ -90,7 +90,7 @@
             <!--子表字段start-->
             <div class="ibox">
                 <div class="ibox-title">
-                    <button type="button" class="btn btn-w-m btn-success" onclick="selectInterface()">点击此处选择接口</button>
+                    <button type="button" class="btn btn-w-m btn-success" onclick="selectInterface()">点击此处选择数据应用模块</button>
                 </div>
                 <div class="ibox-content">
                     <div class="panel-group" id="accordion">
@@ -156,7 +156,7 @@
     function selectInterface() {
         let deptId = $("#treeId").val();
         if(deptId == "" || deptId == null){
-            $.modal.alertError('请先选择接口提供部门');
+            $.modal.alertError('请先选择数据应用提供部门');
         }else{
             let url = prefix + '/interfaceinfo/selectInterfaceByDeptId/' + deptId + '/share_type_1/share_type_3';
             $.modal.open("请选择接口", url, ($(window).width() - 50),($(window).height() - 50), interfaceCallback);

+ 9 - 5
mybusiness/src/main/resources/templates/applyData/record/edit.html

@@ -48,10 +48,14 @@
                             </div>
                         </div>
                         <div class="form-group">
-                            <label class="col-sm-2 control-label is-required">接口提供部门</label>
-                            <div class="col-sm-10">
+                            <label class="col-sm-2 control-label is-required">数据应用来源</label>
+                            <div class="col-sm-4">
+                                <input type="input" readonly name="shareType" class="form-control" maxlength="15" th:value="${DataRecord.shareType}" required>
+                            </div>
+                            <label class="col-sm-2 control-label is-required">数据应用提供部门</label>
+                            <div class="col-sm-4">
                                 <div class="input-group">
-                                    <input name="provideDeptName" th:value="${DataRecord.provideDeptName}" onclick="selectDeptTree()" id="treeName" type="text" placeholder="请选择归属部门" class="form-control" required>
+                                    <input name="provideDeptName" th:value="${DataRecord.provideDeptName}" onclick="selectDeptTree()" id="treeName" type="text" placeholder="请选择提供部门" class="form-control" required>
                                     <input name="provideDeptId" th:value="${DataRecord.provideDeptId}" type="hidden" id="treeId"/>
                                     <span class="input-group-addon"><i class="fa fa-search"></i></span>
                                 </div>
@@ -77,7 +81,7 @@
             <!--子表字段start-->
             <div class="ibox">
                 <div class="ibox-title">
-                    <button type="button" class="btn btn-w-m btn-success" onclick="selectInterface()">点击此处选择接口</button>
+                    <button type="button" class="btn btn-w-m btn-success" onclick="selectInterface()">点击此处选择数据应用模块</button>
                 </div>
                 <div class="ibox-content">
                     <div class="panel-group" id="accordion">
@@ -189,7 +193,7 @@
     function selectInterface() {
         let deptId = $("#treeId").val();
         if(deptId == "" || deptId == null){
-            $.modal.alertError('请先选择接口提供部门');
+            $.modal.alertError('请先选择数据应用提供部门');
         }else{
             let url = prefix + '/interfaceinfo/selectInterfaceByDeptId/' + deptId + '/share_type_1/share_type_3';
             $.modal.open("请选择接口", url, ($(window).width() - 50),($(window).height() - 50), interfaceCallback);

+ 146 - 0
mybusiness/src/main/resources/templates/applyData/record/uploadFrame.html

@@ -0,0 +1,146 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org">
+<head>
+    <th:block th:include="include :: header('用户列表')" />
+    <th:block th:include="include :: bootstrap-fileinput-css" />
+</head>
+    <input class="file-upload" id="file" name="file" type="file" data-min-file-count="1">
+    <input type="hidden" name="_file" th:value="${file}">
+<th:block th:include="include :: footer" />
+<th:block th:include="include :: bootstrap-fileinput-js" />
+<script>
+
+    /**附件组件多图片回显JS**/
+    let newFilePs = []; //图片回显
+    let imgConfig = []; //预览参数
+    let uploadImageArray = [];//所有已上传的图片路径
+    let fileP=$("input[name='_file']").val();
+    let urlsArr = ($("input[name='_file']").val()).split(",");
+    for(let i in urlsArr) {
+        if (urlsArr[i] != "") {
+            uploadImageArray.push(urlsArr[i]);
+            newFilePs[i] = urlsArr[i];
+            let fileType = urlsArr[i].substr(urlsArr[i].lastIndexOf(".")+1,urlsArr[i].length-1);
+            let ftype ="image"; //文件类型
+            if(fileType=="pdf"){
+                ftype = "pdf";
+            }
+            imgConfig[i] = {
+                url: "/common/removeFile",
+                downloadUrl:urlsArr[i], //下载路径,此项不设置的话下载按钮不显示
+                type:ftype,             //文件类型
+                key: urlsArr[i],        //参数,用于文件删除向后台传参
+                caption:urlsArr[i].substr(urlsArr[i].lastIndexOf("/")+1,urlsArr[i].length-1)    //文件名,用于预览文件显示的文件名
+            };
+        }
+    }
+
+
+    $(".file-upload").each(function (i) {
+        $(this).fileinput({
+            language: 'zh', //设置语言
+            uploadUrl: '/common/upload',
+            deleteUrl: '/common/removeFile',
+            allowedFileExtensions: ['pdf','docx','doc','jpg','png'],//接收的文件后缀
+            showUpload: false, //是否显示上传按钮
+            showRemove: false, //显示移除按钮
+            showPreview: true, //是否显示预览
+            showCaption: false,//是否显示标题
+            browseClass: "btn btn-primary", //按钮样式
+            dropZoneEnabled: true,//是否显示拖拽区域
+            initialPreviewAsData: true,
+            enctype: 'multipart/form-data',
+            initialPreview: newFilePs,
+            uploadAsync: true, //默认异步上传(true),回调fileuploaded,false为同步上传,回调filebatchuploadsuccess
+            maxFileCount: 6,
+            overwriteInitial:false,    //不覆盖已存在的图片
+            initialPreviewConfig: imgConfig, //配置预览的参数
+            autoReplace: true,
+            preferIconicPreview: true,// 强制缩略图显示以下文件扩展名的图标
+            previewFileIconSettings: {
+                'doc': '<i class="fa fa-file-word-o text-primary"></i>',
+                'xls': '<i class="fa fa-file-excel-o text-success"></i>',
+                'ppt': '<i class="fa fa-file-powerpoint-o text-danger"></i>',
+                'zip': '<i class="fa fa-file-archive-o text-muted"></i>',
+                'htm': '<i class="fa fa-file-code-o text-info"></i>',
+                'txt': '<i class="fa fa-file-text-o text-info"></i>',
+                'mov': '<i class="fa fa-file-movie-o text-warning"></i>',
+                'mp3': '<i class="fa fa-file-audio-o text-warning"></i>',
+            },
+            previewFileExtSettings: { // configure the logic for determining icon file extensions
+                'doc': function(ext) {
+                    return ext.match(/(doc|docx)$/i);
+                },
+                'xls': function(ext) {
+                    return ext.match(/(xls|xlsx)$/i);
+                },
+                'ppt': function(ext) {
+                    return ext.match(/(ppt|pptx)$/i);
+                },
+                'zip': function(ext) {
+                    return ext.match(/(zip|rar|tar|gzip|gz|7z)$/i);
+                },
+                'htm': function(ext) {
+                    return ext.match(/(htm|html)$/i);
+                },
+                'txt': function(ext) {
+                    return ext.match(/(txt|ini|csv|java|php|js|css)$/i);
+                },
+                'mov': function(ext) {
+                    return ext.match(/(avi|mpg|mkv|mov|mp4|3gp|webm|wmv)$/i);
+                },
+                'mp3': function(ext) {
+                    return ext.match(/(mp3|wav)$/i);
+                }
+            }
+        }).on('fileuploaded', function (event, data, previewId, index) {
+            fileP += data.response.fileName+",";
+            $('#zoom-'+previewId).find(".kv-preview-data").attr("src",data.response.fileName);//上传成功后替换文件路径(替换为实际数据库的存储路径)
+            $("input[name='_" + event.currentTarget.id + "']").val(data.response.fileName);
+        }).on("filebatchselected", function (event, previewId, files) {//选中文件后执行
+            $(".file-upload").fileinput("upload");
+        }).on('fileremoved', function (event, id, index) {//预览时点击缩略图上的删除按钮才能触发的
+            console.log('fileremoved');
+            getMeg();
+        }).on("filepredelete", function (event, key, jqXHR, data) {   //预览图片删除
+            console.log('filepredelete')
+            getMeg();
+        }).on("filesuccessremove", function (event, id) {   //使用缩略图删除按钮删除成功上传的缩略图后
+            console.log('filesuccessremove')
+            getMeg();
+        })
+        $(this).fileinput('_initFileActions');
+    });
+
+    function nowImgTotal() {
+        return $(".file-preview-thumbnails").find('.file-preview-frame').length / 2;
+    }
+
+    function getMeg() {
+        if (nowImgTotal() >= 6) {
+            $('#file').attr('disabled', 'disabled');
+            $.modal.alert("图片允许上传的最大数值为6,请删除需要被替换的图片后再进行上传操作!")
+            return false;
+        }else{
+            $('#file').removeAttr("disabled");
+        }
+    }
+
+    /*
+        获取当前页面图片附件的存储路径
+     */
+    function getImgUrl(){
+        var initFileDiv = $(".kv-zoom-cache");
+        var imgUrl = [];
+        initFileDiv.each(function(i,e){
+            debugger
+            var fullPath = $(this).find(".kv-preview-data").attr("src");
+            if(fullPath!=null&&fullPath!=""&&fullPath.length>=2)
+                imgUrl[i]="/profile/upload/"+(fullPath.split("upload/",fullPath.length-1))[1];
+        });
+        return imgUrl;
+    }
+
+</script>
+</html>
+