From 5e33ae7c16e5d707d8c9510b85eb464f44ffee4c Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Thu, 4 Mar 2021 18:18:19 +0800 Subject: [PATCH] caidanzu --- .../dev/addMenuGroup/addMenuGroup.html | 39 +++-- .../dev/addMenuGroup/addMenuGroup.js | 149 +++++++++--------- .../dev/editMenuGroup/editMenuGroup.html | 14 ++ .../dev/editMenuGroup/editMenuGroup.js | 6 +- .../dev/menuGroupManage/menuGroupManage.html | 20 ++- .../dev/menuGroupManage/menuGroupManage.js | 126 +++++++++------ 6 files changed, 209 insertions(+), 145 deletions(-) diff --git a/public/components/dev/addMenuGroup/addMenuGroup.html b/public/components/dev/addMenuGroup/addMenuGroup.html index 8fd6d4e8d..edd2b5c51 100644 --- a/public/components/dev/addMenuGroup/addMenuGroup.html +++ b/public/components/dev/addMenuGroup/addMenuGroup.html @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/public/components/dev/addMenuGroup/addMenuGroup.js b/public/components/dev/addMenuGroup/addMenuGroup.js index 267ef7810..b31cec99b 100644 --- a/public/components/dev/addMenuGroup/addMenuGroup.js +++ b/public/components/dev/addMenuGroup/addMenuGroup.js @@ -1,4 +1,4 @@ -(function(vc) { +(function (vc) { vc.extends({ propTypes: { @@ -14,75 +14,75 @@ label: '', seq: '', description: '', - groupType:'' - + groupType: '', + storeTypeCd: '' } }, - _initMethod: function() { + _initMethod: function () { -}, - _initEvent: function() { + }, + _initEvent: function () { vc.on('addMenuGroup', 'openAddMenuGroupModal', - function() { - $('#addMenuGroupModel').modal('show'); - }); + function () { + $('#addMenuGroupModel').modal('show'); + }); }, methods: { addMenuGroupValidate() { return vc.validate.validate({ addMenuGroupInfo: vc.component.addMenuGroupInfo }, - { - 'addMenuGroupInfo.name': [{ - limit: "required", - param: "", - errInfo: "组名称不能为空" - }, { - limit: "maxin", - param: "2,10", - errInfo: "组名称必须在2至10字符之间" - }, - ], - 'addMenuGroupInfo.icon': [{ - limit: "required", - param: "", - errInfo: "icon不能为空" - }, - { - limit: "maxin", - param: "2,20", - errInfo: "icon必须在2至20字符之间" - }, - ], - 'addMenuGroupInfo.label': [, - { - limit: "maxLength", - param: "20", - errInfo: "标签错误" - }, - ], - 'addMenuGroupInfo.seq': [{ - limit: "required", - param: "", - errInfo: "序列不能为空" - }, - { - limit: "num", - param: "", - errInfo: "序列必须为整数" - }, - ], - 'addMenuGroupInfo.description': [{ - limit: "maxLength", - param: "200", - errInfo: "备注内容不能超过200" - }, - ], + 'addMenuGroupInfo.name': [{ + limit: "required", + param: "", + errInfo: "组名称不能为空" + }, + { + limit: "maxin", + param: "2,10", + errInfo: "组名称必须在2至10字符之间" + }, + ], + 'addMenuGroupInfo.icon': [{ + limit: "required", + param: "", + errInfo: "icon不能为空" + }, + { + limit: "maxin", + param: "2,20", + errInfo: "icon必须在2至20字符之间" + }, + ], + 'addMenuGroupInfo.label': [, + { + limit: "maxLength", + param: "20", + errInfo: "标签错误" + }, + ], + 'addMenuGroupInfo.seq': [{ + limit: "required", + param: "", + errInfo: "序列不能为空" + }, + { + limit: "num", + param: "", + errInfo: "序列必须为整数" + }, + ], + 'addMenuGroupInfo.description': [{ + limit: "maxLength", + param: "200", + errInfo: "备注内容不能超过200" + }, + ], - }); + }); }, - saveMenuGroupInfo: function() { + saveMenuGroupInfo: function () { if (!vc.component.addMenuGroupValidate()) { vc.toast(vc.validate.errInfo); @@ -100,34 +100,35 @@ vc.http.post('addMenuGroup', 'save', JSON.stringify(vc.component.addMenuGroupInfo), { emulateJSON: true }, - function(json, res) { - //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); - if (res.status == 200) { - //关闭model - $('#addMenuGroupModel').modal('hide'); - vc.component.clearAddMenuGroupInfo(); - vc.emit('menuGroupManage', 'listMenuGroup', {}); + function (json, res) { + //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); + if (res.status == 200) { + //关闭model + $('#addMenuGroupModel').modal('hide'); + vc.component.clearAddMenuGroupInfo(); + vc.emit('menuGroupManage', 'listMenuGroup', {}); - return; - } - vc.toast(json); + return; + } + vc.toast(json); - }, - function(errInfo, error) { - console.log('请求失败处理'); + }, + function (errInfo, error) { + console.log('请求失败处理'); - vc.toast(errInfo); + vc.toast(errInfo); - }); + }); }, - clearAddMenuGroupInfo: function() { + clearAddMenuGroupInfo: function () { vc.component.addMenuGroupInfo = { name: '', icon: '', label: '', seq: '', description: '', - groupType:'' + groupType: '', + storeTypeCd: '' }; } } diff --git a/public/components/dev/editMenuGroup/editMenuGroup.html b/public/components/dev/editMenuGroup/editMenuGroup.html index 0e528a34a..5d6682751 100644 --- a/public/components/dev/editMenuGroup/editMenuGroup.html +++ b/public/components/dev/editMenuGroup/editMenuGroup.html @@ -48,6 +48,20 @@ +
+ +
+ +
+
diff --git a/public/components/dev/editMenuGroup/editMenuGroup.js b/public/components/dev/editMenuGroup/editMenuGroup.js index 10e7c2f6f..21cfa5b1b 100644 --- a/public/components/dev/editMenuGroup/editMenuGroup.js +++ b/public/components/dev/editMenuGroup/editMenuGroup.js @@ -9,7 +9,8 @@ label: '', seq: '', description: '', - groupType: '' + groupType: '', + storeTypeCd: '' } }, _initMethod: function () { @@ -117,7 +118,8 @@ label: '', seq: '', description: '', - groupType: '' + groupType: '', + storeTypeCd: '' } } } diff --git a/public/pages/dev/menuGroupManage/menuGroupManage.html b/public/pages/dev/menuGroupManage/menuGroupManage.html index 662d5c8e4..b582ae7d3 100644 --- a/public/pages/dev/menuGroupManage/menuGroupManage.html +++ b/public/pages/dev/menuGroupManage/menuGroupManage.html @@ -35,8 +35,19 @@
- - +
+
+ +
+
@@ -61,12 +72,11 @@ 组Id 组名称 组类型 + 归属商户 icon 标签 序列 操作 - - @@ -74,6 +84,7 @@ {{menuGroup.gId}} {{menuGroup.name}} {{menuGroup.groupType == 'P_WEB'?'web菜单':'App菜单'}} + {{menuGroup.storeTypeCdName}} {{menuGroup.icon}} {{menuGroup.label}} {{menuGroup.seq}} @@ -89,7 +100,6 @@ - diff --git a/public/pages/dev/menuGroupManage/menuGroupManage.js b/public/pages/dev/menuGroupManage/menuGroupManage.js index 239300f5f..7ce3aee5e 100644 --- a/public/pages/dev/menuGroupManage/menuGroupManage.js +++ b/public/pages/dev/menuGroupManage/menuGroupManage.js @@ -1,86 +1,108 @@ /** 入驻小区 **/ -(function(vc){ +(function (vc) { var DEFAULT_PAGE = 1; var DEFAULT_ROWS = 10; vc.extends({ - data:{ - menuGroupManageInfo:{ - menuGroups:[], - total:0, - records:1, - moreCondition:false, - name:'', - conditions:{ - name:'', -icon:'', -label:'', - + data: { + menuGroupManageInfo: { + menuGroups: [], + total: 0, + records: 1, + moreCondition: false, + name: '', + conditions: { + name: '', + icon: '', + label: '', + storeTypeCd: '' } } }, - _initMethod:function(){ + _initMethod: function () { vc.component._listMenuGroups(DEFAULT_PAGE, DEFAULT_ROWS); }, - _initEvent:function(){ - - vc.on('menuGroupManage','listMenuGroup',function(_param){ - vc.component._listMenuGroups(DEFAULT_PAGE, DEFAULT_ROWS); + _initEvent: function () { + + vc.on('menuGroupManage', 'listMenuGroup', function (_param) { + vc.component._listMenuGroups(DEFAULT_PAGE, DEFAULT_ROWS); }); - vc.on('pagination','page_event',function(_currentPage){ - vc.component._listMenuGroups(_currentPage,DEFAULT_ROWS); + vc.on('pagination', 'page_event', function (_currentPage) { + vc.component._listMenuGroups(_currentPage, DEFAULT_ROWS); }); }, - methods:{ - _listMenuGroups:function(_page, _rows){ + methods: { + _listMenuGroups: function (_page, _rows) { vc.component.menuGroupManageInfo.conditions.page = _page; vc.component.menuGroupManageInfo.conditions.row = _rows; var param = { - params:vc.component.menuGroupManageInfo.conditions - }; + params: vc.component.menuGroupManageInfo.conditions + }; - //发送get请求 - vc.http.get('menuGroupManage', - 'list', - param, - function(json,res){ - var _menuGroupManageInfo=JSON.parse(json); - vc.component.menuGroupManageInfo.total = _menuGroupManageInfo.total; - vc.component.menuGroupManageInfo.records = _menuGroupManageInfo.records; - vc.component.menuGroupManageInfo.menuGroups = _menuGroupManageInfo.menuGroups; - vc.emit('pagination','init',{ - total:vc.component.menuGroupManageInfo.records, - currentPage:_page - }); - },function(errInfo,error){ - console.log('请求失败处理'); - } - ); + //发送get请求 + vc.http.get('menuGroupManage', + 'list', + param, + function (json, res) { + var _menuGroupManageInfo = JSON.parse(json); + vc.component.menuGroupManageInfo.total = _menuGroupManageInfo.total; + vc.component.menuGroupManageInfo.records = _menuGroupManageInfo.records; + vc.component.menuGroupManageInfo.menuGroups = _menuGroupManageInfo.menuGroups; + vc.emit('pagination', 'init', { + total: vc.component.menuGroupManageInfo.records, + currentPage: _page + }); + }, function (errInfo, error) { + console.log('请求失败处理'); + } + ); }, - _openAddMenuGroupModal:function(){ - vc.emit('addMenuGroup','openAddMenuGroupModal',{}); + _openAddMenuGroupModal: function () { + vc.emit('addMenuGroup', 'openAddMenuGroupModal', {}); }, - _openEditMenuGroupModel:function(_menuGroup){ - vc.emit('editMenuGroup','openEditMenuGroupModal',_menuGroup); + _openEditMenuGroupModel: function (_menuGroup) { + vc.emit('editMenuGroup', 'openEditMenuGroupModal', _menuGroup); }, - _openDeleteMenuGroupModel:function(_menuGroup){ - vc.emit('deleteMenuGroup','openDeleteMenuGroupModal',_menuGroup); + _openDeleteMenuGroupModel: function (_menuGroup) { + vc.emit('deleteMenuGroup', 'openDeleteMenuGroupModal', _menuGroup); }, - _queryMenuGroupMethod:function(){ + _queryMenuGroupMethod: function () { vc.component._listMenuGroups(DEFAULT_PAGE, DEFAULT_ROWS); }, - _moreCondition:function(){ - if(vc.component.menuGroupManageInfo.moreCondition){ + _moreCondition: function () { + if (vc.component.menuGroupManageInfo.moreCondition) { vc.component.menuGroupManageInfo.moreCondition = false; - }else{ + } else { vc.component.menuGroupManageInfo.moreCondition = true; } + }, + _getStoreTypeName: function (_storeTypeCd) { + // + // + // + // + // + // + + if (_storeTypeCd == '800900000001') { + return "运营团队"; + } else if (_storeTypeCd == '800900000002') { + return "代理商"; + } else if (_storeTypeCd == '800900000003') { + return "物业"; + } else if (_storeTypeCd == '800900000004') { + return "物流公司"; + } else if (_storeTypeCd == '800900000005') { + return "商家"; + } else { + return "开发团队"; + } } - + } }); })(window.vc);