فهرست منبع

修改宽度问题

wxy 3 ماه پیش
والد
کامیت
0deb77294d

+ 27 - 31
src/components/Layout/components/layout/main.vue

@@ -1,28 +1,27 @@
 <template>
   <a-layout style="height: 100vh;">
     <a-layout>
-      <a-layout-sider :width="LayoutStore.setting.laoutStyle==0?260:340" >
+      <a-layout-sider :width="LayoutStore.setting.laoutStyle == 0 ? 260 : 340">
         <!-- 侧边栏 -->
-        <blendMenu v-if="LayoutStore.setting.laoutStyle==0"/>
-        <Menu v-if="LayoutStore.setting.laoutStyle==1"></Menu>
+        <blendMenu v-if="LayoutStore.setting.laoutStyle == 0" />
+        <Menu v-if="LayoutStore.setting.laoutStyle == 1"></Menu>
       </a-layout-sider>
-      <a-layout-content>
-        <!-- 主体内容 -->
-        <a-layout style="height: 100vh;">
-          <!-- 头部 -->
-          <a-layout-header class="layout-header">
-            <LayoutHeader />
-          </a-layout-header>
-          <a-layout>
-            <a-layout-content class="layout-content">
-              <!-- 主题内容 -->
-              <main class="layout-content-main">
-                <router-view v-slot="{ Component }" class="layout-content-router">
-                  <component :is="Component" key="Layout" />
-                </router-view>
-              </main>
-            </a-layout-content>
-          </a-layout>
+      <!-- 主体内容 -->
+      <a-layout-content class="layout-main"
+        :style="{ width: `calc(100vw - ${LayoutStore.setting.laoutStyle == 0 ? 260+'px' : 340+'px'})` }">
+        <!-- 头部 -->
+        <a-layout-header class="layout-header">
+          <LayoutHeader />
+        </a-layout-header>
+        <a-layout>
+          <a-layout-content class="layout-content">
+            <!-- 主题内容 -->
+            <main class="layout-content-main">
+              <router-view v-slot="{ Component }" class="layout-content-router">
+                <component :is="Component" key="Layout" />
+              </router-view>
+            </main>
+          </a-layout-content>
         </a-layout>
       </a-layout-content>
     </a-layout>
@@ -38,9 +37,10 @@ import { layoutSetting } from '@/store/modules/layoutSetting'
 const LayoutStore = layoutSetting()
 </script>
 <style lang="less" scoped>
