Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
liangzhen
/
framework-tools-web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c7269591
authored
Mar 18, 2024
by
史敦盼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批次计划管理
1 parent
04d13d76
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
169 additions
and
33 deletions
src/api/index.js
src/components/Form.vue
src/components/TableConfig.vue
src/main.js
src/views/batchPlanManagement/Add.vue
src/views/batchPlanManagement/index.vue
src/api/index.js
View file @
c726959
...
...
@@ -607,5 +607,14 @@ export function saveExamine(params) {
}
// 概设架构遵从检查, 保存
export
function
queryReviewArchiFollowCheckRightSuggestionDetails
(
params
)
{
return
post
(
'/network/app-archi-control-requirements/qReview'
,
params
);
return
post
(
'/network/app-archi-control-requirements/qReview'
,
params
)
}
// 新增批次计划
export
function
addBatchPlan
(
params
)
{
return
post
(
'/network/bat-plan-info/ad'
,
params
)
}
// 修改批次计划
export
function
editBatchPlan
(
params
)
{
return
post
(
'/network/bat-plan-info/upd'
,
params
)
}
src/components/Form.vue
View file @
c726959
...
...
@@ -4,7 +4,7 @@
* @Autor: pan
* @Date: 2024-03-12 14:55:59
* @LastEditors: pan
* @LastEditTime: 2024-03-1
5 09:43:02
* @LastEditTime: 2024-03-1
8 14:41:17
-->
<!-- /**
* 搜索栏公共组件
...
...
@@ -78,7 +78,6 @@ export default {
formData
:
{},
}
},
computed
:
{
newKeys
()
{
return
this
.
formOptions
.
map
((
v
)
=>
{
...
...
@@ -108,9 +107,10 @@ export default {
},
// 获取表单数据
getData
()
{
this
.
onValidate
(()
=>
{
this
.
$emit
(
'getData'
,
this
.
formData
)
})
return
this
.
formData
// this.onValidate(() => {
// this.$emit('getData', this.formData)
// })
},
// 导出
onExport
()
{
...
...
@@ -139,7 +139,6 @@ export default {
<
style
lang=
"scss"
scoped
>
.form-box
{
//
display
:
flex
;
margin-top
:
10px
;
.btn-box
{
display
:
flex
;
...
...
@@ -149,21 +148,13 @@ export default {
display
:
flex
;
flex-wrap
:
wrap
;
/deep/
.el-form-item__label
{
margin-bottom
:
10px
;
flex-shrink
:
0
;
color
:
#000
;
}
.el-form-item
{
margin-bottom
:
0
;
//
display
:
flex
;
&.is-error
{
margin-bottom
:
25px
;
}
}
//
el-input
宽度
/
deep
/
.form-item
{
.el-input
{
width
:
220px
!important
;
width
:
100%
!important
;
}
}
}
...
...
src/components/TableConfig.vue
View file @
c726959
...
...
@@ -4,7 +4,7 @@
* @Autor: pan
* @Date: 2024-03-11 14:53:40
* @LastEditors: pan
* @LastEditTime: 2024-03-1
4 09:46:17
* @LastEditTime: 2024-03-1
8 11:02:04
-->
<!-- 示例
columns: [{ label: '头像', prop: 'avatar', align: 'center', __slotName: 'avatar',callback: (row, title) => {
...
...
@@ -208,7 +208,6 @@ export default {
},
methods
:
{
handleToText
(
item
,
state
)
{
console
.
log
(
item
,
state
)
const
obj
=
item
.
options
.
find
((
v
)
=>
v
.
value
===
state
)
||
{}
return
obj
[
'label'
]
},
...
...
src/main.js
View file @
c726959
...
...
@@ -12,7 +12,33 @@ initDirective(Vue)
Vue
.
config
.
productionTip
=
false
Vue
.
use
(
ElementUI
)
Date
.
prototype
.
format
=
function
(
fmt
)
{
if
(
!
fmt
)
{
fmt
=
'yyyy-MM-dd hh:mm:ss'
}
var
o
=
{
'M+'
:
this
.
getMonth
()
+
1
,
// 月份
'd+'
:
this
.
getDate
(),
// 日
'h+'
:
this
.
getHours
(),
// 小时
'm+'
:
this
.
getMinutes
(),
// 分
's+'
:
this
.
getSeconds
(),
// 秒
'q+'
:
Math
.
floor
((
this
.
getMonth
()
+
3
)
/
3
),
// 季度
S
:
this
.
getMilliseconds
(),
// 毫秒
}
if
(
/
(
y+
)
/
.
test
(
fmt
))
fmt
=
fmt
.
replace
(
RegExp
.
$1
,
(
this
.
getFullYear
()
+
''
).
substr
(
4
-
RegExp
.
$1
.
length
),
)
for
(
let
k
in
o
)
{
if
(
new
RegExp
(
'('
+
k
+
')'
).
test
(
fmt
))
fmt
=
fmt
.
replace
(
RegExp
.
$1
,
RegExp
.
$1
.
length
==
1
?
o
[
k
]
:
(
'00'
+
o
[
k
]).
substr
((
''
+
o
[
k
]).
length
),
)
}
return
fmt
}
new
Vue
({
router
,
store
,
...
...
src/views/batchPlanManagement/Add.vue
View file @
c726959
...
...
@@ -4,17 +4,19 @@
:visible
.
sync=
"showDialog"
:close-on-click-modal=
"false"
width=
"60%"
@
close=
"handleClose"
@
open=
"handleOpen"
>
<div>
<Form
@
getData=
"getFormData
"
ref=
"addForm
"
:form-options=
"formOptions"
label-width=
"120px"
></Form>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"showDialog = false"
size=
"mini"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"handle
Impor
t"
size=
"mini"
<el-button
type=
"primary"
@
click=
"handle
Submi
t"
size=
"mini"
>
提 交
</el-button
>
</span></el-dialog
...
...
@@ -23,6 +25,8 @@
<
script
>
import
Form
from
'@/components/Form.vue'
import
{
addBatchPlan
,
editBatchPlan
}
from
'@/api'
export
default
{
props
:
{
title
:
{
...
...
@@ -33,6 +37,10 @@ export default {
type
:
Boolean
,
default
:
false
,
},
rowData
:
{
type
:
Object
,
default
:
()
=>
{},
},
},
data
()
{
return
{}
...
...
@@ -48,11 +56,11 @@ export default {
prop
:
'batName'
,
// 字段名
element
:
'el-input'
,
// 指定elementui组件
placeholder
:
'请输入内容'
,
// elementui组件属性
rules
:
[],
rules
:
[
{
required
:
true
,
trigger
:
'blur'
,
message
:
'不能为空'
}
],
},
{
label
:
'创建人'
,
// label文字
prop
:
'
batName
'
,
// 字段名
prop
:
'
createMan
'
,
// 字段名
element
:
'el-input'
,
// 指定elementui组件
initValue
:
''
,
// 字段初始值
placeholder
:
'请输入内容'
,
// elementui组件属性
...
...
@@ -60,20 +68,20 @@ export default {
},
{
label
:
'创建时间'
,
// label文字
prop
:
'
planReviewDat
e'
,
// 字段名
prop
:
'
createTim
e'
,
// 字段名
type
:
'date'
,
valueFormat
:
'yyyy-MM-dd'
,
element
:
'el-date-picker'
,
// 指定elementui组件
initValue
:
''
,
// 字段初始值
initValue
:
new
Date
().
format
(
'yyyy-MM-dd'
)
,
// 字段初始值
placeholder
:
'请选择'
,
// elementui组件属性
},
{
label
:
'年度'
,
// label文字
prop
:
'
planReviewDate
'
,
// 字段名
prop
:
'
year
'
,
// 字段名
type
:
'year'
,
valueFormat
:
'yyyy'
,
element
:
'el-date-picker'
,
// 指定elementui组件
initValue
:
''
,
// 字段初始值
initValue
:
new
Date
().
format
(
'yyyy'
)
,
// 字段初始值
placeholder
:
'请选择'
,
// elementui组件属性
},
{
...
...
@@ -87,10 +95,12 @@ export default {
},
{
label
:
'备注'
,
// label文字
prop
:
'
planReviewDate
'
,
// 字段名
prop
:
'
remark
'
,
// 字段名
type
:
'textarea'
,
element
:
'el-input'
,
// 指定elementui组件
placeholder
:
'请输入内容'
,
// elementui组件属性
span
:
24
,
rules
:
[{
required
:
true
,
trigger
:
'blur'
,
message
:
'不能为空'
}],
},
]
},
...
...
@@ -102,10 +112,58 @@ export default {
this
.
$emit
(
'update:visible'
,
value
)
},
},
isEdit
()
{
if
(
this
.
title
===
'修改批次计划'
)
{
return
true
}
else
{
return
false
}
},
},
mounted
()
{},
methods
:
{
getFormData
(
formData
)
{},
handleSubmit
()
{
this
.
$refs
[
'addForm'
].
onValidate
(()
=>
{
const
loading
=
this
.
$loading
({
lock
:
true
,
text
:
'保存中'
,
spinner
:
'el-icon-loading'
,
})
const
formInfo
=
this
.
$refs
[
'addForm'
].
getData
()
const
typeApi
=
this
.
isEdit
?
editBatchPlan
:
addBatchPlan
const
params
=
{
...
this
.
rowData
,
...
formInfo
,
state
:
1
,
}
typeApi
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
loading
.
close
()
this
.
$message
.
success
(
'保存成功'
)
this
.
showDialog
=
false
this
.
handleClose
()
this
.
$emit
(
'querySearch'
)
}
})
})
},
handleClose
()
{
this
.
$refs
[
'addForm'
].
onReset
()
},
handleOpen
()
{
if
(
Object
.
keys
(
this
.
rowData
).
length
)
{
this
.
formOptions
.
forEach
((
v
)
=>
{
v
.
initValue
=
this
.
rowData
[
v
.
prop
]
})
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'addForm'
].
addInitValue
()
})
}
else
{
this
.
$nextTick
(()
=>
{
this
.
handleClose
()
})
}
},
},
}
</
script
>
...
...
src/views/batchPlanManagement/index.vue
View file @
c726959
...
...
@@ -30,7 +30,12 @@
</list-page>
<!-- 新增弹窗 -->
<Add
:visible
.
sync=
"visible"
title=
"新增批次计划"
></Add>
<Add
@
querySearch=
"querySearch"
:visible
.
sync=
"visible"
:row-data=
"rowData"
:title=
"dialogTitle"
></Add>
</div>
</template>
...
...
@@ -40,7 +45,7 @@ import SearchForm from '@/components/SearchForm.vue'
import
TableConfig
from
'@/components/TableConfig.vue'
import
Add
from
'./Add.vue'
import
{
getDianXingAnLiSelectData
}
from
'@/api/index.js'
import
{
getDianXingAnLiSelectData
,
editBatchPlan
}
from
'@/api/index.js'
import
{
batchPlanManagement
}
from
'@/api/interface'
import
{
approvalStatusOptions
}
from
'@/utils/dictionary'
export
default
{
...
...
@@ -60,6 +65,8 @@ export default {
queryParam
:
{},
},
visible
:
false
,
rowData
:
{},
dialogTitle
:
''
,
}
},
computed
:
{
...
...
@@ -138,14 +145,13 @@ export default {
},
],
callback
:
(
row
,
title
)
=>
{
this
.
fn
ToDetailsTab
(
'1'
)
this
.
fn
Operation
(
row
,
title
)
},
},
]
},
},
created
()
{
console
.
log
(
'batchPlanManagement'
,
batchPlanManagement
)
const
params
=
{
key
:
'build_type'
,
}
...
...
@@ -168,6 +174,53 @@ export default {
this
.
$refs
.
searchTable
.
queryData
()
},
fnAdd
()
{
this
.
dialogTitle
=
'新增批次计划'
this
.
visible
=
true
this
.
rowData
=
{}
},
/**
* @description: 操作按钮
* @param {Object} row 当前操作行数据
* @param {String} title 当前操作按钮名称
* @author: pan
*/
fnOperation
(
row
,
title
)
{
switch
(
title
)
{
case
'修改'
:
this
.
fnEdit
(
row
)
break
case
'删除'
:
this
.
fnDel
(
row
)
break
default
:
break
}
},
fnDel
(
row
)
{
this
.
$confirm
(
'是否确认删除?'
,
'提示'
,
{
confirmButtonText
:
'确认'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
})
.
then
(()
=>
{
const
params
=
{
...
row
,
delFlag
:
1
,
}
editBatchPlan
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
this
.
$message
.
success
(
'删除成功'
)
this
.
$refs
.
searchTable
.
queryData
()
}
else
{
this
.
$message
.
error
(
'删除失败'
)
}
})
})
.
catch
(()
=>
{})
},
fnEdit
(
row
)
{
this
.
dialogTitle
=
'修改批次计划'
this
.
rowData
=
row
this
.
visible
=
true
},
},
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment