| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- @using VberAdmin.Web.Models.Table
- @using Microsoft.AspNetCore.Mvc.Rendering
- @using VberAdmin.Web.Models.Modals
- @using VberAdmin.Web.Models.Search
- @using VberZero
- @{
- //ViewBag.Title = L("StateTitle");
- ViewBag.Title = "工作流程信息维护";
- string activeMenu = PermissionNames.VberSystemMgWorkflowMg; //The menu item will be active for this page.
- ViewBag.ActiveMenu = activeMenu;
- var table = new VmTable(VzConsts.ApiAppUrl + "Workflow/GetAll", activeMenu, new VmSearch(new List<VmSearchItem>()
- {
- //new SearchItem("dd", L("stateName")).SetSearchIcon("q_u","ddd"),
- //new SearchItem("ff", L("stateName")).SetSelectItem("<option value=\"\">000</option><option value=\"S10001\">111</option><option value=\"S10002\">222</option>").SetSearchIcon("q_u","fff"),
- //new SearchItem("name1", L("stateName"),FieldType.D),
- new VmSearchItem("id", "流程编号"),
- new VmSearchItem("title", "流程名称")
- })).AddItems(new List<VmTableItem>()
- {
- new("id", "流程编号"),
- new("title", "流程名称"),
- new VmTableItem("", "操作").WithFormatter("ActionsFormatter"),
-
- });
- //var modalBody = new VmModalBody()
- // .AddInputs(new List<VmInputBase>()
- // {
- // new VmInputHidden("id"),
- // })
- // .AddInput(new VmInput("displayValue", L("displayValue")))
- // .AddGroup(new List<VmInputBase>()
- // {
- // new VmInput("name", L("stateName")).WithDisabled(),
- // new VmInput("codeKey", L("codeKey")).WithDisabled(),
- // new VmInput("codeValue", L("codeValue")).WithDisabled(),
-
- // }, 3);
- //var modal = new VmModal().WithHeaderAndFooter(L("state"), "").WithBody(modalBody);
- var modal = new VmModal().WithHeaderAndFooter("流程测试").WithBody("<div id=\"test-box\"></div>");
- }
- @await Html.PartialAsync("_Table", table)
- @await Html.PartialAsync("_Modal", modal)
- @section scripts
- {
- @*<script src="~/Content/Plugins/PrintPreView/print-preview.js"></script>*@
- <script src="~/js/workflowHelper.js" asp-append-version="false"></script>
- <script type="text/javascript">
- let $table = $('#table');
- $(function() {
- var funs = window.LoadTable();
- funs["btnCreate"] = function() {
- window.open("/wf/design");
- };
- funs["btnUpdate"] = function() {
- let row = $table.VbTable("getSelection");
- if (row) {
- window.open(`/wf/design/${row.id}?v=${row.version}`);
- }
- };
- });
- //$('#print').printPreview({
- // printBody: ".table-box",
- // cssUrl: '../../Content/Plugins/bootstrap-3.3.7/css/bootstrap.css,../../Content/Css/Site.css'
- //});
- function TestStart(id,version) {
- $.vbAjax4({
- url: abp.appUrl + "Workflow/GetByVersion",
- data: { id: id, version: version },
- success: (res) => {
- OpenModal({
- showBefore:() => {
- $('#test-box').VbWorkflow("useDyForm",res.inputs);
- },
- save:() => {
- const inputs =$('#test-box').VbWorkflow("getDyFormData",res.inputs);
- console.log("===========>",inputs);
- $.vbAjax1({
- url: abp.appUrl + "Workflow/Start",
- data: { id: id, version: version, inputs: inputs }
- });
- }
- });
- }
- });
- }
- </script>
- <script id="formatter" type="text/javascript">
- function ActionsFormatter(v, r) {
- let str = `<button type="button" class="btn btn-sm btn-primary" onclick="TestStart('${r.id}','${r.version}')">测试</button>`;
- return str;
- }
- </script>
- }
|