Explorar el Código

管理后台页面调试修改

zuypeng hace 1 año
padre
commit
1a69d3dd12

+ 1 - 1
admin-web/.env.development

@@ -2,6 +2,6 @@
 ENV = development
 
 # 本地环境接口地址
-VITE_API_URL = http://localhost:8080/admin
+VITE_API_URL = http://localhost:9090/admin
 #VITE_API_URL = https://www.kuaiyuman.cn/admin/
 VITE_FILE_URL = http://static.kuaiyuman.cn/

+ 1 - 0
admin-web/src/directive/authDirective.ts

@@ -12,6 +12,7 @@ export function authDirective(app: App) {
 	// 单个权限验证(v-auth="xxx")
 	app.directive('auth', {
 		mounted(el, binding) {
+			return;
 			const stores = useUserInfo();
 			if(!binding.value||!stores.userInfos?.permissions){
 				return;

+ 30 - 94
admin-web/src/router/route.ts

@@ -163,36 +163,36 @@ export const adminRoutes: Array<RouteRecordRaw> = [
                     //         icon: 'ele-User',
                     //     },
                     // },
-                    {
-                        path: '/station/statMonth',
-                        name: 'adminStationStatMonth',
-                        component: () => import('/@/views/admin/station/stat/index.vue'),
-                        meta: {
-                            title: '站点月表',
-                            isLink: '',
-                            isHide: false,
-                            isKeepAlive: true,
-                            isAffix: false,
-                            isIframe: false,
-                            perm:"stationStatMonth.list",
-                            icon: 'ele-Histogram',
-                        },
-                    },
-                    {
-                        path: '/station/statement',
-                        name: 'adminStatement',
-                        component: () => import('/@/views/admin/station/statment/index.vue'),
-                        meta: {
-                            title: '对账单',
-                            isLink: '',
-                            isHide: false,
-                            isKeepAlive: true,
-                            isAffix: false,
-                            isIframe: false,
-                            perm:"statement.list",
-                            icon: 'ele-CreditCard',
-                        },
-                    },
+                    // {
+                    //     path: '/station/statMonth',
+                    //     name: 'adminStationStatMonth',
+                    //     component: () => import('/@/views/admin/station/stat/index.vue'),
+                    //     meta: {
+                    //         title: '站点月表',
+                    //         isLink: '',
+                    //         isHide: false,
+                    //         isKeepAlive: true,
+                    //         isAffix: false,
+                    //         isIframe: false,
+                    //         perm:"stationStatMonth.list",
+                    //         icon: 'ele-Histogram',
+                    //     },
+                    // },
+                    // {
+                    //     path: '/station/statement',
+                    //     name: 'adminStatement',
+                    //     component: () => import('/@/views/admin/station/statment/index.vue'),
+                    //     meta: {
+                    //         title: '对账单',
+                    //         isLink: '',
+                    //         isHide: false,
+                    //         isKeepAlive: true,
+                    //         isAffix: false,
+                    //         isIframe: false,
+                    //         perm:"statement.list",
+                    //         icon: 'ele-CreditCard',
+                    //     },
+                    // },
                 ]
             },
             // {
@@ -225,70 +225,6 @@ export const adminRoutes: Array<RouteRecordRaw> = [
                     perm:"banner.list",
                 }
             },
-            {
-                path: '/activity',
-                name: 'activity',
-                component: () => import('/@/layout/routerView/parent.vue'),
-                redirect: '/activity/list',
-                meta: {
-                    title: '营销活动',
-                    isLink: '',
-                    isHide: false,
-                    isKeepAlive: true,
-                    isAffix: false,
-                    isIframe: false,
-                    icon: 'ele-Tools',
-                    perm: "activity.list,coupon.list",
-                },
-                children: [
-                    {
-                        path: '/activity/list',
-                        name: 'adminActivity',
-                        component: () => import('/@/views/admin/activity/index.vue'),
-                        meta: {
-                            title: '活动列表',
-                            isLink: '',
-                            isHide: false,
-                            isKeepAlive: true,
-                            isAffix: false,
-                            isIframe: false,
-                            icon: 'ele-PieChart',
-                            perm:"activity.list",
-                        }
-                    },
-                    {
-                        path: '/activity/coupon',
-                        name: 'adminCoupon',
-                        component: () => import('/@/views/admin/activity/coupon/index.vue'),
-                        meta: {
-                            title: '优惠券列表',
-                            isLink: '',
-                            isHide: false,
-                            isKeepAlive: true,
-                            isAffix: false,
-                            isIframe: false,
-                            icon: 'ele-PieChart',
-                            // perm:"coupon.list",
-                        }
-                    },
-                    {
-                        path: '/activity/userCoupon',
-                        name: 'adminUserCoupon',
-                        component: () => import('/@/views/admin/activity/userCoupon/index.vue'),
-                        meta: {
-                            title: '用户优惠券',
-                            isLink: '',
-                            isHide: false,
-                            isKeepAlive: true,
-                            isAffix: false,
-                            isIframe: false,
-                            icon: 'ele-PieChart',
-                            // perm:"coupon.list",
-                        }
-                    },
-                ]
-            },
-
             {
                 path: '/ordering',
                 name: 'adminOrdering',

+ 3 - 3
admin-web/src/views/admin/banner/dialog.vue

@@ -20,7 +20,7 @@
           size="default"
           label-width="125px"
           class="mt5">
-        <el-form-item label="主活动" prop="activityId">
+<!--        <el-form-item label="主活动" prop="activityId">
           <ext-select
               v-model="state.ruleForm.activityId"
               placeholder="关联活动"
@@ -29,7 +29,7 @@
               clearable
               class="wd200">
           </ext-select>
-        </el-form-item>
+        </el-form-item>-->
         <el-form-item label="banner图片" prop="bannerUrl">
           <ext-upload v-model="state.ruleForm.bannerUrl"></ext-upload>
 <!--          <el-input-->
@@ -141,7 +141,7 @@ const initState = () => ({
   rules: {
     startTime:[u.validator.required],
     endTime:[u.validator.required],
-    status:[u.validator.required],
+    // status:[u.validator.required],
   },
 })
 

+ 145 - 0
admin-web/src/views/admin/faq/dialog.vue

@@ -0,0 +1,145 @@
+<style scoped lang="scss">
+
+</style>
+<template>
+  <div class="system-dialog-container">
+    <el-dialog
+        :title="state.dialog.title"
+        v-model="state.dialog.isShowDialog"
+        width="820px"
+        draggable
+        destroy-on-close
+        :close-on-click-modal="false"
+        @close="onClose"
+        align-center>
+      <el-form
+          inline
+          :model="state.ruleForm"
+          :rules="state.rules"
+          ref="formRef"
+          size="default"
+          label-width="125px"
+          class="mt5">
+        <el-form-item label="问题" prop="question"  class="w100">
+          <el-input
+              v-model.trim="state.ruleForm.question"
+              placeholder="问题"
+              clearable
+              class="w100">
+          </el-input>
+        </el-form-item>
+
+        <el-form-item label="答案" prop="answer"   class="w100">
+          <ext-editor v-model="state.ruleForm.answer"></ext-editor>
+        </el-form-item>
+
+      </el-form>
+
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="onCancel" size="default">取 消</el-button>
+          <el-button :loading="state.btnLoading" type="primary" @click="onSubmit" size="default">{{ state.dialog.submitTxt }}</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup lang="ts" name="FaqDialog">
+import {defineAsyncComponent, reactive, onMounted, ref} from 'vue';
+import {Msg} from "/@/utils/message";
+import {$body, $get} from "/@/utils/request";
+import u from '/@/utils/u'
+import ExtSelect from "/@/components/form/ExtSelect.vue";
+import ExtUpload from "/@/components/form/ExtUpload.vue";
+import ExtDatePicker from "/@/components/form/ExtDatePicker.vue";
+import ExtDSelect from "/@/components/form/ExtDSelect.vue";
+import ExtEditor from "/@/components/form/ExtEditor.vue";
+
+
+// 定义子组件向父组件传值/事件
+const emit = defineEmits(['refresh']);
+const formRef = ref();
+//定义初始变量,重置使用
+const initState = () => ({
+  ruleForm: {
+    id: 0,
+    status:1,
+
+  },
+  btnLoading: false,
+  dialog: {
+    isShowDialog: false,
+    type: '',
+    title: '',
+    submitTxt: '',
+  },
+  rules: {
+    answer:[u.validator.required],
+    question:[u.validator.required],
+    // status:[u.validator.required],
+  },
+})
+
+// 定义变量内容
+const state = reactive(initState());
+
+
+// 打开弹窗
+const open = (action: string = 'add', row: any) => {
+  state.dialog.title = u.dialog.actions[action].title + "『问题配置』"
+  state.dialog.submitTxt = u.dialog.actions[action].btn + "『问题配置』"
+  state.dialog.isShowDialog = true;
+  if (action !== 'add') {
+    loadData(row.id);
+  } else {
+    state.ruleForm = Object.assign(state.ruleForm, row);
+  }
+};
+// 关闭弹窗
+const onClose = () => {
+  state.dialog.isShowDialog = false;
+  Object.assign(state, initState())
+};
+// 取消
+const onCancel = () => {
+  onClose();
+};
+// 提交
+const onSubmit = () => {
+  formRef.value.validate((valid:boolean) => {
+    if(valid){
+      state.btnLoading = true;
+      const url = state.ruleForm.id > 0 ? "faq/modify" : "faq/add"
+      $body(url, state.ruleForm).then(() => {
+        state.btnLoading = false;
+        Msg.message('操作成功');
+        console.log('submit!')
+        onClose();
+        emit('refresh');
+      })
+    }
+  }).catch(() => {
+    state.btnLoading = false;
+    Msg.message('请先完整填写表单', 'error');
+  })
+};
+
+const handleFormChange = (formData: any) => {
+  console.log(formData)
+}
+
+// 初始化表格数据
+const loadData = (id: number) => {
+  $get(`faq/${id}`).then((res: any) => {
+    state.ruleForm = res;
+  })
+}
+
+// 暴露变量
+defineExpose({
+  open
+});
+
+
+</script>

+ 23 - 52
admin-web/src/views/admin/faq/index.vue

@@ -34,46 +34,31 @@
           ref="queryRef"
           size="default" label-width="0px" class="mt5 mb5">
         <el-input
-            v-model="state.formQuery.mobilePhone"
-            placeholder="用户手机号"
+            v-model="state.formQuery.question"
+            placeholder="问题"
             clearable
             @blur="loadData(true)"
             class="wd150 mr10">
         </el-input>
-        <el-input
-            v-model="state.formQuery.outTradeNo"
-            placeholder="商户订单号"
-            clearable
-            @blur="loadData(true)"
-            class="wd150 mr10">
-        </el-input>
-        <el-input
-            v-model="state.formQuery.transactionId"
-            placeholder="微信订单号"
+        <ext-d-select
+            v-model="state.formQuery.status"
+            placeholder="状态"
+            type="Faq.status"
             clearable
             @blur="loadData(true)"
             class="wd150 mr10">
-        </el-input>
-        <!--        <el-input
-                    v-model="state.formQuery.tradeType"
-                    placeholder="交易类型,枚举值:JSAPI:公众号支付 NATIVE:扫码支付 APP:APP支付 MICROPAY:付款码支付 MWEB:H5支付 FACEPAY:刷脸支付"
-                    clearable
-                    @blur="loadData(true)"
-                    class="wd150 mr10">
-                </el-input>-->
-        <!--        <el-input
-                    v-model="state.formQuery.tradeState"
-                    placeholder="交易状态,枚举值:SUCCESS:支付成功REFUND:转入退款NOTPAY:未支付CLOSED:已关闭REVOKED:已撤销(付款码支付)USERPAYING:用户支付中(付款码支付)PAYERROR:支付失败(其他原因,如银行返回失败)"
-                    clearable
-                    @blur="loadData(true)"
-                    class="wd150 mr10">
-                </el-input>-->
+        </ext-d-select>
 
 
         <el-button class="ml10" plain size="default" type="success" @click="loadData(true)">
           <SvgIcon name="ele-Search"/>
           查询
         </el-button>
+
+        <el-button  v-auth="'faq.add'"   size="default" plain  type="success" class="ml10" @click="onRowClick('add',null)">
+          <SvgIcon name="ele-FolderAdd"/>
+          新增
+        </el-button>
       </el-form>
 
       <el-table
@@ -105,9 +90,6 @@
             <template v-if="field.prop==='expand'">
               <p style="padding-left: 2em;" v-html="row[field.prop]"></p>
             </template>
-            <template v-if="field.prop==='rechargeAmount'">
-              {{u.fmt.fmtMoney(row[field.prop])}}
-            </template>
             <template v-else>
               <div>{{ row[field.prop] }}</div>
             </template>
@@ -118,10 +100,11 @@
 
       <ext-page class="page-pager" v-model:value="state.pageQuery" @change="loadData(false)"/>
     </el-card>
+    <FaqDialog ref="faq_dialog_ref"></FaqDialog>
   </div>
 </template>
 
-<script setup lang="ts" name="PayLogList">
+<script setup lang="ts" name="FaqList">
 import {nextTick, onBeforeMount, onBeforeUnmount, onMounted, reactive, ref} from 'vue';
 import {$get} from "/@/utils/request";
 import {Msg} from "/@/utils/message";
@@ -129,6 +112,7 @@ import u from "/@/utils/u"
 
 import {useRoute} from "vue-router";
 import ExtPage from '/@/components/form/ExtPage.vue'
+import FaqDialog from "/@/views/admin/faq/dialog.vue"
 
 import mittBus from '/@/utils/mitt';
 
@@ -137,7 +121,7 @@ const route = useRoute();
 
 //定义引用
 const queryRef = ref();
-const payLogDialogRef = ref();
+const faq_dialog_ref = ref();
 
 //定义变量
 const state = reactive({
@@ -152,15 +136,10 @@ const state = reactive({
     data: [] as Array<any>,
     loading: false,
     columns: [
-      {label: '用户ID', prop: 'userId', width: 200, resizable: true, fixed: 'left'},
-      {label: '用户手机号', prop: 'mobilePhone', width: 150, resizable: true, fixed: 'left'},
-      {label: '商户订单号', prop: 'outTradeNo', width: 250, resizable: true},
-      {label: '微信订单号', prop: 'transactionId', width: 250, resizable: true},
-      {label: '订单总金额', prop: 'rechargeAmount', resizable: true, width: 130},
-      // {label: '交易类型', prop: 'tradeType', width: 150, resizable: true},
-      {label: '交易状态', prop: 'tradeState', width: 150, resizable: true},
-      {label: '用户支付币种', prop: 'currency', width: 150, resizable: true},
-      {label: '支付完成时间', prop: 'transactionTime', sortable: 'custom', resizable: true, width: 200, fixed: 'right'},
+      {label: '问题', prop: 'question', width: 200, resizable: true, fixed: 'left'},
+      {label: '状态', prop: 'status', width: 150, resizable: true, fixed: 'left'},
+      {label: '答案', prop: 'answer', resizable: true},
+      {label: '操作', prop: 'transactionTime', sortable: 'custom', resizable: true, width: 200, fixed: 'right'},
     ],
   },
 })
@@ -193,14 +172,8 @@ onMounted(() => {
     state.tableData.height = bodyHeight - queryHeight - 320
   })
 
-  mittBus.on("payLog.refresh", () => {
-    loadData();
-  })
 });
 
-onBeforeUnmount(() => {
-  mittBus.off("payLog.refresh")
-})
 
 
 //region 方法区
@@ -210,7 +183,7 @@ const loadData = (refresh: boolean = false) => {
     state.pageQuery.pageNum = 1;
   }
   state.tableData.loading = true;
-  $get(`/custom/listRecharge`, {...state.formQuery, ...state.pageQuery}).then((res: any) => {
+  $get(`/faq/list`, {...state.formQuery, ...state.pageQuery}).then((res: any) => {
     let {list, total} = res;
     state.tableData.data = list;
     state.pageQuery.total = total;
@@ -221,15 +194,13 @@ const loadData = (refresh: boolean = false) => {
   })
 };
 
-// 打开修改用户弹窗
 const onRowClick = (type: string, row: any) => {
-  payLogDialogRef.value.open(type, row);
+  faq_dialog_ref.value.open(type, row);
 };
 
-// 删除用户
 const onRowDel = (row: any) => {
   Msg.confirm(`此操作将永久删除:『${row.name}』,是否继续?`).then(() => {
-    $get(`/payLog/delete/${row.id}`).then(() => {
+    $get(`/faq/delete/${row.id}`).then(() => {
       Msg.message("删除成功", 'success')
     }).catch(() => {
       Msg.message("删除失败", 'error')

+ 11 - 11
admin-web/src/views/admin/index.vue

@@ -108,7 +108,7 @@ const state = reactive({
     {
       num1: '0',
       num2: '-12.32',
-      num3: '今日充电量(kwh)',
+      num3: '今日洗车量(kwh)',
       num4: 'fa fa-meetup',
       color1: '#FF6462',
       color2: '--next-color-primary-lighter',
@@ -144,7 +144,7 @@ const state = reactive({
     {
       num1: '0',
       num2: '-10.01',
-      num3: '今日充电人数',
+      num3: '今日洗车人数',
       num4: 'fa fa-github-alt',
       color1: '#FF6462',
       color2: '--next-color-danger-lighter',
@@ -153,7 +153,7 @@ const state = reactive({
     {
       num1: '0',
       num2: '-10.01',
-      num3: '今日充电订单数(笔)',
+      num3: '今日洗车订单数(笔)',
       num4: 'fa fa-github-alt',
       color1: '#FF6462',
       color2: '--next-color-danger-lighter',
@@ -210,13 +210,13 @@ const initLineChart = (dataList: Array<any>) => {
   const option = {
     backgroundColor: state.charts.bgColor,
     title: {
-      text: '充电数据走势图',
+      text: '洗车数据走势图',
       x: 'left',
       textStyle: {fontSize: '15', color: state.charts.color},
     },
     grid: {top: 70, right: 0, bottom: 30, left: 50},
     tooltip: {trigger: 'axis'},
-    legend: {data: ['充电量', /*'总金额','电费',*/'实付服务费',], right: 0},
+    legend: {data: ['洗车量', /*'总金额','电费',*/'实付服务费',], right: 0},
     xAxis: {
       data: xAxis,
       // data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
@@ -224,14 +224,14 @@ const initLineChart = (dataList: Array<any>) => {
     yAxis: [
       {
         type: 'value',
-        name: '费用/元 充电量/度',
+        name: '费用/元 洗车量/度',
         position: 'left',
         splitLine: {show: true, lineStyle: {type: 'dashed', color: '#f5f5f5'}},
       },
     ],
     series: [
       {
-        name: '充电量',
+        name: '洗车量',
         type: 'bar',
         symbolSize: 6,
         symbol: 'circle',
@@ -324,7 +324,7 @@ const initLineChart = (dataList: Array<any>) => {
 const initPieChart = (dataMap: any) => {
   if (!state.global.dispose.some((b: any) => b === state.global.homeChartTwo)) state.global.homeChartTwo.dispose();
   state.global.homeChartTwo = markRaw(echarts.init(homePieRef.value, state.charts.theme));
-  var getname = ['离线', '空闲', '已连接', '充电中', '预约中', '故障'];
+  var getname = ['离线', '空闲', '已连接', '洗车中', '预约中', '故障'];
   const colorList = ['#6B6F75FF', '#36C78B', '#e9ee8e', '#ffa496', '#E790E8','#363638FF'];
   // var getvalue = [34.2, 38.87, 17.88];
   // var data = [dataMap["0"]||0,dataMap["1"]||0,dataMap["2"]||0];
@@ -336,7 +336,7 @@ const initPieChart = (dataMap: any) => {
   const option = {
     backgroundColor: state.charts.bgColor,
     title: {
-      text: '充电站电桩状态',
+      text: '洗车站电桩状态',
       x: 'left',
       textStyle: {fontSize: '15', color: state.charts.color},
     },
@@ -472,12 +472,12 @@ onMounted(() => {
   console.error("home onMounted")
   NProgress.done();
   initEchartsResize();
-  //加载充电走势数据
+  //加载洗车走势数据
   loadStationStat()
   //今日统计数据
   loadStationStatToday();
 
-  //加载充电桩状态
+  //加载洗车桩状态
   loadCurrentEquipmentStatus();
 
   mittBus.on('stationChangeRefresh', (stationId) => {