| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285 |
- <html>
- <head>
- <style>
- #space-content {
- width: 100%;
- box-sizing: border-box;
- }
-
- .gooFlow-content {
- height: calc(100% - 50px);
- overflow: hidden;
- background-color: #f1f1f1;
- }
-
- /* 中间行 */
- .gooFlow-aside-column{
- box-sizing: border-box;
- width: 115px;
- height: 100%;
- background-color: #fff;
- margin: 4px 5px 0 0;
- float: left;
- padding: 8px 0;
- text-align: center;
- overflow-y: auto;
- }
- .gooFlow-aside-column .el-button{
- width: calc(100% - 16px);
- }
- .have-midel-rigth-iframe{
- width: calc(100% - 120px);
- }
- .gooFlow-aside-bar{
- margin-top: 8px;
- }
- .gooFlow-aside-bar>a{
- display: block;
- line-height: 22px;
- padding: 6px;
- text-align: left;
- min-height: 36px;
- margin: 6px 7px;
- border: 1px solid #f2f2f2;
- border-radius: 3px;
- color: #666;
- }
- .gooFlow-aside-bar>a:hover,
- .GooFlow_tool_btndown{
- color: #fff !important;
- background-color: #409EFF;
- border-color: #409EFF !important;
- }
- .el-button--danger{
- color: #606266;
- background-color: #FFF;
- border-color: #DCDFE6;
- }
- </style>
- </head>
- <body>
- <div id="space-content">
- <!-- 头部 star -->
- <div class="space-content-title" style="background-color: #fff;">
- <span class="content-title-name">
- ${flowTitle}-{{selectedFlowTitle}}
- </span>
- <p class="content-title-btn">
- <el-button icon="el-icon-star-off" size="small" v-if="flowConditionAttr" @click='defaultFlow'>设置默认</el-button>
- <el-button icon="el-icon-setting" size="small" v-if="flowConditionAttr" @click='openAttr'>属性</el-button>
- <el-button icon="el-icon-delete" size="small" type="danger" v-if="flowConditionAttr" @click='deleteFlow'>删除</el-button>
- <el-button icon="el-icon-edit-outline" size="small" @click='openChangeFlow'>变动</el-button>
- <el-button icon="el-icon-circle-check" size="small" @click="saveGooFlow();">保存</el-button>
- <el-button type="primary" icon="el-icon-s-promotion" size="small" @click="releaseVersion();">发布</el-button>
- </p>
- </div>
- <!-- 头部 end-->
- <div class="gooFlow-content">
- <div class="gooFlow-aside-column">
- <el-button icon="el-icon-plus" size="small"
- onclick='@service{ page: `flow_add`, params:`{mkid: "${mkid}", flowId: "${flowId}", flowName: "${flowName}"}`, show:`true` }@'>增加</el-button>
- <div class="gooFlow-aside-bar">
- <c:forEach items="${childrenFlow}" var="item">
- <a href="javascript:void(0)" title="${item.mc}" class="${selectedFlow.lcid == item.lcid ? 'GooFlow_tool_btndown' : 'GooFlow_tool_btn'}"
- @click='openFlowEdit( $event, "${item.lcid}", "${item.mc}", ${item.sfmrlc == 11 ? false : true})'>
- <c:if test="${11 == item.sfmrlc}">
- <el-tag style="margin-right: 3px;" size="mini">默认</el-tag>
- </c:if>
- ${item.mc}
- </a>
- </c:forEach>
- </div>
-
- </div>
-
- <iframe class="have-midel-rigth-iframe" id="flowEdit" :src="winSrc" v-if="winSrc"></iframe>
-
- </div>
- </div>
- </body>
-
- <script type="text/javascript">
- space.vue = new Vue({
- el: space.appContent,
- data() {
- return {
- winSrc: undefined,
- editURl: '@service{ name: `basic_flow_edit`, page: `flow_edit`, params:`{mkid: "${mkid}", flowId: "${selectedFlow.lcid}"}` }@',
- selectedFlowTitle: '',
- flowConditionAttr: space.utils.parseBoolean('${flowConditionAttr}'),
- flowId: '${selectedFlow.lcid}'
- };
- },
- created: function() {
- this.winSrc = space.utils.appendRandom(this.editURl);
- this.selectedFlowTitle = "${selectedFlow.mc}";
- },
- methods: {
- /**
- * 打开画流程
- * @param {Object} e
- * @param {Object} flowId
- * @param {Object} title
- * @param {Object} flowConditionAttr
- */
- openFlowEdit: function(e, flowId, title, flowConditionAttr) {
- this.flowConditionAttr = flowConditionAttr;
- var url = '@service{ name: `basic_flow_edit`, page: `flow_edit`, params:`{mkid: "${mkid}"}`}@'
- this.winSrc = space.utils.appendRandom(url + "&flowId=" + flowId);
- this.selectedFlowTitle = title;
- this.flowId = flowId
-
- var _this = $(e.target);
-
- if (e.target.tagName.toLowerCase() == 'span') {
- _this = $(e.target).parent();
- }
-
- $(_this).siblings().removeClass('GooFlow_tool_btndown');
- $(_this).addClass('GooFlow_tool_btndown');
-
- },
- /**
- * 保存流程
- */
- saveGooFlow: function() {
- $("#flowEdit")[0].contentWindow.space.vue.saveGooFlow();
- },
- /**
- * 发布流程版本
- */
- releaseVersion: function() {
- $("#flowEdit")[0].contentWindow.space.vue.releaseVersion();
- },
- /**
- * 打开属性
- */
- openAttr: function() {
- var url = '@service{ name: `basic_flow_condition_getAttrList`, page: `flow_condition`, params:`{mkid: "${mkid}"}` }@';
- space.plugins.layer.openPage({ open:true, title:"流程条件", width:"800", height:"80%", url: url + "&flowId=" + this.flowId });
- },
- /**
- * 打开变动流程
- */
- openChangeFlow: function() {
- var url = '@service{ name: `basic_flow_info`, page: `flow_change`, params:`{mkid: "${mkid}"}` }@';
- space.plugins.layer.openPage({ open:true, title:"流程变动", width:"800", height:"80%", url: url + "&flowId=" + this.flowId });
- },
- /**
- * 设置默认流程
- */
- defaultFlow: function() {
- var msg = "是否设置《" + this.selectedFlowTitle + "》为默认流程?"
-
- var _this = this;
- var index = top.layer.confirm(msg, {
- anim: 5,
- isOutAnim: false,
- title: '提示',
- btn: ['确定', '取消'] //按钮
- }, function () {
- var url = space.utils.appendRandom('@service{ name: `basic_default_flow` }@' + "&flowId=" + _this.flowId);
- space.utils.ajax({
- url: url,
- dataType: 'json',
- callback: function(data) {
- if (data.code == "success") {
- space.topWin.spaceIndex.info.success("设置默认流程成功");
- location.reload();
- }
- else {
- space.topWin.spaceIndex.info.error("系统繁忙,请稍后再试");
- }
- }
- });
-
- top.layer.close(index);
- }, function () {
-
- });
-
- },
- /**
- * 删除流程
- */
- deleteFlow: function() {
- var msg = "是否确认删除《" + this.selectedFlowTitle + "》流程?"
-
- var _this = this;
- var index = top.layer.confirm(msg, {
- anim: 5,
- isOutAnim: false,
- title: '提示',
- btn: ['确定', '取消'] //按钮
- }, function () {
- var url = space.utils.appendRandom('@service{ name: `basic_delete_flow` }@' + "&flowId=" + _this.flowId);
- space.utils.ajax({
- url: url,
- dataType: 'json',
- callback: function(data) {
- if (data.code == "success") {
- space.topWin.spaceIndex.info.success("删除流程成功");
- location.reload();
- }
- else {
- space.topWin.spaceIndex.info.error("系统繁忙,请稍后再试");
- }
- }
- });
-
- top.layer.close(index);
- }, function () {
-
- });
- }
-
- }
- })
-
- function saveChildrenFlow(name) {
- var url = '@service{ name: `basic_children_flow_submit`, params:`{mkid: "${mkid}", flowId: "${flowId}"}` }@';
- var _this = this;
-
- $.ajax({
- type: "post",
- url: url,
- data: {
- "name": name
- },
- async: false,
- cache: false,
- dataType: 'json',
- success: function (data) {
-
- }
- });
-
- }
- </script>
- </html>
|