Commit 84d019c37a6a2f55954f2819417afa2bd205fab3

Authored by xp.Huang
2 parents b5f1369a eb0992b5

Merge branch 'd-ww' into 'main'

fix: device list not found device image will throw error && add git commit hook

See merge request huang/yun-teng-iot-front!339
  1 +module.exports = {
  2 + '*.{js,jsx,ts,tsx}': ['eslint --fix', 'prettier --write'],
  3 + '{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': ['prettier --write--parser json'],
  4 + 'package.json': ['prettier --write'],
  5 + '*.vue': ['eslint --fix', 'prettier --write', 'stylelint --fix'],
  6 + '*.{scss,less,styl,html}': ['stylelint --fix', 'prettier --write'],
  7 + '*.md': ['prettier --write'],
  8 +};
  1 +#!/usr/bin/env sh
  2 +. "$(dirname -- "$0")/_/husky.sh"
  3 +
  4 +npm run lint:lint-staged
@@ -28,9 +28,9 @@ @@ -28,9 +28,9 @@
28 :showBadge="false" 28 :showBadge="false"
29 :simpleShow="true" 29 :simpleShow="true"
30 :imgList=" 30 :imgList="
31 - typeof record.deviceInfo.avatar !== 'undefined' &&  
32 - record.deviceInfo.avatar !== '' &&  
33 - record.deviceInfo.avatar != null 31 + typeof record?.deviceInfo?.avatar !== 'undefined' &&
  32 + record?.deviceInfo?.avatar !== '' &&
  33 + record?.deviceInfo?.avatar != null
34 ? [record.deviceInfo.avatar] 34 ? [record.deviceInfo.avatar]
35 : null 35 : null
36 " 36 "
@@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
44 </div> 44 </div>
45 </div> 45 </div>
46 <div v-else style="display: flex; justify-content: center; align-items: center"> 46 <div v-else style="display: flex; justify-content: center; align-items: center">
47 - <div style="position: relative; left: 0rem; top: 3rem">暂无数据</div> 47 + <div style="position: relative; left: 0; top: 3rem">暂无数据</div>
48 </div> 48 </div>
49 </Spin> 49 </Spin>
50 </div> 50 </div>
@@ -78,7 +78,7 @@ @@ -78,7 +78,7 @@
78 defineEmits(['register']); 78 defineEmits(['register']);
79 const heightNum = ref(800); 79 const heightNum = ref(800);
80 80
81 - let currentRecord: ExecuteReportRecord = {}; 81 + let currentRecord: ExecuteReportRecord = {} as unknown as ExecuteReportRecord;
82 82
83 const chartInstance = ref< 83 const chartInstance = ref<
84 { device: string; name: string; attributes: string[]; active?: string }[] 84 { device: string; name: string; attributes: string[]; active?: string }[]
@@ -265,6 +265,7 @@ @@ -265,6 +265,7 @@
265 </script> 265 </script>
266 <style lang="less" scoped> 266 <style lang="less" scoped>
267 @import url('./ReportPreviewModal.less'); 267 @import url('./ReportPreviewModal.less');
  268 +
268 .chart-style { 269 .chart-style {
269 display: flex; 270 display: flex;
270 flex-wrap: wrap; 271 flex-wrap: wrap;
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 import { DropMenu } from '/@/components/Dropdown'; 3 import { DropMenu } from '/@/components/Dropdown';
4 import Dropdown from '/@/components/Dropdown/src/Dropdown.vue'; 4 import Dropdown from '/@/components/Dropdown/src/Dropdown.vue';
5 import { Tooltip } from 'ant-design-vue'; 5 import { Tooltip } from 'ant-design-vue';
6 - import SvgIcon from '/@/components/Icon/src/SvgIcon.vue'; 6 + // import SvgIcon from '/@/components/Icon/src/SvgIcon.vue';
7 import { isBataBoardSharePage, MoreActionEvent } from '../../config/config'; 7 import { isBataBoardSharePage, MoreActionEvent } from '../../config/config';
8 import { computed } from '@vue/reactivity'; 8 import { computed } from '@vue/reactivity';
9 import { usePermission } from '/@/hooks/web/usePermission'; 9 import { usePermission } from '/@/hooks/web/usePermission';
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 const props = defineProps<{ 14 const props = defineProps<{
15 id: string; 15 id: string;
16 record: DataSource[]; 16 record: DataSource[];
17 - panelName: string; 17 + panelName?: string;
18 }>(); 18 }>();
19 const { hasPermission } = usePermission(); 19 const { hasPermission } = usePermission();
20 const dropMenuList = computed<DropMenu[]>(() => { 20 const dropMenuList = computed<DropMenu[]>(() => {