Browse Source

更改源数据库

master
parent
commit
4cb01d42df
  1. 2
      NugetTest/appsettings.json
  2. 7
      ReZero/SuperAPI/MethodGeneratorAPI/internalapi/PermissionHelper/SavePermissionInfoDetailModel.cs
  3. 20
      SuperAPI/appsettings.json
  4. 66
      SuperAPI/wwwroot/rezero/default_ui/css/page_table_list.css
  5. 728
      SuperAPI/wwwroot/rezero/default_ui/database_manager.html
  6. 365
      SuperAPI/wwwroot/rezero/default_ui/dynamic_interface.html
  7. 317
      SuperAPI/wwwroot/rezero/default_ui/instance-transfer.html
  8. 357
      SuperAPI/wwwroot/rezero/default_ui/interface_categroy.html
  9. 3936
      SuperAPI/wwwroot/rezero/default_ui/interface_manager.html

2
NugetTest/appsettings.json

@ -33,7 +33,7 @@
} }
], ],
//, true //, true
"DisableSystemInterface": false "DisableSystem": false
}, },
"Cors": { "Cors": {
"Enable": true, //true "Enable": true, //true

7
ReZero/SuperAPI/MethodGeneratorAPI/internalapi/PermissionHelper/SavePermissionInfoDetailModel.cs

@ -1,13 +1,16 @@
using System; using SqlSugar;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
namespace ReZero.SuperAPI namespace ReZero.SuperAPI
{ {
public class SavePermissionInfoDetailModel: ZeroPermissionInfo public class SavePermissionInfoDetailModel: ZeroPermissionInfo
{ {
[SqlSugar.SugarColumn(ColumnDataType = "CLOB")]
public List<string>? Users { get; set; } public List<string>? Users { get; set; }
[SqlSugar.SugarColumn(ColumnDataType = "CLOB")]
public List<PermissionInfoInterfaceItem>? Items { get; set; } public List<PermissionInfoInterfaceItem>? Items { get; set; }
} }
public class PermissionInfoInterfaceItem public class PermissionInfoInterfaceItem

20
SuperAPI/appsettings.json

@ -6,15 +6,17 @@
} }
}, },
"ReZero": { "ReZero": {
"BasicDatabase": { "BasicDatabase": {
/* MySql,SqlServer,Sqlite,Oracle,PostgreSQL,Dm (),Kdbndp */ /* MySql,SqlServer,Sqlite,Oracle,PostgreSQL,Dm (),Kdbndp */
// "DbType": "SqlServer", // "DbType": "SqlServer",
// "ConnectionString": "server=.;uid=sa;pwd=sasa;database=SuperAPI" // "ConnectionString": "server=.;uid=sa;pwd=sasa;database=SuperAPI"
// "DbType": "Sqlite", // "DbType": "Sqlite",
// "ConnectionString": "Data Source=SuperAPI.db", // "ConnectionString": "Data Source=SuperAPI.db",
"DbType": "SqlServer", //"DbType": "SqlServer",
"ConnectionString": "server=192.168.2.5;uid=hdhis;pwd=haoding@123;database=SuperAPI" //"ConnectionString": "server=192.168.2.5;uid=hdhis;pwd=haoding@123;database=SuperAPI",
}, "DbType": "Oracle",
"ConnectionString": "Data Source=192.168.2.5:2521/ORCLPDB;User ID=DATA_TRANSFER;Password=his"
},
"Ui": { "Ui": {
/*ReZerofalse,trueSwagger*/ /*ReZerofalse,trueSwagger*/
"ShowNativeApiDocument": true, "ShowNativeApiDocument": true,

66
SuperAPI/wwwroot/rezero/default_ui/css/page_table_list.css

@ -1,58 +1,58 @@
.table-responsive th { .table-responsive th {
text-align: center; text-align: center;
} }
.table_opt { .table_opt {
text-align: center; text-align: center;
width: 250px; width: 250px;
} }
.table_opt button { .table_opt button {
max-width: 80px; max-width: 80px;
margin: 0 10px; margin: 0 10px;
} }
.table_opt2 { .table_opt2 {
text-align: center; text-align: center;
width: 330px; width: 330px;
} }
.table_opt2 button { .table_opt2 button {
max-width: 90px; max-width: 90px;
margin: 0 5px; margin: 0 5px;
} }
.table_opt3 { .table_opt3 {
text-align: center; text-align: center;
width: 450px; width: 450px;
} }
.table_opt3 button { .table_opt3 button {
max-width: 75px; max-width: 75px;
margin: 0 5px; margin: 0 5px;
} }
.form-group label { .form-group label {
border: 0 !important; border: 0 !important;
text-align: right text-align: right;
} }
.search-bar { .search-bar {
padding: 0 15px; padding: 0 15px;
padding-top: 35px; padding-top: 35px;
} }
.pagination { .pagination {
margin-left:20px; margin-left: 20px;
margin-top:-20px; margin-top: -20px;
}
.pagination select {
border: 1px solid #ccc;
width: 40px;
text-align: center;
position: relative;
top: 4px;
} }
.pagination select {
border:1px solid #ccc;
width:40px;
text-align:center;
position:relative;
top:4px
}
.lyear-checkbox { .lyear-checkbox {
padding-left: 10px; padding-left: 10px;
} }

728
SuperAPI/wwwroot/rezero/default_ui/database_manager.html

@ -1,393 +1,389 @@
@@master_page.html @@master_page.html
<link href="css/page_table_list.css" rel="stylesheet" /> <link href="css/page_table_list.css" rel="stylesheet" />
<div id="apibox" class="card"> <div id="apibox" class="card">
<div class="search-bar"> <div class="search-bar">
<form id="frmSearach" action="lyear_forms_elements.html" method="post" onsubmit="return false;">
<form id="frmSearach" action="lyear_forms_elements.html" method="post" onsubmit="return false;"> <div class="form-group">
<div class="form-group"> <div class="row">
<div class="row"> <div class="col-md-1"><label class="form-control" t>库备注:</label></div>
<div class="col-md-1"><label class="form-control" t>库备注:</label></div> <div class="col-md-3"><input class="form-control" type="text" id="txtSearch" name="example-text-input" placeholder="数据库备注"></div>
<div class="col-md-3"><input class="form-control" type="text" id="txtSearch" name="example-text-input" placeholder="数据库备注"></div> <div class="col-md-3">
<div class="col-md-3"> <button @click="onSearch()" id="btnSearch" class="btn btn-secondary"><i class="mdi mdi-magnify"></i>搜索</button>
<button @click="onSearch()" id="btnSearch" class="btn btn-secondary"><i class="mdi mdi-magnify"></i>搜索</button> <button onclick="frmSearach.reset()" class="btn btn-close" type="submit">清空</button>
<button onclick="frmSearach.reset()" class="btn btn-close" type="submit">清空</button> </div>
</div> <div class="col-md-4"></div>
<div class="col-md-4"></div>
</div>
</div>
</form>
<div class="toolbar-btn-action">
<button @click="openAddDiv()" class="btn btn-primary m-r-5" data-toggle="modal" data-target="#gridSystemModal"><i class="mdi mdi-plus"></i> 新增</button>
<button @click="openSynchronousDataDiv()" class="btn btn-success m-r-5" data-toggle="modal" data-target="#btnSynchronousData"><i class="mdi mdi-redo-variant"></i> 同步接口</button>
</div> </div>
</div>
</form>
<div class="toolbar-btn-action">
<button @click="openAddDiv()" class="btn btn-primary m-r-5" data-toggle="modal" data-target="#gridSystemModal"><i class="mdi mdi-plus"></i> 新增</button>
<button @click="openSynchronousDataDiv()" class="btn btn-success m-r-5" data-toggle="modal" data-target="#btnSynchronousData"><i class="mdi mdi-redo-variant"></i> 同步接口</button>
</div> </div>
<div class="card-body"> </div>
<div class="card-body">
<h5> </h5> <h5> </h5>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead>
<tr v-if="data && data.Columns && data.Columns.length > 0"> <tr v-if="data && data.Columns && data.Columns.length > 0">
<th class="mi-w-100" v-for="column in data.Columns">{{column.ColumnDescription}}</th> <th class="mi-w-100" v-for="column in data.Columns">{{column.ColumnDescription}}</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
</thead> </thead>
<tbody v-if="data &&data.Data"> <tbody v-if="data &&data.Data">
<tr v-if="data.Columns && data.Columns.length > 0" v-for="item in data.Data"> <tr v-if="data.Columns && data.Columns.length > 0" v-for="item in data.Data">
<td v-for="(column,index) in data.Columns" class="word-all"> <td v-for="(column,index) in data.Columns" class="word-all">
<div v-if="index == 0" class="mi-w-150"> <div v-if="index == 0" class="mi-w-150">
{{ item[column.PropertyName] }} {{ item[column.PropertyName] }}
</div> </div>
<div v-else> <div v-else>
{{ item[column.PropertyName] }} {{ item[column.PropertyName] }}
</div> </div>
</td> </td>
<td class="table_opt3"> <td class="table_opt3">
<button data-toggle="modal" @click="testDatabase(item)" class="btn btn-link" type="button"> <button data-toggle="modal" @click="testDatabase(item)" class="btn btn-link" type="button">
<i class="mdi mdi-test-tube"></i> 测试 <i class="mdi mdi-test-tube"></i> 测试
</button> </button>
<button data-toggle="modal" @click="createDatabase(item)" class="btn btn-link" type="button"> <button data-toggle="modal" @click="createDatabase(item)" class="btn btn-link" type="button">
<i class="mdi mdi-cube"></i> 建库 <i class="mdi mdi-cube"></i> 建库
</button> </button>
<button data-toggle="modal" @click="openEditDiv(item)" data-target="#gridSystemModal" class="btn btn-link" type="button"> <button data-toggle="modal" @click="openEditDiv(item)" data-target="#gridSystemModal" class="btn btn-link" type="button">
<i class="mdi mdi-lead-pencil"></i> 修改 <i class="mdi mdi-lead-pencil"></i> 修改
</button> </button>
<button data-toggle="modal" @click="deleteAndConfirm(item)" data-target="#divDelBox" class="btn btn-link" type="button"> <button data-toggle="modal" @click="deleteAndConfirm(item)" data-target="#divDelBox" class="btn btn-link" type="button">
<i class="mdi mdi-do-not-disturb"></i> 删除 <i class="mdi mdi-do-not-disturb"></i> 删除
</button> </button>
</td> </td>
</tr> </tr>
</tbody>
</table>
</div>
</tbody>
</table>
</div> </div>
@@page_control.html
<div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel" id="gridSystemModal" style="display: none;"> </div>
<div class="modal-dialog" role="document"> @@page_control.html
<div class="modal-content"> <div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel" id="gridSystemModal" style="display: none;">
<div class="modal-header"> <div class="modal-dialog" role="document">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <div class="modal-content">
<h4 class="modal-title" id="exampleModalLabel">{{title}}</h4> <div class="modal-header">
</div> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<div class="modal-body"> <h4 class="modal-title" id="exampleModalLabel">{{title}}</h4>
<form id="frmEdit"> </div>
<input type="hidden" v-model="formData.Id" name="Id" /> <div class="modal-body">
<div class="form-group"> <form id="frmEdit">
<label for="recipient-name" class="control-label">库备注:</label> <input type="hidden" v-model="formData.Id" name="Id" />
<input type="text" v-model="formData.Name" name="Name" class="form-control" id="recipient-name"> <div class="form-group">
</div> <label for="recipient-name" class="control-label">库备注:</label>
<div class="form-group"> <input type="text" v-model="formData.Name" name="Name" class="form-control" id="recipient-name">
<label for="message-text" class="control-label">数据库类型:</label> </div>
<select @change="showMessage" class="form-control" v-model="formData.DbType" name="DbType"> <div class="form-group">
<option v-for="item in dbTypeList" v-bind:value="item.Value"> {{item.Name}} </option> <label for="message-text" class="control-label">数据库类型:</label>
</select> <select @change="showMessage" class="form-control" v-model="formData.DbType" name="DbType">
</div> <option v-for="item in dbTypeList" v-bind:value="item.Value"> {{item.Name}} </option>
<div class="form-group"> </select>
<label for="message-text" class="control-label">字符串:</label> </div>
<textarea class="form-control" v-model="formData.Connection" name="Connection" id="message-text"></textarea> <div class="form-group">
</div> <label for="message-text" class="control-label">字符串:</label>
<div class="form-group"> <textarea class="form-control" v-model="formData.Connection" name="Connection" id="message-text"></textarea>
<code class="db0 hidden dbmessage"> </div>
MySql示例:<br /> <div class="form-group">
server=localhost;Database=SqlSugar4xTest;Uid=root;Pwd=haosql; <code class="db0 hidden dbmessage">
非默认端口要用port=3306 MySql示例:<br />
</code> server=localhost;Database=SqlSugar4xTest;Uid=root;Pwd=haosql;
<code class="db1 hidden dbmessage"> 非默认端口要用port=3306
SqlServer示例:<br /> </code>
server=localhost;Database=SqlSugar4xTest;Uid=root;Pwd=haosql;<br /> <code class="db1 hidden dbmessage">
.net8需要注意 启动文件csproj文件 ,InvariantGlobalization设置为false<br /> SqlServer示例:<br />
有端口localhost:1433; server=localhost;Database=SqlSugar4xTest;Uid=root;Pwd=haosql;<br />
</code> .net8需要注意 启动文件csproj文件 ,InvariantGlobalization设置为false<br />
<code class="db2 hidden dbmessage"> 有端口localhost:1433;
Sqlite示例:<br /> </code>
DataSource=xxx.sqlite <code class="db2 hidden dbmessage">
</code> Sqlite示例:<br />
<code class="db3 hidden dbmessage"> DataSource=xxx.sqlite
Oracle示例:<br /> </code>
//写法1<br /> <code class="db3 hidden dbmessage">
Data Source=localhost/orcl;User ID=system;Password=haha<br /> Oracle示例:<br />
//字法2 上面连不上可以试用下面写法<br /> //写法1<br />
Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=150.158.57.125)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCL)));User Id=xx;Password=xx;Pooling='true';Max Pool Size=150 Data Source=localhost/orcl;User ID=system;Password=haha<br />
</code> //字法2 上面连不上可以试用下面写法<br />
<code class="db4 hidden dbmessage"> Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=150.158.57.125)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCL)));User Id=xx;Password=xx;Pooling='true';Max Pool Size=150
Postgresql 示例:<br /> </code>
PORT=5432;DATABASE=SqlSugar4xTest;HOST=localhost;PASSWORD=haosql;USER ID=postgres<br /> <code class="db4 hidden dbmessage">
不是public需要设置架构名searchpath=架构名 Postgresql 示例:<br />
</code> PORT=5432;DATABASE=SqlSugar4xTest;HOST=localhost;PASSWORD=haosql;USER ID=postgres<br />
<code class="db5 hidden dbmessage"> 不是public需要设置架构名searchpath=架构名
达梦 示例:<br /> </code>
Server=153.101.101:5236;User Id=SYSDBA;PWD=123456;SCHEMA=架构;DATABASE=DAMENG <code class="db5 hidden dbmessage">
</code> 达梦 示例:<br />
<code class="db6 hidden dbmessage"> Server=153.101.101:5236;User Id=SYSDBA;PWD=123456;SCHEMA=架构;DATABASE=DAMENG
人大金仓 示例:<br /> </code>
Server=127.0.0.1;Port=54321;UID=SYSTEM;PWD=system;database=SQLSUGAR4XTEST1<br> <code class="db6 hidden dbmessage">
默认是Oracle模式,如果不是Oracle模式需要看SqlSugar文档改ReZero源码<br> 人大金仓 示例:<br />
通过SQL可以查看安装模式 show database_mode; Server=127.0.0.1;Port=54321;UID=SYSTEM;PWD=system;database=SQLSUGAR4XTEST1<br>
</code> 默认是Oracle模式,如果不是Oracle模式需要看SqlSugar文档改ReZero源码<br>
</div> 通过SQL可以查看安装模式 show database_mode;
</form> </code>
</div>
<div class="modal-footer">
<button type="button" id="btnCloseEdit" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" @click="addOrUpdate()" class="btn btn-primary">保存</button>
</div>
</div> </div>
</form>
</div>
<div class="modal-footer">
<button type="button" id="btnCloseEdit" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" @click="addOrUpdate()" class="btn btn-primary">保存</button>
</div> </div>
</div>
</div> </div>
<div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel" id="btnSynchronousData" style="display: none;"> </div>
<div class="modal-dialog" role="document"> <div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel" id="btnSynchronousData" style="display: none;">
<div class="modal-content"> <div class="modal-dialog" role="document">
<div class="modal-header"> <div class="modal-content">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <div class="modal-header">
<h4 class="modal-title">同步数据</h4> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div> <h4 class="modal-title">同步数据</h4>
</div>
<div class="card-body">
<p class="alert alert-success">
注意:这儿只同步四张配置表,业务表需要在【菜单:实体表维护】选实体点同步<br />
1、接口数据 : [zero_interface_list]
[zero_interface_category]<br />
2、实体数据 : [zero_entity_info]
[zero_entity_column_info]
</p>
<form class="form-horizontal">
<div class="form-group has-success">
<label class="col-xs-12 text-align-left" for="example-text-input-success">基准库</label>
<div class="col-xs-12">
<select v-model="od_originaldb" class="form-control" type="text" id="example-text-input-success" name="example-text-input-success" placeholder="成功状态..">
<option value="1">启动库Rezro</option>
</select>
</div>
</div>
<div class="form-group has-success">
<label class="col-xs-12 text-align-left" for="example-text-input-success2">更新库</label>
<div class="col-xs-12">
<select v-model="od_targetdb" class="form-control" type="text" id="example-text-input-success2" name="example-text-input-success" placeholder="成功状态..">
<option :value="item.Id" v-if="item.Id!=1" v-for="item in dataAll">{{item.Name}}</option>
</select>
</div>
</div>
<div class="form-group has-success">
<label class="col-xs-12 text-align-left" for="example-text-input-success">备份表</label>
<div class="col-xs-12">
<label class="lyear-checkbox checkbox-primary text-align-left">
<input v-model="od_isbak" type="checkbox" class="checkbox-parent checkbox-child" dataid="id-1-6" value="true">
<span class="m-l-15"> 表名+时间HHmmss</span>
</label>
</div>
</div>
</form>
</div>
<div class="modal-footer"> <div class="card-body">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> <p class="alert alert-success">
<button type="button" @click="synchronousData" class="btn btn-primary">同步</button> 注意:这儿只同步四张配置表,业务表需要在【菜单:实体表维护】选实体点同步<br />
</div> 1、接口数据 : [zero_interface_list]
[zero_interface_category]<br />
2、实体数据 : [zero_entity_info]
[zero_entity_column_info]
</p>
<form class="form-horizontal">
<div class="form-group has-success">
<label class="col-xs-12 text-align-left" for="example-text-input-success">基准库</label>
<div class="col-xs-12">
<select v-model="od_originaldb" class="form-control" type="text" id="example-text-input-success" name="example-text-input-success" placeholder="成功状态..">
<option value="1">启动库Rezro</option>
</select>
</div>
</div>
<div class="form-group has-success">
<label class="col-xs-12 text-align-left" for="example-text-input-success2">更新库</label>
<div class="col-xs-12">
<select v-model="od_targetdb" class="form-control" type="text" id="example-text-input-success2" name="example-text-input-success" placeholder="成功状态..">
<option :value="item.Id" v-if="item.Id!=1" v-for="item in dataAll">{{item.Name}}</option>
</select>
</div>
</div>
<div class="form-group has-success">
<label class="col-xs-12 text-align-left" for="example-text-input-success">备份表</label>
<div class="col-xs-12">
<label class="lyear-checkbox checkbox-primary text-align-left">
<input v-model="od_isbak" type="checkbox" class="checkbox-parent checkbox-child" dataid="id-1-6" value="true">
<span class="m-l-15"> 表名+时间HHmmss</span>
</label>
</div>
</div> </div>
</form>
</div> </div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" @click="synchronousData" class="btn btn-primary">同步</button>
</div>
</div>
</div> </div>
</div>
</div> </div>
<script> <script>
var vueObj = new Vue({ var vueObj = new Vue({
el: '#apibox', el: '#apibox',
data: { data: {
data: null, data: null,
dataAll: null, dataAll: null,
error: null, error: null,
addTitle: "添加数据库配置", addTitle: "添加数据库配置",
editTitle: "修改数据库配置", editTitle: "修改数据库配置",
title: "", title: "",
dbTypeList: [], dbTypeList: [],
formData: { formData: {
}, },
od_isbak: false, od_isbak: false,
od_originaldb: null, od_originaldb: null,
od_targetdb: null, od_targetdb: null,
lock: false lock: false
}, },
mounted() { mounted() {
this.fetchData(""); this.fetchData("");
}, },
methods: { methods: {
fetchData(append) { fetchData(append) {
var url = "/PrivateReZeroRoute/100003/GetDatabaseInfoList?ParentId=200" + append; var url = "/PrivateReZeroRoute/100003/GetDatabaseInfoList?ParentId=200" + append;
axios.get(url, jwHeader) axios.get(url, jwHeader)
.then(response => { .then(response => {
this.data = response.data; this.data = response.data;
this.error = null; this.error = null;
}) })
.catch(error => { .catch(error => {
this.error = error.message; this.error = error.message;
this.data = null; this.data = null;
}); });
axios.get("/PrivateReZeroRoute/100004/GetDbTypeList", jwHeader) axios.get("/PrivateReZeroRoute/100004/GetDbTypeList", jwHeader)
.then(response => { .then(response => {
this.dbTypeList = response.data; this.dbTypeList = response.data;
this.error = null; this.error = null;
}) })
.catch(error => { .catch(error => {
this.error = error.message; this.error = error.message;
this.data = null; this.data = null;
}); });
axios.get("/PrivateReZeroRoute/100004/GetDatabaseInfoAllList", jwHeader) axios.get("/PrivateReZeroRoute/100004/GetDatabaseInfoAllList", jwHeader)
.then(response => { .then(response => {
this.dataAll = response.data; this.dataAll = response.data;
}) })
.catch(error => { .catch(error => {
this.error = error.message; this.error = error.message;
this.data = null; this.data = null;
}); });
}, },
onSearch: function (page) { onSearch: function (page) {
var urlParameters = "&" + tools.objectToQueryString({ var urlParameters = "&" + tools.objectToQueryString({
Name: txtSearch.value, Name: txtSearch.value,
__pageNumber: page, __pageNumber: page,
__pageSize: tools.getValue("selPageSize"), __pageSize: tools.getValue("selPageSize"),
}); });
this.fetchData(urlParameters); this.fetchData(urlParameters);
}, },
deleteAndConfirm: function (item) { deleteAndConfirm: function (item) {
if (item == null) { if (item == null) {
var url = "/PrivateReZeroRoute/100003/DeleteDataBaseInfo?IsDeleted=true&Id=" + localStorage.delId; var url = "/PrivateReZeroRoute/100003/DeleteDataBaseInfo?IsDeleted=true&Id=" + localStorage.delId;
axios.get(url, jwHeader) axios.get(url, jwHeader)
.then(response => { .then(response => {
if (response.data.message) { if (response.data.message) {
tools.alert(response.data.message); tools.alert(response.data.message);
} }
this.error = null; this.error = null;
this.onSearch(); this.onSearch();
btnDelClose.click(); btnDelClose.click();
}) })
.catch(error => { .catch(error => {
this.error = error.message; this.error = error.message;
this.data = null; this.data = null;
}); });
} else { } else {
localStorage.delId = item.Id; localStorage.delId = item.Id;
} }
}, },
openEditDiv: function (item) { openEditDiv: function (item) {
var urlById = "/PrivateReZeroRoute/100003/GetDataBaseInfoById?id=" + item.Id; var urlById = "/PrivateReZeroRoute/100003/GetDataBaseInfoById?id=" + item.Id;
if (item.Id) { if (item.Id) {
this.title = this.editTitle; this.title = this.editTitle;
axios.get(urlById, jwHeader) axios.get(urlById, jwHeader)
.then(response => { .then(response => {
this.formData = response.data; this.formData = response.data;
}) })
.catch(error => { .catch(error => {
this.error = error.message; this.error = error.message;
this.data = null; this.data = null;
}); });
} }
}, },
openAddDiv: function (item) { openAddDiv: function (item) {
this.formData = {}; this.formData = {};
this.title = this.addTitle; this.title = this.addTitle;
}, },
addOrUpdate: function () { addOrUpdate: function () {
var th = this; var th = this;
var frmId = "frmEdit"; var frmId = "frmEdit";
var json = this.formData; var json = this.formData;
var url = json.Id ? var url = json.Id ?
"/PrivateReZeroRoute/100003/UpdateDatabaseInfo" : "/PrivateReZeroRoute/100003/UpdateDatabaseInfo" :
"/PrivateReZeroRoute/100003/AddDatabaseInfo"; "/PrivateReZeroRoute/100003/AddDatabaseInfo";
this.addOrUpdateSubmit(url, json); this.addOrUpdateSubmit(url, json);
}, },
addOrUpdateSubmit: function (url, json) { addOrUpdateSubmit: function (url, json) {
var th = this; var th = this;
axios.post(url, json, jwHeader) axios.post(url, json, jwHeader)
.then(response => { .then(response => {
this.error = null; this.error = null;
this.onSearch(); this.onSearch();
if (response.data == true) { if (response.data == true) {
frmEdit.reset(); frmEdit.reset();
btnCloseEdit.click(); btnCloseEdit.click();
} }
else { else {
tools.highlightErrorFields(response.data) tools.highlightErrorFields(response.data)
}
})
.catch(error => {
this.error = error.message;
this.data = null;
});
},
testDatabase: function (item) {
axios.post("/PrivateReZeroRoute/100003/TestDatabaseInfo", { Id: item.Id }, jwHeader)
.then(response => {
this.error = null;
tools.alert(response.data + "");
})
.catch(error => {
this.error = error.message;
});
},
createDatabase: function (item) {
axios.post("/PrivateReZeroRoute/100003/CreateDatabaseInfo", { Connection: item.Connection, DbType: item.DbType }, jwHeader)
.then(response => {
this.error = null;
tools.alert(response.data + "");
})
.catch(error => {
this.error = error.message;
});
},
openSynchronousDataDiv: function () {
},
synchronousData: function () {
if (!this.od_originaldb) {
tools.alert("请选择基准库");
return;
}
if (!this.od_targetdb) {
tools.alert("请选择更新库");
return;
}
if (this.od_targetdb == this.od_originaldb) {
tools.alert("相同库不需要同步");
return;
}
if (this.lock == true)
{
return;
}
this.lock = true;
axios.post("/PrivateReZeroRoute/100003/SynchronousData",
{
OriginalDb: this.od_originaldb,
TargetDb: this.od_targetdb,
IsBak: this.od_isbak
}, jwHeader)
.then(response => {
this.lock = false;
this.error = null;
if (response.data == true) {
tools.alert("同步成功");
} else {
tools.alert(response.data.message);
}
})
.catch(error => {
this.error = error.message;
});
},
showMessage: function ()
{
var id = this.formData.DbType;
$(".dbmessage").addClass("hidden");
$(".db" + id).removeClass("hidden");
} }
})
.catch(error => {
this.error = error.message;
this.data = null;
});
},
testDatabase: function (item) {
axios.post("/PrivateReZeroRoute/100003/TestDatabaseInfo", { Id: item.Id }, jwHeader)
.then(response => {
this.error = null;
tools.alert(response.data + "");
})
.catch(error => {
this.error = error.message;
});
},
createDatabase: function (item) {
axios.post("/PrivateReZeroRoute/100003/CreateDatabaseInfo", { Connection: item.Connection, DbType: item.DbType }, jwHeader)
.then(response => {
this.error = null;
tools.alert(response.data + "");
})
.catch(error => {
this.error = error.message;
});
},
openSynchronousDataDiv: function () {
},
synchronousData: function () {
if (!this.od_originaldb) {
tools.alert("请选择基准库");
return;
}
if (!this.od_targetdb) {
tools.alert("请选择更新库");
return;
} }
});</script> if (this.od_targetdb == this.od_originaldb) {
tools.alert("相同库不需要同步");
return;
}
if (this.lock == true) {
return;
}
this.lock = true;
axios.post("/PrivateReZeroRoute/100003/SynchronousData",
{
OriginalDb: this.od_originaldb,
TargetDb: this.od_targetdb,
IsBak: this.od_isbak
}, jwHeader)
.then(response => {
this.lock = false;
this.error = null;
if (response.data == true) {
tools.alert("同步成功");
} else {
tools.alert(response.data.message);
}
})
.catch(error => {
this.error = error.message;
});
},
showMessage: function () {
var id = this.formData.DbType;
$(".dbmessage").addClass("hidden");
$(".db" + id).removeClass("hidden");
}
}
});</script>

