WanGxC hace 8 meses
padre
commit
763c9f38ab

+ 0 - 44
src/views/company-information/api.ts

@@ -1,44 +0,0 @@
-import { request } from '/@/utils/service';
-
-
-const apiPrefix = '/api/assets/company/';
-
-export function getCardData(query: any) {
-  return request({
-    url: apiPrefix + 'card/',
-    method: 'GET',
-    params: query,
-  });
-}
-
-export function getTableData(query: any) {
-  return request({
-    url: apiPrefix + 'shop/',
-    method: 'GET',
-    params: query,
-  });
-}
-
-export function getCompanyOverview(query: any) {
-  return request({
-    url: apiPrefix + `${query.companyId}/`,
-    method: 'GET',
-  });
-}
-
-export function updateShopDetail(query: any) {
-  return request({
-    url: apiPrefix + `${query.id}/`,
-    method: 'POST',
-    params: { partial: query.partial },
-    data: query.formData,
-  });
-}
-
-export function createCompany(body: any) {
-  return request({
-    url: apiPrefix + 'create/',
-    method: 'POST',
-    data: body,
-  });
-}

+ 0 - 184
src/views/company-information/components/CompanyCreate.vue

@@ -1,184 +0,0 @@
-<script lang="ts" setup>
-/**
- * @Name: CompanyCreate.vue
- * @Description: 新增公司
- * @Author: Cheney
- */
-
-import { ElMessage, FormInstance, FormRules } from 'element-plus';
-import { useResponse } from '/@/utils/useResponse';
-import * as api from '../api';
-import { Delete, Finished, Plus, RefreshLeft } from '@element-plus/icons-vue';
-
-
-const isOpen = defineModel({ default: false });
-const emit = defineEmits([ 'refresh' ]);
-
-const createLoading = ref(false);
-
-interface ContactItem {
-  phone: string;
-  email: string;
-}
-
-interface RuleForm {
-  name: string;
-  address: string;
-  enName: string;
-  juridicalPerson: string;
-  vatNumber: string;
-  vatCompany: string;
-  contacts: ContactItem[];
-}
-
-const ruleFormRef = ref<FormInstance>();
-const form = reactive<RuleForm>({
-  name: '',
-  address: '',
-  enName: '',
-  juridicalPerson: '',
-  vatNumber: '',
-  vatCompany: '',
-  contacts: [
-    {
-      phone: '',
-      email: ''
-    }
-  ]
-});
-
-const rules = reactive<FormRules<RuleForm>>({
-  name: [ { required: true, message: '请输入公司名称', trigger: 'blur' } ],
-  enName: [ { required: true, message: '请输入公司英文名称', trigger: 'blur' } ],
-  address: [ { required: true, message: '请输入公司地址', trigger: 'blur' } ],
-  juridicalPerson: [ { required: true, message: '请输入公司法人', trigger: 'blur' } ],
-  vatNumber: [ { required: true, message: '请输入VAT税号', trigger: 'blur' } ],
-  vatCompany: [ { required: true, message: '请输入VAT税号公司', trigger: 'blur' } ],
-  contacts: {
-    phone: [ { required: true, message: '请输入电话号码', trigger: 'blur' } ],
-    email: [
-      { required: true, message: '请输入邮箱地址', trigger: 'blur' },
-      { type: 'email', message: '请输入有效的邮箱地址', trigger: 'blur' }
-    ]
-  }
-});
-
-const addContact = () => {
-  form.contacts.push({
-    phone: '',
-    email: ''
-  });
-};
-
-const removeContact = (item: ContactItem) => {
-  const index = form.contacts.indexOf(item);
-  if (index !== -1) {
-    form.contacts.splice(index, 1);
-  }
-};
-
-async function create() {
-  const body = {
-    company: form.name,
-    companyEnglishName: form.enName,
-    address: form.address,
-    juridicalPerson: form.juridicalPerson,
-    vatNumber: form.vatNumber,
-    vatCompany: form.vatCompany,
-    companyPhoneEmail: form.contacts
-  };
-  await useResponse(body, api.createCompany, createLoading);
-}
-
-const submitForm = async (formEl: FormInstance | undefined) => {
-  if (!formEl) return;
-  await formEl.validate(async (valid, fields) => {
-    if (valid) {
-      await create();
-      isOpen.value = false;
-      emit('refresh');
-    } else {
-      console.log('error submit!', fields);
-      ElMessage.error('请检查表单');
-    }
-  });
-};
-
-const resetForm = (formEl: FormInstance | undefined) => {
-  if (!formEl) return;
-  formEl.resetFields();
-};
-</script>
-
-<template>
-  <el-dialog v-model="isOpen" :close-on-click-modal="false" title="新增公司" width="35%">
-    <el-form
-        ref="ruleFormRef"
-        :model="form"
-        :rules="rules"
-        label-width="auto"
-        status-icon
-    >
-      <el-form-item label="公司名称" prop="name">
-        <el-input v-model="form.name" placeholder="请输入公司名称"></el-input>
-      </el-form-item>
-      <el-form-item label="英文名称" prop="enName">
-        <el-input v-model="form.enName" placeholder="请输入公司英文名称"></el-input>
-      </el-form-item>
-      <el-form-item label="公司地址" prop="address">
-        <el-input v-model="form.address" placeholder="请输入公司地址"></el-input>
-      </el-form-item>
-      <el-form-item label="公司法人" prop="juridicalPerson">
-        <el-input v-model="form.juridicalPerson" placeholder="请输入公司法人"></el-input>
-      </el-form-item>
-      <el-form-item label="VAT税号" prop="vatNumber">
-        <el-input v-model="form.vatNumber" placeholder="请输入VAT税号"></el-input>
-      </el-form-item>
-      <el-form-item label="VAT税号公司" prop="vatCompany">
-        <el-input v-model="form.vatCompany" placeholder="请输入VAT税号公司"></el-input>
-      </el-form-item>
-
-      <el-form-item
-          v-for="(contact, index) in form.contacts"
-          :key="index"
-          :label="'联系方式' + (index + 1)"
-      >
-        <div class="flex gap-2.5 items-start">
-          <el-form-item
-              :prop="'contacts.' + index + '.phone'"
-          >
-            <el-input
-                v-model="contact.phone"
-                placeholder="请输入电话"
-            />
-          </el-form-item>
-          <el-form-item
-              :prop="'contacts.' + index + '.email'"
-              :rules="rules.contacts.email"
-          >
-            <el-input
-                v-model="contact.email"
-                placeholder="请输入邮箱"
-            />
-          </el-form-item>
-          <el-button :icon="Delete" type="danger" @click.prevent="removeContact(contact)">
-            删 除
-          </el-button>
-        </div>
-      </el-form-item>
-
-      <el-form-item>
-        <div class="flex flex-1 justify-end">
-          <el-button :icon="Plus" type="warning" @click="addContact">新增联系方式</el-button>
-          <el-button :icon="Finished" :loading="createLoading" type="primary" @click="submitForm(ruleFormRef)">创 建
-          </el-button>
-          <el-button :icon="RefreshLeft" @click="resetForm(ruleFormRef)">重 置</el-button>
-        </div>
-      </el-form-item>
-    </el-form>
-  </el-dialog>
-</template>
-
-<style scoped>
-
-</style>

+ 0 - 219
src/views/company-information/components/CompanyDetail.vue

@@ -1,219 +0,0 @@
-<script lang="ts" setup>
-/**
- * @Name: CompanyDetail.vue
- * @Description: 公司详情
- * @Author: Cheney
- */
-
-import { Edit, Link, Picture as IconPicture } from '@element-plus/icons-vue';
-import { companyColumns } from '../useColumns';
-import { usePagination } from '/@/utils/usePagination';
-import { useTableData } from '/@/utils/useTableData';
-import * as api from '../api';
-import router from '/@/router';
-import { useResponse } from '/@/utils/useResponse';
-import EditDrawer from '../components/EditDrawer.vue';
-
-
-const route = useRoute();
-const companyId = route.query.id;
-const companyOverview: any = ref([]);
-const overviewLoading = ref();
-const { tableOptions, handlePageChange } = usePagination(fetchCompanyDetail);
-const platformTableData = ref([]);
-const gridOptions: any = reactive({
-  border: false,
-  round: true,
-  stripe: true,
-  currentRowHighLight: true,
-  height: 870,
-  toolbarConfig: {
-    custom: true
-  },
-  rowConfig: {
-    isHover: true
-  },
-  columnConfig: {
-    resizable: true
-  },
-  pagerConfig: {
-    total: tableOptions.value.total,
-    page: tableOptions.value.page,
-    limit: tableOptions.value.limit
-  },
-  loading: false,
-  loadingConfig: {
-    icon: 'vxe-icon-indicator roll',
-    text: '正在拼命加载中...'
-  },
-  columns: companyColumns,
-  data: platformTableData
-});
-
-const isOpen = ref(false);
-
-onBeforeMount(() => {
-  fetchCompanyOverview();
-  fetchCompanyDetail();
-});
-
-async function fetchCompanyDetail() {
-  const query = {
-    id: companyId,
-    page: gridOptions.pagerConfig.page,
-    limit: gridOptions.pagerConfig.limit
-  };
-  await useTableData(api.getTableData, query, gridOptions);
-}
-
-async function fetchCompanyOverview() {
-  const res = await useResponse({ companyId }, api.getCompanyOverview, overviewLoading);
-  companyOverview.value = res.data;
-}
-
-function handleNavigate(item: any) {
-  router.push({
-    path: '/shop/detail',
-    query: { platformNumber: item.platformNumber }
-  });
-}
-
-function drawerOpen() {
-  isOpen.value = true;
-}
-
-function handleRefresh() {
-  fetchCompanyOverview();
-}
-
-const contactGroups = computed(() => {
-  const contacts = companyOverview.value?.companyPhoneEmail || [];
-  if (!Array.isArray(contacts)) {
-    console.error('companyPhoneEmail is not an array:', contacts);
-    return [];
-  }
-
-  const groups = [];
-
-  if (contacts.length > 0) {
-    groups.push(contacts.slice(0, 2));
-  }
-
-  for (let i = 2; i < contacts.length; i += 3) {
-    groups.push(contacts.slice(i, i + 3));
-  }
-
-  return groups;
-});
-</script>
-
-<template>
-  <div class="p-2.5">
-    <el-card v-loading="overviewLoading" body-class="flex items-center gap-10" shadow="hover" style="border: none">
-      <el-image :src="`/src/assets/platformImg/${ companyId }.png`" class="mr-7 rounded-2xl" fit="contain"
-                style="height: 120px; width: 120px;">
-        <template #error>
-          <div class="mr-3.5 flex items-center justify-center text-5xl"
-               style="height: 100%; width: 100%; background-color: #f5f5f5">
-            <el-icon>
-              <icon-picture/>
-            </el-icon>
-          </div>
-        </template>
-      </el-image>
-      <div class="text-lg whitespace-nowrap">
-        <div class="font-semibold relative">
-          <el-button :icon="Edit" class="absolute" link style="left: -20px; bottom: 2px;" type="warning"
-                     @click="drawerOpen"></el-button>
-          公司名称:
-          <span class="font-medium italic ml-1.5" style="color: #64748b;"> 
-            {{ companyOverview?.company ? companyOverview?.company : '--' }} 
-          </span>
-        </div>
-        <div class="font-semibold">
-          公司英文名:
-          <span class="font-medium italic ml-1.5" style="color: #64748b">
-            {{ companyOverview?.companyEnglishName ? companyOverview?.companyEnglishName : '--' }} 
-          </span>
-        </div>
-        <div class="font-semibold">
-          公司地址:
-          <span class="font-medium italic ml-1.5" style="color: #64748b">
-            {{ companyOverview?.address ? companyOverview?.address : '--' }}
-          </span>
-        </div>
-      </div>
-      <div class="text-lg whitespace-nowrap">
-        <div class="font-semibold">
-          公司法人:
-          <span class="font-medium italic ml-1.5" style="color: #64748b"> 
-            {{ companyOverview?.juridicalPerson ? companyOverview?.juridicalPerson : '--' }} 
-          </span>
-        </div>
-        <div class="font-semibold">
-          VAT税号:
-          <span class="font-medium italic ml-1.5" style="color: #64748b"> 
-            {{ companyOverview?.vatNumber ? companyOverview?.vatNumber : '--' }} 
-          </span>
-        </div>
-        <div class="font-semibold">
-          VAT税号公司:
-          <span class="font-medium italic ml-1.5" style="color: #64748b"> 
-            {{ companyOverview?.vatCompany ? companyOverview?.vatCompany : '--' }} 
-          </span>
-        </div>
-      </div>
-      <div v-if="contactGroups.length > 0" class="flex flex-wrap whitespace-nowrap">
-        <div v-for="(group, groupIndex) in contactGroups" :key="groupIndex">
-          <div class="text-lg font-semibold">
-            <template v-if="groupIndex === 0">
-              公司联系方式:
-            </template>
-            <div v-for="(item, itemIndex) in group" :key="itemIndex"
-                 class="font-medium italic mr-3" style="color: #64748b">
-              {{ item.phone }} - {{ item.email }}
-            </div>
-          </div>
-        </div>
-      </div>
-      <div v-else class="text-lg font-semibold">
-        暂无联系方式
-      </div>
-    </el-card>
-
-    <el-card body-style="padding-top: 10px" class="mt-2.5" shadow="hover" style="border: none">
-      <vxe-grid v-bind="gridOptions">
-        <template #platformNumber="{ row }">
-          <el-button link style="font-weight: 700" type="primary" @click="handleNavigate(row)">
-            <el-icon>
-              <Link/>
-            </el-icon>
-            {{ row.platformNumber ? row.platformNumber : '--' }}
-          </el-button>
-        </template>
-        <template #pager>
-          <vxe-pager
-              v-model:currentPage="gridOptions.pagerConfig.page"
-              v-model:pageSize="gridOptions.pagerConfig.limit"
-              :total="gridOptions.pagerConfig.total"
-              @page-change="handlePageChange"
-          >
-          </vxe-pager>
-        </template>
-      </vxe-grid>
-    </el-card>
-
-    <EditDrawer
-        v-if="isOpen"
-        v-model="isOpen"
-        :company="companyOverview.company"
-        :companyOverview
-        :formSelect
-        @refresh="handleRefresh"
-    />
-  </div>
-</template>
-
-<style scoped>
-
-</style>

+ 0 - 213
src/views/company-information/components/EditDrawer.vue

@@ -1,213 +0,0 @@
-<script lang="ts" setup>
-/**
- * @Name: EditDrawer.vue
- * @Description: 公司编辑
- * @Author: Cheney
- */
-
-import { ElMessage, FormInstance, FormRules } from 'element-plus';
-import { useResponse } from '/@/utils/useResponse';
-import * as api from '../api';
-import { Delete, Plus } from '@element-plus/icons-vue';
-import { cloneDeep } from 'lodash';
-
-
-const loading = ref(false);
-const isOpen = defineModel({ default: false });
-const { companyOverview, company } = defineProps<{
-  companyOverview: any;
-  company: any;
-}>();
-
-const emit = defineEmits([ 'refresh' ]);
-
-onBeforeMount(() => {
-  replaceCol();
-});
-
-interface ContactItem {
-  phone: string;
-  email: string;
-}
-
-interface RuleForm {
-  company: string;
-  companyEnglishName: string;
-  address: string;
-  juridicalPerson: string;
-  vatNumber: string;
-  vatCompany: string;
-  contacts: ContactItem[];
-}
-
-const ruleFormRef = ref<FormInstance>();
-const ruleForm = reactive<RuleForm>({
-  company: '',
-  companyEnglishName: '',
-  address: '',
-  juridicalPerson: '',
-  vatNumber: '',
-  vatCompany: '',
-  contacts: [
-    {
-      phone: '',
-      email: ''
-    }
-  ]
-});
-
-const rules = reactive<FormRules<RuleForm>>({
-  company: [
-    { required: true, message: 'Please input platform name', trigger: 'blur' }
-  ],
-  companyEnglishName: [
-    { required: true, message: 'Please input platform name', trigger: 'blur' }
-  ],
-  address: [
-    { required: true, message: 'Please input country name', trigger: 'blur' }
-  ],
-  juridicalPerson: [
-    { required: true, message: 'Please input platform name', trigger: 'blur' }
-  ],
-  vatNumber: [
-    { required: true, message: 'Please select line', trigger: 'change' }
-  ],
-  vatCompany: [
-    { required: true, message: 'Please select line', trigger: 'change' }
-  ],
-  contacts: {
-    phone: [ { required: true, message: '请输入电话号码', trigger: 'blur' } ],
-    email: [
-      { required: true, message: '请输入邮箱地址', trigger: 'blur' },
-      { type: 'email', message: '请输入有效的邮箱地址', trigger: 'blur' }
-    ]
-  }
-});
-
-const addContact = () => {
-  ruleForm.contacts.push({
-    phone: '',
-    email: ''
-  });
-};
-
-const removeContact = (item: ContactItem) => {
-  const index = ruleForm.contacts.indexOf(item);
-  if (index !== -1) {
-    ruleForm.contacts.splice(index, 1);
-  }
-};
-
-const submitForm = async (formEl: FormInstance | undefined) => {
-  if (!formEl) return;
-  await formEl.validate(async (valid, fields) => {
-    if (valid) {
-      const formData = {
-        ...ruleForm,
-        companyPhoneEmail: ruleForm.contacts.map(contact => ({
-          email: contact.email,
-          phone: contact.phone
-        }))
-      };
-      await useResponse({ id: companyOverview.id, partial: 1, formData }, api.updateShopDetail, loading);
-      isOpen.value = false;
-      ElMessage.success('编辑成功');
-      emit('refresh');
-    } else {
-      console.log('error submit!', fields);
-    }
-  });
-};
-
-const resetForm = (formEl: FormInstance | undefined) => {
-  if (!formEl) return;
-  formEl.resetFields();
-};
-
-function replaceCol() {
-  const result = Object.keys(ruleForm).reduce((acc, key) => {
-    if (key in companyOverview) {
-      acc[key] = companyOverview[key];
-    }
-    return acc;
-  }, {} as { [key: string]: any });
-
-  // 处理 contacts 字段
-  if (companyOverview.companyPhoneEmail) {
-    result.contacts = cloneDeep(companyOverview.companyPhoneEmail);  // 深拷贝
-  }
-
-  Object.assign(ruleForm, result);
-}
-</script>
-
-<template>
-  <el-drawer v-model="isOpen" :title="`公司编辑 - ${company}`" size="30%">
-    <el-form
-        ref="ruleFormRef"
-        :model="ruleForm"
-        :rules="rules"
-        class="mx-2.5 mt-2.5"
-        label-width="auto"
-        status-icon>
-      <el-form-item label="公司名称" prop="platformNumber">
-        <el-input v-model="ruleForm.company"/>
-      </el-form-item>
-      <el-form-item label="公司英文名" prop="platformName">
-        <el-input v-model="ruleForm.companyEnglishName"/>
-      </el-form-item>
-      <el-form-item label="公司地址" prop="country">
-        <el-input v-model="ruleForm.address"/>
-      </el-form-item>
-      <el-form-item label="公司法人" prop="brandName">
-        <el-input v-model="ruleForm.juridicalPerson"/>
-      </el-form-item>
-      <el-form-item label="VAT税号" prop="status">
-        <el-input v-model="ruleForm.vatNumber"/>
-      </el-form-item>
-      <el-form-item label="VAT税号公司" prop="platform">
-        <el-input v-model="ruleForm.vatCompany"/>
-      </el-form-item>
-
-      <el-form-item
-          v-for="(contact, index) in ruleForm.contacts"
-          :key="index"
-          :label="'联系方式' + (index + 1)"
-      >
-        <div class="flex gap-2.5 items-start">
-          <el-form-item
-              :prop="'contacts.' + index + '.phone'"
-          >
-            <el-input
-                v-model="contact.phone"
-                placeholder="请输入电话"
-            />
-          </el-form-item>
-          <el-form-item
-              :prop="'contacts.' + index + '.email'"
-              :rules="rules.contacts.email"
-          >
-            <el-input
-                v-model="contact.email"
-                placeholder="请输入邮箱"
-            />
-          </el-form-item>
-          <el-button :icon="Delete" type="danger" @click.prevent="removeContact(contact)">
-            删 除
-          </el-button>
-        </div>
-      </el-form-item>
-      <el-form-item>
-        <div class="flex flex-1 justify-center">
-          <el-button :icon="Plus" type="warning" @click="addContact">新增联系方式</el-button>
-          <el-button :loading="loading" type="primary" @click="submitForm(ruleFormRef)">确 定</el-button>
-          <el-button @click="resetForm(ruleFormRef)">重 置</el-button>
-        </div>
-      </el-form-item>
-    </el-form>
-  </el-drawer>
-</template>
-
-<style scoped>
-
-</style>

