From b5f20f19c575338d8ade38bc7947938f36bb3ccf Mon Sep 17 00:00:00 2001 From: Silent YANG Date: Tue, 30 Jan 2024 22:14:55 +0800 Subject: [PATCH] update --- src/components/navbar/index.vue | 5 +- src/router/routes/modules/list.ts | 40 +++- src/utils/serial.js | 1 + src/views/guide/f117/index.vue | 4 +- src/views/list/flash/components/card-wrap.vue | 204 ++++++++++++++++++ .../flash/components/quality-inspection.vue | 115 ++++++++++ .../list/flash/components/rules-preset.vue | 51 +++++ .../list/flash/components/the-service.vue | 57 +++++ src/views/list/flash/index.vue | 152 +++++++++++++ src/views/list/flash/locale/en-US.ts | 19 ++ src/views/list/flash/locale/zh-CN.ts | 19 ++ src/views/list/flash/mock.ts | 186 ++++++++++++++++ src/views/list/image/components/card-wrap.vue | 204 ++++++++++++++++++ .../image/components/quality-inspection.vue | 115 ++++++++++ .../list/image/components/rules-preset.vue | 51 +++++ .../list/image/components/the-service.vue | 57 +++++ src/views/list/image/index.vue | 170 +++++++++++++++ src/views/list/image/locale/en-US.ts | 19 ++ src/views/list/image/locale/zh-CN.ts | 19 ++ src/views/list/image/mock.ts | 186 ++++++++++++++++ 20 files changed, 1662 insertions(+), 12 deletions(-) create mode 100644 src/views/list/flash/components/card-wrap.vue create mode 100644 src/views/list/flash/components/quality-inspection.vue create mode 100644 src/views/list/flash/components/rules-preset.vue create mode 100644 src/views/list/flash/components/the-service.vue create mode 100644 src/views/list/flash/index.vue create mode 100644 src/views/list/flash/locale/en-US.ts create mode 100644 src/views/list/flash/locale/zh-CN.ts create mode 100644 src/views/list/flash/mock.ts create mode 100644 src/views/list/image/components/card-wrap.vue create mode 100644 src/views/list/image/components/quality-inspection.vue create mode 100644 src/views/list/image/components/rules-preset.vue create mode 100644 src/views/list/image/components/the-service.vue create mode 100644 src/views/list/image/index.vue create mode 100644 src/views/list/image/locale/en-US.ts create mode 100644 src/views/list/image/locale/zh-CN.ts create mode 100644 src/views/list/image/mock.ts diff --git a/src/components/navbar/index.vue b/src/components/navbar/index.vue index d243083..d0b5dd9 100644 --- a/src/components/navbar/index.vue +++ b/src/components/navbar/index.vue @@ -10,7 +10,7 @@ :style="{ margin: 0, fontSize: '18px' }" :heading="5" > - K5Web 网页小工具 + K5Web 工具箱 { if(appStore.connectState == false){ + try{ + if(appStore.connectPort)await disconnect(appStore.connectPort); + }catch{} const _connect = await connect(); if(!_connect){ diff --git a/src/router/routes/modules/list.ts b/src/router/routes/modules/list.ts index 631d249..4f462be 100644 --- a/src/router/routes/modules/list.ts +++ b/src/router/routes/modules/list.ts @@ -12,16 +12,6 @@ const LIST: AppRouteRecordRaw = { order: 2, }, children: [ - { - path: 'chi', - name: 'Chi', - component: () => import('@/views/list/chi/index.vue'), - meta: { - locale: '字库写入', - requiresAuth: true, - roles: ['*'], - }, - }, { path: 'backup', name: 'Backup', @@ -32,6 +22,36 @@ const LIST: AppRouteRecordRaw = { roles: ['*'], }, }, + { + path: 'flash', + name: 'Flash', + component: () => import('@/views/list/flash/index.vue'), + meta: { + locale: '固件升级', + requiresAuth: true, + roles: ['*'], + }, + }, + { + path: 'image', + name: 'Image', + component: () => import('@/views/list/image/index.vue'), + meta: { + locale: '开机图片', + requiresAuth: true, + roles: ['*'], + }, + }, + { + path: 'chi', + name: 'Chi', + component: () => import('@/views/list/chi/index.vue'), + meta: { + locale: '字库写入', + requiresAuth: true, + roles: ['*'], + }, + }, ], }; diff --git a/src/utils/serial.js b/src/utils/serial.js index bd3d027..50fb14b 100644 --- a/src/utils/serial.js +++ b/src/utils/serial.js @@ -1252,6 +1252,7 @@ export { check_eeprom, eeprom_write, flash_flashFirmware, + flash_generateCommand, unpackVersion, unpack } \ No newline at end of file diff --git a/src/views/guide/f117/index.vue b/src/views/guide/f117/index.vue index 684d817..4f26824 100644 --- a/src/views/guide/f117/index.vue +++ b/src/views/guide/f117/index.vue @@ -259,7 +259,9 @@ const iFlashIt = async () => { await sendPacket(_connect, _data); await readPacket(_connect, 0x18) await flash_flashFirmware(_connect, unpack(binary)) - appStore.updateSettings({ connectPort: _connect }); + if(appStore.connectPort){ + appStore.updateSettings({ connectPort: _connect }); + } state.flashIt = true state.loading = false } diff --git a/src/views/list/flash/components/card-wrap.vue b/src/views/list/flash/components/card-wrap.vue new file mode 100644 index 0000000..9b876d8 --- /dev/null +++ b/src/views/list/flash/components/card-wrap.vue @@ -0,0 +1,204 @@ + + + + + diff --git a/src/views/list/flash/components/quality-inspection.vue b/src/views/list/flash/components/quality-inspection.vue new file mode 100644 index 0000000..88167b6 --- /dev/null +++ b/src/views/list/flash/components/quality-inspection.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/src/views/list/flash/components/rules-preset.vue b/src/views/list/flash/components/rules-preset.vue new file mode 100644 index 0000000..e5a2878 --- /dev/null +++ b/src/views/list/flash/components/rules-preset.vue @@ -0,0 +1,51 @@ + + + + + diff --git a/src/views/list/flash/components/the-service.vue b/src/views/list/flash/components/the-service.vue new file mode 100644 index 0000000..2f4748e --- /dev/null +++ b/src/views/list/flash/components/the-service.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/src/views/list/flash/index.vue b/src/views/list/flash/index.vue new file mode 100644 index 0000000..a4f4395 --- /dev/null +++ b/src/views/list/flash/index.vue @@ -0,0 +1,152 @@ + + + + + + + diff --git a/src/views/list/flash/locale/en-US.ts b/src/views/list/flash/locale/en-US.ts new file mode 100644 index 0000000..6b0681e --- /dev/null +++ b/src/views/list/flash/locale/en-US.ts @@ -0,0 +1,19 @@ +export default { + 'menu.list.cardList': 'Card List', + 'cardList.tab.title.all': 'All', + 'cardList.tab.title.content': 'Quality Inspection', + 'cardList.tab.title.service': 'The service', + 'cardList.tab.title.preset': 'Rules Preset', + 'cardList.searchInput.placeholder': 'Search', + 'cardList.enable': 'Enable', + 'cardList.disable': 'Disable', + 'cardList.content.delete': 'Delete', + 'cardList.content.inspection': 'Inspection', + 'cardList.content.action': 'Click Create Qc Content queue', + 'cardList.service.open': 'Open', + 'cardList.service.cancel': 'Cancel', + 'cardList.service.renew': 'Contract of service', + 'cardList.service.tag': 'Opened', + 'cardList.service.expiresTag': 'Expired', + 'cardList.preset.tag': 'Enable', +}; diff --git a/src/views/list/flash/locale/zh-CN.ts b/src/views/list/flash/locale/zh-CN.ts new file mode 100644 index 0000000..0cd29e7 --- /dev/null +++ b/src/views/list/flash/locale/zh-CN.ts @@ -0,0 +1,19 @@ +export default { + 'menu.list.cardList': '卡片列表', + 'cardList.tab.title.all': '全部', + 'cardList.tab.title.content': '内容质检', + 'cardList.tab.title.service': '开通服务', + 'cardList.tab.title.preset': '规则预置', + 'cardList.searchInput.placeholder': '搜索', + // 'cardList.statistic.enable': '已启用', + // 'cardList.statistic.disable': '未启用', + 'cardList.content.delete': '删除', + 'cardList.content.inspection': '质检', + 'cardList.content.action': '点击创建质检内容队列', + 'cardList.service.open': '开通服务', + 'cardList.service.cancel': '取消服务', + 'cardList.service.renew': '续约服务', + 'cardList.service.tag': '已开通', + 'cardList.service.expiresTag': '已过期', + 'cardList.preset.tag': '已启用', +}; diff --git a/src/views/list/flash/mock.ts b/src/views/list/flash/mock.ts new file mode 100644 index 0000000..68cf096 --- /dev/null +++ b/src/views/list/flash/mock.ts @@ -0,0 +1,186 @@ +import Mock from 'mockjs'; +import setupMock, { successResponseWrap } from '@/utils/setup-mock'; +import { ServiceRecord } from '@/api/list'; + +const qualityInspectionList: ServiceRecord[] = [ + { + id: 1, + name: 'quality', + title: '视频类-历史导入', + description: '2021-10-12 00:00:00', + data: [ + { + label: '待质检数', + value: '120', + }, + { + label: '积压时长', + value: '60s', + }, + { + label: '待抽检数', + value: '0', + }, + ], + }, + { + id: 2, + name: 'quality', + title: '图文类-图片版权', + description: '2021-12-11 18:30:00', + data: [ + { + label: '待质检数', + value: '120', + }, + { + label: '积压时长', + value: '60s', + }, + { + label: '待抽检数', + value: '0', + }, + ], + }, + { + id: 3, + name: 'quality', + title: '图文类-高清图片', + description: '2021-10-15 08:10:00', + data: [ + { + label: '待质检数', + value: '120', + }, + { + label: '积压时长', + value: '60s', + }, + { + label: '待抽检数', + value: '0', + }, + ], + }, +]; +const theServiceList: ServiceRecord[] = [ + { + id: 1, + icon: 'code', + title: '漏斗分析', + description: + '用户行为分析之漏斗分析模型是企业实现精细化运营、进行用户行为分析的重要数据分析模型。', + enable: true, + actionType: 'button', + }, + { + id: 2, + icon: 'edit', + title: '用户分布', + description: + '快速诊断用户人群,地域细分情况,了解数据分布的集中度,以及主要的数据分布的区间段是什么。', + enable: true, + actionType: 'button', + expires: true, + }, + { + id: 3, + icon: 'user', + title: '资源分发', + description: + '移动端动态化资源分发解决方案。提供稳定大流量服务支持、灵活定制的分发圈选规则,通过离线化预加载。', + enable: false, + actionType: 'button', + }, + { + id: 4, + icon: 'user', + title: '用户画像分析', + description: + '用户画像就是将典型用户信息标签化,根据用户特征、业务场景和用户行为等信息,构建一个标签化的用户模型。', + enable: true, + actionType: 'button', + }, +]; +const rulesPresetList: ServiceRecord[] = [ + { + id: 1, + title: '内容屏蔽规则', + description: + '用户在执行特定的内容分发任务时,可使用内容屏蔽规则根据特定标签,过滤内容集合。', + enable: true, + actionType: 'switch', + }, + { + id: 2, + title: '内容置顶规则', + description: + '该规则支持用户在执行特定内容分发任务时,对固定的几条内容置顶。', + enable: true, + actionType: 'switch', + }, + { + id: 3, + title: '内容加权规则', + description: '选定内容加权规则后可自定义从不同内容集合获取内容的概率。', + enable: false, + actionType: 'switch', + }, + { + id: 4, + title: '内容分发规则', + description: '内容分发时,对某些内容需要固定在C端展示的位置。', + enable: true, + actionType: 'switch', + }, + { + id: 5, + title: '违禁内容识别', + description: '精准识别赌博、刀枪、毒品、造假、贩假等违规物品和违规行为。', + enable: false, + actionType: 'switch', + }, + { + id: 6, + title: '多语言文字符号识别', + description: + '精准识别英语、维语、藏语、蒙古语、朝鲜语等多种语言以及emoji表情形态的语义识别。', + enable: false, + actionType: 'switch', + }, +]; + +setupMock({ + setup() { + // Quality Inspection + Mock.mock(new RegExp('/api/list/quality-inspection'), () => { + return successResponseWrap( + qualityInspectionList.map((_, index) => ({ + ...qualityInspectionList[index % qualityInspectionList.length], + id: Mock.Random.guid(), + })) + ); + }); + + // the service + Mock.mock(new RegExp('/api/list/the-service'), () => { + return successResponseWrap( + theServiceList.map((_, index) => ({ + ...theServiceList[index % theServiceList.length], + id: Mock.Random.guid(), + })) + ); + }); + + // rules preset + Mock.mock(new RegExp('/api/list/rules-preset'), () => { + return successResponseWrap( + rulesPresetList.map((_, index) => ({ + ...rulesPresetList[index % rulesPresetList.length], + id: Mock.Random.guid(), + })) + ); + }); + }, +}); diff --git a/src/views/list/image/components/card-wrap.vue b/src/views/list/image/components/card-wrap.vue new file mode 100644 index 0000000..9b876d8 --- /dev/null +++ b/src/views/list/image/components/card-wrap.vue @@ -0,0 +1,204 @@ + + + + + diff --git a/src/views/list/image/components/quality-inspection.vue b/src/views/list/image/components/quality-inspection.vue new file mode 100644 index 0000000..88167b6 --- /dev/null +++ b/src/views/list/image/components/quality-inspection.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/src/views/list/image/components/rules-preset.vue b/src/views/list/image/components/rules-preset.vue new file mode 100644 index 0000000..e5a2878 --- /dev/null +++ b/src/views/list/image/components/rules-preset.vue @@ -0,0 +1,51 @@ + + + + + diff --git a/src/views/list/image/components/the-service.vue b/src/views/list/image/components/the-service.vue new file mode 100644 index 0000000..2f4748e --- /dev/null +++ b/src/views/list/image/components/the-service.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/src/views/list/image/index.vue b/src/views/list/image/index.vue new file mode 100644 index 0000000..319ae76 --- /dev/null +++ b/src/views/list/image/index.vue @@ -0,0 +1,170 @@ + + + + + + + diff --git a/src/views/list/image/locale/en-US.ts b/src/views/list/image/locale/en-US.ts new file mode 100644 index 0000000..6b0681e --- /dev/null +++ b/src/views/list/image/locale/en-US.ts @@ -0,0 +1,19 @@ +export default { + 'menu.list.cardList': 'Card List', + 'cardList.tab.title.all': 'All', + 'cardList.tab.title.content': 'Quality Inspection', + 'cardList.tab.title.service': 'The service', + 'cardList.tab.title.preset': 'Rules Preset', + 'cardList.searchInput.placeholder': 'Search', + 'cardList.enable': 'Enable', + 'cardList.disable': 'Disable', + 'cardList.content.delete': 'Delete', + 'cardList.content.inspection': 'Inspection', + 'cardList.content.action': 'Click Create Qc Content queue', + 'cardList.service.open': 'Open', + 'cardList.service.cancel': 'Cancel', + 'cardList.service.renew': 'Contract of service', + 'cardList.service.tag': 'Opened', + 'cardList.service.expiresTag': 'Expired', + 'cardList.preset.tag': 'Enable', +}; diff --git a/src/views/list/image/locale/zh-CN.ts b/src/views/list/image/locale/zh-CN.ts new file mode 100644 index 0000000..0cd29e7 --- /dev/null +++ b/src/views/list/image/locale/zh-CN.ts @@ -0,0 +1,19 @@ +export default { + 'menu.list.cardList': '卡片列表', + 'cardList.tab.title.all': '全部', + 'cardList.tab.title.content': '内容质检', + 'cardList.tab.title.service': '开通服务', + 'cardList.tab.title.preset': '规则预置', + 'cardList.searchInput.placeholder': '搜索', + // 'cardList.statistic.enable': '已启用', + // 'cardList.statistic.disable': '未启用', + 'cardList.content.delete': '删除', + 'cardList.content.inspection': '质检', + 'cardList.content.action': '点击创建质检内容队列', + 'cardList.service.open': '开通服务', + 'cardList.service.cancel': '取消服务', + 'cardList.service.renew': '续约服务', + 'cardList.service.tag': '已开通', + 'cardList.service.expiresTag': '已过期', + 'cardList.preset.tag': '已启用', +}; diff --git a/src/views/list/image/mock.ts b/src/views/list/image/mock.ts new file mode 100644 index 0000000..68cf096 --- /dev/null +++ b/src/views/list/image/mock.ts @@ -0,0 +1,186 @@ +import Mock from 'mockjs'; +import setupMock, { successResponseWrap } from '@/utils/setup-mock'; +import { ServiceRecord } from '@/api/list'; + +const qualityInspectionList: ServiceRecord[] = [ + { + id: 1, + name: 'quality', + title: '视频类-历史导入', + description: '2021-10-12 00:00:00', + data: [ + { + label: '待质检数', + value: '120', + }, + { + label: '积压时长', + value: '60s', + }, + { + label: '待抽检数', + value: '0', + }, + ], + }, + { + id: 2, + name: 'quality', + title: '图文类-图片版权', + description: '2021-12-11 18:30:00', + data: [ + { + label: '待质检数', + value: '120', + }, + { + label: '积压时长', + value: '60s', + }, + { + label: '待抽检数', + value: '0', + }, + ], + }, + { + id: 3, + name: 'quality', + title: '图文类-高清图片', + description: '2021-10-15 08:10:00', + data: [ + { + label: '待质检数', + value: '120', + }, + { + label: '积压时长', + value: '60s', + }, + { + label: '待抽检数', + value: '0', + }, + ], + }, +]; +const theServiceList: ServiceRecord[] = [ + { + id: 1, + icon: 'code', + title: '漏斗分析', + description: + '用户行为分析之漏斗分析模型是企业实现精细化运营、进行用户行为分析的重要数据分析模型。', + enable: true, + actionType: 'button', + }, + { + id: 2, + icon: 'edit', + title: '用户分布', + description: + '快速诊断用户人群,地域细分情况,了解数据分布的集中度,以及主要的数据分布的区间段是什么。', + enable: true, + actionType: 'button', + expires: true, + }, + { + id: 3, + icon: 'user', + title: '资源分发', + description: + '移动端动态化资源分发解决方案。提供稳定大流量服务支持、灵活定制的分发圈选规则,通过离线化预加载。', + enable: false, + actionType: 'button', + }, + { + id: 4, + icon: 'user', + title: '用户画像分析', + description: + '用户画像就是将典型用户信息标签化,根据用户特征、业务场景和用户行为等信息,构建一个标签化的用户模型。', + enable: true, + actionType: 'button', + }, +]; +const rulesPresetList: ServiceRecord[] = [ + { + id: 1, + title: '内容屏蔽规则', + description: + '用户在执行特定的内容分发任务时,可使用内容屏蔽规则根据特定标签,过滤内容集合。', + enable: true, + actionType: 'switch', + }, + { + id: 2, + title: '内容置顶规则', + description: + '该规则支持用户在执行特定内容分发任务时,对固定的几条内容置顶。', + enable: true, + actionType: 'switch', + }, + { + id: 3, + title: '内容加权规则', + description: '选定内容加权规则后可自定义从不同内容集合获取内容的概率。', + enable: false, + actionType: 'switch', + }, + { + id: 4, + title: '内容分发规则', + description: '内容分发时,对某些内容需要固定在C端展示的位置。', + enable: true, + actionType: 'switch', + }, + { + id: 5, + title: '违禁内容识别', + description: '精准识别赌博、刀枪、毒品、造假、贩假等违规物品和违规行为。', + enable: false, + actionType: 'switch', + }, + { + id: 6, + title: '多语言文字符号识别', + description: + '精准识别英语、维语、藏语、蒙古语、朝鲜语等多种语言以及emoji表情形态的语义识别。', + enable: false, + actionType: 'switch', + }, +]; + +setupMock({ + setup() { + // Quality Inspection + Mock.mock(new RegExp('/api/list/quality-inspection'), () => { + return successResponseWrap( + qualityInspectionList.map((_, index) => ({ + ...qualityInspectionList[index % qualityInspectionList.length], + id: Mock.Random.guid(), + })) + ); + }); + + // the service + Mock.mock(new RegExp('/api/list/the-service'), () => { + return successResponseWrap( + theServiceList.map((_, index) => ({ + ...theServiceList[index % theServiceList.length], + id: Mock.Random.guid(), + })) + ); + }); + + // rules preset + Mock.mock(new RegExp('/api/list/rules-preset'), () => { + return successResponseWrap( + rulesPresetList.map((_, index) => ({ + ...rulesPresetList[index % rulesPresetList.length], + id: Mock.Random.guid(), + })) + ); + }); + }, +});