365
SuperAPI/wwwroot/rezero/default_ui/dynamic_interface.html

@ -1,191 +1,190 @@
@@master_page.html @@master_page.html
<link href="css/page_interface.css?v=2" rel="stylesheet" /> <link href="css/page_interface.css?v=2" rel="stylesheet" />
<div id="apibox"> <div id="apibox">
<div class="form-group row"> <div class="form-group row">
<form id="frmSearch" onsubmit="return false;"> <form id="frmSearch" onsubmit="return false;">
<div class="row "> <div class="row ">
<div class="col-md-2"> </div> <div class="col-md-2"> </div>
<div class="col-md-6"> <div class="col-md-6">
<input class="form-control" type="text" id="txtSearch" name="example-text-input" placeholder="Url or name"> <input class="form-control" type="text" id="txtSearch" name="example-text-input" placeholder="Url or name">
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<button @click="onSearch()" id="btnSearch" class="btn btn-success" type="submit"><i class="mdi mdi-magnify"></i>搜索</button> <button @click="onSearch()" id="btnSearch" class="btn btn-success" type="submit"><i class="mdi mdi-magnify"></i>搜索</button>
<button onclick="frmSearch.reset()" id="btnSearch" class="btn btn-close" type="submit">清空</button> <button onclick="frmSearch.reset()" id="btnSearch" class="btn btn-close" type="submit">清空</button>
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
数据库 <span class="caret"></span> 数据库 <span class="caret"></span>
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li v-for="item in database"><a :href="getDynamicApiDocUrlByDatabase(item)">{{item.Name}}</a></li> <li v-for="item in database"><a :href="getDynamicApiDocUrlByDatabase(item)">{{item.Name}}</a></li>
</ul> </ul>
</div> </div>
<div class="btn-group m-l-10"> <div class="btn-group m-l-10">
<button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
分类 <span class="caret"></span> 分类 <span class="caret"></span>
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li v-for="item in interfaceCategroyList"><a :href="getDynamicApiDocUrl(item)">{{item.Name}}</a></li> <li v-for="item in interfaceCategroyList"><a :href="getDynamicApiDocUrl(item)">{{item.Name}}</a></li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<div class="data" v-for="masterItem in data" :key="masterItem.Key"> <div class="data" v-for="masterItem in data" :key="masterItem.Key">
<h2>{{ masterItem.Key }} </h2> <h2>{{ masterItem.Key }} </h2>
<section v-for="item in masterItem.Value" :key="item.Id"> <section v-for="item in masterItem.Value" :key="item.Id">
<div :class="getEndpointType(item)"> <div :class="getEndpointType(item)">
<p class="p" @click="toggleEndpoint"> <p class="p" @click="toggleEndpoint">
<span class="method">{{ item.HttpMethod }}</span> <span class="method">{{ item.HttpMethod }}</span>
<span class="url"> {{item.Url}} {{item.Name}}</span> <span class="url"> {{item.Url}} {{item.Name}}</span>
<span class="openapi">+</span> <span class="openapi">+</span>
</p> </p>
<p>{{ item.Description }}</p> <p>{{ item.Description }}</p>
<div class="parameter-title" style="display:none"> <div class="parameter-title" style="display:none">
Parameters: Parameters:
<div class="try-out"> <div class="try-out">
<button class="btn try-out__btn" @click="tryItOut(item)">Try it out </button> <button class="btn try-out__btn" @click="tryItOut(item)">Try it out </button>
</div> </div>
</div> </div>
<div class="parameter" style="display:none" v-if="item.DataModel.DefaultParameters && item.DataModel.DefaultParameters.length > 0"> <div class="parameter" style="display:none" v-if="item.DataModel.DefaultParameters && item.DataModel.DefaultParameters.length > 0">
<ul> <ul>
<li v-for="param in item.DataModel.DefaultParameters.filter(p => !p.ValueIsReadOnly && p.Value !== undefined && p.Value !== '')" :key="param.Name"> <li v-for="param in item.DataModel.DefaultParameters.filter(p => !p.ValueIsReadOnly && p.Value !== undefined && p.Value !== '')" :key="param.Name">
<code>{{ param.ValueIsReadOnly ? 'Readonly:':''}}{{ param.Name }}</code> ({{ param.ValueType }}) - {{param.Type}} {{ param.Description }} {{ param.Value ? ' ['+param.Name +' = ' + param.Value+']' : ''}} <code>{{ param.ValueIsReadOnly ? 'Readonly:':''}}{{ param.Name }}</code> ({{ param.ValueType }}) - {{param.Type}} {{ param.Description }} {{ param.Value ? ' ['+param.Name +' = ' + param.Value+']' : ''}}
</li> </li>
<li v-if="item.DataModel.OrderDynamicParemters"> <li v-if="item.DataModel.OrderDynamicParemters">
<code>OrderBy:[{FieldName:"FieldName",OrderByType:0}] 0 Asc, 1 Desc </code> <code>OrderBy:[{FieldName:"FieldName",OrderByType:0}] 0 Asc, 1 Desc </code>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
</section> </section>
</div> </div>
<!-- 添加这个div来显示“还没有数据”当data为空时 --> <!-- 添加这个div来显示“还没有数据”当data为空时 -->
<div v-if="data==null||data.length === 0" class="no-data-message"> <div v-if="data==null||data.length === 0" class="no-data-message">
<div class="alert alert-warning" role="alert"> <div class="alert alert-warning" role="alert">
<p> 没有创建接口:1、先创建实体,2、点同步创建表,3、创建接口</p> <p> 没有创建接口:1、先创建实体,2、点同步创建表,3、创建接口</p>
<p> 创建了没显示: 菜单:【系统配置-接口授权】 给用户授权可以访问的接口 或者 清空所有接口授权</p> <p> 创建了没显示: 菜单:【系统配置-接口授权】 给用户授权可以访问的接口 或者 清空所有接口授权</p>
</div>
</div> </div>
</div>
</div> </div>
<script> <script>
new Vue({ new Vue({
el: '#apibox', el: '#apibox',
data: { data: {
data: null, data: null,
error: null, error: null,
interfaceCategroyList: [], interfaceCategroyList: [],
database: [], database: [],
}, },
mounted() { mounted() {
// 在组件加载时触发数据获取 // 在组件加载时触发数据获取
this.fetchData(null); this.fetchData(null);
this.bindInterfaceCategroySelect(); this.bindInterfaceCategroySelect();
this.bindDatabaseSelect(); this.bindDatabaseSelect();
}, },
methods: { methods: {
fetchData(name) { fetchData(name) {
var urlParams = new URLSearchParams(window.location.search); var urlParams = new URLSearchParams(window.location.search);
var idFromUrl = urlParams.get('InterfaceCategoryId'); var idFromUrl = urlParams.get('InterfaceCategoryId');
var databaseIdFromUrl = urlParams.get('DatabaseId'); var databaseIdFromUrl = urlParams.get('DatabaseId');
var url = url = '/PrivateReZeroRoute/100003/GetInternalInterfaceList?IsInitialized=0'; var url = url = '/PrivateReZeroRoute/100003/GetInternalInterfaceList?IsInitialized=0';
var urlParameters = "&" + tools.objectToQueryString({ var urlParameters = "&" + tools.objectToQueryString({
Name: txtSearch.value, Name: txtSearch.value,
InterfaceCategoryId: idFromUrl, InterfaceCategoryId: idFromUrl,
DatabaseId:databaseIdFromUrl DatabaseId: databaseIdFromUrl
}); });
url = url + urlParameters; url = url + urlParameters;
axios.get(url, jwHeader) axios.get(url, jwHeader)
.then(response => { .then(response => {
this.data = response.data; this.data = response.data;
this.error = null; this.error = null;
}) })
.catch(error => { .catch(error => {
this.error = error.message; this.error = error.message;
this.data = null; this.data = null;
}); });
}, },
tryItOut(item) { tryItOut(item) {
var urlParams = new URLSearchParams(window.location.search); var urlParams = new URLSearchParams(window.location.search);
var token = urlParams.get('token'); var token = urlParams.get('token');
window.open('/rezero/try_api.html?id=' + item.Id + "&token=" + token, '_blank'); window.open('/rezero/try_api.html?id=' + item.Id + "&token=" + token, '_blank');
}, },
onSearch: function () { onSearch: function () {
this.fetchData(txtSearch.value); this.fetchData(txtSearch.value);
}, },
toggleEndpoint(event) { toggleEndpoint(event) {
var $currentTarget = $(event.currentTarget); var $currentTarget = $(event.currentTarget);
var $parent = $currentTarget.parent(); var $parent = $currentTarget.parent();
var $parameterElements = $parent.find(".parameter-title, .parameter"); var $parameterElements = $parent.find(".parameter-title, .parameter");
var $textEle = $currentTarget.find(".openapi"); var $textEle = $currentTarget.find(".openapi");
var isTextPlus = $textEle.text() === "+"; var isTextPlus = $textEle.text() === "+";
$parameterElements.toggle(100); $parameterElements.toggle(100);
$textEle.text(isTextPlus ? "-" : "+").toggleClass("reduction", isTextPlus); $textEle.text(isTextPlus ? "-" : "+").toggleClass("reduction", isTextPlus);
}, },
bindInterfaceCategroySelect: function () { bindInterfaceCategroySelect: function () {
axios.get("/PrivateReZeroRoute/100004/GetDynamicInterfaceCategoryList", jwHeader) axios.get("/PrivateReZeroRoute/100004/GetDynamicInterfaceCategoryList", jwHeader)
.then(response => { .then(response => {
this.interfaceCategroyList = response.data; this.interfaceCategroyList = response.data;
}) })
.catch(error => { .catch(error => {
this.error = error.message; this.error = error.message;
this.data = null; this.data = null;
}); });
}, },
bindDatabaseSelect: function () { bindDatabaseSelect: function () {
axios.get("/PrivateReZeroRoute/100004/GetDatabaseInfoAllList", jwHeader) axios.get("/PrivateReZeroRoute/100004/GetDatabaseInfoAllList", jwHeader)
.then(response => { .then(response => {
this.database = response.data; this.database = response.data;
this.databaseId = this.database[0].Id; this.databaseId = this.database[0].Id;
var th = this; var th = this;
setTimeout(function () { setTimeout(function () {
th.onSearch(); th.onSearch();
}, 50); }, 50);
}) })
.catch(error => { .catch(error => {
this.error = error.message; this.error = error.message;
this.data = null; this.data = null;
}); });
}, },
getEndpointType(item) { getEndpointType(item) {
var actionType =item.DataModel.ActionType; var actionType = item.DataModel.ActionType;
if (item.HttpMethod == "Get") { if (item.HttpMethod == "Get") {
return 'endpoint endpointGet'; return 'endpoint endpointGet';
} else if (item.HttpMethod == "Post") { } else if (item.HttpMethod == "Post") {
return 'endpoint endpointPost'; return 'endpoint endpointPost';
} else if (item.HttpMethod == "Delete") { } else if (item.HttpMethod == "Delete") {
return 'endpoint endpointDelete'; return 'endpoint endpointDelete';
} else if (item.HttpMethod == "Put") { } else if (item.HttpMethod == "Put") {
return 'endpoint endpointPut'; return 'endpoint endpointPut';
} else if (actionType.startsWith('1')) { } else if (actionType.startsWith('1')) {
return 'endpoint endpointGet'; return 'endpoint endpointGet';
} else if (actionType.startsWith('2')) { } else if (actionType.startsWith('2')) {
return 'endpoint endpointPost'; return 'endpoint endpointPost';
} else if (actionType.startsWith('6')) { } else if (actionType.startsWith('6')) {
return 'endpoint endpointPost'; return 'endpoint endpointPost';
} else if (actionType.startsWith('3')) { } else if (actionType.startsWith('3')) {
return 'endpoint endpointDelete'; return 'endpoint endpointDelete';
} else if (actionType.startsWith('4')) { } else if (actionType.startsWith('4')) {
return 'endpoint endpointPut'; return 'endpoint endpointPut';
} else if (actionType.startsWith('9')) { } else if (actionType.startsWith('9')) {
return 'endpoint endpointSql'; return 'endpoint endpointSql';
} else { } else {
return 'endpoint endpointOther'; return 'endpoint endpointOther';
}
},
getDynamicApiDocUrl: function (item)
{
var urlParams = new URLSearchParams(window.location.search);
var token = urlParams.get('token');
var model = urlParams.get('model');
return "/rezero/dynamic_interface.html?InterfaceCategoryId=" + item.Id + "&model=" + model + "&token=" + token;
},
getDynamicApiDocUrlByDatabase: function (item) {
var urlParams = new URLSearchParams(window.location.search);
var token = urlParams.get('token');
var model = urlParams.get('model');
return "/rezero/dynamic_interface.html?DatabaseId=" + item.Id + "&model=" + model + "&token=" + token;
}
} }
}); },
getDynamicApiDocUrl: function (item) {
var urlParams = new URLSearchParams(window.location.search);
var token = urlParams.get('token');
var model = urlParams.get('model');
return "/rezero/dynamic_interface.html?InterfaceCategoryId=" + item.Id + "&model=" + model + "&token=" + token;
},
getDynamicApiDocUrlByDatabase: function (item) {
var urlParams = new URLSearchParams(window.location.search);
var token = urlParams.get('token');
var model = urlParams.get('model');
return "/rezero/dynamic_interface.html?DatabaseId=" + item.Id + "&model=" + model + "&token=" + token;
}
}
});
</script> </script>

