瀏覽代碼

fix: 删除不必要的页面

liming 5 月之前
父節點
當前提交
3bdb59df82
共有 2 個文件被更改,包括 0 次插入347 次删除
  1. 0 171
      src/views/plan-management/NewFeeForm.vue
  2. 0 176
      src/views/plan-management/index.vue

+ 0 - 171
src/views/plan-management/NewFeeForm.vue

@@ -1,171 +0,0 @@
-<template>
-  <a-modal
-    :visible="visible"
-    :title="editMode ? $t('plan.editFee') : $t('plan.addFee')"
-    @ok="handleSubmit"
-    @cancel="handleCancel"
-    :width="800"
-  >
-    <a-form :model="formData" :rules="rules" ref="formRef" >
-      <a-divider>{{ $t('plan.basicInfo') }}</a-divider>
-      <a-form-item field="feeCode" :label="$t('plan.feeCode')" required>
-        <a-input v-model="formData.feeCode" :placeholder="$t('plan.enterFeeCode')" :maxLength="60" show-word-limit />
-      </a-form-item>
-      <a-form-item field="feeName" :label="$t('plan.feeName')" required>
-        <a-input v-model="formData.feeName" :placeholder="$t('plan.enterFeeName')" :maxLength="60" show-word-limit />
-      </a-form-item>
-      <a-form-item field="supplier" :label="$t('plan.supplier')" required>
-        <a-select v-model="formData.supplier" :placeholder="$t('plan.selectSupplier')">
-          <a-option value="supplier1">{{ $t('plan.supplier1') }}</a-option>
-          <a-option value="supplier2">{{ $t('plan.supplier2') }}</a-option>
-        </a-select>
-      </a-form-item>
-      <a-form-item field="dataType" :label="$t('plan.dataType')" required>
-        <a-radio-group v-model="formData.dataType">
-          <a-radio value="general">{{ $t('plan.general') }}</a-radio>
-          <a-radio value="specific">{{ $t('plan.specific') }}</a-radio>
-        </a-radio-group>
-      </a-form-item>
-      <a-form-item field="billingCategory" :label="$t('plan.billingCategory')" required>
-        <a-radio-group v-model="formData.billingCategory">
-          <a-radio value="data">{{ $t('plan.data') }}</a-radio>
-          <a-radio value="voice">{{ $t('plan.voice') }}</a-radio>
-          <a-radio value="nb">{{ $t('plan.nb') }}</a-radio>
-          <a-radio value="sms">{{ $t('plan.sms') }}</a-radio>
-        </a-radio-group>
-      </a-form-item>
-      <a-form-item field="status" :label="$t('plan.status')" required>
-        <a-radio-group v-model="formData.status">
-          <a-radio value="normal">{{ $t('plan.status.normal') }}</a-radio>
-          <a-radio value="disabled">{{ $t('plan.status.disabled') }}</a-radio>
-          <a-radio value="offline">{{ $t('plan.status.offline') }}</a-radio>
-        </a-radio-group>
-      </a-form-item>
-
-      <a-divider>{{ $t('plan.billingInfo') }}</a-divider>
-      <a-form-item field="billingCycle" :label="$t('plan.billingCycle')" required>
-        <a-radio-group v-model="formData.billingCycle">
-          <a-radio value="daily">{{ $t('plan.daily') }}</a-radio>
-          <a-radio value="monthly">{{ $t('plan.monthly') }}</a-radio>
-        </a-radio-group>
-      </a-form-item>
-      <a-form-item field="packageSize" :label="$t('plan.packageSize')" required>
-        <a-input-number v-model="formData.packageSize" :placeholder="$t('plan.enterPackageSize')" style="width: 200px" />
-        <a-select v-model="formData.packageUnit" style="width: 80px; margin-left: 10px;">
-          <a-option value="KB">KB</a-option>
-          <a-option value="MB">MB</a-option>
-          <a-option value="GB">GB</a-option>
-        </a-select>
-      </a-form-item>
-      <a-form-item field="standardPrice" :label="$t('plan.standardPrice')" required>
-        <a-input-number v-model="formData.standardPrice" :placeholder="$t('plan.enterPrice')" style="width: 200px" />
-        <span style="margin: 0 10px;">{{ $t('plan.currency') }}/</span>
-        <a-select v-model="formData.priceUnit" style="width: 120px;">
-          <a-option value="day">{{ $t('plan.billingCycleType') }}</a-option>
-          <a-option value="month">{{ $t('plan.month') }}</a-option>
-        </a-select>
-      </a-form-item>
-      <a-form-item field="subscriptionPeriod" :label="$t('plan.subscriptionPeriod')" required>
-        <a-input-number v-model="formData.minPeriod" :placeholder="$t('plan.minimum')" style="width: 100px" />
-        <span style="margin: 0 10px;">{{ $t('plan.monthsMin') }}</span>
-        <a-input-number v-model="formData.maxPeriod" :placeholder="$t('plan.maximum')" style="width: 100px" />
-        <span style="margin-left: 10px;">{{ $t('plan.monthsMax') }}</span>
-      </a-form-item>
-      <a-form-item field="overagePrice" :label="$t('plan.overagePrice')">
-        <a-input-number v-model="formData.overagePrice" :placeholder="$t('plan.enterOveragePrice')" style="width: 200px" />
-        <span style="margin: 0 10px;">{{ $t('plan.currency') }}/</span>
-        <a-select v-model="formData.overageUnit" style="width: 80px;">
-          <a-option value="KB">KB</a-option>
-          <a-option value="MB">MB</a-option>
-          <a-option value="GB">GB</a-option>
-        </a-select>
-      </a-form-item>
-      <a-form-item field="connectionTimes" :label="$t('plan.connectionTimes')">
-        <a-input-number v-model="formData.connectionTimes" placeholder="0" />
-        <span style="margin-left: 10px;">{{ $t('plan.times') }}</span>
-      </a-form-item>
-      <a-form-item field="voiceRate" :label="$t('plan.voiceRate')">
-        <a-input-number v-model="formData.voiceRate" placeholder="0" />
-        <span style="margin-left: 10px;">{{ $t('plan.currency') }}/{{ $t('plan.minute') }}</span>
-      </a-form-item>
-      <a-form-item field="billingCode" :label="$t('plan.billingCode')">
-        <a-input v-model="formData.billingCode" :placeholder="$t('plan.autoGenerated')" disabled />
-      </a-form-item>
-    </a-form>
-  </a-modal>
-</template>
-
-<script setup>
-import { ref, reactive } from 'vue';
-import { Message } from '@arco-design/web-vue';
-import { useI18n } from 'vue-i18n';
-
-const { t } = useI18n();
-
-const props = defineProps({
-  visible: Boolean,
-  editMode: Boolean,
-  editData: Object,
-});
-
-const emit = defineEmits(['update:visible', 'submit']);
-
-const formRef = ref(null);
-
-const formData = reactive({
-  feeCode: '',
-  feeName: '',
-  supplier: '',
-  dataType: 'general',
-  billingCategory: 'data',
-  status: 'normal',
-  billingCycle: 'daily',
-  packageSize: null,
-  packageUnit: 'MB',
-  standardPrice: null,
-  priceUnit: 'day',
-  minPeriod: 1,
-  maxPeriod: 60,
-  overagePrice: null,
-  overageUnit: 'MB',
-  connectionTimes: 0,
-  voiceRate: 0,
-  billingCode: t('plan.autoGenerated'),
-});
-
-const rules = {
-  feeCode: [{ required: true, message: t('plan.feeCodeRequired') }],
-  feeName: [{ required: true, message: t('plan.feeNameRequired') }],
-  supplier: [{ required: true, message: t('plan.supplierRequired') }],
-  dataType: [{ required: true, message: t('plan.dataTypeRequired') }],
-  billingCategory: [{ required: true, message: t('plan.billingCategoryRequired') }],
-  status: [{ required: true, message: t('plan.statusRequired') }],
-  billingCycle: [{ required: true, message: t('plan.billingCycleRequired') }],
-  packageSize: [{ required: true, type: 'number', message: t('plan.packageSizeRequired') }],
-  standardPrice: [{ required: true, type: 'number', message: t('plan.standardPriceRequired') }],
-  minPeriod: [{ required: true, type: 'number', message: t('plan.minPeriodRequired') }],
-  maxPeriod: [{ required: true, type: 'number', message: t('plan.maxPeriodRequired') }],
-};
-
-const handleSubmit = () => {
-  formRef.value.validate((errors) => {
-    if (!errors) {
-      emit('submit', { ...formData });
-      emit('update:visible', false);
-    } else {
-      console.error('Validation failed', errors);
-      Message.error(t('plan.fillRequiredFields'));
-    }
-  });
-};
-
-const handleCancel = () => {
-  emit('update:visible', false);
-};
-</script>
-
-<style scoped>
-.arco-form-item {
-  margin-bottom: 18px;
-}
-</style>

