Bladeren bron

Merge branch 'master' of http://git.shengws.com/csx/Vue_New

csx 5 jaren geleden
bovenliggende
commit
36469c397e

+ 247 - 254
src/lang/zh.js Bestand weergeven

@@ -1,285 +1,278 @@
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
-    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: "明细查询",
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: '明细查询',
160 160
 
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: "透析方案",
172
-    integration_config: "集成配置",
173
-    his_config: "HIS集成配置"
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: '透析方案',
172
+    integration_config: '集成配置',
173
+    his_config: 'HIS集成配置'
174 174
   },
175 175
   navbar: {
176
-    logOut: "退出登录",
177
-    dashboard: "首页",
178
-    github: "项目地址",
179
-    screenfull: "全屏",
180
-    theme: "换肤"
176
+    logOut: '退出登录',
177
+    dashboard: '首页',
178
+    github: '项目地址',
179
+    screenfull: '全屏',
180
+    theme: '换肤'
181 181
   },
182 182
   login: {
183
-    title: "系统登录",
184
-    logIn: "登录",
185
-    username: "账号",
186
-    password: "密码",
187
-    any: "随便填",
188
-    thirdparty: "第三方登录",
189
-    thirdpartyTips: "本地不能模拟,请结合自己业务进行模拟!!!"
183
+    title: '系统登录',
184
+    logIn: '登录',
185
+    username: '账号',
186
+    password: '密码',
187
+    any: '随便填',
188
+    thirdparty: '第三方登录',
189
+    thirdpartyTips: '本地不能模拟,请结合自己业务进行模拟!!!'
190 190
   },
191 191
   documentation: {
192
-    documentation: "文档",
193
-    github: "Github 地址"
192
+    documentation: '文档',
193
+    github: 'Github 地址'
194 194
   },
195 195
   permission: {
196
-    roles: "你的权限",
197
-    switchRoles: "切换权限"
196
+    roles: '你的权限',
197
+    switchRoles: '切换权限'
198 198
   },
199 199
   guide: {
200
-    description:
201
-      "引导页对于一些第一次进入项目的人很有用,你可以简单介绍下项目的功能。本 Demo 是基于",
202
-    button: "打开引导"
200
+    description: '引导页对于一些第一次进入项目的人很有用,你可以简单介绍下项目的功能。本 Demo 是基于',
201
+    button: '打开引导'
203 202
   },
204 203
   components: {
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不兼容,所以自己改造了一下,如果大家要使用的话,优先还是使用官方版本。"
204
+    documentation: '文档',
205
+    tinymceTips: '富文本是管理后台一个核心的功能,但同时又是一个有很多坑的地方。在选择富文本的过程中我也走了不少的弯路,市面上常见的富文本都基本用过了,最终权衡了一下选择了Tinymce。更详细的富文本比较和介绍见',
206
+    dropzoneTips: '由于我司业务有特殊需求,而且要传七牛 所以没用第三方,选择了自己封装。代码非常的简单,具体代码你可以在这里看到 @/components/Dropzone',
207
+    stickyTips: '当页面滚动到预设的位置会吸附在顶部',
208
+    backToTopTips1: '页面滚动到指定位置会在右下角出现返回顶部按钮',
209
+    backToTopTips2: '可自定义按钮的样式、show/hide、出现的高度、返回的位置 如需文字提示,可在外部使用Element的el-tooltip元素',
210
+    imageUploadTips: '由于我在使用时它只有vue@1版本,而且和mockjs不兼容,所以自己改造了一下,如果大家要使用的话,优先还是使用官方版本。'
216 211
   },
217 212
   table: {
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: "保 存"
213
+    dynamicTips1: '固定表头, 按照表头顺序排序',
214
+    dynamicTips2: '不固定表头, 按照点击顺序排序',
215
+    dragTips1: '默认顺序',
216
+    dragTips2: '拖拽后顺序',
217
+    title: '标题',
218
+    importance: '重要性',
219
+    type: '类型',
220
+    remark: '点评',
221
+    search: '搜索',
222
+    add: '新增',
223
+    export: '导出',
224
+    reviewer: '审核人',
225
+    id: '序号',
226
+    date: '时间',
227
+    author: '作者',
228
+    readings: '阅读数',
229
+    status: '状态',
230
+    actions: '操作',
231
+    edit: '编辑',
232
+    publish: '发布',
233
+    draft: '草稿',
234
+    delete: '删除',
235
+    cancel: '取 消',
236
+    confirm: '保 存'
242 237
   },
243 238
   errorLog: {
244
-    tips: "请点击右上角bug小图标",
245
-    description:
246
-      "现在的管理后台基本都是spa的形式了,它增强了用户体验,但同时也会增加页面出问题的可能性,可能一个小小的疏忽就导致整个页面的死锁。好在 Vue 官网提供了一个方法来捕获处理异常,你可以在其中进行错误处理或者异常上报。",
247
-    documentation: "文档介绍"
239
+    tips: '请点击右上角bug小图标',
240
+    description: '现在的管理后台基本都是spa的形式了,它增强了用户体验,但同时也会增加页面出问题的可能性,可能一个小小的疏忽就导致整个页面的死锁。好在 Vue 官网提供了一个方法来捕获处理异常,你可以在其中进行错误处理或者异常上报。',
241
+    documentation: '文档介绍'
248 242
   },
249 243
   excel: {
250
-    export: "导出",
251
-    selectedExport: "导出已选择项",
252
-    placeholder: "请输入文件名(默认excel-list)"
244
+    export: '导出',
245
+    selectedExport: '导出已选择项',
246
+    placeholder: '请输入文件名(默认excel-list)'
253 247
   },
254 248
   zip: {
255
-    export: "导出",
256
-    placeholder: "请输入文件名(默认file)"
249
+    export: '导出',
250
+    placeholder: '请输入文件名(默认file)'
257 251
   },
258 252
   theme: {
259
-    change: "换肤",
260
-    documentation: "换肤文档",
261
-    tips:
262
-      "Tips: 它区别于 navbar 上的 theme-pick, 是两种不同的换肤方法,各自有不同的应用场景,具体请参考文档。"
253
+    change: '换肤',
254
+    documentation: '换肤文档',
255
+    tips: 'Tips: 它区别于 navbar 上的 theme-pick, 是两种不同的换肤方法,各自有不同的应用场景,具体请参考文档。'
263 256
   },
264 257
   tagsView: {
265
-    close: "关闭",
266
-    closeOthers: "关闭其它",
267
-    closeAll: "关闭所有"
258
+    close: '关闭',
259
+    closeOthers: '关闭其它',
260
+    closeAll: '关闭所有'
268 261
   },
269 262
   data_config: {
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: "设备管理"
263
+    patient: '病人管理',
264
+    scheduling: '排班管理',
265
+    device: '设备管理',
266
+    hemodialysis: '血透管理',
267
+    system: '系统配置',
268
+    education: '透后宣教',
269
+    summary: '透析小结',
270
+    config_name: '名称',
271
+    config_field: '字段名',
272
+    config_value: '字段值',
273
+    remark: '备注',
274
+    course_disease: '病程',
275
+    rescue_record: '抢救记录',
276
+    manage_ment: '设备管理'
284 277
   }
