You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
690 lines
21 KiB
690 lines
21 KiB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
|
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
|
<%@ include file="/common/ctx.jsp"%>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
|
<title>应急预案管理信息</title>
|
|
<!-- jQuery -->
|
|
<script src="${ctx}/js/jquery-3.7.0.min.js"></script>
|
|
<script type="text/javascript" src="${ctx}/js/jquery.form.js"></script>
|
|
|
|
<!-- 公共js -->
|
|
<script type="text/javascript" src="${ctx}/js/common/cjy_common.js"></script>
|
|
|
|
|
|
<!-- 字体图标 -->
|
|
<link href="${ctx}/assets/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
|
|
<link href="${ctx}/assets/ionicon/css/ionicons.min.css" rel="stylesheet" />
|
|
<link href="${ctx}/css/material-design-iconic-font.min.css" rel="stylesheet">
|
|
|
|
|
|
<!-- 自定义样式 -->
|
|
<%--<link href="${ctx}/hbcyjc/resourceNew/css/cjy_style.css" rel="stylesheet" />--%>
|
|
<%--<link href="${ctx}/hbcyjc/resourceNew/css/cjy_style2.css" rel="stylesheet" />--%>
|
|
<%--<link href="${ctx}/hbcyjc/resourceNew/css/cjy_zlmxg.css" rel="stylesheet" />--%>
|
|
|
|
<%@include file="/common/theme_css.jsp"%>
|
|
|
|
<link rel="stylesheet" type="text/css" href="${ctx}/hbcyjc/region/130000/yuanxing/static/css/pre_version_adapter.css"/>
|
|
<!-- checkbox 单选多选美化 -->
|
|
<script src="${ctx}/hbcyjc/resourceNew/js/checkbox.js"></script>
|
|
<script src="${ctx}/js/layer/layer.js"></script>
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
|
|
$('input').customInput();
|
|
$('.toggle').each(function() {
|
|
$('div:first', this).addClass('first');
|
|
$('div:last', this).addClass('last');
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
//表单验证
|
|
$(function() {
|
|
$.validator.setDefaults({
|
|
submitHandler : function(mainForm) {
|
|
mainForm.submit();
|
|
}
|
|
});
|
|
$("#mainForm").validate({
|
|
rules : {
|
|
"planName" : {
|
|
required : true
|
|
},
|
|
"planArrangement" : {
|
|
required : true
|
|
},
|
|
"subordinateRegion" : {
|
|
required : true
|
|
},
|
|
"eventType" : {
|
|
required : true
|
|
},
|
|
"leadUnit" : {
|
|
required : true
|
|
},
|
|
"contactInformation" : {
|
|
required : true
|
|
},
|
|
"editorInChief" : {
|
|
required : true
|
|
},
|
|
"province" : {
|
|
required : true
|
|
},
|
|
"city" : {
|
|
required : true
|
|
},
|
|
"county" : {
|
|
required : true
|
|
},
|
|
"effectiveDates" : {
|
|
required : true
|
|
}
|
|
},
|
|
messages : {
|
|
"planName" : {
|
|
required : "请输入预案名称"
|
|
},
|
|
"planArrangement" : {
|
|
required : "请选择预案层次"
|
|
},
|
|
"subordinateRegion" : {
|
|
required : "请选择所属区域"
|
|
},
|
|
"eventType" : {
|
|
required : "请选择事件类型"
|
|
},
|
|
"leadUnit" : {
|
|
required : "请输入牵头单位"
|
|
},
|
|
"contactInformation" : {
|
|
required : "请输入联系方式 "
|
|
},
|
|
"editorInChief" : {
|
|
required : "请选择主编单位"
|
|
},
|
|
"province" : {
|
|
required : "请选择省 "
|
|
},
|
|
"city" : {
|
|
required : "请选择市 "
|
|
},
|
|
"county" : {
|
|
required : "请选择县 "
|
|
},
|
|
"effectiveDates" : {
|
|
required : "请选择生效日期 "
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
//保存
|
|
function save() {
|
|
if ($("#mainForm").valid()) {
|
|
var options = {
|
|
type : "post",
|
|
url : "${ctx}/yjglyjyagl/insertYjglYjyagl.do",
|
|
dataType : "json",
|
|
data : {},
|
|
success : function(json) {
|
|
var num = json.dataList;
|
|
if (1 == num[0]) {
|
|
layer.msg("保存成功!");
|
|
// parent.init();
|
|
setInterval(function() {
|
|
var index = parent.layer.getFrameIndex(window.name);
|
|
parent.layer.close(index); //关闭当前页
|
|
}, 3000);
|
|
}else{
|
|
layer.msg("保存失败!");
|
|
}
|
|
}
|
|
}
|
|
$("#mainForm").ajaxSubmit(options);
|
|
}
|
|
}
|
|
//重置
|
|
function reset() {
|
|
mainForm.reset();
|
|
}
|
|
//返回
|
|
function reback() {
|
|
// location.href="${ctx}/yjglyjyagl/searchYjglYjyaglList.do";
|
|
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
|
|
parent.layer.close(index) //关闭弹出框
|
|
}
|
|
//显示地图
|
|
function openMap() {
|
|
var url = "${ctx}/back/map_zb.jsp?temp=" + new Date().getTime();
|
|
window.parent.popWin(url);
|
|
}
|
|
//选择地区
|
|
function openregion() {
|
|
var url = "${ctx}/sysregion/regionList.do";
|
|
window.parent.popWin(url);
|
|
}
|
|
|
|
|
|
$(document).ready(function() {
|
|
if('${isDept}'=='city'){
|
|
$("#county").val('${county}');
|
|
chooseCounty();
|
|
}else if('${isDept}'=='province'){
|
|
$("#city").val('${city}');
|
|
chooseCity();
|
|
$("#county").val('${county}');
|
|
chooseCounty();
|
|
}
|
|
if($("#city").val()==null){
|
|
if($("#county").val()!=null){
|
|
$("#city").css("display","none");
|
|
}
|
|
}
|
|
});
|
|
|
|
//选择市
|
|
function chooseCity(){
|
|
var deptid = $("#province").val();
|
|
if(deptid){
|
|
$.ajax({
|
|
url : "${ctx}/sysdept/selectBydpid.do",
|
|
data : {"deptid" : deptid},
|
|
type : "post",
|
|
dataType : "json",
|
|
async : false,
|
|
success : function(data) {
|
|
document.getElementById("city").options.length=0;//删除所有option
|
|
$("#city").append("<option value=''>-请选择-</option>");
|
|
if(data!=null && data.length>0){
|
|
for(var i=0;i<data.length;i++){
|
|
$("#city").append("<option value='"+data[i].dremark+"'>"+data[i].dname+"</option>");
|
|
}
|
|
$("#city option[value='${city}']").attr("selected",true);
|
|
}
|
|
}
|
|
});
|
|
}else{
|
|
document.getElementById("city").options.length=0;//删除所有option
|
|
$("#city").append("<option value=''>-请选择-</option>");
|
|
}
|
|
}
|
|
|
|
//选择区/县
|
|
function chooseCounty(){
|
|
var deptid = $("#city").val();
|
|
if(deptid){
|
|
$.ajax({
|
|
url : "${ctx}/sysdept/selectBydpid.do",
|
|
data : {"deptid" : deptid},
|
|
type : "post",
|
|
dataType : "json",
|
|
async : false,
|
|
success : function(data) {
|
|
document.getElementById("county").options.length=0;//删除所有option
|
|
$("#county").append("<option value=''>-请选择-</option>");
|
|
if(data!=null && data.length>0){
|
|
for(var i=0;i<data.length;i++){
|
|
$("#county").append("<option value='"+data[i].dremark+"'>"+data[i].dname+"</option>");
|
|
}
|
|
$("#county option[value='${county}']").attr("selected",true);
|
|
}
|
|
}
|
|
});
|
|
}else{
|
|
document.getElementById("county").options.length=0;//删除所有option
|
|
$("#county").append("<option value=''>-请选择-</option>");
|
|
}
|
|
}
|
|
</script>
|
|
</head>
|
|
<body class="cj-page-bg">
|
|
<div class="xingk_nr"></div>
|
|
<div class="content">
|
|
<div class="container">
|
|
<!-- Form-validation -->
|
|
<ul class="bdmall-tab">
|
|
<li class="active" onclick="showitem(this,'div_1')">
|
|
<p>基本信息</p> <span class="jb-lefts"><img
|
|
src="${ctx }/hbcyjc/resourceNew/images/jb-lefts.png" /></span> <span
|
|
class="jb-leftx"><img
|
|
src="${ctx }/hbcyjc/resourceNew/images/jb-leftx.png" /></span> <span
|
|
class="jb-rights"><img
|
|
src="${ctx }/hbcyjc/resourceNew/images/jb-rights.png" /></span> <span
|
|
class="jb-rightx"><img
|
|
src="${ctx }/hbcyjc/resourceNew/images/jb-rightx.png" /></span>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="bdmall-tab-list" id="div_1">
|
|
<form class="form_meren" id="mainForm" name="mainForm" method="post" action="${ctx}/yjglyjyagl/insertYjglYjyagl.do" enctype="multipart/form-data">
|
|
|
|
<div class="form_hang ">
|
|
<label for="logname" class="form_label"> <span
|
|
class="text-danger">*</span>预案名称
|
|
</label>
|
|
<div class="form_input">
|
|
<input class="form-control " id="planName" name="planName"
|
|
type="text" placeholder="预案名称">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form_hang ">
|
|
<label for="logname" class="form_label"> <span
|
|
class="text-danger">*</span>预案层次
|
|
</label>
|
|
<div class="form_select">
|
|
<select class="form-control " id="planArrangement" name="planArrangement">
|
|
<option value="">-请选择-</option>
|
|
<c:forEach items="${yaccList }" var="list">
|
|
<option value="${list.dicid }">${list.dicname }</option>
|
|
</c:forEach>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="form_hang">
|
|
<label for="logname" class="form_label"> <span
|
|
class="text-danger">*</span>事件类型
|
|
</label>
|
|
<div class="form_select">
|
|
<select class="form-control " id="eventType" name="eventType">
|
|
<option value="">-请选择-</option>
|
|
<c:forEach items="${typeList }" var="list">
|
|
<option value="${list.dicid }">${list.dicname }</option>
|
|
</c:forEach>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form_hang ">
|
|
<label for="logname" class="form_label"> <span
|
|
class="text-danger">*</span>所属区域
|
|
</label>
|
|
<div class="dbtn">
|
|
<div class="zdsy" style="margin-right: -7px">
|
|
<div class="pf-2" style="width: 33%;">
|
|
<div class="jd">
|
|
<select class="form-control" id="province" name="province" onchange="chooseCity()" style="width: 100%;height: 30px">
|
|
<c:forEach items="${provinceList}" var="dept">
|
|
<c:choose>
|
|
<c:when test="${dept.dremark == province}">
|
|
<option value="${dept.dremark}" selected="selected">${dept.dname}</option>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<option value="${dept.dremark}">${dept.dname}</option>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</c:forEach>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="pf-2" style="width: 33%;">
|
|
<div class="wd">
|
|
<select class="form-control" id="city" name="city" onchange="chooseCounty()" style="width: 100%;height: 30px">
|
|
<c:forEach items="${cityList}" var="dept">
|
|
<c:choose>
|
|
<c:when test="${dept.dremark == city}">
|
|
<option value="${dept.dremark}" selected="selected">${dept.dname}</option>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<option value="${dept.dremark}">${dept.dname}</option>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</c:forEach>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="pf-2" style="width: 33%;">
|
|
<div class="wd">
|
|
<select class="form-control" id="county" name="county" style="width: 100%;height: 30px">
|
|
<c:forEach items="${countyList}" var="dept">
|
|
<c:choose>
|
|
<c:when test="${dept.dremark == county}">
|
|
<option value="${dept.dremark}" selected="selected">${dept.dname}</option>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<option value="${dept.dremark}">${dept.dname}</option>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</c:forEach>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form_hang ">
|
|
<label for="logname" class="form_label"> <span
|
|
class="text-danger">*</span>牵头单位
|
|
</label>
|
|
<div class="form_input">
|
|
<input class="form-control " id="leadUnit" name="leadUnit"
|
|
type="text">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form_hang ">
|
|
<label for="logname" class="form_label"> <span
|
|
class="text-danger">*</span>联系方式
|
|
</label>
|
|
<div class="form_input">
|
|
<input class="form-control " id="contactInformation"
|
|
name="contactInformation" type="text">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form_hang ">
|
|
<label for="logname" class="form_label"> <span
|
|
class="text-danger">*</span>主编单位
|
|
</label>
|
|
<div class="form_select">
|
|
<select class="form-control " id="editorInChief" name="editorInChief">
|
|
<option value="">-请选择-</option>
|
|
<c:forEach items="${dataList }" var="list">
|
|
<option value="${list.dicid }">${list.dicname }</option>
|
|
</c:forEach>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form_hang ">
|
|
<label for="logname" class="form_label"><span
|
|
class="text-danger">*</span>生效日期 </label>
|
|
<div class="form_input">
|
|
<input class="form-control " id="effectiveDate"
|
|
name="effectiveDates" type="text">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form_hang ">
|
|
<label for="logname" class="form_label"> <span
|
|
class="text-danger"></span>编制目的
|
|
</label>
|
|
<div class="form_input">
|
|
<input class="form-control " id="compilationPurpose"
|
|
name="compilationPurpose" type="text">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form_hang ">
|
|
<label for="logname" class="form_label"><span
|
|
class="text-danger"></span>编制依据 </label>
|
|
<div class="form_input">
|
|
<input class="form-control " id="compilationBasis"
|
|
name="compilationBasis" type="text">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form_hang ">
|
|
<label for="logname" class="form_label"><span
|
|
class="text-danger"></span>适用范围 </label>
|
|
<div class="form_input">
|
|
<input class="form-control " id="scopeOfApplication"
|
|
name="scopeOfApplication" type="text">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form_hang ">
|
|
<label for="logname" class="form_label"> <span
|
|
class="text-danger"></span>工作原则
|
|
</label>
|
|
<div class="form_input">
|
|
<input class="form-control " id="workingPrinciple"
|
|
name="workingPrinciple" type="text">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form_hang ">
|
|
<label for="logname" class="form_label"> <span
|
|
class="text-danger"></span>指挥体系
|
|
</label>
|
|
<div class="form_input">
|
|
<input class="form-control " id="commandSystem"
|
|
name="commandSystem" type="text">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form_hang ">
|
|
<label for="logname" class="form_label"> <span
|
|
class="text-danger"></span>职责
|
|
</label>
|
|
<div class="form_input">
|
|
<input class="form-control " id="duty" name="duty" type="text">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form_hang ">
|
|
<label for="logname" class="form_label"><span
|
|
class="text-danger"></span>事件分级说明 </label>
|
|
<div class="form_input">
|
|
<input class="form-control " id="eventClassificationDescription"
|
|
name="eventClassificationDescription" type="text">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form_hang ">
|
|
<label for="logname" class="form_label"><span
|
|
class="text-danger"></span>备注 </label>
|
|
<div class="form_input">
|
|
<input class="form-control " id="remarks" name="remarks" type="text">
|
|
</div>
|
|
</div>
|
|
|
|
<%-- <div class="form_hang ">
|
|
<label for="logname" class="form_label"> <span
|
|
class="text-danger"></span>附件
|
|
</label>
|
|
<div class="form_input">
|
|
<input class="form-control " id="enclosure" name="enclosure"
|
|
type="text">
|
|
</div>
|
|
</div>--%>
|
|
<div class="form_hang form_hang_tongh">
|
|
<label class="form_label">附件 </label>
|
|
<label class="form_label">附件 </label>
|
|
<div class="form_scy">
|
|
<div class="fileInput">
|
|
<input type="file" id="file_logo" name="file_logo" accept=".bmp,.jpg,.png,.tif,.gif,.svg,.psd,.ai,.jpeg,.docx,.doc,.xlsx,.xls,.pdf" class="upfile" onchange="fileupload(this)"/>
|
|
<input class="upFileBtn bttn bttn_ss" type="button" value="请选择"
|
|
onclick="document.getElementById('file_logo').click()" />
|
|
<input type="hidden" id="enclosure" name="enclosure"/>
|
|
</div>
|
|
<div class="scpic" id="show_logo">
|
|
<%-- <div class="img-pic" style="background-image:url('${lis.logo }')"></div>--%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="clear"></div>
|
|
<p class="form-btncz">
|
|
<button class="bttn bttn_bc" type="button" onclick="save()">
|
|
<i class="fa fa-save"></i>保存
|
|
</button>
|
|
<!-- <button class="bttn bttn_bc" onclick="savejbxx()" type="button"><i class="fa fa-save"></i>保存</button> -->
|
|
<button class="bttn" type="button" onclick="reback()">
|
|
<i class="fa fa-reply"></i>返回
|
|
</button>
|
|
</p>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<!--form validation-->
|
|
<script type="text/javascript"
|
|
src="${ctx}/assets/jquery.validate/jquery.validate.min.js"></script>
|
|
<!--选项卡-->
|
|
<script>
|
|
function showitem(e, id) {
|
|
$(e).parent().find('li').removeClass('active');
|
|
$(e).addClass('active');
|
|
$('.bdmall-tab-list').css("display", 'none');
|
|
$('#' + id).css("display", '');
|
|
|
|
}
|
|
</script>
|
|
|
|
<script type="text/javascript" src="${ctx}/js/laydate5.09/laydate.js"></script>
|
|
<script type="text/javascript">
|
|
//时间选择器
|
|
laydate.render({
|
|
elem : '#effectiveDate',
|
|
theme : 'datecolor',
|
|
type : 'datetime'
|
|
});
|
|
|
|
//文件上传
|
|
function fileupload(file) {
|
|
var fileTypes = ['.jpg' ,'.png' , '.jpeg' , '.gif' , '.bmp','.svg','.psd','.docx','.doc','.xlsx','.xls','.pdf',];
|
|
var filePath = file.value;
|
|
var obj = filePath.lastIndexOf("\\");
|
|
let filename = filePath.substr(obj+1);
|
|
var options = {
|
|
type: "post",
|
|
dataType: "json",
|
|
url: "${ctx}/yjglyjyagl/uploadfile.do",
|
|
success: function (json) {
|
|
if (json.success) {
|
|
showimg(json,json.type, filename);
|
|
}else{
|
|
$("#logo").val("");
|
|
layer.msg("文件大小不符合要求!");
|
|
return false;
|
|
}
|
|
}
|
|
};
|
|
if (filePath) {
|
|
var filePic = file.files[0]; //选择的文件内容--图片
|
|
var fileType = filePath.slice(filePath.indexOf(".")); //选择文件的格式
|
|
var fileSize = file.files[0].size; //选择文件的大小
|
|
if (fileTypes.indexOf(fileType) == -1) { //判断文件格式是否符合要求
|
|
layer.msg("文件格式不符合要求!");
|
|
return;
|
|
}
|
|
if (fileSize > 1024 * 1024 * 4) {
|
|
layer.msg("文件大小不能超过4M!");
|
|
return;
|
|
}
|
|
$('#mainForm').ajaxSubmit(options);
|
|
}
|
|
}
|
|
function showimg(json,type, filename) {
|
|
|
|
//上传一次后, 先把file清除
|
|
$("#file_logo").val("");
|
|
$("#file_logoxx").val("");
|
|
//给隐藏域赋值, 为了保存图片路径
|
|
var http_path = json.uploadfilehttppath;
|
|
var filepath = json.filepath;
|
|
var filesData = filepath.split(";");
|
|
var _html;
|
|
for (var i = 0; i < filesData.length; i++) {
|
|
var fileType = filesData[i].split(",")[0];
|
|
var fileName = filesData[i].split(",")[1];
|
|
if(type == "img"){
|
|
_html = '<div class="img-pic" style="background-image:url('+ http_path + fileName +')">' +
|
|
'<a class="pic_delete" href="javascript:deleteimg(\'' + fileType + '\',\'' + fileName + '\',\'' + http_path + '\')"><i class="fa ion-close"></i></a></div>';
|
|
} else{
|
|
_html = '<a download="download" href="'+ http_path + fileName +'">' + filename + '</a>';
|
|
$("#show_logo").html(_html);
|
|
$("#enclosure").val(http_path + fileName);
|
|
}
|
|
if (fileType == "file_logo") {
|
|
$("#show_logo").html(_html);
|
|
$("#enclosure").val(http_path + fileName );
|
|
} else if (fileType == "file_logoxx") {
|
|
$("#show_logoxx").html(_html);
|
|
// $("#enclosure").val(toiletPicturexx);
|
|
$("#enclosure").val(http_path + fileName);
|
|
}
|
|
}
|
|
}
|
|
|
|
function deleteimg() {
|
|
$("#show_logo").html('');
|
|
$("#enclosure").val('');
|
|
}
|
|
//上传图片信息
|
|
function fileupload_many(file) {
|
|
var fileTypes = ['.jpg' ,'.png' , '.jpeg' , '.gif' , '.bmp','.svg','.psd'];
|
|
var filePath = file.value;
|
|
if (filePath) {
|
|
var filePic = file.files[0]; //选择的文件内容--图片
|
|
var fileType = filePath.slice(filePath.indexOf(".")); //选择文件的格式
|
|
var fileSize = file.files[0].size; //选择文件的大小
|
|
if (fileTypes.indexOf(fileType) == -1) { //判断文件格式是否符合要求
|
|
alert("文件格式不符合要求!");
|
|
return;
|
|
if (fileSize > 1024 * 1024 * 6) {
|
|
alert("文件大小不能超过6M!");
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
var options = {
|
|
type: "post",
|
|
dataType: "json",
|
|
url: "${ctx}/lylibrary/uploadfile.do",
|
|
success: function (json) {
|
|
if (json.success) {
|
|
//上传一次后, 先把file清除
|
|
$("#otherfiles").val("");
|
|
//给隐藏域赋值, 为了保存图片路径
|
|
var http_path = json.uploadfilehttppath;//文件显示路径
|
|
var filepath = json.filepath;
|
|
var filesData = filepath.split(";");
|
|
for (var i = 0; i < filesData.length; i++) {
|
|
var fileType = filesData[i].split(",")[0];//文件类型
|
|
var fileName = filesData[i].split(",")[1];//文件名
|
|
var _html = '<div class="img-pic" style="background-image:url(\'' + http_path + fileName + '\')">' +
|
|
'<a class="pic_delete" href="javascript:deleteimg(\'' + fileType + '\',\'' + fileName + '\',\'' + http_path + '\')"><i class="fa ion-close"></i></a></div>';
|
|
if (fileType == "otherfiles") {
|
|
$("#picturelis").append(_html);
|
|
var files_path = $("#files_path").val();
|
|
fileName = http_path + fileName;
|
|
if (!isEmpty(files_path)) {
|
|
fileName = files_path + fileName;
|
|
}
|
|
$("#files_path").val(fileName + ",");
|
|
}
|
|
}
|
|
var files_path = $("#files_path").val();
|
|
// alert(files_path);
|
|
}
|
|
}
|
|
};
|
|
$('#from_picture').ajaxSubmit(options);
|
|
}
|
|
//删除图片后, 展示图片
|
|
function showfile(fileType, files_path, http_path) {
|
|
$("#picturelis").html("");
|
|
if (!isEmpty(files_path)) {
|
|
files_path = files_path.substring(0, files_path.length - 1);
|
|
var filearr = files_path.split(",");
|
|
for (var i = 0; i < filearr.length; i++) {
|
|
var _html = '<div class="img-pic" style="background-image:url(\'' + http_path + filearr[i] + '\')">' +
|
|
'<a class="pic_delete" href="javascript:deleteimg(\'' + fileType + '\',\'' + filearr[i] + '\',\'' + http_path + '\')"><i class="fa ion-close"></i></a></div>';
|
|
$("#picturelis").append(_html);
|
|
}
|
|
}
|
|
}
|
|
/**
|
|
* 判断是否为空, 如果是null返回true
|
|
*/
|
|
function isEmpty(text) {
|
|
if (text != null && text != "null" && text != "" && text != "undefined" && text != undefined) {
|
|
return false;
|
|
} else {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|