Commit 523b67b8 authored by Xuguangxing's avatar Xuguangxing

feat: 完成后台导航配置部分功能

parent e9f5bbd6
......@@ -16,11 +16,9 @@ export default class NavigatorController extends Controller {
}
// 查询导航配置列表(父子接口,供选择页面使用,且带有分页)
public async getNavigatorConfigListWithRelation(ctx: Context) {
const { pageNo, pageSize, name, author} = ctx.query;
const { pageNo, pageSize, name, author, id } = ctx.query;
try {
const list = await ctx.service.navigator.getList(pageNo, pageSize, name, author);
const { data } = list;
const list = await ctx.service.navigator.getNavigatorConfigListWithRelation(pageNo, pageSize, name, author, id);
ctx.body = ctx.helper.ok(list);
} catch (e) {
ctx.logger.info(`获取导航配置数据异常, ${JSON.stringify(e)}`);
......
......@@ -48,6 +48,38 @@ export default class ArticeService extends Service {
}
return result;
}
// 选择页面 导航配置 获取列表
async getNavigatorConfigListWithRelation(pageNo, pageSize, name = '', author = '', id) {
const offset = (+pageNo - 1) * pageSize;;
const condition = {
author: null,
name: null,
id: null
};
// 模糊匹配作者
if (author) condition.author = author;
// 模糊匹配名称
if (name) condition.name = name;
if (id) {
condition.id = {
$notIn: [id]
}
}
if (!condition.author) delete condition.author;
if (!condition.name) delete condition.name;
if (!condition.id) delete condition.id;
const res = await this.context.model.NavigatorConfig
.findAndCountAll({
where: condition,
limit: +pageSize,
offset
})
const result = {
total: res.count || 0,
data: res.rows || []
}
return result;
}
// 删除导航配置
async deleteById(id) {
const res = await this.context.model.NavigatorConfig.destroy({
......
......@@ -3,15 +3,15 @@ const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'http';
const hostMap = {
apiHost: `http://localhost:7002/`,
// apiHost: `http://192.168.28.199:7001/`,
// apiHost: 'https://quantum-blocks-vcc2.liangkebang.net/',
h5Host: 'https://quantum-h5-vcc2.liangkebang.net',
// apiHost: 'https://quantum-blocks-bfe.liangkebang.net/',
h5Host: 'https://quantum-h5-bfe.liangkebang.net',
qiniuHost: `https://appsync.lkbang.net`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`,
opapiHost: `https://opapi-vcc2.liangkebang.net`,
opapiHost: `https://opapi-bfe.liangkebang.net`,
qiniuUpHost: `${protocol}//up-z0.qiniup.com`,
// kdspHost: 'https://kdsp-api-vcc2.liangkebang.net',
talosHost: 'https://talos-vcc2.liangkebang.net',
kdspHost: 'https://kdsp-api-vcc2.liangkebang.net',
// kdspHost: 'https://kdsp-api-bfe.liangkebang.net',
talosHost: 'https://talos-bfe.liangkebang.net',
kdspHost: 'https://kdsp-api-bfe.liangkebang.net',
yxmTenantId: 560761,
appIdMap: {
560761: 'wxe16bf9293671506c',
......
......@@ -96,22 +96,24 @@
<Button type="ghost" @click="close">取消</Button>
<Button type="primary" @click="confirm">保存</Button>
</div>
<Modal v-model="showSelectPageModal" id="selectPageModal" title="选择页面" width="1000" :styles="{zIndex: 999999}">
<Tabs :value="pageTabType">
<TabPane label="功能页面" name="1">
<featurePageTable
@selectPage="selectPage"
/>
</TabPane>
<TabPane label="活动页面" name="2">
<activityPageTable @selectPage="selectPage" />
</TabPane>
<TabPane label="导航页面" name="3">
<navigatorPageTable @selectPage="selectPage" />
</TabPane>
</Tabs>
<div slot="footer" />
</Modal>
<div v-if="showSelectPageModal">
<Modal v-model="showSelectPageModal" :mask-closable="false" id="selectPageModal" title="选择页面" width="1000">
<Tabs :value="pageTabType">
<TabPane label="功能页面" name="1">
<featurePageTable
@selectPage="selectPage"
/>
</TabPane>
<TabPane label="活动页面" name="2">
<activityPageTable @selectPage="selectPage" />
</TabPane>
<TabPane label="导航页面" name="3">
<navigatorPageTable :nav-id="id" @selectPage="selectPage" />
</TabPane>
</Tabs>
<div slot="footer" />
</Modal>
</div>
</Modal>
</template>
<script>
......@@ -314,6 +316,10 @@ export default {
/deep/ .ivu-modal-mask, /deep/ .ivu-modal-wrap{
z-index: 1009
}
/deep/ .ivu-modal-body{
height: 70vh;
overflow-y: auto;
}
}
/deep/ .ivu-modal-body{
max-height: 70vh;
......
......@@ -43,6 +43,12 @@ import navigatorApi from '@api/navigator.api'
import expandRow from './expandRow.vue';
import config from '@/config/index';
export default {
props: {
navId: {
type: [Number, String],
default: ''
}
},
components: {
expandRow
},
......@@ -132,7 +138,11 @@ export default {
this.query();
},
async query() {
const res = await navigatorApi.getListWithRelation(this.searchForm);
const queryParams = Object.assign({}, this.searchForm);
if (this.navId) {
queryParams.id = navId;
}
const res = await navigatorApi.getListWithRelation(queryParams);
this.total = res.total || 0;
if (res.data.length) {
for (let i = 0; i < res.data.length; i++) {
......
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