diff --git a/modeler/src/style.less b/modeler/src/style.less index 2426ca6..80c05d2 100644 --- a/modeler/src/style.less +++ b/modeler/src/style.less @@ -1562,6 +1562,89 @@ .ant-btn-default{ &.ant-btn-dangerous{ + background: transparent!important; + } +} + + +.ant-empty-small { + margin-block: 8px; + color: rgb(207 207 207 / 66%); +} +.ant-btn >span { + display: inline-block; + float: inherit; +} + +.ant-btn, +.ant-input { + border-radius: 2px; +} + +.ant-btn-primary { + color: #eee; + //border-color: #1b5b7d; + //background: linear-gradient(90deg, #1e4c65 0%, #0b3a62 100%); + border-color: #29759c; + background: linear-gradient(0deg, #0f374c 0, #154c69 100%); + &.selected, + &:not(:disabled):hover, + &:hover, + &:active { + border-color: #166094; + background: linear-gradient(90deg, #3687bc 0%, #074375 100%); + color: #fff; + } +} + +.ant-btn-default { + color: #eee; + //border-color: #144087; + //background: linear-gradient(90deg, #0f4a7c 0%, #0a365b 100%); + border-color: #1c468b; + background: linear-gradient(0deg, #284e91 0, #2c5dad 100%); + background: linear-gradient(0deg, #14223b 0, #1c468b 100%); + &.selected, + &:not(:disabled):hover, + &:hover, + &:active { + color: #fff; + border-color: #166094; + background: linear-gradient(90deg, #3687bc 0%, #074375 100%); + } + &:disabled, + &.disabled{ + color: #a9a3a3; + &:hover{ + color:#eee; + } + } +} + +.btn-field { + min-width: 120px; + background: #5796b2; + text-align: center; + cursor: pointer; + border-radius: 2px; + color: #fff; + padding: 5px; + border: 1px solid #5796b2; + + .anticon { + margin-left: 10px; + } + + &:hover, + &.selected { + background: #19b0ff; + border-color: #19b0ff; + } + + &.gold { background: transparent; + border-color: #b5b39d; + color: #b5b39d; + cursor: pointer; } } \ No newline at end of file diff --git a/modeler/src/views/decision/algorithm/api.ts b/modeler/src/views/decision/algorithm/api.ts index 1f00f83..7fe7244 100644 --- a/modeler/src/views/decision/algorithm/api.ts +++ b/modeler/src/views/decision/algorithm/api.ts @@ -23,6 +23,10 @@ export const createAlgorithm = (algorithm: Algorithm): Promise => return req.postJson('/algo/algorithm', algorithm); }; +export const runAlgorithm = (algorithm: Algorithm): Promise => { + return req.postJson('/algo/algorithm/run', algorithm); +}; + export const updateAlgorithm = (algorithm: Algorithm): Promise => { return req.putJson('/algo/algorithm', algorithm); }; diff --git a/modeler/src/views/decision/algorithm/management.vue b/modeler/src/views/decision/algorithm/management.vue index da0ae58..38a9c48 100644 --- a/modeler/src/views/decision/algorithm/management.vue +++ b/modeler/src/views/decision/algorithm/management.vue @@ -131,7 +131,14 @@ :wrapper-col="{offset: 6}" > - 保存规则 + 保存规则 + + 运行规则 + { } }; +const handleRun = ()=> { + if (formRef.value) { + formRef.value.validate().then(() => { + runAlgorithm(selectedAlgorithm.value).then(r => { + if (r.code === 200) { + message.info(r.msg ?? '运行成功'); + } else { + message.error(r.msg ?? '运行失败'); + } + }); + }); + } +} + const handleChange = (page: number, pageSize: number) => { query.value.pageNum = page; query.value.pageSize = pageSize;