+ 0 - 91
src/views/company-information/components/InfoCard.vue

@@ -1,91 +0,0 @@
-<script lang="ts" setup>
-/**
- * @Name: InfoCard.vue
- * @Description: 电脑信息卡片
- * @Author: Cheney
- */
-
-import { useRouter } from 'vue-router';
-import { ElCard, ElCol, ElDescriptions, ElIcon, ElRow } from 'element-plus';
-import { Platform, Picture as IconPicture, Search, Shop } from '@element-plus/icons-vue';
-
-
-const router = useRouter();
-const cardData = inject<Ref>('cardData', ref({}));
-
-function handleNavigate(item: any) {
-  router.push({
-    path: '/company/detail',
-    query: { id: item.id }
-  });
-}
-
-function getImageSrc(platform: string) {
-  return new URL(`/src/assets/platformImg/${ platform }.png`, import.meta.url).href;
-}
-
-</script>
-
-<template>
-  <el-row :gutter="20">
-    <el-col v-for="(item, index) in cardData" :key="index" :lg="6" :md="8" :sm="8" :xl="4" :xs="12" class="my-2.5">
-      <el-card body-style="padding: 0px 10px 0px 10px" shadow="hover">
-        <el-descriptions>
-          <template #title>
-            <el-image :src="getImageSrc(item.platform)" class="my-2.5 rounded-2xl" fit="contain"
-                      style="width: 60px; height: 60px">
-              <template #error>
-                <div class="flex justify-center items-center" style="width: 60px; height: 60px; font-size: 4rem">
-                  <el-icon>
-                    <icon-picture/>
-                  </el-icon>
-                </div>
-              </template>
-            </el-image>
-            <div class="text-xl mb-2" style="color: #606266;">{{ item.company ? item.company : '暂无' }}</div>
-            <hr style="box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);">
-          </template>
-        </el-descriptions>
-        <div class="flex justify-evenly mb-2.5">
-          <div>
-            <el-icon style="top: 2px; margin-right: 6px; font-size: 1.2rem">
-              <Shop/>
-            </el-icon>
-            <span class="font-medium text-lg mr-2">店铺</span>
-            <span class="font-medium text-xl italic">
-              {{ item.countShop }}
-            </span>
-          </div>
-          <div>
-            <el-icon style="top: 2px; margin-right: 5px; font-size: 1.2rem">
-              <Platform />
-            </el-icon>
-            <span class="font-medium text-lg mr-2">电脑</span>
-            <span class="font-medium text-xl italic">
-              {{ item.countComputer }}
-            </span>
-          </div>
-        </div>
-        <template #footer>
-          <div style="text-align: center; padding: 0 10px">
-            <el-button :icon="Search" plain round style="width: 100%" type="primary" @click="handleNavigate(item)">
-              查看详情
-            </el-button>
-          </div>
-        </template>
-      </el-card>
-    </el-col>
-  </el-row>
-</template>
-
-<style scoped>
-:deep(.el-descriptions__header .el-descriptions__title) {
-  flex: 1;
-  text-align: center;
-}
-
-:deep(.el-card__footer) {
-  border-top: none;
-  padding: 0 0 10px 0;
-}
-</style>

