1000810280_edit.jsp 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <html>
  2. <head>
  3. <style>
  4. #space-content {
  5. width: 100%;
  6. box-sizing: border-box;
  7. }
  8. .gooFlow-content {
  9. height: calc(100% - 50px);
  10. overflow: hidden;
  11. background-color: #f1f1f1;
  12. }
  13. /* 中间行 */
  14. .gooFlow-aside-column{
  15. box-sizing: border-box;
  16. width: 115px;
  17. height: 100%;
  18. background-color: #fff;
  19. margin: 4px 5px 0 0;
  20. float: left;
  21. padding: 8px 0;
  22. text-align: center;
  23. overflow-y: auto;
  24. }
  25. .gooFlow-aside-column .el-button{
  26. width: calc(100% - 16px);
  27. }
  28. .have-midel-rigth-iframe{
  29. width: calc(100% - 120px);
  30. }
  31. .gooFlow-aside-bar{
  32. margin-top: 8px;
  33. }
  34. .gooFlow-aside-bar>a{
  35. display: block;
  36. line-height: 22px;
  37. padding: 6px;
  38. text-align: left;
  39. min-height: 36px;
  40. margin: 6px 7px;
  41. border: 1px solid #f2f2f2;
  42. border-radius: 3px;
  43. color: #666;
  44. }
  45. .gooFlow-aside-bar>a:hover,
  46. .GooFlow_tool_btndown{
  47. color: #fff !important;
  48. background-color: #409EFF;
  49. border-color: #409EFF !important;
  50. }
  51. .el-button--danger{
  52. color: #606266;
  53. background-color: #FFF;
  54. border-color: #DCDFE6;
  55. }
  56. </style>
  57. </head>
  58. <body>
  59. <div id="space-content">
  60. <!-- 头部 star -->
  61. <div class="space-content-title" style="background-color: #fff;">
  62. <span class="content-title-name">
  63. ${flowTitle}-{{selectedFlowTitle}}
  64. </span>
  65. <p class="content-title-btn">
  66. <el-button icon="el-icon-star-off" size="small" v-if="flowConditionAttr" @click='defaultFlow'>设置默认</el-button>
  67. <el-button icon="el-icon-setting" size="small" v-if="flowConditionAttr" @click='openAttr'>属性</el-button>
  68. <el-button icon="el-icon-delete" size="small" type="danger" v-if="flowConditionAttr" @click='deleteFlow'>删除</el-button>
  69. <el-button icon="el-icon-edit-outline" size="small" @click='openChangeFlow'>变动</el-button>
  70. <el-button icon="el-icon-circle-check" size="small" @click="saveGooFlow();">保存</el-button>
  71. <el-button type="primary" icon="el-icon-s-promotion" size="small" @click="releaseVersion();">发布</el-button>
  72. </p>
  73. </div>
  74. <!-- 头部 end-->
  75. <div class="gooFlow-content">
  76. <div class="gooFlow-aside-column">
  77. <el-button icon="el-icon-plus" size="small"
  78. onclick='@service{ page: `flow_add`, params:`{mkid: "${mkid}", flowId: "${flowId}", flowName: "${flowName}"}`, show:`true` }@'>增加</el-button>
  79. <div class="gooFlow-aside-bar">
  80. <c:forEach items="${childrenFlow}" var="item">
  81. <a href="javascript:void(0)" title="${item.mc}" class="${selectedFlow.lcid == item.lcid ? 'GooFlow_tool_btndown' : 'GooFlow_tool_btn'}"
  82. @click='openFlowEdit( $event, "${item.lcid}", "${item.mc}", ${item.sfmrlc == 11 ? false : true})'>
  83. <c:if test="${11 == item.sfmrlc}">
  84. <el-tag style="margin-right: 3px;" size="mini">默认</el-tag>
  85. </c:if>
  86. ${item.mc}
  87. </a>
  88. </c:forEach>
  89. </div>
  90. </div>
  91. <iframe class="have-midel-rigth-iframe" id="flowEdit" :src="winSrc" v-if="winSrc"></iframe>
  92. </div>
  93. </div>
  94. </body>
  95. <script type="text/javascript">
  96. space.vue = new Vue({
  97. el: space.appContent,
  98. data() {
  99. return {
  100. winSrc: undefined,
  101. editURl: '@service{ name: `basic_flow_edit`, page: `flow_edit`, params:`{mkid: "${mkid}", flowId: "${selectedFlow.lcid}"}` }@',
  102. selectedFlowTitle: '',
  103. flowConditionAttr: space.utils.parseBoolean('${flowConditionAttr}'),
  104. flowId: '${selectedFlow.lcid}'
  105. };
  106. },
  107. created: function() {
  108. this.winSrc = space.utils.appendRandom(this.editURl);
  109. this.selectedFlowTitle = "${selectedFlow.mc}";
  110. },
  111. methods: {
  112. /**
  113. * 打开画流程
  114. * @param {Object} e
  115. * @param {Object} flowId
  116. * @param {Object} title
  117. * @param {Object} flowConditionAttr
  118. */
  119. openFlowEdit: function(e, flowId, title, flowConditionAttr) {
  120. this.flowConditionAttr = flowConditionAttr;
  121. var url = '@service{ name: `basic_flow_edit`, page: `flow_edit`, params:`{mkid: "${mkid}"}`}@'
  122. this.winSrc = space.utils.appendRandom(url + "&flowId=" + flowId);
  123. this.selectedFlowTitle = title;
  124. this.flowId = flowId
  125. var _this = $(e.target);
  126. if (e.target.tagName.toLowerCase() == 'span') {
  127. _this = $(e.target).parent();
  128. }
  129. $(_this).siblings().removeClass('GooFlow_tool_btndown');
  130. $(_this).addClass('GooFlow_tool_btndown');
  131. },
  132. /**
  133. * 保存流程
  134. */
  135. saveGooFlow: function() {
  136. $("#flowEdit")[0].contentWindow.space.vue.saveGooFlow();
  137. },
  138. /**
  139. * 发布流程版本
  140. */
  141. releaseVersion: function() {
  142. $("#flowEdit")[0].contentWindow.space.vue.releaseVersion();
  143. },
  144. /**
  145. * 打开属性
  146. */
  147. openAttr: function() {
  148. var url = '@service{ name: `basic_flow_condition_getAttrList`, page: `flow_condition`, params:`{mkid: "${mkid}"}` }@';
  149. space.plugins.layer.openPage({ open:true, title:"流程条件", width:"800", height:"80%", url: url + "&flowId=" + this.flowId });
  150. },
  151. /**
  152. * 打开变动流程
  153. */
  154. openChangeFlow: function() {
  155. var url = '@service{ name: `basic_flow_info`, page: `flow_change`, params:`{mkid: "${mkid}"}` }@';
  156. space.plugins.layer.openPage({ open:true, title:"流程变动", width:"800", height:"80%", url: url + "&flowId=" + this.flowId });
  157. },
  158. /**
  159. * 设置默认流程
  160. */
  161. defaultFlow: function() {
  162. var msg = "是否设置《" + this.selectedFlowTitle + "》为默认流程?"
  163. var _this = this;
  164. var index = top.layer.confirm(msg, {
  165. anim: 5,
  166. isOutAnim: false,
  167. title: '提示',
  168. btn: ['确定', '取消'] //按钮
  169. }, function () {
  170. var url = space.utils.appendRandom('@service{ name: `basic_default_flow` }@' + "&flowId=" + _this.flowId);
  171. space.utils.ajax({
  172. url: url,
  173. dataType: 'json',
  174. callback: function(data) {
  175. if (data.code == "success") {
  176. space.topWin.spaceIndex.info.success("设置默认流程成功");
  177. location.reload();
  178. }
  179. else {
  180. space.topWin.spaceIndex.info.error("系统繁忙,请稍后再试");
  181. }
  182. }
  183. });
  184. top.layer.close(index);
  185. }, function () {
  186. });
  187. },
  188. /**
  189. * 删除流程
  190. */
  191. deleteFlow: function() {
  192. var msg = "是否确认删除《" + this.selectedFlowTitle + "》流程?"
  193. var _this = this;
  194. var index = top.layer.confirm(msg, {
  195. anim: 5,
  196. isOutAnim: false,
  197. title: '提示',
  198. btn: ['确定', '取消'] //按钮
  199. }, function () {
  200. var url = space.utils.appendRandom('@service{ name: `basic_delete_flow` }@' + "&flowId=" + _this.flowId);
  201. space.utils.ajax({
  202. url: url,
  203. dataType: 'json',
  204. callback: function(data) {
  205. if (data.code == "success") {
  206. space.topWin.spaceIndex.info.success("删除流程成功");
  207. location.reload();
  208. }
  209. else {
  210. space.topWin.spaceIndex.info.error("系统繁忙,请稍后再试");
  211. }
  212. }
  213. });
  214. top.layer.close(index);
  215. }, function () {
  216. });
  217. }
  218. }
  219. })
  220. function saveChildrenFlow(name) {
  221. var url = '@service{ name: `basic_children_flow_submit`, params:`{mkid: "${mkid}", flowId: "${flowId}"}` }@';
  222. var _this = this;
  223. $.ajax({
  224. type: "post",
  225. url: url,
  226. data: {
  227. "name": name
  228. },
  229. async: false,
  230. cache: false,
  231. dataType: 'json',
  232. success: function (data) {
  233. }
  234. });
  235. }
  236. </script>
  237. </html>