317
SuperAPI/wwwroot/rezero/default_ui/instance-transfer.html

@ -0,0 +1,317 @@
@@master_page.html
<link
href="css/page_table_list.css"
rel="stylesheet"
/>
<div
id="apibox"
class="card"
>
<div class="search-bar">
<form
id="frmSearach"
action="lyear_forms_elements.html"
method="post"
onsubmit="return false;"
>
<div class="form-group">
<div class="row">
<div class="col-md-1">
<label
class="form-control"
t
>名称:</label
>
</div>
<div class="col-md-3">
<input
class="form-control"
type="text"
id="txtSearch"
name="example-text-input"
placeholder="分类名称"
/>
</div>
<div class="col-md-3">
<button
@click="onSearch()"
id="btnSearch"
class="btn btn-secondary"
>
<i class="mdi mdi-magnify"></i>搜索
</button>
<button
onclick="frmSearach.reset()"
class="btn btn-close m-l-15"
type="submit"
>
清空
</button>
</div>
<div class="col-md-4"></div>
</div>
</div>
</form>
<div class="toolbar-btn-action">
<button
@click="openAddDiv()"
class="btn btn-primary m-l-15"
data-toggle="modal"
data-target="#gridSystemModal"
>
<i class="mdi mdi-plus"></i> 新增
</button>
</div>
</div>
<div class="card-body">
<h5></h5>
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr v-if="data && data.Columns && data.Columns.length > 0">
<th
class="mi-w-100"
v-for="column in data.Columns"
>
{{column.ColumnDescription}}
</th>
<th>操作</th>
</tr>
</thead>
<tbody v-if="data &&data.Data">
<tr
v-if="data.Columns && data.Columns.length > 0"
v-for="item in data.Data"
>
<td v-for="column in data.Columns">
{{ item[column.PropertyName] }}
</td>
<td class="table_opt">
<button
data-toggle="modal"
@click="openEditDiv(item)"
data-target="#gridSystemModal"
class="btn btn-link"
type="button"
>
<i class="mdi mdi-lead-pencil"></i> 修改
</button>
<button
data-toggle="modal"
@click="deleteAndConfirm(item)"
data-target="#divDelBox"
class="btn btn-link"
type="button"
>
<i class="mdi mdi-do-not-disturb"></i> 删除
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
@@page_control.html
<div
class="modal fade"
tabindex="-1"
role="dialog"
aria-labelledby="gridSystemModalLabel"
id="gridSystemModal"
style="display: none"
>
<div
class="modal-dialog"
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>
<h4
class="modal-title"
id="exampleModalLabel"
>
{{title}}
</h4>
</div>
<div class="modal-body">
<form id="frmEdit">
<input
type="hidden"
v-model="formData.Id"
name="Id"
/>
<div class="form-group">
<label
for="recipient-name"
class="control-label"
>名称:</label
>
<input
type="text"
v-model="formData.Name"
name="Name"
class="form-control"
id="recipient-name"
/>
</div>
<div class="form-group">
<label
for="message-text"
class="control-label"
>内容:</label
>
<textarea
class="form-control"
v-model="formData.Description"
name="Description"
id="message-text"
></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button
type="button"
id="btnCloseEdit"
class="btn btn-default"
data-dismiss="modal"
>
关闭
</button>
<button
type="button"
@click="addOrUpdate()"
class="btn btn-primary"
>
保存
</button>
</div>
</div>
</div>
</div>
</div>
<script>
var vueObj = new Vue({
el: '#apibox',
data: {
data: null,
error: null,
addTitle: '添加动态接口分类',
editTitle: '修改态接口分类',
title: '',
formData: {},
},
mounted() {
this.fetchData('')
},
methods: {
fetchData(append) {
var url = '/trs/page' + append
axios
.get(url, jwHeader)
.then(response => {
this.data = response.data
this.error = null
})
.catch(error => {
this.error = error.message
this.data = null
})
},
onSearch: function (page) {
var urlParameters =
'&' +
tools.objectToQueryString({
Name: txtSearch.value,
__pageNumber: page,
__pageSize: tools.getValue('selPageSize'),
})
this.fetchData(urlParameters)
},
deleteAndConfirm: function (item) {
if (item == null) {
if (localStorage.delId == 200100) {
tools.alert('初始化分类不能删除')
btnDelClose.click()
return
}
var url =
'/PrivateReZeroRoute/100003/DeleteDynamicInterfaceCategory?IsDeleted=true&Id=' +
localStorage.delId
axios
.get(url, jwHeader)
.then(response => {
this.data = response.data
this.error = null
this.onSearch()
btnDelClose.click()
})
.catch(error => {
this.error = error.message
this.data = null
})
} else {
localStorage.delId = item.Id
}
},
openEditDiv: function (item) {
var urlById =
'/PrivateReZeroRoute/100003/GetDynamicInterfaceCategoryById?id=' +
item.Id
if (item.Id) {
this.title = this.editTitle
axios
.get(urlById, jwHeader)
.then(response => {
this.formData = response.data
})
.catch(error => {
this.error = error.message
this.data = null
})
}
},
openAddDiv: function (item) {
this.title = this.addTitle
this.formData = {}
},
addOrUpdate: function () {
var th = this
var frmId = 'frmEdit'
var json = this.formData
var url = json.Id
? '/PrivateReZeroRoute/100003/UpdateDynamicInterfaceCategory'
: '/PrivateReZeroRoute/100003/AddDynamicInterfaceCategory'
this.addOrUpdateSubmit(url, json)
},
addOrUpdateSubmit: function (url, json) {
var th = this
axios
.post(url, json, jwHeader)
.then(response => {
this.error = null
this.onSearch()
if (response.data == true) {
frmEdit.reset()
btnCloseEdit.click()
} else {
tools.highlightErrorFields(response.data)
}
})
.catch(error => {
this.error = error.message
this.data = null
})
},
},
})
</script>

