您好,登錄后才能下訂單哦!
<div class="form-group">
<label class="col-xs-2 control-label col-xs-offset-1">系統圖片</label>
<div class="col-xs-7">
<div class="input-group" ng-show="YES">
<input class="file-name form-control" type="text" readonly="readonly" id="fileItem" value="`fileItem`.`name`" ng-model="fileItem.name"/>
<div class="input-group-btn">
<input type="file" accept="p_w_picpath/*" file-model="myFile" name="certificate" class='input-file files fff' id="f" onchange="txt.value=this.value" size="1" hidefocus nv-file-select uploader="uploader"/>
<input type="button" onmousemove="f.style.pixelLeft=event.x-60;f.style.pixelTop=this.offsetTop;" value="選擇圖片" size="30" onclick="f.click()" class=" btn-info btn liulan">
</div>
</div>
<div class="input-group" ng-show="NO">
<div class="input-group-btn">
<input class="form-control" readonly type="text" name="branchPn_add" name="sysImagePc_add" value="`sysImagePc_add`" ng-model="sysImagePc_add" >
<input type="button" value="重新選擇" ng-click="chooseAgain()" size="30" class=" btn-info btn liulan">
</div>
</div>
<div class="input-group imgSrc" ng-show="YESs">
<img ng-src="`p_w_picpathSrc`" id="iSrc" />
</div>
<br />
<a class="btn btn-info" ng-click='UploadFile()'>上傳</a>
<a class="btn btn-default" ng-click="EditloadFile()">取消</a>
</div>
</div>
//新增系統-開始出現彈窗
$scope.addSystem = function(){
$scope.YESs = t2;
$scope.YES = t1;
$scope.NO = t2;
$scope.p_w_picpathSrc = "";
$('#fileItem').val("");
// $scope.createUser_add = $scope.LoginList.employeeName
}
//新增系統-重新選擇
$scope.chooseAgain = function(){
$scope.YES = t1;
$scope.YESs = t2;
$scope.NO = t2;
$scope.fileItem = null;
$scope.p_w_picpathSrc = false;
}
//新增系統-上傳圖片預覽
$scope.getFile = function () {
fileReader.readAsDataUrl($scope.file, $scope)
.then(function(result) {
$scope.sysImagePc_edit = result;
$scope.YESs = t1;
$scope.sysImagePc_edit = result;
$scope.p_w_picpathSrc = result;
$scope.fileItem = $scope.file;
});
};
//新增系統-點擊上傳
$scope.uploadStatus = false;
var uploader = $scope.uploader = new FileUploader({
url: '/FileServlet',
queueLimit: 1,
removeAfterUpload: true
});
uploader.onAfterAddingFile = function(fileItem) {
$scope.fileItem = fileItem._file;
};
uploader.onSuccessItem = function(fileItem, response, status, headers) {
$scope.uploadStatus = true;
$scope.sysImagePc_add = response;
$scope.sysImagePc_edit = response;
$scope.YESs = t2;
$scope.YES = t2;
$scope.NO = t1;
};
$scope.UploadFile = function(){
uploader.uploadAll();
};
//新增產品-選擇圖片--取消
$scope.EditloadFile = function(){
$scope.YES = t1;
$scope.YESs = t2;
$scope.NO = t2;
$('#fileItem').val("");
$scope.fileItem = $scope.sysImagePc_edit;
};
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。