Sfoglia il codice sorgente

增加开发环境和生产环境变量 & 修改资费关闭某些值被重置为空的bug

wxy 3 mesi fa
parent
commit
543bb742a9

+ 3 - 0
.env.development

@@ -0,0 +1,3 @@
+# 开发环境
+VITE_API_URL=http://sim.nanodreamtech.com
+VITE_ENV=development

+ 3 - 0
.env.production

@@ -0,0 +1,3 @@
+# 生产环境api
+VITE_API_URL=http://sim.ainets.net
+VITE_ENV=production

+ 0 - 8
src/views/lotCard/cardList/index.vue

@@ -6,10 +6,6 @@
       <Search :SearchForm="SearchForm" @query="intData" @reset="reset" />
     </div>
 
-    <div class="add_card">
-      <a-button type="primary">导卡</a-button>
-    </div>
-
     <a-table row-key="iccid" :data="dataSource" :columns="columns" :pagination="false" :scroll="{ x: 'auto' }">
       <template #dataUsageTotal="{ record }">
         <span>{{ record.dataUsageTotal }}MB</span>
@@ -138,10 +134,6 @@ onMounted(() => {
   margin-top: 30px;
 }
 
-.add_card {
-  margin-bottom: 1rem;
-}
-
 .search-section {
   margin-top: 20px;
   margin-bottom: 20px;

+ 1 - 1
src/views/supplier/trafficList/config.js

@@ -1,6 +1,6 @@
 export const columns = [
   { title: window.$t('dataPackage.id'), dataIndex: 'id', align: 'center', ellipsis: true },
-  { title: '来源', dataIndex: 'source', align: 'center', ellipsis: true },
+  { title: '供应商', dataIndex: 'source', align: 'center', ellipsis: true },
   { title: '流量包名称', dataIndex: 'productName', align: 'center', ellipsis: true },
   { title: '地区名称', dataIndex: 'dataZoneName', align: 'center', ellipsis: true },
   { title: '套餐有效天数', dataIndex: 'validDays', align: 'center', ellipsis: true },

+ 11 - 5
src/views/tariffManagement/Management/add.vue

@@ -112,7 +112,7 @@
 </template>
 
 <script setup>
-import { ref, onMounted, toRefs, toRef, watch,defineExpose } from 'vue';
+import { ref, onMounted, toRefs, toRef, watch, defineExpose } from 'vue';
 import { getDataPlanList } from "@/api/path/lotCard.api"
 import { getSTSInfoList } from '@/api/path/system.api'
 import { updateTariff, addTariff } from "@/api/path/tariffManagement.api"
@@ -195,7 +195,6 @@ const rules = {
     testsimDataPlanId: [{ required: true, trigger: 'change', }],
 };
 
-
 // 提交
 const handleSubmit = ({ values, errors }) => {
     formRef.value.validate(async (errors) => {
@@ -240,8 +239,15 @@ const handleSubmit = ({ values, errors }) => {
 const resetForm = () => {
     emit('update:modelValue', false)
     Object.keys(formState.value).forEach(key => {
-        formState.value[key] = ''
+        if (
+            key != 'billingMethod' &&
+            key != 'currency' &&
+            key != 'trafficBillingType'
+        ) {
+            formState.value[key] = ''
+        }
     })
+
     delete formState.value.id
 }
 
@@ -302,7 +308,7 @@ watch(() => props.typeIndex, val => {
 }, { immediate: true })
 
 const detaile = (val) => {
-    if (!val.id) return
+    if (!val) return
     Object.keys(formState.value).forEach(key => {
         if (val[key]) {
             formState.value[key] = key === 'userId' ? Number(val[key]) : val[key];
@@ -317,6 +323,6 @@ onMounted(() => {
     formState.value.trafficBillingType = 'MB'
 })
 
-defineExpose({detaile})
+defineExpose({ detaile })
 </script>
 <style scoped></style>

+ 9 - 9
src/views/tariffManagement/index.vue

@@ -3,10 +3,10 @@
   <div class="container">
     <!-- 搜索条件区 -->
     <div class="search-section">
-      <Search :SearchForm="trafficSearchFrom" @query="intData" @reset="reset"/>
+      <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">
+      <a-button type="text" @click="dictShowModel(1, false)" v-if="role.getRole == 1">
         <template #icon>
           <icon-plus-circle />
         </template>
@@ -60,14 +60,14 @@
     </a-modal>
 
     <Meal v-model:model-value="modealShow" :traffIds="ids" @submit="intData()" />
-    <Add v-model:model-value="visible" :type-index="typeCurrent"  ref="addDetaile" @submit="intData()"></Add>
+    <Add v-model:model-value="visible" :type-index="typeCurrent" ref="addDetaile" @submit="intData()"></Add>
   </div>
 </template>
 
 <script setup>
 import { onMounted, ref, toRefs, getCurrentInstance } from "vue";
 import { useRoute } from "vue-router";
-import { columns, planColumns ,trafficSearchFrom} from "./config";
+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'
@@ -128,7 +128,7 @@ const {
 const addDetaile = ref(null)
 
 const intData = async (item) => {
-  if(item){
+  if (item) {
     searchForm.value = item
   }
   const param = {
@@ -148,9 +148,9 @@ const intData = async (item) => {
     let pricingName;
 
     if (item.billingMethod == 1) {
-      pricingName = item.trafficBillingAmount + pricingCurrty
+      pricingName = item.trafficBillingAmount + '/' + pricingCurrty
     } else if (item.billingMethod == 2) {
-      pricingName = item.pricing + pricingCurrty
+      pricingName = item.pricing + '/' + pricingCurrty
     }
     return {
       ...item,
@@ -167,8 +167,8 @@ const intData = async (item) => {
   pagination.value.total = data.total
 }
 
-const reset = (item)=>{
-  searchForm.value = item 
+const reset = (item) => {
+  searchForm.value = item
   pagination.value.current = 1
   intData()
 }

+ 2 - 1
vite.config.js

@@ -63,7 +63,8 @@ export default defineConfig({
             "/api": {
                 // target: "http://sim.nanodreamtech.com",
                 // target: "http://127.0.0.1:3001",
-                target: "http://sim.ainets.net",
+                // target: "http://sim.ainets.net",
+                target:import.meta.env.VITE_API_URL,
                 changeOrigin: true,
                 ws: true,
                 secure: true,