From 22229c67d87f0fae4c4bc90db106b8a1e2c49b53 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 20 八月 2026 15:50:11 +0800
Subject: [PATCH] feat(permission): 为多个模块添加管理员权限控制功能
---
src/views/basicData/customerFile/index.vue | 74 +++++++++++++++++++-----------------
1 files changed, 39 insertions(+), 35 deletions(-)
diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index 64618be..3385fef 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -155,7 +155,40 @@
</el-col>
</el-row>
- <el-row :gutter="30">
+ <el-row :gutter="30"
+ v-for="(contact, index) in formYYs.contactList"
+ :key="index">
+ <el-col :span="12">
+ <el-form-item label="鑱旂郴浜猴細"
+ prop="contactPerson">
+ <el-input v-model="contact.contactPerson"
+ placeholder="璇疯緭鍏�"
+ clearable />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鑱旂郴鐢佃瘽锛�"
+ prop="contactPhone">
+ <div style="display: flex; align-items: center;width: 100%;">
+ <el-input v-model="contact.contactPhone"
+ placeholder="璇疯緭鍏�"
+ clearable />
+ <el-button @click="removeContact(index)"
+ type="danger"
+ circle
+ style="margin-left: 5px;">
+ <el-icon>
+ <Close />
+ </el-icon>
+ </el-button>
+ </div>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-button @click="addNewContact"
+ style="margin-bottom: 10px;">+ 鏂板鑱旂郴浜�</el-button>
+ <el-row :gutter="30">
<el-col :span="12">
<el-form-item label="浠g悊浜�"
prop="agent">
@@ -187,38 +220,6 @@
</el-form-item>
</el-col>
</el-row>
- <el-row :gutter="30"
- v-for="(contact, index) in formYYs.contactList"
- :key="index">
- <el-col :span="12">
- <el-form-item label="鑱旂郴浜猴細"
- prop="contactPerson">
- <el-input v-model="contact.contactPerson"
- placeholder="璇疯緭鍏�"
- clearable />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鑱旂郴鐢佃瘽锛�"
- prop="contactPhone">
- <div style="display: flex; align-items: center;width: 100%;">
- <el-input v-model="contact.contactPhone"
- placeholder="璇疯緭鍏�"
- clearable />
- <el-button @click="removeContact(index)"
- type="danger"
- circle
- style="margin-left: 5px;">
- <el-icon>
- <Close />
- </el-icon>
- </el-button>
- </div>
- </el-form-item>
- </el-col>
- </el-row>
- <el-button @click="addNewContact"
- style="margin-bottom: 10px;">+ 鏂板鑱旂郴浜�</el-button>
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="缁存姢浜猴細"
@@ -658,7 +659,7 @@
</template>
<script setup>
- import { onMounted, ref, reactive, getCurrentInstance, toRefs } from "vue";
+ import { onMounted, ref, reactive, getCurrentInstance, toRefs, computed } from "vue";
import { Search, Paperclip, Upload } from "@element-plus/icons-vue";
import {
addCustomerPrivate,
@@ -681,6 +682,9 @@
import { getToken } from "@/utils/auth.js";
const { proxy } = getCurrentInstance();
const userStore = useUserStore();
+ const isAdminUser = computed(() =>
+ ["admin", "鏅��2", "鏈�楂�1"].some(r => (userStore.roles || []).includes(r))
+ );
// 鍥炶鎻愰啋鐩稿叧
const reminderDialogVisible = ref(false);
@@ -1193,7 +1197,7 @@
let ids = [];
if (selectedRows.value.length > 0) {
const unauthorizedData = selectedRows.value.filter(
- item => item.type === 1 || item.type === "1"
+ item => (item.type === 1 || item.type === "1") && !isAdminUser.value
);
if (unauthorizedData.length > 0) {
proxy.$modal.msgWarning("鍏捣鍒嗛厤鐨勫鎴蜂笉鑳藉垹闄�");
--
Gitblit v1.9.3