Merge branch 'master' of http://113.200.75.45:82/monitor_v3/hg-monitor-web
Showing
14 changed files
with
684 additions
and
127 deletions
@@ -194,7 +194,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'upload', 'common', 'sessions', | @@ -194,7 +194,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'upload', 'common', 'sessions', | ||
194 | title: '操作', fixed: 'right', align: 'center',minWidth: 280, | 194 | title: '操作', fixed: 'right', align: 'center',minWidth: 280, |
195 | templet: '<div>' + | 195 | templet: '<div>' + |
196 | //lsq 新增变更按钮 2022-05-30 | 196 | //lsq 新增变更按钮 2022-05-30 |
197 | - '<button data-username="{{d.username}}" lay-tips="人员相关业务变更" type="button" class="layui-btn layui-btn-xs layui-btn-normal user_batch_change_leaders_btn"><i class="layui-icon layui-icon-edit"></i></button>'+ | 197 | + '<button data-username="{{d.username}}" data-nickname="{{d.nickname}}" lay-tips="人员相关业务变更" type="button" class="layui-btn layui-btn-xs layui-btn-normal user_batch_change_leaders_btn"><i class="layui-icon layui-icon-edit"></i></button>'+ |
198 | 198 | ||
199 | '<button data-id="{{d.id}}" lay-tips="删除" type="button" class="layui-btn layui-btn-xs layui-btn-normal user_delete_btn"><i class="layui-icon layui-icon-delete"></i></button>'+ | 199 | '<button data-id="{{d.id}}" lay-tips="删除" type="button" class="layui-btn layui-btn-xs layui-btn-normal user_delete_btn"><i class="layui-icon layui-icon-delete"></i></button>'+ |
200 | '<button data-id="{{d.id}}" data-username="{{d.username}}" lay-tips="重置密码" type="button" class="layui-btn layui-btn-xs layui-btn-normal user_pass_btn"><i class="layui-icon layui-icon-password"></i></button>'+ | 200 | '<button data-id="{{d.id}}" data-username="{{d.username}}" lay-tips="重置密码" type="button" class="layui-btn layui-btn-xs layui-btn-normal user_pass_btn"><i class="layui-icon layui-icon-password"></i></button>'+ |
@@ -288,10 +288,10 @@ layui.define(['table', 'form', 'admin', 'layer', 'upload', 'common', 'sessions', | @@ -288,10 +288,10 @@ layui.define(['table', 'form', 'admin', 'layer', 'upload', 'common', 'sessions', | ||
288 | } | 288 | } |
289 | //start lsq 人员相关业务批量变更 2022-05-30 | 289 | //start lsq 人员相关业务批量变更 2022-05-30 |
290 | $('.user_batch_change_leaders_btn').unbind().on('click',function () { | 290 | $('.user_batch_change_leaders_btn').unbind().on('click',function () { |
291 | - if ($.inArray('back:user:impower',permissionList) == -1) { | ||
292 | - layer.msg('暂无权限',{icon: 7,time:3000}) | ||
293 | - return false; | ||
294 | - } | 291 | + // if ($.inArray('back:user:impower',permissionList) == -1) { |
292 | + // layer.msg('暂无权限',{icon: 7,time:3000}) | ||
293 | + // return false; | ||
294 | + // } | ||
295 | let param = { | 295 | let param = { |
296 | username: $(this).data('username'), | 296 | username: $(this).data('username'), |
297 | resName: '' | 297 | resName: '' |
@@ -305,7 +305,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'upload', 'common', 'sessions', | @@ -305,7 +305,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'upload', 'common', 'sessions', | ||
305 | urlParams=urlParams.substr(0,urlParams.length-1); | 305 | urlParams=urlParams.substr(0,urlParams.length-1); |
306 | let title=` | 306 | let title=` |
307 | <div style="display: flex;justify-content: space-between; align-items: center;"> | 307 | <div style="display: flex;justify-content: space-between; align-items: center;"> |
308 | - <span>相关业务批量变更</span> | 308 | + <span>"`+$(this).data('nickname')+`"相关业务批量变更</span> |
309 | <button id="exportBtn" type="button" class="layui-btn layui-btn-sm layui-btn-normal exportBtn">导出</button> | 309 | <button id="exportBtn" type="button" class="layui-btn layui-btn-sm layui-btn-normal exportBtn">导出</button> |
310 | </div> | 310 | </div> |
311 | `; | 311 | `; |
1 | <div > | 1 | <div > |
2 | <!-- 表格--> | 2 | <!-- 表格--> |
3 | <el-table :border="showBorder" v-loading="loading" :size="size" ref="multipleTable" @selection-change="handleSelectionChange" :data="dataList" stripe header-row-class-name="tbl-header-class" :height="height" | 3 | <el-table :border="showBorder" v-loading="loading" :size="size" ref="multipleTable" @selection-change="handleSelectionChange" :data="dataList" stripe header-row-class-name="tbl-header-class" :height="height" |
4 | - style="width: 100%;margin: 0px 0px; font-size:13.5px;" :row-key="getRowKeys" :expand-row-keys="expands" :default-expand-all="defaultExpand"> | 4 | + style="width: 100%;margin: 0px 0px; font-size:13.5px;" :row-key="getRowKeys" :expand-row-keys="expands" :default-expand-all="defaultExpand" |
5 | + @select="handleSelect" @select-all="handleSelectAll" | ||
6 | + > | ||
5 | 7 | ||
6 | <el-table-column type="expand" v-if="showExpand"> | 8 | <el-table-column type="expand" v-if="showExpand"> |
7 | <template #default="scope"> | 9 | <template #default="scope"> |
@@ -155,6 +155,7 @@ export default { | @@ -155,6 +155,7 @@ export default { | ||
155 | let params = { | 155 | let params = { |
156 | page: currentPage.value, limit: pageSize.value | 156 | page: currentPage.value, limit: pageSize.value |
157 | } | 157 | } |
158 | + proxy.$refs.multipleTable.clearSelection(); | ||
158 | 159 | ||
159 | emit('loaddata', params) | 160 | emit('loaddata', params) |
160 | } | 161 | } |
@@ -229,6 +230,49 @@ export default { | @@ -229,6 +230,49 @@ export default { | ||
229 | return val; | 230 | return val; |
230 | 231 | ||
231 | } | 232 | } |
233 | + //设置父节点选中后children也选中 | ||
234 | + let setChecked=(row)=>{ | ||
235 | + let arr=[]; | ||
236 | + if(row.children){ | ||
237 | + row.children.map(j=>{ | ||
238 | + arr.push(j) | ||
239 | + setChecked(j) | ||
240 | + }) | ||
241 | + } | ||
242 | + toggleSelection(arr) | ||
243 | + } | ||
244 | + //勾选数据行的Checkbox事件 | ||
245 | + let handleSelect=(selection, row)=>{ | ||
246 | + /* if(selection.some(el=>{ return row[props.getRowKeys] ===el[props.getRowKeys]})){ | ||
247 | + setChecked(row); | ||
248 | + }else{ | ||
249 | + setChecked(row); | ||
250 | + }*/ | ||
251 | + setChecked(row); | ||
252 | + | ||
253 | + emit('handleSelect',selection) | ||
254 | + } | ||
255 | + //勾选全选checkbox事件 | ||
256 | + let handleSelectAll=(selection)=>{ | ||
257 | + const isSelect=selection.some(el=>{ | ||
258 | + const tableDataIds=props.dataList.map(j=>j[props.getRowKeys]) | ||
259 | + return tableDataIds.includes(el.id) | ||
260 | + }) | ||
261 | + const isCancel=!props.dataList.every(el=>{ | ||
262 | + const selectIds=selection.map(j=>j[props.getRowKeys]) | ||
263 | + return selectIds.includes(el.id) | ||
264 | + }) | ||
265 | + if(isSelect){ | ||
266 | + setChecked(selection); | ||
267 | + } | ||
268 | + if(isCancel){ | ||
269 | + props.dataList.map(el=>{ | ||
270 | + setChecked(el); | ||
271 | + }) | ||
272 | + } | ||
273 | + | ||
274 | + emit('handleSelectAll',selection) | ||
275 | + } | ||
232 | // 挂载完 | 276 | // 挂载完 |
233 | Vue.onMounted(() => { | 277 | Vue.onMounted(() => { |
234 | //callback(); | 278 | //callback(); |
@@ -245,6 +289,8 @@ export default { | @@ -245,6 +289,8 @@ export default { | ||
245 | }) | 289 | }) |
246 | 290 | ||
247 | return { | 291 | return { |
292 | + handleSelect, | ||
293 | + handleSelectAll, | ||
248 | toggleSelection, | 294 | toggleSelection, |
249 | handleSelectionChange, | 295 | handleSelectionChange, |
250 | // multipleSelection, | 296 | // multipleSelection, |
@@ -14,7 +14,11 @@ let http = { | @@ -14,7 +14,11 @@ let http = { | ||
14 | window.top.location.reload(); | 14 | window.top.location.reload(); |
15 | //window.top.location.href = localStorage.getItem('loginUrl'); | 15 | //window.top.location.href = localStorage.getItem('loginUrl'); |
16 | } else { | 16 | } else { |
17 | - __global.showMsg("服务异常,请联系管理员!","error"); | 17 | + let text='服务异常,请联系管理员!'; |
18 | + if(xhr.responseJSON.resp_msg){ | ||
19 | + text=xhr.responseJSON.resp_msg | ||
20 | + } | ||
21 | + __global.showMsg(text,"error"); | ||
18 | } | 22 | } |
19 | }catch (e){ | 23 | }catch (e){ |
20 | } | 24 | } |
hg-monitor-web-base/src/main/resources/static/vue3/src/views/batchChangeLeaders/bizLeader/index.html
1 | +<el-row> | ||
2 | + <el-col :span="24" class="search"> | ||
3 | + <div class="condition" > | ||
4 | + <el-form ref=“form” style="display: flex;"> | ||
5 | + <el-form-item style="margin-right: 6px;margin-bottom: 10px;"> | ||
6 | + <el-input v-model="search.keyword" placeholder="请输入业务名称"></el-input> | ||
7 | + </el-form-item> | ||
8 | + <!--<el-form-item style="margin-right: 6px;margin-bottom: 10px;"> | ||
9 | + <el-select filterable clearable v-model="search.resType" placeholder="请选择资源类型"> | ||
10 | + <el-option | ||
11 | + v-for="item in resTypeOptions" | ||
12 | + :key="item.resTypeCode" | ||
13 | + :label="item.resTypeName" | ||
14 | + :value="item.resTypeCode"> | ||
15 | + </el-option> | ||
16 | + </el-select> | ||
17 | + </el-form-item>--> | ||
18 | + <el-form-item style="margin-right: 6px;margin-bottom: 10px;"> | ||
19 | + <el-button @click="getListData" type="primary">查询</el-button> | ||
20 | + </el-form-item> | ||
21 | + </el-form> | ||
22 | + </div> | ||
23 | + </el-col> | ||
24 | +</el-row> | ||
25 | +<el-row style="margin-bottom: 10px;"> | ||
26 | + <div class="flex-div-start"> | ||
27 | +<!-- <el-button type="primary" @click="changeCancel()" size="small">取消</el-button>--> | ||
28 | + <el-button type="primary" @click="changeAdmin()" size="small" style="margin-left: 6px">变更</el-button> | ||
29 | + </div> | ||
30 | +</el-row> | ||
31 | +<el-row class="margin-bottom-50" style="margin-top: 3px"> | ||
32 | + <el-col :span="24" class="table-height"> | ||
33 | + <cm-table-page :columns="columns" | ||
34 | + :dataList="resourceData" | ||
35 | + :total="count" | ||
36 | + :layout="'total, prev,pager,next,sizes, jumper'" | ||
37 | + :pageSize="search.limit" | ||
38 | + @loaddata="loadTableDataList" | ||
39 | + @selectionChange="selectionChange" | ||
40 | + :showIndex="true" | ||
41 | + :showSelection="true" | ||
42 | + :showBorder="true" | ||
43 | + :loading="loading" | ||
44 | + :showPage="true" | ||
45 | + :showTools="false" | ||
46 | + :height="(height - 200)"> | ||
47 | + <template #default="{row,prop,column}"> | ||
48 | + <div v-if="prop == 'showType'"> | ||
49 | + <el-select v-if="row.resType == 'HOST_X86SERVER'" v-model="row.showType" placeholder=""> | ||
50 | + <el-option | ||
51 | + v-for="item in showTypeList" | ||
52 | + :key="item.value" | ||
53 | + :label="item.name" | ||
54 | + :value="item.value" | ||
55 | + > | ||
56 | + </el-option> | ||
57 | + </el-select> | ||
58 | + </div> | ||
59 | + </template> | ||
60 | + </cm-table-page> | ||
61 | + </el-col> | ||
62 | +</el-row> | ||
63 | + | ||
64 | +<ChangeUsersList :show="show" :isTwoGroup="isTwoGroup" :isMulti="isMulti" @hideDialog="hideDialog" @savebtn="savebtn"></ChangeUsersList> |
1 | export default { | 1 | export default { |
2 | - name: 'resourceTypePer', | 2 | + name: 'bizLeader', |
3 | template: '', | 3 | template: '', |
4 | components: { | 4 | components: { |
5 | - | 5 | + 'ChangeUsersList': Vue.defineAsyncComponent( |
6 | + () => myImport('views/batchChangeLeaders/changeUsersList/index') | ||
7 | + ), | ||
6 | }, | 8 | }, |
7 | data() { | 9 | data() { |
8 | }, | 10 | }, |
@@ -10,12 +12,251 @@ export default { | @@ -10,12 +12,251 @@ export default { | ||
10 | }, | 12 | }, |
11 | setup: function (props, {attrs, slots, emit}) { | 13 | setup: function (props, {attrs, slots, emit}) { |
12 | const {proxy} = Vue.getCurrentInstance(); | 14 | const {proxy} = Vue.getCurrentInstance(); |
15 | + //接收从用户列表中选中的用户 | ||
16 | + let userName=Vue.ref(proxy.$route.query.username); | ||
17 | + //变更人员弹框 | ||
18 | + let show=Vue.ref(false); | ||
19 | + //变更人员列表是否多选 | ||
20 | + let isMulti=Vue.ref(false); | ||
21 | + //变更人员列表是否是两组 | ||
22 | + let isTwoGroup=Vue.ref(false); | ||
23 | + //配置列表总数 | ||
24 | + let count = Vue.ref(0); | ||
25 | + //列表高度 | ||
26 | + let height = Vue.ref(window.innerHeight); | ||
27 | + //列表分页 | ||
28 | + let limit = Vue.ref(400); | ||
29 | + //加载 | ||
30 | + let loading = Vue.ref(true); | ||
31 | + //选中数据 | ||
32 | + let pitch = Vue.ref([]); | ||
33 | + let showTypeList=Vue.ref([]); | ||
34 | + let search = Vue.ref({ | ||
35 | + resType: '', | ||
36 | + keyword: '', | ||
37 | + page: 1, | ||
38 | + limit: 20, | ||
39 | + }); | ||
40 | + let resTypeOptions=Vue.ref([]) | ||
41 | + const columns = [ | ||
42 | + { | ||
43 | + prop: 'busTypeName', | ||
44 | + label: '业务类型名称', | ||
45 | + sortable: true, | ||
46 | + align: 'center', | ||
47 | + }, | ||
48 | + { | ||
49 | + prop: 'admin', | ||
50 | + label: '负责人', | ||
51 | + sortable: true, | ||
52 | + align: 'center', | ||
53 | + }, | ||
54 | + { | ||
55 | + prop: 'busTypeDesc', | ||
56 | + label: '业务类型描述', | ||
57 | + sortable: true, | ||
58 | + align: 'center', | ||
59 | + }, | ||
60 | + { | ||
61 | + prop: 'isUse', | ||
62 | + label: '是否使用', | ||
63 | + sortable: true, | ||
64 | + align: 'center', | ||
65 | + render: function (row) { | ||
66 | + switch (row.isUse) { | ||
67 | + case 0: | ||
68 | + return '否'; | ||
69 | + case 1: | ||
70 | + return '是'; | ||
71 | + default: | ||
72 | + return ''; | ||
73 | + } | ||
74 | + } | ||
75 | + }, | ||
76 | + { | ||
77 | + prop: 'important', | ||
78 | + label: '重要程度', | ||
79 | + sortable: true, | ||
80 | + align: 'center', | ||
81 | + render: function (row) { | ||
82 | + switch (row.important) { | ||
83 | + case 1: | ||
84 | + return '核心'; | ||
85 | + case 2: | ||
86 | + return '重要'; | ||
87 | + case 3: | ||
88 | + return '一般'; | ||
89 | + case 9: | ||
90 | + return '虚拟业务'; | ||
91 | + default: | ||
92 | + return ''; | ||
93 | + } | ||
94 | + } | ||
95 | + }, | ||
96 | + { | ||
97 | + prop: 'sort', | ||
98 | + label: '排序', | ||
99 | + sortable: true, | ||
100 | + align: 'center', | ||
101 | + }, | ||
102 | + { | ||
103 | + prop: 'showType', | ||
104 | + label: '展示类型', | ||
105 | + sortable: true, | ||
106 | + align: 'center', | ||
107 | + /* render: function (row) { | ||
108 | + | ||
109 | + }*/ | ||
110 | + } | ||
111 | + ]; | ||
112 | + | ||
113 | + //列表数据 | ||
114 | + let resourceData = Vue.ref([]); | ||
115 | + //获取列表数据 | ||
116 | + const getListData = () => { | ||
117 | + resourceData.value=[]; | ||
118 | + loading.value = true; | ||
119 | + //定义列表参数 | ||
120 | + let getParams = { | ||
121 | + resType:search.value.resType, | ||
122 | + keywords:search.value.keyword, | ||
123 | + userName:userName.value, | ||
124 | + page: search.value.page, | ||
125 | + limit: search.value.limit | ||
126 | + }; | ||
127 | + proxy.$http.post("/api-web/personnelChange/getList/bizLeader", getParams, function (res) { | ||
128 | + if (res && res.data) { | ||
129 | + resourceData.value = res.data ? res.data : []; | ||
130 | + count.value = res.count; | ||
131 | + loading.value = false; | ||
132 | + } | ||
133 | + }) | ||
134 | + } | ||
135 | + //重新加载表格数据 | ||
136 | + let loadTableDataList = ({page, limit}) => { | ||
137 | + search.value.page=page; | ||
138 | + search.value.limit=limit; | ||
139 | + getListData(); | ||
140 | + } | ||
141 | + let busIds=Vue.ref('');//选中的ids | ||
142 | + //表格全选事件 | ||
143 | + let selectionChange = (val) => { | ||
144 | + pitch.value = val; | ||
145 | + let arr=[]; | ||
146 | + pitch.value.map(item=>{ | ||
147 | + arr.push(item.busId) | ||
148 | + }) | ||
149 | + busIds.value=arr.join(",");//选中的值 | ||
150 | + } | ||
151 | + //获取资源类型数据 | ||
152 | + let getResourceTypoe=()=>{ | ||
153 | + proxy.$http.get(`/api-web/manage/restype/list`, {}, function (res) { | ||
154 | + if (res && res.data) { | ||
155 | + resTypeOptions.value=res.data | ||
156 | + } | ||
157 | + }) | ||
158 | + } | ||
159 | + //获取展示类型的字典数据 | ||
160 | + let initShowType=()=>{ | ||
161 | + proxy.$http.post("/api-web/manage/ddic/findSucDdics/DETAILS_POWER", {}, function (res) { | ||
162 | + if (res && res.data) { | ||
163 | + let arr=res.data; | ||
164 | + if(arr && arr.length>0){ | ||
165 | + arr.map(v=>{ | ||
166 | + showTypeList.value.push({ | ||
167 | + name: v.ddicName | ||
168 | + ,value: v.ddicCode.substring(v.ddicCode.lastIndexOf("_")+1,v.ddicCode.length) | ||
169 | + }); | ||
170 | + }) | ||
171 | + } | ||
172 | + | ||
173 | + } | ||
174 | + }) | ||
175 | + } | ||
176 | + //批量取消相关资源 | ||
177 | + let changeCancel = () => { | ||
178 | + if(pitch.value.length<1){ | ||
179 | + proxy.$global.showMsg('请至少选择一项','warning'); | ||
180 | + }else{ | ||
181 | + proxy.$global.confirm("确定取消相关资源?", function () { | ||
182 | + let parmas={ | ||
183 | + userName:userName.value, | ||
184 | + busId:busIds.value | ||
185 | + } | ||
186 | + proxy.$http.post(`/api-web/personnelChange/remove/bizLeader`, parmas, function (res) { | ||
187 | + if (res && res.success) { | ||
188 | + proxy.$global.showMsg('取消成功!'); | ||
189 | + getListData() | ||
190 | + } | ||
191 | + }) | ||
192 | + }); | ||
193 | + } | ||
194 | + } | ||
195 | + //变更负责人 | ||
196 | + let changeAdmin = () => { | ||
197 | + if(pitch.value.length<1){ | ||
198 | + proxy.$global.showMsg('请至少选择一项','warning'); | ||
13 | 199 | ||
200 | + }else{ | ||
201 | + show.value=true; | ||
202 | + } | ||
203 | + | ||
204 | + } | ||
205 | + //变更人员的弹框关闭后 | ||
206 | + let hideDialog =(flag)=>{ | ||
207 | + show.value=flag; | ||
208 | + } | ||
209 | + //变更人员的弹框保存后 | ||
210 | + let savebtn =(obj)=>{ | ||
211 | + show.value=false; | ||
212 | + //obj.selectModel 选中的用户组(一个/主负责人) obj.selectModelSecond 辅负责人,都是数组 | ||
213 | + let targetUserName=''; | ||
214 | + if(obj.selectModel){ | ||
215 | + targetUserName=obj.selectModel.join(',') | ||
216 | + } | ||
217 | + let params={ | ||
218 | + busId:busIds.value, | ||
219 | + targetUserName:targetUserName, | ||
220 | + userName:userName.value, | ||
221 | + } | ||
222 | + proxy.$http.post(`/api-web/personnelChange/update/bizLeader`, params, function (res) { | ||
223 | + if (res && res.success) { | ||
224 | + proxy.$global.showMsg('变更成功!'); | ||
225 | + getListData() | ||
226 | + } | ||
227 | + }) | ||
228 | + } | ||
14 | // 挂载完 | 229 | // 挂载完 |
15 | Vue.onMounted(() => { | 230 | Vue.onMounted(() => { |
231 | + initShowType(); | ||
232 | + getResourceTypoe(); | ||
233 | + getListData(); | ||
16 | }) | 234 | }) |
17 | return { | 235 | return { |
236 | + isMulti, | ||
237 | + isTwoGroup, | ||
238 | + show, | ||
239 | + initShowType, | ||
240 | + showTypeList, | ||
241 | + search, | ||
242 | + resTypeOptions, | ||
243 | + changeCancel, | ||
244 | + count, | ||
245 | + hideDialog, | ||
246 | + savebtn, | ||
247 | + changeAdmin, | ||
248 | + getResourceTypoe, | ||
249 | + | ||
250 | + resourceData, | ||
251 | + columns, | ||
252 | + height, | ||
253 | + loading, | ||
254 | + | ||
255 | + selectionChange, | ||
18 | 256 | ||
257 | + getListData, | ||
258 | + loadTableDataList, | ||
259 | + userName | ||
19 | } | 260 | } |
20 | } | 261 | } |
21 | } | 262 | } |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <div class="condition" > | 3 | <div class="condition" > |
4 | <el-form ref=“form” style="display: flex;"> | 4 | <el-form ref=“form” style="display: flex;"> |
5 | <el-form-item style="margin-right: 6px;margin-bottom: 10px;"> | 5 | <el-form-item style="margin-right: 6px;margin-bottom: 10px;"> |
6 | - <el-input v-model="search.keyword" placeholder="请输入关键字"></el-input> | 6 | + <el-input v-model="search.keyword" placeholder="请输入资源名称/ip"></el-input> |
7 | </el-form-item> | 7 | </el-form-item> |
8 | <el-form-item style="margin-right: 6px;margin-bottom: 10px;"> | 8 | <el-form-item style="margin-right: 6px;margin-bottom: 10px;"> |
9 | <el-select filterable clearable v-model="search.resType" placeholder="请选择资源类型"> | 9 | <el-select filterable clearable v-model="search.resType" placeholder="请选择资源类型"> |
@@ -30,11 +30,11 @@ | @@ -30,11 +30,11 @@ | ||
30 | </el-row> | 30 | </el-row> |
31 | <el-row class="margin-bottom-50" style="margin-top: 3px"> | 31 | <el-row class="margin-bottom-50" style="margin-top: 3px"> |
32 | <el-col :span="24" class="table-height"> | 32 | <el-col :span="24" class="table-height"> |
33 | - <cm-table-page :columns="columns" | 33 | + <cm-table-page :columns="columns" |
34 | :dataList="resourceData" | 34 | :dataList="resourceData" |
35 | :total="count" | 35 | :total="count" |
36 | :layout="'total, prev,pager,next,sizes, jumper'" | 36 | :layout="'total, prev,pager,next,sizes, jumper'" |
37 | - :pageSize="pageSize" | 37 | + :pageSize="search.limit" |
38 | @loaddata="loadTableDataList" | 38 | @loaddata="loadTableDataList" |
39 | @selectionChange="selectionChange" | 39 | @selectionChange="selectionChange" |
40 | :showIndex="true" | 40 | :showIndex="true" |
@@ -61,4 +61,4 @@ | @@ -61,4 +61,4 @@ | ||
61 | </el-col> | 61 | </el-col> |
62 | </el-row> | 62 | </el-row> |
63 | 63 | ||
64 | -<ChangeUsersList :show="show" :isTwoGroup="true" :isMulti="isMulti" @hideDialog="hideDialog" @savebtn="savebtn"></ChangeUsersList> | 64 | +<ChangeUsersList :show="show" :isTwoGroup="isTwoGroup" :isMulti="isMulti" @hideDialog="hideDialog" @savebtn="savebtn"></ChangeUsersList> |
@@ -12,6 +12,8 @@ export default { | @@ -12,6 +12,8 @@ export default { | ||
12 | }, | 12 | }, |
13 | setup: function (props, {attrs, slots, emit}) { | 13 | setup: function (props, {attrs, slots, emit}) { |
14 | const {proxy} = Vue.getCurrentInstance(); | 14 | const {proxy} = Vue.getCurrentInstance(); |
15 | + //接收从用户列表中选中的用户 | ||
16 | + let userName=Vue.ref(proxy.$route.query.username); | ||
15 | //变更人员弹框 | 17 | //变更人员弹框 |
16 | let show=Vue.ref(false); | 18 | let show=Vue.ref(false); |
17 | //变更人员列表是否多选 | 19 | //变更人员列表是否多选 |
@@ -56,8 +58,14 @@ export default { | @@ -56,8 +58,14 @@ export default { | ||
56 | align: 'center', | 58 | align: 'center', |
57 | }, | 59 | }, |
58 | { | 60 | { |
59 | - prop: 'admin', | ||
60 | - label: '负责人', | 61 | + prop: 'resMainAdmin', |
62 | + label: '主负责人', | ||
63 | + sortable: true, | ||
64 | + align: 'center', | ||
65 | + }, | ||
66 | + { | ||
67 | + prop: 'resAuxiliaryAdmin', | ||
68 | + label: '辅负责人', | ||
61 | sortable: true, | 69 | sortable: true, |
62 | align: 'center', | 70 | align: 'center', |
63 | }, | 71 | }, |
@@ -100,18 +108,16 @@ export default { | @@ -100,18 +108,16 @@ export default { | ||
100 | let resourceData = Vue.ref([]); | 108 | let resourceData = Vue.ref([]); |
101 | //获取列表数据 | 109 | //获取列表数据 |
102 | const getListData = () => { | 110 | const getListData = () => { |
103 | - let username=proxy.$route.query.username; | ||
104 | - let resName=proxy.$route.query.resName; | 111 | + loading.value = true; |
105 | //定义列表参数 | 112 | //定义列表参数 |
106 | let getParams = { | 113 | let getParams = { |
107 | resType:search.value.resType, | 114 | resType:search.value.resType, |
108 | - keyword:search.value.keyword, | ||
109 | - resName: resName, | ||
110 | - userId: username, | 115 | + keywords:search.value.keyword, |
116 | + userName:userName.value, | ||
111 | page: search.value.page, | 117 | page: search.value.page, |
112 | limit: search.value.limit | 118 | limit: search.value.limit |
113 | }; | 119 | }; |
114 | - proxy.$http.get("/api-web/manage/resource/getAllResByUser", getParams, function (res) { | 120 | + proxy.$http.post("/api-web/personnelChange/getList/resourceLeader", getParams, function (res) { |
115 | if (res && res.data) { | 121 | if (res && res.data) { |
116 | resourceData.value = res.data ? res.data : []; | 122 | resourceData.value = res.data ? res.data : []; |
117 | count.value = res.count; | 123 | count.value = res.count; |
@@ -134,7 +140,7 @@ export default { | @@ -134,7 +140,7 @@ export default { | ||
134 | arr.push(item.resId) | 140 | arr.push(item.resId) |
135 | }) | 141 | }) |
136 | resIds.value=arr.join(",");//选中的值 | 142 | resIds.value=arr.join(",");//选中的值 |
137 | - proxy.resourceData.map((v, i) => { | 143 | + /*proxy.resourceData.map((v, i) => { |
138 | v.checked = false; | 144 | v.checked = false; |
139 | }); | 145 | }); |
140 | let selectData = val; | 146 | let selectData = val; |
@@ -150,7 +156,7 @@ export default { | @@ -150,7 +156,7 @@ export default { | ||
150 | proxy.resourceData.map((v, i) => { | 156 | proxy.resourceData.map((v, i) => { |
151 | v.checked = false; | 157 | v.checked = false; |
152 | }) | 158 | }) |
153 | - } | 159 | + }*/ |
154 | } | 160 | } |
155 | //获取资源类型数据 | 161 | //获取资源类型数据 |
156 | let getResourceTypoe=()=>{ | 162 | let getResourceTypoe=()=>{ |
@@ -177,19 +183,22 @@ export default { | @@ -177,19 +183,22 @@ export default { | ||
177 | } | 183 | } |
178 | }) | 184 | }) |
179 | } | 185 | } |
180 | - //批量取消负责的相关资源 | 186 | + //批量取消相关资源 |
181 | let changeCancel = () => { | 187 | let changeCancel = () => { |
182 | if(pitch.value.length<1){ | 188 | if(pitch.value.length<1){ |
183 | proxy.$global.showMsg('请至少选择一项','warning'); | 189 | proxy.$global.showMsg('请至少选择一项','warning'); |
184 | }else{ | 190 | }else{ |
185 | - proxy.$global.confirm("确定取消负责的相关资源?", function () { | ||
186 | - proxy.$global.showMsg('取消成功!'); | ||
187 | - // proxy.$http.get(`/api-web/`, {resIds:resIds.value}, function (res) { | ||
188 | - // if (res && res.data) { | ||
189 | - // proxy.$global.showMsg('取消成功!'); | ||
190 | - // getListData() | ||
191 | - // } | ||
192 | - // }) | 191 | + proxy.$global.confirm("确定取消相关资源?", function () { |
192 | + let parmas={ | ||
193 | + userName:userName.value, | ||
194 | + resId:resIds.value | ||
195 | + } | ||
196 | + proxy.$http.post(`/api-web/personnelChange/remove/resourceLeader`, parmas, function (res) { | ||
197 | + if (res && res.success) { | ||
198 | + proxy.$global.showMsg('取消成功!'); | ||
199 | + getListData() | ||
200 | + } | ||
201 | + }) | ||
193 | }); | 202 | }); |
194 | } | 203 | } |
195 | } | 204 | } |
@@ -206,22 +215,26 @@ export default { | @@ -206,22 +215,26 @@ export default { | ||
206 | //变更人员的弹框关闭后 | 215 | //变更人员的弹框关闭后 |
207 | let hideDialog =(flag)=>{ | 216 | let hideDialog =(flag)=>{ |
208 | show.value=flag; | 217 | show.value=flag; |
209 | - // getListData(); | ||
210 | } | 218 | } |
211 | //变更人员的弹框保存后 | 219 | //变更人员的弹框保存后 |
212 | let savebtn =(obj)=>{ | 220 | let savebtn =(obj)=>{ |
213 | show.value=false; | 221 | show.value=false; |
214 | //obj.selectModel 选中的用户组(一个/主负责人) obj.selectModelSecond 辅负责人,都是数组 | 222 | //obj.selectModel 选中的用户组(一个/主负责人) obj.selectModelSecond 辅负责人,都是数组 |
223 | + let targetUserName=''; | ||
224 | + if(obj.selectModel){ | ||
225 | + targetUserName=obj.selectModel.join(',') | ||
226 | + } | ||
215 | let params={ | 227 | let params={ |
216 | - resIds:resIds.value, | ||
217 | - selectModel:obj.selectModel, | 228 | + resId:resIds.value, |
229 | + targetUserName:targetUserName, | ||
230 | + userName:userName.value, | ||
218 | } | 231 | } |
219 | - // proxy.$http.get(`/api-web/`, {}, function (res) { | ||
220 | - // if (res && res.data) { | ||
221 | - // proxy.$global.showMsg('变更成功!'); | ||
222 | - // getListData() | ||
223 | - // } | ||
224 | - // }) | 232 | + proxy.$http.post(`/api-web/personnelChange/update/resourceLeader`, params, function (res) { |
233 | + if (res && res.success) { | ||
234 | + proxy.$global.showMsg('变更成功!'); | ||
235 | + getListData() | ||
236 | + } | ||
237 | + }) | ||
225 | } | 238 | } |
226 | // 挂载完 | 239 | // 挂载完 |
227 | Vue.onMounted(() => { | 240 | Vue.onMounted(() => { |
@@ -253,7 +266,7 @@ export default { | @@ -253,7 +266,7 @@ export default { | ||
253 | 266 | ||
254 | getListData, | 267 | getListData, |
255 | loadTableDataList, | 268 | loadTableDataList, |
256 | - | 269 | + userName |
257 | } | 270 | } |
258 | } | 271 | } |
259 | } | 272 | } |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <div class="condition" > | 3 | <div class="condition" > |
4 | <el-form ref=“form” style="display: flex;"> | 4 | <el-form ref=“form” style="display: flex;"> |
5 | <el-form-item style="margin-right: 6px;margin-bottom: 10px;"> | 5 | <el-form-item style="margin-right: 6px;margin-bottom: 10px;"> |
6 | - <el-input v-model="search.keyword" placeholder="请输入关键字"></el-input> | 6 | + <el-input v-model="search.keyword" placeholder="请输入资源名称/ip"></el-input> |
7 | </el-form-item> | 7 | </el-form-item> |
8 | <el-form-item style="margin-right: 6px;margin-bottom: 10px;"> | 8 | <el-form-item style="margin-right: 6px;margin-bottom: 10px;"> |
9 | <el-select filterable clearable v-model="search.resType" placeholder="请选择资源类型"> | 9 | <el-select filterable clearable v-model="search.resType" placeholder="请选择资源类型"> |
@@ -30,11 +30,11 @@ | @@ -30,11 +30,11 @@ | ||
30 | </el-row> | 30 | </el-row> |
31 | <el-row class="margin-bottom-50" style="margin-top: 3px"> | 31 | <el-row class="margin-bottom-50" style="margin-top: 3px"> |
32 | <el-col :span="24" class="table-height"> | 32 | <el-col :span="24" class="table-height"> |
33 | - <cm-table-page :columns="columns" | 33 | + <cm-table-page :columns="columns" |
34 | :dataList="resourceData" | 34 | :dataList="resourceData" |
35 | :total="count" | 35 | :total="count" |
36 | :layout="'total, prev,pager,next,sizes, jumper'" | 36 | :layout="'total, prev,pager,next,sizes, jumper'" |
37 | - :pageSize="pageSize" | 37 | + :pageSize="search.limit" |
38 | @loaddata="loadTableDataList" | 38 | @loaddata="loadTableDataList" |
39 | @selectionChange="selectionChange" | 39 | @selectionChange="selectionChange" |
40 | :showIndex="true" | 40 | :showIndex="true" |
hg-monitor-web-base/src/main/resources/static/vue3/src/views/batchChangeLeaders/resourcePer/index.js
@@ -12,6 +12,8 @@ export default { | @@ -12,6 +12,8 @@ export default { | ||
12 | }, | 12 | }, |
13 | setup: function (props, {attrs, slots, emit}) { | 13 | setup: function (props, {attrs, slots, emit}) { |
14 | const {proxy} = Vue.getCurrentInstance(); | 14 | const {proxy} = Vue.getCurrentInstance(); |
15 | + //接收从用户列表中选中的用户 | ||
16 | + let userName=Vue.ref(proxy.$route.query.username); | ||
15 | //变更人员弹框 | 17 | //变更人员弹框 |
16 | let show=Vue.ref(false); | 18 | let show=Vue.ref(false); |
17 | //变更人员列表是否多选 | 19 | //变更人员列表是否多选 |
@@ -100,18 +102,17 @@ export default { | @@ -100,18 +102,17 @@ export default { | ||
100 | let resourceData = Vue.ref([]); | 102 | let resourceData = Vue.ref([]); |
101 | //获取列表数据 | 103 | //获取列表数据 |
102 | const getListData = () => { | 104 | const getListData = () => { |
103 | - let username=proxy.$route.query.username; | ||
104 | - let resName=proxy.$route.query.resName; | 105 | + // resourceData.value=[]; |
106 | + loading.value = true; | ||
105 | //定义列表参数 | 107 | //定义列表参数 |
106 | let getParams = { | 108 | let getParams = { |
107 | resType:search.value.resType, | 109 | resType:search.value.resType, |
108 | - keyword:search.value.keyword, | ||
109 | - resName: resName, | ||
110 | - userId: username, | 110 | + keywords:search.value.keyword, |
111 | + userName:userName.value, | ||
111 | page: search.value.page, | 112 | page: search.value.page, |
112 | limit: search.value.limit | 113 | limit: search.value.limit |
113 | }; | 114 | }; |
114 | - proxy.$http.get("/api-web/manage/resource/getAllResByUser", getParams, function (res) { | 115 | + proxy.$http.post("/api-web/personnelChange/getList/resourcePer", getParams, function (res) { |
115 | if (res && res.data) { | 116 | if (res && res.data) { |
116 | resourceData.value = res.data ? res.data : []; | 117 | resourceData.value = res.data ? res.data : []; |
117 | count.value = res.count; | 118 | count.value = res.count; |
@@ -134,7 +135,7 @@ export default { | @@ -134,7 +135,7 @@ export default { | ||
134 | arr.push(item.resId) | 135 | arr.push(item.resId) |
135 | }) | 136 | }) |
136 | resIds.value=arr.join(",");//选中的值 | 137 | resIds.value=arr.join(",");//选中的值 |
137 | - proxy.resourceData.map((v, i) => { | 138 | + /*proxy.resourceData.map((v, i) => { |
138 | v.checked = false; | 139 | v.checked = false; |
139 | }); | 140 | }); |
140 | let selectData = val; | 141 | let selectData = val; |
@@ -150,7 +151,7 @@ export default { | @@ -150,7 +151,7 @@ export default { | ||
150 | proxy.resourceData.map((v, i) => { | 151 | proxy.resourceData.map((v, i) => { |
151 | v.checked = false; | 152 | v.checked = false; |
152 | }) | 153 | }) |
153 | - } | 154 | + }*/ |
154 | } | 155 | } |
155 | //获取资源类型数据 | 156 | //获取资源类型数据 |
156 | let getResourceTypoe=()=>{ | 157 | let getResourceTypoe=()=>{ |
@@ -183,13 +184,16 @@ export default { | @@ -183,13 +184,16 @@ export default { | ||
183 | proxy.$global.showMsg('请至少选择一项','warning'); | 184 | proxy.$global.showMsg('请至少选择一项','warning'); |
184 | }else{ | 185 | }else{ |
185 | proxy.$global.confirm("确定取消相关资源?", function () { | 186 | proxy.$global.confirm("确定取消相关资源?", function () { |
186 | - proxy.$global.showMsg('取消成功!'); | ||
187 | - // proxy.$http.get(`/api-web/`, {resIds:resIds.value}, function (res) { | ||
188 | - // if (res && res.data) { | ||
189 | - // proxy.$global.showMsg('取消成功!'); | ||
190 | - // getListData() | ||
191 | - // } | ||
192 | - // }) | 187 | + let parmas={ |
188 | + userName:userName.value, | ||
189 | + resId:resIds.value | ||
190 | + } | ||
191 | + proxy.$http.post(`/api-web/personnelChange/remove/resourcePer`, parmas, function (res) { | ||
192 | + if (res && res.success) { | ||
193 | + proxy.$global.showMsg('取消成功!'); | ||
194 | + getListData() | ||
195 | + } | ||
196 | + }) | ||
193 | }); | 197 | }); |
194 | } | 198 | } |
195 | } | 199 | } |
@@ -206,22 +210,26 @@ export default { | @@ -206,22 +210,26 @@ export default { | ||
206 | //变更人员的弹框关闭后 | 210 | //变更人员的弹框关闭后 |
207 | let hideDialog =(flag)=>{ | 211 | let hideDialog =(flag)=>{ |
208 | show.value=flag; | 212 | show.value=flag; |
209 | - // getListData(); | ||
210 | } | 213 | } |
211 | //变更人员的弹框保存后 | 214 | //变更人员的弹框保存后 |
212 | let savebtn =(obj)=>{ | 215 | let savebtn =(obj)=>{ |
213 | show.value=false; | 216 | show.value=false; |
214 | //obj.selectModel 选中的用户组(一个/主负责人) obj.selectModelSecond 辅负责人,都是数组 | 217 | //obj.selectModel 选中的用户组(一个/主负责人) obj.selectModelSecond 辅负责人,都是数组 |
218 | + let targetUserName=''; | ||
219 | + if(obj.selectModel){ | ||
220 | + targetUserName=obj.selectModel.join(',') | ||
221 | + } | ||
215 | let params={ | 222 | let params={ |
216 | - resIds:resIds.value, | ||
217 | - selectModel:obj.selectModel, | 223 | + resId:resIds.value, |
224 | + targetUserName:targetUserName, | ||
225 | + userName:userName.value, | ||
218 | } | 226 | } |
219 | - // proxy.$http.get(`/api-web/`, {}, function (res) { | ||
220 | - // if (res && res.data) { | ||
221 | - // proxy.$global.showMsg('变更成功!'); | ||
222 | - // getListData() | ||
223 | - // } | ||
224 | - // }) | 227 | + proxy.$http.post(`/api-web/personnelChange/update/resourcePer`, params, function (res) { |
228 | + if (res && res.success) { | ||
229 | + proxy.$global.showMsg('变更成功!'); | ||
230 | + getListData() | ||
231 | + } | ||
232 | + }) | ||
225 | } | 233 | } |
226 | // 挂载完 | 234 | // 挂载完 |
227 | Vue.onMounted(() => { | 235 | Vue.onMounted(() => { |
@@ -253,7 +261,7 @@ export default { | @@ -253,7 +261,7 @@ export default { | ||
253 | 261 | ||
254 | getListData, | 262 | getListData, |
255 | loadTableDataList, | 263 | loadTableDataList, |
256 | - | 264 | + userName |
257 | } | 265 | } |
258 | } | 266 | } |
259 | } | 267 | } |
@@ -3,9 +3,9 @@ | @@ -3,9 +3,9 @@ | ||
3 | <div class="condition" > | 3 | <div class="condition" > |
4 | <el-form ref=“form” style="display: flex;"> | 4 | <el-form ref=“form” style="display: flex;"> |
5 | <el-form-item style="margin-right: 6px;margin-bottom: 10px;"> | 5 | <el-form-item style="margin-right: 6px;margin-bottom: 10px;"> |
6 | - <el-input v-model="search.keyword" placeholder="请输入关键字"></el-input> | 6 | + <el-input v-model="search.keyword" placeholder="请输入资源类型"></el-input> |
7 | </el-form-item> | 7 | </el-form-item> |
8 | - <el-form-item style="margin-right: 6px;margin-bottom: 10px;"> | 8 | + <!-- <el-form-item style="margin-right: 6px;margin-bottom: 10px;"> |
9 | <el-select filterable clearable v-model="search.resType" placeholder="请选择资源类型"> | 9 | <el-select filterable clearable v-model="search.resType" placeholder="请选择资源类型"> |
10 | <el-option | 10 | <el-option |
11 | v-for="item in resTypeOptions" | 11 | v-for="item in resTypeOptions" |
@@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
14 | :value="item.resTypeCode"> | 14 | :value="item.resTypeCode"> |
15 | </el-option> | 15 | </el-option> |
16 | </el-select> | 16 | </el-select> |
17 | - </el-form-item> | 17 | + </el-form-item>--> |
18 | <el-form-item style="margin-right: 6px;margin-bottom: 10px;"> | 18 | <el-form-item style="margin-right: 6px;margin-bottom: 10px;"> |
19 | <el-button @click="getListData" type="primary">查询</el-button> | 19 | <el-button @click="getListData" type="primary">查询</el-button> |
20 | </el-form-item> | 20 | </el-form-item> |
@@ -34,7 +34,7 @@ | @@ -34,7 +34,7 @@ | ||
34 | :dataList="resourceData" | 34 | :dataList="resourceData" |
35 | :total="count" | 35 | :total="count" |
36 | :layout="'total, prev,pager,next,sizes, jumper'" | 36 | :layout="'total, prev,pager,next,sizes, jumper'" |
37 | - :pageSize="pageSize" | 37 | + :pageSize="search.limit" |
38 | @loaddata="loadTableDataList" | 38 | @loaddata="loadTableDataList" |
39 | @selectionChange="selectionChange" | 39 | @selectionChange="selectionChange" |
40 | :showIndex="true" | 40 | :showIndex="true" |
@@ -47,7 +47,7 @@ | @@ -47,7 +47,7 @@ | ||
47 | :defaultExpand="true" | 47 | :defaultExpand="true" |
48 | :height="(height - 200)"> | 48 | :height="(height - 200)"> |
49 | <template #default="{row,prop,column}"> | 49 | <template #default="{row,prop,column}"> |
50 | - <div v-if="prop == 'paramDesc'"> | 50 | + <div v-if="prop == 'showType'"> |
51 | <el-select v-if="row.resType == 'HOST_X86SERVER'" v-model="row.showType" placeholder=""> | 51 | <el-select v-if="row.resType == 'HOST_X86SERVER'" v-model="row.showType" placeholder=""> |
52 | <el-option | 52 | <el-option |
53 | v-for="item in showTypeList" | 53 | v-for="item in showTypeList" |
@@ -12,6 +12,8 @@ export default { | @@ -12,6 +12,8 @@ export default { | ||
12 | }, | 12 | }, |
13 | setup: function (props, {attrs, slots, emit}) { | 13 | setup: function (props, {attrs, slots, emit}) { |
14 | const {proxy} = Vue.getCurrentInstance(); | 14 | const {proxy} = Vue.getCurrentInstance(); |
15 | + //接收从用户列表中选中的用户 | ||
16 | + let userName=Vue.ref(proxy.$route.query.username); | ||
15 | //变更人员弹框 | 17 | //变更人员弹框 |
16 | let show=Vue.ref(false); | 18 | let show=Vue.ref(false); |
17 | //变更人员列表是否多选 | 19 | //变更人员列表是否多选 |
@@ -110,22 +112,19 @@ export default { | @@ -110,22 +112,19 @@ export default { | ||
110 | let resourceData = Vue.ref([]); | 112 | let resourceData = Vue.ref([]); |
111 | //获取列表数据 | 113 | //获取列表数据 |
112 | const getListData = () => { | 114 | const getListData = () => { |
113 | - let username=proxy.$route.query.username; | ||
114 | - let resTypeName=proxy.$route.query.resTypeName; | 115 | + // resourceData.value=[]; |
116 | + loading.value = true; | ||
115 | //定义列表参数 | 117 | //定义列表参数 |
116 | let getParams = { | 118 | let getParams = { |
117 | resType:search.value.resType, | 119 | resType:search.value.resType, |
118 | - keyword:search.value.keyword, | ||
119 | - resTypeName: resTypeName, | ||
120 | - userAccount: username, | ||
121 | - // page: search.value.page, | ||
122 | - // limit: search.value.limit | 120 | + keywords:search.value.keyword, |
121 | + userName: userName.value, | ||
122 | + page: search.value.page, | ||
123 | + limit: search.value.limit | ||
123 | }; | 124 | }; |
124 | - proxy.$http.get("/api-web/manage/restype/listAll", getParams, function (res) { | 125 | + proxy.$http.post("/api-web/personnelChange/getList/resourceTypePer", getParams, function (res) { |
125 | if (res && res.data) { | 126 | if (res && res.data) { |
126 | resourceData.value = handleTree(res.data, 'resTypeCode', 'parentId') | 127 | resourceData.value = handleTree(res.data, 'resTypeCode', 'parentId') |
127 | - | ||
128 | - console.log("(()",resourceData.value) | ||
129 | count.value = res.count; | 128 | count.value = res.count; |
130 | loading.value = false; | 129 | loading.value = false; |
131 | }else{ | 130 | }else{ |
@@ -181,34 +180,22 @@ export default { | @@ -181,34 +180,22 @@ export default { | ||
181 | let loadTableDataList = ({page, limit}) => { | 180 | let loadTableDataList = ({page, limit}) => { |
182 | search.value.page=page; | 181 | search.value.page=page; |
183 | search.value.limit=limit; | 182 | search.value.limit=limit; |
183 | + selectionChange([]) | ||
184 | getListData(); | 184 | getListData(); |
185 | } | 185 | } |
186 | - let resIds=Vue.ref('');//选中的ids | 186 | + let resTypeId=Vue.ref('');//选中的ids |
187 | //表格全选事件 | 187 | //表格全选事件 |
188 | let selectionChange = (val) => { | 188 | let selectionChange = (val) => { |
189 | pitch.value = val; | 189 | pitch.value = val; |
190 | let arr=[]; | 190 | let arr=[]; |
191 | pitch.value.map(item=>{ | 191 | pitch.value.map(item=>{ |
192 | - arr.push(item.resId) | 192 | + arr.push(item.resTypeId) |
193 | }) | 193 | }) |
194 | - resIds.value=arr.join(",");//选中的值 | ||
195 | - proxy.resourceData.map((v, i) => { | ||
196 | - v.checked = false; | ||
197 | - }); | ||
198 | - let selectData = val; | ||
199 | - if (selectData.length > 0) { | ||
200 | - selectData.map((item, index) => { | ||
201 | - proxy.resourceData.map((v, i) => { | ||
202 | - if (item.id == v.id) { | ||
203 | - v.checked = true; | ||
204 | - } | ||
205 | - }) | ||
206 | - }) | ||
207 | - } else { | ||
208 | - proxy.resourceData.map((v, i) => { | ||
209 | - v.checked = false; | ||
210 | - }) | ||
211 | - } | 194 | + resTypeId.value=arr.join(",");//选中的值 |
195 | + } | ||
196 | + //勾选数据行的checked | ||
197 | + let handleSelect=(selection)=>{ | ||
198 | + console.log("selection",selection) | ||
212 | } | 199 | } |
213 | //获取资源类型数据 | 200 | //获取资源类型数据 |
214 | let getResourceTypoe=()=>{ | 201 | let getResourceTypoe=()=>{ |
@@ -258,13 +245,16 @@ export default { | @@ -258,13 +245,16 @@ export default { | ||
258 | proxy.$global.showMsg('请至少选择一项','warning'); | 245 | proxy.$global.showMsg('请至少选择一项','warning'); |
259 | }else{ | 246 | }else{ |
260 | proxy.$global.confirm("确定取消负责的相关资源?", function () { | 247 | proxy.$global.confirm("确定取消负责的相关资源?", function () { |
261 | - proxy.$global.showMsg('取消成功!'); | ||
262 | - // proxy.$http.get(`/api-web/`, {resIds:resIds.value}, function (res) { | ||
263 | - // if (res && res.data) { | ||
264 | - // proxy.$global.showMsg('取消成功!'); | ||
265 | - // getListData() | ||
266 | - // } | ||
267 | - // }) | 248 | + let parmas={ |
249 | + userName:userName.value, | ||
250 | + resTypeId:resTypeId.value | ||
251 | + } | ||
252 | + proxy.$http.post(`/api-web/personnelChange/remove/resourceTypePer`, parmas, function (res) { | ||
253 | + if (res && res.success) { | ||
254 | + proxy.$global.showMsg('取消成功!'); | ||
255 | + getListData() | ||
256 | + } | ||
257 | + }) | ||
268 | }); | 258 | }); |
269 | } | 259 | } |
270 | } | 260 | } |
@@ -281,22 +271,26 @@ export default { | @@ -281,22 +271,26 @@ export default { | ||
281 | //变更人员的弹框关闭后 | 271 | //变更人员的弹框关闭后 |
282 | let hideDialog =(flag)=>{ | 272 | let hideDialog =(flag)=>{ |
283 | show.value=flag; | 273 | show.value=flag; |
284 | - // getListData(); | ||
285 | } | 274 | } |
286 | //变更人员的弹框保存后 | 275 | //变更人员的弹框保存后 |
287 | let savebtn =(obj)=>{ | 276 | let savebtn =(obj)=>{ |
288 | show.value=false; | 277 | show.value=false; |
289 | //obj.selectModel 选中的用户组(一个/主负责人) obj.selectModelSecond 辅负责人,都是数组 | 278 | //obj.selectModel 选中的用户组(一个/主负责人) obj.selectModelSecond 辅负责人,都是数组 |
279 | + let targetUserName=''; | ||
280 | + if(obj.selectModel){ | ||
281 | + targetUserName=obj.selectModel.join(',') | ||
282 | + } | ||
290 | let params={ | 283 | let params={ |
291 | - resIds:resIds.value, | ||
292 | - selectModel:obj.selectModel, | 284 | + resTypeId:resTypeId.value, |
285 | + targetUserName:targetUserName, | ||
286 | + userName:userName.value, | ||
293 | } | 287 | } |
294 | - // proxy.$http.get(`/api-web/`, {}, function (res) { | ||
295 | - // if (res && res.data) { | ||
296 | - // proxy.$global.showMsg('变更成功!'); | ||
297 | - // getListData() | ||
298 | - // } | ||
299 | - // }) | 288 | + proxy.$http.post(`/api-web/personnelChange/update/resourceTypePer`, params, function (res) { |
289 | + if (res && res.success) { | ||
290 | + proxy.$global.showMsg('变更成功!'); | ||
291 | + getListData() | ||
292 | + } | ||
293 | + }) | ||
300 | } | 294 | } |
301 | // 挂载完 | 295 | // 挂载完 |
302 | Vue.onMounted(() => { | 296 | Vue.onMounted(() => { |
@@ -326,12 +320,11 @@ export default { | @@ -326,12 +320,11 @@ export default { | ||
326 | columns, | 320 | columns, |
327 | height, | 321 | height, |
328 | loading, | 322 | loading, |
329 | - | ||
330 | selectionChange, | 323 | selectionChange, |
331 | 324 | ||
332 | getListData, | 325 | getListData, |
333 | loadTableDataList, | 326 | loadTableDataList, |
334 | - | 327 | + handleSelect |
335 | } | 328 | } |
336 | } | 329 | } |
337 | } | 330 | } |
1 | +<el-row> | ||
2 | + <el-col :span="24" class="search"> | ||
3 | + <div class="condition" > | ||
4 | + <el-form ref=“form” style="display: flex;"> | ||
5 | + <el-form-item style="margin-right: 6px;margin-bottom: 10px;"> | ||
6 | + <el-input v-model="search.keyword" placeholder="请输入角色名称"></el-input> | ||
7 | + </el-form-item> | ||
8 | + <el-form-item style="margin-right: 6px;margin-bottom: 10px;"> | ||
9 | + <el-button @click="getListData" type="primary">查询</el-button> | ||
10 | + </el-form-item> | ||
11 | + </el-form> | ||
12 | + </div> | ||
13 | + </el-col> | ||
14 | +</el-row> | ||
15 | +<el-row style="margin-bottom: 10px;"> | ||
16 | + <div class="flex-div-start"> | ||
17 | + <el-button type="primary" @click="changeCancel()" size="small">取消</el-button> | ||
18 | +<!-- <el-button type="primary" @click="changeAdmin()" size="small" style="margin-left: 6px">变更</el-button>--> | ||
19 | + </div> | ||
20 | +</el-row> | ||
21 | +<el-row class="margin-bottom-50" style="margin-top: 3px"> | ||
22 | + <el-col :span="24" class="table-height"> | ||
23 | + <cm-table-page :columns="columns" | ||
24 | + :dataList="resourceData" | ||
25 | + :total="count" | ||
26 | + :layout="'total, prev,pager,next,sizes, jumper'" | ||
27 | + :pageSize="search.limit" | ||
28 | + @loaddata="loadTableDataList" | ||
29 | + @selectionChange="selectionChange" | ||
30 | + :showIndex="true" | ||
31 | + :showSelection="true" | ||
32 | + :showBorder="true" | ||
33 | + :loading="loading" | ||
34 | + :showPage="true" | ||
35 | + :showTools="false" | ||
36 | + :height="(height - 200)"> | ||
37 | + <template #default="{row,prop,column}"> | ||
38 | + </template> | ||
39 | + </cm-table-page> | ||
40 | + </el-col> | ||
41 | +</el-row> | ||
42 | + | ||
43 | +<ChangeUsersList :show="show" :isTwoGroup="isTwoGroup" :isMulti="isMulti" @hideDialog="hideDialog" @savebtn="savebtn"></ChangeUsersList> |
1 | export default { | 1 | export default { |
2 | - name: 'resourceTypePer', | 2 | + name: 'rolePer', |
3 | template: '', | 3 | template: '', |
4 | components: { | 4 | components: { |
5 | - | 5 | + 'ChangeUsersList': Vue.defineAsyncComponent( |
6 | + () => myImport('views/batchChangeLeaders/changeUsersList/index') | ||
7 | + ), | ||
6 | }, | 8 | }, |
7 | data() { | 9 | data() { |
8 | }, | 10 | }, |
@@ -10,12 +12,153 @@ export default { | @@ -10,12 +12,153 @@ export default { | ||
10 | }, | 12 | }, |
11 | setup: function (props, {attrs, slots, emit}) { | 13 | setup: function (props, {attrs, slots, emit}) { |
12 | const {proxy} = Vue.getCurrentInstance(); | 14 | const {proxy} = Vue.getCurrentInstance(); |
15 | + //接收从用户列表中选中的用户 | ||
16 | + let userName=Vue.ref(proxy.$route.query.username); | ||
17 | + //变更人员弹框 | ||
18 | + let show=Vue.ref(false); | ||
19 | + //变更人员列表是否多选 | ||
20 | + let isMulti=Vue.ref(false); | ||
21 | + //变更人员列表是否是两组 | ||
22 | + let isTwoGroup=Vue.ref(false); | ||
23 | + //配置列表总数 | ||
24 | + let count = Vue.ref(0); | ||
25 | + //列表高度 | ||
26 | + let height = Vue.ref(window.innerHeight); | ||
27 | + //列表分页 | ||
28 | + let limit = Vue.ref(400); | ||
29 | + //加载 | ||
30 | + let loading = Vue.ref(true); | ||
31 | + //选中数据 | ||
32 | + let pitch = Vue.ref([]); | ||
33 | + let search = Vue.ref({ | ||
34 | + resType: '', | ||
35 | + keyword: '', | ||
36 | + page: 1, | ||
37 | + limit: 20, | ||
38 | + }); | ||
39 | + const columns = [ | ||
40 | + { | ||
41 | + prop: 'name', | ||
42 | + label: '角色名称', | ||
43 | + sortable: true, | ||
44 | + align: 'center', | ||
45 | + } | ||
46 | + ]; | ||
47 | + | ||
48 | + //列表数据 | ||
49 | + let resourceData = Vue.ref([]); | ||
50 | + //获取列表数据 | ||
51 | + const getListData = () => { | ||
52 | + resourceData.value=[]; | ||
53 | + loading.value = true; | ||
54 | + //定义列表参数 | ||
55 | + let getParams = { | ||
56 | + resType:search.value.resType, | ||
57 | + keywords:search.value.keyword, | ||
58 | + userName:userName.value, | ||
59 | + page: search.value.page, | ||
60 | + limit: search.value.limit | ||
61 | + }; | ||
62 | + proxy.$http.post("/api-web/personnelChange/getList/rolePer", getParams, function (res) { | ||
63 | + if (res && res.data) { | ||
64 | + resourceData.value = res.data ? res.data : []; | ||
65 | + count.value = res.count; | ||
66 | + loading.value = false; | ||
67 | + } | ||
68 | + }) | ||
69 | + } | ||
70 | + //重新加载表格数据 | ||
71 | + let loadTableDataList = ({page, limit}) => { | ||
72 | + search.value.page=page; | ||
73 | + search.value.limit=limit; | ||
74 | + getListData(); | ||
75 | + } | ||
76 | + let roleIds=Vue.ref('');//选中的ids | ||
77 | + //表格全选事件 | ||
78 | + let selectionChange = (val) => { | ||
79 | + pitch.value = val; | ||
80 | + let arr=[]; | ||
81 | + pitch.value.map(item=>{ | ||
82 | + arr.push(item.id) | ||
83 | + }) | ||
84 | + roleIds.value=arr.join(",");//选中的值 | ||
85 | + } | ||
86 | + | ||
87 | + //批量取消相关资源 | ||
88 | + let changeCancel = () => { | ||
89 | + if(pitch.value.length<1){ | ||
90 | + proxy.$global.showMsg('请至少选择一项','warning'); | ||
91 | + }else{ | ||
92 | + proxy.$global.confirm("确定取消相关资源?", function () { | ||
93 | + let parmas={ | ||
94 | + userName:userName.value, | ||
95 | + roleId:roleIds.value | ||
96 | + } | ||
97 | + proxy.$http.post(`/api-web/personnelChange/remove/rolePer`, parmas, function (res) { | ||
98 | + if (res && res.success) { | ||
99 | + proxy.$global.showMsg('取消成功!'); | ||
100 | + getListData() | ||
101 | + } | ||
102 | + }) | ||
103 | + }); | ||
104 | + } | ||
105 | + } | ||
106 | + //变更负责人 | ||
107 | + let changeAdmin = () => { | ||
108 | + if(pitch.value.length<1){ | ||
109 | + proxy.$global.showMsg('请至少选择一项','warning'); | ||
110 | + | ||
111 | + }else{ | ||
112 | + show.value=true; | ||
113 | + } | ||
13 | 114 | ||
115 | + } | ||
116 | + //变更人员的弹框关闭后 | ||
117 | + let hideDialog =(flag)=>{ | ||
118 | + show.value=flag; | ||
119 | + } | ||
120 | + //变更人员的弹框保存后 | ||
121 | + let savebtn =(obj)=>{ | ||
122 | + show.value=false; | ||
123 | + //obj.selectModel 选中的用户组(一个/主负责人) obj.selectModelSecond 辅负责人,都是数组 | ||
124 | + let targetUserName=''; | ||
125 | + if(obj.selectModel){ | ||
126 | + targetUserName=obj.selectModel.join(',') | ||
127 | + } | ||
128 | + let params={ | ||
129 | + roleId:roleIds.value, | ||
130 | + targetUserName:targetUserName, | ||
131 | + userName:userName.value, | ||
132 | + } | ||
133 | + proxy.$http.post(`/api-web/personnelChange/update/rolePer`, params, function (res) { | ||
134 | + if (res && res.success) { | ||
135 | + proxy.$global.showMsg('变更成功!'); | ||
136 | + getListData() | ||
137 | + } | ||
138 | + }) | ||
139 | + } | ||
14 | // 挂载完 | 140 | // 挂载完 |
15 | Vue.onMounted(() => { | 141 | Vue.onMounted(() => { |
142 | + getListData(); | ||
16 | }) | 143 | }) |
17 | return { | 144 | return { |
18 | - | 145 | + isMulti, |
146 | + isTwoGroup, | ||
147 | + show, | ||
148 | + search, | ||
149 | + changeCancel, | ||
150 | + count, | ||
151 | + hideDialog, | ||
152 | + savebtn, | ||
153 | + changeAdmin, | ||
154 | + resourceData, | ||
155 | + columns, | ||
156 | + height, | ||
157 | + loading, | ||
158 | + selectionChange, | ||
159 | + getListData, | ||
160 | + loadTableDataList, | ||
161 | + userName | ||
19 | } | 162 | } |
20 | } | 163 | } |
21 | } | 164 | } |
-
Please register or login to post a comment