Commit 523b67b8 authored by Xuguangxing's avatar Xuguangxing

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

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