Explorar el Código

广告管理,翻译

theo hace 3 años
padre
commit
ea54c23b72

+ 2 - 2
backendApi/modules/v1/controllers/AdController.php

@@ -75,7 +75,7 @@ class AdController extends BaseController
      */
     public function actionAdd(){
         if(Yii::$app->request->isPost) {
-            return parent::edit(AdForm::class, '添加广告成功', null, null, null, function($formModel, $result){
+            return parent::edit(AdForm::class, 'Add Ad Succeed', null, null, null, function($formModel, $result){
                 // 添加操作日志
                 // Log::adminHandle('添加广告:'.$result->TITLE);
             });
@@ -93,7 +93,7 @@ class AdController extends BaseController
     public function actionEdit(){
         $id = Yii::$app->request->get('id');
         if(Yii::$app->request->isPost) {
-            return parent::edit(AdForm::class, '编辑广告成功', null, null, null, function($formModel, $result){
+            return parent::edit(AdForm::class, 'Edit Ad Succeed', null, null, null, function($formModel, $result){
                 // 添加操作日志
                 // Log::adminHandle('编辑广告:'.$result->TITLE);
             });

+ 10 - 10
backendEle/src/router/index.js

@@ -1648,7 +1648,7 @@ export const constantRouterMap = [
           title: 'Ad',
           breadcrumb: [
             {title: 'Dashboard', path: '/dashboard/index'},
-            {title: 'Ad management', path: '/ad/location'},
+            {title: 'Ad Management', path: '/ad/location'},
           ],
         },
       },
@@ -1657,12 +1657,12 @@ export const constantRouterMap = [
         component: _import('ad/list'),
         name: 'ad_list',
         meta: {
-          title: '广告列表',
+          title: 'Ad List', // 广告列表
           highLight: '/ad/location',
           breadcrumb: [
             {title: 'Dashboard', path: '/dashboard/index'},
-            {title: '广告管理', path: '/ad/location'},
-            {title: '广告位', path: '/ad/location'},
+            {title: 'Ad Management', path: '/ad/location'}, // 广告管理
+            {title: 'Ad Location', path: '/ad/location'}, // 广告位
           ],
         },
       },
@@ -1671,12 +1671,12 @@ export const constantRouterMap = [
         component: _import('ad/edit'),
         name: 'ad_add',
         meta: {
-          title: '添加广告',
+          title: 'Ad Add', // 添加广告
           highLight: '/ad/location',
           breadcrumb: [
             {title: 'Dashboard', path: '/dashboard/index'},
-            {title: '广告管理', path: '/ad/location'},
-            {title: '广告位', path: '/ad/location'},
+            {title: 'Ad Management', path: '/ad/location'}, // 广告管理
+            {title: 'Ad Location', path: '/ad/location'}, // 广告位
           ],
         },
       },
@@ -1685,12 +1685,12 @@ export const constantRouterMap = [
         component: _import('ad/edit'),
         name: 'ad_edit',
         meta: {
-          title: '编辑广告',
+          title: 'Ad Edit', // 编辑广告
           highLight: '/ad/location',
           breadcrumb: [
             {title: 'Dashboard', path: '/dashboard/index'},
-            {title: '广告管理', path: '/ad/location'},
-            {title: '广告位', path: '/ad/location'},
+            {title: 'Ad Management', path: '/ad/location'}, // 广告管理
+            {title: 'Ad Location', path: '/ad/location'}, // 广告位
           ],
         },
       },

+ 10 - 10
backendEle/src/views/ad/edit.vue

@@ -2,26 +2,26 @@
   <div v-loading="loading">
     <div class="white-box">
       <el-form ref="form" :model="form" label-width="100px" style="">
-        <el-form-item label="标题">
+        <el-form-item label="Title"> <!-- 标题 -->
           <el-input v-model="form.title" style="width: 400px;">></el-input>
         </el-form-item>
-        <el-form-item label="广告位">
-          <el-select v-model="form.lid" placeholder="请选择广告位" style="width: 400px;">
+        <el-form-item label="Ad Location"> <!-- 广告位 -->
+          <el-select v-model="form.lid" placeholder="Select Ad Location" style="width: 400px;"> <!-- 请选择广告位 -->
             <el-option v-for="item in allLocation" :label="item.LOCATION_NAME" :value="item.ID"
                        :key="item.ID"></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="广告类型">
-          <el-select v-model="form.type" placeholder="请选择广告类型" style="width: 400px;">
-            <el-option label="外链" value="1" :key="1"></el-option>
-            <el-option label="文章" value="2" :key="2"></el-option>
+        <el-form-item label="Type"> <!-- 广告类型 -->
+          <el-select v-model="form.type" placeholder="Select Type" style="width: 400px;"> <!-- 请选择广告类型 -->
+            <el-option label="External Link" value="1" :key="1"></el-option> <!-- 外链 -->
+            <el-option label="Article" value="2" :key="2"></el-option> <!-- 文章 -->
           </el-select>
         </el-form-item>
-        <el-form-item :label="form.type==='1' ? '链接地址' : '文章ID'">
+        <el-form-item :label="form.type==='1' ? 'Url' : 'Article ID'"> <!-- '链接地址' '文章ID' -->
           <el-input v-model="form.content" style="width: 400px;">></el-input>
-          <span class="note">注:外链请明确输入 http://或https://,文章则不需要输入</span>
+          <span class="note"></span> <!-- 注:外链请明确输入 http://或https://,文章则不需要输入 -->
         </el-form-item>
-        <el-form-item label="广告图片">
+        <el-form-item label="Image"> <!-- 广告图片 -->
           <leo-uploader :requestRoute="'ad/upload'" :defaultImageUrl="defaultImageUrl" width="400px" height="160px"
                         @on-success="handleSuccess"></leo-uploader>
         </el-form-item>

+ 14 - 14
backendEle/src/views/ad/list.vue

@@ -9,54 +9,54 @@
           </template>
         </el-table-column>
         <el-table-column type="selection" width="55"></el-table-column>
-        <el-table-column label="广告标题" prop="TITLE" width="250">
+        <el-table-column label="Ad Title" prop="TITLE" width="250"> <!-- 广告标题 -->
           <template slot-scope="scope">
             <el-tag type="" size="small" class="no-border">{{scope.row.TITLE}}</el-tag>
           </template>
         </el-table-column>
-        <el-table-column label="广告位" width="150">
+        <el-table-column label="Ad Location" width="150"> <!-- 广告位 -->
           <template slot-scope="scope">
             <el-tag type="warning" size="small" class="no-border">{{allData.allLocation[scope.row.LID].LOCATION_NAME}}</el-tag>
           </template>
         </el-table-column>
-        <el-table-column label="类型">
+        <el-table-column label="Type"> <!-- 类型 -->
           <template slot-scope="scope">
             <template v-if="scope.row.TYPE === '1'">
-              <el-tag type="success">外链</el-tag>
+              <el-tag type="success">External Links</el-tag> <!-- 外链 -->
             </template>
             <template v-else-if="scope.row.TYPE === '2'">
-              <el-tag>文章</el-tag>
+              <el-tag>Article</el-tag> <!-- 文章 -->
             </template>
           </template>
         </el-table-column>
-        <el-table-column label="连接或文章ID" prop="CONTENT" width="120"></el-table-column>
-        <el-table-column label="排序" width="100">
+        <el-table-column label="ID" prop="CONTENT" width="120"></el-table-column> <!-- 链接或文章ID -->
+        <el-table-column label="Sort" width="100"> <!-- 排序 -->
           <template slot-scope="scope">
             <el-input v-model="scope.row.SORT" min="0" max="99" @change="handleChangeSort(scope.row, scope.row.SORT)"
                       @click.native.stop=""></el-input>
           </template>
         </el-table-column>
-        <el-table-column label="创建人">
+        <el-table-column label="Creator"> <!-- 创建人 -->
           <template slot-scope="scope">
             {{scope.row.CREATE_ADMIN_NAME}}
           </template>
         </el-table-column>
-        <el-table-column label="创建时间" width="180">
+        <el-table-column label="Created Time" width="180"> <!-- 创建时间 -->
           <template slot-scope="scope">
             {{tool.formatDate(scope.row.CREATED_AT)}}
           </template>
         </el-table-column>
-        <el-table-column label="修改人">
+        <el-table-column label="Modified By"> <!-- 修改人 -->
           <template slot-scope="scope">
             {{scope.row.UPDATE_ADMIN_NAME}}
           </template>
         </el-table-column>
-        <el-table-column label="修改时间" width="180">
+        <el-table-column label="Modified Time" width="180"> <!-- 修改时间 -->
           <template slot-scope="scope">
             {{tool.formatDate(scope.row.UPDATED_AT)}}
           </template>
         </el-table-column>
-        <el-table-column fixed="right" label="操作" width="180">
+        <el-table-column fixed="right" label="Action" width="180"> <!-- 操作 -->
           <template slot-scope="scope">
             <el-dropdown size="small" trigger="click" v-if="permission.hasPermission(`ad/ad-delete`) || permission.hasPermission(`ad/edit`)">
               <el-button type="primary" size="small" @click.stop="">
@@ -79,7 +79,7 @@
             <el-dropdown-item command="delete" @click.native="handleMuliDel()">Delete</el-dropdown-item>
           </el-dropdown-menu>
         </el-dropdown>
-        <el-button type="primary" size="small" @click="handleAdd" icon="el-icon-plus" v-if="permission.hasPermission(`ad/add`)">添加广告</el-button>
+        <el-button type="primary" size="small" @click="handleAdd" icon="el-icon-plus" v-if="permission.hasPermission(`ad/add`)">Add Ad</el-button>
         <pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange" @current-change="handleCurrentChange"></pagination>
       </div>
     </div>
@@ -153,7 +153,7 @@ export default {
     },
     delData (id = null) {
       let obj = this
-      obj.$confirm('确定删除选定的数据?', 'Notice', {
+      obj.$confirm('Are you sure to delete the selected data?', 'Notice', { // 确定删除选定的数据?
         confirmButtonText: 'confirm', // 确定
         cancelButtonText: 'cancel', // 取消
         type: 'warning'

+ 1 - 1
backendEle/src/views/ad/location.vue

@@ -35,7 +35,7 @@
                 Action<i class="el-icon-arrow-down el-icon--right"></i>
               </el-button>
               <el-dropdown-menu slot="dropdown">
-                <el-dropdown-item command="edit" @click.native="handleShow(scope.row)">查看</el-dropdown-item> <!--  -->
+                <el-dropdown-item command="edit" @click.native="handleShow(scope.row)">View</el-dropdown-item> <!--  -->
               </el-dropdown-menu>
             </el-dropdown>
           </template>

+ 2 - 2
common/models/forms/AdForm.php

@@ -152,11 +152,11 @@ class AdForm extends Model
         }
         if($this->scenario == 'add'){
             $this->adminOperateLogger->afterInsert($model)->clean()->save([
-                'optType' => '添加广告',
+                'optType' => 'Add',
             ]);
         }else{
             $this->adminOperateLogger->afterUpdate($model)->clean()->save([
-                'optType' => '编辑广告',
+                'optType' => 'Edit',
             ]);
         }
         return $model;