diff --git a/cutejava-front/src/views/components/devops/pipeline/PipeTask.vue b/cutejava-front/src/views/components/devops/pipeline/PipeTask.vue
index 6ffa8f12..61c1bff0 100644
--- a/cutejava-front/src/views/components/devops/pipeline/PipeTask.vue
+++ b/cutejava-front/src/views/components/devops/pipeline/PipeTask.vue
@@ -44,8 +44,7 @@
:key="index"
v-prevent-re-click
type="text"
- :style="`width: ${item.text && item.text.length >= 4 ? '74px': '26px'
- };color: ${item.color ? item.color : statusColorMap.running};display: ${item.condition ===
+ :style="`color: ${item.color ? item.color : statusColorMap.running};display: ${item.condition ===
'all' ?
'inline-block':
(item.condition === status ? 'inline-block': 'none')};overflow: hidden;text-overflow: ellipsis;`"
@@ -101,14 +100,18 @@ export default {
*/
startTimeMillis: {
type: Number,
- required: true
+ required: false,
+ default: function() {
+ return new Date().getTime()
+ }
},
/**
* 持续时间。单位:秒
*/
durationMillis: {
type: Number,
- required: true
+ required: false,
+ default: 0
},
/**
* 状态
@@ -200,8 +203,8 @@ export default {
taskWindowStyle() {
const colorHex = this.getColorHexByStatus(this.status)
return {
- width: '240px',
- maxWidth: '240px',
+ width: '260px',
+ maxWidth: '260px',
height: '100px',
maxHeight: '100px',
border: `1px solid ${colorHex}`,
diff --git a/cutejava-front/src/views/components/devops/pipeline/PipeTaskBuilder.vue b/cutejava-front/src/views/components/devops/pipeline/PipeTaskBuilder.vue
index 6e384c57..e45e95df 100644
--- a/cutejava-front/src/views/components/devops/pipeline/PipeTaskBuilder.vue
+++ b/cutejava-front/src/views/components/devops/pipeline/PipeTaskBuilder.vue
@@ -54,35 +54,14 @@
/>
-
- 节点选项(预览)
-
-
-
-
-
-
-
-
-
-
节点参数设置
-
+
-
+
@@ -109,7 +88,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -126,7 +120,7 @@
-
+
@@ -134,11 +128,11 @@
-
+
-
+
-
+
@@ -166,30 +160,33 @@
-
+
-
+
-
-
-
+ placeholder="请输入参数选项"
+ @input="(value) => onParameterDataSourceInput(nodeParamScope, index, value)"
+ @clear="onParameterDataSourceClear(nodeParamScope, index)"
+ />
+ 添加可选项
+
@@ -198,6 +195,37 @@
+
+
+ 节点选项(预览)
+
+
+
+
+
+
+
+
+
+ 节点配置(预览)
+
+
+
+
+
@@ -211,19 +239,19 @@ export default {
components: { CutePage, PipeTask },
data() {
return {
- name: '环境准备',
- code: 'release',
+ name: '',
+ code: '',
click: false,
retry: false,
detailType: null,
buttonList: [
- {
- condition: 'running',
- method: 'get',
- requestUrl: `api/devops/ci/doCheck?id=#pipelineInstanceNodeId`,
- text: '确认合并',
- type: 'execute'
- }
+ // {
+ // condition: 'running',
+ // method: 'get',
+ // requestUrl: `api/devops/ci/doCheck?id=#pipelineInstanceNodeId`,
+ // text: '确认合并',
+ // type: 'execute'
+ // }
],
hasButtonList: false,
parameters: {
@@ -237,22 +265,235 @@ export default {
}
},
parameterList: [
- {
- name: 'Jdk版本',
- code: 'jdkVersion',
- dataSource: [
- { label: 'jdk8', value: 'jdk8' },
- { label: 'jdk11', value: 'jdk11' },
- { label: 'jdk21', value: 'jdk21' }
- ]
- }
- ]
+ // {
+ // name: 'Jdk版本',
+ // code: 'jdkVersion',
+ // dataSource: [
+ // { label: 'jdk8', value: 'jdk8' },
+ // { label: 'jdk11', value: 'jdk11' },
+ // { label: 'jdk21', value: 'jdk21' }
+ // ]
+ // }
+ ],
+ taskConfig: ''
}
},
- computed: {},
- watch: {},
- mounted() {},
- methods: {}
+ computed: {
+ },
+ watch: {
+ name: {
+ handler(newVal) {
+ const tempParameters = {}
+ for (const key in this.parameters) {
+ tempParameters[key] = ''
+ }
+ const tempParameterMap = {}
+ for (const key in newVal) {
+ tempParameterMap[key] = newVal[key].dataSource
+ }
+ const config = {
+ name: newVal,
+ code: this.code,
+ click: this.click,
+ retry: this.retry,
+ detailType: this.detailType,
+ buttonList: this.buttonList,
+ parameters: tempParameters
+ }
+ this.taskConfig = JSON.stringify(config, null, 2)
+ },
+ immediate: true
+ },
+ code: {
+ handler(newVal) {
+ const tempParameters = {}
+ for (const key in this.parameters) {
+ tempParameters[key] = ''
+ }
+ const tempParameterMap = {}
+ for (const key in newVal) {
+ tempParameterMap[key] = newVal[key].dataSource
+ }
+ const config = {
+ name: this.name,
+ code: newVal,
+ click: this.click,
+ retry: this.retry,
+ detailType: this.detailType,
+ buttonList: this.buttonList,
+ parameters: tempParameters,
+ parameterMap: tempParameterMap
+ }
+ this.taskConfig = JSON.stringify(config, null, 2)
+ },
+ immediate: true
+ },
+ click: {
+ handler(newVal) {
+ const tempParameters = {}
+ for (const key in this.parameters) {
+ tempParameters[key] = ''
+ }
+ const tempParameterMap = {}
+ for (const key in newVal) {
+ tempParameterMap[key] = newVal[key].dataSource
+ }
+ const config = {
+ name: this.name,
+ code: this.code,
+ click: newVal,
+ retry: this.retry,
+ detailType: this.detailType,
+ buttonList: this.buttonList,
+ parameters: tempParameters,
+ parameterMap: tempParameterMap
+ }
+ this.taskConfig = JSON.stringify(config, null, 2)
+ },
+ immediate: true
+ },
+ retry: {
+ handler(newVal) {
+ const tempParameters = {}
+ for (const key in this.parameters) {
+ tempParameters[key] = ''
+ }
+ const tempParameterMap = {}
+ for (const key in newVal) {
+ tempParameterMap[key] = newVal[key].dataSource
+ }
+ const config = {
+ name: this.name,
+ code: this.code,
+ click: this.click,
+ retry: newVal,
+ detailType: this.detailType,
+ buttonList: this.buttonList,
+ parameters: tempParameters,
+ parameterMap: tempParameterMap
+ }
+ this.taskConfig = JSON.stringify(config, null, 2)
+ },
+ immediate: true
+ },
+ detailType: {
+ handler(newVal) {
+ const tempParameters = {}
+ for (const key in this.parameters) {
+ tempParameters[key] = ''
+ }
+ const tempParameterMap = {}
+ for (const key in newVal) {
+ tempParameterMap[key] = newVal[key].dataSource
+ }
+ const config = {
+ name: this.name,
+ code: this.code,
+ click: this.click,
+ retry: this.retry,
+ detailType: newVal,
+ buttonList: this.buttonList,
+ parameters: tempParameters,
+ parameterMap: tempParameterMap
+ }
+ this.taskConfig = JSON.stringify(config, null, 2)
+ },
+ immediate: true
+ },
+ buttonList: {
+ handler(newVal) {
+ const tempParameters = {}
+ for (const key in this.parameters) {
+ tempParameters[key] = ''
+ }
+ const tempParameterMap = {}
+ for (const key in newVal) {
+ tempParameterMap[key] = newVal[key].dataSource
+ }
+ const config = {
+ name: this.name,
+ code: this.code,
+ click: this.click,
+ retry: this.retry,
+ detailType: this.detailType,
+ buttonList: newVal,
+ parameters: tempParameters,
+ parameterMap: tempParameterMap
+ }
+ this.taskConfig = JSON.stringify(config, null, 2)
+ },
+ immediate: true,
+ deep: true
+ },
+ parameters: {
+ handler(newVal) {
+ const tempParameters = {}
+ for (const key in newVal) {
+ tempParameters[key] = ''
+ }
+ const tempParameterMap = {}
+ for (const key in newVal) {
+ tempParameterMap[key] = newVal[key].dataSource
+ }
+ const config = {
+ name: this.name,
+ code: this.code,
+ click: this.click,
+ retry: this.retry,
+ detailType: this.detailType,
+ buttonList: this.buttonList,
+ parameters: tempParameters,
+ parameterMap: tempParameterMap
+ }
+ this.taskConfig = JSON.stringify(config, null, 2)
+ },
+ immediate: true,
+ deep: true
+ },
+ /**
+ * 用于刷新 parameters
+ */
+ parameterList: {
+ handler: function(newList, oldList) {
+ const newParameters = {}
+ for (const param of newList) {
+ if (param.code) {
+ newParameters[param.code] = {
+ name: param.name,
+ dataSource: param.dataSource || []
+ }
+ }
+ }
+ this.parameters = newParameters
+ },
+ deep: true,
+ immediate: true
+ }
+ },
+ mounted() {
+ },
+ methods: {
+ onParameterDataSourceInput(nodeParamScope, index, value) {
+ const iii = nodeParamScope.row.dataSource[index]
+ iii.label = value
+ iii.value = value
+ nodeParamScope.row.dataSource[index] = iii
+ },
+ onParameterDataSourceClear(nodeParamScope, index) {
+ nodeParamScope.row.dataSource.splice(index, 1)
+ },
+ onParameterDataSourceAppendClick(nodeParamScope) {
+ // m1.这种写法vue2无法响应式的检测到变化
+ // const ds = nodeParamScope.row.dataSource || []
+ // ds.push({label: '', value: ''})
+ // nodeParamScope.row.dataSource = ds
+ // m2.使用 this.$set(推荐用于 Vue 2)
+ if (!nodeParamScope.row.dataSource) {
+ this.$set(nodeParamScope.row, 'dataSource', [])
+ }
+ nodeParamScope.row.dataSource.push({ label: '', value: '' })
+ }
+ }
}
diff --git a/cutejava-front/src/views/components/devops/pipeline/Pipeline.vue b/cutejava-front/src/views/components/devops/pipeline/Pipeline.vue
index e11b511a..aba24809 100644
--- a/cutejava-front/src/views/components/devops/pipeline/Pipeline.vue
+++ b/cutejava-front/src/views/components/devops/pipeline/Pipeline.vue
@@ -54,8 +54,8 @@ export default {