Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
so-manage-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
smart-operation
so-manage-ui
Commits
c151e788
Commit
c151e788
authored
Jun 28, 2023
by
张俊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增编辑任务调整
parent
b1bf6882
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
151 additions
and
23 deletions
+151
-23
src/bg-ui/bg-inner-tabs.vue
src/bg-ui/bg-inner-tabs.vue
+9
-2
src/page/main/auto-maintenance/task-manage/add/base-info.vue
src/page/main/auto-maintenance/task-manage/add/base-info.vue
+23
-3
src/page/main/auto-maintenance/task-manage/add/finish.vue
src/page/main/auto-maintenance/task-manage/add/finish.vue
+12
-4
src/page/main/auto-maintenance/task-manage/add/index.vue
src/page/main/auto-maintenance/task-manage/add/index.vue
+45
-6
src/page/main/auto-maintenance/task-manage/add/use-content.vue
...age/main/auto-maintenance/task-manage/add/use-content.vue
+62
-8
No files found.
src/bg-ui/bg-inner-tabs.vue
View file @
c151e788
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
</
template
>
</
template
>
<
script
setup
>
<
script
setup
>
import
{
reactive
,
ref
,
onBeforeMount
,
toRefs
}
from
"
vue
"
;
import
{
reactive
,
ref
,
onBeforeMount
,
toRefs
,
watch
}
from
"
vue
"
;
const
props
=
defineProps
({
const
props
=
defineProps
({
modelValue
:
{
modelValue
:
{
type
:
[
String
,
Number
],
type
:
[
String
,
Number
],
...
@@ -35,6 +35,13 @@ const emit = defineEmits(["update:modelValue", "change"]);
...
@@ -35,6 +35,13 @@ const emit = defineEmits(["update:modelValue", "change"]);
const
nowIndex
=
ref
(
""
);
const
nowIndex
=
ref
(
""
);
watch
(
()
=>
props
.
modelValue
,
()
=>
{
nowIndex
.
value
=
props
.
modelValue
;
}
);
const
changeInner
=
(
val
)
=>
{
const
changeInner
=
(
val
)
=>
{
nowIndex
.
value
=
val
;
nowIndex
.
value
=
val
;
emit
(
"
update:modelValue
"
,
val
);
emit
(
"
update:modelValue
"
,
val
);
...
@@ -42,7 +49,7 @@ const changeInner = (val) => {
...
@@ -42,7 +49,7 @@ const changeInner = (val) => {
};
};
onBeforeMount
(()
=>
{
onBeforeMount
(()
=>
{
nowIndex
.
value
=
props
.
default
;
nowIndex
.
value
=
props
.
modelValue
;
});
});
</
script
>
</
script
>
...
...
src/page/main/auto-maintenance/task-manage/add/base-info.vue
View file @
c151e788
...
@@ -33,10 +33,12 @@ const props = defineProps({
...
@@ -33,10 +33,12 @@ const props = defineProps({
},
},
});
});
const
ruleFormRef
=
ref
(
null
);
const
state
=
reactive
({
const
state
=
reactive
({
ruleForm
:
{
ruleForm
:
{
name
:
props
.
data
?.
name
,
name
:
props
.
data
?.
name
||
""
,
desc
:
props
.
data
?.
desc
,
desc
:
props
.
data
?.
desc
||
""
,
},
},
rules
:
{
rules
:
{
name
:
[
name
:
[
...
@@ -47,10 +49,28 @@ const state = reactive({
...
@@ -47,10 +49,28 @@ const state = reactive({
},
},
});
});
const
save
=
()
=>
{};
const
save
=
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
ruleFormRef
.
value
.
validate
((
valid
,
fields
)
=>
{
if
(
valid
)
{
props
.
data
.
name
=
state
.
ruleForm
.
name
;
props
.
data
.
desc
=
state
.
ruleForm
.
desc
;
resolve
();
}
else
{
reject
();
console
.
log
(
"
error submit!
"
,
fields
);
}
});
});
};
const
clear
=
()
=>
{
ruleFormRef
.
value
.
resetFields
();
};
defineExpose
({
defineExpose
({
save
,
save
,
clear
,
});
});
</
script
>
</
script
>
...
...
src/page/main/auto-maintenance/task-manage/add/finish.vue
View file @
c151e788
...
@@ -4,8 +4,8 @@
...
@@ -4,8 +4,8 @@
<img
src=
"@/assets/imgs/img_data-complete.png"
/>
<img
src=
"@/assets/imgs/img_data-complete.png"
/>
<p
class=
"tips"
>
新增成功
</p>
<p
class=
"tips"
>
新增成功
</p>
<div
class=
"apaas_button btns"
>
<div
class=
"apaas_button btns"
>
<el-button
type=
"default"
@
click=
"go
StepOne
"
>
返回列表
</el-button>
<el-button
type=
"default"
@
click=
"go
ToList
"
>
返回列表
</el-button>
<el-button
type=
"primary"
@
click=
"
putawayAction
"
>
继续新增
</el-button>
<el-button
type=
"primary"
@
click=
"
goStepOne
"
>
继续新增
</el-button>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -17,8 +17,16 @@ import { useRouter, useRoute } from "vue-router";
...
@@ -17,8 +17,16 @@ import { useRouter, useRoute } from "vue-router";
import
{
ElMessage
}
from
"
element-plus
"
;
import
{
ElMessage
}
from
"
element-plus
"
;
const
router
=
useRouter
();
const
router
=
useRouter
();
const
route
=
useRoute
();
const
route
=
useRoute
();
const
state
=
reactive
({
data
:
1
});
const
{
data
}
=
toRefs
(
state
);
const
emit
=
defineEmits
([
"
clear
"
]);
const
goToList
=
()
=>
{
router
.
push
(
"
/auto-maintenance/task-manage
"
);
};
const
goStepOne
=
()
=>
{
emit
(
"
clear
"
);
};
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
...
...
src/page/main/auto-maintenance/task-manage/add/index.vue
View file @
c151e788
...
@@ -40,9 +40,9 @@
...
@@ -40,9 +40,9 @@
</div>
</div>
</div>
</div>
<div
class=
"content_main log_content_nor"
:style=
"step == 3 ? { height: 'calc(100vh - 234px)' } : {}"
>
<div
class=
"content_main log_content_nor"
:style=
"step == 3 ? { height: 'calc(100vh - 234px)' } : {}"
>
<base-info
v-show=
"step == 1"
></base-info>
<base-info
v-show=
"step == 1"
:data=
"state.data"
ref=
"baseInfoRef"
></base-info>
<use-content
v-show=
"step == 2"
></use-content>
<use-content
v-show=
"step == 2"
:data=
"state.data"
ref=
"useContentRef"
></use-content>
<finish
v-show=
"step == 3"
></finish>
<finish
v-show=
"step == 3"
@
clear=
"clearData"
></finish>
</div>
</div>
<div
class=
"content_foot apaas_button"
v-if=
"step == 1 || step == 2"
>
<div
class=
"content_foot apaas_button"
v-if=
"step == 1 || step == 2"
>
<el-button
type=
"default"
@
click=
"cancel"
>
取消
</el-button>
<el-button
type=
"default"
@
click=
"cancel"
>
取消
</el-button>
...
@@ -68,18 +68,57 @@ const router = useRouter();
...
@@ -68,18 +68,57 @@ const router = useRouter();
const
route
=
useRoute
();
const
route
=
useRoute
();
const
step
=
ref
(
1
);
const
step
=
ref
(
1
);
const
baseInfoRef
=
ref
(
null
);
const
useContentRef
=
ref
(
null
);
const
state
=
reactive
({
data
:
1
});
const
state
=
reactive
({
data
:
{},
});
const
cancel
=
()
=>
{
const
cancel
=
()
=>
{
router
.
back
();
router
.
back
();
};
};
const
confirm
=
(
val
)
=>
{
const
confirm
=
async
(
val
)
=>
{
step
.
value
=
step
.
value
+
val
;
let
flag
=
true
;
if
(
val
==
1
)
{
if
(
step
.
value
==
1
)
{
//下一步
await
baseInfoRef
.
value
.
save
()
.
then
()
.
catch
(()
=>
{
flag
=
false
;
});
}
else
if
(
step
.
value
==
2
)
{
//保存
await
useContentRef
.
value
.
save
()
.
then
(()
=>
{
saveTask
();
})
.
catch
(()
=>
{
flag
=
false
;
});
}
}
if
(
flag
)
{
step
.
value
=
step
.
value
+
val
;
}
};
};
const
saveTask
=
()
=>
{};
const
useScript
=
()
=>
{};
const
useScript
=
()
=>
{};
const
clearData
=
()
=>
{
baseInfoRef
.
value
.
clear
();
useContentRef
.
value
.
clear
();
state
.
data
=
{};
step
.
value
=
1
;
};
onBeforeMount
(()
=>
{});
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
...
...
src/page/main/auto-maintenance/task-manage/add/use-content.vue
View file @
c151e788
...
@@ -14,9 +14,9 @@
...
@@ -14,9 +14,9 @@
</bg-upload>
</bg-upload>
</div>
</div>
<bg-form-gap
title=
"执行主机"
></bg-form-gap>
<bg-form-gap
title=
"执行主机"
></bg-form-gap>
<el-form
ref=
"
rule
FormRef"
:model=
"state.ruleForm"
:rules=
"state.rules"
label-position=
"top"
label-width=
"120px"
>
<el-form
ref=
"
pc
FormRef"
:model=
"state.ruleForm"
:rules=
"state.rules"
label-position=
"top"
label-width=
"120px"
>
<el-form-item
label=
"主机分组名称"
prop=
"
n
ame"
style=
"width: 1100px"
>
<el-form-item
label=
"主机分组名称"
prop=
"
pcN
ame"
style=
"width: 1100px"
>
<el-select
v-model=
"state.ruleForm.
n
ame"
style=
"width: 1020px"
clearable
placeholder=
"请选择"
>
<el-select
v-model=
"state.ruleForm.
pcN
ame"
style=
"width: 1020px"
clearable
placeholder=
"请选择"
>
<el-option
v-for=
"item in state.options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
<el-option
v-for=
"item in state.options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</el-select>
<span
class=
"add-pc can_click_text"
>
去创建
</span>
<span
class=
"add-pc can_click_text"
>
去创建
</span>
...
@@ -26,21 +26,31 @@
...
@@ -26,21 +26,31 @@
</
template
>
</
template
>
<
script
setup
>
<
script
setup
>
import
{
reactive
,
ref
,
onBeforeMount
,
toRefs
}
from
"
vue
"
;
import
{
reactive
,
ref
,
onBeforeMount
,
toRefs
,
onMounted
}
from
"
vue
"
;
import
{
useRouter
,
useRoute
}
from
"
vue-router
"
;
import
{
useRouter
,
useRoute
}
from
"
vue-router
"
;
import
{
ElMessage
}
from
"
element-plus
"
;
import
{
ElMessage
}
from
"
element-plus
"
;
const
router
=
useRouter
();
const
router
=
useRouter
();
const
route
=
useRoute
();
const
route
=
useRoute
();
const
props
=
defineProps
({
data
:
{
type
:
Object
,
default
:
()
=>
{},
},
});
const
pcFormRef
=
ref
(
null
);
const
state
=
reactive
({
const
state
=
reactive
({
useType
:
0
,
useType
:
0
,
useData
:
[
"
文本执行
"
,
"
文件执行
"
],
useData
:
[
"
文本执行
"
,
"
文件执行
"
],
useText
:
""
,
useText
:
props
.
data
?.
useText
||
""
,
doc_file
:
[],
doc_file
:
props
.
data
?.
doc_file
||
[],
ruleForm
:
{
ruleForm
:
{
name
:
""
,
pcName
:
props
.
data
?.
pcName
||
""
,
},
},
rules
:
{
rules
:
{
n
ame
:
[{
required
:
true
,
message
:
"
请选择主机分组
"
,
trigger
:
"
change
"
}],
pcN
ame
:
[{
required
:
true
,
message
:
"
请选择主机分组
"
,
trigger
:
"
change
"
}],
},
},
options
:
[
options
:
[
{
{
...
@@ -49,6 +59,50 @@ const state = reactive({
...
@@ -49,6 +59,50 @@ const state = reactive({
},
},
],
],
});
});
const
save
=
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
pcFormRef
.
value
.
validate
((
valid
,
fields
)
=>
{
if
(
valid
)
{
props
.
data
.
pcName
=
state
.
ruleForm
.
pcName
;
if
(
state
.
useType
==
0
)
{
props
.
data
.
useText
=
state
.
useText
;
}
else
{
props
.
data
.
doc_file
=
state
.
doc_file
;
}
resolve
();
}
else
{
reject
();
console
.
log
(
"
error submit!
"
,
fields
);
}
});
});
};
const
clear
=
()
=>
{
pcFormRef
.
value
.
resetFields
();
state
.
useText
=
""
;
state
.
doc_file
=
[];
state
.
useType
=
0
;
};
onMounted
(()
=>
{
if
(
(
props
.
data
&&
props
.
data
.
useText
==
""
&&
props
.
data
.
doc_file
.
length
==
0
)
||
(
!
props
.
data
.
useText
&&
!
props
.
data
.
doc_file
)
)
{
state
.
useType
=
0
;
}
else
if
(
props
.
data
&&
props
.
data
.
useText
!==
""
)
{
state
.
useType
=
1
;
}
else
if
(
props
.
data
&&
props
.
data
.
doc_file
.
length
==
0
)
{
state
.
useType
=
0
;
}
});
defineExpose
({
save
,
clear
,
});
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment