95 lines
4.4 KiB
Plaintext
95 lines
4.4 KiB
Plaintext
@{
|
|
ViewData["Title"] = "数据库升级";
|
|
}
|
|
|
|
<div class="card" id="dbUpdateDiv">
|
|
<div class="card-header">
|
|
<h4 class="card-title">数据库升级</h4>
|
|
<button class="btn btn-primary ml-2" v-on:click="executeUpdate()">批量执行</button>
|
|
<button class="btn btn-primary ml-2" v-on:click="executeUpdate('isUpdateDone')">批量更新为已执行</button>
|
|
<button class="btn btn-primary ml-2" v-on:click="viewUpdateContent()">查看升级内容</button>
|
|
<button class="btn btn-primary ml-2" v-on:click="getUpdateList">刷新升级列表</button>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="border">
|
|
<div class="p-3 form-inline mb-3 border-bottom">
|
|
<label class="mr-1">版本:</label>
|
|
<select class="form-control" style="width:100px;" v-model="filter.version">
|
|
<option value="">---</option>
|
|
<option v-for="item in filter.versionItems">{{item}}</option>
|
|
</select>
|
|
<label class="ml-3 mr-1">数据库:</label>
|
|
<select class="form-control" style="width:100px;" v-model="filter.dbschema">
|
|
<option value="">---</option>
|
|
<option value="prod">prod</option>
|
|
<option value="client">client</option>
|
|
<option value="admin">admin</option>
|
|
</select>
|
|
<label class="ml-3"><input type="checkbox" v-model="filter.upstate" class="mr-1" />只显示未执行</label>
|
|
</div>
|
|
<table class="table table-hover">
|
|
<colgroup>
|
|
<col span="1" width="30" />
|
|
<col span="1" width="90" />
|
|
<col span="1" width="90" />
|
|
<col span="1" width="90" />
|
|
<col span="1" width="120" />
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<th><label><input type="checkbox" v-model="checkAll" v-on:change="changeAllChecked" /></label></th>
|
|
<th>版本</th>
|
|
<th>数据库</th>
|
|
<th>内容</th>
|
|
<th>操作</th>
|
|
<th>执行结果</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr v-for="item in updateList" v-bind:style="isShowItem(item)">
|
|
<td><input type="checkbox" v-model="item.checked" v-on:change="changeItemChecked(item)" /></td>
|
|
<td>{{item.Version}}</td>
|
|
<td>{{item.DbSchema}}</td>
|
|
<td><a href="javascript:void(0)" v-on:click="viewUpdateContent(item.UpKey)">查看</a></td>
|
|
<td><a href="javascript:void(0)" v-on:click="executeUpdate(item)">{{item.UpState<1?"执行更新":"重新执行"}}</a></td>
|
|
<td :class="itemStatusClass(item)">{{item.UpResult}}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal" id="dbContentModal" aria-hidden="true">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<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>
|
|
<div class="modal-body">
|
|
<textarea class="codesql public_text" id="dbContentText"></textarea>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@section heads{
|
|
<link href="~/Statics/libs/codemirror/lib/codemirror.css" rel="stylesheet" />
|
|
}
|
|
@section scripts{
|
|
<script src="~/Statics/libs/codemirror/lib/codemirror.js"></script>
|
|
<script src="~/Statics/libs/codemirror/addon/matchbrackets.js"></script>
|
|
<script src="~/Statics/libs/codemirror/addon/comment/continuecomment.js"></script>
|
|
<script src="~/Statics/libs/codemirror/addon/comment/comment.js"></script>
|
|
<script src="~/Statics/libs/codemirror/mode/sql.js"></script>
|
|
<script src="~/Scripts/admin/dbupdate.js"></script>
|
|
}
|