+ 0 - 64
src/views/company-information/index.vue

@@ -1,64 +0,0 @@
-<script lang="ts" setup>
-/**
- * @Name: index.vue
- * @Description: 公司信息页面
- * @Author: Cheney
- */
-
-import { useResponse } from '/@/utils/useResponse';
-import * as api from './api';
-import InfoCard from './components/InfoCard.vue';
-import { Plus } from '@element-plus/icons-vue';
-import CompanyCreate from '/@/views/company-information/components/CompanyCreate.vue';
-
-
-const cardData = ref();
-provide('cardData', cardData);
-
-const loading = ref(false);
-
-const isOpen = ref();
-
-onBeforeMount(() => {
-  initData();
-});
-
-async function initData() {
-  const res = await useResponse({}, api.getCardData, loading);
-  cardData.value = res.data;
-}
-
-async function addCompany() {
-  isOpen.value = true;
-}
-
-function handleRefresh() {
-  initData();
-}
-</script>
-
-<template>
-  <div class="px-2.5">
-    <el-card class="my-2.5" shadow="never" style="border: none;">
-      <div class="flex justify-between items-baseline">
-        <div>
-          <span class="font-bold text-xl">公司信息概览</span>
-          <el-divider class=" text-3xl" direction="vertical"/>
-        </div>
-        <span>
-           <el-button :icon="Plus" type="primary" @click="addCompany">添 加</el-button>
-        </span>
-      </div>
-    </el-card>
-    <el-card v-loading="loading" shadow="never" style="border: none; min-height: 692px;">
-      <InfoCard></InfoCard>
-    </el-card>
-    <CompanyCreate v-model="isOpen" @refresh="handleRefresh"/>
-  </div>
-</template>
-
-<style scoped>
-:deep(.el-divider__text.is-left) {
-  background-color: #F5F5F5;
-}
-</style>

+ 0 - 74
src/views/company-information/useColumns.tsx

@@ -1,74 +0,0 @@
-import { useCountryInfoStore } from '/@/stores/countryInfo';
-
-
-const countryInfoStore = useCountryInfoStore();
-
-export const companyColumns = [
-  { type: 'seq', width: 50, align: 'center', fixed: 'left' },
-  {
-    field: 'platform', title: '平台', minWidth: 'auto', align: 'center',
-    slots: {
-      default({ row }: any) {
-        return <span class={ 'font-medium' }>{ row.platform ? row.platform : '--' }</span>;
-      }
-    }
-  },
-  {
-    field: 'platformNumber', title: '平台编号', minWidth: 'auto', align: 'center',
-    slots: {
-      default({ row }: any) {
-        return <span class={ 'font-medium' }>{ row.platformNumber ? row.platformNumber : '--' }</span>;
-      }
-    }
-  },
-  {
-    field: 'platformName', title: '平台名称', minWidth: 'auto', align: 'center',
-    slots: {
-      default({ row }: any) {
-        return <span class={ 'font-medium' }>{ row.platformName ? row.platformName : '--' }</span>;
-      }
-    }
-  },
-  {
-    field: 'status', title: '状态', width: 80, align: 'center',
-    slots: {
-      default({ row }: any) {
-        return (
-            <el-tag
-                class="font-medium"
-                type={ row.status === 1 ? 'success' : 'danger' }
-            >
-              { row.status === 1 ? '启用' : '暂停' }
-            </el-tag>
-        );
-      }
-    }
-  },
-  {
-    field: 'country', title: '国家', minWidth: 'auto', align: 'center',
-    slots: {
-      default({ row }: any) {
-        const country = countryInfoStore.countries.find(c => c.name === row.country);
-        const color = country ? country.color : '#3875F6';
-        return <el-tag effect="plain" round
-                       style={ { color: color, borderColor: color } }>{ row.country ? row.country : '--' }</el-tag>;
-      }
-    }
-  },
-  {
-    field: 'brandName', title: '品牌', minWidth: 'auto', align: 'center',
-    slots: {
-      default({ row }: any) {
-        return <span class={ 'font-medium' }>{ row.brandName ? row.brandName : '--' }</span>;
-      }
-    }
-  },
-  {
-    field: 'line', title: '线路', minWidth: 'auto', align: 'center',
-    slots: {
-      default({ row }: any) {
-        return <span class={ 'font-medium' }>{ row.line ? row.line : '--' }</span>;
-      }
-    }
-  },
-];

+ 0 - 13
src/views/computer-information/api.ts

@@ -1,13 +0,0 @@
-import { request } from '/@/utils/service';
-
-
-const apiPrefix = '/api/assets/computer/';
-
-export function getCardData(query: any) {
-  return request({
-    url: apiPrefix + 'card/',
-    method: 'GET',
-    params: query,
-  });
-}
-

+ 0 - 94
src/views/computer-information/components/ComputerDetail.vue

@@ -1,94 +0,0 @@
-<script setup lang="ts">/**
- * @Name: ComputerDetail.vue
- * @Description: 电脑信息-当前
- * @Author: xinyan
- */
-import { ComputerColumns } from '/@/views/computer-information/useColumns';
-
-const gridOptions: any = reactive({
-  border: 'inner',
-  round: true,
-  stripe: true,
-  currentRowHighLight: true,
-  height: 870,
-  toolbarConfig: {
-    custom: true,
-    slots: {
-      buttons: 'toolbar_buttons'
-      // tools: 'toolbar_tools'
-    }
-  },
-  rowConfig: {
-    isHover: true
-  },
-  columnConfig: {
-    resizable: true
-  },
-  pagerConfig: {
-    total: 0,
-    page: 1,
-    limit: 10
-  },
-  loading: false,
-  loadingConfig: {
-    icon: 'vxe-icon-indicator roll',
-    text: '正在拼命加载中...'
-  },
-  columns: ComputerColumns,
-  data: []
-});
-</script>
-
-<template>
-  <div class="p-2.5">
-    <!-- overview-card -->
-    <el-card body-class="flex items-center" shadow="hover" style="border: none">
-      <el-image :src="`https://via.placeholder.com/150`" class="mr-7 rounded-2xl" style="height: 100px; width: 100px; object-fit: contain">
-        <template #error>
-          <div class="mr-3.5 flex items-center justify-center text-5xl" style="height: 100px; width: 100px; background-color: #f5f5f5">
-            <el-icon>
-              <icon-picture />
-            </el-icon>
-          </div>
-        </template>
-      </el-image>
-      <el-col :span="18">
-        <div class="info-container">
-          <div class="info-column">
-            <div class="font-semibold">电脑编号:</div>
-            <div class="font-semibold">所属部门:</div>
-            <div class="font-semibold">工位号:</div>
-            <div class="font-semibold">IP地址:</div>
-          </div>
-          <div class="info-column">
-            <div class="font-semibold">电脑名称:</div>
-            <div class="font-semibold">使用人:</div>
-            <div class="font-semibold">电脑类型:</div>
-            <div class="font-semibold">MAC地址:</div>
-          </div>
-        </div>
-      </el-col>
-    </el-card>
-    <!-- table-card -->
-    <el-card body-style="padding-top: 10px" class="mt-2.5" shadow="hover" style="border: none">
-      <vxe-grid v-bind="gridOptions">
-      </vxe-grid>
-    </el-card>
-  </div>
-</template>
-
-<style scoped lang="scss">
-.info-container {
-  display: flex;
-  justify-content: space-between;
-}
-
-.info-column {
-  flex: 1;
-  padding: 0 10px;
-}
-
-p {
-  margin: 5px 0;
-}
-</style>

+ 0 - 15
src/views/computer-information/components/EditComputerInfo.vue

@@ -1,15 +0,0 @@
-<script setup lang="ts">/**
- * @Name: EditComputerInfo.vue
- * @Description: 编辑电脑信息
- * @Author: xinyan
- */
-
-</script>
-
-<template>
-
-</template>
-
-<style scoped lang="scss">
-
-</style>

+ 0 - 152
src/views/computer-information/components/InfoCard.vue