285
-};
278
+}

+ 87 - 85
src/views/layout/components/Navbar.vue Bestand weergeven

@@ -46,7 +46,7 @@
46 46
           </div>
47 47
           <el-dropdown-menu slot="dropdown">
48 48
             <el-dropdown-item command="modifyUserInfoAction">
49
-              修改个人信息
49
+              个人信息
50 50
             </el-dropdown-item>
51 51
             <el-dropdown-item command="modifyOrgInfoAction">
52 52
               机构信息
@@ -70,7 +70,12 @@
70 70
           <i class="el-icon-arrow-down el-icon--right"></i>
71 71
         </span>
72 72
         <el-dropdown-menu slot="dropdown">
73
-          <el-dropdown-item   icon="el-icon-plus" v-for="(item,index) in orgs" :key="index"  :command="item.id">{{item.org_name}}</el-dropdown-item>
73
+          <el-dropdown-item
74
+            v-for="(item, index) in orgs"
75
+            :key="index"
76
+            :command="item.id"
77
+            >{{ item.org_name }}</el-dropdown-item
78
+          >
74 79
         </el-dropdown-menu>
75 80
       </el-dropdown>
76 81
     </div>
@@ -92,7 +97,7 @@
92 97
           </div>
93 98
           <el-dropdown-menu slot="dropdown">
94 99
             <el-dropdown-item command="modifyUserInfoAction"
95
-              >修改个人信息</el-dropdown-item
100
+              >个人信息</el-dropdown-item
96 101
             >
97 102
             <el-dropdown-item command="modifyOrgInfoAction"
98 103
               >机构信息</el-dropdown-item
@@ -112,7 +117,7 @@
112 117
       </div>
113 118
       <div>
114 119
         <i class="el-icon-question"></i>
115
-        <span>帮助中心</span>
120
+        <span @click="toClick">帮助中心</span>
116 121
       </div>
117 122
     </div>
118 123
   </div>
@@ -125,22 +130,20 @@ import { mapGetters } from "vuex";
125 130
 import Screenfull from "@/components/Screenfull";
126 131
 import ModifyUserInfoDialog from "@/xt_pages/home/modify_user_info_dialog";
127 132
 import ModifyOrgInfoDialog from "@/xt_pages/home/modifyOrgInfoDialog";
