From b250e78d8e9706a3744bfa30dc43bbfbdbb130ea Mon Sep 17 00:00:00 2001 From: hhx <1284857778@qq.com> Date: Thu, 17 Mar 2022 09:11:22 +0800 Subject: [PATCH] commit --- 04.系统编码/App/App.csproj | 2 + .../statistic-analysis/index.js | 22 ++--- .../user-management/edit-password.js | 85 +++++++++++++++++++ .../system-management/user-management/edit.js | 14 +-- .../user-management/index.js | 13 ++- 04.系统编码/App/Content/styles/common.css | 53 ++++++------ .../App/Views/StatisticAnalysis/Index.cshtml | 7 +- .../Views/UserManagement/EditDialog.cshtml | 4 +- .../UserManagement/EditPasswordDialog.cshtml | 30 +++++++ .../App/Views/UserManagement/Index.cshtml | 7 +- 10 files changed, 178 insertions(+), 59 deletions(-) create mode 100644 04.系统编码/App/Content/scripts/system-management/user-management/edit-password.js create mode 100644 04.系统编码/App/Views/UserManagement/EditPasswordDialog.cshtml diff --git a/04.系统编码/App/App.csproj b/04.系统编码/App/App.csproj index 375e3ce..9cfe204 100644 --- a/04.系统编码/App/App.csproj +++ b/04.系统编码/App/App.csproj @@ -218,6 +218,7 @@ + @@ -356,6 +357,7 @@ + diff --git a/04.系统编码/App/Content/scripts/system-management/statistic-analysis/index.js b/04.系统编码/App/Content/scripts/system-management/statistic-analysis/index.js index 04d89a7..b999da2 100644 --- a/04.系统编码/App/Content/scripts/system-management/statistic-analysis/index.js +++ b/04.系统编码/App/Content/scripts/system-management/statistic-analysis/index.js @@ -28,8 +28,8 @@ var width = $(window).width(); var height = $(window).height(); - $('.manage-table, .manage-table .datagrid').width(width - 247); - $('.manage-table, .manage-table .datagrid').height(height - 109); + $('.manage-table, .manage-table .datagrid').width(width - 267); + $('.manage-table, .manage-table .datagrid').height(height - 435); }; this.OnStatisticTypeClick = function (event) { @@ -120,7 +120,7 @@ this.InitChart = function (series, xAxises, values, name, max) { Highcharts.chart('chart', { chart: { - backgroundColor: '#002145' + backgroundColor: 'rgba(0, 0, 0, 0)' }, title: { useHTML: true, @@ -161,7 +161,7 @@ title: { text: null }, - max: max * 3, + //max: max * 3, labels: { style: { color: '#ffffff', @@ -246,18 +246,6 @@ return moment(time).format('YYYY-MM-DD'); }; - this.ReLoadTableData = function () { - this.statisticGrid.datagrid({ - method: "POST", - url: '/StatisticAnalysis/Query', - queryParams: { - typeCode: $('.statistic-type span.active').attr('type'), - fromTime: $("#from-date").datetimebox('getValue'), - toTime: $("#to-date").datetimebox('getValue') - } - }); - }; - this.InitPieChart = function (series, name) { var firstColors = ['#00d5f6', '#97e6af', '#e4e189', '#dc9884', '#8c83dc', '#7aa9da', '#b7d2ff', '#88f187', '#e3ea79', '#e29f6f']; var lastColors = ['#266cb9', '#229625', '#b3ae15', '#bd3d17', '#3324a9', '#1538e4', '#b7d2ff', '#3ac720', '#cad619', '#d2691f']; @@ -267,7 +255,7 @@ type: 'pie' }, title: { - text: name.slice(2) + '统计占比', + text: name.slice(2) + '占比', style: { color: '#ffffff', fontFamily: '微软雅黑' diff --git a/04.系统编码/App/Content/scripts/system-management/user-management/edit-password.js b/04.系统编码/App/Content/scripts/system-management/user-management/edit-password.js new file mode 100644 index 0000000..c7f268a --- /dev/null +++ b/04.系统编码/App/Content/scripts/system-management/user-management/edit-password.js @@ -0,0 +1,85 @@ +var EditPasswordDialog = function (parent) { + this.Parent = parent; + this.User = {}; + + this.Setup = function () { + $("#edit-password-sure-btn").on("click", this.OnSureButtonClick.bind(this)); + $("#edit-password-cancel-btn").on("click", this.HideDialog.bind(this)); + $("#edit-password-close").on("click", this.HideDialog.bind(this)); + }; + + this.Show = function (data) { + this.User = data; + this.InitOrgList(); + $('#edit-password-dialog').show(); + $("#username").textbox('setValue', data.RealName); + $("#account").textbox('setValue', data.LoginName); + //$("#password").textbox('setValue', data.LoginPassword); + parseInt($('#sex span').eq(0).attr('gender')) === data.Gender ? $('#sex span').eq(0).addClass('active') : $('#sex span').eq(0).removeClass('active'); + parseInt($('#sex span').eq(1).attr('gender')) === data.Gender ? $('#sex span').eq(1).addClass('active') : $('#sex span').eq(1).removeClass('active'); + }; + + this.InitOrgList = function () { + $.ajax({ + type: "POST", + dataType: 'text', + url: '/OrgManagement/Query', + data: { + page: 1, + rows: 10000 + }, + success: function (result) { + console.log(this.User.OrgId) + }.bind(this) + }); + }; + + this.OnSureButtonClick = function () { + this.validation(); + }; + + this.validation = function () { + if ($("#password").textbox('getValue').trim() === '' || $("#password").textbox('getValue').trim === null) { + alert('请输入新密码'); + return + } else if ($("#confirm-password").textbox('getValue').trim() === '' || $("#confirm-password").textbox('getValue').trim === null) { + alert('请输入确认密码'); + return + } else if ($("#password").textbox('getValue') !== $("#confirm-password").textbox('getValue')) { + alert('两次输入的密码不一致'); + return; + } else { + //this.User.OrgId = $('#edit-dialog-org-list').combobox('getValue'); + //this.User.Gender = parseInt($('#sex span.active').attr('gender')); + //this.User.RealName = $("#username").textbox('getValue'); + //this.User.LoginName = $('#account').textbox('getValue'); + //this.User.LoginPassword = $('#password').textbox('getValue'); + + this.EditUser(); + this.HideDialog(); + } + }; + + this.HideDialog = function () { + $('#edit-password-dialog').hide(); + + this.clearInput(); + }; + + this.EditUser = function () { + $.ajax({ + type: "POST", + dataType: 'text', + url: '/UserManagement/Update', + data: this.User, + success: function () { + this.Parent.ReLoadTableData($('#org-list').combobox('getValue')); + }.bind(this) + }); + }; + + this.clearInput = function () { + $('#password').textbox('setValue', ''), + $('#confirm-password').textbox('setValue', '') + }; +}; \ No newline at end of file diff --git a/04.系统编码/App/Content/scripts/system-management/user-management/edit.js b/04.系统编码/App/Content/scripts/system-management/user-management/edit.js index 3acab7d..2b65110 100644 --- a/04.系统编码/App/Content/scripts/system-management/user-management/edit.js +++ b/04.系统编码/App/Content/scripts/system-management/user-management/edit.js @@ -15,7 +15,7 @@ $('#edit-dialog').show(); $("#username").textbox('setValue', data.RealName); $("#account").textbox('setValue', data.LoginName); - $("#password").textbox('setValue', data.LoginPassword); + //$("#password").textbox('setValue', data.LoginPassword); parseInt($('#sex span').eq(0).attr('gender')) === data.Gender ? $('#sex span').eq(0).addClass('active') : $('#sex span').eq(0).removeClass('active'); parseInt($('#sex span').eq(1).attr('gender')) === data.Gender ? $('#sex span').eq(1).addClass('active') : $('#sex span').eq(1).removeClass('active'); }; @@ -63,10 +63,12 @@ } else if ($("#account").textbox('getValue').trim() === '' || $("#account").textbox('getValue').trim === null) { alert('请输入登录账户'); return - } else if ($("#password").textbox('getValue').trim() === '' || $("#password").textbox('getValue').trim === null) { - alert('请输入登录密码'); - return - } else if ($("#password").textbox('getValue').trim().length < 6) { + } + //else if ($("#password").textbox('getValue').trim() === '' || $("#password").textbox('getValue').trim === null) { + // alert('请输入登录密码'); + // return + //} + else if ($("#password").textbox('getValue').trim().length < 6) { alert('密码长度至少为6位'); return } else { @@ -103,7 +105,7 @@ $('#edit-dialog-org-list').combobox('setValue', ''), $("#username").textbox('setValue', ''), $('#account').textbox('setValue', ''), - $('#password').textbox('setValue', ''), + //$('#password').textbox('setValue', ''), $('#sex span').eq(0).addClass("active"); }; }; \ No newline at end of file diff --git a/04.系统编码/App/Content/scripts/system-management/user-management/index.js b/04.系统编码/App/Content/scripts/system-management/user-management/index.js index 5086a4e..8776ea0 100644 --- a/04.系统编码/App/Content/scripts/system-management/user-management/index.js +++ b/04.系统编码/App/Content/scripts/system-management/user-management/index.js @@ -4,6 +4,7 @@ this.selectedRow = []; this.AddDialog = new AddDialog(this); this.EditDialog = new EditDialog(this); + this.EditPasswordDialog = new EditPasswordDialog(this); this.Startup = function () { $('#manage').addClass('active'); @@ -15,9 +16,11 @@ this.AddDialog.Setup(); this.EditDialog.Setup(); + this.EditPasswordDialog.Setup(); $('#add-btn').on('click', this.OnAddButtonClick.bind(this)); $('#edit-btn').on('click', this.onEditButtonClick.bind(this)); + $('#edit-password-btn').on('click', this.onEditPasswordButtonClick.bind(this)); $('#delete-btn').on('click', this.onDeleteButtonClick.bind(this)); $('#query-btn').on('click', this.onQueryButtonClick.bind(this)); $('#delete-dialog-close').on('click', this.CloseDeleteDialog.bind(this)); @@ -162,8 +165,7 @@ //set buttons disabled state $('#edit-btn').prop('disabled', row === null); $('#delete-btn').prop('disabled', row === null); - $('#enable-btn').prop('disabled', row.isEnable !== 1 ? null : true); - $('#disable-btn').prop('disabled', row.isEnable === 1 ? null : true); + $('#edit-password-btn').prop('disabled', row === null); }; this.OnTaskUnselected = function (index, row) { @@ -189,6 +191,10 @@ this.EditDialog.Show(this.selectedRow); }; + this.onEditPasswordButtonClick = function () { + this.EditPasswordDialog.Show(this.selectedRow); + }; + this.onDeleteButtonClick = function () { $('.dialog-delete').show(); $('.dialog-clear h2').text('确定删除名为「{0}」的用户吗?'.format(this.selectedRow.RealName)); @@ -220,9 +226,8 @@ this.DisabledEvent = function () { $('#edit-btn').prop('disabled', true); + $('#edit-password-btn').prop('disabled', true); $('#delete-btn').prop('disabled', true); - $('#enable-btn').prop('disabled', true); - $('#disable-btn').prop('disabled', true); }; }; diff --git a/04.系统编码/App/Content/styles/common.css b/04.系统编码/App/Content/styles/common.css index c939cd6..312f53a 100644 --- a/04.系统编码/App/Content/styles/common.css +++ b/04.系统编码/App/Content/styles/common.css @@ -307,6 +307,11 @@ border-right: 0; } +.statistic-table { + background: red; + margin: 0 auto; +} + .tooltip-content { word-break: break-all; } @@ -576,6 +581,7 @@ } .manage-dialog .modal-body .row .col .passwordbox-open { + opacity: 1; background: url("../images/password-open.png") no-repeat center center; } @@ -806,25 +812,38 @@ } .chart { - width: 98%; - height: calc(100vh - 105px); - margin: 0 auto; - position: relative; - /*display: flex; - align-items: center;*/ + width: calc(100% - 20px); + height: 300px; + margin: 10px; + display: flex; + align-items: center; } -.default-chart { - width: 100%; +.chart-item { + width: 60%; height: 100%; + padding: 10px; + background: #052a50; + border-radius: 3px; + box-shadow: 0 0 10px rgba(93, 144, 210, 0.25) inset; +} + +.chart-item:last-of-type { + width: calc(40% - 10px); + margin-left: 10px; +} + +.default-chart { + /*width: 100%; + height: 100%;*/ } .pie-chart { - width: 350px; + /*width: 350px; height: 350px; position: absolute; top: 40px; - right: 0; + right: 0;*/ } .highcharts-title { @@ -832,20 +851,6 @@ text-align: center; } -.chart-item { - width: 60%; - height: 500px; - padding: 10px; - background: #052a50; - border-radius: 3px; - box-shadow: 0 0 10px rgba(93, 144, 210, 0.25) inset; -} - -.chart-item:last-of-type { - width: 39%; - margin-left: 1%; -} - ::-webkit-scrollbar { width: 7px; height: 7px; diff --git a/04.系统编码/App/Views/StatisticAnalysis/Index.cshtml b/04.系统编码/App/Views/StatisticAnalysis/Index.cshtml index 14b3c41..a0e310b 100644 --- a/04.系统编码/App/Views/StatisticAnalysis/Index.cshtml +++ b/04.系统编码/App/Views/StatisticAnalysis/Index.cshtml @@ -39,8 +39,11 @@
-
-
+
+
+
+
+
diff --git a/04.系统编码/App/Views/UserManagement/EditDialog.cshtml b/04.系统编码/App/Views/UserManagement/EditDialog.cshtml index 4c7b8cd..f90db09 100644 --- a/04.系统编码/App/Views/UserManagement/EditDialog.cshtml +++ b/04.系统编码/App/Views/UserManagement/EditDialog.cshtml @@ -32,10 +32,10 @@ -
+ @*
-
+
*@ diff --git a/04.系统编码/App/Views/UserManagement/EditPasswordDialog.cshtml b/04.系统编码/App/Views/UserManagement/EditPasswordDialog.cshtml new file mode 100644 index 0000000..2f31e87 --- /dev/null +++ b/04.系统编码/App/Views/UserManagement/EditPasswordDialog.cshtml @@ -0,0 +1,30 @@ +
+ +
\ No newline at end of file diff --git a/04.系统编码/App/Views/UserManagement/Index.cshtml b/04.系统编码/App/Views/UserManagement/Index.cshtml index 15c0b75..0069611 100644 --- a/04.系统编码/App/Views/UserManagement/Index.cshtml +++ b/04.系统编码/App/Views/UserManagement/Index.cshtml @@ -25,12 +25,9 @@
+
- @*
- - -
*@
机构名称 @@ -63,10 +60,12 @@ @{ Html.RenderPartial("/Views/UserManagement/AddDialog.cshtml"); Html.RenderPartial("/Views/UserManagement/EditDialog.cshtml"); + Html.RenderPartial("/Views/UserManagement/EditPasswordDialog.cshtml"); } @section scripts { + } \ No newline at end of file