@@ -1,152 +0,0 @@
-<script lang="ts" setup>
-/**
- * @Name: InfoCard.vue
- * @Description: 电脑信息卡片
- * @Author: xinyan
- */
-
-import { ref } from 'vue';
-import { ElIcon, ElMessage } from 'element-plus';
-import { Delete, EditPen, Picture as IconPicture, Search } from '@element-plus/icons-vue';
-import { useResponse } from '/@/utils/useResponse';
-import * as api from '/@/views/computer-information/api';
-import { useRouter } from 'vue-router';
-import { usePagination } from '/@/utils/usePagination';
-import { useElTableData } from '/@/utils/useElTable';
-
-const router = useRouter();
-const cardItems = ref([]);
-const loading = ref();
-const { tableData, currentPage, pageSize ,total } = usePagination(fetchCardData)
-
-// 分页参数
-// const currentPage = ref(1);
-// const pageSize = ref(10);
-// const total = ref(0);
-
-async function fetchCardData() {
-  const query = {
-    page: currentPage.value,
-    limit: pageSize.value,
-  };
-  await useElTableData(api.getCardData, query, tableData, total, loading)
-	// const res = await useResponse(query, api.getCardData, loading);
-  // tableData.value = res.data;
-  // total.value = res.total;
-  // currentPage.value = res.page;
-  // pageSize.value = res.limit;
-}
-
-// 编辑和删除的事件处理
-const editItem = (item) => {
-	router.push({
-    path: '/computer/edit',
-    query: { computerNumber: item.computerNumber }
-  })
-};
-
-const deleteItem = (item) => {
-	ElMessage({
-		message: `删除 ${item.computerNumber}`,
-		type: 'warning',
-	});
-};
-
-// 处理图片地址
-const getImageUrl = (images) => {
-	// 如果有图片,返回第一个图片的 image_url,否则返回占位图
-	return images.length > 0 ? images[0].image_url : 'https://via.placeholder.com/150';
-};
-
-onMounted(() => {
-  fetchCardData();
-});
-</script>
-
-<template>
-		<!-- 卡片展示区域 -->
-		<div class="card-container">
-			<el-row :gutter="20">
-				<el-col v-for="(item, index) in tableData" :key="index" :span="4" class="my-2.5">
-					<el-card class="item-card" shadow="hover">
-						<el-image :src="getImageUrl(item.images)" alt="电脑图片" class="card-image">
-							<template #error>
-								<el-icon class="card-image" style="font-size: 4rem">
-									<icon-picture />
-								</el-icon>
-							</template>
-						</el-image>
-						<div class="card-content">
-							<div>
-								<span style="color: #808d97">电脑编号: </span>
-								<span>{{ item.computerNumber }}</span>
-							</div>
-							<div>
-								<span style="color: #808d97">所属店铺: </span>
-								<span>{{ item.shopName }}</span>
-							</div>
-						</div>
-						<div class="card-footer">
-              <el-button :icon="Search" circle type="primary" @click="editItem(item)" />
-							<el-button :icon="EditPen" circle type="primary" @click="editItem(item)" />
-							<el-button :icon="Delete" circle type="danger" @click="deleteItem(item)" />
-						</div>
-					</el-card>
-				</el-col>
-			</el-row>
-		</div>
-    <div class="pagination-container">
-      <!--<el-pagination-->
-      <!--    v-model:current-page="currentPage"-->
-      <!--    :page-size="pageSize"-->
-      <!--    :page-sizes="[10, 25, 50,100,200]"-->
-      <!--    :total="total"-->
-      <!--    background-->
-      <!--    layout="total,sizes,prev, next, jumper"-->
-      <!--    small-->
-      <!--/>-->
-      <el-pagination
-          v-model:current-page="currentPage"
-          v-model:page-size="pageSize"
-          :page-sizes="[10, 20, 30, 50, 100, 200]"
-          :total="total"
-          layout="sizes, prev, pager, next, total"
-          background
-          @change="handlePageChange"/>
-    </div>
-</template>
-
-<style lang="scss" scoped>
-.card-container {
-	margin-bottom: 20px;
-}
-
-.item-card {
-	border-radius: 10px;
-	overflow: hidden;
-	position: relative;
-}
-
-.card-image {
-	width: 100%;
-	height: 150px;
-	object-fit: cover;
-}
-
-.card-content {
-	padding: 10px;
-	font-size: 14px;
-}
-
-.card-footer {
-	display: flex;
-	justify-content: flex-end;
-	padding: 10px;
-}
-
-.pagination-container {
-  display: flex;
-  justify-content: flex-end;
-  // margin-bottom: 20px;
-}
-</style>

+ 0 - 20
src/views/computer-information/index.vue

@@ -1,20 +0,0 @@
-<script lang="ts" setup>
-/**
- * @Name: index.vue
- * @Description: 电脑信息页面
- * @Author: xinyan
- */
-
-import InfoCard from '/@/views/computer-information/components/InfoCard.vue';
-
-</script>
-
-<template>
-	<div class="px-5 py-5">
-		<InfoCard />
-	</div>
-</template>
-
-<style scoped>
-
-</style>

+ 0 - 8
src/views/computer-information/useColumns.tsx

@@ -1,8 +0,0 @@
-export const ComputerColumns = [
-  { field: 'platformNumber', title: '平台编号'},
-  { field: 'platform', title: '平台'},
-  { field: 'platformName', title: '平台名称'},
-  { field: 'country', title: '区域'},
-  { field: 'userName', title: '使用人'},
-  { field: 'company', title: '所属公司'},
-];

+ 0 - 16
src/views/employee-information/index.vue

@@ -1,16 +0,0 @@
-<script setup lang="ts">
-/**
- * @Name: index.vue
- * @Description: 员工信息页面
- * @Author: Cheney
- */
-
-</script>
-
-<template>
-
-</template>
-
-<style scoped>
-
-</style>