-::v-deep .arco-layout-sider-trigger{
+::v-deep .arco-layout-sider-trigger {
   display: none;
 }
+
 .layout-header {
   height: auto;
   background: @bg_color_2;
@@ -49,22 +49,18 @@ const LayoutStore = layoutSetting()
   background-color: #fff;
 }
 
-.layout-content{
+.layout-content {
   background-color: #f2f3f5;
 }
 
 .layout-content-main {
-  flex: 1;
-  padding: 0 1.2rem 1.6rem 1.2rem;
-  margin: 1.1rem 0 0rem 0;
-  overflow-y: auto;
-  overflow: overlay;
-  height: 95%;
-  display: flex;
-  flex-wrap: wrap;
+  // flex: 1;
+  padding: 6px 0;
+  margin: 1.1rem;
+  background-color: #fff;
 }
 
-:deep(.layout-content-router) {
+::v-deep .layout-content-router {
   padding: 0 1rem 1rem 1rem;
   background-color: @bg_color_4;
   box-sizing: border-box;

+ 18 - 79
src/components/Layout/components/layout/menu.vue

@@ -1,8 +1,6 @@
 <template>
-  <a-layout style="min-height: 100vh">
-    
-    <a-layout-sider theme="dark" :width="160" :collapsed-width="48" collapsible :trigger="null"
-      @collapse="evMenuSecondLongShow" v-model:collapsed="menuSecondLongShow">
+  <a-row class="grid-demo">
+    <a-col :span="12" style="height: 100vh;background-color: #232324;">
       <div class="logo-layout" v-if="LayoutStore.setting.SidebarLogo">
         <div class="logo">
           <img src="@/assets/images/logo.png" />
@@ -18,11 +16,10 @@
           <span>{{ routeItem.meta.title }}</span>
         </a-menu-item>
       </a-menu>
-    </a-layout-sider>
-    <a-layout-sider :width="180" :collapsed-width="48" collapsible :trigger="null" @collapse="evMenuSecondLongShow"
-      v-model:collapsed="menuSecondLongShow">
+    </a-col>
+    <a-col :span="12">
       <a-menu :selectedKeys="routeItemSelectedKeys" id="layout-sider" theme="light" mode="vertical" :collapsed="false"
-        :auto-open="true">
+        :auto-open="true" style="height: 100vh;color: #fff;">
         <template v-for="routeItem in menuSecondData?.children || []">
           <a-menu-item v-if="!routeItem.children || routeItem.children.length === 0" :key="routeItem.name?.toString()"
             @click="evGoPage(routeItem)">
@@ -34,8 +31,8 @@
           </template>
         </template>
       </a-menu>
-    </a-layout-sider>
-  </a-layout>
+    </a-col>
+  </a-row>
 </template>
 <script setup>
 import { ref, computed, h, reactive, onMounted, watch, nextTick } from "vue";
@@ -144,11 +141,11 @@ watch(
 );
 
 watch(() => routerTagData.getMenuTabSate, val => {
-  routesData.forEach(res=>{
-    if(res.children && res.children.length > 0){
-      res.children.forEach(item=>{
-        if(item.name == val){
-          menuTabSate.value =  [res.name]
+  routesData.forEach(res => {
+    if (res.children && res.children.length > 0) {
+      res.children.forEach(item => {
+        if (item.name == val) {
+          menuTabSate.value = [res.name]
           routeItemSelectedKeys.value = [item.name]
           const items = findPath(res);
           evGoPage(items);
@@ -160,31 +157,12 @@ watch(() => routerTagData.getMenuTabSate, val => {
 }, { immediate: true })
 </script>
 <style scoped lang="less">
-.layout-header {
-  height: 48px;
-  background: @bg_color_2;
-  padding-inline: 10px;
-  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
-  z-index: 9;
+.grid-demo {
+  height: 100vh;
+  background-color: #fff;
 }
 
-.ant-layout-content {
-  height: auto;
-  min-height: auto;
-  overflow-y: auto;
-  padding: 0 20px;
-}
 
-.layout-content-main {
-  flex: 1;
-  padding: 0 1.2rem 1.6rem 1.2rem;
-  margin: 1.1rem 0 0rem 0;
-  overflow-y: auto;
-  overflow: overlay;
-  height: 95%;
-  display: flex;
-  flex-wrap: wrap;
-}
 
 .logo-layout {
   height: 64px;
@@ -195,7 +173,7 @@ watch(() => routerTagData.getMenuTabSate, val => {
 
   .logo {
     width: 36px;
-    height: 36px;
+    height: px;
     display: flex;
     justify-content: center;
     align-items: center;
@@ -205,53 +183,14 @@ watch(() => routerTagData.getMenuTabSate, val => {
       height: 100%;
     }
   }
-  h3{
+
+  h3 {
     color: #fff;
     margin-left: 10px;
   }
 }
 
-.arco-layout {
-  color: @text_color_1;
-  background: @layout-split-color !important;
-  overflow: hidden;
-}
-
-:deep(.arco-menu-light) {
-  background-color: @bg_color_3;
-
-  .arco-menu-item {
-    background-color: @bg_color_3;
-  }
-}
-
-:deep(.arco-layout-sider-light) {
-  background-color: @bg_color_3;
-}
-
-:deep(.arco-menu-inline-header) {
-  font-weight: 600;
-  color: @text_color_1;
-  background-color: @bg_color_3;
-}
-
-:deep(.layout-content-router) {
-  padding: 0 1rem 1rem 1rem;
-  background-color: @bg_color_4;
-  box-sizing: border-box;
-  width: 100%;
-}
 
-:deep(.arco-menu-inline-content) {
-  .arco-menu-selected {
-    color: @text_color_1;
-    background-color: @black_3;
-
-    &:after {
-      content: none;
-    }
-  }
-}
 
 #layout-sider {
   :deep(.arco-menu-selected) {

+ 284 - 4
src/views/OperationRecord/TariffRecord/index.vue

@@ -1,10 +1,290 @@
+<!-- 资费管理 -->
 <template>
-  <div class=""></div>
+  <div class="container">
+    <!-- 搜索条件区 -->
+    <div class="search-section">
+      <Search :SearchForm="trafficSearchFrom" @query="intData" @reset="reset"/>
+    </div>
+    <div class="audit-btn">
+      <a-button type="text" @click="dictShowModel(1, null)" v-if="role.getRole == 1">
+        <template #icon>
+          <icon-plus-circle />
+        </template>
+        <template #default>{{ $t('form.Add') }}</template>
+      </a-button>
+    </div>
+    <a-table row-key="id" :data="dataSource" :columns="columns" :pagination="pagination" :scroll="{ x: 'auto' }"
+      @page-change="evChangePage">
+      <template #id="{ record }">
+        <!-- 修改 -->
+        <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="dictShowModel(2, record)"
+          v-if="role.getRole == 1">{{
+            $t('form.alter')
+          }}</a>
+        <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="meal(record)">{{
+          $t('tariffManagement.SetMeal') }}</a>
+        <!-- 删除 -->
+        <a-popconfirm :content="$t('form.Delete')" :ok-text="$t('form.Confirm')" :cancel-text="$t('form.Cancel')"
+          @ok="handleDel(record.id)">
+          <a class="a-link" href="javascript:;" style="margin-right: 1rem" v-if="role.getRole == 1">{{
+            $t('form.Delete')
+          }}</a>
+        </a-popconfirm>
+      </template>
+    </a-table>
+
+
+
+    <a-modal width="70%" :visible="planVisible" :title="$t('tariffManagement.SelectiveTrafficPacket')"
+      @ok="handleSubmitPlan" @cancel="handleCancel">
+      <!-- 搜索条件区 -->
+      <div class="search-section">
+        <a-form :model="formData" layout="inline">
+          <a-form-item field="label" :label="$t('tariffManagement.label')">
+            <a-input v-model="formData.label" :placeholder="$t('lotCard.please') + $t('tariffManagement.label')"
+              allow-clear />
+          </a-form-item>
+          <a-form-item>
+            <a-space>
+              <a-button type="primary" @click="handleSearchPlan">{{ $t('form.Search') }}</a-button>
+              <a-button @click="resetSearchPlan">{{ $t('form.Reset') }}</a-button>
+            </a-space>
+          </a-form-item>
+        </a-form>
+      </div>
+      <a-table row-key="id" :data="planList" :columns="planColumns" :scroll="{ x: 'auto' }"
+        :row-selection="rowSelectionPlan" v-model:selectedKeys="selectedKeysPlan">
+
+      </a-table>
+
+    </a-modal>
+
+  </div>
 </template>
 
 <script setup>
-import { ref, onMounted, toRefs } from 'vue';
+import { onMounted, ref, toRefs, getCurrentInstance } from "vue";
+import { useRoute } from "vue-router";
+import { columns, planColumns ,trafficSearchFrom} from "../config";
+import { deleteTariff, tariffList } from "@/api/path/tariffManagement.api"
+import { Getdictionary } from '@/mixins/index.js'
+import { useSystemStore } from '@/store/modules/systemStore'
+import Search from '@/components/Search/index.vue'
+import { useI18n } from 'vue-i18n'
+import { Message } from '@arco-design/web-vue'
+const { t } = useI18n();
+const role = useSystemStore()
+const state = ref({
+  searchForm: {},
+  FormDataList: {},
+  currency: [],
+  dataSource: [],
+  pagination: {
+    total: 0,
+    pageSize: 10,
+    current: 1,
+  },
+  planList: [],
+  visible: false,
+  typeCurrent: null,
+  sourceList: [],
+  cycleist: [],
+  modealShow: false,
+  planVisible: false,
+  formData: {},
+  selectedKeysPlan: [],
+  rowSelectionPlan: {
+    type: 'radio',
+    showCheckedAll: true,
+    onlyCurrent: false,
+  },
+  ids: null,
+  methodList: []
+})
+const {
+  searchForm,
+  FormDataList,
+  currency,
+  dataSource,
+  pagination,
+  planList,
+  visible,
+  typeCurrent,
+  sourceList,
+  cycleist,
+  modealShow,
+  planVisible,
+  formData,
+  selectedKeysPlan,
+  rowSelectionPlan,
+  ids,
+  methodList
+} = toRefs(state.value);
+
+const intData = async (item) => {
+  if(item){
+    searchForm.value = item
+  }
+  const param = {
+    current: pagination.value.current,
+    size: pagination.value.pageSize,
+    ...searchForm.value,
+  }
+  const { data } = await tariffList(param)
+  dataSource.value = (data.records || []).map((item, index) => {
+    const sourceName = sourceList.value.find(val => val.value == item.source)?.label
+    const billingCycleName = cycleist.value.find(val => val.value == item.billingCycle)?.label
+    const pricingCurrty = currency.value.find(val => val.value == item.currency)?.label || '人民币'
+    const Activated = item.trafficBilling + item.trafficBillingType
+    const bagSize = item.pricing + '/' + item.mrcAmount + '/' + item.networkAccessFee
+    const billingMethodName = methodList.value.find(val => val.value == item.billingMethod)?.label
+
+    let pricingName;
+
+    if (item.billingMethod == 1) {
+      pricingName = item.trafficBillingAmount + pricingCurrty
+    } else if (item.billingMethod == 2) {
+      pricingName = item.pricing + pricingCurrty
+    }
+    return {
+      ...item,
+      sourceName,
+      pricingName,
+      billingCycleName,
+      Activated: Activated,
+      status: "正常",
+      bagSize,
+      billingMethodName,
+      Number: index + 1
+    }
+  })
+  pagination.value.total = data.total
+}
+
+const reset = (item)=>{
+  searchForm.value = item 
+  pagination.value.current = 1
+  intData()
+}
+
+
+// 删除
+const handleDel = async (id) => {
+  const { code } = await deleteTariff({ id })
+  if (code == 200) {
+    Message.success({
+      content: t('setting.deleteSuccess'),
+      duration: 2000,
+    })
+    intData()
+  }
+};
+
+const evChangePage = (page) => {
+  pagination.value.current = page
+  intData()
+}
+
+// 弹框
+const dictShowModel = (type, data) => {
+  FormDataList.value = type == 1 ? {} : data
+  typeCurrent.value = type;
+  visible.value = true;
+}
+
+const resetSearchPlan = () => {
+
+}
+const handleSearchPlan = () => {
+
+}
+const handleCancel = () => {
+  planVisible.value = false
+}
+
+const handleSubmitPlan = () => {
+  if (selectedKeysPlan.value.length > 0) {
+    formState.value.simDataPlanId = String(selectedKeysPlan.value[0])
+    planVisible.value = false
+  }
+
+}
+
+
+const handleDictValue = async () => {
+  sourceList.value = await Getdictionary('source')
+  cycleist.value = await Getdictionary('Billingcycle')
+  currency.value = await Getdictionary('currencyType')
+  methodList.value = await Getdictionary('billingMethod')
+}
+
+const meal = (data) => {
+  ids.value = data.id
+  modealShow.value = true
+}
+
+
+onMounted(async () => {
+  await handleDictValue()
+  await intData()
+})
+
+
 </script>
-<style scoped>
 
-</style>
+<style scoped lang="less">
+.head-title-right {
+  .m-r-10 {
+    margin-right: 10px;
+  }
+
+}
+
+.search-section {
+  margin-top: 20px;
+  margin-bottom: 20px;
+}
+
+.container {
+  .head-title {
+    display: flex;
+    justify-content: space-between;
+  }
+
+  .form-row {
+    display: flex;
+
+    .form-row-col {
+      width: 25%;
+      display: flex;
+      align-items: center;
+
+      .form-row-label {
+        width: 120px;
+        text-align: right;
+      }
+    }
+  }
+}
+
+.audit-btn {
+  margin-bottom: 10px;
+}
+
+.formTitle {
+  font-size: 18px;
+  margin-bottom: 20px;
+  display: flex;
+  align-items: center
+}
+
+.formTitle::before {
+  content: "";
+  display: inline-block;
+  width: 4px;
+  height: 20px;
+  background-color: green;
+  margin-right: 10px;
+
+}
+</style>

+ 274 - 0
src/views/OperationRecord/config.js

@@ -0,0 +1,274 @@
+export let columns = [
+  {
+    title: window.$t("tariffManagement.id"),
+    dataIndex: "Number",
+    align: "center",
+    width: 200,
+    ellipsis: true,
+  },
+  // { title: window.$t('tariffManagement.feeCode'), dataIndex: 'feeCode', align: 'center', width: 200 },
+  {
+    title: window.$t("tariffManagement.userName"),
+    dataIndex: "userName",
+    align: "center",
+    width: 200,
+    ellipsis: true,
+  },
+  {
+    title: window.$t("tariffManagement.label"),
+    dataIndex: "label",
+    align: "center",
+    width: 200,
+    ellipsis: true,
+  },
+  {
+    title: window.$t("tariffManagement.source"),
+    dataIndex: "sourceName",
+    align: "center",
+    width: 200,
+    ellipsis: true,
+  },
+  {
+    title: window.$t("tariffManagement.simDataPlanIdName"),
+    dataIndex: "metadataPackagesName",
+    align: "center",
+    width: 200,
+    ellipsis: true,
+  },
+  {
+    title: window.$t("tariffManagement.TestFlowPacketName"),
+    dataIndex: "testMetadataPackagesName",
+    align: "center",
+    width: 200,
+    ellipsis: true,
+  },
+  // { title: window.$t('tariffManagement.trafficType'), dataIndex: 'trafficTypeName', align: 'center', width: 200 },
+  // { title: window.$t('tariffManagement.billingType'), dataIndex: 'billingTypeName', align: 'center', width: 200 },
+  {
+    title: window.$t("tariffManagement.billingCycle"),
+    dataIndex: "billingCycleName",
+    align: "center",
+    width: 200,
+    ellipsis: true,
+  },
+  {
+    title: window.$t("tariffManagement.BillingMode"),
+    dataIndex: "billingMethodName",
+    align: "center",
+    width: 200,
+    ellipsis: true,
+  },
+  // { title: window.$t('tariffManagement.bagSize'), dataIndex: 'bagSize', align: 'center', width: 200 },
+  {
+    title: window.$t("tariffManagement.pricing"),
+    dataIndex: "pricingName",
+    align: "center",
+    width: 200,
+    ellipsis: true,
+  },
+  // { title: window.$t('tariffManagement.billingMethod'), dataIndex: 'billing_method', align: 'center', width: 200 },
+  {
+    title: window.$t("tariffManagement.ActivatedNames"),
+    dataIndex: "Activated",
+    align: "center",
+    width: 200,
+    ellipsis: true,
+  },
+  {
+    title: window.$t("tariffManagement.feeStatus"),
+    dataIndex: "status",
+    align: "center",
+    width: 200,
+    ellipsis: true,
+  },
+  {
+    title: window.$t("tariffManagement.MRCName"),
+    dataIndex: "mrcAmount",
+    align: "center",
+    width: 200,
+    ellipsis: true,
+  },
+  {
+    title: window.$t("tariffManagement.networkName"),
+    dataIndex: "networkAccessFee",
+    align: "center",
+    width: 200,
+    ellipsis: true,
+  },
+  {
+    title: window.$t("tariffManagement.endDate"),
+    dataIndex: "endDate",
+    align: "center",
+    width: 200,
+    ellipsis: true,
+  },
+  {
+    title: window.$t("global.common.operations"),
+    dataIndex: "id",
+    slotName: "id",
+    align: "center",
+    width: 180,
+    fixed: "right",
+  },
+];
+// 资费套餐
+export const planColumns = [
+  {
+    title: window.$t("tariffManagement.feeCode"),
+    dataIndex: "feeCode",
+    align: "center",
+    width: 200,
+  },
+  {
+    title: window.$t("tariffManagement.label"),
+    dataIndex: "label",
+    align: "center",
+    width: 200,
+  },
+  {
+    title: window.$t("tariffManagement.source"),
+    dataIndex: "sourceName",
+    align: "center",
+    width: 200,
+  },
+  {
+    title: window.$t("tariffManagement.bagSize"),
+    dataIndex: "bag_size",
+    align: "center",
+    width: 200,
+  },
+];
+
+// 资费搜索字段
+export const trafficSearchFrom = [
+  {
+    type: "input",
+    label: "客户名称",
+    field: "username",
+    value: "", // 双向绑定的值
+  },
+  {
+    type: "input",
+    label: "资费名称",
+    field: "label",
+    value: "", // 双向绑定的值
+  },
+  {
+    type: "select",
+    label: "供应商名称",
+    field: "source",
+    options: [], // 默认空,后面会通过字典加载
+    dict: "source",
+    value: "", // 双向绑定的值
+    width: "200",
+  },
+  {
+    type: "select",
+    label: "计费方式",
+    field: "billingMethod",
+    options: [], // 默认空,后面会通过字典加载
+    dict: "billingMethod",
+    value: "", // 双向绑定的值
+    width: "200",
+  },
+  {
+    type: "select",
+    label: "计费周期",
+    field: "BillingCycle",
+    options: [], // 默认空,后面会通过字典加载
+    dict: "BillingCycle",
+    value: "", // 双向绑定的值
+    width: "200",
+  },
+  {
+    type: "date-picker",
+    label: "有效期",
+    field: "endDate",
+    value: "", // 双向绑定的值
+    width: "200",
+  },
+];
+
+// 客户搜索字段
+export const UserSearchForm = [
+  {
+    type: "input",
+    label: "客户名称",
+    field: "name",
+    value: "", // 双向绑定的值
+  },
+  {
+    type: "input",
+    label: "客户账号",
+    field: "username",
+    value: "", // 双向绑定的值
+  },
+  {
+    type: "select",
+    label: "客户状态",
+    field: "state",
+    options: [], // 默认空,后面会通过字典加载
+    dict: "userType",
+    value: "", // 双向绑定的值
+    width: "200",
+  },
+  {
+    type: "range-picker",
+    label: "创建时间",
+    field: "createdAt",
+    value: [], // 双向绑定的值
+    width: "300",
+    Custom: 'mode="month"', // 自定义值
+  },
+];
+
+export const UserColumns = [
+  {
+    title: window.$t("customer.id"),
+    dataIndex: "id",
+    align: "center",
+    ellipsis: true,
+  },
+  {
+    title: window.$t("customer.customerName"),
+    dataIndex: "name",
+    align: "center",
+    ellipsis: true,
+  },
+  {
+    title: window.$t("customer.userAdmin"),
+    dataIndex: "username",
+    align: "center",
+  },
+  {
+    title: window.$t("customer.customerStatus"),
+    slotName: "state",
+    align: "center",
+    ellipsis: true,
+  },
+  { title: "app_key  ", dataIndex: "appKey", align: "center", ellipsis: true },
+  {
+    title: "app_secret",
+    dataIndex: "appSecret",
+    align: "center",
+    ellipsis: true,
+  },
+  {
+    title: window.$t("customer.startTime"),
+    dataIndex: "createdAt",
+    align: "center",
+    ellipsis: true,
+  },
+  {
+    title: window.$t("customer.updateTime"),
+    dataIndex: "updatedAt",
+    align: "center",
+    ellipsis: true,
+  },
+  {
+    title: window.$t("global.common.operations"),
+    slotName: "operation",
+    align: "center",
+    ellipsis: true,
+  },
+];

+ 3 - 1
src/views/tariffManagement/Management/add.vue

@@ -315,9 +315,11 @@ watch(() => FormDataList.value, val => {
 }, { immediate: true })
 
 
-watch(() => typeIndexSet.value, val => {
+watch(() => props.typeIndex, val => {
     if (val == null) return
     typeIndexSet.value = val
+
+    console.log(typeIndexSet.value);
 }, { immediate: true })
 
 onMounted(() => {

+ 2 - 2
vite.config.js

@@ -61,9 +61,9 @@ export default defineConfig({
         hmr: true,
         proxy: {
             "/api": {
-                // target: "http://sim.nanodreamtech.com",
+                target: "http://sim.nanodreamtech.com",
                 // target: "http://127.0.0.1:3001",
-                target: "http://sim.ainets.net",
+                // target: "http://sim.ainets.net",
                 changeOrigin: true,
                 ws: true,
                 secure: true,