From f58f07875461b7cc8205978cf4f0fac86564df72 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期三, 20 十二月 2023 17:49:01 +0800 Subject: [PATCH] 新增调试下载环信码功能 --- src/views/fytz/user/UserInfo.vue | 97 +++++++++++++++++++++++++++++++----------------- 1 files changed, 63 insertions(+), 34 deletions(-) diff --git a/src/views/fytz/user/UserInfo.vue b/src/views/fytz/user/UserInfo.vue index ac17524..3269798 100644 --- a/src/views/fytz/user/UserInfo.vue +++ b/src/views/fytz/user/UserInfo.vue @@ -3,7 +3,7 @@ <template #options> <FYOptionLocation :allOption="true" - :level="4" + :level="5" v-model:value="formSearch._locations" ></FYOptionLocation> <FYOptionText @@ -36,41 +36,57 @@ </template> </el-table-column> <el-table-column prop="userInfo.acountname" label="璐﹀彿" width="110" /> - <el-table-column prop="sceneTypeName" label="绫诲瀷" width="130" /> - <el-table-column prop="biProvinceName" label="鐪�" width="90" /> - <el-table-column prop="biCityName" label="甯�" width="90" /> + <el-table-column prop="sceneTypeName" label="绫诲瀷" width="100" /> + <el-table-column prop="biProvinceName" label="鐪�" width="80" /> + <el-table-column prop="biCityName" label="甯�" width="80" /> <!-- <el-table-column prop="districtname" label="鍖哄幙" width="90" /> --> - <el-table-column prop="userInfo.extension1" label="鍖哄幙" width="90" /> + <el-table-column prop="userInfo.extension1" label="鍖哄幙" width="80" /> <el-table-column prop="biTownName" label="琛楅亾" width="110" /> <el-table-column prop="biArea" label="闆嗕腑鍖�" width="110" /> <el-table-column prop="biManagementCompany" label="鐗╀笟" min-width="110" /> <el-table-column prop="userInfo.isenable" label="鐘舵��" width="90"> - <template #default="scope"> - {{ scope.row.userInfo.isenable ? '涓婄嚎涓�' : '宸蹭笅绾�' }} + <template #default="{ row }"> + {{ row.userInfo.isenable ? '涓婄嚎涓�' : '宸蹭笅绾�' }} </template> </el-table-column> <el-table-column prop="userInfo.usertype" label="鐢ㄦ埛绫诲瀷" width="90" /> - <el-table-column fixed="right" align="right" label="鎿嶄綔" width="160"> + <el-table-column fixed="right" align="right" label="鎿嶄綔" width="190"> <template #header> <el-button icon="DocumentAdd" size="default" type="success" @click="drawer = true" >鏂板鐢ㄦ埛</el-button > </template> - <template #default="scope"> - <el-button - :loading="scope.row.loading1" - type="primary" - size="small" - @click="editRow(scope)" - >鏌ョ湅</el-button - > - <el-button - :loading="scope.row.loading2" - :type="scope.row.userInfo.isenable != '0' ? 'danger' : 'primary'" - size="small" - @click="itemActive(scope)" - >{{ scope.row.userInfo.isenable != '0' ? '涓嬬嚎' : '涓婄嚎' }}</el-button - > + <template #default="{ row }"> + <el-space> + <!-- <el-button :loading="row.loading1" type="primary" size="small" @click="editRow(row)" + >鏌ョ湅</el-button + > --> + <el-button + :loading="row.loading2" + :type="row.userInfo.isenable != '0' ? 'danger' : 'primary'" + size="small" + @click="itemActive(row)" + >{{ row.userInfo.isenable != '0' ? '涓嬬嚎' : '涓婄嚎' }}</el-button + > + <el-dropdown + split-button + :loading="row.loading1" + size="small" + type="primary" + @click="editRow(row)" + @command="handleCommand" + trigger="click" + > + 鏌ョ湅 + <template #dropdown> + <el-dropdown-menu> + <el-dropdown-item icon="Download" :command="{ c: 1, p: row }" + >涓嬭浇鐜俊鐮�</el-dropdown-item + > + </el-dropdown-menu> + </template> + </el-dropdown> + </el-space> </template> </el-table-column> </template> @@ -80,6 +96,7 @@ <script> import userApi from '@/api/fytz/userApi'; +import creditApi from '@/api/fytz/creditApi'; import { useLoadingStore } from '@/stores/loadingStore'; import { mapStores } from 'pinia'; import { useMessageBoxTip } from '@/composables/messageBox'; @@ -139,37 +156,49 @@ } }); }, - editRow(scope) { - scope.row.loading1 = true; - this.loadingStore.pushLoading(() => (scope.row.loading1 = false)); - this.$router.push(`userEdit/${scope.row.userInfo.guid}`); + editRow(row) { + row.loading1 = true; + this.loadingStore.pushLoading(() => (row.loading1 = false)); + this.$router.push(`userEdit/${row.userInfo.guid}`); }, - itemActive(scope) { + itemActive(row) { const param = { - guid: scope.row.userInfo.guid, - isenable: !scope.row.userInfo.isenable + guid: row.userInfo.guid, + isenable: !row.userInfo.isenable }; - const msg = scope.row.userInfo.isenable ? '涓嬬嚎' : '涓婄嚎'; + const msg = row.userInfo.isenable ? '涓嬬嚎' : '涓婄嚎'; useMessageBoxTip({ confirmMsg: `纭${msg}璇ュ満鏅紵`, confirmTitle: msg, onConfirm: async () => { - scope.row.loading2 = true; + row.loading2 = true; return userApi .updateUserInfo(param) .then((res) => { if (res.success) { - scope.row.userInfo.isenable = param.isenable; + row.userInfo.isenable = param.isenable; } }) .finally(() => { - scope.row.loading2 = false; + row.loading2 = false; }); } }); }, tableRowClassName({ row }) { return row.userInfo.isenable ? 'online-row' : 'offline-row'; + }, + handleCommand(e){ + const userId = e.p.userInfo.guid + switch (e.c) { + // 涓嬭浇鐜俊鐮� + case 1: + creditApi.downloadCode(userId) + break; + + default: + break; + } } } }; -- Gitblit v1.9.3