1. 修改myUser 資料
2. 公司管理上傳圖片 3. 加入電站資訊頁面
@ -5,6 +5,7 @@ using SolarPower.Models.Company;
|
||||
using SolarPower.Repository.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@ -13,10 +14,16 @@ namespace SolarPower.Controllers
|
||||
public class CompanyController : MyBaseController<CompanyController>
|
||||
{
|
||||
private readonly ICompanyRepository companyRepository;
|
||||
private string logoPath = "/upload/company_logo/";
|
||||
private string logoSaveAsPath = "";
|
||||
|
||||
public CompanyController(ICompanyRepository companyRepository) : base()
|
||||
{
|
||||
this.companyRepository = companyRepository;
|
||||
|
||||
var xxx = Directory.GetCurrentDirectory();
|
||||
|
||||
logoSaveAsPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "upload", "company_logo");
|
||||
}
|
||||
|
||||
public IActionResult Index()
|
||||
@ -70,8 +77,18 @@ namespace SolarPower.Controllers
|
||||
|
||||
companies = await companyRepository.GetAllByFilterAsync(post);
|
||||
|
||||
foreach(var company in companies)
|
||||
foreach (var company in companies)
|
||||
{
|
||||
//替換logo src
|
||||
if (!string.IsNullOrEmpty(company.Logo))
|
||||
{
|
||||
company.Logo = logoPath + company.Logo;
|
||||
}
|
||||
else
|
||||
{
|
||||
company.Logo = logoPath + "default.png";
|
||||
}
|
||||
|
||||
//找出當前狀態正常使用者人數
|
||||
var registerNumber = await companyRepository.GetNormalUserNumberByCompanyIdAsync(company.Id);
|
||||
|
||||
@ -79,8 +96,8 @@ namespace SolarPower.Controllers
|
||||
|
||||
//if(mySimpleCompany.Id == 1)
|
||||
//{
|
||||
company.Function = @"
|
||||
<a href='javascript:;' class='btn btn-success btn-pills waves-effect waves-themed company-auth-btn'>權限池</a>
|
||||
company.Function = @"
|
||||
<button type='button' class='btn btn-success btn-pills waves-effect waves-themed company-auth-btn'>權限池</button>
|
||||
<button type='button' class='btn btn-primary btn-pills waves-effect waves-themed edit-btn'>修改</button>
|
||||
<button type='button' class='btn btn-danger btn-pills waves-effect waves-themed del-btn'>刪除</button>";
|
||||
//}
|
||||
@ -159,7 +176,7 @@ namespace SolarPower.Controllers
|
||||
/// <param name="post"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<ApiResult<string>> SaveCompany(PostCompany post)
|
||||
public async Task<ApiResult<string>> SaveCompany([FromForm] PostCompany post)
|
||||
{
|
||||
ApiResult<string> apiResult = new ApiResult<string>();
|
||||
|
||||
@ -184,21 +201,22 @@ namespace SolarPower.Controllers
|
||||
//先檢查統編是否已被使用
|
||||
var exist = await companyRepository.GetOneNormalSimpleCompanyByTaxIDNumber(post.TaxIDNumber);
|
||||
|
||||
if(exist != null)
|
||||
if (exist != null)
|
||||
{
|
||||
apiResult.Code = "9995";
|
||||
apiResult.Msg = errorCode.GetString(apiResult.Code);
|
||||
return apiResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
company = new Company()
|
||||
{
|
||||
Name = post.Name,
|
||||
//Logo = post.Logo,
|
||||
TaxIDNumber = post.TaxIDNumber,
|
||||
Phone = post.Phone,
|
||||
Address = post.Address,
|
||||
RegisterUpperLimit= post.RegisterUpperLimit,
|
||||
RegisterUpperLimit = post.RegisterUpperLimit,
|
||||
CreatedBy = myUser.Id
|
||||
};
|
||||
|
||||
@ -212,7 +230,36 @@ namespace SolarPower.Controllers
|
||||
"CreatedBy",
|
||||
};
|
||||
|
||||
await companyRepository.AddAsync(company, properties);
|
||||
var id = await companyRepository.AddAsync(company, properties);
|
||||
|
||||
//處裡公司Logo圖片
|
||||
if (post.LogoFile != null)
|
||||
{
|
||||
var split = post.LogoFile.FileName.Split(".");
|
||||
var fileName = id + "." + split[split.Length - 1];
|
||||
|
||||
var fullPath = Path.Combine(logoSaveAsPath, fileName);
|
||||
|
||||
using (var stream = new FileStream(fullPath, FileMode.Create))
|
||||
{
|
||||
post.LogoFile.CopyTo(stream);
|
||||
}
|
||||
|
||||
UpdateCompany updateCompany = new UpdateCompany()
|
||||
{
|
||||
Id = id,
|
||||
Logo = fileName
|
||||
};
|
||||
|
||||
properties = new List<string>()
|
||||
{
|
||||
"Id",
|
||||
"Logo"
|
||||
};
|
||||
|
||||
await companyRepository.UpdateCompany(updateCompany, properties);
|
||||
}
|
||||
|
||||
apiResult.Code = "0000";
|
||||
apiResult.Msg = "儲存成功";
|
||||
#endregion
|
||||
@ -223,7 +270,7 @@ namespace SolarPower.Controllers
|
||||
|
||||
//先檢查統編是否已被使用
|
||||
var exist = await companyRepository.GetOneNormalSimpleCompanyByTaxIDNumber(post.TaxIDNumber);
|
||||
if(exist != null && exist.Id != company.Id)
|
||||
if (exist != null && exist.Id != company.Id)
|
||||
{
|
||||
apiResult.Code = "9995";
|
||||
apiResult.Msg = errorCode.GetString(apiResult.Code);
|
||||
@ -242,7 +289,6 @@ namespace SolarPower.Controllers
|
||||
UpdatedBy = myUser.Id,
|
||||
};
|
||||
|
||||
|
||||
List<string> properties = new List<string>()
|
||||
{
|
||||
"Id",
|
||||
@ -256,6 +302,34 @@ namespace SolarPower.Controllers
|
||||
|
||||
await companyRepository.UpdateCompany(update, properties);
|
||||
|
||||
//處裡公司Logo圖片
|
||||
if (post.LogoFile != null)
|
||||
{
|
||||
var split = post.LogoFile.FileName.Split(".");
|
||||
var fileName = company.Id + "." + split[split.Length - 1];
|
||||
|
||||
var fullPath = Path.Combine(logoSaveAsPath, fileName);
|
||||
|
||||
using (var stream = new FileStream(fullPath, FileMode.Create))
|
||||
{
|
||||
post.LogoFile.CopyTo(stream);
|
||||
}
|
||||
|
||||
update = new UpdateCompany()
|
||||
{
|
||||
Id = company.Id,
|
||||
Logo = fileName
|
||||
};
|
||||
|
||||
properties = new List<string>()
|
||||
{
|
||||
"Id",
|
||||
"Logo"
|
||||
};
|
||||
|
||||
await companyRepository.UpdateCompany(update, properties);
|
||||
}
|
||||
|
||||
apiResult.Code = "0000";
|
||||
apiResult.Msg = "儲存成功";
|
||||
#endregion
|
||||
@ -319,16 +393,15 @@ namespace SolarPower.Controllers
|
||||
/// <returns></returns>
|
||||
public async Task<ActionResult> GetCompanyAuthByCompanyId(int id)
|
||||
{
|
||||
ApiResult<List<CompanyAuth>> apiResult = new ApiResult<List<CompanyAuth>>();
|
||||
ApiResult<List<CompanyAuthDataTable>> apiResult = new ApiResult<List<CompanyAuthDataTable>>();
|
||||
|
||||
int totalRecords = 0; //總資料筆數
|
||||
int recFilter = 0; //過濾後資料筆數
|
||||
|
||||
List<CompanyAuth> companyAuths = null;
|
||||
List<CompanyAuthDataTable> companyAuths = null;
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
companyAuths = await companyRepository.GetCompanyAuthByCompanyId(id);
|
||||
|
||||
totalRecords = companyAuths.Count();
|
||||
@ -355,6 +428,86 @@ namespace SolarPower.Controllers
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<ApiResult<string>> SaveCompanyAuth(PostCompanyAuth post)
|
||||
{
|
||||
ApiResult<string> apiResult = new ApiResult<string>();
|
||||
|
||||
Company company = null;
|
||||
|
||||
try
|
||||
{
|
||||
company = await companyRepository.GetOneAsync(post.SelectedCompanyId);
|
||||
|
||||
if (company == null)
|
||||
{
|
||||
apiResult.Code = "9996";
|
||||
apiResult.Msg = errorCode.GetString(apiResult.Code);
|
||||
return apiResult;
|
||||
}
|
||||
|
||||
List<CompanyAuthDataTable> origCompanyAuths = null; //原先的公司權限池
|
||||
|
||||
origCompanyAuths = await companyRepository.GetCompanyAuthByCompanyId(post.SelectedCompanyId);
|
||||
|
||||
origCompanyAuths = origCompanyAuths.Where(x => x.CheckAuth == 1).ToList();
|
||||
|
||||
//判斷新進來的資料是否要歸類到新增 or 刪除
|
||||
#region 刪除公司權限池
|
||||
|
||||
//找出要刪除的
|
||||
List<CompanyAuth> deletedCompanyAuthStrs = origCompanyAuths.Where(x => !post.CheckAuths.Contains(x.AuthCode)).Select(x => new CompanyAuth { CompanyId = company.Id, AuthCode = x.AuthCode }).ToList();
|
||||
|
||||
//刪除權限池
|
||||
await companyRepository.PurgeCompanyAuth(deletedCompanyAuthStrs);
|
||||
|
||||
//同時刪除該公司底下擁有這些權限的角色
|
||||
await companyRepository.PurgeCompanyRoleAuth(company.Id, deletedCompanyAuthStrs);
|
||||
|
||||
#endregion
|
||||
|
||||
#region 新增公司權限池
|
||||
|
||||
//找出要新增的
|
||||
List<string> insertCompanyAuthStrs = post.CheckAuths.Where(x => !origCompanyAuths.Select(y => y.AuthCode).Contains(x)).ToList();
|
||||
|
||||
List<CompanyAuth> insertCompanyAuths = new List<CompanyAuth>();
|
||||
|
||||
foreach (var checkAuth in insertCompanyAuthStrs)
|
||||
{
|
||||
CompanyAuth companyAuth = new CompanyAuth();
|
||||
companyAuth.CompanyId = company.Id;
|
||||
companyAuth.AuthCode = checkAuth;
|
||||
companyAuth.CreatedBy = myUser.Id;
|
||||
|
||||
insertCompanyAuths.Add(companyAuth);
|
||||
}
|
||||
|
||||
List<string> properties = new List<string>()
|
||||
{
|
||||
"CompanyId",
|
||||
"AuthCode",
|
||||
"CreatedBy",
|
||||
};
|
||||
|
||||
await companyRepository.AddCompanyAuthAsync(insertCompanyAuths, properties);
|
||||
|
||||
#endregion
|
||||
|
||||
apiResult.Code = "0000";
|
||||
apiResult.Msg = "儲存成功";
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
apiResult.Code = "9999";
|
||||
apiResult.Msg = errorCode.GetString(apiResult.Code);
|
||||
string json = System.Text.Json.JsonSerializer.Serialize(post);
|
||||
Logger.LogError("【" + controllerName + "/" + actionName + "】" + json);
|
||||
Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
|
||||
}
|
||||
|
||||
return apiResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 透過公司編號,取得該公司剩餘可註冊的人數
|
||||
/// </summary>
|
||||
|
||||
@ -30,6 +30,7 @@ namespace SolarPower.Controllers
|
||||
protected ILogger<T> Logger => _logger ?? (_logger = HttpContext?.RequestServices.GetService<ILogger<T>>());
|
||||
private IUserRepository userRepository => HttpContext?.RequestServices.GetService<IUserRepository>();
|
||||
private ICompanyRepository companyRepository => HttpContext?.RequestServices.GetService<ICompanyRepository>();
|
||||
private IRoleRepository roleRepository => HttpContext?.RequestServices.GetService<IRoleRepository>();
|
||||
private IOperatorLogRepository operatorLogRepository => HttpContext?.RequestServices.GetService<IOperatorLogRepository>();
|
||||
|
||||
protected MyUser myUser = null;
|
||||
@ -62,10 +63,26 @@ namespace SolarPower.Controllers
|
||||
//取得當前登入使用者資訊
|
||||
myUser = userRepository.GetMyUserInfoByAccount(myAccount);
|
||||
myUser.Company = companyRepository.GetMyCompanyInfoById(myUser.CompanyId);
|
||||
myUser.Role = roleRepository.GetMyRoleInfoById(myUser.RoleId);
|
||||
|
||||
List<string> auth_arr = new List<string>();
|
||||
if (myUser.IsGod != 1 || myUser.Role.Layer != 0) //判斷是否神級使用者或平台管理員
|
||||
{
|
||||
foreach (var auth in myUser.Role.Auths)
|
||||
{
|
||||
var per_auch_arr = auth.Split(',');
|
||||
foreach (var x in per_auch_arr)
|
||||
{
|
||||
auth_arr.Add(x);
|
||||
}
|
||||
}
|
||||
|
||||
ViewBag.auths = auth_arr;
|
||||
}
|
||||
|
||||
ViewBag.myUser = myUser;
|
||||
|
||||
#region 記錄人員操作紀錄
|
||||
#region 記錄人員操作記錄
|
||||
var content = JsonConvert.SerializeObject(filterContext.ActionArguments);
|
||||
|
||||
OperatorLog operatorLog = new OperatorLog()
|
||||
|
||||
21
SolarPower/Controllers/PowerStationController.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SolarPower.Controllers
|
||||
{
|
||||
public class PowerStationController : Controller
|
||||
{
|
||||
public IActionResult Index()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult Edit()
|
||||
{
|
||||
return View("~/Views/PowerStation/PowerStationEdit.cshtml");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
@ -79,12 +80,13 @@ namespace SolarPower.Models.Company
|
||||
public string Phone { get; set; } //手機
|
||||
public string Address { get; set; } //地址
|
||||
public int RegisterUpperLimit { get; set; } //註冊上限
|
||||
public IFormFile LogoFile { get; set; } //公司logo
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 公司權限池
|
||||
/// </summary>
|
||||
public class CompanyAuth
|
||||
public class CompanyAuthDataTable
|
||||
{
|
||||
public string AuthCode { get; set; }
|
||||
public string MainName { get; set; }
|
||||
@ -92,4 +94,16 @@ namespace SolarPower.Models.Company
|
||||
public string ControlName { get; set; }
|
||||
public byte CheckAuth { get; set; }
|
||||
}
|
||||
|
||||
public class PostCompanyAuth
|
||||
{
|
||||
public int SelectedCompanyId { get; set; }
|
||||
public List<string> CheckAuths { get; set; }
|
||||
}
|
||||
|
||||
public class CompanyAuth : Created
|
||||
{
|
||||
public int CompanyId { get; set; }
|
||||
public string AuthCode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,6 +41,7 @@ namespace SolarPower.Models
|
||||
public int RoleId { get; set; } //角色編號
|
||||
public string Email { get; set; }
|
||||
public MyCompany Company { get; set; } //公司資訊
|
||||
public MyRole Role { get; set; } //角色資訊
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -59,6 +60,7 @@ namespace SolarPower.Models
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; } //名稱
|
||||
public List<string> Auth { get; set; } //可操作頁面
|
||||
public byte Layer { get; set; } //角色層級
|
||||
public List<string> Auths { get; set; } //可操作頁面
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,14 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SolarPower.Models.Role
|
||||
{
|
||||
public enum RoleLayerEnum : byte
|
||||
{
|
||||
PlatformAdmin = 0, //平台管理員
|
||||
PlatformUser = 1, //平台使用者
|
||||
CompanyAdmin = 2, //公司管理員
|
||||
CompanyUser = 3 //公司使用者
|
||||
}
|
||||
|
||||
public class Role : Created
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
@ -186,11 +186,11 @@ namespace SolarPower.Models
|
||||
/// 回傳結果
|
||||
/// </summary>
|
||||
/// <typeparam name="T">資料型別</typeparam>
|
||||
public class ApiResult<T>
|
||||
public class ApiResult<S1>
|
||||
{
|
||||
public string Code { get; set; }
|
||||
public string Msg { get; set; }
|
||||
public T Data { get; set; }
|
||||
public S1 Data { get; set; }
|
||||
}
|
||||
|
||||
public class DapperConnection
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
using SolarPower.Helper;
|
||||
using SolarPower.Models;
|
||||
using SolarPower.Models.Company;
|
||||
using SolarPower.Models.Role;
|
||||
using SolarPower.Models.User;
|
||||
using SolarPower.Repository.Interface;
|
||||
using System;
|
||||
@ -264,9 +265,14 @@ namespace SolarPower.Repository.Implement
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<CompanyAuth>> GetCompanyAuthByCompanyId(int companyId)
|
||||
/// <summary>
|
||||
/// 透過公司編號,取得該公司的權限池
|
||||
/// </summary>
|
||||
/// <param name="companyId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<CompanyAuthDataTable>> GetCompanyAuthByCompanyId(int companyId)
|
||||
{
|
||||
List<CompanyAuth> result;
|
||||
List<CompanyAuthDataTable> result;
|
||||
using (IDbConnection conn = this._databaseHelper.GetConnection())
|
||||
{
|
||||
conn.Open();
|
||||
@ -274,13 +280,12 @@ namespace SolarPower.Repository.Implement
|
||||
{
|
||||
var sql = @$"SELECT
|
||||
ap.*,
|
||||
CASE WHEN cap_id.ComapnyId IS NOT NULL THEN 1 ELSE 0 END AS CheckAuth
|
||||
CASE WHEN cap_id.CompanyId IS NOT NULL THEN 1 ELSE 0 END AS CheckAuth
|
||||
FROM auth_page ap
|
||||
LEFT JOIN (SELECT * FROM company_auth_page WHERE ComapnyId = @ComapnyId)
|
||||
cap_id ON ap.AuthCode = cap_id.AuthCode
|
||||
LEFT JOIN (SELECT * FROM company_auth_page WHERE CompanyId = @CompanyId) cap_id ON ap.AuthCode = cap_id.AuthCode
|
||||
";
|
||||
|
||||
result = (await conn.QueryAsync<CompanyAuth>(sql, new { CompanyId = companyId })).ToList();
|
||||
result = (await conn.QueryAsync<CompanyAuthDataTable>(sql, new { CompanyId = companyId })).ToList();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@ -293,5 +298,111 @@ namespace SolarPower.Repository.Implement
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 實際刪除公司權限池
|
||||
/// </summary>
|
||||
/// <param name="companyAuths"></param>
|
||||
/// <returns></returns>
|
||||
public async Task PurgeCompanyAuth(List<CompanyAuth> companyAuths)
|
||||
{
|
||||
using (IDbConnection conn = this._databaseHelper.GetConnection())
|
||||
{
|
||||
conn.Open();
|
||||
using (var trans = conn.BeginTransaction())
|
||||
{
|
||||
try
|
||||
{
|
||||
var sql = $"DELETE FROM company_auth_page WHERE CompanyId = @CompanyId AND AuthCode = @AuthCode";
|
||||
|
||||
await conn.ExecuteAsync(sql, companyAuths, trans);
|
||||
|
||||
trans.Commit();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
trans.Rollback();
|
||||
throw exception;
|
||||
}
|
||||
finally
|
||||
{
|
||||
conn.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 實際刪除公司權限池
|
||||
/// </summary>
|
||||
/// <param name="companyAuths"></param>
|
||||
/// <returns></returns>
|
||||
public async Task PurgeCompanyRoleAuth(int companyId, List<CompanyAuth> companyAuths)
|
||||
{
|
||||
using (IDbConnection conn = this._databaseHelper.GetConnection())
|
||||
{
|
||||
conn.Open();
|
||||
using (var trans = conn.BeginTransaction())
|
||||
{
|
||||
try
|
||||
{
|
||||
//找出該公司底下有該權限的角色
|
||||
var auths = companyAuths.Select(x => x.AuthCode).ToList();
|
||||
|
||||
var sqlRole = @$"SELECT ra.Id, ra.AuthCode FROM role_auth ra
|
||||
LEFT JOIN role r ON ra.Id = r.Id
|
||||
WHERE r.CompanyId = @CompanyId AND ra.AuthCode IN @AuthCode";
|
||||
|
||||
var roles = (await conn.QueryAsync<RoleAuth>(sqlRole, new { CompanyId = companyId, AuthCode = auths }, trans)).ToList();
|
||||
|
||||
var sql = $"DELETE FROM role_auth WHERE Id = @Id AND AuthCode = @AuthCode";
|
||||
|
||||
await conn.ExecuteAsync(sql, roles, trans);
|
||||
|
||||
trans.Commit();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
trans.Rollback();
|
||||
throw exception;
|
||||
}
|
||||
finally
|
||||
{
|
||||
conn.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增公司權限池
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <param name="properties"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<int> AddCompanyAuthAsync(List<CompanyAuth> entity, List<string> properties)
|
||||
{
|
||||
int count;
|
||||
using (IDbConnection conn = _databaseHelper.GetConnection())
|
||||
{
|
||||
conn.Open();
|
||||
try
|
||||
{
|
||||
string sql = $"INSERT INTO company_auth_page (CompanyId, AuthCode, CreatedBy) VALUES (@CompanyId, @AuthCode, @CreatedBy)";
|
||||
|
||||
count = await conn.ExecuteAsync(sql, entity);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
throw exception;
|
||||
}
|
||||
finally
|
||||
{
|
||||
conn.Close();
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using Dapper;
|
||||
using SolarPower.Helper;
|
||||
using SolarPower.Models;
|
||||
using SolarPower.Models.Role;
|
||||
using SolarPower.Repository.Interface;
|
||||
using System;
|
||||
@ -41,6 +42,42 @@ namespace SolarPower.Repository.Implement
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 取得當前使用者的角色資訊
|
||||
/// </summary>
|
||||
/// <param name="account"></param>
|
||||
/// <returns></returns>
|
||||
public MyRole GetMyRoleInfoById(int id)
|
||||
{
|
||||
MyRole result;
|
||||
using (IDbConnection conn = this._databaseHelper.GetConnection())
|
||||
{
|
||||
conn.Open();
|
||||
try
|
||||
{
|
||||
var sql = $"SELECT * FROM {tableName} WHERE Deleted = 0 AND Id = @Id";
|
||||
|
||||
result = conn.QueryFirstOrDefault<MyRole>(sql, new { Id = id });
|
||||
|
||||
//查詢該角色可使用的權限
|
||||
var sql_auth = @"SELECT ControlName FROM role_auth ra
|
||||
LEFT JOIN auth_page ap ON ra.AuthCode = ap.AuthCode
|
||||
WHERE ra.Id = @Id";
|
||||
|
||||
result.Auths = conn.Query<string>(sql_auth, new { Id = id }).ToList();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
throw exception;
|
||||
}
|
||||
finally
|
||||
{
|
||||
conn.Close();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 取得單一公司角色,須為Deleted: 0
|
||||
/// </summary>
|
||||
@ -223,10 +260,10 @@ namespace SolarPower.Repository.Implement
|
||||
var sql = @$"SELECT ap2.AuthCode, ap2.MainName, ap2.SubName
|
||||
FROM
|
||||
(
|
||||
SELECT cap.ComapnyId, cap.AuthCode, ap.MainName, ap.SubName, ap.ControlName
|
||||
SELECT cap.CompanyId, cap.AuthCode, ap.MainName, ap.SubName, ap.ControlName
|
||||
FROM company_auth_page cap
|
||||
LEFT JOIN auth_page ap ON cap.AuthCode = ap.AuthCode
|
||||
WHERE cap.ComapnyId = @CompanyId
|
||||
WHERE cap.CompanyId = @CompanyId
|
||||
) ap2
|
||||
LEFT JOIN role_auth ra ON ap2.AuthCode = ra.AuthCode AND ra.Id = @RoleId
|
||||
WHERE ra.AuthCode IS NULL
|
||||
|
||||
@ -72,6 +72,27 @@ namespace SolarPower.Repository.Interface
|
||||
/// </summary>
|
||||
/// <param name="companyId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<CompanyAuth>> GetCompanyAuthByCompanyId(int companyId);
|
||||
Task<List<CompanyAuthDataTable>> GetCompanyAuthByCompanyId(int companyId);
|
||||
|
||||
/// <summary>
|
||||
/// 實際刪除公司權限池
|
||||
/// </summary>
|
||||
/// <param name="companyId"></param>
|
||||
/// <returns></returns>
|
||||
Task PurgeCompanyAuth(List<CompanyAuth> companyAuths);
|
||||
|
||||
/// <summary>
|
||||
/// 實際刪除公司角色擁有的權限
|
||||
/// </summary>
|
||||
/// <param name="companyAuths"></param>
|
||||
/// <returns></returns>
|
||||
Task PurgeCompanyRoleAuth(int companyId, List<CompanyAuth> companyAuths);
|
||||
|
||||
/// <summary>
|
||||
/// 新增公司權限池
|
||||
/// </summary>
|
||||
/// <param name="post"></param>
|
||||
/// <returns></returns>
|
||||
Task<int> AddCompanyAuthAsync(List<CompanyAuth> entity, List<string> properties);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using SolarPower.Models.Role;
|
||||
using SolarPower.Models;
|
||||
using SolarPower.Models.Role;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -8,6 +9,13 @@ namespace SolarPower.Repository.Interface
|
||||
{
|
||||
public interface IRoleRepository : IRepositoryBase<Role>
|
||||
{
|
||||
/// <summary>
|
||||
/// 取得當前使用者的角色資訊
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
MyRole GetMyRoleInfoById(int id);
|
||||
|
||||
/// <summary>
|
||||
/// 取得下拉式公司角色選單,須為Deleted: 0
|
||||
/// </summary>
|
||||
|
||||
@ -121,6 +121,11 @@
|
||||
<label class="form-label" for="company_registerUpperLimit_modal">註冊上限人數</label>
|
||||
<input type="number" id="company_registerUpperLimit_modal" name="company_registerUpperLimit_modal" class="form-control" min="0" oninput="value=value.replace(/\D+/g, '')">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-lg-6">
|
||||
<label class="form-label" for="company_logo_modal">Logo</label>
|
||||
<input type="file" id="company_logo_modal" name="company_logo_modal" class="form-control" accept="image/*">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -146,7 +151,6 @@
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<table id="company_auth_table" class="table table-bordered text-center">
|
||||
<thead>
|
||||
<thead class="thead-themed">
|
||||
<tr>
|
||||
<th>選擇</th>
|
||||
@ -162,7 +166,7 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
|
||||
<button type="button" class="btn btn-primary">確定</button>
|
||||
<button type="button" class="btn btn-primary" onclick="SaveComapnyAuth()">確定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -225,8 +229,16 @@
|
||||
"data": "createdAt"
|
||||
}, {
|
||||
"data": "function",
|
||||
}
|
||||
],
|
||||
}],
|
||||
"columnDefs": [{
|
||||
'targets': 1,
|
||||
'searchable': false,
|
||||
'orderable': false,
|
||||
'className': 'dt-body-center',
|
||||
'render': function (data, type, full, meta) {
|
||||
return '<img src="' + data + '" class="img-fluid">';
|
||||
}
|
||||
}],
|
||||
"language": {
|
||||
"emptyTable": "無資料...",
|
||||
"processing": "處理中...",
|
||||
@ -306,7 +318,7 @@
|
||||
'render': function (data, type, full, meta) {
|
||||
var check_html = "";
|
||||
check_html += '<div class="custom-control custom-checkbox">';
|
||||
if (full.CheckAuth > 0) {
|
||||
if (full.checkAuth > 0) {
|
||||
check_html += '<input type="checkbox" class="custom-control-input" name="selectedAuthPage[]" id="auth-page-' + data + '" value="' + data + '" checked /> ';
|
||||
} else {
|
||||
check_html += '<input type="checkbox" class="custom-control-input" name="selectedAuthPage[]" id="auth-page-' + data + '" value="' + data + '" /> ';
|
||||
@ -439,7 +451,19 @@
|
||||
Address: $("#company_address_modal").val(),
|
||||
}
|
||||
|
||||
$.post(url, send_data, function (rel) {
|
||||
var formData = new FormData();
|
||||
var logos = $('#company_logo_modal')[0].files;
|
||||
|
||||
formData.append("Id", selected_id);
|
||||
formData.append("Name", $("#company_name_modal").val());
|
||||
formData.append("TaxIDNumber", $("#company_taxIDNumber_modal").val());
|
||||
formData.append("Phone", $("#company_phone_modal").val());
|
||||
formData.append("Address", $("#company_address_modal").val());
|
||||
if (logos.length > 0) {
|
||||
formData.append("LogoFile", logos[0])
|
||||
}
|
||||
|
||||
@*$.post(url, formData, function (rel) {
|
||||
if (rel.code != "0000") {
|
||||
toast_error(rel.msg);
|
||||
return;
|
||||
@ -449,7 +473,28 @@
|
||||
$('#company-modal').modal('hide');
|
||||
|
||||
companyTable.ajax.reload();
|
||||
}, 'json');
|
||||
}, 'json');*@
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: function (rel) {
|
||||
if (rel.code != "0000") {
|
||||
toast_error(rel.msg);
|
||||
return;
|
||||
}
|
||||
|
||||
toast_ok(rel.msg);
|
||||
$('#company-modal').modal('hide');
|
||||
|
||||
companyTable.ajax.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
//#endregion
|
||||
@ -493,5 +538,34 @@
|
||||
$("#company-auth-modal").modal();
|
||||
});
|
||||
//#endregion
|
||||
|
||||
//#region 儲存公司權限池
|
||||
function SaveComapnyAuth() {
|
||||
|
||||
//取得被選擇的權限
|
||||
var checkAuths = $("input[name='selectedAuthPage[]']:checked").map(function () {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
|
||||
var url = "/Company/SaveCompanyAuth";
|
||||
|
||||
var send_data = {
|
||||
SelectedCompanyId: selected_id,
|
||||
CheckAuths: checkAuths
|
||||
}
|
||||
|
||||
$.post(url, send_data, function (rel) {
|
||||
if (rel.code != "0000") {
|
||||
toast_error(rel.msg);
|
||||
return;
|
||||
}
|
||||
|
||||
toast_ok(rel.msg);
|
||||
$("#company-auth-modal").modal('hide');
|
||||
|
||||
companyAuthTable.ajax.reload();
|
||||
}, 'json');
|
||||
}
|
||||
//#endregion
|
||||
</script>
|
||||
}
|
||||
324
SolarPower/Views/PowerStation/Index.cshtml
Normal file
@ -0,0 +1,324 @@
|
||||
@{
|
||||
ViewData["MainNum"] = "6";
|
||||
ViewData["SubNum"] = "1";
|
||||
ViewData["Title"] = "電站資料管理";
|
||||
}
|
||||
|
||||
<ol class="breadcrumb page-breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="javascript:void(0);">總覽</a></li>
|
||||
<li class="breadcrumb-item active">@ViewData["Title"]</li>
|
||||
<li class="position-absolute pos-top pos-right d-none d-sm-block"><span class="js-get-date"></span></li>
|
||||
</ol>
|
||||
|
||||
<!-- Your main content goes below here: -->
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div id="panel-5" class="panel">
|
||||
<div class="panel-container show">
|
||||
<div class="panel-content">
|
||||
<div class="subheader">
|
||||
<h1 class="subheader-title"> 電站分佈區域 </h1>
|
||||
</div>
|
||||
<ul class="nav nav-tabs mb-5" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link fs-lg px-4 active" data-toggle="tab" href="#tab-newtaipei" role="tab">
|
||||
<span class="hidden-sm-down ml-1">新北市</span> <span class="badge bg-primary-500 ml-2">4</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link fs-lg px-4" data-toggle="tab" href="#tab-taipei" role="tab">
|
||||
<span class="hidden-sm-down ml-1">台北市</span> <span class="badge bg-primary-500 ml-2">4</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link fs-lg px-4" data-toggle="tab" href="#tab-hsinchu" role="tab">
|
||||
<span class="hidden-sm-down ml-1">新竹市</span> <span class="badge bg-primary-500 ml-2">4</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link fs-lg px-4" data-toggle="tab" href="#tab-miaoli" role="tab">
|
||||
<span class="hidden-sm-down ml-1">苗栗縣</span> <span class="badge bg-primary-500 ml-2">1</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link fs-lg px-4" data-toggle="tab" href="#tab-taichung" role="tab">
|
||||
<span class="hidden-sm-down ml-1">台中市</span> <span class="badge bg-primary-500 ml-2">3</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content p-3">
|
||||
<div class="tab-pane fade show active" id="tab-newtaipei" role="tabpanel" aria-labelledby="tab-newtaipei">
|
||||
<div class="row mb-5 d-flex justify-content-between">
|
||||
<div class="col-6">
|
||||
<a asp-controller="PowerStation" asp-action="Edit" class="btn btn-success waves-effect waves-themed mb-3">
|
||||
<span class="fal fa-plus mr-1"></span>
|
||||
新增電站
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
<a href="javascript:;" class="btn btn-secondary btn-icon waves-effect waves-themed"><span class="fal fa-list mr-1"></span></a>
|
||||
<a href="javascript:;" class="btn btn-secondary btn-icon waves-effect waves-themed"><span class="fal fa-grip-horizontal mr-1"></span></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-5">
|
||||
<div class="col-xl">
|
||||
<div class="card border m-auto m-lg-0">
|
||||
<a href="0station.html">
|
||||
<img src="img/card-backgrounds/cover-3-lg.png" class="card-img-top" alt="...">
|
||||
</a>
|
||||
<div class="card-body d-flex justify-content-between pb-0 px-2">
|
||||
<h4 class="font-weight-bold" style="line-height: 27px;">
|
||||
<a href="javascript:void(0);" class="btn btn-success btn-sm btn-icon rounded-circle waves-effect waves-themed">
|
||||
<i class="fal fa-check"></i>
|
||||
</a> 新竹巨城站
|
||||
</h4>
|
||||
<p class="card-text"><i class="fal fa-cloud-sun-rain fa-2x"></i></p>
|
||||
</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item px-2">
|
||||
<div class=" d-flex justify-content-between">
|
||||
<p>發電量</p>
|
||||
<p><span class="color-primary-400">185</span> kWh</p>
|
||||
<p>27°C</p>
|
||||
</div>
|
||||
<div class=" d-flex justify-content-between">
|
||||
<p>發電金額</p>
|
||||
<p><span class="color-primary-400">2,5840</span> NT</p>
|
||||
<p class="small">2021-06-30</p>
|
||||
</div>
|
||||
<div class=" d-flex justify-content-between">
|
||||
<p>Pr值</p>
|
||||
<p><span class="color-primary-400">90</span> %</p>
|
||||
<p class="small">17:50:36</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="progress progress-sm">
|
||||
<div class="progress-bar bg-info" role="progressbar" style="width: 90%;" aria-valuenow="90" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<div class="card border m-auto m-lg-0">
|
||||
<img src="img/card-backgrounds/cover-3-lg.png" class="card-img-top" alt="...">
|
||||
<div class="card-body d-flex justify-content-between pb-0 px-2">
|
||||
<h4 class="font-weight-bold" style="line-height: 27px;">
|
||||
<a href="javascript:void(0);" class="btn btn-success btn-sm btn-icon rounded-circle waves-effect waves-themed">
|
||||
<i class="fal fa-check"></i>
|
||||
</a> 新竹交大站
|
||||
</h4>
|
||||
<p class="card-text"><i class="fal fa-cloud-sun-rain fa-2x"></i></p>
|
||||
</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item px-2">
|
||||
<div class=" d-flex justify-content-between">
|
||||
<p>發電量</p>
|
||||
<p><span class="color-primary-400">185</span> kWh</p>
|
||||
<p>27°C</p>
|
||||
</div>
|
||||
<div class=" d-flex justify-content-between">
|
||||
<p>發電金額</p>
|
||||
<p><span class="color-primary-400">2,5840</span> NT</p>
|
||||
<p class="small">2021-06-30</p>
|
||||
</div>
|
||||
<div class=" d-flex justify-content-between">
|
||||
<p>Pr值</p>
|
||||
<p><span class="color-primary-400">65</span> %</p>
|
||||
<p class="small">17:50:36</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="progress progress-sm">
|
||||
<div class="progress-bar bg-info" role="progressbar" style="width: 65%;" aria-valuenow="65" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<div class="card border m-auto m-lg-0">
|
||||
<img src="img/card-backgrounds/cover-3-lg.png" class="card-img-top" alt="...">
|
||||
<div class="card-body d-flex justify-content-between pb-0 px-2">
|
||||
<h4 class="font-weight-bold" style="line-height: 27px;">
|
||||
<a href="javascript:void(0);" class="btn btn-warning btn-sm btn-icon rounded-circle waves-effect waves-themed">
|
||||
<i class="fal fa-exclamation"></i>
|
||||
</a> 新竹動物園站
|
||||
</h4>
|
||||
<p class="card-text"><i class="fal fa-cloud-sun-rain fa-2x"></i></p>
|
||||
</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item px-2">
|
||||
<div class=" d-flex justify-content-between">
|
||||
<p>發電量</p>
|
||||
<p><span class="color-primary-400">185</span> kWh</p>
|
||||
<p>27°C</p>
|
||||
</div>
|
||||
<div class=" d-flex justify-content-between">
|
||||
<p>發電金額</p>
|
||||
<p><span class="color-primary-400">2,5840</span> NT</p>
|
||||
<p class="small">2021-06-30</p>
|
||||
</div>
|
||||
<div class=" d-flex justify-content-between">
|
||||
<p>Pr值</p>
|
||||
<p><span class="color-primary-400">40</span> %</p>
|
||||
<p class="small">17:50:36</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="progress progress-sm">
|
||||
<div class="progress-bar bg-info" role="progressbar" style="width: 40%;" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<div class="card border m-auto m-lg-0">
|
||||
<img src="img/card-backgrounds/cover-3-lg.png" class="card-img-top" alt="...">
|
||||
<div class="card-body d-flex justify-content-between pb-0 px-2">
|
||||
<h4 class="font-weight-bold" style="line-height: 27px;">
|
||||
<a href="javascript:void(0);" class="btn btn-danger btn-sm btn-icon rounded-circle waves-effect waves-themed">
|
||||
<i class="fal fa-horizontal-rule"></i>
|
||||
</a> 新竹動物園站
|
||||
</h4>
|
||||
<p class="card-text"><i class="fal fa-cloud-sun-rain fa-2x"></i></p>
|
||||
</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item px-2">
|
||||
<div class=" d-flex justify-content-between">
|
||||
<p>發電量</p>
|
||||
<p><span class="color-primary-400">185</span> kWh</p>
|
||||
<p>27°C</p>
|
||||
</div>
|
||||
<div class=" d-flex justify-content-between">
|
||||
<p>發電金額</p>
|
||||
<p><span class="color-primary-400">2,5840</span> NT</p>
|
||||
<p class="small">2021-06-30</p>
|
||||
</div>
|
||||
<div class=" d-flex justify-content-between">
|
||||
<p>Pr值</p>
|
||||
<p><span class="color-primary-400">5</span> %</p>
|
||||
<p class="small">17:50:36</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="progress progress-sm">
|
||||
<div class="progress-bar bg-info" role="progressbar" style="width: 5%;" aria-valuenow="5" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<div class="card border m-auto m-lg-0">
|
||||
<img src="img/card-backgrounds/cover-3-lg.png" class="card-img-top" alt="...">
|
||||
<div class="card-body d-flex justify-content-between pb-0 px-2">
|
||||
<h4 class="font-weight-bold" style="line-height: 27px;">
|
||||
<a href="javascript:void(0);" class="btn btn-success btn-sm btn-icon rounded-circle waves-effect waves-themed">
|
||||
<i class="fal fa-check"></i>
|
||||
</a> 新竹巨城站
|
||||
</h4>
|
||||
<p class="card-text"><i class="fal fa-cloud-sun-rain fa-2x"></i></p>
|
||||
</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item px-2">
|
||||
<div class=" d-flex justify-content-between">
|
||||
<p>發電量</p>
|
||||
<p><span class="color-primary-400">185</span> kWh</p>
|
||||
<p>27°C</p>
|
||||
</div>
|
||||
<div class=" d-flex justify-content-between">
|
||||
<p>發電金額</p>
|
||||
<p><span class="color-primary-400">2,5840</span> NT</p>
|
||||
<p class="small">2021-06-30</p>
|
||||
</div>
|
||||
<div class=" d-flex justify-content-between">
|
||||
<p>Pr值</p>
|
||||
<p><span class="color-primary-400">90</span> %</p>
|
||||
<p class="small">17:50:36</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="progress progress-sm">
|
||||
<div class="progress-bar bg-info" role="progressbar" style="width: 90%;" aria-valuenow="90" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl">
|
||||
<div class="card border m-auto m-lg-0">
|
||||
<img src="img/card-backgrounds/cover-3-lg.png" class="card-img-top" alt="...">
|
||||
<div class="card-body d-flex justify-content-between pb-0 px-2">
|
||||
<h4 class="font-weight-bold" style="line-height: 27px;">
|
||||
<a href="javascript:void(0);" class="btn btn-success btn-sm btn-icon rounded-circle waves-effect waves-themed">
|
||||
<i class="fal fa-check"></i>
|
||||
</a> 新竹交大站
|
||||
</h4>
|
||||
<p class="card-text"><i class="fal fa-cloud-sun-rain fa-2x"></i></p>
|
||||
</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item px-2">
|
||||
<div class=" d-flex justify-content-between">
|
||||
<p>發電量</p>
|
||||
<p><span class="color-primary-400">185</span> kWh</p>
|
||||
<p>27°C</p>
|
||||
</div>
|
||||
<div class=" d-flex justify-content-between">
|
||||
<p>發電金額</p>
|
||||
<p><span class="color-primary-400">2,5840</span> NT</p>
|
||||
<p class="small">2021-06-30</p>
|
||||
</div>
|
||||
<div class=" d-flex justify-content-between">
|
||||
<p>Pr值</p>
|
||||
<p><span class="color-primary-400">65</span> %</p>
|
||||
<p class="small">17:50:36</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="progress progress-sm">
|
||||
<div class="progress-bar bg-info" role="progressbar" style="width: 65%;" aria-valuenow="65" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xl"></div>
|
||||
<div class="col-xl"></div>
|
||||
<div class="col-xl"></div>
|
||||
<div class="col-xl"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="tab-taipei" role="tabpanel" aria-labelledby="tab-taipei">
|
||||
<div class="row mb-5">
|
||||
此處放台北市數據
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="tab-hsinchu" role="tabpanel" aria-labelledby="tab-hsinchu">
|
||||
<div class="row mb-5">
|
||||
此處放新竹市數據
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="tab-miaoli" role="tabpanel" aria-labelledby="tab-miaoli">
|
||||
<div class="row mb-5">
|
||||
此處放苗栗縣數據
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="tab-taichung" role="tabpanel" aria-labelledby="tab-taichung">
|
||||
<div class="row mb-5">
|
||||
此處放台中市數據
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts{
|
||||
<script>
|
||||
|
||||
$(function () {
|
||||
});
|
||||
|
||||
</script>
|
||||
}
|
||||
84
SolarPower/Views/PowerStation/PowerStationEdit.cshtml
Normal file
@ -0,0 +1,84 @@
|
||||
@{
|
||||
ViewData["MainNum"] = "6";
|
||||
ViewData["SubNum"] = "1";
|
||||
ViewData["Title"] = "電站資料管理";
|
||||
}
|
||||
|
||||
<ol class="breadcrumb page-breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="javascript:void(0);">總覽</a></li>
|
||||
<li class="breadcrumb-item">@ViewData["Title"]</li>
|
||||
<li class="breadcrumb-item">新竹市</li>
|
||||
<li class="breadcrumb-item active">新竹巨城站</li>
|
||||
<li class="position-absolute pos-top pos-right d-none d-sm-block"><span class="js-get-date"></span></li>
|
||||
</ol>
|
||||
|
||||
<!-- Your main content goes below here: -->
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div id="panel-5" class="panel">
|
||||
<div class="panel-container show">
|
||||
<div class="panel-content">
|
||||
<div class="subheader">
|
||||
<h1 class="subheader-title">
|
||||
<span class="icon-stack fa-1x">
|
||||
<i class="base-7 icon-stack-3x color-info-500"></i>
|
||||
<i class="base-7 icon-stack-2x color-info-700"></i>
|
||||
<i class="ni ni-graph icon-stack-1x text-white"></i>
|
||||
</span> 新竹巨城站
|
||||
</h1>
|
||||
</div>
|
||||
<ul class="nav nav-tabs mb-5" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link fs-lg px-4 active" data-toggle="tab" href="#tab-001" role="tab">
|
||||
<i class="fal fa-home text-success"></i> <span class="hidden-sm-down ml-1">電站資料</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link fs-lg px-4" data-toggle="tab" href="#tab-002" role="tab">
|
||||
<i class="fal fa-home text-success"></i> <span class="hidden-sm-down ml-1">裝置列表</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link fs-lg px-4" data-toggle="tab" href="#tab-003" role="tab">
|
||||
<i class="fal fa-home text-success"></i> <span class="hidden-sm-down ml-1">維運廠商</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link fs-lg px-4" data-toggle="tab" href="#tab-004" role="tab">
|
||||
<i class="fal fa-home text-success"></i> <span class="hidden-sm-down ml-1">資料上傳</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link fs-lg px-4 disabled" data-toggle="tab" href="#tab-005" role="tab">
|
||||
<i class="fal fa-home text-success"></i> <span class="hidden-sm-down ml-1">異常設定</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content p-3">
|
||||
<div class="tab-pane fade show active" id="tab-001" role="tabpanel" aria-labelledby="tab-001">
|
||||
@Html.Partial("_StationInfo")
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="tab-002" role="tabpanel" aria-labelledby="tab-002">
|
||||
@Html.Partial("_DeviceSetting")
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="tab-003" role="tabpanel" aria-labelledby="tab-003">
|
||||
@Html.Partial("_Operation")
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="tab-004" role="tabpanel" aria-labelledby="tab-004">
|
||||
@Html.Partial("_UploadImage")
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="tab-005" role="tabpanel" aria-labelledby="tab-005">
|
||||
<div class="row mb-5">
|
||||
此處放異常設定數據
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
72
SolarPower/Views/PowerStation/_DeviceSetting.cshtml
Normal file
@ -0,0 +1,72 @@
|
||||
<div class="row mb-5">
|
||||
<div class="col-6"><h3>裝置設定</h3></div>
|
||||
<div class="col-6 text-right">
|
||||
<button type="button" class="btn btn-success waves-effect waves-themed mb-3">
|
||||
<span class="fal fa-plus mr-1"></span>
|
||||
新增
|
||||
</button>
|
||||
</div>
|
||||
<div class="w-100">
|
||||
<table class="table table-bordered table-hover m-0 text-center">
|
||||
<thead class="thead-themed">
|
||||
<tr>
|
||||
<th>設備ID</th>
|
||||
<th>裝置名稱</th>
|
||||
<th>裝置類型</th>
|
||||
<th>廠牌</th>
|
||||
<th>型號</th>
|
||||
<th>DBName</th>
|
||||
<th>tableName</th>
|
||||
<th>columnName</th>
|
||||
<th>備註</th>
|
||||
<th>功能</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">PEP-NTP001-PYR-01</th>
|
||||
<td>日照計01</td>
|
||||
<td>日照計</td>
|
||||
<td>ADTEK</td>
|
||||
<td>CS1</td>
|
||||
<td></td>
|
||||
<td>CS1</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary btn-pills waves-effect waves-themed">修改</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">PEP-NTP001-THR-01</th>
|
||||
<td>溫度計03</td>
|
||||
<td>溫度計</td>
|
||||
<td>ADTEK</td>
|
||||
<td>CS1</td>
|
||||
<td></td>
|
||||
<td>CS1</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary btn-pills waves-effect waves-themed">修改</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">05101300967-PWR</th>
|
||||
<td>電表01</td>
|
||||
<td>電表</td>
|
||||
<td>ADTEK</td>
|
||||
<td>CS1</td>
|
||||
<td></td>
|
||||
<td>CS1</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary btn-pills waves-effect waves-themed">修改</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
64
SolarPower/Views/PowerStation/_Operation.cshtml
Normal file
@ -0,0 +1,64 @@
|
||||
<div class="row mb-5">
|
||||
<div class="col-6"><h3>運維資料</h3></div>
|
||||
<div class="col-6 text-right">
|
||||
<button type="button" class="btn btn-success waves-effect waves-themed mb-3">
|
||||
<span class="fal fa-plus mr-1"></span>
|
||||
新增
|
||||
</button>
|
||||
</div>
|
||||
<div class="w-100">
|
||||
<table class="table table-bordered table-hover m-0 text-center">
|
||||
<thead class="thead-themed">
|
||||
<tr>
|
||||
<th>廠商類別</th>
|
||||
<th>廠商</th>
|
||||
<th>聯絡人</th>
|
||||
<th>電話</th>
|
||||
<th>email</th>
|
||||
<th>建立日期</th>
|
||||
<th>建立人</th>
|
||||
<th>功能</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">施工</th>
|
||||
<td>台達電</td>
|
||||
<td>林先生</td>
|
||||
<td>0928-123456</td>
|
||||
<td>lin@tdd.com.tw</td>
|
||||
<td>2021/06/02</td>
|
||||
<td>周杰倫</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary btn-pills waves-effect waves-themed">修改</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">清洗</th>
|
||||
<td>潔寶</td>
|
||||
<td>暴風女</td>
|
||||
<td>0928-654321</td>
|
||||
<td>storm@mavel.com</td>
|
||||
<td>2021/06/03</td>
|
||||
<td>周杰倫</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary btn-pills waves-effect waves-themed">修改</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">維運</th>
|
||||
<td>華碩</td>
|
||||
<td>雷神索爾</td>
|
||||
<td>0937-123123</td>
|
||||
<td>thor@asus.com</td>
|
||||
<td>2021/06/04</td>
|
||||
<td>周杰倫</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary btn-pills waves-effect waves-themed">修改</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
256
SolarPower/Views/PowerStation/_StationInfo.cshtml
Normal file
@ -0,0 +1,256 @@
|
||||
<div class="row mb-5">
|
||||
<div class="card border mb-g w-100">
|
||||
<!-- notice the additions of utility paddings and display properties on .card-header -->
|
||||
<div class="card-header bg-fusion-50 pr-3 d-flex align-items-center flex-wrap justify-content-between">
|
||||
<!-- we wrap header title inside a div tag with utility padding -->
|
||||
<div class="card-title font-weight-bold">電站基本資料</div>
|
||||
<div class="text-right">
|
||||
<a href="javascript:;" class="btn btn-sm btn-success ml-auto waves-effect waves-themed">
|
||||
<span class="fal fa-plus mr-1"></span> 新增
|
||||
</a>
|
||||
<a href="javascript:;" class="btn btn-sm btn-info ml-auto waves-effect waves-themed">
|
||||
<span class="fal fa-cog mr-1"></span> 修改
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row d-flex justify-content-between">
|
||||
<div class="col-xl-2 d-flex justify-content-center">
|
||||
<p>電站代碼 </p>
|
||||
<p class="color-info-600">PEP-NTP001</p>
|
||||
</div>
|
||||
<div class="col-xl-2 d-flex justify-content-center">
|
||||
<p>電站名稱:</p>
|
||||
<p class="color-info-600">新竹巨城站</p>
|
||||
</div>
|
||||
<div class="col-xl-2 d-flex justify-content-center">
|
||||
<p>是否為代管 :</p>
|
||||
<p class="color-info-600">
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="radio" class="custom-control-input" id="customSwitch3radio" checked="" disabled="" name="defaultSwitchRadioExample2">
|
||||
<label class="custom-control-label" for="customSwitch3radio">Yes</label>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-xl-2 d-flex justify-content-center">
|
||||
<p>台電掛錶日 </p>
|
||||
<p class="color-info-600">2018-12-26</p>
|
||||
</div>
|
||||
<div class="col-xl-2 d-flex justify-content-center">
|
||||
<p>預計回收年限:</p>
|
||||
<p class="color-info-600">20</p>
|
||||
</div>
|
||||
<div class="col-xl-2 d-flex justify-content-center">
|
||||
<p>資料建立:</p>
|
||||
<p class="color-info-600">蜘蛛人</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row d-flex justify-content-between mb-5">
|
||||
<div class="col-xl-2 d-flex justify-content-center">
|
||||
<p>電廠發電容量 <br>(kW)</p>
|
||||
<p class="color-info-600">362.7</p>
|
||||
</div>
|
||||
<div class="col-xl-2 d-flex justify-content-center">
|
||||
<p>運維人員:</p>
|
||||
<p class="color-info-600">美國隊長<br>鋼鐵人</p>
|
||||
</div>
|
||||
<div class="col-xl-2 d-flex justify-content-center">
|
||||
<p>被代管公司 :</p>
|
||||
<p class="color-info-600">台達電</p>
|
||||
</div>
|
||||
<div class="col-xl-2 d-flex justify-content-center">
|
||||
<p>授電費率:</p>
|
||||
<p class="color-info-600">PM060MW2_305</p>
|
||||
</div>
|
||||
<div class="col-xl-2 d-flex justify-content-center">
|
||||
<p>座標:</p>
|
||||
<p class="color-info-600">25.0726625,<br>121.5725953</p>
|
||||
</div>
|
||||
<div class="col-xl-2 d-flex justify-content-center">
|
||||
<p>建立時間:</p>
|
||||
<p class="color-info-600">2018-10-01 12:00</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-6">
|
||||
<h5 class="border-bottom font-weight-bold mb-3 pl-5 pb-3">逆變器</h5>
|
||||
<div class="row d-flex justify-content-between px-5">
|
||||
<div class="col-xl-4">
|
||||
<p>廠牌:<span class="color-info-600">AUO</span></p>
|
||||
</div>
|
||||
<div class="col-xl-4">
|
||||
<p>型號 :<span class="color-info-600">PM060MW2_305</span></p>
|
||||
</div>
|
||||
<div class="col-xl-4 text-right">
|
||||
<p>數量:<span class="color-info-600">400</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6">
|
||||
<h5 class="border-bottom font-weight-bold mb-3 pl-5 pb-3">光電板</h5>
|
||||
<div class="row d-flex justify-content-between px-5">
|
||||
<div class="col-xl-4">
|
||||
<p>廠牌:<span class="color-info-600">ABLYTEK</span></p>
|
||||
</div>
|
||||
<div class="col-xl-4">
|
||||
<p>規格 :<span class="color-info-600">1640×992×40</span></p>
|
||||
</div>
|
||||
<div class="col-xl-4 text-right">
|
||||
<p>數量:<span class="color-info-600">1116</span></p>
|
||||
</div>
|
||||
<div class="col-xl-4">
|
||||
<p>型號 :<span class="color-info-600">6MN6A295</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row mb-5">
|
||||
<div class="card border mb-g w-100">
|
||||
<!-- notice the additions of utility paddings and display properties on .card-header -->
|
||||
<div class="card-header bg-fusion-50 pr-3 d-flex align-items-center flex-wrap justify-content-between">
|
||||
<!-- we wrap header title inside a div tag with utility padding -->
|
||||
<div class="card-title font-weight-bold">經濟部能源局與台電資訊</div>
|
||||
<div class="text-right">
|
||||
<a href="javascript:;" class="btn btn-sm btn-success ml-auto waves-effect waves-themed">
|
||||
<span class="fal fa-plus mr-1"></span> 新增
|
||||
</a>
|
||||
<a href="javascript:;" class="btn btn-sm btn-info ml-auto waves-effect waves-themed">
|
||||
<span class="fal fa-cog mr-1"></span> 修改
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-xl-6">
|
||||
<h5 class="border-bottom font-weight-bold mb-3 pl-5 pb-3">經濟部能源局</h5>
|
||||
<div class="row d-flex justify-content-between px-5">
|
||||
<div class="col-xl-6">
|
||||
<p>能源局同意檔案:<span class="color-info-600">台北市內湖區中山路一段1001號</span></p>
|
||||
</div>
|
||||
<div class="col-xl-6">
|
||||
<p>折扣率 :<span class="color-info-600">2018-01-01</span></p>
|
||||
</div>
|
||||
<div class="col-xl-6">
|
||||
<p>能源局設備登記編號:<span class="color-info-600">25.0726625,121.5725953</span></p>
|
||||
</div>
|
||||
<div class="col-xl-6">
|
||||
<p>租金比例 (%) <span class="color-info-600">10</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6">
|
||||
<h5 class="border-bottom font-weight-bold mb-3 pl-5 pb-3">台電資訊</h5>
|
||||
<div class="row d-flex justify-content-between px-5">
|
||||
<div class="col-xl-4">
|
||||
<p>契約編號 <span class="color-info-600">鋼鐵人</span></p>
|
||||
</div>
|
||||
<div class="col-xl-4">
|
||||
<p>售電期限(年) <span class="color-info-600">20</span></p>
|
||||
</div>
|
||||
<div class="col-xl-4 text-right">
|
||||
<p>正式購電日 <span class="color-info-600">2018-10-01</span></p>
|
||||
</div>
|
||||
<div class="col-xl-4">
|
||||
<p>簽約日期 <span class="color-info-600">0828-123456</span></p>
|
||||
</div>
|
||||
<div class="col-xl-4">
|
||||
<p>每期抄錶日 <span class="color-info-600">10日</span></p>
|
||||
</div>
|
||||
<div class="col-xl-4 text-right">
|
||||
<p>正式售電日 <span class="color-info-600">2018-10-01</span></p><br><br>
|
||||
<p>資料建立:<span class="color-info-600">蜘蛛人</span></p>
|
||||
<p>建立時間:<span class="color-info-600">2018-10-01 12:00</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row mb-5">
|
||||
<div class="card border mb-g w-100">
|
||||
<!-- notice the additions of utility paddings and display properties on .card-header -->
|
||||
<div class="card-header bg-fusion-50 pr-3 d-flex align-items-center flex-wrap justify-content-between">
|
||||
<!-- we wrap header title inside a div tag with utility padding -->
|
||||
<div class="card-title font-weight-bold">土地房屋資料</div>
|
||||
<div class="text-right">
|
||||
<a href="javascript:;" class="btn btn-sm btn-success ml-auto waves-effect waves-themed">
|
||||
<span class="fal fa-plus mr-1"></span> 新增
|
||||
</a>
|
||||
<a href="javascript:;" class="btn btn-sm btn-info ml-auto waves-effect waves-themed">
|
||||
<span class="fal fa-cog mr-1"></span> 修改
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row d-flex justify-content-between">
|
||||
<div class="col-xl">
|
||||
<p>地址 <span class="color-info-600">台北市內湖區中山路一段1001號</span></p>
|
||||
<p>經緯度 <span class="color-info-600">25.0726625,121.5725953</span></p>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<p>租約公證日期 <span class="color-info-600">新竹巨城站</span></p>
|
||||
<p>租金比例 (%) <span class="color-info-600">10</span></p>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<p>地主姓名 <span class="color-info-600">鋼鐵人</span></p>
|
||||
<p>電話 <span class="color-info-600">0828-123456</span></p>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<p>房屋用途 <span class="color-info-600">工廠</span></p>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<p>資料建立 <span class="color-info-600">蜘蛛人</span></p>
|
||||
<p>建立時間 <span class="color-info-600">2018-10-01 12:00</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="card-body">
|
||||
<div class="row d-flex justify-content-between">
|
||||
<div class="col-xl">
|
||||
<p>地址 <span class="color-info-600">台北市內湖區中山路一段1001號</span></p>
|
||||
<p>經緯度 <span class="color-info-600">25.0726625,121.5725953</span></p>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<p>租約公證日期 <span class="color-info-600">新竹巨城站</span></p>
|
||||
<p>租金比例 (%) <span class="color-info-600">10</span></p>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<p>地主姓名 <span class="color-info-600">鋼鐵人</span></p>
|
||||
<p>電話 <span class="color-info-600">0828-123456</span></p>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<p>房屋用途 <span class="color-info-600">工廠</span></p>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<p>資料建立 <span class="color-info-600">蜘蛛人</span></p>
|
||||
<p>建立時間 <span class="color-info-600">2018-10-01 12:00</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-right">
|
||||
<a href="javascript:;" class="btn btn-sm btn-success ml-auto waves-effect waves-themed">
|
||||
<span class="fal fa-plus mr-1"></span> 新增
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
182
SolarPower/Views/PowerStation/_UploadImage.cshtml
Normal file
@ -0,0 +1,182 @@
|
||||
<div class="row mb-5">
|
||||
<div class="card border mb-5 w-100">
|
||||
<!-- notice the additions of utility paddings and display properties on .card-header -->
|
||||
<div class="card-header bg-fusion-50 pr-3 d-flex align-items-center flex-wrap justify-content-between">
|
||||
<!-- we wrap header title inside a div tag with utility padding -->
|
||||
<div class="card-title font-weight-bold">圖片上傳</div>
|
||||
<div class="text-right">
|
||||
<a href="javascript:;" class="btn btn-sm btn-success ml-auto waves-effect waves-themed">
|
||||
<span class="fal fa-plus mr-1"></span> 上傳圖片
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row d-flex justify-content-between">
|
||||
<div class="col-xl">
|
||||
<div class="card border m-auto m-lg-0" style="padding: 9.5px;">
|
||||
<img src="~/img/card-backgrounds/cover-3-lg.png" class="card-img-top" alt="...">
|
||||
<a href="javascript:void(0);" class="btn btn-danger btn-lg btn-icon rounded-circle waves-effect waves-themed position-absolute pos-top pos-right">
|
||||
<i class="fal fa-times"></i>
|
||||
</a>
|
||||
<div class="card-body">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="defaultUnchecked">
|
||||
<label class="custom-control-label" for="defaultUnchecked">卡片顯示圖</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<div class="card border m-auto m-lg-0" style="padding: 9.5px;">
|
||||
<img src="~/img/blank.gif" class="card-img-top" alt="...">
|
||||
<div class="card-body">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="defaultUnchecked">
|
||||
<label class="custom-control-label" for="defaultUnchecked">卡片顯示圖</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<div class="card border m-auto m-lg-0" style="padding: 9.5px;">
|
||||
<img src="~/img/blank.gif" class="card-img-top" alt="...">
|
||||
<div class="card-body">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="defaultUnchecked">
|
||||
<label class="custom-control-label" for="defaultUnchecked">卡片顯示圖</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<div class="card border m-auto m-lg-0" style="padding: 9.5px;">
|
||||
<img src="~/img/blank.gif" class="card-img-top" alt="...">
|
||||
<div class="card-body">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="defaultUnchecked">
|
||||
<label class="custom-control-label" for="defaultUnchecked">卡片顯示圖</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<div class="card border m-auto m-lg-0" style="padding: 9.5px;">
|
||||
<img src="~/img/blank.gif" class="card-img-top" alt="...">
|
||||
<div class="card-body">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="defaultUnchecked">
|
||||
<label class="custom-control-label" for="defaultUnchecked">卡片顯示圖</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div class="card-body">
|
||||
<form action="/upload" class="dropzone needsclick dz-clickable" style="min-height: 7rem;">
|
||||
<div class="dz-message needsclick">
|
||||
<i class="fal fa-cloud-upload text-muted mb-3"></i> <br>
|
||||
<span class="text-uppercase">Drop files here or click to upload.</span>
|
||||
<br>
|
||||
<span class="fs-sm text-muted">This is just a demo dropzone. Selected files are <strong>not</strong> actually uploaded.</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-5">
|
||||
<div class="card border mb-g w-100">
|
||||
<!-- notice the additions of utility paddings and display properties on .card-header -->
|
||||
<div class="card-header bg-fusion-50 pr-3 d-flex align-items-center flex-wrap justify-content-between">
|
||||
<!-- we wrap header title inside a div tag with utility padding -->
|
||||
<div class="card-title font-weight-bold">單線圖</div>
|
||||
<div class="text-right">
|
||||
<a href="javascript:;" class="btn btn-sm btn-success ml-auto waves-effect waves-themed">
|
||||
<span class="fal fa-plus mr-1"></span> 上傳圖片
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row d-flex justify-content-between">
|
||||
<div class="col-xl">
|
||||
<div class="card border m-auto m-lg-0" style="padding: 9.5px;">
|
||||
<img src="~/img/card-backgrounds/cover-3-lg.png" class="card-img-top" alt="...">
|
||||
<a href="javascript:void(0);" class="btn btn-danger btn-lg btn-icon rounded-circle waves-effect waves-themed position-absolute pos-top pos-right">
|
||||
<i class="fal fa-times"></i>
|
||||
</a>
|
||||
<div class="card-body">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="defaultUnchecked">
|
||||
<label class="custom-control-label" for="defaultUnchecked">卡片顯示圖</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<div class="card border m-auto m-lg-0" style="padding: 9.5px;">
|
||||
<img src="~/img/blank.gif" class="card-img-top" alt="...">
|
||||
<div class="card-body">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="defaultUnchecked">
|
||||
<label class="custom-control-label" for="defaultUnchecked">卡片顯示圖</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<div class="card border m-auto m-lg-0" style="padding: 9.5px;">
|
||||
<img src="~/img/blank.gif" class="card-img-top" alt="...">
|
||||
<div class="card-body">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="defaultUnchecked">
|
||||
<label class="custom-control-label" for="defaultUnchecked">卡片顯示圖</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<div class="card border m-auto m-lg-0" style="padding: 9.5px;">
|
||||
<img src="~/img/blank.gif" class="card-img-top" alt="...">
|
||||
<div class="card-body">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="defaultUnchecked">
|
||||
<label class="custom-control-label" for="defaultUnchecked">卡片顯示圖</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
<div class="card border m-auto m-lg-0" style="padding: 9.5px;">
|
||||
<img src="~/img/blank.gif" class="card-img-top" alt="...">
|
||||
<div class="card-body">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="defaultUnchecked">
|
||||
<label class="custom-control-label" for="defaultUnchecked">卡片顯示圖</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div class="card-body">
|
||||
<form action="/upload" class="dropzone needsclick dz-clickable" style="min-height: 7rem;">
|
||||
<div class="dz-message needsclick">
|
||||
<i class="fal fa-cloud-upload text-muted mb-3"></i> <br>
|
||||
<span class="text-uppercase">Drop files here or click to upload.</span>
|
||||
<br>
|
||||
<span class="fs-sm text-muted">This is just a demo dropzone. Selected files are <strong>not</strong> actually uploaded.</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -27,6 +27,8 @@
|
||||
<!-- SweetAlert -->
|
||||
<link rel="stylesheet" media="screen, print" href="~/css/notifications/sweetalert2/sweetalert2.bundle.css">
|
||||
<link rel="stylesheet" media="screen, print" href="~/css/notifications/toastr/toastr.css">
|
||||
|
||||
<link rel="stylesheet" media="screen, print" href="~/css/formplugins/dropzone/dropzone.css">
|
||||
<!--Custome CSS-->
|
||||
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
|
||||
</head>
|
||||
@ -39,7 +41,7 @@
|
||||
<aside class="page-sidebar">
|
||||
<div class="page-logo">
|
||||
<a href="#" class="page-logo-link press-scale-down d-flex align-items-center position-relative" data-toggle="modal" data-target="#modal-shortcut">
|
||||
<img src="img/logo.png" alt="SmartAdmin WebApp" aria-roledescription="logo">
|
||||
<img src="~/img/logo.png" alt="SmartAdmin WebApp" aria-roledescription="logo">
|
||||
<span class="page-logo-text mr-1"></span>
|
||||
<span class="position-absolute text-white opacity-50 small pos-top pos-right mr-2 mt-n2"></span>
|
||||
<!--<i class="fal fa-angle-down d-inline-block ml-1 fs-lg color-primary-300"></i>-->
|
||||
@ -81,7 +83,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-title">Navigation Title</li>-->
|
||||
<li class="open">
|
||||
<li class="">
|
||||
<a href="#" title="Category" data-filter-tags="category">
|
||||
<i class="fal fa-file"></i>
|
||||
<span class="nav-link-text" data-i18n="nav.category">總覽</span>
|
||||
@ -110,7 +112,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="javascript:void(0);" title="電站總覽" data-filter-tags="utilities disabled item">
|
||||
<a href="0stations.html" title="電站總覽" data-filter-tags="utilities disabled item">
|
||||
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">電站總覽</span>
|
||||
</a>
|
||||
</li>
|
||||
@ -210,8 +212,8 @@
|
||||
<span class="nav-link-text" data-i18n="nav.category">系統管理</span>
|
||||
</a>
|
||||
<ul>
|
||||
<li class="">
|
||||
<a href="javascript:void(0);" title="電站資料管理" data-filter-tags="utilities disabled item">
|
||||
<li class="@(ViewData["MainNum"] == "6" && ViewData["SubNum"] == "1" ? "active" : "")">
|
||||
<a asp-controller="PowerStation" asp-action="Index" title="電站資料管理" data-filter-tags="utilities disabled item">
|
||||
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">電站資料管理</span>
|
||||
</a>
|
||||
</li>
|
||||
@ -1146,6 +1148,8 @@
|
||||
<script src="~/js/notifications/toastr/toastr.js"></script>
|
||||
<!--Toast-->
|
||||
<script src="~/js/toast.js"></script>
|
||||
|
||||
<script src="~/js/formplugins/dropzone/dropzone.js"></script>
|
||||
<!-- Custome JS -->
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
|
||||
|
||||
@ -897,13 +897,8 @@
|
||||
$("#role-modal .modal-title").html("人員基本資料 - 新增");
|
||||
$("#role-form").trigger("reset");
|
||||
$("#role_companyId_modal").val($("#select_company_role_roleManager_tab").val());
|
||||
$("#user_account_modal").prop("disabled", false);
|
||||
$(".user_account_same_email_div").show();
|
||||
$("#user_account_same_email").prop("disabled", false);
|
||||
$(".user_password_form_row").show();
|
||||
|
||||
|
||||
$("#user-modal").modal();
|
||||
$("#role-modal").modal();
|
||||
}
|
||||
//#endregion
|
||||
|
||||
@ -1080,6 +1075,6 @@
|
||||
});
|
||||
//#endregion
|
||||
|
||||
//#endregion
|
||||
//#endregion
|
||||
</script>
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
<a href="javascript:;" class="btn btn-success waves-effect waves-themed mb-3" onclick="AddUser()"><span class="fal fa-plus mr-1"></span> 新增</a>
|
||||
<a href="javascript:;" class="btn btn-success waves-effect waves-themed mb-3" onclick="AddRole()"><span class="fal fa-plus mr-1"></span> 新增</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@ -54,7 +54,7 @@
|
||||
<div class="modal-body">
|
||||
<form class="role-form" id="role-form">
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-6">
|
||||
<div class="form-group col-lg-6" style="display:none">
|
||||
<label class="form-label" for="role_companyId_modal">公司</label>
|
||||
<input type="text" id="role_companyId_modal" name="role_companyId_modal" class="form-control" disabled>
|
||||
</div>
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
<div class="modal-body">
|
||||
<form class="user-form" id="user-form">
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-6">
|
||||
<div class="form-group col-lg-6" style="display:none">
|
||||
<label class="form-label" for="user_companyId_modal">公司</label>
|
||||
<input type="text" id="user_companyId_modal" name="user_companyId_modal" class="form-control" disabled>
|
||||
</div>
|
||||
|
||||
@ -8,10 +8,10 @@
|
||||
},
|
||||
"LoginExpireMinute": 60, //登入到期時間,單位(分)
|
||||
"DBConfig": {
|
||||
"Server": "Abc123456",
|
||||
"Database": "321",
|
||||
"Root": "147",
|
||||
"Password": "741"
|
||||
"Server": "172.16.251.248",
|
||||
"Database": "solar_power",
|
||||
"Root": "idafenweb",
|
||||
"Password": "P@ssw0rd"
|
||||
},
|
||||
"JWTConfig": {
|
||||
"Issuer": "SHH", //Token釋出者
|
||||
|
||||
@ -12,13 +12,6 @@ html {
|
||||
}
|
||||
}
|
||||
|
||||
.card-header > .card-title {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
|
||||
/* JQuery Validate*/
|
||||
label.error {
|
||||
color: red;
|
||||
|
||||
@ -286,7 +286,7 @@ RESULT:
|
||||
.page-logo, .page-sidebar, .nav-footer, .bg-brand-gradient {
|
||||
background-image: -webkit-gradient(linear, right top, left top, from(rgba(51, 148, 225, 0.18)), to(transparent));
|
||||
background-image: linear-gradient(270deg, rgba(51, 148, 225, 0.18), transparent);
|
||||
background-color: #404c5c; }
|
||||
background-color: #00152a; }
|
||||
|
||||
/*
|
||||
%shadow-hover {
|
||||
@ -477,7 +477,7 @@ html body {
|
||||
color: #7289aa; }
|
||||
|
||||
.nav-menu li > ul {
|
||||
background-color: rgba(0, 0, 0, 0.1); }
|
||||
background-color: rgba(0, 0, 0, 0.9); }
|
||||
.nav-menu li > ul li a {
|
||||
color: #95a2b5; }
|
||||
.nav-menu li > ul li a > [class*='fa-'],
|
||||
|
||||
1
SolarPower/wwwroot/css/themes/cust-theme-15.css.map_
Normal file
@ -4267,9 +4267,9 @@ input[type="button"].btn-block {
|
||||
|
||||
@media (min-width: 576px) {
|
||||
.card-columns {
|
||||
-webkit-column-count: 3;
|
||||
-moz-column-count: 3;
|
||||
column-count: 3;
|
||||
-webkit-column-count: 5;
|
||||
-moz-column-count: 5;
|
||||
column-count: 5;
|
||||
-webkit-column-gap: 1.25rem;
|
||||
-moz-column-gap: 1.25rem;
|
||||
column-gap: 1.25rem;
|
||||
|
||||
BIN
SolarPower/wwwroot/img/blank.gif
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 907 B After Width: | Height: | Size: 907 B |
BIN
SolarPower/wwwroot/upload/company_logo/default.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |