From 41f8bcffd7ace57975c0445e871cce0d076a2ed1 Mon Sep 17 00:00:00 2001 From: Jay Huang Date: Mon, 27 Nov 2023 17:47:27 +0800 Subject: [PATCH] =?UTF-8?q?#=E5=A2=9E=E5=8A=A0=E4=BA=86=E7=B9=81=E4=BD=93?= =?UTF-8?q?=E4=B8=AD=E6=96=87=E6=94=AF=E6=8C=81=EF=BC=8C=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=BA=86=E4=BA=8C=E4=BB=A3=E7=81=AD=E8=9A=8A=E7=81=AF=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E5=92=8C=E8=BF=9C=E7=A8=8B=E6=8E=A7=E5=88=B6=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/counter.js | 10 + src/components/LangSelect/index.vue | 3 +- src/lang/en.js | 1 + src/lang/hk.js | 238 ++++++++++++++++++++++++ src/lang/index.js | 6 + src/lang/zh.js | 1 + src/views/counter/components/screen.vue | 67 ++++++- src/views/counter/device.vue | 5 +- 8 files changed, 327 insertions(+), 4 deletions(-) create mode 100644 src/lang/hk.js diff --git a/src/api/counter.js b/src/api/counter.js index f43739f..d93cbd9 100644 --- a/src/api/counter.js +++ b/src/api/counter.js @@ -77,3 +77,13 @@ export function fetchWeatherLog(query) { params: query }) } + +// device v2 remote control + +export function fetchRemoteControl(deviceID, data) { + return request({ + url: `/api/mosq/devicemqtt/remotecontrol/${deviceID}/`, + method: 'post', + data + }) +} diff --git a/src/components/LangSelect/index.vue b/src/components/LangSelect/index.vue index e8afa59..c798dcd 100644 --- a/src/components/LangSelect/index.vue +++ b/src/components/LangSelect/index.vue @@ -4,7 +4,8 @@ - 中文 + 简体 + 繁体 English diff --git a/src/lang/en.js b/src/lang/en.js index f6e126c..e2fa987 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -179,6 +179,7 @@ export default { trendChart: 'Trend chart', region: 'Region', deviceName: 'Device Name', + noName: 'No Name', humitureChart: 'Humiture chart', temperature: 'Temperature', humidity: 'Humidity', diff --git a/src/lang/hk.js b/src/lang/hk.js new file mode 100644 index 0000000..74637a0 --- /dev/null +++ b/src/lang/hk.js @@ -0,0 +1,238 @@ +export default { + route: { + dashboard: '儀表板', + introduction: '簡述', + documentation: '文檔', + counter: '滅蚊燈數據', + statistic: '數據統計', + device: '狀態監控', + detail: '設備詳情', + logs: '日誌列表', + map: '區域地圖', + weather: '氣象台', + deviceSetting: '設備設置', + systemSetting: '系統設置', + guide: '引導頁', + permission: '權限測試頁', + pagePermission: '頁面權限', + directivePermission: '指令權限', + icons: '圖標', + components: '組件', + componentIndex: '介紹', + tinymce: '富文本編輯器', + markdown: 'Markdown', + jsonEditor: 'JSON編輯器', + dndList: '列表拖拽', + splitPane: 'Splitpane', + avatarUpload: '頭像上傳', + dropzone: 'Dropzone', + sticky: 'Sticky', + countTo: 'CountTo', + componentMixin: '小組件', + backToTop: '返回頂部', + dragDialog: '拖拽 Dialog', + dragKanban: '可拖拽看板', + charts: '圖表', + keyboardChart: '鍵盤圖表', + lineChart: '折線圖', + mixChart: '混合圖表', + example: '綜合實例', + nested: '路由嵌套', + bar: 'Bar', + barProfile: 'Profile', + barPosts: 'Posts', + Table: 'Table', + dynamicTable: '動態Table', + dragTable: '拖拽Table', + inlineEditTable: 'Table內編輯', + complexTable: '綜合Table', + treeTable: '樹形表格', + customTreeTable: '自定義樹表', + tab: 'Tab', + form: '表單', + createArticle: '創建文章', + editArticle: '編輯文章', + articleList: '文章列表', + errorPages: '錯誤頁面', + page401: '401', + page404: '404', + errorLog: '錯誤日誌', + excel: 'Excel', + exportExcel: '導出 Excel', + selectExcel: '導出選定', + uploadExcel: '上傳 Excel', + zip: 'Zip', + exportZip: '導出 Zip', + theme: '換膚', + clipboardDemo: 'Clipboard', + i18n: '國際化' + }, + navbar: { + logOut: '退出登錄', + dashboard: '首頁', + github: '項目地址', + screenfull: '全屏', + theme: '換膚' + }, + login: { + title: '系統登錄', + logIn: '登錄', + username: '賬號', + password: '密碼', + any: '隨便填', + thirdparty: '第三方登錄', + thirdpartyTips: '本地不能模擬,請結合自己業務進行模擬!!!' + }, + documentation: { + documentation: '文檔', + github: 'Github 地址' + }, + permission: { + roles: '你的權限', + switchRoles: '切換權限' + }, + guide: { + description: '引導頁對於一些第一次進入項目的人很有用,你可以簡單介紹下項目的功能。本 Demo 是基於', + button: '打開引導' + }, + components: { + documentation: '文檔', + tinymceTips: '富文本是管理後臺一個核心的功能,但同時又是一個有很多坑的地方。在選擇富文本的過程中我也走了不少的彎路,市面上常見的富文本都基本用過了,最終權衡了一下選擇了Tinymce。更詳細的富文本比較和介紹見', + dropzoneTips: '由於我司業務有特殊需求,而且要傳七牛 所以沒用第三方,選擇了自己封裝。代碼非常的簡單,具體代碼你可以在這裡看到 @/components/Dropzone', + stickyTips: '當頁面滾動到預設的位置會吸附在頂部', + backToTopTips1: '頁面滾動到指定位置會在右下角出現返回頂部按鈕', + backToTopTips2: '可自定義按鈕的樣式、show/hide、出現的高度、返回的位置 如需文字提示,可在外部使用Element的el-tooltip元素', + imageUploadTips: '由於我在使用時它只有vue@1版本,而且和mockjs不兼容,所以自己改造了一下,如果大家要使用的話,優先還是使用官方版本。' + }, + table: { + dynamicTips1: '固定表頭, 按照表頭順序排序', + dynamicTips2: '不固定表頭, 按照點擊順序排序', + dragTips1: '默認順序', + dragTips2: '拖拽後順序', + title: '標題', + importance: '重要性', + type: '類型', + remark: '點評', + search: '搜索', + add: '添加', + export: '導出', + reviewer: '審核人', + id: '序號', + date: '時間', + author: '作者', + readings: '閱讀數', + status: '狀態', + actions: '操作', + edit: '編輯', + publish: '發布', + draft: '草稿', + delete: '刪除', + cancel: '取 消', + confirm: '確 定' + }, + errorLog: { + tips: '請點擊右上角bug小圖標', + description: '現在的管理後臺基本都是spa的形式了,它增強了用戶體驗,但同時也會增加頁面出問題的可能性,可能一個小小的疏忽就導致整個頁面的死鎖。好在 Vue 官網提供了一個方法來捕獲處理異常,你可以在其中進行錯誤處理或者異常上報。', + documentation: '文檔介紹' + }, + excel: { + export: '導出', + selectedExport: '導出已選擇項', + placeholder: '請輸入文件名(默認excel-list)' + }, + zip: { + export: '導出', + placeholder: '請輸入文件名(默認file)' + }, + theme: { + change: '換膚', + documentation: '換膚文檔', + tips: 'Tips: 它區別於 navbar 上的 theme-pick, 是兩種不同的換膚方法,各自有不同的應用場景,具體請參考文檔。' + }, + tagsView: { + close: '關閉', + closeOthers: '關閉其它', + closeAll: '關閉所有' + }, + counter: { + online: '在線', + offline: '離線', + all: '全部', + inputDeviceID: '設備 ID', + inputStatus: '狀態', + search: '搜索', + reset: '重置', + detail: '詳情', + map: '地圖', + sn: '序號', + device: '設備ID', + status: '狀態', + count: '計數', + signal: '信號', + energy: '電量', + time: '時間', + date: '日期', + coordinate: '坐標', + action: '操作', + logDesc: '滅蚊器日誌列表', + screen: '顯示屏', + trendChart: '趨勢圖', + region: '地區', + deviceName: '設備名稱', + noName: '未命名', + humitureChart: '溫濕度', + temperature: '溫度', + humidity: '濕度', + to: '至', + logSeachContent: '設備名稱/ID', + start_date: '開始日期', + end_date: '結束日期' + }, + weather: { + online: '在線', + offline: '離線', + all: '全部', + inputDeviceID: '設備 ID', + inputStatus: '狀態', + search: '搜索', + reset: '重置', + detail: '詳情', + map: '地圖', + sn: '序號', + device: '設備ID', + status: '狀態', + count: '計數', + signal: '信號', + energy: '電量', + time: '時間', + date: '日期', + coordinate: '坐標', + action: '操作', + logDesc: '滅蚊器日誌列表', + screen: '顯示屏', + trendChart: '趨勢圖', + region: '地區', + deviceName: '設備名稱', + humitureChart: '溫濕度', + temperature: '溫度', + humidity: '濕度', + to: '至', + logSeachContent: '設備名稱/ID', + start_date: '開始日期', + end_date: '結束日期', + envTemp: '環溫(℃)', + dewPointTemp: '露點溫度(℃)', + envHumi: '環濕(%RH)', + airPressure: '氣壓(hPa)', + totalRadiation1Ins: '總輻射1瞬時(W/㎡)', + windDirection: '風向(°)', + windSpeedIns: '瞬時風速(m/s)', + windSpeed2mins: '2分鐘風速(m/s)', + windSpeed10mins: '10分鐘風速(m/s)', + rainfallIntervalCum: '雨量間隔累計(mm)', + totalRadiation1IntervalCum: '總輻射1間隔累計(MJ/㎡)', + rainfallDailyCum: '雨量日累計(mm)', + totalRadiation1DailyCum: '總輻射1日累計(MJ/㎡)', + power: '電量(%)' + } +} diff --git a/src/lang/index.js b/src/lang/index.js index a36a980..def52e3 100644 --- a/src/lang/index.js +++ b/src/lang/index.js @@ -3,8 +3,10 @@ import VueI18n from 'vue-i18n' import Cookies from 'js-cookie' import elementEnLocale from 'element-ui/lib/locale/lang/en' // element-ui lang import elementZhLocale from 'element-ui/lib/locale/lang/zh-CN'// element-ui lang +import elementHkLocale from 'element-ui/lib/locale/lang/zh-TW'// element-ui lang import enLocale from './en' import zhLocale from './zh' +import hkLocale from './hk' Vue.use(VueI18n) @@ -16,6 +18,10 @@ const messages = { zh: { ...zhLocale, ...elementZhLocale + }, + hk: { + ...hkLocale, + ...elementHkLocale } } diff --git a/src/lang/zh.js b/src/lang/zh.js index f843f01..2563b83 100644 --- a/src/lang/zh.js +++ b/src/lang/zh.js @@ -179,6 +179,7 @@ export default { trendChart: '趋势图', region: '地区', deviceName: '设备名称', + noName: '未命名', humitureChart: '温湿度', temperature: '温度', humidity: '湿度', diff --git a/src/views/counter/components/screen.vue b/src/views/counter/components/screen.vue index 500ab78..0e75aa0 100644 --- a/src/views/counter/components/screen.vue +++ b/src/views/counter/components/screen.vue @@ -4,7 +4,7 @@

{{$t('counter.device')}}: {{deviceID}}

{{$t('counter.deviceName')}}: {{lastItem.device_name}}

-

{{$t('counter.deviceName')}}: 未命名

+

{{$t('counter.deviceName')}}: {{$t('counter.noName')}}

@@ -44,12 +44,48 @@
  • Power: {{lastItem.energy}}
  • +
    +
      +
    • +

      LED开关 + + +

      +
    • +
    • + 计数清零 +
    • +
    +
    + + + + 确定要清零计数器吗? + + 取消 + 确定 + +