|
|
@@ -7,13 +7,13 @@
|
|
|
<div class="btn">
|
|
|
<el-button type="" v-if="formSearch.appIds && selectData.length > 0" @click="clearSelection">取消全选</el-button>
|
|
|
<!-- <el-button type="primary" :disabled="!selectData.length > 0" @click="userCheck">批量审核</el-button> -->
|
|
|
- <el-button type="danger" :disabled="!selectData.length > 0" @click="edit({}, 2)">批量封禁母包</el-button>
|
|
|
- <el-button type="danger" :disabled="!selectData.length > 0" @click="edit({}, 1)">批量封禁</el-button>
|
|
|
- <el-button type="danger" :disabled="!selectData.length > 0" @click="edit({}, 3)">批量封禁IP</el-button>
|
|
|
- <el-button type="primary" :disabled="!selectData.length > 0" @click="editUserType({}, true)">批量解封</el-button>
|
|
|
- <el-button type="success" :disabled="!selectData.length > 0" @click="exportUserList">批量导出</el-button>
|
|
|
- <el-tooltip class="box-item" effect="dark" content="慎用 比较占用服务器资源!!! 导出数量(根据左下角条数)" placement="bottom">
|
|
|
- <el-button type="warning" :disabled="!page.total > 0" @click="allExportUserList">全部导出</el-button>
|
|
|
+ <el-button type="danger" v-if="appShare" :disabled="!selectData.length > 0" @click="edit({}, 2)">批量封禁母包</el-button>
|
|
|
+ <el-button type="danger" v-if="appShare" :disabled="!selectData.length > 0" @click="edit({}, 1)">批量封禁</el-button>
|
|
|
+ <el-button type="danger" v-if="appShare" :disabled="!selectData.length > 0" @click="edit({}, 3)">批量封禁IP</el-button>
|
|
|
+ <el-button type="primary" v-if="appShare" :disabled="!selectData.length > 0" @click="editUserType({}, true)">批量解封</el-button>
|
|
|
+ <el-button type="success" v-if="appShare" :disabled="!selectData.length > 0" @click="exportUserList">批量导出</el-button>
|
|
|
+ <el-tooltip class="box-item" v-if="appShare" effect="dark" content="慎用 比较占用服务器资源!!! 导出数量(根据左下角条数)" placement="bottom">
|
|
|
+ <el-button type="warning" :disabled="!page.total > 0" @click="allExportUserList">全部导出</el-button>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
|
|
|
@@ -204,6 +204,9 @@ const { loadDictData, getOptions, getDictionaryName } = useGetDictList();
|
|
|
const tableData = ref([]);
|
|
|
const table = ref(null)
|
|
|
const appType = ref(1)
|
|
|
+const appShare = ref(false);
|
|
|
+// 新增:存储所有应用选项的响应式变量
|
|
|
+const allAppsOptions = ref([]);
|
|
|
|
|
|
// 分页参数, 供table使用
|
|
|
const page = reactive({
|
|
|
@@ -315,8 +318,10 @@ const getApiOptions = async () => {
|
|
|
const appsOptions = appData.map(item => ({
|
|
|
label: item.appName,
|
|
|
value: item.appId,
|
|
|
- appType: item.appType
|
|
|
+ appType: item.appType,
|
|
|
+ appUserId: item.userId
|
|
|
}))
|
|
|
+ allAppsOptions.value = appsOptions;
|
|
|
|
|
|
// 赋值到表单项
|
|
|
dynamicFormItems.value[3].options = ditchOptions
|
|
|
@@ -329,6 +334,9 @@ const getApiOptions = async () => {
|
|
|
dynamicFormItems.value[2].defaultVal = firstApp.value
|
|
|
formSearch.value.appIds = firstApp.value
|
|
|
|
|
|
+ // 判断第一个应用是否属于当前用户
|
|
|
+ appShare.value = appsOptions[0].appUserId == store.state.user.info.userId;
|
|
|
+
|
|
|
dynamicFormItemsTarget.value = appsOptions[0].appType === 1
|
|
|
? dynamicFormItems.value.slice(0, 7)
|
|
|
: dynamicFormItems.value
|
|
|
@@ -433,11 +441,17 @@ const handleFormReset = () => {
|
|
|
|
|
|
const handleFormSelect = (item, e) => {
|
|
|
if (item.prop === 'appIds') {
|
|
|
+ // 查找选中的应用信息
|
|
|
+ const selectedApp = allAppsOptions.value.find(app => app.value === e);
|
|
|
+ if (selectedApp) {
|
|
|
+ // 判断选中的应用是否属于当前用户
|
|
|
+ appShare.value = selectedApp.appUserId == store.state.user.info.userId;
|
|
|
+ }
|
|
|
+
|
|
|
const options = item.options
|
|
|
// appType 1-安卓 2-IOS
|
|
|
const appTypeNum = options.find((item) => item.value === e).appType
|
|
|
|
|
|
-
|
|
|
dynamicFormItems.value[0].defaultVal = formSearch.value.nickName
|
|
|
dynamicFormItems.value[1].defaultVal = formSearch.value.userId
|
|
|
dynamicFormItems.value[2].defaultVal = e
|