357
SuperAPI/wwwroot/rezero/default_ui/interface_categroy.html

@ -1,197 +1,194 @@
@@master_page.html @@master_page.html
<link href="css/page_table_list.css" rel="stylesheet" /> <link href="css/page_table_list.css" rel="stylesheet" />
<div id="apibox" class="card"> <div id="apibox" class="card">
<div class="search-bar"> <div class="search-bar">
<form id="frmSearach" action="lyear_forms_elements.html" method="post" onsubmit="return false;"> <form id="frmSearach" action="lyear_forms_elements.html" method="post" onsubmit="return false;">
<div class="form-group"> <div class="form-group">
<div class="row"> <div class="row">
<div class="col-md-1"><label class="form-control" t>名称:</label></div> <div class="col-md-1"><label class="form-control" t>名称:</label></div>
<div class="col-md-3"><input class="form-control" type="text" id="txtSearch" name="example-text-input" placeholder="分类名称"></div> <div class="col-md-3"><input class="form-control" type="text" id="txtSearch" name="example-text-input" placeholder="分类名称"></div>
<div class="col-md-3"> <div class="col-md-3">
<button @click="onSearch()" id="btnSearch" class="btn btn-secondary"><i class="mdi mdi-magnify"></i>搜索</button> <button @click="onSearch()" id="btnSearch" class="btn btn-secondary"><i class="mdi mdi-magnify"></i>搜索</button>
<button onclick="frmSearach.reset()" class="btn btn-close m-l-15" type="submit">清空</button> <button onclick="frmSearach.reset()" class="btn btn-close m-l-15" type="submit">清空</button>
</div> </div>
<div class="col-md-4"></div> <div class="col-md-4"></div>
</div>
</div>
</form>
<div class="toolbar-btn-action">
<button @click="openAddDiv()" class="btn btn-primary m-l-15 " data-toggle="modal" data-target="#gridSystemModal"><i class="mdi mdi-plus"></i> 新增</button>
</div> </div>
</div>
</form>
<div class="toolbar-btn-action">
<button @click="openAddDiv()" class="btn btn-primary m-l-15 " data-toggle="modal" data-target="#gridSystemModal"><i class="mdi mdi-plus"></i> 新增</button>
</div> </div>
<div class="card-body"> </div>
<div class="card-body">
<h5> </h5> <h5> </h5>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead>
<tr v-if="data && data.Columns && data.Columns.length > 0"> <tr v-if="data && data.Columns && data.Columns.length > 0">
<th class="mi-w-100" v-for="column in data.Columns">{{column.ColumnDescription}}</th> <th class="mi-w-100" v-for="column in data.Columns">{{column.ColumnDescription}}</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
</thead> </thead>
<tbody v-if="data &&data.Data"> <tbody v-if="data &&data.Data">
<tr v-if="data.Columns && data.Columns.length > 0" v-for="item in data.Data"> <tr v-if="data.Columns && data.Columns.length > 0" v-for="item in data.Data">
<td v-for="column in data.Columns"> <td v-for="column in data.Columns">
{{ item[column.PropertyName] }} {{ item[column.PropertyName] }}
</td> </td>
<td class="table_opt"> <td class="table_opt">
<button data-toggle="modal" @click="openEditDiv(item)" data-target="#gridSystemModal" class="btn btn-link" type="button"> <button data-toggle="modal" @click="openEditDiv(item)" data-target="#gridSystemModal" class="btn btn-link" type="button">
<i class="mdi mdi-lead-pencil"></i> 修改 <i class="mdi mdi-lead-pencil"></i> 修改
</button> </button>
<button data-toggle="modal" @click="deleteAndConfirm(item)" data-target="#divDelBox" class="btn btn-link" type="button"> <button data-toggle="modal" @click="deleteAndConfirm(item)" data-target="#divDelBox" class="btn btn-link" type="button">
<i class="mdi mdi-do-not-disturb"></i> 删除 <i class="mdi mdi-do-not-disturb"></i> 删除
</button> </button>
</td> </td>
</tr> </tr>
</tbody>
</table>
</div>
</tbody>
</table>
</div> </div>
@@page_control.html
<div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel" id="gridSystemModal" style="display: none;"> </div>
<div class="modal-dialog" role="document"> @@page_control.html
<div class="modal-content"> <div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel" id="gridSystemModal" style="display: none;">
<div class="modal-header"> <div class="modal-dialog" role="document">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <div class="modal-content">
<h4 class="modal-title" id="exampleModalLabel">{{title}}</h4> <div class="modal-header">
</div> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<div class="modal-body"> <h4 class="modal-title" id="exampleModalLabel">{{title}}</h4>
<form id="frmEdit"> </div>
<input type="hidden" v-model="formData.Id" name="Id" /> <div class="modal-body">
<div class="form-group"> <form id="frmEdit">
<label for="recipient-name" class="control-label">名称:</label> <input type="hidden" v-model="formData.Id" name="Id" />
<input type="text" v-model="formData.Name" name="Name" class="form-control" id="recipient-name"> <div class="form-group">
</div> <label for="recipient-name" class="control-label">名称:</label>
<div class="form-group"> <input type="text" v-model="formData.Name" name="Name" class="form-control" id="recipient-name">
<label for="message-text" class="control-label">内容:</label>
<textarea class="form-control" v-model="formData.Description" name="Description" id="message-text"></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" id="btnCloseEdit" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" @click="addOrUpdate()" class="btn btn-primary">保存</button>
</div>
</div> </div>
<div class="form-group">
<label for="message-text" class="control-label">内容:</label>
<textarea class="form-control" v-model="formData.Description" name="Description" id="message-text"></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" id="btnCloseEdit" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" @click="addOrUpdate()" class="btn btn-primary">保存</button>
</div> </div>
</div>
</div> </div>
</div>
</div> </div>
<script> <script>
var vueObj = new Vue({ var vueObj = new Vue({
el: '#apibox', el: '#apibox',
data: { data: {
data: null, data: null,
error: null, error: null,
addTitle: "添加动态接口分类", addTitle: "添加动态接口分类",
editTitle: "修改态接口分类", editTitle: "修改态接口分类",
title: "", title: "",
formData: { formData: {
} }
}, },
mounted() { mounted() {
this.fetchData(""); this.fetchData("");
}, },
methods: { methods: {
fetchData(append) { fetchData(append) {
var url = "/PrivateReZeroRoute/100003/GetDynamicInterfaceCategoryPageList?ParentId=200" + append; var url = "/PrivateReZeroRoute/100003/GetDynamicInterfaceCategoryPageList?ParentId=200" + append;
axios.get(url, jwHeader) axios.get(url, jwHeader)
.then(response => { .then(response => {
this.data = response.data; this.data = response.data;
this.error = null; this.error = null;
}) })
.catch(error => { .catch(error => {
this.error = error.message; this.error = error.message;
this.data = null; this.data = null;
}); });
}, },
onSearch: function (page) { onSearch: function (page) {
var urlParameters="&"+tools.objectToQueryString({ var urlParameters = "&" + tools.objectToQueryString({
Name: txtSearch.value, Name: txtSearch.value,
__pageNumber: page, __pageNumber: page,
__pageSize: tools.getValue("selPageSize"), __pageSize: tools.getValue("selPageSize"),
}); });
this.fetchData(urlParameters); this.fetchData(urlParameters);
}, },
deleteAndConfirm: function (item) { deleteAndConfirm: function (item) {
if (item == null) { if (item == null) {
if (localStorage.delId == 200100) { if (localStorage.delId == 200100) {
tools.alert("初始化分类不能删除"); tools.alert("初始化分类不能删除");
btnDelClose.click(); btnDelClose.click();
return; return;
} }
var url = "/PrivateReZeroRoute/100003/DeleteDynamicInterfaceCategory?IsDeleted=true&Id=" + localStorage.delId; var url = "/PrivateReZeroRoute/100003/DeleteDynamicInterfaceCategory?IsDeleted=true&Id=" + localStorage.delId;
axios.get(url, jwHeader) axios.get(url, jwHeader)
.then(response => { .then(response => {
this.data = response.data; this.data = response.data;
this.error = null; this.error = null;
this.onSearch(); this.onSearch();
btnDelClose.click(); btnDelClose.click();
}) })
.catch(error => { .catch(error => {
this.error = error.message; this.error = error.message;
this.data = null; this.data = null;
}); });
} else { } else {
localStorage.delId = item.Id; localStorage.delId = item.Id;
} }
}, },
openEditDiv: function (item) openEditDiv: function (item) {
{ var urlById = "/PrivateReZeroRoute/100003/GetDynamicInterfaceCategoryById?id=" + item.Id;
var urlById = "/PrivateReZeroRoute/100003/GetDynamicInterfaceCategoryById?id="+item.Id; if (item.Id) {
if (item.Id) { this.title = this.editTitle;
this.title = this.editTitle; axios.get(urlById, jwHeader)
axios.get(urlById, jwHeader) .then(response => {
.then(response => { this.formData = response.data;
this.formData= response.data; })
}) .catch(error => {
.catch(error => { this.error = error.message;
this.error = error.message; this.data = null;
this.data = null; });
});
}
},
openAddDiv: function (item)
{
this.title= this.addTitle;
this.formData = {};
},
addOrUpdate: function () {
var th = this;
var frmId = "frmEdit";
var json = this.formData;
var url = json.Id ?
"/PrivateReZeroRoute/100003/UpdateDynamicInterfaceCategory" :
"/PrivateReZeroRoute/100003/AddDynamicInterfaceCategory";
this.addOrUpdateSubmit(url, json);
},
addOrUpdateSubmit: function (url, json) {
var th = this;
axios.post(url, json, jwHeader)
.then(response => {
this.error = null;
this.onSearch();
if (response.data == true) {
frmEdit.reset();
btnCloseEdit.click();
}
else
{
tools.highlightErrorFields(response.data)
}
})
.catch(error => {
this.error = error.message;
this.data = null;
});
}
} }
});</script> },
openAddDiv: function (item) {
this.title = this.addTitle;
this.formData = {};
},
addOrUpdate: function () {
var th = this;
var frmId = "frmEdit";
var json = this.formData;
var url = json.Id ?
"/PrivateReZeroRoute/100003/UpdateDynamicInterfaceCategory" :
"/PrivateReZeroRoute/100003/AddDynamicInterfaceCategory";
this.addOrUpdateSubmit(url, json);
},
addOrUpdateSubmit: function (url, json) {
var th = this;
axios.post(url, json, jwHeader)
.then(response => {
this.error = null;
this.onSearch();
if (response.data == true) {
frmEdit.reset();
btnCloseEdit.click();
}
else {
tools.highlightErrorFields(response.data)
}
})
.catch(error => {
this.error = error.message;
this.data = null;
});
}
}
});</script>

3936
SuperAPI/wwwroot/rezero/default_ui/interface_manager.html

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save