Commit 865102e6 authored by 赵伟庚's avatar 赵伟庚

update: 对接部分能力推荐接口

parent 609aa0c2
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<!-- 测试结果弹窗 --> <!-- 测试结果弹窗 -->
<el-dialog <el-dialog
custom-class="dialog_box result_box" class="dialog_box result_box"
title="提示" title="提示"
v-model="showDialog" v-model="showDialog"
width="400px" width="400px"
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<!-- 测试结果弹窗 --> <!-- 测试结果弹窗 -->
<el-dialog <el-dialog
custom-class="dialog_box result_box" class="dialog_box result_box"
title="提示" title="提示"
v-model="showDialog" v-model="showDialog"
width="400px" width="400px"
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<!-- 测试结果弹窗 --> <!-- 测试结果弹窗 -->
<el-dialog <el-dialog
custom-class="dialog_box result_box" class="dialog_box result_box"
title="提示" title="提示"
v-model="showDialog" v-model="showDialog"
width="400px" width="400px"
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<!-- 测试结果弹窗 --> <!-- 测试结果弹窗 -->
<el-dialog <el-dialog
custom-class="dialog_box result_box" class="dialog_box result_box"
title="提示" title="提示"
v-model="showDialog" v-model="showDialog"
width="400px" width="400px"
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<!-- 测试结果弹窗 --> <!-- 测试结果弹窗 -->
<el-dialog <el-dialog
custom-class="dialog_box result_box" class="dialog_box result_box"
title="提示" title="提示"
v-model="showDialog" v-model="showDialog"
width="400px" width="400px"
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<!-- 测试结果弹窗 --> <!-- 测试结果弹窗 -->
<el-dialog <el-dialog
custom-class="dialog_box result_box" class="dialog_box result_box"
title="提示" title="提示"
v-model="showDialog" v-model="showDialog"
width="400px" width="400px"
......
<template> <template>
<div class="msg-container-bdx12" @click.stop> <div class="msg-container-bdx12" @click.stop>
<el-dialog title="详情" v-model="dialogVisible" width="640px" custom-class="dialog_box1"> <el-dialog title="详情" v-model="dialogVisible" width="640px" class="dialog_box1">
<div> <div>
<detail-table2 :list="detailData"> <detail-table2 :list="detailData">
<template v-slot:action="{data}"> <template v-slot:action="{data}">
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
</div> </div>
<!-- 新建/编辑弹窗 --> <!-- 新建/编辑弹窗 -->
<el-dialog <el-dialog
custom-class="dialog_box" class="dialog_box"
:title=" addType == 1 ? '新建' : '编辑'" :title=" addType == 1 ? '新建' : '编辑'"
v-model="addDialog" v-model="addDialog"
width="758px" width="758px"
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
</el-dialog> </el-dialog>
<!-- 删除弹窗 --> <!-- 删除弹窗 -->
<el-dialog <el-dialog
custom-class="dialog_box" class="dialog_box"
title="提示" title="提示"
v-model="dialogDelete" v-model="dialogDelete"
width="400px" width="400px"
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
</div> </div>
<!-- 删除弹窗 --> <!-- 删除弹窗 -->
<el-dialog <el-dialog
custom-class="dialog_box" class="dialog_box"
title="提示" title="提示"
v-model="delDialog" v-model="delDialog"
width="400px" width="400px"
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</div> </div>
<!-- 删除弹窗 --> <!-- 删除弹窗 -->
<el-dialog <el-dialog
custom-class="dialog_box" class="dialog_box"
title="提示" title="提示"
v-model="dialogDelete" v-model="dialogDelete"
width="400px" width="400px"
...@@ -202,7 +202,6 @@ const moveRow = (row,type) => { ...@@ -202,7 +202,6 @@ const moveRow = (row,type) => {
sort: row.sort sort: row.sort
} }
] ]
console.log(params)
axios axios
.post(`/apaas/system/v5/banner/sort`,[...params]) .post(`/apaas/system/v5/banner/sort`,[...params])
.then((res) => { .then((res) => {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<bg-breadcrumb></bg-breadcrumb> <bg-breadcrumb></bg-breadcrumb>
<div class="main_container"> <div class="main_container">
<div class="content_top bg-scroll"> <div class="content_top bg-scroll">
<type-form ref="typeFormRef" @action="submitFormData" @changeType="changeType"></type-form> <type-form ref="typeFormRef" :businessList="businessList" @action="submitFormData" @changeType="changeType"></type-form>
<div class="ability_select"> <div class="ability_select">
<div class="title"> <div class="title">
<span>已选择能力({{selectArrNew.length}}/9)</span> <span>已选择能力({{selectArrNew.length}}/9)</span>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</div> </div>
</div> </div>
<el-dialog <el-dialog
custom-class="select_dialog" class="select_dialog"
title="选择能力" title="选择能力"
v-model="selectDialog" v-model="selectDialog"
width="1220px" width="1220px"
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
v-for="(item, index) in typeList" v-for="(item, index) in typeList"
:key="'typeList' + index" :key="'typeList' + index"
:label="item.name" :label="item.name"
:value="item.value" :value="item.id"
> >
</el-option> </el-option>
</el-select> </el-select>
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
</template> </template>
</el-cascader> </el-cascader>
<el-input <el-input
v-model.trim="dialogFilter.search" v-model.trim="dialogFilter.keyword"
placeholder="请输入内容" placeholder="请输入内容"
style="width: 240px" style="width: 240px"
:prefix-icon="Search" :prefix-icon="Search"
...@@ -140,33 +140,19 @@ const state = reactive({ ...@@ -140,33 +140,19 @@ const state = reactive({
logo: [], logo: [],
state: 1 state: 1
}, },
emptyArr: ["","","","","","","","",""],
selectArr: ["","","","","","","","",""], selectArr: ["","","","","","","","",""],
selectDialog: false, selectDialog: false,
dialogFilter: { dialogFilter: {
openness: "", openness: [],
organization_id: "", organization_id: [],
search: "", keyword: "",
limit: 15, limit: 15,
page: 1, page: 1,
collation: 0, collation: 0,
}, },
orgList: [], orgList: [],
typeList: [ typeList: [],
// { total: 0,
// name: "全部",
// value: ""
// },
{
name: "共享",
value: 1
},
{
name: "开放",
value: 2
}
],
total: 40,
collationArr: [ collationArr: [
{ {
name:'综合排序', name:'综合排序',
...@@ -185,6 +171,7 @@ const state = reactive({ ...@@ -185,6 +171,7 @@ const state = reactive({
value:3, value:3,
}, },
], ],
businessList: [],
list: [], list: [],
selectArrNew: [] selectArrNew: []
}) })
...@@ -229,262 +216,38 @@ const changeType = (val) => { ...@@ -229,262 +216,38 @@ const changeType = (val) => {
const getAbilityList = () => { const getAbilityList = () => {
let params = { let params = {
...state.dialogFilter, ...state.dialogFilter,
business_type_id: state.formData.business_type_id business_type: state.formData.business_type_id
} }
console.log(params) params.organization_id = params.organization_id && params.organization_id.length > 0 ? params.organization_id.join(',') : ''
state.list= [ params.openness = params.openness && params.openness.length > 0 ? params.openness.join(',') : ''
{ axios
ability_logo: "", .get(`/apaas/system/v5/recommend/ability/list`,{params})
ability_name: "冒烟测试1冒烟测试冒烟测试12101", .then(res => {
ability_type: 0, if (res.data.code == 200) {
browse_count: 118, state.list = res.data.data.ability_list || []
call_count: 666, state.selectArrNew = []
develop: "比格", state.total = res.data.data.ability_total
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e", nextTick(() => {
id: 1, state.list.forEach(e => {
include_mock_service: true, e.checked = false
openness: "开放", state.selectArr.forEach(k => {
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311", if (k.id) {
score: 1.9, if (e.id == k.id) {
ability_id: "5228116e-db80-42ed-9c31-5d681ed434ca", e.checked = true
sort_weight: 228.2733180765668, state.selectArrNew.push(e)
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101", }
}, }
{ })
ability_logo: "", })
ability_name: "冒烟测试112101", })
ability_type: 0, }
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
id: 2,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101",
ability_id: "cf7d0496-9b65-460a-ba07-82ae10fbbe3d",
},
{
ability_logo: "",
ability_name: "测试1121s01",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
id: 3,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101",
ability_id: "00c5fc87-861e-4a58-ade5-03058364ad1e",
},
{
ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
id: 4,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
ability_id: "e71240fe-2305-4637-bbb5-316f2cdb77ee",
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
},
{
ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
id: 5,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
ability_id: "ea1488f5-3912-4c83-8b38-98a7dcdafc5f",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
},
{
ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
ability_id: "70c371d3-7b7a-4c66-a40f-30d83ac567b3",
id: 6,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
},
{
ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
ability_id: "346237c3-9c21-4cf8-ae1d-3d8692ad0255",
id: 7,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
},
{
ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
ability_id: "f8039680-7978-4561-982d-96b799459368",
id: 8,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
},
{
ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
id: 9,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
},
{
ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
id: 10,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
},
{
ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
id: 11,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
},
{
ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
id: 12,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
},
{
ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
id: 13,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
},
{
ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
id: 14,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
},
]
state.selectArrNew = []
nextTick(() => {
state.list.forEach(e => {
e.checked = false
state.selectArr.forEach(k => {
if (k.id) {
if (e.id == k.id) {
e.checked = true
state.selectArrNew.push(e)
}
}
})
}) })
})
} }
const openDialog = () => { const openDialog = () => {
state.selectDialog = true state.selectDialog = true
getAbilityList() console.log(state.dialogFilter)
clearAction()
} }
const deleteItem = (item) => { const deleteItem = (item) => {
...@@ -531,6 +294,7 @@ const changeSize = (val) => { ...@@ -531,6 +294,7 @@ const changeSize = (val) => {
const changeCollation = (val) => { const changeCollation = (val) => {
state.dialogFilter.collation = val state.dialogFilter.collation = val
changePage(1)
} }
const clearSelection = () => { const clearSelection = () => {
...@@ -540,15 +304,16 @@ const clearSelection = () => { ...@@ -540,15 +304,16 @@ const clearSelection = () => {
state.selectArrNew = [] state.selectArrNew = []
} }
const searchAction = () => { const searchAction = () => {
console.log(state.dialogFilter) changePage(1)
} }
const clearAction = () => { const clearAction = () => {
state.dialogFilter = { state.dialogFilter = {
openness: "", openness: [],
organization_id: "", organization_id: [],
search: "", keyword: "",
collation: 0, collation: 0,
limit: 15,
} }
changePage(1) changePage(1)
} }
...@@ -654,7 +419,28 @@ const cancel = () => { ...@@ -654,7 +419,28 @@ const cancel = () => {
router.go(-1) router.go(-1)
} }
const getTypeList = () => {
axios
.get("/apaas/system/v5/dictionary/alllist")
.then((res) => {
if (res.data.code == 200) {
let data = res.data.data || []
data.forEach(e => {
if (e.classify_id == "eb9c7d70-c123-42b7-8e61-dde1b022b669") {
state.businessList = e.list || [];
}
if (e.classify_id == "949a1138-4995-464e-97a9-424d097eb271") {
state.typeList = e.list || []
}
})
}else {
ElMessage.error(res.data.data)
}
})
}
onBeforeMount(() => { onBeforeMount(() => {
getTypeList()
getOrgList() getOrgList()
if (route.query.id) { if (route.query.id) {
getDetail(route.query.id) getDetail(route.query.id)
...@@ -664,7 +450,6 @@ onBeforeMount(() => { ...@@ -664,7 +450,6 @@ onBeforeMount(() => {
const { const {
formData, formData,
selectArr, selectArr,
emptyArr,
selectDialog, selectDialog,
dialogFilter, dialogFilter,
typeList, typeList,
...@@ -674,6 +459,7 @@ const { ...@@ -674,6 +459,7 @@ const {
selection, selection,
list, list,
selectArrNew, selectArrNew,
businessList,
} = toRefs(state) } = toRefs(state)
</script> </script>
......
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
class="form" class="form"
> >
<el-form-item label="能力类型" prop="business_type_id"> <el-form-item label="能力类型" prop="business_type_id">
<el-select v-model="formData.business_type_id" placeholder="请选择能力类型" style="width: 100%" @change="changeType"> <el-select v-model="formData.business_type_id" placeholder="请选择能力类型" style="width: 100%" @change="changeType" :disabled="route.query.id">
<el-option <el-option
v-for="item in TypeList" v-for="item in props.businessList"
:key="item.dict_id" :key="item.dict_id"
:label="item.name" :label="item.name"
:value="item.dict_id" :value="item.id"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -30,6 +30,12 @@ import { useRoute, useRouter } from 'vue-router' ...@@ -30,6 +30,12 @@ import { useRoute, useRouter } from 'vue-router'
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
const form = ref(null) const form = ref(null)
const props = defineProps({
businessList: {
type: Array,
default: []
}
})
const state = reactive({ const state = reactive({
formData: { formData: {
business_type_id: "", business_type_id: "",
...@@ -43,7 +49,6 @@ const state = reactive({ ...@@ -43,7 +49,6 @@ const state = reactive({
{ required: true, message: '请上传图标', trigger: 'change' }, { required: true, message: '请上传图标', trigger: 'change' },
], ],
}, },
TypeList: [],
}) })
const emit = defineEmits(['action','changeType']) const emit = defineEmits(['action','changeType'])
...@@ -73,31 +78,13 @@ const setForm = (data) => { ...@@ -73,31 +78,13 @@ const setForm = (data) => {
Object.assign(state.formData, data); Object.assign(state.formData, data);
} }
const getTypeList = () => {
axios
.get("/apaas/system/v5/dictionary/alllist")
.then((res) => {
if (res.data.code == 200) {
let data = res.data.data || []
data.forEach(e => {
if (e.classify_id == "eb9c7d70-c123-42b7-8e61-dde1b022b669") {
state.TypeList = e.list || [];
}
})
}else {
ElMessage.error(res.data.data)
}
})
}
onBeforeMount(() => { onBeforeMount(() => {
getTypeList()
}) })
const { const {
formData, formData,
formRules, formRules,
TypeList,
} = toRefs(state) } = toRefs(state)
defineExpose({ submitForm, clearForm, setForm }) defineExpose({ submitForm, clearForm, setForm })
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
:isIndex="true" :isIndex="true"
:stripe="true" :stripe="true"
> >
<template v-slot:state="{ row }"> <template v-slot:recommend_state="{ row }">
<bg-switch @click="changeUseRow(row)" :labels="['否','是']" :values="[0,1]" v-model="row.state"></bg-switch> <bg-switch @click="changeUseRow(row)" :labels="['否','是']" :values="[0,1]" v-model="row.recommend_state"></bg-switch>
</template> </template>
<template v-slot:action="{ row }"> <template v-slot:action="{ row }">
<bg-table-btns :operations="getOperations(row)" /> <bg-table-btns :operations="getOperations(row)" />
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</div> </div>
<!-- 删除弹窗 --> <!-- 删除弹窗 -->
<el-dialog <el-dialog
custom-class="dialog_box" class="dialog_box"
title="提示" title="提示"
v-model="dialogDelete" v-model="dialogDelete"
width="400px" width="400px"
...@@ -69,7 +69,7 @@ const state = reactive({ ...@@ -69,7 +69,7 @@ const state = reactive({
headers: [ headers: [
{ {
label: "能力类型", label: "能力类型",
prop: "ability_type", prop: "business_type_name",
}, },
{ {
label: "创建人", label: "创建人",
...@@ -77,11 +77,11 @@ const state = reactive({ ...@@ -77,11 +77,11 @@ const state = reactive({
}, },
{ {
label: "更新时间", label: "更新时间",
prop: "update_time", prop: "created_time",
}, },
{ {
label: "是否启用", label: "是否启用",
prop: "state", prop: "recommend_state",
}, },
{ {
label: "操作", label: "操作",
...@@ -96,73 +96,23 @@ const state = reactive({ ...@@ -96,73 +96,23 @@ const state = reactive({
}) })
const getRoleRows = () => { const getRoleRows = () => {
state.tableRows = [ axios
{ .get(`/apaas/system/v5/recommend/ability/classify/list`)
id: 1, .then((res) => {
ability_type: "数据服务", if (res.data.code == 200) {
created_user: "admin", state.tableRows = res.data.data || []
update_time: "2022-11-29 14:30:34", if (state.tableRows.length > 0) {
state: 1, state.tableRows.forEach(e => {
sort: 1, e.canMoveUp = true
}, e.canMoveDown = true
{ })
id: 2, state.tableRows[0].canMoveUp = false
ability_type: "视频服务", state.tableRows[state.tableRows.length - 1].canMoveDown = false
created_user: "admin", }
update_time: "2022-11-29 14:30:34", }else {
state: 0, ElMessage.error(res.data.data)
sort: 2, }
},
{
id: 3,
ability_type: "综合服务",
created_user: "admin",
update_time: "2022-11-29 14:30:34",
state: 1,
sort: 3,
},
{
id: 4,
ability_type: "融合服务",
created_user: "admin",
update_time: "2022-11-29 14:30:34",
state: 0,
sort: 4,
},
{
id: 5,
ability_type: "时空服务",
created_user: "admin",
update_time: "2022-11-29 14:30:34",
state: 1,
sort: 5,
},
]
if (state.tableRows.length > 0) {
state.tableRows.forEach(e => {
e.canMoveUp = true
e.canMoveDown = true
}) })
state.tableRows[0].canMoveUp = false
state.tableRows[state.tableRows.length - 1].canMoveDown = false
}
// axios
// .get(`/apaas/service/v5/ability/query/list`,)
// .then((res) => {
// if (res.data.code == 200) {
// state.tableRows = res.data.data || []
// if (state.tableRows.length > 0) {
// state.tableRows.forEach(e => {
// e.canMoveUp = true
// e.canMoveDown = true
// })
// state.tableRows[0].canMoveUp = false
// state.tableRows[state.tableRows.length - 1].canMoveDown = false
// }
// }else {
// ElMessage.error(res.data.data)
// }
// })
} // 获取列表 } // 获取列表
const getOperations = (row) => { const getOperations = (row) => {
...@@ -170,12 +120,12 @@ const getOperations = (row) => { ...@@ -170,12 +120,12 @@ const getOperations = (row) => {
{ {
name: "编辑", name: "编辑",
callback: () => edit_row(row), callback: () => edit_row(row),
disabled: row.state == 1, disabled: row.recommend_state == 1,
}, },
{ {
name: "删除", name: "删除",
callback: () => delete_row(row), callback: () => delete_row(row),
disabled: row.state == 1, disabled: row.recommend_state == 1,
}, },
{ {
name: "上移", name: "上移",
...@@ -197,17 +147,34 @@ const addBanner = () => { ...@@ -197,17 +147,34 @@ const addBanner = () => {
const edit_row = (row) => { const edit_row = (row) => {
console.log("去编辑") console.log("去编辑")
router.push({
path: "/home-config/recommend/edit",
query: {
id: row.id
}
})
} }
const delete_row = (row) => { const delete_row = (row) => {
state.actionRow = row state.actionRow = row
state.dialogDelete = true state.dialogDelete = true
console.log("删除")
} }
const deleteData = () => { const deleteData = () => {
console.log("确定删除",state.actionRow) let params = {
state.dialogDelete = false id: state.actionRow.id
}
axios
.delete(`/apaas/system/v5/recommend/ability/delete`,{data: params})
.then(res => {
if (res.data.code == 200) {
ElMessage.success(res.data.msg)
state.dialogDelete = false
getRoleRows()
}else {
ElMessage.error(res.data.data)
}
})
} }
const moveRow = (row,type) => { const moveRow = (row,type) => {
...@@ -233,24 +200,33 @@ const moveRow = (row,type) => { ...@@ -233,24 +200,33 @@ const moveRow = (row,type) => {
sort: row.sort sort: row.sort
} }
] ]
console.log(params) axios
// axios .post(`/apaas/system/v5/recommend/ability/sort`,[...params])
// .put(``,[...params]) .then((res) => {
// .then((res) => { if (res.data.code == 200) {
// if (res.data.code == 200) { ElMessage.success(res.data.msg)
// ElMessage.success(res.data.msg) getRoleRows()
// getRoleRows() }else {
// }else { ElMessage.error(res.data.data)
// ElMessage.error(res.data.data) }
// } })
// }) .catch((err) => {
// .catch((err) => { console.log(err)
// console.log(err) })
// })
} }
const changeUseRow = (row) => { const changeUseRow = (row) => {
console.log(row) axios
.get(`/apaas/system/v5/recommend/ability/state/${row.id}/${row.recommend_state}`)
.then(res => {
if (res.data.code == 200) {
ElMessage.success(res.data.msg)
getRoleRows()
}else {
ElMessage.error(res.data.data)
row.recommend_state = row.recommend_state == 0 ? 1 : 0
}
})
} }
onBeforeMount(() => { onBeforeMount(() => {
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
</div> </div>
<!-- 删除弹窗 --> <!-- 删除弹窗 -->
<el-dialog <el-dialog
custom-class="dialog_box" class="dialog_box"
title="提示" title="提示"
v-model="delDialog" v-model="delDialog"
width="400px" width="400px"
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
</el-dialog> </el-dialog>
<!-- 分配用户 --> <!-- 分配用户 -->
<el-dialog <el-dialog
custom-class="distribute_dialog" class="distribute_dialog"
title="分配用户" title="分配用户"
v-model="distributeDialog" v-model="distributeDialog"
width="1062px" width="1062px"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment