See999 5 年之前
父節點
當前提交
a0ae17c5e1

+ 253 - 245
src/lang/zh.js 查看文件

@@ -1,277 +1,285 @@
1 1
 export default {
2 2
   route: {
3
-    dashboard: '首页',
4
-    introduction: '简述',
5
-    documentation: '文档',
6
-    guide: '引导页',
7
-    permission: '权限测试页',
8
-    pagePermission: '页面权限',
9
-    directivePermission: '指令权限',
10
-    icons: '图标',
11
-    components: '组件',
12
-    componentIndex: '介绍',
13
-    tinymce: '富文本编辑器',
14
-    markdown: 'Markdown',
15
-    jsonEditor: 'JSON编辑器',
16
-    dndList: '列表拖拽',
17
-    splitPane: 'Splitpane',
18
-    avatarUpload: '头像上传',
19
-    dropzone: 'Dropzone',
20
-    sticky: 'Sticky',
21
-    countTo: 'CountTo',
22
-    componentMixin: '小组件',
23
-    backToTop: '返回顶部',
24
-    dragDialog: '拖拽 Dialog',
25
-    dragKanban: '可拖拽看板',
26
-    charts: '图表',
27
-    keyboardChart: '键盘图表',
28
-    lineChart: '折线图',
29
-    mixChart: '混合图表',
30
-    example: '综合实例',
31
-    nested: '路由嵌套',
32
-    menu1: '菜单1',
33
-    'menu1-1': '菜单1-1',
34
-    'menu1-2': '菜单1-2',
35
-    'menu1-2-1': '菜单1-2-1',
36
-    'menu1-2-2': '菜单1-2-2',
37
-    'menu1-3': '菜单1-3',
38
-    menu2: '菜单2',
39
-    Table: 'Table',
40
-    dynamicTable: '动态Table',
41
-    dragTable: '拖拽Table',
42
-    inlineEditTable: 'Table内编辑',
43
-    complexTable: '综合Table',
44
-    treeTable: '树形表格',
45
-    customTreeTable: '自定义树表',
46
-    tab: 'Tab',
47
-    form: '表单',
48
-    createArticle: '创建文章',
49
-    editArticle: '编辑文章',
50
-    articleList: '文章列表',
51
-    errorPages: '错误页面',
52
-    page401: '401',
53
-    page404: '404',
54
-    errorLog: '错误日志',
55
-    excel: 'Excel',
56
-    exportExcel: 'Export Excel',
57
-    selectExcel: 'Export Selected',
58
-    uploadExcel: 'Upload Excel',
59
-    zip: 'Zip',
60
-    exportZip: 'Export Zip',
61
-    theme: '换肤',
62
-    clipboardDemo: 'Clipboard',
63
-    i18n: '国际化',
64
-    permissionManage: '权限管理',
65
-    adminManage: '用户管理',
66
-    roleManage: '角色管理',
67
-    dialysis: '透析管理',
68
-    paper: '透析管理',
69
-    advice: '今日医嘱',
70
-    prepare: '透析准备',
71
-    dialysisPrintOrder: '打印透析单',
72
-    details: '透析',
73
-    data_dictionary: '数据字典',
74
-    field_config: '字段配置',
75
-    template: '模版配置',
76
-    druguse: '医嘱模版',
77
-    watch: '透析监测',
78
-    addAdmin: '新增用户',
79
-    editAdmin: '编辑用户信息',
80
-    setupPerview: '设置权限',
81
-    user: '病人管理',
82
-    createPatient: '新增病人',
83
-    patientPage: '病人信息',
84
-    editPatient: '修改病人信息',
85
-    patient: '病人管理',
86
-    dialysisSolution: '透析处方',
87
-    inspection: '检验检查',
88
-    home: '首页',
89
-    weight: '干体重',
90
-    dialysisRecord: '透析记录',
91
-    scheduling: '排班信息',
92
-    proeducation: '宣教信息',
93
-    doctorAdvice: '医嘱信息',
94
-    dryWeight: '干体重',
95
-    device: '设备',
96
-    deviceManage: '设备管理',
97
-    modemanagement:'型号管理',
98
-    dialysisMachineManage: '设备管理',
99
-    workforce: '排班管理',
100
-    appointment: '排班管理',
101
-    sign: '治疗签到',
102
-    remind: '排班提醒',
103
-    signWeight: '签到称重',
104
-    deviceZoneManage: '分区管理',
105
-    deviceGroupManage: '分组管理',
106
-    deviceNumberManage: '床位管理',
107
-    service: '我的服务',
108
-    invoice: '发票管理',
109
-    invoiceApply: '申请发票',
110
-    servicePay: '立即支付',
111
-    serviceOrder: '购买服务',
112
-    payType: '选择支付方式',
113
-    weChatPay: '确认支付',
114
-    completeOrder: '购买结果',
115
-    orderRecord: '订单详情',
116
-    recordList: '订单记录',
117
-    stockManage: '库存管理',
118
-    goodType: '商品类型',
119
-    stockIn: '入库管理',
120
-    stockOut: '出库管理',
121
-    manufacturer: '厂家',
122
-    dealer: '经销商',
123
-    salesReturn: '退货',
124
-    salesReutrnRecord: '退货记录',
125
-    warehouseRecord: '入库记录',
126
-    addStockOut: '出库',
127
-    cancelStock: '出库退库',
128
-    cancelStockRecord: '退库记录',
129
-    stockOutRecord: '出库记录',
130
-    addStockIn: '入库',
131
-    stockQuery: '库存查询',
132
-    workforce_template: '排班模板设置',
133
-    statistics: '统计分析',
134
-    config: '库存配置',
135
-    goodInfo: '商品信息',
136
-    CourseOfDiseaseManage: '病程管理',
137
-    RescueRecord: '抢救记录',
138
-    special_permission_manage: '特殊权限管理',
139
-    schedule_print: '排班打印',
3
+    dashboard: "首页",
4
+    introduction: "简述",
5
+    documentation: "文档",
6
+    guide: "引导页",
7
+    permission: "权限测试页",
8
+    pagePermission: "页面权限",
9
+    directivePermission: "指令权限",
10
+    icons: "图标",
11
+    components: "组件",
12
+    componentIndex: "介绍",
13
+    tinymce: "富文本编辑器",
14
+    markdown: "Markdown",
15
+    jsonEditor: "JSON编辑器",
16
+    dndList: "列表拖拽",
17
+    splitPane: "Splitpane",
18
+    avatarUpload: "头像上传",
19
+    dropzone: "Dropzone",
20
+    sticky: "Sticky",
21
+    countTo: "CountTo",
22
+    componentMixin: "小组件",
23
+    backToTop: "返回顶部",
24
+    dragDialog: "拖拽 Dialog",
25
+    dragKanban: "可拖拽看板",
26
+    charts: "图表",
27
+    keyboardChart: "键盘图表",
28
+    lineChart: "折线图",
29
+    mixChart: "混合图表",
30
+    example: "综合实例",
31
+    nested: "路由嵌套",
32
+    menu1: "菜单1",
33
+    "menu1-1": "菜单1-1",
34
+    "menu1-2": "菜单1-2",
35
+    "menu1-2-1": "菜单1-2-1",
36
+    "menu1-2-2": "菜单1-2-2",
37
+    "menu1-3": "菜单1-3",
38
+    menu2: "菜单2",
39
+    Table: "Table",
40
+    dynamicTable: "动态Table",
41
+    dragTable: "拖拽Table",
42
+    inlineEditTable: "Table内编辑",
43
+    complexTable: "综合Table",
44
+    treeTable: "树形表格",
45
+    customTreeTable: "自定义树表",
46
+    tab: "Tab",
47
+    form: "表单",
48
+    createArticle: "创建文章",
49
+    editArticle: "编辑文章",
50
+    articleList: "文章列表",
51
+    errorPages: "错误页面",
52
+    page401: "401",
53
+    page404: "404",
54
+    errorLog: "错误日志",
55
+    excel: "Excel",
56
+    exportExcel: "Export Excel",
57
+    selectExcel: "Export Selected",
58
+    uploadExcel: "Upload Excel",
59
+    zip: "Zip",
60
+    exportZip: "Export Zip",
61
+    theme: "换肤",
62
+    clipboardDemo: "Clipboard",
63
+    i18n: "国际化",
64
+    permissionManage: "权限管理",
65
+    adminManage: "用户管理",
66
+    roleManage: "角色管理",
67
+    dialysis: "透析管理",
68
+    paper: "透析管理",
69
+    advice: "今日医嘱",
70
+    prepare: "透析准备",
71
+    dialysisPrintOrder: "打印透析单",
72
+    details: "透析",
73
+    data_dictionary: "数据字典",
74
+    field_config: "字段配置",
75
+    template: "模版配置",
76
+    druguse: "医嘱模版",
77
+    watch: "透析监测",
78
+    addAdmin: "新增用户",
79
+    editAdmin: "编辑用户信息",
80
+    setupPerview: "设置权限",
81
+    user: "病人管理",
82
+    createPatient: "新增病人",
83
+    patientPage: "病人信息",
84
+    editPatient: "修改病人信息",
85
+    patient: "病人管理",
86
+    dialysisSolution: "透析处方",
87
+    inspection: "检验检查",
88
+    home: "首页",
89
+    weight: "干体重",
90
+    dialysisRecord: "透析记录",
91
+    scheduling: "排班信息",
92
+    proeducation: "宣教信息",
93
+    doctorAdvice: "医嘱信息",
94
+    dryWeight: "干体重",
95
+    device: "设备",
96
+    deviceManage: "设备管理",
97
+    modemanagement: "型号管理",
98
+    dialysisMachineManage: "设备管理",
99
+    workforce: "排班管理",
100
+    appointment: "排班管理",
101
+    sign: "治疗签到",
102
+    remind: "排班提醒",
103
+    signWeight: "签到称重",
104
+    deviceZoneManage: "分区管理",
105
+    deviceGroupManage: "分组管理",
106
+    deviceNumberManage: "床位管理",
107
+    service: "我的服务",
108
+    invoice: "发票管理",
109
+    invoiceApply: "申请发票",
110
+    servicePay: "立即支付",
111
+    serviceOrder: "购买服务",
112
+    payType: "选择支付方式",
113
+    weChatPay: "确认支付",
114
+    completeOrder: "购买结果",
115
+    orderRecord: "订单详情",
116
+    recordList: "订单记录",
117
+    stockManage: "库存管理",
118
+    goodType: "商品类型",
119
+    stockIn: "入库管理",
120
+    stockOut: "出库管理",
121
+    manufacturer: "厂家",
122
+    dealer: "经销商",
123
+    salesReturn: "退货",
124
+    salesReutrnRecord: "退货记录",
125
+    warehouseRecord: "入库记录",
126
+    addStockOut: "出库",
127
+    cancelStock: "出库退库",
128
+    cancelStockRecord: "退库记录",
129
+    stockOutRecord: "出库记录",
130
+    addStockIn: "入库",
131
+    stockQuery: "库存查询",
132
+    workforce_template: "排班模板设置",
133
+    statistics: "统计分析",
134
+    config: "库存配置",
135
+    goodInfo: "商品信息",
136
+    CourseOfDiseaseManage: "病程管理",
137
+    RescueRecord: "抢救记录",
138
+    special_permission_manage: "特殊权限管理",
139
+    schedule_print: "排班打印",
140 140
 
141
-    stockInOrder: '耗材入库单',
142
-    salesReturnOrder: '耗材退货单',
143
-    stockOutOrder: '耗材出库单',
144
-    cancelStockOrder: '耗材退库单',
145
-    otherStockInOrder: '其他入库单',
146
-    otherSalesReturnOrder: '其他退货单',
147
-    otherStockOutOrder: '其他出库单',
148
-    otherCancelStockOrder: '其他退库单',
149
-    stockInOrderAdd: '新增入库单',
150
-    salesReturnOrderAdd: '新增退货单',
151
-    stockOutOrderAdd: '新增出库单',
152
-    cancelStockOrderAdd: '新增退库单',
153
-    stockInDetail: '入库单详情',
154
-    salesReturnDetail: '退货单详情',
155
-    stockOutDetail: '出库单详情',
156
-    cancelStockDetail: '退库单详情',
157
-    stockDetail: '出入库明细查询',
141
+    warehouseReceipt: "出入库单",
142
+    warehouseReceiptOther: "其他出入库单",
143
+    stockInOrder: "耗材入库单",
144
+    salesReturnOrder: "耗材退货单",
145
+    stockOutOrder: "耗材出库单",
146
+    cancelStockOrder: "耗材退库单",
147
+    otherStockInOrder: "其他入库单",
148
+    otherSalesReturnOrder: "其他退货单",
149
+    otherStockOutOrder: "其他出库单",
150
+    otherCancelStockOrder: "其他退库单",
151
+    stockInOrderAdd: "新增入库单",
152
+    salesReturnOrderAdd: "新增退货单",
153
+    stockOutOrderAdd: "新增出库单",
154
+    cancelStockOrderAdd: "新增退库单",
155
+    stockInDetail: "入库单详情",
156
+    salesReturnDetail: "退货单详情",
157
+    stockOutDetail: "出库单详情",
158
+    cancelStockDetail: "退库单详情",
159
+    stockDetail: "出入库明细查询",
158 160
 
159
-    showconfig: '显示配置',
160
-    user_detail: '使用明细',
161
-    systemManage: '系统管理',
162
-    printTemplate: '打印模版',
163
-    data_upload: '一键上报',
164
-    fast_upload: '快捷上报',
165
-    export: '一键导出',
166
-    upload_config: '质控上报配置',
167
-    quality_control: '质控上报',
168
-    remind_print: '排版提醒打印',
169
-    system_prescription:"透析方案",
161
+    showconfig: "显示配置",
162
+    user_detail: "使用明细",
163
+    systemManage: "系统管理",
164
+    printTemplate: "打印模版",
165
+    data_upload: "一键上报",
166
+    fast_upload: "快捷上报",
167
+    export: "一键导出",
168
+    upload_config: "质控上报配置",
169
+    quality_control: "质控上报",
170
+    remind_print: "排版提醒打印",
171
+    system_prescription: "透析方案",
170 172
     integration_config: "集成配置",
171
-    his_config:"HIS集成配置",
172
-
173
+    his_config: "HIS集成配置"
173 174
   },
174 175
   navbar: {
175
-    logOut: '退出登录',
176
-    dashboard: '首页',
177
-    github: '项目地址',
178
-    screenfull: '全屏',
179
-    theme: '换肤'
176
+    logOut: "退出登录",
177
+    dashboard: "首页",
178
+    github: "项目地址",
179
+    screenfull: "全屏",
180
+    theme: "换肤"
180 181
   },
181 182
   login: {
182
-    title: '系统登录',
183
-    logIn: '登录',
184
-    username: '账号',
185
-    password: '密码',
186
-    any: '随便填',
187
-    thirdparty: '第三方登录',
188
-    thirdpartyTips: '本地不能模拟,请结合自己业务进行模拟!!!'
183
+    title: "系统登录",
184
+    logIn: "登录",
185
+    username: "账号",
186
+    password: "密码",
187
+    any: "随便填",
188
+    thirdparty: "第三方登录",
189
+    thirdpartyTips: "本地不能模拟,请结合自己业务进行模拟!!!"
189 190
   },
190 191
   documentation: {
191
-    documentation: '文档',
192
-    github: 'Github 地址'
192
+    documentation: "文档",
193
+    github: "Github 地址"
193 194
   },
194 195
   permission: {
195
-    roles: '你的权限',
196
-    switchRoles: '切换权限'
196
+    roles: "你的权限",
197
+    switchRoles: "切换权限"
197 198
   },
198 199
   guide: {
199
-    description: '引导页对于一些第一次进入项目的人很有用,你可以简单介绍下项目的功能。本 Demo 是基于',
200
-    button: '打开引导'
200
+    description:
201
+      "引导页对于一些第一次进入项目的人很有用,你可以简单介绍下项目的功能。本 Demo 是基于",
202
+    button: "打开引导"
201 203
   },
202 204
   components: {
203
-    documentation: '文档',
204
-    tinymceTips: '富文本是管理后台一个核心的功能,但同时又是一个有很多坑的地方。在选择富文本的过程中我也走了不少的弯路,市面上常见的富文本都基本用过了,最终权衡了一下选择了Tinymce。更详细的富文本比较和介绍见',
205
-    dropzoneTips: '由于我司业务有特殊需求,而且要传七牛 所以没用第三方,选择了自己封装。代码非常的简单,具体代码你可以在这里看到 @/components/Dropzone',
206
-    stickyTips: '当页面滚动到预设的位置会吸附在顶部',
207
-    backToTopTips1: '页面滚动到指定位置会在右下角出现返回顶部按钮',
208
-    backToTopTips2: '可自定义按钮的样式、show/hide、出现的高度、返回的位置 如需文字提示,可在外部使用Element的el-tooltip元素',
209
-    imageUploadTips: '由于我在使用时它只有vue@1版本,而且和mockjs不兼容,所以自己改造了一下,如果大家要使用的话,优先还是使用官方版本。'
205
+    documentation: "文档",
206
+    tinymceTips:
207
+      "富文本是管理后台一个核心的功能,但同时又是一个有很多坑的地方。在选择富文本的过程中我也走了不少的弯路,市面上常见的富文本都基本用过了,最终权衡了一下选择了Tinymce。更详细的富文本比较和介绍见",
208
+    dropzoneTips:
209
+      "由于我司业务有特殊需求,而且要传七牛 所以没用第三方,选择了自己封装。代码非常的简单,具体代码你可以在这里看到 @/components/Dropzone",
210
+    stickyTips: "当页面滚动到预设的位置会吸附在顶部",
211
+    backToTopTips1: "页面滚动到指定位置会在右下角出现返回顶部按钮",
212
+    backToTopTips2:
213
+      "可自定义按钮的样式、show/hide、出现的高度、返回的位置 如需文字提示,可在外部使用Element的el-tooltip元素",
214
+    imageUploadTips:
215
+      "由于我在使用时它只有vue@1版本,而且和mockjs不兼容,所以自己改造了一下,如果大家要使用的话,优先还是使用官方版本。"
210 216
   },
211 217
   table: {
212
-    dynamicTips1: '固定表头, 按照表头顺序排序',
213
-    dynamicTips2: '不固定表头, 按照点击顺序排序',
214
-    dragTips1: '默认顺序',
215
-    dragTips2: '拖拽后顺序',
216
-    title: '标题',
217
-    importance: '重要性',
218
-    type: '类型',
219
-    remark: '点评',
220
-    search: '搜索',
221
-    add: '新增',
222
-    export: '导出',
223
-    reviewer: '审核人',
224
-    id: '序号',
225
-    date: '时间',
226
-    author: '作者',
227
-    readings: '阅读数',
228
-    status: '状态',
229
-    actions: '操作',
230
-    edit: '编辑',
231
-    publish: '发布',
232
-    draft: '草稿',
233
-    delete: '删除',
234
-    cancel: '取 消',
235
-    confirm: '保 存'
218
+    dynamicTips1: "固定表头, 按照表头顺序排序",
219
+    dynamicTips2: "不固定表头, 按照点击顺序排序",
220
+    dragTips1: "默认顺序",
221
+    dragTips2: "拖拽后顺序",
222
+    title: "标题",
223
+    importance: "重要性",
224
+    type: "类型",
225
+    remark: "点评",
226
+    search: "搜索",
227
+    add: "新增",
228
+    export: "导出",
229
+    reviewer: "审核人",
230
+    id: "序号",
231
+    date: "时间",
232
+    author: "作者",
233
+    readings: "阅读数",
234
+    status: "状态",
235
+    actions: "操作",
236
+    edit: "编辑",
237
+    publish: "发布",
238
+    draft: "草稿",
239
+    delete: "删除",
240
+    cancel: "取 消",
241
+    confirm: "保 存"
236 242
   },
237 243
   errorLog: {
238
-    tips: '请点击右上角bug小图标',
239
-    description: '现在的管理后台基本都是spa的形式了,它增强了用户体验,但同时也会增加页面出问题的可能性,可能一个小小的疏忽就导致整个页面的死锁。好在 Vue 官网提供了一个方法来捕获处理异常,你可以在其中进行错误处理或者异常上报。',
240
-    documentation: '文档介绍'
244
+    tips: "请点击右上角bug小图标",
245
+    description:
246
+      "现在的管理后台基本都是spa的形式了,它增强了用户体验,但同时也会增加页面出问题的可能性,可能一个小小的疏忽就导致整个页面的死锁。好在 Vue 官网提供了一个方法来捕获处理异常,你可以在其中进行错误处理或者异常上报。",
247
+    documentation: "文档介绍"
241 248
   },
242 249
   excel: {
243
-    export: '导出',
244
-    selectedExport: '导出已选择项',
245
-    placeholder: '请输入文件名(默认excel-list)'
250
+    export: "导出",
251
+    selectedExport: "导出已选择项",
252
+    placeholder: "请输入文件名(默认excel-list)"
246 253
   },
247 254
   zip: {
248
-    export: '导出',
249
-    placeholder: '请输入文件名(默认file)'
255
+    export: "导出",
256
+    placeholder: "请输入文件名(默认file)"
250 257
   },
251 258
   theme: {
252
-    change: '换肤',
253
-    documentation: '换肤文档',
254
-    tips: 'Tips: 它区别于 navbar 上的 theme-pick, 是两种不同的换肤方法,各自有不同的应用场景,具体请参考文档。'
259
+    change: "换肤",
260
+    documentation: "换肤文档",
261
+    tips:
262
+      "Tips: 它区别于 navbar 上的 theme-pick, 是两种不同的换肤方法,各自有不同的应用场景,具体请参考文档。"
255 263
   },
256 264
   tagsView: {
257
-    close: '关闭',
258
-    closeOthers: '关闭其它',
259
-    closeAll: '关闭所有'
265
+    close: "关闭",
266
+    closeOthers: "关闭其它",
267
+    closeAll: "关闭所有"
260 268
   },
261 269
   data_config: {
262
-    patient: '病人管理',
263
-    scheduling: '排班管理',
264
-    device: '设备管理',
265
-    hemodialysis: '血透管理',
266
-    system: '系统配置',
267
-    education: '透后宣教',
268
-    summary: '透析小结',
269
-    config_name: '名称',
270
-    config_field: '字段名',
271
-    config_value: '字段值',
272
-    remark: '备注',
273
-    course_disease: '病程',
274
-    rescue_record: '抢救记录',
275
-    manage_ment: '设备管理'
270
+    patient: "病人管理",
271
+    scheduling: "排班管理",
272
+    device: "设备管理",
273
+    hemodialysis: "血透管理",
274
+    system: "系统配置",
275
+    education: "透后宣教",
276
+    summary: "透析小结",
277
+    config_name: "名称",
278
+    config_field: "字段名",
279
+    config_value: "字段值",
280
+    remark: "备注",
281
+    course_disease: "病程",
282
+    rescue_record: "抢救记录",
283
+    manage_ment: "设备管理"
276 284
   }
277
-}
285
+};

+ 154 - 110
src/router/modules/stock.js 查看文件

@@ -1,145 +1,189 @@
1
-import Layout from '@/views/layout/Layout'
1
+import Layout from "@/views/layout/Layout";
2 2
 
3 3
 export default {
4
-  path: '/stock/',
4
+  path: "/stock",
5 5
   component: Layout,
6
-  redirect: 'noredirect',
7
-  name: 'stockManage',
6
+  redirect: "noredirect",
7
+  name: "stockManage",
8 8
   alwaysShow: true,
9 9
   meta: {
10
-    title: 'stockManage',
11
-    icon: 'stock'
10
+    title: "stockManage",
11
+    icon: "stock",
12
+    isChild: true
12 13
   },
13 14
   children: [
14 15
     {
15
-      path: '/stock/in',
16
-      component: () => import('@/xt_pages/stock/stockInOrder'),
17
-      name: 'stockInOrder',
18
-      meta: { title: 'stockInOrder', noCache: true }
19
-    }, {
20
-      path: '/stock/return',
21
-      component: () => import('@/xt_pages/stock/salesReturnOrder'),
22
-      name: 'salesReturnOrder',
23
-      meta: { title: 'salesReturnOrder', noCache: true }
16
+      path: "/stock/a",
17
+      component: Layout,
18
+      redirect: "noredirect",
19
+      name: "warehouseReceipt",
20
+      meta: {
21
+        isChild: true,
22
+        title: "warehouseReceipt"
23
+      },
24
+      children: [
25
+        {
26
+          path: "/stock/a/in",
27
+          component: () => import("@/xt_pages/stock/stockInOrder"),
28
+          name: "stockInOrder",
29
+          meta: { title: "stockInOrder", noCache: true }
30
+        },
31
+        {
32
+          path: "/stock/return",
33
+          component: () => import("@/xt_pages/stock/salesReturnOrder"),
34
+          name: "salesReturnOrder",
35
+          meta: { title: "salesReturnOrder", noCache: true }
36
+        },
37
+        {
38
+          path: "/stock/out",
39
+          component: () => import("@/xt_pages/stock/stockOutOrder"),
40
+          name: "stockOutOrder",
41
+          meta: { title: "stockOutOrder", noCache: true }
42
+        },
43
+        {
44
+          path: "/stock/cancel",
45
+          component: () => import("@/xt_pages/stock/cancelStockOrder"),
46
+          name: "cancelStockOrder",
47
+          meta: { title: "cancelStockOrder", noCache: true }
48
+        }
49
+      ]
50
+    },
51
+    {
52
+      path: "/stock/",
53
+      component: Layout,
54
+      redirect: "noredirect",
55
+      name: "warehouseReceiptOther",
56
+      meta: {
57
+        isChild: true,
58
+        title: "warehouseReceiptOther"
59
+      },
60
+      children: [
61
+        {
62
+          path: "/stock/in/other",
63
+          component: () => import("@/xt_pages/stock/otherStockInOrder"),
64
+          name: "otherStockInOrder",
65
+          meta: { title: "otherStockInOrder", noCache: true }
66
+        },
67
+        {
68
+          path: "/stock/return/other",
69
+          component: () => import("@/xt_pages/stock/otherSalesReturnOrder"),
70
+          name: "otherSalesReturnOrder",
71
+          meta: { title: "otherSalesReturnOrder", noCache: true }
72
+        },
73
+        {
74
+          path: "/stock/out/other",
75
+          component: () => import("@/xt_pages/stock/otherStockOutOrder"),
76
+          name: "otherStockOutOrder",
77
+          meta: { title: "otherStockOutOrder", noCache: true }
78
+        },
79
+        {
80
+          path: "/stock/cancel/other",
81
+          component: () => import("@/xt_pages/stock/otherCancelStockOrder"),
82
+          name: "otherCancelStockOrder",
83
+          meta: { title: "otherCancelStockOrder", noCache: true }
84
+        }
85
+      ]
86
+    },
87
+    {
88
+      path: "/stock/query",
89
+      component: () => import("@/xt_pages/stock/stockQuery"),
90
+      name: "stockQuery",
91
+      meta: { title: "stockQuery", noCache: true }
92
+    },
93
+    {
94
+      path: "/stock/detail",
95
+      component: () => import("@/xt_pages/stock/stockDetailIndex"),
96
+      name: "stockDetail",
97
+      meta: { title: "stockDetail", noCache: true }
24 98
     },
25 99
     {
26
-      path: '/stock/out',
27
-      component: () => import('@/xt_pages/stock/stockOutOrder'),
28
-      name: 'stockOutOrder',
29
-      meta: { title: 'stockOutOrder', noCache: true }
30
-    }, {
31
-      path: '/stock/cancel',
32
-      component: () => import('@/xt_pages/stock/cancelStockOrder'),
33
-      name: 'cancelStockOrder',
34
-      meta: { title: 'cancelStockOrder', noCache: true }
35
-    }, {
36
-      path: '/stock/in/other',
37
-      component: () => import('@/xt_pages/stock/otherStockInOrder'),
38
-      name: 'otherStockInOrder',
39
-      meta: { title: 'otherStockInOrder', noCache: true }
40
-    }, {
41
-      path: '/stock/return/other',
42
-      component: () => import('@/xt_pages/stock/otherSalesReturnOrder'),
43
-      name: 'otherSalesReturnOrder',
44
-      meta: { title: 'otherSalesReturnOrder', noCache: true }
45
-    }, {
46
-      path: '/stock/out/other',
47
-      component: () => import('@/xt_pages/stock/otherStockOutOrder'),
48
-      name: 'otherStockOutOrder',
49
-      meta: { title: 'otherStockOutOrder', noCache: true }
50
-    }, {
51
-      path: '/stock/cancel/other',
52
-      component: () => import('@/xt_pages/stock/otherCancelStockOrder'),
53
-      name: 'otherCancelStockOrder',
54
-      meta: { title: 'otherCancelStockOrder', noCache: true }
55
-    }, {
56
-      path: '/stock/query',
57
-      component: () => import('@/xt_pages/stock/stockQuery'),
58
-      name: 'stockQuery',
59
-      meta: { title: 'stockQuery', noCache: true  }
60
-    }, {
61
-      path: '/stock/detail',
62
-      component: () => import('@/xt_pages/stock/stockDetailIndex'),
63
-      name: 'stockDetail',
64
-      meta: { title: 'stockDetail', noCache: true  }
65
-    }, {
66
-      path: '/stock/in/add',
67
-      component: () => import('@/xt_pages/stock/stockInOrderAdd'),
68
-      name: 'stockInOrderAdd',
100
+      path: "/stock/in/add",
101
+      component: () => import("@/xt_pages/stock/stockInOrderAdd"),
102
+      name: "stockInOrderAdd",
69 103
       hidden: true,
70 104
       is_menu: false,
71
-      meta: { title: 'stockInOrderAdd', noCache: true }
72
-    }, {
73
-      path: '/stock/in/detail',
74
-      component: () => import('@/xt_pages/stock/stockInDetail'),
75
-      name: 'stockInDetail',
105
+      meta: { title: "stockInOrderAdd", noCache: true }
106
+    },
107
+    {
108
+      path: "/stock/in/detail",
109
+      component: () => import("@/xt_pages/stock/stockInDetail"),
110
+      name: "stockInDetail",
76 111
       hidden: true,
77 112
       is_menu: false,
78
-      meta: { title: 'stockInDetail', noCache: true  }
79
-    }, {
80
-      path: '/stock/return/detail',
81
-      component: () => import('@/xt_pages/stock/salesReturnDetail'),
82
-      name: 'salesReturnDetail',
113
+      meta: { title: "stockInDetail", noCache: true }
114
+    },
115
+    {
116
+      path: "/stock/return/detail",
117
+      component: () => import("@/xt_pages/stock/salesReturnDetail"),
118
+      name: "salesReturnDetail",
83 119
       hidden: true,
84 120
       is_menu: false,
85
-      meta: { title: 'salesReturnDetail', noCache: true  }
86
-    }, {
87
-      path: '/stock/return/add',
88
-      component: () => import('@/xt_pages/stock/salesReturnOrderAdd'),
89
-      name: 'salesReturnOrderAdd',
121
+      meta: { title: "salesReturnDetail", noCache: true }
122
+    },
123
+    {
124
+      path: "/stock/return/add",
125
+      component: () => import("@/xt_pages/stock/salesReturnOrderAdd"),
126
+      name: "salesReturnOrderAdd",
90 127
       hidden: true,
91 128
       is_menu: false,
92
-      meta: { title: 'salesReturnOrderAdd', noCache: true }
93
-    }, {
94
-      path: '/stock/out/add',
95
-      component: () => import('@/xt_pages/stock/stockOutOrderAdd'),
96
-      name: 'stockOutOrderAdd',
129
+      meta: { title: "salesReturnOrderAdd", noCache: true }
130
+    },
131
+    {
132
+      path: "/stock/out/add",
133
+      component: () => import("@/xt_pages/stock/stockOutOrderAdd"),
134
+      name: "stockOutOrderAdd",
97 135
       hidden: true,
98 136
       is_menu: false,
99
-      meta: { title: 'stockOutOrderAdd', noCache: true }
100
-    }, {
101
-      path: '/stock/out/detail',
102
-      component: () => import('@/xt_pages/stock/stockOutDetail'),
103
-      name: 'stockOutDetail',
137
+      meta: { title: "stockOutOrderAdd", noCache: true }
138
+    },
139
+    {
140
+      path: "/stock/out/detail",
141
+      component: () => import("@/xt_pages/stock/stockOutDetail"),
142
+      name: "stockOutDetail",
104 143
       hidden: true,
105 144
       is_menu: false,
106
-      meta: { title: 'stockOutDetail', noCache: true }
107
-    }, {
108
-      path: '/stock/cancel/add',
109
-      component: () => import('@/xt_pages/stock/cancelStockOrderAdd'),
110
-      name: 'cancelStockOrderAdd',
145
+      meta: { title: "stockOutDetail", noCache: true }
146
+    },
147
+    {
148
+      path: "/stock/cancel/add",
149
+      component: () => import("@/xt_pages/stock/cancelStockOrderAdd"),
150
+      name: "cancelStockOrderAdd",
111 151
       hidden: true,
112 152
       is_menu: false,
113
-      meta: { title: 'cancelStockOrderAdd', noCache: true }
114
-    }, {
115
-      path: '/stock/cancel/detail',
116
-      component: () => import('@/xt_pages/stock/cancelStockDetail'),
117
-      name: 'cancelStockDetail',
153
+      meta: { title: "cancelStockOrderAdd", noCache: true }
154
+    },
155
+    {
156
+      path: "/stock/cancel/detail",
157
+      component: () => import("@/xt_pages/stock/cancelStockDetail"),
158
+      name: "cancelStockDetail",
118 159
       hidden: true,
119 160
       is_menu: false,
120
-      meta: { title: 'cancelStockDetail', noCache: true }
121
-    }, {
122
-      path: '/stock/config',
123
-      component: () => import('@/xt_pages/stock/index'),
124
-      name: 'config',
125
-      meta: { title: 'config', noCache: true  }
126
-    }, {
127
-      path: '/stock/print',
128
-      component: () => import('@/xt_pages/stock/detail/print'),
161
+      meta: { title: "cancelStockDetail", noCache: true }
162
+    },
163
+    {
164
+      path: "/stock/config",
165
+      component: () => import("@/xt_pages/stock/index"),
166
+      name: "config",
167
+      meta: { title: "config", noCache: true }
168
+    },
169
+    {
170
+      path: "/stock/print",
171
+      component: () => import("@/xt_pages/stock/detail/print"),
129 172
       hidden: true,
130 173
       is_menu: false,
131
-      name: 'stock_print',
174
+      name: "stock_print",
132 175
       meta: {
133
-        title: '库存打印',
176
+        title: "库存打印",
134 177
         noCache: true
135 178
       }
136
-    },{
137
-      path: '/stock/user/detail',
138
-      component: () => import('@/xt_pages/stock/stockUserDetail'),
139
-      name: 'user_detail',
179
+    },
180
+    {
181
+      path: "/stock/user/detail",
182
+      component: () => import("@/xt_pages/stock/stockUserDetail"),
183
+      name: "user_detail",
140 184
       hidden: true,
141 185
       is_menu: false,
142
-      meta: { title: 'user_detail', noCache: true  }
186
+      meta: { title: "user_detail", noCache: true }
143 187
     }
144 188
   ]
145
-}
189
+};

+ 44 - 43
src/styles/sidebar.scss 查看文件

@@ -2,7 +2,7 @@
2 2
   // 主体区域
3 3
   .main-container {
4 4
     min-height: 100%;
5
-    transition: margin-left .28s;
5
+    transition: margin-left 0.28s;
6 6
     margin-left: 150px;
7 7
     position: relative;
8 8
   }
@@ -20,10 +20,11 @@
20 20
     overflow: hidden;
21 21
     //reset element-ui css
22 22
     .horizontal-collapse-transition {
23
-      transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
23
+      transition: 0s width ease-in-out, 0s padding-left ease-in-out,
24
+        0s padding-right ease-in-out;
24 25
     }
25 26
     .scrollbar-wrapper {
26
-      overflow-x: hidden!important;
27
+      overflow-x: hidden !important;
27 28
       .el-scrollbar__view {
28 29
         height: 100%;
29 30
         .hamburger-container {
@@ -51,45 +52,45 @@
51 52
       width: 100% !important;
52 53
     }
53 54
   }
54
-  .hideSidebar {
55
-    .sidebar-container {
56
-      width: 36px !important;
57
-    }
58
-    .main-container {
59
-      margin-left: 36px;
60
-    }
61
-    .submenu-title-noDropdown {
62
-      padding-left: 10px !important;
63
-      position: relative;
64
-      .el-tooltip {
65
-        padding: 0 10px !important;
66
-      }
67
-    }
68
-    .el-submenu {
69
-      overflow: hidden;
70
-      &>.el-submenu__title {
71
-        padding-left: 10px !important;
72
-        
73
-        .el-submenu__icon-arrow {
74
-          display: none;
75
-        }
76
-      }
77
-    }
78
-    .el-menu--collapse {
79
-      .el-submenu {
80
-        &>.el-submenu__title {
81
-          &>span {
82
-            height: 0;
83
-            width: 0;
84
-            overflow: hidden;
85
-            visibility: hidden;
86
-            display: inline-block;
87
-          }
88
-        }
89
-      }
90
-    }
91
-  }
92
-  .sidebar-container .nest-menu .el-submenu>.el-submenu__title,
55
+  // .hideSidebar {
56
+  //   .sidebar-container {
57
+  //     width: 36px !important;
58
+  //   }
59
+  //   // .main-container {
60
+  //   //   margin-left: 36px;
61
+  //   // }
62
+  //   .submenu-title-noDropdown {
63
+  //     padding-left: 10px !important;
64
+  //     position: relative;
65
+  //     .el-tooltip {
66
+  //       padding: 0 10px !important;
67
+  //     }
68
+  //   }
69
+  //   .el-submenu {
70
+  //     overflow: hidden;
71
+  //     & > .el-submenu__title {
72
+  //       padding-left: 10px !important;
73
+
74
+  //       .el-submenu__icon-arrow {
75
+  //         display: none;
76
+  //       }
77
+  //     }
78
+  //   }
79
+  //   .el-menu--collapse {
80
+  //     .el-submenu {
81
+  //       & > .el-submenu__title {
82
+  //         & > span {
83
+  //           height: 0;
84
+  //           width: 0;
85
+  //           overflow: hidden;
86
+  //           visibility: hidden;
87
+  //           display: inline-block;
88
+  //         }
89
+  //       }
90
+  //     }
91
+  //   }
92
+  // }
93
+  .sidebar-container .nest-menu .el-submenu > .el-submenu__title,
93 94
   .sidebar-container .el-submenu .el-menu-item {
94 95
     // min-width: 180px !important;
95 96
     background-color: $subMenuBg !important;
@@ -107,7 +108,7 @@
107 108
       margin-left: 0px;
108 109
     }
109 110
     .sidebar-container {
110
-      transition: transform .28s;
111
+      transition: transform 0.28s;
111 112
       width: 180px !important;
112 113
     }
113 114
     &.hideSidebar {

+ 60 - 36
src/views/layout/Layout.vue 查看文件

@@ -1,24 +1,29 @@
1 1
 <template>
2 2
   <div class="app-wrapper" :class="classObj">
3
-    <div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"></div>
4
-      <navbar></navbar>
3
+    <div
4
+      v-if="device === 'mobile' && sidebar.opened"
5
+      class="drawer-bg"
6
+      @click="handleClickOutside"
7
+    ></div>
8
+    <navbar></navbar>
5 9
 
6 10
     <div class="Header-container">
7
-    <sidebar class="sidebar-container"></sidebar>
8
-    <div class="main-container">
9
-      <tags-view></tags-view>
10
-      <app-main></app-main>
11
+      <sidebar class="sidebar-container" @callBackIndex="handleIndex"></sidebar>
12
+      <!-- <sidebar class="newSide" @callBackIndex="handleIndex"></sidebar> -->
13
+      <div class="main-container">
14
+        <tags-view :index="index"></tags-view>
15
+        <app-main></app-main>
16
+      </div>
11 17
     </div>
12
-   </div>
13 18
   </div>
14 19
 </template>
15 20
 
16 21
 <script>
17
-import { Navbar, Sidebar, AppMain, TagsView } from './components'
18
-import ResizeMixin from './mixin/ResizeHandler'
22
+import { Navbar, Sidebar, AppMain, TagsView } from "./components";
23
+import ResizeMixin from "./mixin/ResizeHandler";
19 24
 
20 25
 export default {
21
-  name: 'layout',
26
+  name: "layout",
22 27
   components: {
23 28
     Navbar,
24 29
     Sidebar,
@@ -28,47 +33,66 @@ export default {
28 33
   mixins: [ResizeMixin],
29 34
   computed: {
30 35
     sidebar() {
31
-      return this.$store.state.app.sidebar
36
+      return this.$store.state.app.sidebar;
32 37
     },
33 38
     device() {
34
-      return this.$store.state.app.device
39
+      return this.$store.state.app.device;
35 40
     },
36 41
     classObj() {
37 42
       return {
38 43
         hideSidebar: !this.sidebar.opened,
39 44
         openSidebar: this.sidebar.opened,
40 45
         withoutAnimation: this.sidebar.withoutAnimation,
41
-        mobile: this.device === 'mobile'
42
-      }
46
+        mobile: this.device === "mobile"
47
+      };
43 48
     }
44 49
   },
50
+  data() {
51
+    return {
52
+      index: 0
53
+    };
54
+  },
45 55
   methods: {
46 56
     handleClickOutside() {
47
-      this.$store.dispatch('closeSideBar', { withoutAnimation: false })
57
+      this.$store.dispatch("closeSideBar", { withoutAnimation: false });
58
+    },
59
+    handleIndex(data) {
60
+      // console.log({ prop: data });
61
+      this.index = data;
48 62
     }
49 63
   }
50
-}
64
+};
51 65
 </script>
52 66
 
53 67
 <style rel="stylesheet/scss" lang="scss" scoped>
54
-  @import "src/styles/mixin.scss";
55
-  .app-wrapper {
56
-    @include clearfix;
57
-    // position: relative;
58
-    height: 100%;
59
-    width: 100%;
60
-    // &.mobile.openSidebar{
61
-    //   position: fixed;
62
-    //   top: 0;
63
-    // }
64
-  }
65
-  .drawer-bg {
66
-    background: #000;
67
-    opacity: 0.3;
68
-    width: 100%;
69
-    top: 0;
70
-    height: 100%;
71
-    position: absolute;
72
-    z-index: 999;
73
-  }
68
+@import "src/styles/mixin.scss";
69
+.app-wrapper {
70
+  @include clearfix;
71
+  // position: relative;
72
+  height: 100%;
73
+  width: 100%;
74
+  // &.mobile.openSidebar{
75
+  //   position: fixed;
76
+  //   top: 0;
77
+  // }
78
+}
79
+.drawer-bg {
80
+  background: #000;
81
+  opacity: 0.3;
82
+  width: 100%;
83
+  top: 0;
84
+  height: 100%;
85
+  position: absolute;
86
+  z-index: 999;
87
+}
88
+.newSide {
89
+  width: 150px !important;
90
+  height: 100%;
91
+  position: fixed;
92
+  top: 60px;
93
+  bottom: 0;
94
+  left: 0;
95
+  z-index: 1001;
96
+  overflow: hidden;
97
+}
74 98
 </style>

+ 169 - 29
src/views/layout/components/Sidebar/SidebarItem.vue 查看文件

@@ -1,40 +1,129 @@
1 1
 <template>
2
-  <div v-if="!item.hidden&&item.children" class="menu-wrapper">
3
-
4
-      <router-link v-if="hasOneShowingChild(item.children) && !onlyOneChild.children&&!item.alwaysShow" :to="resolvePath(onlyOneChild.path)">
5
-        <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
6
-          <svg-icon v-if="onlyOneChild.meta&&onlyOneChild.meta.icon" :icon-class="onlyOneChild.meta.icon"></svg-icon>
7
-          <span v-if="onlyOneChild.meta&&onlyOneChild.meta.title" slot="title">{{generateTitle(onlyOneChild.meta.title)}}</span>
2
+  <div v-if="!item.hidden && item.children" class="menu-wrapper">
3
+    <div
4
+      v-if="
5
+        hasOneShowingChild(item.children) &&
6
+          !onlyOneChild.children &&
7
+          !item.alwaysShow
8
+      "
9
+      @click="onClick(item)"
10
+    >
11
+      <router-link :to="resolvePath(onlyOneChild.path)">
12
+        <el-menu-item
13
+          :index="resolvePath(onlyOneChild.path)"
14
+          :class="{ 'submenu-title-noDropdown': !isNest }"
15
+        >
16
+          <svg-icon
17
+            v-if="onlyOneChild.meta && onlyOneChild.meta.icon"
18
+            :icon-class="onlyOneChild.meta.icon"
19
+          ></svg-icon>
20
+          <span
21
+            v-if="onlyOneChild.meta && onlyOneChild.meta.title"
22
+            slot="title"
23
+            >{{ generateTitle(onlyOneChild.meta.title) }}</span
24
+          >
8 25
         </el-menu-item>
9 26
       </router-link>
27
+    </div>
10 28
 
11
-      <el-submenu v-else :index="item.name||item.path">
29
+    <div v-else>
30
+      <el-submenu
31
+        v-if="item.meta.isChild"
32
+        id="mySubmenu"
33
+        :index="item.name || item.path"
34
+      >
12 35
         <template slot="title">
13
-          <svg-icon v-if="item.meta&&item.meta.icon" :icon-class="item.meta.icon"></svg-icon>
14
-          <span v-if="item.meta&&item.meta.title" slot="title">{{generateTitle(item.meta.title)}}</span>
36
+          <svg-icon
37
+            v-if="item.meta && item.meta.icon"
38
+            :icon-class="item.meta.icon"
39
+          ></svg-icon>
40
+          <span v-if="item.meta && item.meta.title" slot="title">{{
41
+            generateTitle(item.meta.title)
42
+          }}</span>
15 43
         </template>
16
-
17 44
         <template v-for="child in item.children" v-if="!child.hidden">
18
-          <sidebar-item :is-nest="true" class="nest-menu" v-if="child.children&&child.children.length>0" :item="child" :key="child.path" :base-path="resolvePath(child.path)"></sidebar-item>
45
+          <router-link
46
+            :to="resolvePath(child.path)"
47
+            v-if="child.meta.isChild != true"
48
+            :key="child.name"
49
+          >
50
+            <el-menu-item :index="resolvePath(child.path)">
51
+              <svg-icon
52
+                v-if="child.meta && child.meta.icon"
53
+                :icon-class="child.meta.icon"
54
+              ></svg-icon>
55
+              <span v-if="child.meta && child.meta.title" slot="title">{{
56
+                generateTitle(child.meta.title)
57
+              }}</span>
58
+            </el-menu-item>
59
+          </router-link>
19 60
 
20
-          <router-link v-else :to="resolvePath(child.path)" :key="child.name">
61
+          <router-link
62
+            v-else
63
+            :to="resolvePath(child.children[0].path)"
64
+            :key="child.name"
65
+          >
21 66
             <el-menu-item :index="resolvePath(child.path)">
22
-              <svg-icon v-if="child.meta&&child.meta.icon" :icon-class="child.meta.icon"></svg-icon>
23
-              <span v-if="child.meta&&child.meta.title" slot="title">{{generateTitle(child.meta.title)}}</span>
67
+              <svg-icon
68
+                v-if="child.meta && child.meta.icon"
69
+                :icon-class="child.meta.icon"
70
+              ></svg-icon>
71
+              <span v-if="child.meta && child.meta.title" slot="title">{{
72
+                generateTitle(child.meta.title)
73
+              }}</span>
24 74
             </el-menu-item>
25 75
           </router-link>
26 76
         </template>
27 77
       </el-submenu>
78
+      <div v-else @click="onClick(item)">
79
+        <router-link :to="resolvePath(item.children[0].path)">
80
+          <el-menu-item :index="item.name || item.path">
81
+            <template slot="title">
82
+              <svg-icon
83
+                v-if="item.meta && item.meta.icon"
84
+                :icon-class="item.meta.icon"
85
+              ></svg-icon>
86
+              <span v-if="item.meta && item.meta.title" slot="title">{{
87
+                generateTitle(item.meta.title)
88
+              }}</span>
89
+            </template>
90
+
91
+            <!-- <template v-for="child in item.children" v-if="!child.hidden">
92
+        <sidebar-item
93
+          :is-nest="true"
94
+          class="nest-menu"
95
+          v-if="child.children && child.children.length > 0"
96
+          :item="child"
97
+          :key="child.path"
98
+          :base-path="resolvePath(child.path)"
99
+        ></sidebar-item>
28 100
 
101
+        <router-link v-else :to="resolvePath(child.path)" :key="child.name">
102
+          <el-menu-item :index="resolvePath(child.path)">
103
+            <svg-icon
104
+              v-if="child.meta && child.meta.icon"
105
+              :icon-class="child.meta.icon"
106
+            ></svg-icon>
107
+            <span v-if="child.meta && child.meta.title" slot="title">{{
108
+              generateTitle(child.meta.title)
109
+            }}</span>
110
+          </el-menu-item>
111
+        </router-link>
112
+      </template> -->
113
+          </el-menu-item>
114
+        </router-link>
115
+      </div>
116
+    </div>
29 117
   </div>
30 118
 </template>
31 119
 
32 120
 <script>
33
-import path from 'path'
34
-import { generateTitle } from '@/utils/i18n'
121
+import path from "path";
122
+import { generateTitle } from "@/utils/i18n";
123
+import { mapGetters } from "vuex";
35 124
 
36 125
 export default {
37
-  name: 'SidebarItem',
126
+  name: "SidebarItem",
38 127
   props: {
39 128
     // route object
40 129
     item: {
@@ -47,35 +136,86 @@ export default {
47 136
     },
48 137
     basePath: {
49 138
       type: String,
50
-      default: ''
139
+      default: ""
140
+    },
141
+    index: {
142
+      type: Number
51 143
     }
52 144
   },
145
+  computed: {
146
+    ...mapGetters(["permission_routers"])
147
+  },
53 148
   data() {
54 149
     return {
55 150
       onlyOneChild: null
56
-    }
151
+    };
57 152
   },
58 153
   methods: {
59 154
     hasOneShowingChild(children) {
60 155
       const showingChildren = children.filter(item => {
61 156
         if (item.hidden) {
62
-          return false
157
+          return false;
63 158
         } else {
64 159
           // temp set(will be used if only has one showing child )
65
-          this.onlyOneChild = item
66
-          return true
160
+          this.onlyOneChild = item;
161
+          return true;
67 162
         }
68
-      })
163
+      });
69 164
       if (showingChildren.length === 1) {
70
-        return true
165
+        return true;
71 166
       }
72
-      return false
167
+      return false;
73 168
     },
74 169
     resolvePath(...paths) {
75
-      return path.resolve(this.basePath, ...paths)
170
+      return path.resolve(this.basePath, ...paths);
76 171
     },
77
-    generateTitle
78
-  }
79
-}
172
+    generateTitle,
173
+    onClick(index) {
174
+      this.permission_routers.map((item, i) => {
175
+        if (this.isObjectValueEqual(item, index)) {
176
+          this.$emit("a", i);
177
+        }
178
+      });
179
+    },
180
+    isObjectValueEqual(a, b) {
181
+      var aProps = Object.getOwnPropertyNames(a);
182
+      var bProps = Object.getOwnPropertyNames(b);
183
+
184
+      if (aProps.length != bProps.length) {
185
+        return false;
186
+      }
187
+
188
+      for (var i = 0; i < aProps.length; i++) {
189
+        var propName = aProps[i];
190
+
191
+        if (a[propName] !== b[propName]) {
192
+          return false;
193
+        }
194
+      }
195
+
196
+      return true;
197
+    }
198
+  },
199
+  created() {}
200
+};
80 201
 </script>
81 202
 
203
+<style lang="scss">
204
+#mySubmenu {
205
+  .el-menu {
206
+    display: flex;
207
+    flex-wrap: wrap;
208
+    > a:nth-child(odd) {
209
+      width: 40% !important;
210
+    }
211
+    > a:nth-child(even) {
212
+      width: 60% !important;
213
+    }
214
+    .el-menu-item {
215
+      min-width: 0;
216
+      padding: 0 5px !important;
217
+      font-size: 12px;
218
+    }
219
+  }
220
+}
221
+</style>

+ 155 - 45
src/views/layout/components/Sidebar/index.vue 查看文件

@@ -1,9 +1,13 @@
1 1
 <template>
2 2
   <el-scrollbar wrapClass="scrollbar-wrapper">
3
-    <div class="sideColumn">
4
-       <hamburger class="hamburger-container" :toggleClick="toggleSideBar" :isActive="sidebar.opened"></hamburger>      
5
-    </div>
6
-    <el-menu
3
+    <!-- <div class="sideColumn">
4
+      <hamburger
5
+        class="hamburger-container"
6
+        :toggleClick="toggleSideBar"
7
+        :isActive="sidebar.opened"
8
+      ></hamburger>
9
+    </div> -->
10
+    <!-- <el-menu
7 11
       mode="vertical"
8 12
       :unique-opened="uniqueOpened"
9 13
       :show-timeout="200"
@@ -12,77 +16,183 @@
12 16
       background-color="#304156"
13 17
       text-color="#bfcbd9"
14 18
       active-text-color="#409EFF"
19
+    > -->
20
+    <el-menu
21
+      mode="vertical"
22
+      :unique-opened="uniqueOpened"
23
+      :show-timeout="200"
24
+      :default-active="$route.path"
25
+      background-color="#304156"
26
+      text-color="#bfcbd9"
27
+      active-text-color="#409EFF"
15 28
     >
16
-      <sidebar-item v-for="route in permission_routers" :key="route.name" :item="route" :base-path="route.path"></sidebar-item>
29
+      <sidebar-item
30
+        v-for="(route, index) in permission_routers"
31
+        :key="route.name"
32
+        :item="route"
33
+        :base-path="route.path"
34
+        :index="index"
35
+        @a="b"
36
+      ></sidebar-item>
17 37
     </el-menu>
18 38
   </el-scrollbar>
39
+  <!-- <div class="mianLeft">
40
+    <div class="logo">
41
+      <img src="/static/img/logo.8dbb9fd.png" alt="" />
42
+    </div>
43
+    <div class="navBox">
44
+      <div
45
+        class="navOne"
46
+        :class="activeClass == index ? 'active' : ''"
47
+        v-for="(item, index) in permission_routers"
48
+        :key="item.name"
49
+        v-if="!item.hidden && item.children"
50
+      >
51
+        <div v-if="item.meta" @click="onClick(index)" class="one">
52
+          <router-link :to="item.children[0].path">
53
+          <svg-icon
54
+            v-if="item.meta && item.meta.icon"
55
+            :icon-class="item.meta.icon"
56
+          ></svg-icon>
57
+          <p v-if="item.meta && item.meta.title">
58
+            {{ generateTitle(item.meta.title) }}
59
+          </p>
60
+          </router-link>
61
+        </div>
62
+
63
+        <div v-else @click="onClick(index)">
64
+          <router-link :to="item.children[0].path" class="one">
65
+            <svg-icon :icon-class="item.children[0].meta.icon"></svg-icon>
66
+            <p>
67
+              {{ generateTitle(item.children[0].meta.title) }}
68
+            </p>
69
+          </router-link>
70
+        </div>
71
+      </div>
72
+    </div>
73
+  </div> -->
19 74
 </template>
