首页入库

This commit is contained in:
aixianling
2022-07-15 18:12:50 +08:00
parent 2d307db6ce
commit d388123410
2 changed files with 34 additions and 42 deletions

View File

@@ -117,10 +117,12 @@ export default {
}
this.$emit("change", selected)
this.$emit("update:choose", choose)
this.$emit("select", choose)
} else {
this.tableData.map(e => e.checked = e[nodeKey] == row.id && row.checked)
this.$emit("change", row.checked ? row[nodeKey] : '')
this.$emit("update:choose", row.checked ? row : null)
this.$emit("select", row.checked ? row : null)
}
},
handleCheckAll(v) {
@@ -131,6 +133,7 @@ export default {
}).filter(e => e.checked) || []
this.$emit("change", selected?.map(e => e[nodeKey]))
this.$emit("update:choose", selected)
this.$emit("select", selected)
}
},
created() {

View File

@@ -44,14 +44,17 @@
<el-form-item label="小程序AppId">
<el-input v-model="form.appId" clearable placeholder="小程序appId"/>
</el-form-item>
<ai-title title="底部导航栏">
<template #rightBtn>
<ai-dialog-btn text="更换定制页" dialogTitle="选择应用">
<ai-lib-table :meta="appList" :choose.sync="customTabbar" :isShowPagination="false" v-bind="$props"/>
</ai-dialog-btn>
</template>
</ai-title>
<ai-table :tableData="tabBar.list" :colConfigs="colConfigs" tableSize="mini" :isShowPagination="false" border/>
<ai-title title="底部导航栏"/>
<ai-table :tableData="tabBar.list" :colConfigs="colConfigs" tableSize="mini" :isShowPagination="false" border>
<el-table-column slot="options" label="操作" width="80" align="center">
<template slot-scope="{row}">
<ai-dialog-btn text="更换" dialogTitle="选择应用">
<ai-lib-table :meta="appList" v-model="row.id" @select="v=>handleTabbarChange(row,v)" :isShowPagination="false" v-bind="$props"
:border="false"/>
</ai-dialog-btn>
</template>
</el-table-column>
</ai-table>
</template>
</template>
</ai-card>
@@ -95,32 +98,6 @@ export default {
return e
}) || []
},
tabBar: v => ({
color: "#666666",
selectedColor: "#197DF0",
backgroundColor: "#ffffff",
list: [
{pagePath: "pages/home/home", text: "首页", iconPath: "static/TabBar/home.png", selectedIconPath: "static/TabBar/home_selected.png"},
{pagePath: "pages/service/service", text: "应用", iconPath: "static/TabBar/service.png", selectedIconPath: "static/TabBar/service_selected.png"},
v.form.customTabbar,
{pagePath: "pages/mine/my", text: "我的", iconPath: "static/TabBar/me.png", selectedIconPath: "static/TabBar/me_selected.png"}
]
}),
customTabbar: {
set({name, id, label}) {
this.form.customTabbar = {
id,
pagePath: `pages/${name}/${name}`,
text: label,
iconPath: `static/TabBar/custom.png`,
selectedIconPath: `static/TabBar/custom_selected.png`
}
},
get() {
const {id} = this.form.customTabbar || {}
return {id}
}
}
},
data() {
return {
@@ -141,7 +118,21 @@ export default {
{prop: 'project', label: "项目/框架"},
{prop: 'category', label: "分类", dict: "appsCategory"},
{prop: 'name', label: "模块名"}
]
],
tabBar: {
color: "#666666",
selectedColor: "#197DF0",
backgroundColor: "#ffffff",
list: [
{pagePath: "pages/AppHome/AppHome", text: "首页", iconPath: "static/TabBar/home.png", selectedIconPath: "static/TabBar/home_selected.png"},
{pagePath: "pages/service/service", text: "应用", iconPath: "static/TabBar/service.png", selectedIconPath: "static/TabBar/service_selected.png"},
{
pagePath: "pages/AppEnteringVillage/AppEnteringVillage", text: "进村",
iconPath: "static/TabBar/custom.png", selectedIconPath: "static/TabBar/custom_selected.png"
},
{pagePath: "pages/mine/my", text: "我的", iconPath: "static/TabBar/me.png", selectedIconPath: "static/TabBar/me_selected.png"}
]
}
}
},
methods: {
@@ -178,14 +169,12 @@ export default {
handleSysTypeChange(v, data) {
if (v == 'mp') {
this.form.appId = data.appId
const customTabbar = data?.tabBar?.list?.[2]
this.$set(this.form, 'customTabbar', customTabbar || {
pagePath: "pages/AppEnteringVillage/AppEnteringVillage",
text: "进村",
iconPath: "static/TabBar/custom.png",
selectedIconPath: "static/TabBar/custom_selected.png"
})
this.tabBar = data?.tabBar || this.tabBar
}
},
handleTabbarChange(row, {name, label}) {
row.label = label
row.pagePath = `pages/${name}/${name}`
}
},
created() {