|
@@ -36,9 +36,18 @@
|
|
|
list-style: none;
|
|
|
padding-left: 3px;
|
|
|
}
|
|
|
+ .list-group-flush .float-right {
|
|
|
+ padding-right: 5px;
|
|
|
+ }
|
|
|
+ .list-group-flush .icon-x {
|
|
|
+ color:#cdcdcd;font-size: 10px
|
|
|
+ }
|
|
|
.submenu .list-group-item {
|
|
|
padding: 10px 0px 10px 20px;
|
|
|
}
|
|
|
+ .submenu .list-group-item:hover {
|
|
|
+ background-color: rgba(221, 251, 239, 0.56);
|
|
|
+ }
|
|
|
.custom-blue-bold {
|
|
|
color: #1e1e1e; /* Bootstrap 的 primary 颜色 */
|
|
|
font-weight: bold;
|
|
@@ -72,6 +81,26 @@
|
|
|
.field_dist_id .pull-right {
|
|
|
margin-left: auto; /* 将删除按钮推到右侧 */
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ #addFileModal .modal-body {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ height: 100px; /* 可根据需要调整高度 */
|
|
|
+ background-color: #ffffff;
|
|
|
+ }
|
|
|
+ #addFileModal .modal-body div {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ #addFileModal .modal-body .text-right {
|
|
|
+ padding-left: 5px;
|
|
|
+ padding-right: 5px;
|
|
|
+ }
|
|
|
+ #addFileModal .modal-sm {
|
|
|
+ max-width:320px;
|
|
|
+ }
|
|
|
+</style>
|
|
|
</style>
|
|
|
|
|
|
<div class="container-fluid" style="padding: 0px;">
|
|
@@ -114,6 +143,35 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+<!-- Modal -->
|
|
|
+
|
|
|
+
|
|
|
+<!-- Modal -->
|
|
|
+<div class="modal fade" id="addFileModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
|
|
+ <div class="modal-dialog modal-sm" role="document">
|
|
|
+ <div class="modal-content">
|
|
|
+ <div class="modal-header">
|
|
|
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-xs-2 text-right">
|
|
|
+ File Name:
|
|
|
+ </div>
|
|
|
+ <div class="col-xs-8">
|
|
|
+ <input type="hidden" class="form-control" id="file_path_name" name="file_path_name">
|
|
|
+ <input type="text" class="form-control" id="file_name_input" name="file_name_input">
|
|
|
+ </div>
|
|
|
+ <div class="col-xs-2">
|
|
|
+ <button type="button" class="btn btn-success" id="addFileButton">OK</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+
|
|
|
+
|
|
|
<script src="/vendor/ace/ace.js" type="text/javascript"></script>
|
|
|
<script>
|
|
|
//https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ace.js
|
|
@@ -208,6 +266,7 @@
|
|
|
layer.close(loadingIndex);
|
|
|
$('.main-card-body').html(response);
|
|
|
actionclick();
|
|
|
+ delFileButtonClick();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -321,6 +380,77 @@
|
|
|
}
|
|
|
});
|
|
|
})
|
|
|
+
|
|
|
+ //文件新增
|
|
|
+ $('#addFileModal').on('show.bs.modal', function (event) {
|
|
|
+ // 获取触发模态框的元素
|
|
|
+ var button = $(event.relatedTarget);
|
|
|
+ // 获取 file_path_name 的值
|
|
|
+ var filePathName = button.attr('file_path_name');
|
|
|
+ $('#file_path_name').val(filePathName);
|
|
|
+ });
|
|
|
+
|
|
|
+ var ajaxAddDelFile = function (appearance_id,dist_id,fileId,filePathName,fileInputName,type) {
|
|
|
+ $.ajax({
|
|
|
+ url: '/prime-control/dist-template/ace',
|
|
|
+ type: 'POST',
|
|
|
+ data: {
|
|
|
+ act:'add_del_tree',
|
|
|
+ type: type,
|
|
|
+ appearance_id: appearance_id,
|
|
|
+ dist_id: dist_id,
|
|
|
+ file_path_name: filePathName,
|
|
|
+ file_name_input: fileInputName,
|
|
|
+ file_id: fileId
|
|
|
+ },
|
|
|
+ success: function(response) {
|
|
|
+ layer.close(loadingIndex);
|
|
|
+ $("#file_name_input").val('')
|
|
|
+ if (response.status == '1') {
|
|
|
+ Dcat.success('保存成功');
|
|
|
+ //刷新代码树
|
|
|
+ postData();
|
|
|
+ }else{
|
|
|
+ Dcat.error(response.msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ $("#addFileButton").click(function () {
|
|
|
+ var filePathName = $('#file_path_name').val();
|
|
|
+ var fileInputName = $('#file_name_input').val();
|
|
|
+ var appearanceId = $('select[name="appearance_id"]').val();
|
|
|
+ var distId = $('input[name="dist_id"]').val();
|
|
|
+ if (fileInputName == '') {
|
|
|
+ Dcat.error('文件名不能为空');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ loadingIndex = layer.load(1, {
|
|
|
+ shade: [0.5, '#000'] // 设置遮罩层
|
|
|
+ });
|
|
|
+ $('#addFileModal').modal('hide');
|
|
|
+ ajaxAddDelFile(appearanceId,distId,0,filePathName,fileInputName,'add');
|
|
|
+ });
|
|
|
+
|
|
|
+ function delFileButtonClick() {
|
|
|
+ $(".delFileButton").click(function () {
|
|
|
+ var filePathName = "";
|
|
|
+ var fileInputName = "";
|
|
|
+ var appearanceId = $('select[name="appearance_id"]').val();
|
|
|
+ var distId = $('input[name="dist_id"]').val();
|
|
|
+ var fileId = $(this).attr('file_id');
|
|
|
+ var fileName = $(this).attr('file_name');
|
|
|
+ msg = '确定要删除'+fileName+'吗?';
|
|
|
+ Dcat.confirm('确认删除',msg , function () {
|
|
|
+ loadingIndex = layer.load(1, {
|
|
|
+ shade: [0.5, '#000'] // 设置遮罩层
|
|
|
+ });
|
|
|
+ ajaxAddDelFile(appearanceId,distId,fileId,filePathName,fileInputName,'del');
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
});
|
|
|
</script>
|
|
|
|