20 75
 
21 76
 <script>
22 77
 import { mapGetters } from "vuex";
23 78
 import SidebarItem from "./SidebarItem";
24 79
 import Hamburger from "@/components/Hamburger";
25
-
80
+import { generateTitle } from "@/utils/i18n";
26 81
 
27 82
 export default {
28
-  components: { SidebarItem,Hamburger },
83
+  components: { SidebarItem, Hamburger },
29 84
   computed: {
30 85
     ...mapGetters(["permission_routers", "sidebar"]),
31 86
     isCollapse() {
32 87
       return !this.sidebar.opened;
33 88
     }
34 89
   },
35
-  data(){
36
-    return{
37
-      uniqueOpened:true,
38
-    }
90
+  data() {
91
+    return {
92
+      uniqueOpened: true,
93
+      activeClass: 0,
94
+      index: 0
95
+    };
39 96
   },
40
-  methods:{
97
+  methods: {
41 98
     toggleSideBar() {
42 99
       this.$store.dispatch("toggleSideBar");
43 100
     },
101
+    generateTitle,
102
+    resolvePath(...paths) {
103
+      return path.resolve(this.basePath, ...paths);
104
+    },
105
+    b(index) {
106
+      // console.log(index);
107
+      // this.index = index;
108
+      // this.activeClass = index;
109
+      this.$emit("callBackIndex", index);
110
+    }
111
+  },
112
+  created() {
113
+    console.log(1111111121121111111, this.permission_routers);
114
+    // this.permission_routers.map(item => {
115
+    //   console.log(item.children);
116
+    // });
44 117
   }
45 118
 };
46 119
 </script>
47 120
 
48
-<style  rel="stylesheet/scss" lang="scss" scoped>
49
-.sideColumn{
50
-  background-color: rgb(48, 65, 86);
51
-.head {
52
-  text-align: center;
53
-  padding: 20px 0 0 0;
54
-  .tx {
55
-    .img {
56
-      width: 45px;
57
-      height: 45px;
58
-      border-radius: 50%;
59
-      -o-object-fit: cover;
60
-    object-fit: cover;
61
-    -o-object-position: center;
62
-    object-position: center;
121
+<style rel="stylesheet/scss" lang="scss" scoped>
122
+.mianLeft {
123
+  width: 150px;
124
+  height: 100%;
125
+  overflow-y: auto;
126
+  background: #304155;
127
+  .logo {
128
+    width: 100px;
129
+    height: 32px;
130
+    margin: 20px auto 0;
131
+    img {
132
+      width: 100%;
133
+      height: 100%;
134
+      display: block;
63 135
     }
64
-  } 
65
-  .title {
66
-    font-size: 14px;
67
-    color: #bfcbd9;
68
-    padding: 10px 10px 15px 10px;
69
-    line-height: 22px;
70
-
71 136
   }
72
-}
73
-.headShrink{
74
-  .tx{
75
-    .img{
76
-      width: 30px;
77
-      height: 30px;
137
+  .navBox {
138
+    display: flex;
139
+    flex-wrap: wrap;
140
+    .navOne {
141
+      width: 50%;
142
+      height: 75px;
143
+      display: flex;
144
+      align-items: center;
145
+      justify-content: space-around;
146
+      color: #fff;
147
+      .one {
148
+        display: flex;
149
+        align-items: center;
150
+        flex-direction: column;
151
+        p {
152
+          margin-top: 10px;
153
+          font-size: 14px;
154
+        }
155
+      }
156
+    }
157
+    .active {
158
+      background: #409eff;
78 159
     }
160
+  }
161
+}
79 162
 
163
+.sideColumn {
164
+  background-color: rgb(48, 65, 86);
165
+  .head {
166
+    text-align: center;
167
+    padding: 20px 0 0 0;
168
+    .tx {
169
+      .img {
170
+        width: 45px;
171
+        height: 45px;
172
+        border-radius: 50%;
173
+        -o-object-fit: cover;
174
+        object-fit: cover;
175
+        -o-object-position: center;
176
+        object-position: center;
177
+      }
178
+    }
179
+    .title {
180
+      font-size: 14px;
181
+      color: #bfcbd9;
182
+      padding: 10px 10px 15px 10px;
183
+      line-height: 22px;
184
+    }
80 185
   }
81
-  .title{
82
-    display: none;
186
+  .headShrink {
187
+    .tx {
188
+      .img {
189
+        width: 30px;
190
+        height: 30px;
191
+      }
192
+    }
193
+    .title {
194
+      display: none;
195
+    }
83 196
   }
84 197
 }
85
-}
86
-
87 198
 </style>
88
-

+ 84 - 17
src/views/layout/components/TagsView.vue 查看文件

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <div class="tags-view-container">
3
-    <scroll-pane class="tags-view-wrapper" ref="scrollPane">
3
+    <!-- <scroll-pane class="tags-view-wrapper" ref="scrollPane">
4 4
       <router-link
5 5
         ref="tag"
6 6
         class="tags-view-item"
@@ -25,44 +25,86 @@
25 25
       <li @click="closeSelectedTag(selectedTag)">{{ $t("tagsView.close") }}</li>
26 26
       <li @click="closeOthersTags">{{ $t("tagsView.closeOthers") }}</li>
27 27
       <li @click="closeAllTags">{{ $t("tagsView.closeAll") }}</li>
28
-    </ul>
28
+    </ul> -->
29
+    <div class="tags-view-wrapper">
30
+      <div class="tagsBox">
31
+        <div
32
+          class="tagsOne"
33
+          v-if="permission_routers[newIndex].meta"
34
+          v-for="(item, i) in permission_routers[newIndex].children"
35
+          :key="i"
36
+        >
37
+          <router-link :to="item.path" v-if="!item.hidden && !item.is_menu">
38
+            <p
39
+              class="newTags"
40
+              :class="activeClass == i ? 'active' : ''"
41
+              @click="onClick(i)"
42
+            >
43
+              {{ generateTitle(item.meta.title) }}
44
+            </p>
45
+          </router-link>
46
+        </div>
47
+        <div v-else class="tagsOne">
48
+          <p
49
+            class="newTags"
50
+            :class="activeClass == i ? 'active' : ''"
51
+            @click="onClick(i)"
52
+          >
53
+            {{
54
+              generateTitle(permission_routers[newIndex].children[0].meta.title)
55
+            }}
56
+          </p>
57
+        </div>
58
+      </div>
59
+    </div>
29 60
   </div>
30 61
 </template>
31 62
 
32 63
 <script>
33 64
 import ScrollPane from "@/components/ScrollPane";
34 65
 import { generateTitle } from "@/utils/i18n";
66
+//
67
+import { mapGetters } from "vuex";
35 68
 
36 69
 export default {
70
+  props: ["index"],
37 71
   components: { ScrollPane },
38 72
   data() {
39 73
     return {
40 74
       visible: false,
41 75
       top: 0,
42 76
       left: 0,
43
-      selectedTag: {}
77
+      selectedTag: {},
78
+      newIndex: 0,
79
+      activeClass: ""
44 80
     };
45 81
   },
46 82
   computed: {
47
-    visitedViews() {
48
-      return this.$store.state.tagsView.visitedViews;
49
-    }
83
+    // visitedViews() {
84
+    //   return this.$store.state.tagsView.visitedViews;
85
+    // },
86
+    ...mapGetters(["permission_routers"])
50 87
   },
51 88
   watch: {
52
-    $route() {
53
-      this.addViewTags();
54
-      this.moveToCurrentTag();
55
-    },
56
-    visible(value) {
57
-      if (value) {
58
-        document.body.addEventListener("click", this.closeMenu);
59
-      } else {
60
-        document.body.removeEventListener("click", this.closeMenu);
61
-      }
89
+    // $route() {
90
+    //   this.addViewTags();
91
+    //   this.moveToCurrentTag();
92
+    // },
93
+    // visible(value) {
94
+    //   if (value) {
95
+    //     document.body.addEventListener("click", this.closeMenu);
96
+    //   } else {
97
+    //     document.body.removeEventListener("click", this.closeMenu);
98
+    //   }
99
+    // },
100
+    index(newVal) {
101
+      this.newIndex = this.index;
62 102
     }
63 103
   },
64 104
   mounted() {
65
-    this.addViewTags();
105
+    console.log(111111122111118379487239847, this.permission_routers);
106
+    console.log(this.permission_routers);
107
+    // this.addViewTags();
66 108
   },
67 109
   methods: {
68 110
     generateTitle, // generateTitle by vue-i18n
@@ -124,6 +166,10 @@ export default {
124 166
     },
125 167
     closeMenu() {
126 168
       this.visible = false;
169
+    },
170
+    onClick(index) {
171
+      console.log(index);
172
+      this.activeClass = index;
127 173
     }
128 174
   }
129 175
 };
@@ -144,6 +190,7 @@ export default {
144 190
     white-space: normal;
145 191
     // right: 0;
146 192
     // left: 150px;
193
+    width: 100%;
147 194
 
148 195
     /* 针对缺省样式 (必须的) */
149 196
     &::-webkit-scrollbar {
@@ -234,6 +281,26 @@ export default {
234 281
       }
235 282
     }
236 283
   }
284
+  .tagsBox {
285
+    display: flex;
286
+    align-items: center;
287
+    height: 100%;
288
+    .tagsOne {
289
+      .newTags {
290
+        border: 1px solid rgba(235, 238, 240, 1);
291
+        border-radius: 2px;
292
+        padding: 8px 12px;
293
+        margin-left: 10px;
294
+        font-size: 14px;
295
+      }
296
+    }
297
+    .active {
298
+      border: 1px solid rgba(64, 158, 255, 1);
299
+      background: rgba(64, 158, 255, 1);
300
+      border-radius: 2px;
301
+      color: #fff;
302
+    }
303
+  }
237 304
 }
238 305
 .scroll-wrapper {
239 306
   right: 0;