microservice.html 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814
  1. <div class="plg-tab-container">
  2. <div id="grid" class="grid-container-full"></div>
  3. </div>
  4. <script>
  5. (function () {
  6. // cSpell:ignore layui api microservice multiselect newcolumn prologui fdata cindex layero
  7. // var BASE_URL = '/api/';
  8. var BASE_URL = '/api/service-microservice/';
  9. var RUN_STATUS = {
  10. '0': {
  11. text: '待发布',
  12. className: 'plg-edit'
  13. },
  14. '1': {
  15. text: '发布',
  16. className: 'plg-public'
  17. },
  18. '2': {
  19. text: '运行',
  20. className: 'plg-run'
  21. },
  22. '3': {
  23. text: '禁用',
  24. className: 'plg-stop'
  25. },
  26. '4': {
  27. text: '启动中...',
  28. className: 'plg-starting'
  29. },
  30. '5': {
  31. text: '失败',
  32. className: 'plg-start-fail'
  33. },
  34. '6': {
  35. text: '待上传',
  36. className: 'plg-wait-upload'
  37. }
  38. };
  39. // 【0】基础服务,【1】公共服务,【2】行业服务,【3】物流服务
  40. var SERVER_CATEGORY = {
  41. '0': '基础服务',
  42. '1': '公共服务',
  43. '2': '行业服务',
  44. '3': '物流服务'
  45. };
  46. var opts = {
  47. skin: "terrace",
  48. multiselect: false,
  49. columns: [{
  50. id: "id",
  51. name: "id",
  52. type: 'txt',
  53. width: "40",
  54. align: "center",
  55. hidden: true
  56. },
  57. {
  58. id: "name",
  59. name: "名称",
  60. type: 'txt',
  61. width: "120",
  62. align: "center"
  63. },
  64. {
  65. id: "instanceId",
  66. name: "实例",
  67. type: 'txt',
  68. width: "120",
  69. align: "center"
  70. },
  71. {
  72. id: "host",
  73. name: "地址",
  74. type: 'txt',
  75. width: "200",
  76. align: "center",
  77. hidden: true
  78. },
  79. {
  80. id: "port",
  81. name: "端口",
  82. type: 'txt',
  83. width: "80",
  84. align: "center",
  85. hidden: true
  86. },
  87. {
  88. id: "status",
  89. name: "状态",
  90. type: 'txt',
  91. width: "100",
  92. align: "center",
  93. render:function(v,record){
  94. return `<span class="${RUN_STATUS[v].className}"> ${RUN_STATUS[v].text} </span>`;
  95. }
  96. },
  97. {
  98. id: "currentVersion",
  99. name: "版本",
  100. type: 'txt',
  101. width: "80",
  102. align: "center"
  103. },
  104. {
  105. id: "category",
  106. name: "服务分类",
  107. type: 'txt',
  108. width: "120",
  109. align: "center",
  110. render:function(v,record){
  111. return SERVER_CATEGORY[v];
  112. }
  113. },
  114. {
  115. id: "creator",
  116. name: "服务创建者",
  117. type: 'txt',
  118. width: "100",
  119. align: "center",
  120. hidden: true
  121. },
  122. {
  123. id: "createTime",
  124. name: "服务创建时间",
  125. type: 'txt',
  126. width: "120",
  127. align: "center",
  128. hidden: true
  129. },
  130. {
  131. id: "lastModifier",
  132. name: "服务变更人",
  133. type: 'txt',
  134. width: "120",
  135. align: "center",
  136. hidden: true
  137. },
  138. {
  139. id: "lastModifiedTime",
  140. name: "服务变更时间",
  141. type: 'txt',
  142. width: "120",
  143. align: "center",
  144. hidden: true
  145. },
  146. {id:"op",name:"操作",type:'button',align:"center",width:"250",render: function(v,record){
  147. switch(record.status){
  148. case 0:
  149. return "发布^microservice_publish,<span class='layui-disabled'>启动</span>^,<span class='layui-disabled'>下载日志</span>^,<span class='layui-disabled'>查看日志</span>^";
  150. case 1:
  151. return "<span class='layui-disabled'>发布</span>^,启动^microservice_start,<span class='layui-disabled'>下载日志</span>^,<span class='layui-disabled'>查看日志</span>^";
  152. case 2:
  153. return "<span class='layui-disabled'>发布</span>^,停止^microservice_uninstall,下载日志^microservice_downloadlog,<span>查看日志</span>^microservice_readlog";
  154. case 3:
  155. return "<span class='layui-disabled'>发布</span>^,启动^microservice_start,下载日志^microservice_downloadlog,<span>查看日志</span>^microservice_readlog";
  156. case 4:
  157. return "<span class='layui-disabled'>发布</span>^,<span class='layui-disabled'>停止</span>^,下载日志^microservice_downloadlog,<span>查看日志</span>^microservice_readlog";
  158. case 5:
  159. return "<span class='layui-disabled'>发布</span>^,停止^microservice_uninstall,<span>下载日志</span>^microservice_downloadlog,<span>查看日志</span>^microservice_readlog";
  160. case 6:
  161. return "<span class='layui-disabled'>发布</span>^,<span class='layui-disabled'>启动</span>^,<span class='layui-disabled'>下载日志</span>^,<span class='layui-disabled'>查看日志</span>^";
  162. }
  163. }},
  164. {
  165. id: "description",
  166. name: "描述",
  167. type: 'txt',
  168. width: "200",
  169. align: "left"
  170. }
  171. ],
  172. toolbar: [
  173. {type:"block", blockOffset:0, offsetTop:10, list:[
  174. {
  175. type: "input",
  176. name: 'name',
  177. label: '服务名称:',
  178. placeholder:"请输入服务名称",
  179. width:300
  180. },
  181. {
  182. type: "newcolumn"
  183. },
  184. {
  185. type: "select",
  186. name: "category",
  187. label: "服务分类:",
  188. width:300,
  189. options: [
  190. {
  191. value: '',
  192. text: '请选择服务分类'
  193. },
  194. {
  195. value: '0',
  196. text: '基础服务'
  197. },
  198. {
  199. value: '1',
  200. text: '公共服务'
  201. },
  202. {
  203. value: '2',
  204. text: '行业服务'
  205. },
  206. {
  207. value: '3',
  208. text: '物流服务'
  209. }
  210. ]
  211. },
  212. {
  213. type: "newcolumn"
  214. },
  215. {
  216. type: "input",
  217. name: "creator",
  218. label: "服务创建者:",
  219. placeholder:"请输入服务创建者",
  220. width:300,
  221. hidden: true
  222. },
  223. {
  224. type: "newcolumn"
  225. },
  226. {
  227. type: "input",
  228. name: "status",
  229. label: "服务状态:",
  230. placeholder:"请输入服务状态",
  231. width:300,
  232. hidden: true,
  233. offsetLeft: 10
  234. },
  235. {
  236. type: "newcolumn"
  237. },
  238. {
  239. type: "button",
  240. name: "searchBtn",
  241. className: "",
  242. value: "查询"
  243. },
  244. {
  245. type: "newcolumn"
  246. },
  247. {
  248. type: "button",
  249. name: "all",
  250. className: "normal",
  251. value: "所有"
  252. },
  253. {
  254. type: "newcolumn"
  255. },
  256. {type:"button", name:"more2", value:"展开",className:"link toggle"},
  257. ]},
  258. {type:"block", blockOffset:0,offsetTop:10,list:[{
  259. type: "button",
  260. name: "deleteBtn",
  261. className: "danger plg-toolbar-right",
  262. value: "<i class='layui-icon layui-icon-delete'></i>删除"
  263. }, {
  264. type: "newcolumn"
  265. },
  266. {
  267. type: "button",
  268. name: "downFile",
  269. className: "normal plg-toolbar-right download",
  270. value: "<i class='layui-icon layui-icon-download-circle'></i>下载"
  271. }, {
  272. type: "newcolumn"
  273. },
  274. {
  275. type: "button",
  276. name: "upFile",
  277. offsetLeft: 10,
  278. className: "normal plg-toolbar-right upload",
  279. value: "<i class='layui-icon layui-icon-upload'></i>上传"
  280. },
  281. {
  282. type: "newcolumn"
  283. },
  284. {
  285. type: "button",
  286. name: "updateBtn",
  287. className: "normal plg-toolbar-right",
  288. value: "<i class='layui-icon layui-icon-edit'></i>编辑"
  289. },
  290. {
  291. type: "newcolumn"
  292. },
  293. {
  294. type: "button",
  295. name: "addBtn",
  296. className: "plg-toolbar-right",
  297. value: "<i class='layui-icon layui-icon-add-1'></i>添加"
  298. }
  299. ]}
  300. ],
  301. formData: [{
  302. type: "settings",
  303. inputWidth: 300,
  304. width: 400,
  305. labelWidth: 80,
  306. position: "label-left",
  307. labelAlign: "left"
  308. },
  309. {
  310. type: "input",
  311. name: 'name',
  312. label: '服务名',
  313. placeholder:"请输入服务名",
  314. editable: false,
  315. validate: 'NotEmpty',
  316. required: true
  317. },
  318. {
  319. type: "input",
  320. name: "instanceId",
  321. label: "实例",
  322. placeholder:"请输入实例名",
  323. validate: 'NotEmpty',
  324. required: true
  325. },
  326. {
  327. type: "input",
  328. name: "port",
  329. label: "端口",
  330. placeholder:"请输入端口号",
  331. validate: 'NotEmpty,ValidNumeric',
  332. required: true
  333. },
  334. {
  335. type: "select",
  336. name: "category",
  337. label: "服务分类",
  338. options: [{
  339. value: '0',
  340. text: '基础服务'
  341. },
  342. {
  343. value: '1',
  344. text: '公共服务'
  345. },
  346. {
  347. value: '2',
  348. text: '行业服务'
  349. },
  350. {
  351. value: '3',
  352. text: '物流服务'
  353. }
  354. ],
  355. validate: 'NotEmpty',
  356. required: true
  357. },
  358. {
  359. type: "input",
  360. name: "lastModifier",
  361. label: "变更人名称",
  362. placeholder:"请输入变更人名称"
  363. },
  364. {
  365. type: "input",
  366. name: "description",
  367. label: "服务变更描述",
  368. placeholder:"请输入服务变更描述",
  369. rows: 3,
  370. validate: 'NotEmpty',
  371. required: true
  372. }
  373. ],
  374. imagePath: "../../prologui/assets/PlgGrid/",
  375. url: BASE_URL + 'microservice', //数据接口
  376. type: "get", //数据提交方式,默认为get
  377. params: {}, //查询提交参数,分页参数默认为pageNum,pageSize
  378. page: true, //是否启用分页
  379. totalCount: "totalCount" //总记录数字段,默认totalCount
  380. };
  381. //分页参数 pageSize pageNum
  382. var grid = new PlgGrid(opts);
  383. grid.renderTo("grid");
  384. grid.loadData();
  385. grid.on("onRowDblClicked", function () {
  386. grid.showDialog(1, "编辑", 430, 350, {
  387. url: BASE_URL + 'microservice',
  388. type: "PUT"
  389. });
  390. });
  391. // 【操作--发布】
  392. window.microservice_publish = function (id, data) {
  393. // 发布之前要先判断用户是否已经上传了Jar包
  394. //console.log('发布之前要先判断用户是否已经上传了Jar包');
  395. //console.log(data);
  396. //console.log('发布之前要先判断用户是否已经上传了Jar包');
  397. // 前置条件,需要拿到版本号列表
  398. // String host,String microId,String version,String regServer,String packagePort)
  399. // 1. id 【microId】
  400. // 2. 版本号列表 【version】-- 传递给后台的属性名
  401. // 3. 服务地址 【host】
  402. // 4. 注册地址地址 【regServer】
  403. // 5. 端口号。默认值是添加的时候的端口号 【packagePort】
  404. // 此处是一个弹窗
  405. var type = 'auto';
  406. var microVersionList = data.microVersionList;
  407. var temStr = '';
  408. microVersionList.map(function(val){
  409. temStr +=`<option value="${val.version_}">${val.version_}</option>`
  410. })
  411. var text = `
  412. <form class="layui-form layui-form-pane1 plg-form-public">
  413. <div class="layui-form-item">
  414. <label class="layui-form-label plg-unset-box-sizing">服务地址</label>
  415. <div class="layui-input-block">
  416. <input type="text" name="host" lay-filter="host" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
  417. </div>
  418. </div>
  419. <div class="layui-form-item">
  420. <label class="layui-form-label plg-unset-box-sizing">启动后缀</label>
  421. <div class="layui-input-block">
  422. <input type="text" name="packagePort" lay-filter="packagePort" lay-verify="required" placeholder="例:--server.port=1234,注意空格" autocomplete="off" class="layui-input">
  423. </div>
  424. </div>
  425. <div class="layui-form-item">
  426. <label class="layui-form-label plg-unset-box-sizing">版本号</label>
  427. <div class="layui-input-block">
  428. <select name="version" lay-filter="version">
  429. <option value=""></option>
  430. ${temStr}
  431. </select>
  432. </div>
  433. </div>
  434. </form>
  435. `;
  436. var currentVersion, // 用户选择的版本号
  437. host, // 用户的服务器地址
  438. regServer, // 用户的注册服务器地址
  439. packagePort; // 用户的注册服务器端口号
  440. layer.open({
  441. type: 1,
  442. title: '发布【' + data.name + '】' //不显示标题栏
  443. ,offset: type //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset
  444. ,id: 'layerDemo'+ type //防止重复弹出
  445. ,content: '<div>'+ text +'</div>'
  446. ,btn: '确认'
  447. ,btnAlign: 'c' //按钮居中
  448. ,shade: 0 //不显示遮罩
  449. ,success: function(){
  450. layui.use('form', function(){
  451. var form = layui.form;
  452. form.render('select'); //刷新select选择框渲染
  453. form.on('select(version)', function(data){
  454. currentVersion = data.value;
  455. });
  456. });
  457. }
  458. ,yes: function(){
  459. var obj = {
  460. host: $("input[name='host']").val(),
  461. // regServer: $("input[name='regServer']").val(), 这里注册地址不要同意填在packagePort里面,要注意格式。
  462. variable: $("input[name='packagePort']").val(),
  463. microId: data.id,
  464. version: currentVersion
  465. }
  466. // //console.log('传递给后台的参数');
  467. // //console.log(obj);
  468. // //console.log('传递给后台的参数');
  469. var loading = Prolog.loading2();
  470. Prolog.ajax({
  471. url: BASE_URL + 'microservice/public',
  472. type: 'post',
  473. data: obj,
  474. dataType: 'json',
  475. success: function (data) {
  476. loading();
  477. if (data.success) {
  478. grid.reload();
  479. layer.closeAll();
  480. } else {
  481. PlgDialog.alert(data.message);
  482. }
  483. }
  484. });
  485. }
  486. });
  487. }
  488. // XXX
  489. // 【操作--启动】
  490. window.microservice_start = function (id, data) {
  491. // 此处是一个弹窗
  492. // 1. id 【microId】
  493. var type = 'auto';
  494. var microVersionList = data.microVersionList;
  495. var temStr = '';
  496. microVersionList.map(function(val){
  497. temStr +=`<option value="${val.version_}">${val.version_}</option>`
  498. })
  499. var text = `
  500. <form class="layui-form layui-form-pane1">
  501. <div class="layui-form-item">
  502. <label class="layui-form-label">选择框</label>
  503. <div class="layui-input-block">
  504. <select name="version" lay-filter="version">
  505. <option value=""></option>
  506. ${temStr}
  507. </select>
  508. </div>
  509. </div>
  510. </form>
  511. `;
  512. var currentVersion;
  513. layer.open({
  514. type: 1,
  515. title: '部署【' + data.name + '】' //不显示标题栏
  516. ,offset: type //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset
  517. ,id: 'layerDemo'+type //防止重复弹出
  518. ,content: '<div style="padding: 20px 100px;">'+ text +'</div>'
  519. ,btn: '确认'
  520. ,btnAlign: 'c' //按钮居中
  521. ,shade: 0 //不显示遮罩
  522. ,success: function(){
  523. layui.use('form', function(){
  524. var form = layui.form;
  525. form.render('select'); //刷新select选择框渲染
  526. form.on('select(version)', function(data){
  527. currentVersion = data.value;
  528. });
  529. });
  530. }
  531. ,yes: function(){
  532. // //console.log('currentVersion::' + currentVersion);
  533. // //console.log('点击确认了');
  534. var obj = {
  535. microId: data.id,
  536. version: currentVersion
  537. }
  538. var loading = Prolog.loading2();
  539. Prolog.ajax({
  540. url: BASE_URL + 'microservice/deploy',
  541. type: 'post',
  542. data: obj,
  543. dataType: 'json',
  544. success: function (data) {
  545. loading();
  546. if (data.success) {
  547. grid.reload();
  548. layer.closeAll();
  549. } else {
  550. PlgDialog.alert(data.message);
  551. }
  552. }
  553. });
  554. }
  555. });
  556. }
  557. // 【操作--卸载】
  558. window.microservice_uninstall = function (rid, data) {
  559. //console.log('卸载之前要先判断用户是否已经上传了Jar包');
  560. //console.log(data);
  561. //console.log('卸载之前要先判断用户是否已经上传了Jar包');
  562. // 【microId】
  563. var obj = {
  564. microId: data.id,
  565. version: data.currentVersion
  566. }
  567. var loading = Prolog.loading2();
  568. Prolog.ajax({
  569. url: BASE_URL + 'microservice/undeploy',
  570. type: 'post',
  571. data: obj,
  572. dataType: 'json',
  573. success: function (data) {
  574. loading();
  575. if (data.success) {
  576. grid.reload();
  577. } else {
  578. PlgDialog.alert(data.message);
  579. }
  580. }
  581. });
  582. }
  583. window.microservice_downloadlog = function(id, data){
  584. // //console.log('下载日志之前要先判断用户是否已经上传了Jar包');
  585. // //console.log(data);
  586. // //console.log('下载日志之前要先判断用户是否已经上传了Jar包');
  587. window.location.href = BASE_URL + 'microservice/downLoadLogInfo?microId=' + id;
  588. }
  589. window.microservice_readlog = function(id, data){
  590. // //console.log('下载日志之前要先判断用户是否已经上传了Jar包');
  591. // //console.log(data);
  592. // //console.log('下载日志之前要先判断用户是否已经上传了Jar包');
  593. var aId = 'plg' + id;
  594. var temTemplate = `<a id="${aId}" target="_blank"; style="display: none;">点击跳转</a>`;
  595. $('body').append(temTemplate);
  596. var openwin = function (url) {
  597. var obj = document.getElementById(aId);
  598. obj.href = url;
  599. obj.click();
  600. }
  601. openwin(BASE_URL + 'microservice/downLoadLogInfoOnline?microId=' + id);
  602. // window.location.href = BASE_URL + 'microservice/downLoadLogInfoOnline?microId=' + id;
  603. }
  604. grid.attachToolBarEvent("onButtonClick", function (name) {
  605. // 用户点击右上角的操作按钮组对应的事件
  606. var operationGroup = {
  607. _getIds: function () {
  608. var ids = grid.getCheckedIds() || grid.getSelectedRowData("id");
  609. if (!ids) {
  610. PlgDialog.msg("请选择行!");
  611. }
  612. return ids;
  613. },
  614. searchBtn: function () {
  615. var fdata = grid.getToolBarForm().getFormData();
  616. grid.setParams(fdata);
  617. grid.reload();
  618. },
  619. all: function () {
  620. grid.setParams({});
  621. grid.reload();
  622. },
  623. downFile: function () {
  624. var version = grid.getSelectedRowData('currentVersion');
  625. var ids = this._getIds();
  626. if (!ids) {
  627. return;
  628. }
  629. // 这里是文件下载并非跳转
  630. window.location.href = BASE_URL + 'microservice/downLoad?microId=' + ids+'&version=' + version;
  631. },
  632. upFile: function () {
  633. var ids = this._getIds();
  634. if (!ids) {
  635. return;
  636. }
  637. //console.log('>>>>>>');
  638. //console.log(Boolean($('.upload').attr('id')));
  639. //console.log('>>>>>>');
  640. if (!$('.upload').attr('id')) {
  641. $('.upload').attr({
  642. 'id': 'upload'
  643. });
  644. }
  645. var loading;
  646. layui.upload.render({
  647. elem: '#upload',
  648. url: BASE_URL + 'microservice/upload',
  649. accept: 'file', //普通文件
  650. data: {
  651. microId: ids
  652. },
  653. before: function () {
  654. loading = Prolog.loading2();
  655. },
  656. done: function (res) {
  657. console.log('done ....');
  658. loading();
  659. layer.msg(res.message);
  660. //console.log(res);
  661. grid.setParams({});
  662. grid.reload();
  663. },
  664. error: function (res) {
  665. console.log('error ....');
  666. loading();
  667. //console.log('请求异常');
  668. layer.msg(res.message);
  669. }
  670. });
  671. },
  672. addBtn: function () {
  673. grid.showDialog(0, "添加", 430, 450, {
  674. url: BASE_URL + 'microservice',
  675. type: "POST"
  676. });
  677. },
  678. updateBtn: function () {
  679. grid.showDialog(1, "编辑", 430, 450, {
  680. url: BASE_URL + 'microservice',
  681. type: "PUT"
  682. });
  683. },
  684. deleteBtn: function () {
  685. var ids = this._getIds();
  686. var currentStatus = grid.getSelectedRowData().status;
  687. console.log('currentStatus::' + currentStatus);
  688. var canDeleteStatus = [0, 3, 6];
  689. if(!(canDeleteStatus.indexOf(currentStatus) > -1)){
  690. PlgDialog.alert('当前状态不可删除!');
  691. return false;
  692. }
  693. if (!ids) {
  694. return;
  695. }
  696. var confirmText = `<div style="padding: 10px; line-height: 22px; font-size: 18px; color: red; font-weight: 500;">
  697. <span class="layui-icon layui-icon-tips"></span>是否确认删除么?<br>
  698. </div>`;
  699. var dialog = layer.open({
  700. type: 1
  701. ,title: false //不显示标题栏
  702. ,closeBtn: false
  703. ,area: '300px;'
  704. ,shade: 0.8
  705. ,id: 'LAY_layuipro' //设定一个id,防止重复弹出
  706. ,btn: ['确认', '取消']
  707. ,btnAlign: 'c'
  708. ,moveType: 1 //拖拽模式,0或者1
  709. ,content: confirmText
  710. ,yes: function() {
  711. //console.log('确认删除');
  712. layer.close(dialog); //关闭信息框
  713. var loading = Prolog.loading2();
  714. Prolog.ajax({
  715. url: BASE_URL + 'microservice' + '/' + ids,
  716. type: 'DELETE',
  717. dataType: 'json',
  718. success: function (data) {
  719. loading();
  720. if (data.success) {
  721. grid.reload();
  722. } else {
  723. PlgDialog.alert(data.message);
  724. }
  725. }
  726. });
  727. }
  728. ,btn2: function() {
  729. //console.log('取消删除');
  730. }
  731. });
  732. }
  733. };
  734. if (name && operationGroup.hasOwnProperty(name)) {
  735. operationGroup[name]();
  736. }
  737. });
  738. }());
  739. </script>