+ 0 - 176
src/views/plan-management/index.vue

@@ -1,176 +0,0 @@
-<template>
-  <div class="fee-management">
-    <!-- Search section -->
-    <div class="search-section">
-      <a-form :model="searchForm" layout="inline">
-        <a-form-item field="feeName" :label="$t('plan.feeName')">
-          <a-input v-model="searchForm.feeName" :placeholder="$t('plan.enterFeeName')" allow-clear />
-        </a-form-item>
-        <a-form-item field="operatorType" :label="$t('plan.operatorType')">
-          <a-select
-            v-model="searchForm.operatorType"
-            :placeholder="$t('plan.selectOperatorType')"
-            allow-clear
-            style="width: 200px"
-          >
-            <a-option v-for="type in operatorTypes" :key="type.value" :value="type.value">
-              {{ $t(`plan.operatorTypes.${type.value}`) }}
-            </a-option>
-          </a-select>
-        </a-form-item>
-        <a-form-item>
-          <a-button type="primary" @click="handleSearch">{{ $t('global.common.search') }}</a-button>
-        </a-form-item>
-      </a-form>
-    </div>
-
-    <!-- Add button -->
-    <div class="operation-section">
-      <a-button type="primary" @click="showNewFeeForm">{{ $t('plan.addFee') }}</a-button>
-    </div>
-
-    <!-- Data table -->
-    <a-table :columns="columns" :data="tableData" :pagination="pagination" @page-change="onPageChange">
-      <template #status="{ record }">
-        <a-tag :color="getStatusColor(record.status)">{{ $t(`plan.status.${record.status}`) }}</a-tag>
-      </template>
-      <template #operation="{ record }">
-        <a-space>
-          <a-button type="text" size="small" @click="handleEdit(record)">{{ $t('global.common.edit') }}</a-button>
-          <a-button type="text" size="small" @click="handleDelete(record)">{{ $t('global.common.delete') }}</a-button>
-        </a-space>
-      </template>
-    </a-table>
-
-    <!-- New/Edit fee form dialog -->
-    <new-fee-form 
-      v-model:visible="newFeeFormVisible"
-      :editMode="editMode"
-      :editData="editData"
-      @submit="handleFeeSubmit"
-    />
-  </div>
-</template>
-
-<script setup>
-import { ref, reactive, computed } from 'vue';
-import { Message } from '@arco-design/web-vue';
-import { useI18n } from 'vue-i18n';
-import NewFeeForm from './NewFeeForm.vue';
-
-const { t } = useI18n();
-
-const searchForm = reactive({
-  feeName: '',
-  operatorType: '',
-});
-
-const operatorTypes = [
-  { value: 'general' },
-  { value: 'specific' },
-];
-
-const columns = computed(() => [
-  { title: t('plan.id'), dataIndex: 'id' },
-  { title: t('plan.feeCode'), dataIndex: 'feeCode' },
-  { title: t('plan.feeName'), dataIndex: 'feeName' },
-  { title: t('plan.supplierName'), dataIndex: 'supplierName' },
-  { title: t('plan.dataType'), dataIndex: 'dataType' },
-  { title: t('plan.billingCategory'), dataIndex: 'billingCategory' },
-  { title: t('plan.billingCycle'), dataIndex: 'billingCycle' },
-  { title: t('plan.packageSize'), dataIndex: 'packageSize' },
-  { title: t('plan.standardPrice'), dataIndex: 'standardPrice' },
-  { title: t('plan.cycleLimitation'), dataIndex: 'cycleLimitation' },
-  { title: t('plan.status'), slotName: 'status' },
-  { title: t('global.common.operations'), slotName: 'operation', width: 150 },
-]);
-
-const tableData = ref([
-  {
-    id: 8,
-    feeCode: 'MR026',
-    feeName: '移动200G',
-    supplierName: '泰国True',
-    dataType: '通用',
-    billingCategory: '流量',
-    billingCycle: '按天',
-    packageSize: '2.00G',
-    standardPrice: '150.00元/月',
-    cycleLimitation: '1-12月',
-    status: '正常',
-  },
-  // 添加更多模拟数据...
-]);
-
-const pagination = reactive({
-  total: 100,
-  current: 1,
-  pageSize: 10,
-});
-
-const newFeeFormVisible = ref(false);
-const editMode = ref(false);
-const editData = ref(null);
-
-const handleSearch = () => {
-  console.log('Search form data:', searchForm);
-  Message.success(t('plan.searchExecuted'));
-};
-
-const showNewFeeForm = () => {
-  editMode.value = false;
-  editData.value = null;
-  newFeeFormVisible.value = true;
-};
-
-const handleEdit = (record) => {
-  editMode.value = true;
-  editData.value = { ...record };
-  newFeeFormVisible.value = true;
-};
-
-const handleDelete = (record) => {
-  Message.success(t('plan.feeDeleted', { name: record.feeName }));
-};
-
-const handleFeeSubmit = (formData) => {
-  if (editMode.value) {
-    console.log('Edited fee submitted:', formData);
-    Message.success(t('plan.feeUpdated', { name: formData.feeName }));
-  } else {
-    console.log('New fee submitted:', formData);
-    Message.success(t('plan.feeAdded', { name: formData.feeName }));
-  }
-};
-
-const onPageChange = (page) => {
-  pagination.current = page;
-};
-
-const getStatusColor = (status) => {
-  const colorMap = {
-    '正常': 'green',
-    '禁用': 'red',
-    '下架': 'gray',
-  };
-  return colorMap[status] || 'blue';
-};
-</script>
-
-<style scoped>
-.fee-management {
-  padding: 20px;
-}
-
-.search-section {
-  margin-bottom: 20px;
-}
-
-.operation-section {
-  margin-bottom: 20px;
-}
-
-.fee-management .arco-table-th {
-  white-space: nowrap;
-}
-</style>