128
-import { getFiledConfigList, setFiledConfigList } from '@/utils/data_config' // getConfigList from sessionStorage
133
+import { getFiledConfigList, setFiledConfigList } from "@/utils/data_config"; // getConfigList from sessionStorage
129 134
 import {
130 135
   getAdminUserInfoCache,
131 136
   cacheAdminUserInfo,
132 137
   removeAdminUserInfoCache
133
-} from '@/utils/admin_info_cache'
134
-import {
135
-  getOrgs,changeOrg
136
-} from '@/api/config'
138
+} from "@/utils/admin_info_cache";
139
+import { getOrgs, changeOrg } from "@/api/config";
137 140
 export default {
138
-  inject:['reload'],
141
+  inject: ["reload"],
139 142
   data() {
140 143
     return {
141
-      orgs:[],
142
-      org_id:this.$store.getters.xt_user.org.id,
143
-      org_name:this.$store.getters.xt_user.org.org_name,
144
+      orgs: [],
145
+      org_id: this.$store.getters.xt_user.org.id,
146
+      org_name: this.$store.getters.xt_user.org.org_name
144 147
 
145 148
       // scrm_role_exist: $store.getters.xt_user.scrm_role_exist
146 149
     };
@@ -160,69 +163,66 @@ export default {
160 163
     }
161 164
   },
162 165
   methods: {
163
-    handleOrgCommand(org_id){
166
+    handleOrgCommand(org_id) {
164 167
       let params = {
165 168
         org_id: org_id
166
-      }
167
-      changeOrg(params).then(response => {
168
-        if (response.data.state === 1) {
169
-          // window.location.reload()
170
-
171
-          this.$message.success('切换成功')
172
-          let data = response.data.data
173
-          this.org_id = data.org.id
174
-          this.org_name = data.org.org_name
175
-
176
-          this.$store.dispatch("ModifyAdminUserOrgInfo", {
177
-            user: data.user,
178
-            cur_org_id: data.current_org_id,
179
-            cur_app_id: data.current_app_id,
180
-            org: data.org,
181
-            subscibe: data.subscibe,
182
-            template_info:data.template_info,
183
-          });
184
-
185
-          this.$store.dispatch("ModifyUrlInfo", {
186
-            urlfors: data.urlfors
187
-
188
-          });
189
-
190
-          this.$store.dispatch("ModifyFiled", {
191
-            fileds: data.fileds
192
-
193
-
194
-          });
195
-
196
-
197
-
198
-
199
-          setFiledConfigList(JSON.stringify(data.fileds))
200
-          cacheAdminUserInfo(JSON.stringify(data))
201
-
202
-
203
-          this.$store.dispatch('xt_GenerateRoutes', this.$store.getters.current_role_urls).then(() => {
204
-            this.$store.dispatch('VerifyConfigList').then(() => {
205
-              // alert('token 验证成功')
206
-              // console.log(this.$store.getters.xt_permission.addRouters)
207
-              this.$router.addRoutes(this.$store.getters.xt_permission.addRouters) // 动态添加可访问路由表
208
-              //        next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
209
-              // this.$router.replace({ path: '/' })
210
-              window.location.reload()
211
-              // this.$router.go(0)
212
-              // this.reload()
213
-            })
214
-          })
215
-
216
-
217
-
218
-
219
-
220
-        }else{
221
-          this.$message.success(response.data.msg)
222
-        }
223
-      }).catch(e => {
224
-        // this.$message.success("网络异常")
225
-      });
169
+      };
170
+      changeOrg(params)
171
+        .then(response => {
172
+          if (response.data.state === 1) {
173
+            // window.location.reload()
174
+
175
+            this.$message.success("切换成功");
176
+            let data = response.data.data;
177
+            this.org_id = data.org.id;
178
+            this.org_name = data.org.org_name;
179
+
180
+            this.$store.dispatch("ModifyAdminUserOrgInfo", {
181
+              user: data.user,
182
+              cur_org_id: data.current_org_id,
183
+              cur_app_id: data.current_app_id,
184
+              org: data.org,
185
+              subscibe: data.subscibe,
186
+              template_info: data.template_info
187
+            });
188
+
189
+            this.$store.dispatch("ModifyUrlInfo", {
190
+              urlfors: data.urlfors
191
+            });
192
+
193
+            this.$store.dispatch("ModifyFiled", {
194
+              fileds: data.fileds
195
+            });
196
+
197
+            setFiledConfigList(JSON.stringify(data.fileds));
198
+            cacheAdminUserInfo(JSON.stringify(data));
199
+
200
+            this.$store
201
+              .dispatch(
202
+                "xt_GenerateRoutes",
203
+                this.$store.getters.current_role_urls
204
+              )
205
+              .then(() => {
206
+                this.$store.dispatch("VerifyConfigList").then(() => {
207
+                  // alert('token 验证成功')
208
+                  // console.log(this.$store.getters.xt_permission.addRouters)
209
+                  this.$router.addRoutes(
210
+                    this.$store.getters.xt_permission.addRouters
211
+                  ); // 动态添加可访问路由表
212
+                  //        next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
213
+                  // this.$router.replace({ path: '/' })
214
+                  window.location.reload();
215
+                  // this.$router.go(0)
216
+                  // this.reload()
217
+                });
218
+              });
219
+          } else {
220
+            this.$message.success(response.data.msg);
221
+          }
222
+        })
223
+        .catch(e => {
224
+          // this.$message.success("网络异常")
225
+        });
226 226
     },
227 227
 
228 228
     handleCommand(command) {
@@ -269,20 +269,22 @@ export default {
269 269
         "/org/admin/apps?org=" +
270 270
         this.$store.getters.xt_user.org_id
271 271
       );
272
+    },
273
+    toClick() {
274
+      window.location.href = "https://testsso.sgjyun.com/help";
272 275
     }
273 276
   },
274 277
   created() {
275 278
     getOrgs().then(response => {
276 279
       if (response.data.state === 1) {
277
-          this.orgs = response.data.data.orgs;
278
-          for (let i =0; i < this.orgs.length; i++){
279
-            if (this.orgs[i].id == this.org_id){
280
-              this.org_name = this.orgs[i].org_name
281
-            }
280
+        this.orgs = response.data.data.orgs;
281
+        for (let i = 0; i < this.orgs.length; i++) {
282
+          if (this.orgs[i].id == this.org_id) {
283
+            this.org_name = this.orgs[i].org_name;
282 284
           }
285
+        }
283 286
       }
284 287
     });
285
-
286 288
   }
287 289
 };
288 290
 </script>
@@ -299,7 +301,7 @@ export default {
299 301
   display: flex;
300 302
   align-items: center;
301 303
   justify-content: space-between;
302
-  color:#fff;
304
+  color: #fff;
303 305
   .dropdownBox {
304 306
     margin-left: 10px;
305 307
   }
@@ -519,9 +521,9 @@ export default {
519 521
   }
520 522
 }
521 523
 .dropdownBox {
522
-    .el-dropdown-link{
523
-      font-size: 14px;
524
-      color:#fff;
525
-    }
524
+  .el-dropdown-link {
525
+    font-size: 14px;
526
+    color: #fff;
526 527
   }
528
+}
527 529
 </style>

+ 279 - 228
src/xt_pages/home/modify_user_info_dialog.vue Bestand weergeven

@@ -1,254 +1,305 @@
1 1
 <template>
2
-    <div>
3
-        <el-dialog title="修改个人信息" :modal-append-to-body="false" :append-to-body="true" width="50%" :visible.sync="visible" :before-close="_close">
4
-            <el-form ref="form" :model="form"  :rules="rules" label-width="80px" 
5
-                    v-loading="uploading">
6
-                <el-form-item label="账号:">
7
-                    <span>{{ this.$store.getters.xt_user.user.mobile }}</span>
8
-                </el-form-item>
9
-                <el-form-item label="姓名:" prop="user_name">
10
-                    <el-input v-model="form.user_name" style="width: 300px;"></el-input>
11
-                </el-form-item>
12
-                <el-form-item label="头像:">
13
-                    <el-upload  
14
-                    style="width:100%;"
15
-                    :data="qn_upload_data"
16
-                    :multiple="false"
17
-                    action="https://upload.qiniup.com"
18
-                    :show-file-list="false"
19
-                    :on-error="handleAvatarError"
20
-                    :on-success="handleAvatarSuccess"
21
-                    :before-upload="beforeAvatarUpload"
22
-                    list-type="picture-card">
23
-                        <!-- <img :src="avatar" style="width: 100px; height: 100px;" />
2
+  <div>
3
+    <el-dialog
4
+      title="修改个人信息"
5
+      :modal-append-to-body="false"
6
+      :append-to-body="true"
7
+      width="50%"
8
+      :visible.sync="visible"
9
+      :before-close="_close"
10
+    >
11
+      <el-form
12
+        ref="form"
13
+        :model="form"
14
+        :rules="rules"
15
+        label-width="80px"
16
+        v-loading="uploading"
17
+      >
18
+        <el-form-item label="账号:">
19
+          <span>{{ this.$store.getters.xt_user.user.mobile }}</span>
20
+        </el-form-item>
21
+        <el-form-item label="姓名:" prop="user_name">
22
+          <el-input v-model="form.user_name" style="width: 300px;"></el-input>
23
+        </el-form-item>
24
+        <el-form-item label="头像:">
25
+          <el-upload
26
+            style="width:100%;"
27
+            :data="qn_upload_data"
28
+            :multiple="false"
29
+            action="https://upload.qiniup.com"
30
+            :show-file-list="false"
31
+            :on-error="handleAvatarError"
32
+            :on-success="handleAvatarSuccess"
33
+            :before-upload="beforeAvatarUpload"
34
+            list-type="picture-card"
35
+          >
36
+            <!-- <img :src="avatar" style="width: 100px; height: 100px;" />
24 37
                         <span style="display: block; font-size: 11px; color: gray">108*108像素,仅支持JPG/PNG/JPEG, 大小在300K以内</span> -->
25
-                        <img v-if="form.avatar" :src="form.avatar" class="avatar">
26
-                        <i v-else class="el-icon-plus"></i>
27
-                    </el-upload>
28
-                    <span style="display: block; font-size: 11px; color: gray">仅支持JPG/PNG/JPEG, 大小在300K以内</span>
29
-                </el-form-item>
30
-            </el-form>
31
-            <div slot="footer" class="dialog-footer">
32
-                    <el-button type="primary" @click="submitAction">保存</el-button>
33
-                    <el-button type="primary" @click="modifyPwdAction">修改密码</el-button>
34
-            </div>
35
-        </el-dialog>
38
+            <img v-if="form.avatar" :src="form.avatar" class="avatar" />
39
+            <i v-else class="el-icon-plus"></i>
40
+          </el-upload>
41
+          <span style="display: block; font-size: 11px; color: gray"
42
+            >仅支持JPG/PNG/JPEG, 大小在300K以内</span
43
+          >
44
+        </el-form-item>
45
+      </el-form>
46
+      <div slot="footer" class="dialog-footer">
47
+        <el-button type="primary" @click="submitAction">保存</el-button>
48
+        <el-button type="primary" @click="modifyPwdAction">修改密码</el-button>
49
+      </div>
50
+    </el-dialog>
36 51
 
37
-        <el-dialog title="修改密码" :modal-append-to-body="false" :append-to-body="true" :visible.sync="pwd_dialog_visible">
38
-            <el-form ref="pwd_form" :model="pwd_form" label-width="80px">
39
-                <el-form-item label="账号:">
40
-                    <span>{{ this.$store.getters.xt_user.user.mobile }}</span>
41
-                </el-form-item>
42
-                <el-form-item label="新密码:" prop="new_password">
43
-                    <el-input v-model="pwd_form.new_password" style="width: 260px;"></el-input>
44
-                </el-form-item>
45
-                <el-form-item label="验证码:" prop="code">
46
-                    <el-input v-model="pwd_form.code" style="width: 135px;"></el-input>
47
-                    <el-button :type="count_downing ? 'info' : 'primary'" :disabled="count_downing" @click="getCodeAction" style="width: 122px; padding-left: 5px; padding-right: 5px;">{{ code_btn_title }}</el-button>
48
-                </el-form-item>
49
-            </el-form>
50
-            <div slot="footer" class="dialog-footer">
51
-                    <el-button :loading="modify_pwd_loading" type="primary" @click="submitModifyPwdAction">保存</el-button>
52
-            </div>
53
-        </el-dialog>
54
-    </div>
52
+    <el-dialog
53
+      title="修改密码"
54
+      :modal-append-to-body="false"
55
+      :append-to-body="true"
56
+      :visible.sync="pwd_dialog_visible"
57
+    >
58
+      <el-form ref="pwd_form" :model="pwd_form" label-width="80px">
59
+        <el-form-item label="账号:">
60
+          <span>{{ this.$store.getters.xt_user.user.mobile }}</span>
61
+        </el-form-item>
62
+        <el-form-item label="新密码:" prop="new_password">
63
+          <el-input
64
+            v-model="pwd_form.new_password"
65
+            style="width: 260px;"
66
+          ></el-input>
67
+        </el-form-item>
68
+        <el-form-item label="验证码:" prop="code">
69
+          <el-input v-model="pwd_form.code" style="width: 135px;"></el-input>
70
+          <el-button
71
+            :type="count_downing ? 'info' : 'primary'"
72
+            :disabled="count_downing"
73
+            @click="getCodeAction"
74
+            style="width: 122px; padding-left: 5px; padding-right: 5px;"
75
+            >{{ code_btn_title }}</el-button
76
+          >
77
+        </el-form-item>
78
+      </el-form>
79
+      <div slot="footer" class="dialog-footer">
80
+        <el-button
81
+          :loading="modify_pwd_loading"
82
+          type="primary"
83
+          @click="submitModifyPwdAction"
84
+          >保存</el-button
85
+        >
86
+      </div>
87
+    </el-dialog>
88
+  </div>
55 89
 </template>
56 90
 
57 91
 <script>
58 92
 import { getToken } from "@/api/qiniu";
59 93
 import { getFileExtension } from "@/utils/tools";
60
-import { modifyAdminInfo, getModifyPwdCode, modifyPassword } from "@/api/login/login"
61
-import { hex_md5 } from "@/utils/md5"
94
+import {
95
+  modifyAdminInfo,
96
+  getModifyPwdCode,
97
+  modifyPassword
98
+} from "@/api/login/login";
99
+import { hex_md5 } from "@/utils/md5";
62 100
 
63 101
 export default {
64
-    name: "ModifyUserInfoDialog",
65
-    data() {
66
-        return {
67
-            visible: false,
68
-            pwd_dialog_visible: false,
69
-            form: {
70
-                user_name: this.$store.getters.xt_user.user.user_name,
71
-                avatar: this.$store.getters.xt_user.user.avatar,
72
-            },
73
-            qn_upload_data: { 
74
-                token: "", 
75
-                key: "",
76
-            },
77
-            qiniuDomain: "https://images.shengws.com/",
78
-            uploading: false,
79
-            rules: {
80
-                user_name: [
81
-                    { required: true, message: "请填写姓名", trigger: "blur" }
82
-                ]
83
-            },
102
+  name: "ModifyUserInfoDialog",
103
+  data() {
104
+    return {
105
+      visible: false,
106
+      pwd_dialog_visible: false,
107
+      form: {
108
+        user_name: this.$store.getters.xt_user.user.user_name,
109
+        avatar: this.$store.getters.xt_user.user.avatar
110
+      },
111
+      qn_upload_data: {
112
+        token: "",
113
+        key: ""
114
+      },
115
+      qiniuDomain: "https://images.shengws.com/",
116
+      uploading: false,
117
+      rules: {
118
+        user_name: [{ required: true, message: "请填写姓名", trigger: "blur" }]
119
+      },
84 120
 
85
-            pwd_form: {
86
-                new_password: "",
87
-                code: "",
88
-            },
89
-            count_downing: false,
90
-            count_down: 0,
91
-            modify_pwd_loading: false,
92
-        }
121
+      pwd_form: {
122
+        new_password: "",
123
+        code: ""
124
+      },
125
+      count_downing: false,
126
+      count_down: 0,
127
+      modify_pwd_loading: false
128
+    };
129
+  },
130
+  computed: {
131
+    avatar: function() {
132
+      return this.form.avatar.length == 0
133
+        ? "/src/assets/home/user.png"
134
+        : this.form.avatar;
135
+    },
136
+    code_btn_title: function() {
137
+      if (this.count_down == 0) {
138
+        return "获取验证码";
139
+      } else {
140
+        return this.count_down + "秒后重新获取";
141
+      }
142
+    }
143
+  },
144
+  methods: {
145
+    _close: function(done) {
146
+      this.clear();
147
+      done();
148
+    },
149
+    clear: function() {
150
+      this.form.user_name = this.$store.getters.xt_user.user.user_name;
151
+      this.form.avatar = this.$store.getters.xt_user.user.avatar;
93 152
     },
94
-    computed: {
95
-        avatar: function() {
96
-            return this.form.avatar.length == 0 ? "/src/assets/home/user.png" : this.form.avatar
97
-        },
98
-        code_btn_title: function() {
99
-            if (this.count_down == 0) {
100
-                return "获取验证码"
153
+    show() {
154
+      this.clear();
155
+      this.visible = true;
156
+    },
157
+    hide() {
158
+      this.clear();
159
+      this.visible = false;
160
+    },
161
+    submitAction() {
162
+      this.$refs.form.validate(valid => {
163
+        if (valid) {
164
+          this.uploading = true;
165
+          var params = {
166
+            name: this.form.user_name,
167
+            avatar: this.form.avatar
168
+          };
169
+          modifyAdminInfo(params).then(rs => {
170
+            this.uploading = false;
171
+            var resp = rs.data;
172
+            if (resp.state === 1) {
173
+              this.$store.dispatch("ModifyAdminUserInfo", {
174
+                user_name: this.form.user_name,
175
+                avatar: this.form.avatar
176
+              });
177
+              this.hide();
101 178
             } else {
102
-                return this.count_down + "秒后重新获取"
179
+              this.$message.error(resp.msg);
103 180
             }
181
+          });
182
+        } else {
183
+          return false;
104 184
         }
185
+      });
105 186
     },
106
-    methods: {
107
-        _close: function(done) {
108
-            this.clear()
109
-            done()
110
-        },
111
-        clear: function() {
112
-            this.form.user_name = this.$store.getters.xt_user.user.user_name
113
-            this.form.avatar = this.$store.getters.xt_user.user.avatar
114
-        },
115
-        show() {
116
-            this.clear()
117
-            this.visible = true
118
-        },
119
-        hide() {
120
-            this.clear()
121
-            this.visible = false
122
-        },
123
-        submitAction() {
124
-            this.$refs.form.validate(valid => {
125
-                if (valid) {
126
-                    this.uploading = true
127
-                    var params = {
128
-                        name: this.form.user_name,
129
-                        avatar: this.form.avatar,
130
-                    }
131
-                    modifyAdminInfo(params).then(rs => {
132
-                        this.uploading = false
133
-                        var resp = rs.data
134
-                        if (resp.state === 1) {
135
-                            this.$store.dispatch("ModifyAdminUserInfo", { user_name: this.form.user_name, avatar: this.form.avatar })
136
-                            this.hide()
137
-
138
-                        } else {
139
-                            this.$message.error(resp.msg)
140
-                        }
141
-                    })
142
-                    
143
-                } else {
144
-                    return false
145
-                }
146
-            })
147
-        },
148
-        handleAvatarError(err, file, fileList) {
149
-            this.$message.error(err);
150
-            this.uploading = false
151
-            return false;
152
-        },
153
-        handleAvatarSuccess(res, file) {
154
-            this.form.avatar = this.qiniuDomain + res.url;
155
-            this.uploading = false
156
-        },
157
-        beforeAvatarUpload(file) {
158
-            var fileType = file.type
159
-            const isJPG = fileType.indexOf("image") > -1
160
-            const isLt300K = file.size < 300 * 1024
187
+    handleAvatarError(err, file, fileList) {
188
+      this.$message.error(err);
189
+      this.uploading = false;
190
+      return false;
191
+    },
192
+    handleAvatarSuccess(res, file) {
193
+      this.form.avatar = this.qiniuDomain + res.url;
194
+      this.uploading = false;
195
+    },
196
+    beforeAvatarUpload(file) {
197
+      var fileType = file.type;
198
+      const isJPG = fileType.indexOf("image") > -1;
199
+      const isLt300K = file.size < 300 * 1024;
161 200
 
162
-            if (!isJPG) {
163
-                this.$message.error("只能上传图片")
164
-                return false
165
-            }
166
-            if (!isLt300K) {
167
-                this.$message.error("上传头像图片大小不能超过 300KB!")
168
-                return false
169
-            }
201
+      if (!isJPG) {
202
+        this.$message.error("只能上传图片");
203
+        return false;
204
+      }
205
+      if (!isLt300K) {
206
+        this.$message.error("上传头像图片大小不能超过 300KB!");
207
+        return false;
208
+      }
170 209
 
171
-            var date = new Date()
172
-            var ext = getFileExtension(file.name)
173
-            var key = date.getFullYear() + "/" + (date.getMonth() + 1) + "/" + date.getDate() + "/" + "admin_avatar_" + file.uid + "." + ext
174
-            this.uploading = true
210
+      var date = new Date();
211
+      var ext = getFileExtension(file.name);
212
+      var key =
213
+        date.getFullYear() +
214
+        "/" +
215
+        (date.getMonth() + 1) +
216
+        "/" +
217
+        date.getDate() +
218
+        "/" +
219
+        "admin_avatar_" +
220
+        file.uid +
221
+        "." +
222
+        ext;
223
+      this.uploading = true;
175 224
 
176
-            return new Promise((resolve, reject) => {
177
-                getToken().then(response => {
178
-                    const token = response.data.data.uptoken
179
-                    this.qn_upload_data.token = token
180
-                    this.qn_upload_data.key = key
181
-                    resolve(true)
182
-                })
183
-            })
184
-        },
185
-        modifyPwdAction: function() {
186
-            this.pwd_dialog_visible = true
187
-        },
188
-        getCodeAction: function() {
189
-            this.count_downing = true
190
-            this.count_down = 11
191
-            this.countDown()
192
-            getModifyPwdCode()
193
-        },
194
-        countDown: function() {
195
-            this.count_down = this.count_down - 1
196
-            if (this.count_down == 0) {
197
-                this.count_downing = false
198
-                return
199
-            }
200
-            var t = this
201
-            setTimeout(() => {
202
-                this.countDown()
203
-            }, 1000);
204
-        },
205
-        submitModifyPwdAction: function() {
206
-            if (this.pwd_form.new_password.length == 0) {
207
-                this.$message.error("未填写新密码")
208
-                return
209
-            }
210
-            if (this.pwd_form.code.length == 0) {
211
-                this.$message.error("未填写验证码")
212
-                return
213
-            }
214
-            this.modify_pwd_loading = true
215
-            modifyPassword(hex_md5(this.pwd_form.new_password), this.pwd_form.code).then(rs => {
216
-                this.modify_pwd_loading = false
217
-                var resp = rs.data
218
-                if (resp.state == 1) {
219
-                    this.$message.success(resp.data.msg)
220
-                } else {
221
-                    this.$message.error(resp.msg)
222
-                }
223
-            })
225
+      return new Promise((resolve, reject) => {
226
+        getToken().then(response => {
227
+          const token = response.data.data.uptoken;
228
+          this.qn_upload_data.token = token;
229
+          this.qn_upload_data.key = key;
230
+          resolve(true);
231
+        });
232
+      });
233
+    },
234
+    modifyPwdAction: function() {
235
+      this.pwd_dialog_visible = true;
236
+    },
237
+    getCodeAction: function() {
238
+      this.count_downing = true;
239
+      this.count_down = 11;
240
+      this.countDown();
241
+      getModifyPwdCode();
242
+    },
243
+    countDown: function() {
244
+      this.count_down = this.count_down - 1;
245
+      if (this.count_down == 0) {
246
+        this.count_downing = false;
247
+        return;
248
+      }
249
+      var t = this;
250
+      setTimeout(() => {
251
+        this.countDown();
252
+      }, 1000);
253
+    },
254
+    submitModifyPwdAction: function() {
255
+      if (this.pwd_form.new_password.length == 0) {
256
+        this.$message.error("未填写新密码");
257
+        return;
258
+      }
259
+      if (this.pwd_form.code.length == 0) {
260
+        this.$message.error("未填写验证码");
261
+        return;
262
+      }
263
+      this.modify_pwd_loading = true;
264
+      modifyPassword(
265
+        hex_md5(this.pwd_form.new_password),
266
+        this.pwd_form.code
267
+      ).then(rs => {
268
+        this.modify_pwd_loading = false;
269
+        var resp = rs.data;
270
+        if (resp.state == 1) {
271
+          this.$message.success(resp.data.msg);
272
+        } else {
273
+          this.$message.error(resp.msg);
224 274
         }
275
+      });
225 276
     }
226
-}
277
+  }
278
+};
227 279
 </script>
228 280
 
229 281
 <style scoped>
230 282
 .avatar-uploader .el-upload {
231
-    border: 1px dashed #d9d9d9;
232
-    border-radius: 6px;
233
-    cursor: pointer;
234
-    position: relative;
235
-    overflow: hidden;
236
-  }
237
-  .avatar-uploader .el-upload:hover {
238
-    border-color: #409EFF;
239
-  }
240
-  .avatar-uploader-icon {
241
-    font-size: 28px;
242
-    color: #8c939d;
243
-    width: 148px;
244
-    height: 148px;
245
-    line-height: 148px;
246
-    text-align: center;
247
-  }
248
-  .avatar {
249
-    width: 146px;
250
-    height: 146px;
251
-    display: block;
252
-  }
283
+  border: 1px dashed #d9d9d9;
284
+  border-radius: 6px;
285
+  cursor: pointer;
286
+  position: relative;
287
+  overflow: hidden;
288
+}
289
+.avatar-uploader .el-upload:hover {
290
+  border-color: #409eff;
291
+}
292
+.avatar-uploader-icon {
293
+  font-size: 28px;
294
+  color: #8c939d;
295
+  width: 148px;
296
+  height: 148px;
297
+  line-height: 148px;
298
+  text-align: center;
299
+}
300
+.avatar {
301
+  width: 146px;
302
+  height: 146px;
303
+  display: block;
304
+}
253 305
 </style>
254
-

+ 34 - 24
src/xt_pages/role/admin.vue Bestand weergeven

@@ -104,7 +104,11 @@
104 104
                 type="danger"
105 105
                 size="small"
106 106
                 icon="el-icon-delete"
107
-                v-if="scope.row.status == 1 && org.creator != scope.row.user_id && (scope.row.user_id != local_user_id )"
107
+                v-if="
108
+                  scope.row.status == 1 &&
109
+                    org.creator != scope.row.user_id &&
110
+                    scope.row.user_id != local_user_id
111
+                "
108 112
                 @click="disableAdminAction(scope.row)"
109 113
               ></el-button>
110 114
             </el-tooltip>
@@ -118,7 +122,11 @@
118 122
                 size="small"
119 123
                 type="info"
120 124
                 icon="el-icon-refresh"
121
-                v-if="scope.row.status == 0 && org.creator != scope.row.user_id  && (scope.row.user_id != local_user_id )"
125
+                v-if="
126
+                  scope.row.status == 0 &&
127
+                    org.creator != scope.row.user_id &&
128
+                    scope.row.user_id != local_user_id
129
+                "
122 130
                 @click="recoverAdminAction(scope.row)"
123 131
               ></el-button>
124 132
             </el-tooltip>
@@ -156,18 +164,18 @@ export default {
156 164
     return {
157 165
       crumbs: [
158 166
         { path: false, name: "权限管理" },
159
-        { path: false, name: "用户管理" }
167
+        { path: false, name: "员工管理" }
160 168
       ],
161 169
       is_loading_admins: true,
162 170
       admins: [], // [{user_id, user_name, role_name, title_name, ip, last_login_time, status}]
163 171
       admin_total_count: 0,
164 172
       current_page: 1,
165
-      roles:[],
173
+      roles: [],
166 174
       is_exist_role: false,
167 175
       org: null,
168
-      isSubSuperAdmin:false,
176
+      isSubSuperAdmin: false,
169 177
 
170
-      local_user_id: 0,
178
+      local_user_id: 0
171 179
     };
172 180
   },
173 181
   components: {
@@ -175,42 +183,44 @@ export default {
175 183
     AdminInfoForm
176 184
   },
177 185
   created: function() {
178
-    this.local_user_id = this.$store.getters.xt_user.user.id
179
-    let page = 1
180
-    this.getRoles(page)
186
+    this.local_user_id = this.$store.getters.xt_user.user.id;
187
+    let page = 1;
188
+    this.getRoles(page);
181 189
     adminMainView()
182 190
       .then(rs => {
183 191
         this.is_loading_admins = false;
184 192
         var resp = rs.data;
185 193
         if (resp.state === 1) {
186
-
187 194
           this.admins.push(...resp.data.admins);
188 195
           this.admin_total_count = resp.data.total_count;
189 196
           this.is_exist_role = resp.data.is_exist_role;
190 197
           this.current_page = 1;
191
-          this.org = resp.data.org
192
-          this.isSubSuperAdmin = resp.data.isSubSuperAdmin
198
+          this.org = resp.data.org;
199
+          this.isSubSuperAdmin = resp.data.isSubSuperAdmin;
193 200
 
194 201
           //能进入当前页面的角色只有超级管理员和子管理员,如果当前角色是子管理员,需要把超级管理员和其他子管理员的信息去除,子管理员不能编辑超级管理员和其他子管理员信息,
195
-          if(this.isSubSuperAdmin) {
202
+          if (this.isSubSuperAdmin) {
196 203
             //去除管理员信息
197
-            for (let i = 0; i < this.admins.length; i++){
204
+            for (let i = 0; i < this.admins.length; i++) {
198 205
               if (this.admins[i].user_id == this.org.creator) {
199
-                this.admins.splice(i, 1)
200
-                i--
206
+                this.admins.splice(i, 1);
207
+                i--;
201 208
               }
202 209
             }
203 210
 
204 211
             //去除其他子管理员信息
205
-            for (let i = 0; i < this.admins.length; i++){
206
-              if (this.admins[i].user_id  != this.local_user_id && this.admins[i].is_sub_super_admin) { //将自己排除在外
207
-                console.log(this.admins[i])
212
+            for (let i = 0; i < this.admins.length; i++) {
213
+              if (
214
+                this.admins[i].user_id != this.local_user_id &&
215
+                this.admins[i].is_sub_super_admin
216
+              ) {
217
+                //将自己排除在外
218
+                console.log(this.admins[i]);
208 219
 
209
-                this.admins.splice(i, 1)
210
-                i--
220
+                this.admins.splice(i, 1);
221
+                i--;
211 222
               }
212 223
             }
213
-
214 224
           }
215 225
         } else {
216 226
           this.$message.error(resp.msg);
@@ -227,7 +237,7 @@ export default {
227 237
     }
228 238
   },
229 239
   methods: {
230
-    getRoles(page){
240
+    getRoles(page) {
231 241
       getRoles(page)
232 242
         .then(rs => {
233 243
           this.loading_roles = false;
@@ -244,7 +254,7 @@ export default {
244 254
         });
245 255
     },
246 256
     openForm(adminId) {
247
-      this.$refs["admininfoform"].open(adminId,this.roles);
257
+      this.$refs["admininfoform"].open(adminId, this.roles);
248 258
     },
249 259
     _parseTime(time, format) {
250 260
       return parseTime(time, format);

+ 200 - 203
src/xt_pages/role/components/AddRole.vue Bestand weergeven

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <el-dialog
3
-    title="新增用户"
3
+    title="新增角色"
4 4
     width="660px"
5 5
     :visible.sync="visible"
6 6
     :before-close="_close"
@@ -9,8 +9,14 @@
9 9
       <el-form-item label="角色名称 : " prop="name">
10 10
         <el-input v-model="form.name" placeholder="" maxlength="30"></el-input>
11 11
       </el-form-item>
12
-      <el-form-item label="角色描述 : " >
13
-        <el-input type="textarea" v-model="form.intro" placeholder="" resize="none" rows="4"></el-input>
12
+      <el-form-item label="角色描述 : ">
13
+        <el-input
14
+          type="textarea"
15
+          v-model="form.intro"
16
+          placeholder=""
17
+          resize="none"
18
+          rows="4"
19
+        ></el-input>
14 20
       </el-form-item>
15 21
     </el-form>
16 22
     <div slot="footer" class="dialog-footer">
@@ -21,232 +27,223 @@
21 27
 </template>
22 28
 
23 29
 <script>
24
-  import { addRole, modifyRole } from '@/api/role/role'
25
-
26
-  export default {
27
-    name: 'AddRole',
28
-    data() {
29
-      return {
30
-        form: {
31
-          id: 0,
32
-          name: '',
33
-          intro: ''
34
-        },
35
-        visible: false,
36
-        rules: {
37
-          name: [
38
-            { required: true, message: '请输入角色名称', trigger: 'blur' },
39
-            { max: 10, message: '10个字以内', trigger: 'blur' }
40
-          ],
41
-          // intro: [{ required: true, message: '请输入角色说明', trigger: 'blur' }]
42
-        },
43
-
44
-        //
45
-        checked: '1',
46
-        checkAll: false,
47
-        checkedCities: [],
48
-        cities: ['上海', '北京', '广州', '深圳'],
49
-        isIndeterminate: true,
50
-        ruleForm: {
51
-          name: '',
52
-          phone: '',
53
-          position: ''
54
-        },
55
-        newrules: {
56
-          name: [
57
-            { required: true, message: '请输入角色名称', trigger: 'blur' },
58
-            { max: 10, message: '10个字以内', trigger: 'blur' }
59
-          ],
60
-          phone: [{ required: true, message: '请输入手机号', trigger: 'blur' }]
61
-        }
62
-      }
63
-    },
64
-    methods: {
65
-      _close: function(done) {
66
-        this.clear()
67
-        done()
30
+import { addRole, modifyRole } from "@/api/role/role";
31
+
32
+export default {
33
+  name: "AddRole",
34
+  data() {
35
+    return {
36
+      form: {
37
+        id: 0,
38
+        name: "",
39
+        intro: ""
68 40
       },
69
-      clear: function() {
70
-        this.form.id = 0
71
-        this.form.name = ''
72
-        this.form.intro = ''
41
+      visible: false,
42
+      rules: {
43
+        name: [
44
+          { required: true, message: "请输入角色名称", trigger: "blur" },
45
+          { max: 10, message: "10个字以内", trigger: "blur" }
46
+        ]
47
+        // intro: [{ required: true, message: '请输入角色说明', trigger: 'blur' }]
73 48
       },
74
-      show() {
75
-        this.clear()
76
-        this.visible = true
77
-      },
78
-      hide() {
79
-        this.clear()
80
-        this.visible = false
81
-      },
82
-      modify(id, name, intro) {
83
-        this.form.id = id
84
-        this.form.name = name
85
-        this.form.intro = intro
86
-        this.visible = true
87
-      },
88
-      submitAction() {
89
-        this.$refs.form.validate(valid => {
90
-          if (valid) {
91
-            // 验证通过
92
-            if (this.form.id === 0) {
93
-              // 新增 role
94
-              addRole(this.form.name, this.form.intro)
95
-                .then(rs => {
96
-                  var resp = rs.data
97
-                  if (resp.state === 1) {
98
-                    var new_id = resp.data.id
99
-                    var new_name = resp.data.name
100
-                    var new_intro = resp.data.intro
101
-                    var new_status = resp.data.status
102
-                    var staff_number = 0
103
-                    this.$emit(
104
-                      'did-add-role',
105
-                      new_id,
106
-                      new_name,
107
-                      new_intro,
108
-                      new_status,
109
-                      staff_number
110
-                    )
111 49
 
112
-                    this.hide()
113
-                  } else {
114
-                    this.$message.error(resp.msg)
115
-                  }
116
-                })
117
-                .catch(err => {
118
-                  this.$message.error(err)
119
-                })
120
-            } else {
121
-              // 修改 role
122
-              modifyRole(this.form.id, this.form.name, this.form.intro)
123
-                .then(rs => {
124
-                  var resp = rs.data
125
-                  if (resp.state === 1) {
126
-                    this.$emit(
127
-                      'did-edit-role',
128
-                      this.form.id,
129
-                      this.form.name,
130
-                      this.form.intro
131
-                    )
132
-                    this.hide()
133
-                  } else {
134
-                    this.$message.error(resp.msg)
135
-                  }
136
-                })
137
-                .catch(err => {
138
-                  this.$message.error(err)
139
-                })
140
-            }
141
-          } else {
142
-            // 验证失败
143
-            return false
144
-          }
145
-        })
146
-      },
147
-      handleCheckAllChange(val) {
148
-        this.checkedCities = val ? this.cities : []
149
-        this.isIndeterminate = false
50
+      //
51
+      checked: "1",
52
+      checkAll: false,
53
+      checkedCities: [],
54
+      cities: ["上海", "北京", "广州", "深圳"],
55
+      isIndeterminate: true,
56
+      ruleForm: {
57
+        name: "",
58
+        phone: "",
59
+        position: ""
150 60
       },
151
-      handleCheckedCitiesChange(value) {
152
-        let checkedCount = value.length
153
-        this.checkAll = checkedCount === this.cities.length
154
-        this.isIndeterminate =
155
-          checkedCount > 0 && checkedCount < this.cities.length
61
+      newrules: {
62
+        name: [
63
+          { required: true, message: "请输入角色名称", trigger: "blur" },
64
+          { max: 10, message: "10个字以内", trigger: "blur" }
65
+        ],
66
+        phone: [{ required: true, message: "请输入手机号", trigger: "blur" }]
156 67
       }
68
+    };
69
+  },
70
+  methods: {
71
+    _close: function(done) {
72
+      this.clear();
73
+      done();
74
+    },
75
+    clear: function() {
76
+      this.form.id = 0;
77
+      this.form.name = "";
78
+      this.form.intro = "";
79
+    },
80
+    show() {
81
+      this.clear();
82
+      this.visible = true;
83
+    },
84
+    hide() {
85
+      this.clear();
86
+      this.visible = false;
87
+    },
88
+    modify(id, name, intro) {
89
+      this.form.id = id;
90
+      this.form.name = name;
91
+      this.form.intro = intro;
92
+      this.visible = true;
93
+    },
94
+    submitAction() {
95
+      this.$refs.form.validate(valid => {
96
+        if (valid) {
97
+          // 验证通过
98
+          if (this.form.id === 0) {
99
+            // 新增 role
100
+            addRole(this.form.name, this.form.intro)
101
+              .then(rs => {
102
+                var resp = rs.data;
103
+                if (resp.state === 1) {
104
+                  var new_id = resp.data.id;
105
+                  var new_name = resp.data.name;
106
+                  var new_intro = resp.data.intro;
107
+                  var new_status = resp.data.status;
108
+                  var staff_number = 0;
109
+                  this.$emit(
110
+                    "did-add-role",
111
+                    new_id,
112
+                    new_name,
113
+                    new_intro,
114
+                    new_status,
115
+                    staff_number
116
+                  );
117
+
118
+                  this.hide();
119
+                } else {
120
+                  this.$message.error(resp.msg);
121
+                }
122
+              })
123
+              .catch(err => {
124
+                this.$message.error(err);
125
+              });
126
+          } else {
127
+            // 修改 role
128
+            modifyRole(this.form.id, this.form.name, this.form.intro)
129
+              .then(rs => {
130
+                var resp = rs.data;
131
+                if (resp.state === 1) {
132
+                  this.$emit(
133
+                    "did-edit-role",
134
+                    this.form.id,
135
+                    this.form.name,
136
+                    this.form.intro
137
+                  );
138
+                  this.hide();
139
+                } else {
140
+                  this.$message.error(resp.msg);
141
+                }
142
+              })
143
+              .catch(err => {
144
+                this.$message.error(err);
145
+              });
146
+          }
147
+        } else {
148
+          // 验证失败
149
+          return false;
150
+        }
151
+      });
152
+    },
153
+    handleCheckAllChange(val) {
154
+      this.checkedCities = val ? this.cities : [];
155
+      this.isIndeterminate = false;
156
+    },
157
+    handleCheckedCitiesChange(value) {
158
+      let checkedCount = value.length;
159
+      this.checkAll = checkedCount === this.cities.length;
160
+      this.isIndeterminate =
161
+        checkedCount > 0 && checkedCount < this.cities.length;
157 162
     }
158 163
   }
164
+};
159 165
 </script>
160 166
 
161 167
 <style lang="scss" scoped>
162
-  .roleContent {
163
-    margin-top: 20px;
164
-    display: flex;
165
-    justify-content: space-between;
168
+.roleContent {
169
+  margin-top: 20px;
170
+  display: flex;
171
+  justify-content: space-between;
166 172
 
167 173
   .roleContentLeft {
174
+    .chooseBox {
175
+      width: 280px;
176
+      height: 320px;
177
+      overflow-y: auto;
178
+      border: 1px solid rgba(235, 238, 240, 1);
179
+      margin-top: 26px;
180
+      padding: 20px;
181
+
182
+      .checkone {
183
+        display: flex;
184
+        align-items: center;
185
+        height: 50px;
186
+      }
168 187
 
169
-  .chooseBox {
170
-    width: 280px;
171
-    height: 320px;
172
-    overflow-y: auto;
173
-    border: 1px solid rgba(235, 238, 240, 1);
174
-    margin-top: 26px;
175
-    padding: 20px;
176
-
177
-  .checkone {
178
-    display: flex;
179
-    align-items: center;
180
-    height: 50px;
181
-  }
182
-
183
-  .el-checkbox__label {
184
-    display: flex;
185
-    align-items: center;
186
-
187
-  img {
188
-    width: 30px;
189
-    height: 30px;
190
-    margin-right: 10px;
191
-  }
188
+      .el-checkbox__label {
189
+        display: flex;
190
+        align-items: center;
192 191
 
193
-  }
194
-  }
192
+        img {
193
+          width: 30px;
194
+          height: 30px;
195
+          margin-right: 10px;
196
+        }
197
+      }
198
+    }
195 199
   }
196 200
   .roleContentRight {
197
-
198
-  .chooseBox {
199
-    width: 280px;
200
-    height: 320px;
201
-    overflow-y: auto;
202
-    border: 1px solid rgba(235, 238, 240, 1);
203
-    margin-top: 26px;
204
-    padding: 20px;
205
-
206
-  .hasChoosedOne {
207
-    display: flex;
208
-    align-items: center;
209
-    height: 50px;
210
-
211
-  img {
212
-    width: 30px;
213
-    height: 30px;
214
-    margin-right: 10px;
215
-  }
216
-
217
-  }
218
-  }
219
-  }
201
+    .chooseBox {
202
+      width: 280px;
203
+      height: 320px;
204
+      overflow-y: auto;
205
+      border: 1px solid rgba(235, 238, 240, 1);
206
+      margin-top: 26px;
207
+      padding: 20px;
208
+
209
+      .hasChoosedOne {
210
+        display: flex;
211
+        align-items: center;
212
+        height: 50px;
213
+
214
+        img {
215
+          width: 30px;
216
+          height: 30px;
217
+          margin-right: 10px;
218
+        }
219
+      }
220
+    }
220 221
   }
221
-  .newStaff {
222
-    margin-top: 26px;
222
+}
223
+.newStaff {
224
+  margin-top: 26px;
223 225
 
224 226
   .newItem {
225 227
     display: flex;
226 228
     align-items: center;
227 229
   }
228
-
229
-  }
230
+}
230 231
 </style>
231 232
 
232 233
 <style lang="scss">
233
-  .roleContent {
234
-
234
+.roleContent {
235 235
   .roleContentLeft {
236
+    .chooseBox {
237
+      .el-checkbox {
238
+        display: flex;
239
+        align-items: center;
240
+      }
236 241
 
237
-  .chooseBox {
238
-
239
-  .el-checkbox {
240
-    display: flex;
241
-    align-items: center;
242
-  }
243
-
244
-  .el-checkbox__label {
245
-    display: flex;
246
-    align-items: center;
247
-  }
248
-
249
-  }
250
-  }
242
+      .el-checkbox__label {
243
+        display: flex;
244
+        align-items: center;
245
+      }
246
+    }
251 247
   }
248
+}
252 249
 </style>

+ 1 - 1
src/xt_pages/role/components/EditRole.vue Bestand weergeven

@@ -110,7 +110,7 @@
110 110
             style="font-size:20px;color:#338AFB"
111 111
           ></i>
112 112
         </p>
113
-        <p style="color:#409FFF" @click="continueAddStaff()">继续新增员工</p>
113
+        <p style="color:#409FFF" @click="continueAddStaff()">保存并继续新增员工</p>
114 114
       </div>
115 115
     </div>
116 116
     <div slot="footer" class="dialog-footer">