Merge branch 'master' of http://yun.pashanhoo.com:9090/bdc/bdcjg-web
Showing
21 changed files
with
977 additions
and
201 deletions
... | @@ -11,6 +11,7 @@ | ... | @@ -11,6 +11,7 @@ |
11 | "@jiaminghi/data-view": "^2.10.0", | 11 | "@jiaminghi/data-view": "^2.10.0", |
12 | "axios": "^0.21.1", | 12 | "axios": "^0.21.1", |
13 | "clipboard": "^2.0.11", | 13 | "clipboard": "^2.0.11", |
14 | "jsoneditor": "^9.9.2", | ||
14 | "core-js": "^3.6.5", | 15 | "core-js": "^3.6.5", |
15 | "echarts": "^4.6.0", | 16 | "echarts": "^4.6.0", |
16 | "js-cookie": "2.2.0", | 17 | "js-cookie": "2.2.0", | ... | ... |
... | @@ -81,6 +81,29 @@ export const api = { | ... | @@ -81,6 +81,29 @@ export const api = { |
81 | crudBusiness : crud + '/rest/business', // crudBusiness | 81 | crudBusiness : crud + '/rest/business', // crudBusiness |
82 | crudDatasources : crud + '/rest/datasources', // crudDatasources | 82 | crudDatasources : crud + '/rest/datasources', // crudDatasources |
83 | } | 83 | } |
84 | |||
85 | // 根据code获取字典 params={isTree:true}) | ||
86 | export function getDictItems(code, params = {}) { | ||
87 | return request({ | ||
88 | url: `${api.baseDataCategory}/${code}/base-datas`, | ||
89 | method: 'get', | ||
90 | params | ||
91 | }) | ||
92 | } | ||
93 | // 获取一级字典值下级接口 | ||
94 | export function getDictItemsChild(id) { | ||
95 | return request({ | ||
96 | url: `${api.baseData}/dict/${id}`, | ||
97 | method: 'get' | ||
98 | }) | ||
99 | } | ||
100 | // 获取传入字段的所有级别字典值 | ||
101 | export function getAllDictItems(name) { | ||
102 | return request({ | ||
103 | url: `${api.baseDataCategory}/${name}/base-datas`, | ||
104 | method: 'get' | ||
105 | }) | ||
106 | } | ||
84 | // get公共方法 | 107 | // get公共方法 |
85 | export function getAction(url, params = {}) { | 108 | export function getAction(url, params = {}) { |
86 | return request({ | 109 | return request({ | ... | ... |
... | @@ -23,7 +23,6 @@ export const getRolesById = categoryId => { | ... | @@ -23,7 +23,6 @@ export const getRolesById = categoryId => { |
23 | queryRelation: 'AND' | 23 | queryRelation: 'AND' |
24 | } | 24 | } |
25 | const params = getParams(conditionGroup); | 25 | const params = getParams(conditionGroup); |
26 | console.log(api.roles,params); | ||
27 | return getAction(api.roles, params) | 26 | return getAction(api.roles, params) |
28 | } | 27 | } |
29 | // 人员列表 | 28 | // 人员列表 |
... | @@ -34,3 +33,51 @@ export const getUserRoles = (id) => { | ... | @@ -34,3 +33,51 @@ export const getUserRoles = (id) => { |
34 | export const updateUser = (id, data) => { | 33 | export const updateUser = (id, data) => { |
35 | return putAction(`${api.userRoles}/${id}/users`, data) | 34 | return putAction(`${api.userRoles}/${id}/users`, data) |
36 | } | 35 | } |
36 | // 根据条件获取用户 | ||
37 | export const getUserList = (params) => { | ||
38 | return getAction(api.users, params) | ||
39 | } | ||
40 | // 导出用户列表 | ||
41 | export const exportUserList = (params) => { | ||
42 | return getAction(api.users + '/export', params) | ||
43 | } | ||
44 | // 更新用户状态 | ||
45 | export const updateStatus = (id, status) => { | ||
46 | return putAction(`${api.users}/${id}/${status}/status`) | ||
47 | } | ||
48 | // 更新用户解锁状态 | ||
49 | export const updateLock = (id) => { | ||
50 | return putAction(`${api.users}/${id}/lock`) | ||
51 | } | ||
52 | // 重置用户密码 | ||
53 | // export const resetPassword = id => { | ||
54 | // return putAction(`${api.users}/${id}/reset-password`) | ||
55 | // } | ||
56 | |||
57 | // 重置用户密码 | ||
58 | export const resetPassword = (ids) => { | ||
59 | return putAction(`${api.users}/reset-passwords?ids=${ids}`) | ||
60 | } | ||
61 | |||
62 | // 删除人员 | ||
63 | export const delUser = (id, data) => { | ||
64 | return deleteAction(`${api.userRoles}/${id}/users`, data) | ||
65 | } | ||
66 | // 获取父级菜单 | ||
67 | export const getParentMenuListAction = (id) => { | ||
68 | let conditionGroup = {} | ||
69 | if (id && id !== '') { | ||
70 | conditionGroup = { | ||
71 | conditions: [ | ||
72 | { | ||
73 | property: 'productId', | ||
74 | value: id, | ||
75 | operator: 'EQ' | ||
76 | } | ||
77 | ], | ||
78 | queryRelation: 'AND' | ||
79 | } | ||
80 | } | ||
81 | const params = getParams(conditionGroup) | ||
82 | return getAction(api.menus, params) | ||
83 | } | ... | ... |
... | @@ -23,6 +23,7 @@ export default { | ... | @@ -23,6 +23,7 @@ export default { |
23 | try { | 23 | try { |
24 | let { result: res } = await work.mapViews("A20"); | 24 | let { result: res } = await work.mapViews("A20"); |
25 | res.map((item) => { | 25 | res.map((item) => { |
26 | |||
26 | return ( | 27 | return ( |
27 | this.cdata.push({ "name": item.areaName, "value": item.ywtotal }) | 28 | this.cdata.push({ "name": item.areaName, "value": item.ywtotal }) |
28 | ) | 29 | ) | ... | ... |
1 | <template> | 1 | <template> |
2 | <div> | 2 | <div> |
3 | <i class="icon-tubiao-242 iconfont" :title="title" @click="openDialog" /> | 3 | <i class="el-icon-s-management icon" :title="title" @click="openDialog" /> |
4 | <el-dialog :key="key" :title="title" :inner-dialog="true" :visible.sync="dialogVisible" width="600px" | 4 | <el-dialog |
5 | :close-on-click-modal="false" append-to-body @cancel="cancel"> | 5 | :key="key" |
6 | <vue-json-editor id="minejson" v-model="resultInfo" :mode="'code'" lang="zh" @json-change="onJsonChange" | 6 | :title="title" |
7 | @json-save="onJsonSave" @has-error="onError" /> | 7 | :inner-dialog="true" |
8 | <el-tooltip content="全屏缩放" effect="dark" placement="bottom" fullscreen class="fullScreen"> | 8 | :visible.sync="dialogVisible" |
9 | width="600px" | ||
10 | :close-on-click-modal="false" | ||
11 | append-to-body | ||
12 | @cancel="cancel" | ||
13 | > | ||
14 | <vue-json-editor | ||
15 | id="minejson" | ||
16 | v-model="resultInfo" | ||
17 | :mode="'code'" | ||
18 | lang="zh" | ||
19 | @json-change="onJsonChange" | ||
20 | @json-save="onJsonSave" | ||
21 | @has-error="onError" | ||
22 | /> | ||
23 | <el-tooltip | ||
24 | content="全屏缩放" | ||
25 | effect="dark" | ||
26 | placement="bottom" | ||
27 | fullscreen | ||
28 | class="fullScreen" | ||
29 | > | ||
9 | <i class="el-icon-full-screen" @click="enLarge" /> | 30 | <i class="el-icon-full-screen" @click="enLarge" /> |
10 | </el-tooltip> | 31 | </el-tooltip> |
11 | <template slot="footer"> | 32 | <template slot="footer"> |
12 | <div class="dialog-footer flex flex-pack-center"> | 33 | <div class="dialog-footer flex flex-pack-center"> |
13 | <el-button type="primary" class="confirmBtn" @click="onJsonSave">保存</el-button> | 34 | <el-button |
14 | <el-button type="primary" class="cancelBtn" @click="cancel">关闭</el-button> | 35 | type="primary" |
36 | class="confirmBtn" | ||
37 | @click="onJsonSave" | ||
38 | >保存</el-button> | ||
39 | <el-button | ||
40 | type="primary" | ||
41 | class="cancelBtn" | ||
42 | @click="cancel" | ||
43 | >关闭</el-button> | ||
15 | </div> | 44 | </div> |
16 | </template> | 45 | </template> |
17 | </el-dialog> | 46 | </el-dialog> |
... | @@ -33,7 +62,7 @@ export default { | ... | @@ -33,7 +62,7 @@ export default { |
33 | default: '' | 62 | default: '' |
34 | } | 63 | } |
35 | }, | 64 | }, |
36 | data () { | 65 | data() { |
37 | return { | 66 | return { |
38 | activeNames: [], | 67 | activeNames: [], |
39 | resultInfo: {}, | 68 | resultInfo: {}, |
... | @@ -46,7 +75,7 @@ export default { | ... | @@ -46,7 +75,7 @@ export default { |
46 | }, | 75 | }, |
47 | watch: { | 76 | watch: { |
48 | resultInfos: { | 77 | resultInfos: { |
49 | handler: function (val) { | 78 | handler: function(val) { |
50 | ++this.key | 79 | ++this.key |
51 | this.resultInfo = | 80 | this.resultInfo = |
52 | this.resultInfos === '' ? {} : JSON.parse(this.resultInfos) | 81 | this.resultInfos === '' ? {} : JSON.parse(this.resultInfos) |
... | @@ -57,18 +86,19 @@ export default { | ... | @@ -57,18 +86,19 @@ export default { |
57 | } | 86 | } |
58 | }, | 87 | }, |
59 | 88 | ||
60 | mounted () { | 89 | mounted() { |
61 | this.resultInfo = | 90 | this.resultInfo = |
62 | this.resultInfos === '' ? {} : JSON.parse(this.resultInfos) | 91 | this.resultInfos === '' ? {} : JSON.parse(this.resultInfos) |
63 | }, | 92 | }, |
64 | 93 | ||
65 | methods: { | 94 | methods: { |
66 | onJsonChange (value) { | 95 | onJsonChange(value) { |
67 | // 只有在格式正确的时候进入此事件 | 96 | // 只有在格式正确的时候进入此事件 |
68 | this.hasJsonFlag = true | 97 | this.hasJsonFlag = true |
69 | }, | 98 | }, |
70 | onJsonSave () { | 99 | onJsonSave() { |
71 | const value = this.resultInfo | 100 | const value = this.resultInfo |
101 | console.log(this.resultInfo, 'resultInfo') | ||
72 | if (this.hasJsonFlag === false) { | 102 | if (this.hasJsonFlag === false) { |
73 | this.$message.error({ message: 'json格式验证失败', showClose: true }) | 103 | this.$message.error({ message: 'json格式验证失败', showClose: true }) |
74 | // alert("json验证失败") | 104 | // alert("json验证失败") |
... | @@ -79,18 +109,19 @@ export default { | ... | @@ -79,18 +109,19 @@ export default { |
79 | return true | 109 | return true |
80 | } | 110 | } |
81 | }, | 111 | }, |
82 | onError (value) { | 112 | onError(value) { |
83 | this.hasJsonFlag = false | 113 | this.hasJsonFlag = false |
84 | }, | 114 | }, |
85 | openDialog () { | 115 | openDialog() { |
86 | this.dialogVisible = true | 116 | this.dialogVisible = true |
87 | }, | 117 | }, |
88 | cancel () { | 118 | cancel() { |
119 | console.log(this.tmpResultInfo, 'tmpResultInfo') | ||
89 | this.resultInfo = this.tmpResultInfo | 120 | this.resultInfo = this.tmpResultInfo |
90 | this.dialogVisible = false | 121 | this.dialogVisible = false |
91 | }, | 122 | }, |
92 | // 放大 | 123 | // 放大 |
93 | enLarge () { | 124 | enLarge() { |
94 | const fullarea = document.getElementById('minejson') | 125 | const fullarea = document.getElementById('minejson') |
95 | if (fullarea.requestFullscreen) { | 126 | if (fullarea.requestFullscreen) { |
96 | fullarea.requestFullscreen() | 127 | fullarea.requestFullscreen() |
... | @@ -109,17 +140,12 @@ export default { | ... | @@ -109,17 +140,12 @@ export default { |
109 | 140 | ||
110 | <style scoped lang="scss"> | 141 | <style scoped lang="scss"> |
111 | /* jsoneditor右上角默认有一个链接,加css去掉了 */ | 142 | /* jsoneditor右上角默认有一个链接,加css去掉了 */ |
112 | .iconfont { | 143 | .icon { |
113 | cursor: pointer; | ||
114 | position: relative; | ||
115 | top: 1px; | ||
116 | color: #349af3; | 144 | color: #349af3; |
117 | } | 145 | } |
118 | 146 | /deep/ .jsoneditor-vue { | |
119 | ::v-deep .jsoneditor-vue { | ||
120 | height: 100%; | 147 | height: 100%; |
121 | } | 148 | } |
122 | |||
123 | .fullScreen { | 149 | .fullScreen { |
124 | position: absolute; | 150 | position: absolute; |
125 | right: 5%; | 151 | right: 5%; |
... | @@ -127,28 +153,22 @@ export default { | ... | @@ -127,28 +153,22 @@ export default { |
127 | cursor: pointer; | 153 | cursor: pointer; |
128 | color: #fff; | 154 | color: #fff; |
129 | } | 155 | } |
130 | 156 | /deep/ .jsoneditor-modes { | |
131 | ::v-deep .jsoneditor-modes { | ||
132 | display: none !important; | 157 | display: none !important; |
133 | } | 158 | } |
134 | |||
135 | .jsoneditor-poweredBy { | 159 | .jsoneditor-poweredBy { |
136 | display: none !important; | 160 | display: none !important; |
137 | } | 161 | } |
138 | |||
139 | .jsoneditor-menu { | 162 | .jsoneditor-menu { |
140 | background-color: #9c9e9f !important; | 163 | background-color: #9c9e9f !important; |
141 | border-bottom: 1px solid #9c9e9f !important; | 164 | border-bottom: 1px solid #9c9e9f !important; |
142 | } | 165 | } |
143 | |||
144 | .jsoneditor { | 166 | .jsoneditor { |
145 | border: 1px solid #9c9e9f !important; | 167 | border: 1px solid #9c9e9f !important; |
146 | } | 168 | } |
147 | |||
148 | .el-collapse { | 169 | .el-collapse { |
149 | border: 0; | 170 | border: 0; |
150 | } | 171 | } |
151 | |||
152 | .el-collapse-item__header { | 172 | .el-collapse-item__header { |
153 | height: 44px; | 173 | height: 44px; |
154 | } | 174 | } | ... | ... |
... | @@ -25,6 +25,51 @@ VXETable.setup({ | ... | @@ -25,6 +25,51 @@ VXETable.setup({ |
25 | i18n: (key, args) => XEUtils.toFormatString(XEUtils.get(zhCNLocat, key), args) | 25 | i18n: (key, args) => XEUtils.toFormatString(XEUtils.get(zhCNLocat, key), args) |
26 | }) | 26 | }) |
27 | 27 | ||
28 | import $deepCopy from '../utils/tool' | ||
29 | |||
30 | Vue.use($deepCopy) | ||
31 | |||
32 | import $dealArrChildren from '../utils/tool' | ||
33 | |||
34 | Vue.use($dealArrChildren) | ||
35 | |||
36 | import $filterNullObj from '../utils/tool' | ||
37 | |||
38 | Vue.use($filterNullObj) | ||
39 | |||
40 | import $getNodeRoute from '../utils/tool' | ||
41 | |||
42 | Vue.use($getNodeRoute) | ||
43 | |||
44 | import $dealArrDisabled from '../utils/tool' | ||
45 | |||
46 | Vue.use($dealArrDisabled) | ||
47 | |||
48 | import $dealArrNotDisabled from '../utils/tool' | ||
49 | |||
50 | Vue.use($dealArrNotDisabled) | ||
51 | |||
52 | import $treeConvertToArr from '../utils/tool' | ||
53 | |||
54 | Vue.use($treeConvertToArr) | ||
55 | |||
56 | import $setChildArr from '../utils/tool' | ||
57 | |||
58 | Vue.use($setChildArr) | ||
59 | |||
60 | import $findParent from '../utils/tool' | ||
61 | |||
62 | Vue.use($findParent) | ||
63 | |||
64 | import $findChildren from '../utils/tool' | ||
65 | |||
66 | Vue.use($findChildren) | ||
67 | |||
68 | import $getLocalStorage from '../utils/tool' | ||
69 | |||
70 | Vue.use($getLocalStorage) | ||
71 | |||
72 | |||
28 | Vue.use(Icon) | 73 | Vue.use(Icon) |
29 | 74 | ||
30 | Vue.use(Header) | 75 | Vue.use(Header) | ... | ... |
... | @@ -6,6 +6,7 @@ import '@/styles/element-variables.scss' | ... | @@ -6,6 +6,7 @@ import '@/styles/element-variables.scss' |
6 | import '@/styles/index.scss' | 6 | import '@/styles/index.scss' |
7 | import Base from './base' // 全局组件引入 | 7 | import Base from './base' // 全局组件引入 |
8 | import mixin from '@/utils/mixin/theme.js' | 8 | import mixin from '@/utils/mixin/theme.js' |
9 | |||
9 | import dataV from '@jiaminghi/data-view'; | 10 | import dataV from '@jiaminghi/data-view'; |
10 | import echarts from "echarts" | 11 | import echarts from "echarts" |
11 | import { startLoadingAddCount, endLoadingSubCount } from './utils/requestLoading' | 12 | import { startLoadingAddCount, endLoadingSubCount } from './utils/requestLoading' | ... | ... |
src/mixins/TableListMixin.js
0 → 100644
1 | /** | ||
2 | * 新增修改完成调用 dialogFormOk方法重置表单,修改新增弹框组件ref定义为dialogForm | ||
3 | * 弹框组件中新增方法add 编辑方法 edit | ||
4 | * 表格页面的data中tableUrl定义为接口地址 | ||
5 | * 弹窗页面定义初始this.init()方法,获取弹窗需要的数据 | ||
6 | * 表格ref=xTree | ||
7 | */ | ||
8 | import { deleteAction, getAction } from '@/api/manageApi' | ||
9 | |||
10 | export const TableListMixin = { | ||
11 | data() { | ||
12 | return { | ||
13 | // 查询拼接json字符串 | ||
14 | queryOptions: '', | ||
15 | queryParam: {}, // 查询条件 | ||
16 | /* 数据源 */ | ||
17 | tableData: [], | ||
18 | /* 分页参数*/ | ||
19 | ipagination: { | ||
20 | pageNumber: 0, | ||
21 | pageSize: 10 | ||
22 | }, | ||
23 | /* table选中行*/ | ||
24 | selectionRows: [], | ||
25 | loading: false // 表格加载状态 | ||
26 | } | ||
27 | }, | ||
28 | created() { | ||
29 | // console.log(' -- mixin created -- ') | ||
30 | // 初始化字典配置 在需要页面调用字典值获取方法 | ||
31 | this.initDictConfig() | ||
32 | }, | ||
33 | methods: { | ||
34 | // 加载表格数据 | ||
35 | loadData(arg) { | ||
36 | if (!this.tableUrl) { | ||
37 | console.log('请设置tableUrl属性为接口地址!') | ||
38 | return | ||
39 | } | ||
40 | // 加载数据 若传入参数1则加载第一页的内容 | ||
41 | // if (arg === 1) { | ||
42 | // } | ||
43 | const params = this.getQueryParams() // 查询条件 | ||
44 | this.loading = true | ||
45 | getAction(this.tableUrl, params) | ||
46 | .then(res => { | ||
47 | if (res.status === 1) { | ||
48 | this.loading = false | ||
49 | this.tableData = res.content | ||
50 | this.$nextTick(() => { | ||
51 | if (this.tableData.length !== 0) { | ||
52 | this.$refs.xTree && this.$refs.xTree.setAllTreeExpand(true) | ||
53 | } | ||
54 | }) | ||
55 | } else { | ||
56 | this.$message.error({ message: res.message, showClose: true }) | ||
57 | this.loading = false | ||
58 | } | ||
59 | }) | ||
60 | .catch(error => { | ||
61 | console.log('errrrrrorrrrr', error) | ||
62 | this.loading = false | ||
63 | }) | ||
64 | }, | ||
65 | // 字典值配置 | ||
66 | initDictConfig() { | ||
67 | // console.log('假初始化字典值方法!') | ||
68 | }, | ||
69 | // 选择所有和取消所有 | ||
70 | selectAllEvent({ checked, records }) { | ||
71 | this.selectionRows = records | ||
72 | }, | ||
73 | // 选中节点 | ||
74 | selectChangeEvent({ records }) { | ||
75 | this.selectionRows = records | ||
76 | }, | ||
77 | // 使用查询条件查询 | ||
78 | searchQuery() { | ||
79 | this.loadData() | ||
80 | }, | ||
81 | // 获取查询条件 | ||
82 | getQueryParams() { | ||
83 | if (this.queryOptions !== '') { | ||
84 | this.queryParam.queryOptions = JSON.stringify(this.queryOptions) | ||
85 | } | ||
86 | // console.log(this.$filterNullObj(this.queryParam), '查询条件') | ||
87 | return this.$filterNullObj(this.queryParam) | ||
88 | }, | ||
89 | // 新增 | ||
90 | handleAdd: function() { | ||
91 | this.$refs.dialogForm.add() | ||
92 | this.$refs.dialogForm.title = '新增' | ||
93 | }, | ||
94 | // 修改 | ||
95 | handleEdit: function(record) { | ||
96 | localStorage.setItem('record', JSON.stringify(record)) | ||
97 | this.$refs.dialogForm.edit(record) | ||
98 | this.$refs.dialogForm.title = '修改' | ||
99 | }, | ||
100 | // 删除 | ||
101 | handleDelete: function(id, content = '') { | ||
102 | this.$confirm( | ||
103 | `<div class="customer-message-wrapper"> | ||
104 | <h5 class="title">您确认要执行该操作用于以下信息:</h5> | ||
105 | <p class="content" aria-controls="${content}">${content} | ||
106 | </p> | ||
107 | <p class="result">执行后,数据将 | ||
108 | <span >无法恢复</span> | ||
109 | </p> | ||
110 | </div>`, | ||
111 | '执行确认', | ||
112 | { | ||
113 | dangerouslyUseHTMLString: true, | ||
114 | customClass: 'customer-delete', | ||
115 | confirmButtonText: '确定', | ||
116 | cancelButtonText: '取消', | ||
117 | type: 'warning' | ||
118 | } | ||
119 | ) | ||
120 | .then(() => { | ||
121 | if (!this.tableUrl) { | ||
122 | this.$message.error({ | ||
123 | message: '请设置tableUrl属性为接口地址!', | ||
124 | showClose: true | ||
125 | }) | ||
126 | return | ||
127 | } | ||
128 | const url = this.tableUrl + '/' + id | ||
129 | deleteAction(url).then(res => { | ||
130 | if (res.status === 1) { | ||
131 | this.$message.success({ message: res.message, showClose: true }) | ||
132 | this.loadDataS(this.subcode) | ||
133 | } else { | ||
134 | this.$message.error({ message: res.message, showClose: true }) | ||
135 | } | ||
136 | }) | ||
137 | }) | ||
138 | .catch(() => {}) | ||
139 | }, | ||
140 | // 批量删除 | ||
141 | batchDel: function() { | ||
142 | if (!this.tableUrl) { | ||
143 | this.$message.error({ | ||
144 | message: '请设置tableUrl属性为接口地址!', | ||
145 | showClose: true | ||
146 | }) | ||
147 | return | ||
148 | } | ||
149 | if (this.selectionRows.length === 0) { | ||
150 | this.$message.error({ | ||
151 | message: '请选择删除项!', | ||
152 | showClose: true | ||
153 | }) | ||
154 | return | ||
155 | } | ||
156 | this.$confirm('确定要删除吗?', '提示', { | ||
157 | confirmButtonText: '确定', | ||
158 | cancelButtonText: '取消', | ||
159 | type: 'warning' | ||
160 | }) | ||
161 | .then(() => { | ||
162 | const ids = [] | ||
163 | this.selectionRows.forEach(element => { | ||
164 | ids.push(element.id) | ||
165 | }) | ||
166 | deleteAction(this.tableUrl, ids).then(res => { | ||
167 | if (res.status === 1) { | ||
168 | this.$message.success({ message: res.message, showClose: true }) | ||
169 | this.loadData() | ||
170 | } else { | ||
171 | this.$message.error({ message: res.message, showClose: true }) | ||
172 | } | ||
173 | }) | ||
174 | }) | ||
175 | .catch(() => {}) | ||
176 | }, | ||
177 | // 新增或修改成功时,重载列表 | ||
178 | dialogFormOk() { | ||
179 | this.loadData() | ||
180 | }, | ||
181 | // 导出 | ||
182 | handleExportXls(data, name) { | ||
183 | if (name === '菜单' || name === '部门' || name === '机构' || | ||
184 | name === '资源' || name === '资源分类' || name === '数据字典' || name === '行政区划') { | ||
185 | const params = this.getQueryParams() // 查询条件 | ||
186 | getAction(this.tableUrl + '/export', params) | ||
187 | .then(res => { | ||
188 | if (res.status === 1) { | ||
189 | data = res.content | ||
190 | this.$downloadJson(data, name) | ||
191 | } else { | ||
192 | this.$message.error({ message: '导出失败', showClose: true }) | ||
193 | } | ||
194 | }) | ||
195 | } else if (name === '人员') { | ||
196 | exportUserList(this.queryParam).then((res) => { | ||
197 | if (res.status === 1) { | ||
198 | data = res.content | ||
199 | this.$downloadJson(data, name) | ||
200 | } else { | ||
201 | this.$message.error({ message: '导出失败', showClose: true }) | ||
202 | } | ||
203 | }) | ||
204 | } else { | ||
205 | this.$downloadJson(data, name) | ||
206 | } | ||
207 | }, | ||
208 | /* 导入 */ | ||
209 | handleImportExcel(info) {} | ||
210 | } | ||
211 | } |
src/utils/proDomStr.js
0 → 100644
src/utils/tool.js
0 → 100644
This diff is collapsed.
Click to expand it.
... | @@ -291,7 +291,7 @@ export default { | ... | @@ -291,7 +291,7 @@ export default { |
291 | handleSubmit () { | 291 | handleSubmit () { |
292 | editDictNode({ | 292 | editDictNode({ |
293 | dictid: this.details.rowData.dictid, | 293 | dictid: this.details.rowData.dictid, |
294 | typeid: this.details.rowData.typeid, | 294 | typeid: this.details.rowData.TYPEID, |
295 | children: this.tableData, | 295 | children: this.tableData, |
296 | }).then((res) => { | 296 | }).then((res) => { |
297 | if (res.code === 200) { | 297 | if (res.code === 200) { | ... | ... |
src/views/system/informations/base-set.vue
0 → 100644
1 | <template> | ||
2 | <div class="content"> | ||
3 | <div class="user-info"> | ||
4 | <el-form | ||
5 | ref="form" | ||
6 | label-width="100px" | ||
7 | :model="form" | ||
8 | class="form-wrapper" | ||
9 | :rules="rules" | ||
10 | > | ||
11 | <el-form-item label="用户名:" required> | ||
12 | <el-input v-model="form.loginName" clearable disabled /> | ||
13 | </el-form-item> | ||
14 | <el-form-item label="姓名:"> | ||
15 | <el-input v-model="form.name" clearable /> | ||
16 | </el-form-item> | ||
17 | <el-form-item label="性别:"> | ||
18 | <el-radio-group v-model="form.sex"> | ||
19 | <el-radio | ||
20 | v-for="(item, index) in sexList" | ||
21 | :key="index" | ||
22 | :label="item.value" | ||
23 | >{{ item.name }}</el-radio | ||
24 | > | ||
25 | </el-radio-group> | ||
26 | </el-form-item> | ||
27 | <el-form-item label="身份证号:" prop="idCard"> | ||
28 | <el-input v-model="form.idCard" clearable /> | ||
29 | </el-form-item> | ||
30 | <el-form-item label="手机号码:" prop="mobilePhone"> | ||
31 | <el-input v-model="form.mobilePhone" clearable /> | ||
32 | </el-form-item> | ||
33 | <el-form-item label="办公电话:" prop="telephone"> | ||
34 | <el-input v-model="form.telephone" clearable /> | ||
35 | </el-form-item> | ||
36 | <el-form-item label="办公地址:"> | ||
37 | <el-input v-model="form.address" clearable /> | ||
38 | </el-form-item> | ||
39 | </el-form> | ||
40 | <div class="bottom-wrapper"> | ||
41 | <el-button type="primary" @click="updateInfo">更新信息</el-button> | ||
42 | </div> | ||
43 | </div> | ||
44 | </div> | ||
45 | </template> | ||
46 | |||
47 | <script> | ||
48 | // import { api, getAction, putAction, getDictItems } from '@api/manageApi' | ||
49 | export default { | ||
50 | props: { | ||
51 | // userInfo: { | ||
52 | // type: Object, | ||
53 | // default: null | ||
54 | // } | ||
55 | }, | ||
56 | data() { | ||
57 | return { | ||
58 | form: { | ||
59 | id: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
60 | name: "超级管理员", | ||
61 | sort: 1, | ||
62 | loginName: "admin", | ||
63 | email: null, | ||
64 | lastLoginTime: null, | ||
65 | mobilePhone: "18291003568", | ||
66 | isLocked: false, | ||
67 | status: "ACTIVE", | ||
68 | passwordChangeTime: "2021-12-10T08:01:01.569+0000", | ||
69 | idCard: "612725202111021521", | ||
70 | departmentId: "2eae5304-544f-4f5b-b354-8f5d47433c9b", | ||
71 | departmentName: null, | ||
72 | organizationId: "0bca67ae-1d9e-4b41-b057-f165586d24aa", | ||
73 | sex: "0", | ||
74 | isDuty: true, | ||
75 | code: "123324", | ||
76 | jobLevel: null, | ||
77 | telephone: "028-87720898", | ||
78 | address: "办公地点修改测试", | ||
79 | }, | ||
80 | sexList: [], | ||
81 | rules: { | ||
82 | mobilePhone: [ | ||
83 | { | ||
84 | pattern: | ||
85 | /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/, | ||
86 | message: "手机号码格式有误", | ||
87 | trigger: "blur", | ||
88 | }, | ||
89 | ], | ||
90 | idCard: [ | ||
91 | { | ||
92 | pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, | ||
93 | message: "身份证号格式有误", | ||
94 | trigger: "blur", | ||
95 | }, | ||
96 | ], | ||
97 | telephone: [ | ||
98 | { | ||
99 | pattern: /\d{3}-\d{8}|\d{4}-\d{7}/, | ||
100 | message: "办公电话格式有误", | ||
101 | trigger: "blur", | ||
102 | }, | ||
103 | ], | ||
104 | }, | ||
105 | }; | ||
106 | }, | ||
107 | watch: { | ||
108 | // userInfo: { | ||
109 | // handler: function(val) { | ||
110 | // if (val) { | ||
111 | // this.getUserInfo(val.id) | ||
112 | // } | ||
113 | // } | ||
114 | // } | ||
115 | }, | ||
116 | mounted() { | ||
117 | // getDictItems('XB').then((res) => { | ||
118 | // if (res.status === 1) { | ||
119 | this.sexList = [ | ||
120 | { | ||
121 | id: "079c72b2-f3de-4a4f-b2a1-e5c8f085cc5f", | ||
122 | createdAt: "2021-06-11T02:42:02.000+0000", | ||
123 | updatedAt: "2021-09-03T09:21:46.000+0000", | ||
124 | createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
125 | updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
126 | sort: 2, | ||
127 | name: "男", | ||
128 | description: "", | ||
129 | code: "N362", | ||
130 | value: "0", | ||
131 | parentId: null, | ||
132 | baseDataCategoryId: "11441374-5e2a-4635-bfa5-d1a430222019", | ||
133 | version: 1, | ||
134 | valid: true, | ||
135 | standard: false, | ||
136 | standardName: null, | ||
137 | standardValue: null, | ||
138 | children: [], | ||
139 | commonName: "男(N362)", | ||
140 | }, | ||
141 | { | ||
142 | id: "4d6f845d-6f6a-4848-8fc2-a3760764c196", | ||
143 | createdAt: "2021-06-11T02:42:12.000+0000", | ||
144 | updatedAt: "2021-09-03T09:21:46.000+0000", | ||
145 | createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
146 | updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
147 | sort: 1, | ||
148 | name: "女", | ||
149 | description: "", | ||
150 | code: "N922", | ||
151 | value: "1", | ||
152 | parentId: null, | ||
153 | baseDataCategoryId: "11441374-5e2a-4635-bfa5-d1a430222019", | ||
154 | version: 1, | ||
155 | valid: true, | ||
156 | standard: false, | ||
157 | standardName: null, | ||
158 | standardValue: null, | ||
159 | children: [], | ||
160 | commonName: "女(N922)", | ||
161 | }, | ||
162 | { | ||
163 | id: "637c360b-d4e2-4afb-aa18-33624cf3abcb", | ||
164 | createdAt: "2021-06-11T02:42:29.000+0000", | ||
165 | updatedAt: "2021-09-03T09:21:43.000+0000", | ||
166 | createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
167 | updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
168 | sort: 0, | ||
169 | name: "保密", | ||
170 | description: "", | ||
171 | code: "BM816", | ||
172 | value: "2", | ||
173 | parentId: null, | ||
174 | baseDataCategoryId: "11441374-5e2a-4635-bfa5-d1a430222019", | ||
175 | version: 1, | ||
176 | valid: true, | ||
177 | standard: false, | ||
178 | standardName: null, | ||
179 | standardValue: null, | ||
180 | children: [], | ||
181 | commonName: "保密(BM816)", | ||
182 | }, | ||
183 | ]; | ||
184 | // } else { | ||
185 | // this.$message.error({ message: res.message, showClose: true }) | ||
186 | // } | ||
187 | // }) | ||
188 | }, | ||
189 | methods: { | ||
190 | // getUserInfo(id) { | ||
191 | // getAction(`${api.users}/${id}`).then((res) => { | ||
192 | // if (res.status === 1) { | ||
193 | |||
194 | // } else { | ||
195 | // this.$message.error({ message: res.message, showClose: true }) | ||
196 | // } | ||
197 | // }) | ||
198 | // }, | ||
199 | // 更新信息 | ||
200 | updateInfo() { | ||
201 | // this.$refs.form.validate((valid) => { | ||
202 | // if (valid) { | ||
203 | // putAction(`${api.users}/${this.form.id}`, this.form).then((res) => { | ||
204 | // if (res.status === 1) { | ||
205 | // this.$message.success({ message: res.message, showClose: true }) | ||
206 | // this.getUserInfo(this.form.id) | ||
207 | // } else { | ||
208 | // this.$message.error({ message: res.message, showClose: true }) | ||
209 | // } | ||
210 | // }) | ||
211 | // } | ||
212 | // }) | ||
213 | }, | ||
214 | }, | ||
215 | }; | ||
216 | </script> | ||
217 | |||
218 | <style scoped lang="scss"> | ||
219 | .user-info { | ||
220 | margin: 0.1875rem 1.0417rem; | ||
221 | background: #ffffff; | ||
222 | max-height: 90%; | ||
223 | overflow-y: auto; | ||
224 | .form-wrapper { | ||
225 | padding: 24px 120px 0px; | ||
226 | .el-form-item { | ||
227 | margin-bottom: 24px; | ||
228 | .el-form-item__label { | ||
229 | color: #747e8c; | ||
230 | } | ||
231 | ::v-deep .el-input .el-input__inner { | ||
232 | padding: 0 8px; | ||
233 | height: 40px; | ||
234 | line-height: 40px; | ||
235 | border: 1px solid #6BC1FC; | ||
236 | } | ||
237 | } | ||
238 | } | ||
239 | .bottom-wrapper { | ||
240 | padding: 32px 120px 24px; | ||
241 | text-align: right; | ||
242 | } | ||
243 | } | ||
244 | </style> |
src/views/system/informations/index.vue
0 → 100644
1 | <template> | ||
2 | <div class="information from-clues"> | ||
3 | <div class="from-clues-header"> | ||
4 | <el-form ref="ruleForm" label-width="100px"> | ||
5 | <el-form-item> | ||
6 | <Breadcrumb /> | ||
7 | </el-form-item> | ||
8 | <el-row class="mb-5"> | ||
9 | <el-col :span="3" class="btnColRight"> | ||
10 | <btn nativeType="cx" @click="information">基本信息</btn> | ||
11 | <btn nativeType="cx" @click="password">修改密码</btn> | ||
12 | </el-col> | ||
13 | </el-row> | ||
14 | </el-form> | ||
15 | </div> | ||
16 | <div class="from-clues-content"> | ||
17 | <div class="contentbox"> | ||
18 | <base-set v-show="isshow" /> | ||
19 | <password-edit v-show="!isshow" /> | ||
20 | </div> | ||
21 | </div> | ||
22 | </div> | ||
23 | </template> | ||
24 | <script> | ||
25 | import "@/utils/flexible.js"; | ||
26 | import BaseSet from "./base-set.vue"; | ||
27 | import PasswordEdit from "./password-edit.vue"; | ||
28 | export default { | ||
29 | components: { | ||
30 | BaseSet, | ||
31 | PasswordEdit, | ||
32 | }, | ||
33 | data() { | ||
34 | return { | ||
35 | active: "baseSet", | ||
36 | isshow: true, | ||
37 | }; | ||
38 | }, | ||
39 | computed: {}, | ||
40 | watch: {}, | ||
41 | created() {}, | ||
42 | mounted() {}, | ||
43 | methods: { | ||
44 | information() { | ||
45 | this.isshow = true; | ||
46 | }, | ||
47 | password() { | ||
48 | this.isshow = false; | ||
49 | }, | ||
50 | }, | ||
51 | }; | ||
52 | </script> | ||
53 | |||
54 | <style scoped lang="scss"> | ||
55 | @import "~@/styles/mixin.scss"; | ||
56 | @import "~@/styles/public.scss"; | ||
57 | .information{ | ||
58 | .btnColRight{ | ||
59 | margin-top: 20px; | ||
60 | } | ||
61 | /deep/.content { | ||
62 | .el-input__inner{ | ||
63 | background: none; | ||
64 | } | ||
65 | .user-info { | ||
66 | background: none; | ||
67 | } | ||
68 | } | ||
69 | /deep/.el-tabs { | ||
70 | |||
71 | .el-tabs__content { | ||
72 | height: 100%; | ||
73 | width: 100%; | ||
74 | |||
75 | |||
76 | } | ||
77 | } | ||
78 | .contentbox{ | ||
79 | height: 3.0854rem; | ||
80 | } | ||
81 | } | ||
82 | |||
83 | </style> |
1 | <template> | ||
2 | <div class="content"> | ||
3 | <div class="user-info"> | ||
4 | <el-form | ||
5 | ref="form" | ||
6 | label-width="100px" | ||
7 | :model="form" | ||
8 | class="form-wrapper" | ||
9 | :rules="rules" | ||
10 | > | ||
11 | <el-form-item label="旧密码:" required prop="oldPassword"> | ||
12 | <el-input | ||
13 | v-model="form.oldPassword" | ||
14 | clearable | ||
15 | type="password" | ||
16 | show-password | ||
17 | /> | ||
18 | </el-form-item> | ||
19 | <el-form-item label="新密码:" required prop="newPassword"> | ||
20 | <el-input | ||
21 | v-model="form.newPassword" | ||
22 | clearable | ||
23 | type="password" | ||
24 | show-password | ||
25 | /> | ||
26 | </el-form-item> | ||
27 | <el-form-item label="确认密码:" required prop="confirmPassword"> | ||
28 | <el-input | ||
29 | v-model="form.confirmPassword" | ||
30 | clearable | ||
31 | type="password" | ||
32 | show-password | ||
33 | /> | ||
34 | </el-form-item> | ||
35 | </el-form> | ||
36 | <div class="bottom-wrapper"> | ||
37 | <el-button type="primary" @click="updatePassword">确认修改</el-button> | ||
38 | </div> | ||
39 | </div> | ||
40 | </div> | ||
41 | </template> | ||
42 | |||
43 | <script> | ||
44 | // import { updateUserPassword } from '@api/organizationManage' | ||
45 | export default { | ||
46 | props: { | ||
47 | // userInfo: { | ||
48 | // type: Object, | ||
49 | // default: null | ||
50 | // } | ||
51 | }, | ||
52 | data() { | ||
53 | return { | ||
54 | form: {}, | ||
55 | sexList: [], | ||
56 | userId: '', | ||
57 | rules: { | ||
58 | oldPassword: [ | ||
59 | { required: true, message: '旧密码不能为空', trigger: 'blur' } | ||
60 | ], | ||
61 | newPassword: [ | ||
62 | { required: true, message: '新密码不能为空', trigger: 'blur' } | ||
63 | ], | ||
64 | confirmPassword: [ | ||
65 | { required: true, message: '确认密码不能为空', trigger: 'blur' }, | ||
66 | { validator: this.validatorConfirmPassword, trigger: 'blur' } | ||
67 | ] | ||
68 | } | ||
69 | } | ||
70 | }, | ||
71 | computed: {}, | ||
72 | watch: { | ||
73 | // userInfo: { | ||
74 | // handler: function(val) { | ||
75 | // if (val) { | ||
76 | // this.userId = val.id | ||
77 | // } | ||
78 | // } | ||
79 | // } | ||
80 | }, | ||
81 | mounted() {}, | ||
82 | methods: { | ||
83 | validatorConfirmPassword(rule, value, callback) { | ||
84 | const { newPassword } = this.form | ||
85 | if (value !== newPassword) { | ||
86 | callback('两次输入密码不一致') | ||
87 | } else { | ||
88 | callback() | ||
89 | } | ||
90 | }, | ||
91 | // 确认修改 | ||
92 | updatePassword() { | ||
93 | // this.$refs.form.validate((valid) => { | ||
94 | // if (valid) { | ||
95 | // const params = Object.assign({}, this.form, { id: this.userId }) | ||
96 | // updateUserPassword(params).then((res) => { | ||
97 | // if (res.status === 1) { | ||
98 | // this.$message.success({ message: res.message, showClose: true }) | ||
99 | // } else { | ||
100 | // this.$message.error({ message: res.message, showClose: true }) | ||
101 | // } | ||
102 | // }) | ||
103 | // } | ||
104 | // }) | ||
105 | } | ||
106 | } | ||
107 | } | ||
108 | </script> | ||
109 | |||
110 | <style scoped lang="scss"> | ||
111 | .user-info { | ||
112 | margin: 36px 200px; | ||
113 | background: #ffffff; | ||
114 | max-height: 90%; | ||
115 | overflow-y: auto; | ||
116 | .form-wrapper { | ||
117 | padding: 24px 120px 0px; | ||
118 | .el-form-item { | ||
119 | margin-bottom: 24px; | ||
120 | .el-form-item__label { | ||
121 | color: #747e8c; | ||
122 | } | ||
123 | ::v-deep .el-input .el-input__inner { | ||
124 | padding: 0 8px; | ||
125 | height: 40px; | ||
126 | line-height: 40px; | ||
127 | border: 1px solid #6BC1FC; | ||
128 | } | ||
129 | } | ||
130 | } | ||
131 | .bottom-wrapper { | ||
132 | padding: 32px 120px 24px; | ||
133 | text-align: right; | ||
134 | } | ||
135 | } | ||
136 | </style> |
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
... | @@ -26,7 +26,7 @@ | ... | @@ -26,7 +26,7 @@ |
26 | > | 26 | > |
27 | </lb-table> | 27 | </lb-table> |
28 | </div> | 28 | </div> |
29 | <EditDialog ref="addEditDialog" /> | 29 | <EditDialog ref="addEditDialog" @ok="reloadTableData" /> |
30 | <Roleslistdiglog ref="rolesForm" /> | 30 | <Roleslistdiglog ref="rolesForm" /> |
31 | </div> | 31 | </div> |
32 | </template> | 32 | </template> |
... | @@ -38,7 +38,7 @@ import { | ... | @@ -38,7 +38,7 @@ import { |
38 | findParents, | 38 | findParents, |
39 | removeTreeListItem, | 39 | removeTreeListItem, |
40 | } from "@/utils/operation"; | 40 | } from "@/utils/operation"; |
41 | import { getRolesById, getUserRoles } from "@/api/Rolemanagement"; | 41 | import { getRolesById, getUserRoles } from "@/api/quanxianmanagement"; |
42 | import data from "./data"; | 42 | import data from "./data"; |
43 | import sjsbTask from "@/api/sjsbTask.js"; | 43 | import sjsbTask from "@/api/sjsbTask.js"; |
44 | import { api, getAction,deleteAction } from "@/api/manageApi"; | 44 | import { api, getAction,deleteAction } from "@/api/manageApi"; |
... | @@ -213,11 +213,9 @@ export default { | ... | @@ -213,11 +213,9 @@ export default { |
213 | 213 | ||
214 | getRolesById(1) | 214 | getRolesById(1) |
215 | .then((res) => { | 215 | .then((res) => { |
216 | console.log("res.content", res.content); | ||
217 | Builtinrole = res.content; | 216 | Builtinrole = res.content; |
218 | getRolesById(2) | 217 | getRolesById(2) |
219 | .then((res) => { | 218 | .then((res) => { |
220 | console.log("res.content", res.content); | ||
221 | Publicrole = res.content; | 219 | Publicrole = res.content; |
222 | 220 | ||
223 | this.listdata = Builtinrole.concat(Publicrole); | 221 | this.listdata = Builtinrole.concat(Publicrole); |
... | @@ -336,7 +334,7 @@ export default { | ... | @@ -336,7 +334,7 @@ export default { |
336 | deleteAction(url).then(res => { | 334 | deleteAction(url).then(res => { |
337 | if (res.status === 1) { | 335 | if (res.status === 1) { |
338 | this.$message.success({ message: res.message, showClose: true }) | 336 | this.$message.success({ message: res.message, showClose: true }) |
339 | this.loadDataS(this.subcode) | 337 | this.getTableData() |
340 | } else { | 338 | } else { |
341 | this.$message.error({ message: res.message, showClose: true }) | 339 | this.$message.error({ message: res.message, showClose: true }) |
342 | } | 340 | } |
... | @@ -344,6 +342,10 @@ export default { | ... | @@ -344,6 +342,10 @@ export default { |
344 | }) | 342 | }) |
345 | .catch(() => {}) | 343 | .catch(() => {}) |
346 | }, | 344 | }, |
345 | // 新增回显 | ||
346 | reloadTableData() { | ||
347 | this.getTableData() | ||
348 | }, | ||
347 | }, | 349 | }, |
348 | }; | 350 | }; |
349 | </script> | 351 | </script> | ... | ... |
... | @@ -27,7 +27,7 @@ | ... | @@ -27,7 +27,7 @@ |
27 | 27 | ||
28 | <script> | 28 | <script> |
29 | import Dialog from "@/components/Dialog/"; | 29 | import Dialog from "@/components/Dialog/"; |
30 | import { updateUser } from "@/api/Rolemanagement"; | 30 | import { updateUser } from "@/api/quanxianmanagement"; |
31 | export default { | 31 | export default { |
32 | name: "", | 32 | name: "", |
33 | components: { Dialog }, | 33 | components: { Dialog }, |
... | @@ -87,7 +87,6 @@ export default { | ... | @@ -87,7 +87,6 @@ export default { |
87 | adds(a, rid) { | 87 | adds(a, rid) { |
88 | this.roleId = rid; | 88 | this.roleId = rid; |
89 | this.visible = true; | 89 | this.visible = true; |
90 | console.log("a", a); | ||
91 | this.tableData.data = a; | 90 | this.tableData.data = a; |
92 | this.tableData.data.forEach((item, index) => { | 91 | this.tableData.data.forEach((item, index) => { |
93 | if (item.selectStatus === 0) { | 92 | if (item.selectStatus === 0) { |
... | @@ -108,9 +107,7 @@ export default { | ... | @@ -108,9 +107,7 @@ export default { |
108 | const idList = this.multipleSelection.map((item) => { | 107 | const idList = this.multipleSelection.map((item) => { |
109 | return item.id; | 108 | return item.id; |
110 | }); | 109 | }); |
111 | console.log("this.roleId",this.roleId,idList); | ||
112 | updateUser(this.roleId, idList).then((res) => { | 110 | updateUser(this.roleId, idList).then((res) => { |
113 | console.log("res",res); | ||
114 | if (res.status === 1) { | 111 | if (res.status === 1) { |
115 | this.$message.success({ message: "保存成功", showClose: true }); | 112 | this.$message.success({ message: "保存成功", showClose: true }); |
116 | this.visible = false; | 113 | this.visible = false; |
... | @@ -120,7 +117,6 @@ export default { | ... | @@ -120,7 +117,6 @@ export default { |
120 | }); | 117 | }); |
121 | }, | 118 | }, |
122 | handleSelectionChange(val) { | 119 | handleSelectionChange(val) { |
123 | console.log("val", val); | ||
124 | this.multipleSelection = val; | 120 | this.multipleSelection = val; |
125 | }, | 121 | }, |
126 | }, | 122 | }, | ... | ... |
... | @@ -6,25 +6,20 @@ class data extends filter { | ... | @@ -6,25 +6,20 @@ class data extends filter { |
6 | columns () { | 6 | columns () { |
7 | return [ | 7 | return [ |
8 | { | 8 | { |
9 | prop: "DCODE", | 9 | prop: "code", |
10 | label: "工号", | 10 | label: "工号", |
11 | width: 130 | 11 | width: 130 |
12 | }, | 12 | }, |
13 | { | 13 | { |
14 | prop: "DNAME", | 14 | prop: "name", |
15 | label: "姓名", | 15 | label: "姓名", |
16 | width: 300 | 16 | width: 300 |
17 | }, | 17 | }, |
18 | { | 18 | { |
19 | prop: "PARENTID", | 19 | prop: "loginName", |
20 | label: "用户名" | 20 | label: "用户名" |
21 | }, | 21 | }, |
22 | { | 22 | { |
23 | prop: "TYPEID", | ||
24 | width: 260, | ||
25 | label: "负责人" | ||
26 | }, | ||
27 | { | ||
28 | prop: "departmentName", | 23 | prop: "departmentName", |
29 | label: "所属部门" | 24 | label: "所属部门" |
30 | }, | 25 | }, | ... | ... |
... | @@ -103,6 +103,7 @@ | ... | @@ -103,6 +103,7 @@ |
103 | </template> | 103 | </template> |
104 | 104 | ||
105 | <script> | 105 | <script> |
106 | import { api, httpAction } from '@/api/manageApi' | ||
106 | import Dialog from "@/components/Dialog/"; | 107 | import Dialog from "@/components/Dialog/"; |
107 | export default { | 108 | export default { |
108 | name: "", | 109 | name: "", |
... | @@ -126,11 +127,14 @@ export default { | ... | @@ -126,11 +127,14 @@ export default { |
126 | showLoginName: false, | 127 | showLoginName: false, |
127 | sexList: [{lable:"0",value:"0",name:"男"},{lable:"1",value:"1",name:"女"}], | 128 | sexList: [{lable:"0",value:"0",name:"男"},{lable:"1",value:"1",name:"女"}], |
128 | levelList: [{lable:"0",value:"0",name:"干事"},{lable:"1",value:"1",name:"经理"}], | 129 | levelList: [{lable:"0",value:"0",name:"干事"},{lable:"1",value:"1",name:"经理"}], |
129 | organizationId: "", // 组织机构ID | 130 | dataUrl: api.users |
130 | departmentId: "", // 部门ID | ||
131 | }; | 131 | }; |
132 | }, | 132 | }, |
133 | computed: {}, | 133 | computed: { |
134 | departmentid() { | ||
135 | return this.$store.state.user.userInfo; | ||
136 | }, | ||
137 | }, | ||
134 | watch: {}, | 138 | watch: {}, |
135 | created() {}, | 139 | created() {}, |
136 | mounted() {}, | 140 | mounted() {}, |
... | @@ -151,11 +155,13 @@ export default { | ... | @@ -151,11 +155,13 @@ export default { |
151 | // } | 155 | // } |
152 | // }) | 156 | // }) |
153 | // }, | 157 | // }, |
158 | // 添加人员 | ||
154 | add() { | 159 | add() { |
155 | this.visible = true; | 160 | this.visible = true; |
156 | // this.type = 0 | 161 | // this.type = 0 |
157 | this.showLoginName = false | 162 | this.showLoginName = false |
158 | }, | 163 | }, |
164 | // 编辑 | ||
159 | edit(record) { | 165 | edit(record) { |
160 | // this.initDictConfig() | 166 | // this.initDictConfig() |
161 | this.showLoginName = true | 167 | this.showLoginName = true |
... | @@ -170,11 +176,14 @@ export default { | ... | @@ -170,11 +176,14 @@ export default { |
170 | handleChange(value) { | 176 | handleChange(value) { |
171 | this.form.departmentId = value; | 177 | this.form.departmentId = value; |
172 | }, | 178 | }, |
179 | // 保存 | ||
173 | submitForm(submitType) { | 180 | submitForm(submitType) { |
174 | this.$refs.form.validate((valid) => { | 181 | this.$refs.form.validate((valid) => { |
175 | if (valid) { | 182 | if (valid) { |
176 | let method = '' | 183 | let method = '' |
177 | let url = '' | 184 | let url = '' |
185 | this.form.organizationId=this.departmentid.organizationId; | ||
186 | this.form.departmentId=this.departmentid.departmentId; | ||
178 | const formData = this.form | 187 | const formData = this.form |
179 | if (!formData.id) { | 188 | if (!formData.id) { |
180 | method = 'post' | 189 | method = 'post' |
... | @@ -183,21 +192,16 @@ export default { | ... | @@ -183,21 +192,16 @@ export default { |
183 | method = 'put' | 192 | method = 'put' |
184 | url = `${this.dataUrl}/${formData.id}` | 193 | url = `${this.dataUrl}/${formData.id}` |
185 | } | 194 | } |
195 | |||
186 | httpAction(url, formData, method).then((res) => { | 196 | httpAction(url, formData, method).then((res) => { |
187 | if (res.status === 1) { | 197 | if (res.status === 1) { |
188 | this.$message.success({ message: res.message, showClose: true }) | 198 | this.$message.success({ message: res.message, showClose: true }) |
189 | // this.type 0新增 1编辑 | 199 | |
190 | if (this.type === 0) { | ||
191 | // submitType 1需要关闭页面 0保存&新增暂不关闭页面 | ||
192 | if (submitType === 1) { | ||
193 | this.close() | ||
194 | } else { | ||
195 | this.resetForm() | 200 | this.resetForm() |
196 | } | 201 | |
197 | } else if (this.type === 1) { | ||
198 | this.close() | 202 | this.close() |
199 | } | 203 | |
200 | this.$emit('ok') | 204 | this.$emit('ok') |
201 | } else { | 205 | } else { |
202 | this.$message.error({ message: res.message, showClose: true }) | 206 | this.$message.error({ message: res.message, showClose: true }) |
203 | } | 207 | } |
... | @@ -208,16 +212,16 @@ export default { | ... | @@ -208,16 +212,16 @@ export default { |
208 | } | 212 | } |
209 | }) | 213 | }) |
210 | }, | 214 | }, |
211 | resetForm() { | 215 | resetForm() { |
212 | this.form = { | 216 | this.form = { |
213 | sex: '0' | 217 | sex: '0' |
214 | } | 218 | } |
215 | this.$refs.form.resetFields() | 219 | this.$refs.form.resetFields() |
216 | }, | ||
217 | close() { | ||
218 | // this.resetForm() | ||
219 | this.visible = false; | ||
220 | }, | 220 | }, |
221 | close() { | ||
222 | this.resetForm() | ||
223 | this.visible = false | ||
224 | } | ||
221 | }, | 225 | }, |
222 | }; | 226 | }; |
223 | </script> | 227 | </script> | ... | ... |
... | @@ -29,7 +29,7 @@ | ... | @@ -29,7 +29,7 @@ |
29 | > | 29 | > |
30 | </lb-table> | 30 | </lb-table> |
31 | </div> | 31 | </div> |
32 | <edit-dialog ref="dialogForm" /> | 32 | <edit-dialog ref="dialogForm" @ok="reloadTableData"/> |
33 | </div> | 33 | </div> |
34 | </template> | 34 | </template> |
35 | <script> | 35 | <script> |
... | @@ -40,7 +40,13 @@ import { | ... | @@ -40,7 +40,13 @@ import { |
40 | findParents, | 40 | findParents, |
41 | removeTreeListItem, | 41 | removeTreeListItem, |
42 | } from "@/utils/operation"; | 42 | } from "@/utils/operation"; |
43 | import { | ||
44 | resetPassword, | ||
45 | getUserList, | ||
46 | } from "@/api/quanxianmanagement"; | ||
47 | import { api, deleteAction } from '@/api/manageApi' | ||
43 | import data from "./data"; | 48 | import data from "./data"; |
49 | import { deleteDomStr } from '@/utils/proDomStr' | ||
44 | import sjsbTask from "@/api/sjsbTask.js"; | 50 | import sjsbTask from "@/api/sjsbTask.js"; |
45 | import tableMixin from "@/mixins/tableMixin.js"; | 51 | import tableMixin from "@/mixins/tableMixin.js"; |
46 | import EditDialog from "./edit-dialog.vue"; | 52 | import EditDialog from "./edit-dialog.vue"; |
... | @@ -53,7 +59,7 @@ export default { | ... | @@ -53,7 +59,7 @@ export default { |
53 | data() { | 59 | data() { |
54 | return { | 60 | return { |
55 | taskData: null, | 61 | taskData: null, |
56 | keyList: [], | 62 | keyList: [], |
57 | form: { | 63 | form: { |
58 | job_name: "", | 64 | job_name: "", |
59 | currentPage: 1, | 65 | currentPage: 1, |
... | @@ -97,9 +103,17 @@ export default { | ... | @@ -97,9 +103,17 @@ export default { |
97 | ] | 103 | ] |
98 | .concat(data.columns()) | 104 | .concat(data.columns()) |
99 | .concat([ | 105 | .concat([ |
106 | { | ||
107 | label: "负责人", | ||
108 | render: (h, scope) => { | ||
109 | return ( | ||
110 | <i v-show={scope.row.isDuty!==null} class="el-icon-check" /> | ||
111 | ) | ||
112 | } | ||
113 | }, | ||
100 | { | 114 | { |
101 | label: "排序", | 115 | label: "排序", |
102 | width: 380, | 116 | width: 280, |
103 | render: (h, scope) => { | 117 | render: (h, scope) => { |
104 | return ( | 118 | return ( |
105 | <div> | 119 | <div> |
... | @@ -134,16 +148,6 @@ export default { | ... | @@ -134,16 +148,6 @@ export default { |
134 | <el-button | 148 | <el-button |
135 | type="text" | 149 | type="text" |
136 | size="mini" | 150 | size="mini" |
137 | icon="el-icon-edit" | ||
138 | onClick={() => { | ||
139 | this.updateLock(scope.row, scope.row.name); | ||
140 | }} | ||
141 | > | ||
142 | 解锁 | ||
143 | </el-button> | ||
144 | <el-button | ||
145 | type="text" | ||
146 | size="mini" | ||
147 | icon="el-icon-video-pause" | 151 | icon="el-icon-video-pause" |
148 | onClick={() => { | 152 | onClick={() => { |
149 | this.resetPassword(scope.row.id); | 153 | this.resetPassword(scope.row.id); |
... | @@ -186,82 +190,80 @@ export default { | ... | @@ -186,82 +190,80 @@ export default { |
186 | }, | 190 | }, |
187 | }; | 191 | }; |
188 | }, | 192 | }, |
189 | created() { | 193 | created() { |
190 | this.featchData(); | 194 | this.getTableList(); |
195 | }, | ||
196 | computed: { | ||
197 | departmentid() { | ||
198 | return this.$store.state.user.userInfo; | ||
199 | }, | ||
191 | }, | 200 | }, |
192 | methods: { | 201 | methods: { |
193 | |||
194 | handleAdd() { | 202 | handleAdd() { |
195 | this.taskData = null; | ||
196 | this.$refs.dialogForm.add(); | 203 | this.$refs.dialogForm.add(); |
197 | this.$refs.dialogForm.title = "添加"; | 204 | this.$refs.dialogForm.title = "添加"; |
198 | }, | 205 | }, |
199 | featchData() { | 206 | getTableList() { |
200 | 207 | this.loading = true; | |
201 | this.tableData.data = [ | 208 | this.queryParam = { |
202 | { | 209 | organizationId: this.departmentid.organizationId, |
203 | "dictid": "51b9f487861671f77782c5a23b5fe52e", | 210 | departmentId: this.departmentid.departmentId, |
204 | "children": null, | 211 | }; |
205 | "TYPEID": "1F460F6E5E354C1AA3C470434D7A67DF", | 212 | getUserList(this.queryParam).then((res) => { |
206 | "PARENTID": "ouyds", | 213 | if (res.status === 1) { |
207 | "DCODE": "1223", | 214 | this.loading = false; |
208 | "DNAME": "小红", | 215 | this.tableData.data = res.content; |
209 | "SORT": null, | 216 | this.tableData.data = judgeSort(this.tableData.data); |
210 | "index": 1, | 217 | } else { |
211 | }, | 218 | this.$message.error({ message: res.message, showClose: true }); |
212 | { | 219 | } |
213 | "dictid": "2291d9e298274c1ea1f40df63fbcff47", | 220 | }); |
214 | "children": null, | ||
215 | "TYPEID": "1F460F6E5E354C1AA3C470434D7A67DF", | ||
216 | "PARENTID": "wer", | ||
217 | "DCODE": "124334", | ||
218 | "DNAME": "小李", | ||
219 | "SORT": null, | ||
220 | "index": 2, | ||
221 | }, | 221 | }, |
222 | { | ||
223 | "dictid": "e6a5aeb8957b8029fa31586fb30dd5b8", | ||
224 | "children": null, | ||
225 | "TYPEID": "1F460F6E5E354C1AA3C470434D7A67DF", | ||
226 | "PARENTID": "underf", | ||
227 | "DCODE": "2344", | ||
228 | "DNAME": "小田", | ||
229 | "SORT": null, | ||
230 | "index": 13, | ||
231 | } | ||
232 | ] | ||
233 | this.tableData.data=judgeSort(this.tableData.data) | ||
234 | }, | ||
235 | 222 | ||
236 | // 更新用户解锁状态 | 223 | // 重置用户密码 |
237 | updateLock(id, name) { | 224 | resetPassword(data) { |
225 | const ids = [] | ||
226 | if (data instanceof Array) { | ||
227 | data.forEach((item) => { | ||
228 | ids.push(item.id) | ||
229 | }) | ||
230 | } else { | ||
231 | ids.push(data) | ||
232 | } | ||
233 | if (ids.length === 0) { | ||
234 | this.$message({ | ||
235 | message: '请选择需要重置密码的用户!', | ||
236 | showClose: true | ||
237 | }) | ||
238 | return | ||
239 | } | ||
238 | this.$confirm( | 240 | this.$confirm( |
239 | `<div class="customer-message-wrapper"> | 241 | `<div class="customer-message-wrapper"> |
240 | <h5 class="title">确定要更新用户解锁状态吗</h5> | 242 | <h5 class="title">确定要重置密码吗</h5> |
241 | <p class="result">执行后,数据将 | 243 | <p class="result">执行后,数据将 |
242 | <span >无法恢复</span> | 244 | <span >无法恢复</span> |
243 | </p> | 245 | </p> |
244 | </div>`, | 246 | </div>`, |
245 | "执行确认", | 247 | '执行确认', |
246 | { | 248 | { |
247 | dangerouslyUseHTMLString: true, | 249 | dangerouslyUseHTMLString: true, |
248 | customClass: "customer-delete", | 250 | customClass: 'customer-delete', |
249 | confirmButtonText: "确定", | 251 | confirmButtonText: '确定', |
250 | cancelButtonText: "取消", | 252 | cancelButtonText: '取消', |
251 | type: "warning", | 253 | type: 'warning' |
252 | } | 254 | } |
253 | ) | 255 | ) |
254 | .then(() => { | 256 | .then(() => { |
255 | // updateLock(id).then((res) => { | 257 | resetPassword(ids).then((res) => { |
256 | // if (res.status === 1) { | 258 | if (res.status === 1) { |
257 | // this.$message.success({ message: res.message, showClose: true }) | 259 | this.$message.success({ message: res.message, showClose: true }) |
258 | // this.getTableList() | 260 | this.getTableList() |
259 | // } else { | 261 | } else { |
260 | // this.$message.error({ message: res.message, showClose: true }) | 262 | this.$message.error({ message: res.message, showClose: true }) |
261 | // } | 263 | } |
262 | // }) | 264 | }) |
263 | }) | 265 | }) |
264 | .catch(() => {}); | 266 | .catch(() => {}) |
265 | }, | 267 | }, |
266 | // 上移下移 | 268 | // 上移下移 |
267 | moveUpward(index, row) { | 269 | moveUpward(index, row) { |
... | @@ -276,74 +278,35 @@ this.tableData.data=judgeSort(this.tableData.data) | ... | @@ -276,74 +278,35 @@ this.tableData.data=judgeSort(this.tableData.data) |
276 | let id = findParents(this.tableData.data, row.dictid); | 278 | let id = findParents(this.tableData.data, row.dictid); |
277 | this.keyList = id; | 279 | this.keyList = id; |
278 | }, | 280 | }, |
279 | // 重置用户密码 | ||
280 | resetPassword(data) { | ||
281 | const ids = []; | ||
282 | if (data instanceof Array) { | ||
283 | data.forEach((item) => { | ||
284 | ids.push(item.id); | ||
285 | }); | ||
286 | } else { | ||
287 | ids.push(data); | ||
288 | } | ||
289 | if (ids.length === 0) { | ||
290 | this.$message({ | ||
291 | message: "请选择需要重置密码的用户!", | ||
292 | showClose: true, | ||
293 | }); | ||
294 | return; | ||
295 | } | ||
296 | this.$confirm( | ||
297 | `<div class="customer-message-wrapper"> | ||
298 | <h5 class="title">确定要重置密码吗</h5> | ||
299 | <p class="result">执行后,数据将 | ||
300 | <span >无法恢复</span> | ||
301 | </p> | ||
302 | </div>`, | ||
303 | "执行确认", | ||
304 | { | ||
305 | dangerouslyUseHTMLString: true, | ||
306 | customClass: "customer-delete", | ||
307 | confirmButtonText: "确定", | ||
308 | cancelButtonText: "取消", | ||
309 | type: "warning", | ||
310 | } | ||
311 | ) | ||
312 | .then(() => { | ||
313 | // resetPassword(ids).then((res) => { | ||
314 | // if (res.status === 1) { | ||
315 | // this.$message.success({ message: res.message, showClose: true }) | ||
316 | // this.getTableList() | ||
317 | // } else { | ||
318 | // this.$message.error({ message: res.message, showClose: true }) | ||
319 | // } | ||
320 | // }) | ||
321 | }) | ||
322 | .catch(() => {}); | ||
323 | }, | ||
324 | // 修改人员信息 | 281 | // 修改人员信息 |
325 | handleEdit(row) { | 282 | handleEdit(row) { |
326 | this.$refs.dialogForm.edit(row); | 283 | this.$refs.dialogForm.edit(row); |
327 | this.$refs.dialogForm.title = "修改"; | 284 | this.$refs.dialogForm.title = "修改"; |
328 | }, | 285 | }, |
329 | // 删除 | 286 | // 删除 |
330 | handleDelete(id, content) { | 287 | handleDelete(id, content) { |
331 | this.$confirm("此操将进行删除操作, 是否继续?", "提示", { | 288 | this.$confirm(deleteDomStr(content), '执行确认', { |
332 | confirmButtonText: "确定", | 289 | dangerouslyUseHTMLString: true, |
333 | cancelButtonText: "取消", | 290 | customClass: 'customer-delete', |
334 | type: "warning", | 291 | confirmButtonText: '确定', |
292 | cancelButtonText: '取消', | ||
293 | type: 'warning' | ||
335 | }) | 294 | }) |
336 | .then(() => { | 295 | .then(() => { |
337 | // deleteAction(`${api.users}/${id}`).then((res) => { | 296 | deleteAction(`${api.users}/${id}`).then((res) => { |
338 | // if (res.status === 1) { | 297 | if (res.status === 1) { |
339 | // this.$message.success({ message: res.message, showClose: true }) | 298 | this.$message.success({ message: res.message, showClose: true }) |
340 | // } else { | 299 | } else { |
341 | // this.$message.error({ message: res.message, showClose: true }) | 300 | this.$message.error({ message: res.message, showClose: true }) |
342 | // } | 301 | } |
343 | // this.getTableList() | 302 | this.getTableList() |
344 | // }) | 303 | }) |
345 | }) | 304 | }) |
346 | .catch(() => {}); | 305 | .catch(() => {}) |
306 | }, | ||
307 | // 新增回显 | ||
308 | reloadTableData() { | ||
309 | this.getTableList() | ||
347 | }, | 310 | }, |
348 | }, | 311 | }, |
349 | }; | 312 | }; | ... | ... |
-
Please register or sign in to post a comment