Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Starter Web Vue
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
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
product
kim3-web-vue
Starter Web Vue
Commits
a61e43fb
Commit
a61e43fb
authored
Jul 18, 2021
by
陈浩玮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
线路编排完成
parent
ca9a6587
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
476 additions
and
76 deletions
+476
-76
src/api/ranger.js
src/api/ranger.js
+16
-0
src/components/table/table.vue
src/components/table/table.vue
+6
-1
src/pages/ranger/basic/line/Assemble/add.vue
src/pages/ranger/basic/line/Assemble/add.vue
+0
-57
src/pages/ranger/basic/line/Assemble/addItem.vue
src/pages/ranger/basic/line/Assemble/addItem.vue
+88
-0
src/pages/ranger/basic/line/Assemble/addPlace.vue
src/pages/ranger/basic/line/Assemble/addPlace.vue
+84
-0
src/pages/ranger/basic/line/Assemble/addUnit.vue
src/pages/ranger/basic/line/Assemble/addUnit.vue
+75
-0
src/pages/ranger/basic/line/Assemble/index.vue
src/pages/ranger/basic/line/Assemble/index.vue
+149
-18
src/pages/ranger/basic/line/Assemble/setOrder.vue
src/pages/ranger/basic/line/Assemble/setOrder.vue
+58
-0
No files found.
src/api/ranger.js
View file @
a61e43fb
...
@@ -145,3 +145,19 @@ export function getRouteAssemblesApi(data) {
...
@@ -145,3 +145,19 @@ export function getRouteAssemblesApi(data) {
export
function
getRouteAssemblesListApi
(
data
)
{
export
function
getRouteAssemblesListApi
(
data
)
{
return
getReq
(
`/ranger/inspection/api/v1/route/assembles/assembleList`
,
data
);
return
getReq
(
`/ranger/inspection/api/v1/route/assembles/assembleList`
,
data
);
}
}
export
function
addRouteAssemblesListApi
(
data
)
{
return
postReq
(
`/ranger/inspection/api/v1/route/assembles`
,
data
);
}
export
function
getPllaceListApi
(
data
)
{
return
postReq
(
'
/ranger/inspection/api/v1/place/page
'
,
data
);
}
export
function
updateRouteAssemblesApi
(
data
)
{
return
putReq
(
'
/ranger/inspection/api/v1/route/assembles
'
,
data
);
}
export
function
setRouteAssemblesOrderApi
(
data
)
{
return
putReq
(
'
/ranger/inspection/api/v1/route/assembles/assembleOrder
'
,
data
);
}
src/components/table/table.vue
View file @
a61e43fb
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<a-button>
更多查询
</a-button>
<a-button>
更多查询
</a-button>
</a-popover>
</a-popover>
<a-button
@
click=
"reset"
>
重置
</a-button>
<a-button
@
click=
"reset"
>
重置
</a-button>
<a-button
type=
"primary"
@
click=
"
g
etData"
>
查询
</a-button>
<a-button
type=
"primary"
@
click=
"
resetG
etData"
>
查询
</a-button>
</a-space>
</a-space>
</div>
</div>
</my-card>
</my-card>
...
@@ -246,6 +246,11 @@ export default {
...
@@ -246,6 +246,11 @@ export default {
this
.
getData
();
this
.
getData
();
},
},
resetGetData
()
{
this
.
initQuery
=
{
...
initQuery
};
this
.
getData
();
},
refreshView
()
{
refreshView
()
{
this
.
data
=
[...
this
.
data
];
this
.
data
=
[...
this
.
data
];
},
},
...
...
src/pages/ranger/basic/line/Assemble/add.vue
deleted
100644 → 0
View file @
ca9a6587
<
template
>
<Table
url=
"/ranger/inspection/api/v1/place/page"
:rowKey=
"rowKey"
:selected.sync=
"selected"
addBtn
ref=
"addTable"
:otherQuery=
"otherQuery"
>
<template
#search
="
{ query }">
<MoreItem
label=
"线路名称"
>
<a-input
v-model=
"query.inputValue"
placeholder=
"请输入"
/>
</MoreItem>
</
template
>
<a-table-column
title=
"地点名称"
data-index=
"placeName"
/>
<a-table-column
title=
"二维码"
data-index=
"qrCode"
/>
<a-table-column
title=
"电子标签"
data-index=
"electronicTag"
/>
</Table>
</template>
<
script
>
import
Table
from
'
@/components/table/table.vue
'
;
import
MoreItem
from
'
@/components/table/more_item.vue
'
;
import
{
updateRouteStateApi
}
from
'
@/api
'
;
export
default
{
components
:
{
Table
,
MoreItem
},
props
:
{
data
:
Object
,
row
:
Object
,
},
watch
:
{
row
:
{
handler
(
val
)
{
if
(
val
)
{
console
.
log
(
val
);
}
else
{
const
{
regionId
}
=
this
.
data
;
this
.
otherQuery
=
{
regionId
};
this
.
rowKey
=
'
placeId
'
;
}
},
deep
:
true
,
immediate
:
true
,
},
},
data
()
{
return
{
selected
:
{},
otherQuery
:
{},
rowKey
:
'
regionId
'
,
};
},
methods
:
{},
};
</
script
>
src/pages/ranger/basic/line/Assemble/addItem.vue
0 → 100644
View file @
a61e43fb
<
template
>
<Wraper
:hidden=
"hidden"
:refresh=
"refresh"
:onOk=
"submit"
>
<Table
url=
"/ranger/inspection/api/v1/items"
rowKey=
"itemId"
:selected.sync=
"selected"
ref=
"addTable"
:otherQuery=
"otherQuery"
:width=
"552"
>
<template
#search
="
{ query }">
<MoreItem
label=
"项目名称"
>
<a-input
v-model=
"query.inputValue"
placeholder=
"请输入"
/>
</MoreItem>
</
template
>
<a-table-column
title=
"项目名称"
data-index=
"itemName"
/>
<a-table-column
title=
"数据类型"
>
<
template
#default=
"row"
>
<span>
{{
dataType
[
row
.
dataType
]
}}
</span>
</
template
>
</a-table-column>
<a-table-column
title=
"项目描述"
data-index=
"equipmentCode"
/>
</Table>
</Wraper>
</template>
<
script
>
import
Table
from
'
@/components/table/table.vue
'
;
import
MoreItem
from
'
@/components/table/more_item.vue
'
;
import
Wraper
from
'
@/components/table/wraper.vue
'
;
import
{
addRouteAssemblesListApi
}
from
'
@/api
'
;
export
default
{
components
:
{
Table
,
MoreItem
,
Wraper
},
props
:
{
data
:
Object
,
row
:
Object
,
hidden
:
Function
,
refresh
:
Function
,
},
watch
:
{
row
:
{
handler
(
val
)
{
if
(
val
)
{
const
{
assembleObjectId
,
routeId
,
parentAssembleObjectId
,
regionId
}
=
val
;
this
.
otherQuery
=
{
placeId
:
parentAssembleObjectId
,
unitId
:
assembleObjectId
,
regionId
};
this
.
submitData
=
{
assembleObjectType
:
'
ITEM
'
,
parentAssembleObjectType
:
'
UNIT
'
,
parentAssembleObjectId
:
assembleObjectId
,
routeId
,
};
}
},
deep
:
true
,
immediate
:
true
,
},
},
data
()
{
return
{
selected
:
{
keys
:
[],
},
otherQuery
:
{},
submitData
:
{},
dataType
:
{
TEXT
:
'
文本类型
'
,
OPTION
:
'
选项类型
'
,
NUMERIC
:
'
数值类型
'
,
},
};
},
methods
:
{
async
submit
()
{
if
(
this
.
selected
?.
keys
?.
length
!==
0
)
{
return
await
addRouteAssemblesListApi
({
...
this
.
submitData
,
assembleObjectIdList
:
this
.
selected
.
keys
,
});
}
this
.
$message
.
warning
(
'
请选择
'
);
throw
new
Error
(
'
请选择
'
);
},
},
};
</
script
>
src/pages/ranger/basic/line/Assemble/addPlace.vue
0 → 100644
View file @
a61e43fb
<
template
>
<Wraper
:hidden=
"hidden"
:refresh=
"refresh"
:onOk=
"submit"
>
<Table
url=
"/ranger/inspection/api/v1/place/page"
rowKey=
"placeId"
:selected.sync=
"selected"
:otherQuery=
"otherQuery"
:width=
"552"
>
<template
#search
="
{ query }">
<MoreItem
label=
"地点名称"
>
<a-input
v-model=
"query.inputValue"
placeholder=
"请输入"
/>
</MoreItem>
</
template
>
<a-table-column
title=
"地点名称"
data-index=
"placeName"
/>
<a-table-column
title=
"二维码"
data-index=
"qrCode"
/>
<a-table-column
title=
"电子标签"
data-index=
"electronicTag"
/>
<!-- <a-table-column v-if="rowKey === 'unitId'" title="单元名称" data-index="unitName" />
<a-table-column v-if="rowKey === 'unitId'" title="设备编号" data-index="equipmentCode" />
<a-table-column v-if="rowKey === 'itemId'" title="项目名称" data-index="itemName" />
<a-table-column v-if="rowKey === 'itemId'" title="数据类型" data-index="dataType" />
<a-table-column v-if="rowKey === 'itemId'" title="项目描述" data-index="equipmentCode" /> -->
</Table>
</Wraper>
</template>
<
script
>
import
Table
from
'
@/components/table/table.vue
'
;
import
MoreItem
from
'
@/components/table/more_item.vue
'
;
import
Wraper
from
'
@/components/table/wraper.vue
'
;
import
{
addRouteAssemblesListApi
}
from
'
@/api
'
;
export
default
{
components
:
{
Table
,
MoreItem
,
Wraper
},
props
:
{
data
:
Object
,
row
:
Object
,
hidden
:
Function
,
refresh
:
Function
,
},
watch
:
{
row
:
{
handler
(
val
)
{
if
(
val
)
{
const
{
regionId
,
routeId
}
=
val
;
this
.
otherQuery
=
{
regionId
};
this
.
submitData
=
{
assembleObjectType
:
'
PLACE
'
,
parentAssembleObjectType
:
'
REGION
'
,
parentAssembleObjectId
:
regionId
,
routeId
,
};
}
},
deep
:
true
,
immediate
:
true
,
},
},
data
()
{
return
{
selected
:
{
keys
:
[],
},
otherQuery
:
{},
submitData
:
{},
};
},
methods
:
{
async
submit
()
{
if
(
this
.
selected
?.
keys
?.
length
!==
0
)
{
return
await
addRouteAssemblesListApi
({
...
this
.
submitData
,
assembleObjectIdList
:
this
.
selected
.
keys
,
});
}
this
.
$message
.
warning
(
'
请选择
'
);
throw
new
Error
(
'
请选择
'
);
},
},
};
</
script
>
src/pages/ranger/basic/line/Assemble/addUnit.vue
0 → 100644
View file @
a61e43fb
<
template
>
<Wraper
:hidden=
"hidden"
:refresh=
"refresh"
:onOk=
"submit"
>
<Table
url=
"/ranger/inspection/api/v1/units"
rowKey=
"unitId"
:selected.sync=
"selected"
:otherQuery=
"otherQuery"
:width=
"552"
>
<template
#search
="
{ query }">
<MoreItem
label=
"搜索"
>
<a-input
v-model=
"query.inputValue"
placeholder=
"请输入单元名称/设备编号"
/>
</MoreItem>
</
template
>
<a-table-column
title=
"单元名称"
data-index=
"unitName"
/>
<a-table-column
title=
"设备编号"
data-index=
"equipmentCode"
/>
</Table>
</Wraper>
</template>
<
script
>
import
Table
from
'
@/components/table/table.vue
'
;
import
MoreItem
from
'
@/components/table/more_item.vue
'
;
import
Wraper
from
'
@/components/table/wraper.vue
'
;
import
{
addRouteAssemblesListApi
}
from
'
@/api
'
;
export
default
{
components
:
{
Table
,
MoreItem
,
Wraper
},
props
:
{
row
:
Object
,
hidden
:
Function
,
refresh
:
Function
,
},
watch
:
{
row
:
{
handler
(
val
)
{
if
(
val
)
{
const
{
assembleObjectId
,
routeId
,
parentAssembleObjectId
}
=
val
;
this
.
otherQuery
=
{
regionId
:
parentAssembleObjectId
,
placeId
:
assembleObjectId
};
this
.
submitData
=
{
assembleObjectType
:
'
UNIT
'
,
parentAssembleObjectType
:
'
PLACE
'
,
parentAssembleObjectId
:
assembleObjectId
,
routeId
,
};
}
},
deep
:
true
,
immediate
:
true
,
},
},
data
()
{
return
{
selected
:
{
keys
:
[],
},
otherQuery
:
{},
submitData
:
{},
};
},
methods
:
{
async
submit
()
{
if
(
this
.
selected
?.
keys
?.
length
!==
0
)
{
return
await
addRouteAssemblesListApi
({
...
this
.
submitData
,
assembleObjectIdList
:
this
.
selected
.
keys
,
});
}
this
.
$message
.
warning
(
'
请选择
'
);
throw
new
Error
(
'
请选择
'
);
},
},
};
</
script
>
src/pages/ranger/basic/line/Assemble/index.vue
View file @
a61e43fb
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
url=
"/ranger/inspection/api/v1/route/assembles"
url=
"/ranger/inspection/api/v1/route/assembles"
rowKey=
"assembleId"
rowKey=
"assembleId"
:formatData=
"formatData"
:formatData=
"formatData"
addBtn
ref=
"assembleTable"
ref=
"assembleTable"
:scroll=
"scroll"
:scroll=
"scroll"
:otherQuery=
"getDefaultQuery()"
:otherQuery=
"getDefaultQuery()"
...
@@ -13,36 +12,44 @@
...
@@ -13,36 +12,44 @@
noPadding
noPadding
:width=
"400"
:width=
"400"
>
>
<template
#operation
>
<a-button
type=
"primary"
@
click=
"addPlace"
>
新增地点
</a-button>
</
template
>
<
template
#drawer=
"drawer"
>
<
template
#drawer=
"drawer"
>
<Add
v-bind=
"drawer"
:data=
"row"
/>
<AddPlace
v-if=
"addType === 'PLACE'"
v-bind=
"drawer"
:refresh=
"refresh"
/>
<AddUnit
v-if=
"addType === 'UNIT'"
v-bind=
"drawer"
:refresh=
"refresh"
/>
<AddItem
v-if=
"addType === 'ITEM'"
v-bind=
"drawer"
:refresh=
"refresh"
/>
</
template
>
</
template
>
<a-table-column
title=
"名称"
data-index=
"assembleObjectName"
/>
<a-table-column
title=
"名称"
:width=
"150"
data-index=
"assembleObjectName"
/>
<a-table-column
title=
"顺序"
>
<a-table-column
title=
"顺序"
:width=
"60"
>
<
template
#default=
"row"
>
<
template
#default=
"row"
>
<span
v-if=
"row.assembleObjectType === 'PLACE'"
>
{{
row
.
assembleOrder
}}
</span>
<span
v-if=
"row.assembleObjectType === 'PLACE'"
>
{{
row
.
assembleOrder
}}
</span>
<span
v-else
>
-
</span>
<span
v-else
>
-
</span>
</
template
>
</
template
>
</a-table-column>
</a-table-column>
<a-table-column
title=
"类型"
>
<a-table-column
title=
"类型"
:width=
"60"
>
<
template
#default=
"row"
>
<
template
#default=
"row"
>
<span
v-if=
"row.assembleObjectType === 'PLACE'"
>
地点
</span>
<span
v-if=
"row.assembleObjectType === 'PLACE'"
>
地点
</span>
<span
v-if=
"row.assembleObjectType === 'UNIT'"
>
单元
</span>
<span
v-if=
"row.assembleObjectType === 'UNIT'"
>
单元
</span>
<span
v-if=
"row.assembleObjectType === 'ITEM'"
>
项目
</span>
<span
v-if=
"row.assembleObjectType === 'ITEM'"
>
项目
</span>
</
template
>
</
template
>
</a-table-column>
</a-table-column>
<a-table-column
title=
"免检"
>
<a-table-column
title=
"免检"
:width=
"60"
>
<
template
#default=
"row"
>
<
template
#default=
"row"
>
<span
:style=
"
{ color: '#2db7f5' }" v-if="row.exemptionState === 'YES'">是
</span>
<span
:style=
"
{ color: '#2db7f5' }" v-if="row.exemptionState === 'YES'">是
</span>
<span
:style=
"
{ color: '#f5222d' }" v-if="row.exemptionState === 'NO'">否
</span>
<span
:style=
"
{ color: '#f5222d' }" v-if="row.exemptionState === 'NO'">否
</span>
</
template
>
</
template
>
</a-table-column>
</a-table-column>
<a-table-column
title=
"状态"
>
<a-table-column
title=
"状态"
:width=
"60"
>
<
template
#default=
"row"
>
<
template
#default=
"row"
>
<span
:style=
"
{ color: '#2db7f5' }" v-if="row.assembleState === 'VALID'">有效
</span>
<span
:style=
"
{ color: '#2db7f5' }" v-if="row.assembleState === 'VALID'">有效
</span>
<span
:style=
"
{ color: '#f5222d' }" v-if="row.assembleState === 'INVALID'">无效
</span>
<span
:style=
"
{ color: '#f5222d' }" v-if="row.assembleState === 'INVALID'">无效
</span>
</
template
>
</
template
>
</a-table-column>
</a-table-column>
<a-table-column
title=
"描述"
data-index=
"assembleDesc"
/>
<a-table-column
title=
"描述"
data-index=
"assembleDesc"
:width=
"200"
/>
<
template
#other
>
<SetOrder
ref=
"setOrder"
:afterSubmit=
"setRouteAssemblesOrder"
/>
</
template
>
</Table>
</Table>
</Wraper>
</Wraper>
</template>
</template>
...
@@ -50,35 +57,88 @@
...
@@ -50,35 +57,88 @@
<
script
>
<
script
>
import
Table
from
'
@/components/table/table.vue
'
;
import
Table
from
'
@/components/table/table.vue
'
;
import
Wraper
from
'
@/components/table/wraper.vue
'
;
import
Wraper
from
'
@/components/table/wraper.vue
'
;
import
{
getRouteAssemblesListApi
}
from
'
@/api
'
;
import
{
getRouteAssemblesListApi
,
updateRouteAssemblesApi
,
setRouteAssemblesOrderApi
}
from
'
@/api
'
;
import
Add
from
'
./add.vue
'
;
import
AddPlace
from
'
./addPlace.vue
'
;
import
AddUnit
from
'
./addUnit.vue
'
;
import
AddItem
from
'
./addItem.vue
'
;
import
SetOrder
from
'
./setOrder.vue
'
;
export
default
{
export
default
{
components
:
{
Wraper
,
Table
,
Add
},
components
:
{
Wraper
,
Table
,
Add
Place
,
AddUnit
,
AddItem
,
SetOrder
},
props
:
{
hidden
:
Function
,
row
:
Object
},
props
:
{
hidden
:
Function
,
row
:
Object
},
data
()
{
data
()
{
return
{
return
{
scroll
:
{
x
:
1300
,
y
:
600
},
scroll
:
{
x
:
1300
,
y
:
600
},
buttons
:
{
buttons
:
{
options
:
{
width
:
2
0
0
,
fixed
:
'
right
'
},
options
:
{
width
:
2
2
0
,
fixed
:
'
right
'
},
title
:
'
操作
'
,
title
:
'
操作
'
,
data
:
[
data
:
[
{
label
:
'
新增
'
,
click
:
()
=>
{}
},
{
{
label
:
'
失效
'
,
click
:
()
=>
{}
},
label
:
'
新增单元
'
,
{
label
:
'
生效
'
,
click
:
()
=>
{}
},
click
:
this
.
addUnit
,
{
label
:
'
置顶
'
,
click
:
()
=>
{}
},
isHidden
:
(
row
)
=>
{
{
label
:
'
排序
'
,
click
:
()
=>
{}
},
return
row
.
assembleObjectType
!==
'
PLACE
'
;
},
},
{
label
:
'
新增项目
'
,
click
:
this
.
addItem
,
isHidden
:
(
row
)
=>
{
return
row
.
assembleObjectType
!==
'
UNIT
'
;
},
},
{
label
:
'
置顶
'
,
click
:
this
.
toTop
,
isHidden
:
(
row
)
=>
{
return
row
.
assembleObjectType
!==
'
PLACE
'
;
},
},
{
label
:
'
排序
'
,
click
:
this
.
setOrder
,
isHidden
:
(
row
)
=>
{
return
row
.
assembleObjectType
!==
'
PLACE
'
;
},
},
{
label
:
'
失效
'
,
click
:
(
row
)
=>
this
.
assembleUpdate
(
row
,
'
INVALID
'
),
isHidden
:
(
row
)
=>
{
if
(
row
.
assembleObjectType
===
'
ITEM
'
)
{
return
true
;
}
else
{
return
row
.
assembleState
===
'
INVALID
'
;
}
},
},
{
label
:
'
生效
'
,
click
:
(
row
)
=>
this
.
assembleUpdate
(
row
,
'
VALID
'
),
isHidden
:
(
row
)
=>
{
if
(
row
.
assembleObjectType
===
'
ITEM
'
)
{
return
true
;
}
else
{
return
row
.
assembleState
===
'
VALID
'
;
}
},
},
{
{
type
:
'
confirm
'
,
type
:
'
confirm
'
,
url
:
(
row
)
=>
`/ranger/inspection/api/v1/route
s/
${
row
.
rout
eId
}
`
,
url
:
(
row
)
=>
`/ranger/inspection/api/v1/route
/assembles/
${
row
.
assembl
eId
}
`
,
after
:
this
.
refresh
,
after
:
this
.
refresh
,
},
},
],
],
},
},
addType
:
''
,
};
};
},
},
mounted
()
{},
mounted
()
{},
methods
:
{
methods
:
{
refresh
()
{
this
.
$refs
.
assembleTable
.
resetGetData
();
},
getDefaultQuery
()
{
getDefaultQuery
()
{
const
{
routeId
,
regionId
}
=
this
.
row
;
const
{
routeId
,
regionId
}
=
this
.
row
;
return
{
return
{
...
@@ -87,6 +147,74 @@ export default {
...
@@ -87,6 +147,74 @@ export default {
routeId
,
routeId
,
};
};
},
},
addPlace
()
{
const
row
=
this
.
getDefaultQuery
();
this
.
addType
=
'
PLACE
'
;
this
.
$refs
.
assembleTable
.
show
({
row
,
title
:
'
新增地点
'
,
type
:
'
add
'
});
},
addUnit
(
row
)
{
this
.
addType
=
'
UNIT
'
;
this
.
$refs
.
assembleTable
.
show
({
row
,
title
:
'
新增单元
'
,
type
:
'
add
'
});
},
addItem
(
row
)
{
this
.
addType
=
'
ITEM
'
;
const
newRow
=
{
...
row
,
regionId
:
this
.
row
.
regionId
};
this
.
$refs
.
assembleTable
.
show
({
row
:
newRow
,
title
:
'
新增项目
'
,
type
:
'
add
'
});
},
async
assembleUpdate
(
row
,
assembleState
)
{
const
{
assembleId
,
assembleObjectId
,
assembleObjectType
,
parentAssembleObjectId
,
parentAssembleObjectType
,
routeId
,
}
=
row
;
const
param
=
{
assembleState
,
assembleId
,
assembleObjectId
,
assembleObjectType
,
parentAssembleObjectId
,
parentAssembleObjectType
,
routeId
,
};
const
resp
=
await
updateRouteAssemblesApi
(
param
);
if
(
resp
)
{
this
.
$message
.
success
(
'
操作成功
'
);
this
.
refresh
();
}
else
{
this
.
$message
.
warning
(
'
操作失败
'
);
}
},
toTop
(
row
)
{
const
{
assembleId
,
routeId
}
=
row
;
const
param
=
{
assembleId
,
routeId
,
assembleOrder
:
1
,
};
this
.
setRouteAssemblesOrder
(
param
);
},
setOrder
(
row
)
{
this
.
$refs
.
setOrder
.
setRow
(
row
);
this
.
$refs
.
setOrder
.
showModal
();
},
async
setRouteAssemblesOrder
(
param
)
{
const
resp
=
setRouteAssemblesOrderApi
(
param
);
if
(
resp
)
{
this
.
$message
.
success
(
'
操作成功
'
);
setTimeout
(()
=>
{
this
.
refresh
();
},
500
);
}
else
{
this
.
$message
.
warning
(
'
操作失败
'
);
}
},
formatData
(
list
)
{
formatData
(
list
)
{
return
list
.
records
.
map
((
i
)
=>
{
return
list
.
records
.
map
((
i
)
=>
{
return
{
return
{
...
@@ -103,7 +231,9 @@ export default {
...
@@ -103,7 +231,9 @@ export default {
parentAssembleObjectId
:
assembleObjectId
,
parentAssembleObjectId
:
assembleObjectId
,
assembleObjectType
:
assembleObjectType
===
'
PLACE
'
?
'
UNIT
'
:
'
ITEM
'
,
assembleObjectType
:
assembleObjectType
===
'
PLACE
'
?
'
UNIT
'
:
'
ITEM
'
,
};
};
const
resp
=
await
getRouteAssemblesListApi
(
params
);
const
resp
=
await
getRouteAssemblesListApi
(
params
);
const
newData
=
resp
.
map
((
i
)
=>
{
const
newData
=
resp
.
map
((
i
)
=>
{
return
{
return
{
...
i
,
...
i
,
...
@@ -113,6 +243,7 @@ export default {
...
@@ -113,6 +243,7 @@ export default {
};
};
});
});
record
.
children
=
newData
;
record
.
children
=
newData
;
this
.
$refs
.
assembleTable
?.
refreshView
();
this
.
$refs
.
assembleTable
?.
refreshView
();
},
},
},
},
...
...
src/pages/ranger/basic/line/Assemble/setOrder.vue
0 → 100644
View file @
a61e43fb
<
template
>
<a-modal
v-model=
"visible"
:title=
"`设置排序:$
{row.assembleObjectName}`"
@ok="handleOk"
destroyOnClose
:zIndex="1010"
>
<a-form-model
layout=
"vertical"
:model=
"form"
:rules=
"rules"
ref=
"form"
>
<a-form-model-item
label=
"排序"
prop=
"order"
>
<a-input-number
:style=
"
{ width: '100%' }" v-model="form.order" :min="1" :max="9999" />
</a-form-model-item>
</a-form-model>
</a-modal>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
visible
:
false
,
form
:
{},
rules
:
{
order
:
[{
required
:
true
},
{
pattern
:
/^
(
0|
[
1-9
][
0-9
]
*
)
$/
,
message
:
'
请输入正确的排序
'
}],
},
row
:
{
assembleObjectName
:
''
,
},
};
},
props
:
{
afterSubmit
:
Function
,
},
methods
:
{
showModal
()
{
this
.
form
=
{};
this
.
visible
=
true
;
},
async
handleOk
(
e
)
{
await
this
.
$refs
.
form
.
validate
();
const
{
assembleId
,
routeId
}
=
this
.
row
;
const
param
=
{
assembleId
,
routeId
,
assembleOrder
:
this
.
form
.
order
,
};
this
.
afterSubmit
&&
this
.
afterSubmit
(
param
);
this
.
closeModal
();
},
closeModal
()
{
this
.
visible
=
false
;
},
setRow
(
row
)
{
this
.
row
=
row
;
},
},
};
</
script
>
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