Commit bdcebf7f6be8ec0997abce417f29b5faed9d8d55

Authored by xp.Huang
2 parents 69cad71c 448c9535

Merge branch 'ft_local_dev' into 'main'

pref:优化部分内容

See merge request huang/yun-teng-iot-front!419
@@ -8,13 +8,13 @@ export const columns: BasicColumn[] = [ @@ -8,13 +8,13 @@ export const columns: BasicColumn[] = [
8 { 8 {
9 title: '状态', 9 title: '状态',
10 dataIndex: 'deviceState', 10 dataIndex: 'deviceState',
11 - width: 120, 11 + width: 80,
12 slots: { customRender: 'deviceState' }, 12 slots: { customRender: 'deviceState' },
13 }, 13 },
14 { 14 {
15 title: '设备图片', 15 title: '设备图片',
16 dataIndex: 'deviceInfo.avatar', 16 dataIndex: 'deviceInfo.avatar',
17 - width: 120, 17 + width: 80,
18 slots: { customRender: 'img' }, 18 slots: { customRender: 'img' },
19 }, 19 },
20 { 20 {
@@ -34,34 +34,36 @@ export const columns: BasicColumn[] = [ @@ -34,34 +34,36 @@ export const columns: BasicColumn[] = [
34 { 34 {
35 title: '所属产品', 35 title: '所属产品',
36 dataIndex: 'deviceProfile.name', 36 dataIndex: 'deviceProfile.name',
37 - width: 160, 37 + width: 180,
38 slots: { customRender: 'deviceProfile' }, 38 slots: { customRender: 'deviceProfile' },
39 ellipsis: true, 39 ellipsis: true,
40 }, 40 },
41 { 41 {
42 title: '所属组织', 42 title: '所属组织',
43 dataIndex: 'organizationDTO.name', 43 dataIndex: 'organizationDTO.name',
  44 + width: 100,
44 }, 45 },
45 { 46 {
46 title: '客户', 47 title: '客户',
47 dataIndex: 'customerName', 48 dataIndex: 'customerName',
  49 + width: 100,
48 }, 50 },
49 { 51 {
50 title: '标签', 52 title: '标签',
51 dataIndex: 'label', 53 dataIndex: 'label',
52 - width: 180, 54 + width: 100,
53 }, 55 },
54 { 56 {
55 title: '最后连接时间', 57 title: '最后连接时间',
56 dataIndex: 'lastOnlineTime', 58 dataIndex: 'lastOnlineTime',
57 format: (text) => text && formatToDate(text, 'YYYY-MM-DD HH:mm:ss'), 59 format: (text) => text && formatToDate(text, 'YYYY-MM-DD HH:mm:ss'),
58 - width: 180, 60 + width: 160,
59 }, 61 },
60 { 62 {
61 title: '最后断开时间', 63 title: '最后断开时间',
62 dataIndex: 'lastOfflineTime', 64 dataIndex: 'lastOfflineTime',
63 format: (text) => text && formatToDate(text, 'YYYY-MM-DD HH:mm:ss'), 65 format: (text) => text && formatToDate(text, 'YYYY-MM-DD HH:mm:ss'),
64 - width: 180, 66 + width: 160,
65 }, 67 },
66 ]; 68 ];
67 69
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 <template #commandSlot> 5 <template #commandSlot>
6 <div class="flex"> 6 <div class="flex">
7 <div ref="jsoneditorRef" style="height: 100%; width: 100%"></div> 7 <div ref="jsoneditorRef" style="height: 100%; width: 100%"></div>
  8 + <a-button style="margin: -5px 0" type="text" @click="handlePremitter">格式化</a-button>
8 <Tooltip title='{"method":"methodThingskit","params":{"pin":7,"value":1}}' class="ml-2"> 9 <Tooltip title='{"method":"methodThingskit","params":{"pin":7,"value":1}}' class="ml-2">
9 <QuestionCircleOutlined style="font-size: 1rem" /> 10 <QuestionCircleOutlined style="font-size: 1rem" />
10 </Tooltip> 11 </Tooltip>
@@ -77,7 +78,11 @@ @@ -77,7 +78,11 @@
77 jsonInstance.value = editor; 78 jsonInstance.value = editor;
78 }); 79 });
79 }); 80 });
80 - 81 + const handlePremitter = () => {
  82 + const value = unref(jsonInstance).get();
  83 + if (!value) return;
  84 + return unref(jsonInstance).set(value);
  85 + };
81 const handleCancel = () => { 86 const handleCancel = () => {
82 resetFields(); 87 resetFields();
83 unref(jsonInstance).set({}); 88 unref(jsonInstance).set({});
@@ -135,6 +140,7 @@ @@ -135,6 +140,7 @@
135 jsoneditorRef, 140 jsoneditorRef,
136 jsonValue, 141 jsonValue,
137 jsonInstance, 142 jsonInstance,
  143 + handlePremitter,
138 }; 144 };
139 }, 145 },
140 }); 146 });
@@ -2,9 +2,9 @@ @@ -2,9 +2,9 @@
2 <div style="background-color: #f0f2f5" class="dark:bg-dark-900"> 2 <div style="background-color: #f0f2f5" class="dark:bg-dark-900">
3 <BasicTable @register="registerTable" class="dark:bg-dark-900"> 3 <BasicTable @register="registerTable" class="dark:bg-dark-900">
4 <template #toolbar> 4 <template #toolbar>
5 - <Authority value="api:yt:smsLog:export"> 5 + <!-- <Authority value="api:yt:smsLog:export">
6 <a-button type="primary" @click="handleCreate"> 导出 </a-button> 6 <a-button type="primary" @click="handleCreate"> 导出 </a-button>
7 - </Authority> 7 + </Authority> -->
8 <Authority value="api:yt:smsLog:delete"> 8 <Authority value="api:yt:smsLog:delete">
9 <Popconfirm 9 <Popconfirm
10 title="您确定要批量删除数据" 10 title="您确定要批量删除数据"
@@ -2,9 +2,9 @@ @@ -2,9 +2,9 @@
2 <div style="background-color: #f0f2f5" class="dark:bg-dark-900"> 2 <div style="background-color: #f0f2f5" class="dark:bg-dark-900">
3 <BasicTable @register="registerTable" class="dark:bg-dark-900"> 3 <BasicTable @register="registerTable" class="dark:bg-dark-900">
4 <template #toolbar> 4 <template #toolbar>
5 - <Authority value="api:yt:smsLog:export"> 5 + <!-- <Authority value="api:yt:smsLog:export">
6 <a-button type="primary" @click="handleExport"> 导出 </a-button> 6 <a-button type="primary" @click="handleExport"> 导出 </a-button>
7 - </Authority> 7 + </Authority> -->
8 <Authority value="api:yt:smsLog:delete"> 8 <Authority value="api:yt:smsLog:delete">
9 <Popconfirm 9 <Popconfirm
10 title="您确定要批量删除数据" 10 title="您确定要批量删除数据"
@@ -8,12 +8,12 @@ export const columns: BasicColumn[] = [ @@ -8,12 +8,12 @@ export const columns: BasicColumn[] = [
8 { 8 {
9 title: '模板名称', 9 title: '模板名称',
10 dataIndex: 'templateName', 10 dataIndex: 'templateName',
11 - width: 200, 11 + width: 150,
12 }, 12 },
13 { 13 {
14 title: '配置名称', 14 title: '配置名称',
15 dataIndex: 'messageConfig.configName', 15 dataIndex: 'messageConfig.configName',
16 - width: 180, 16 + width: 120,
17 slots: { customRender: 'config' }, 17 slots: { customRender: 'config' },
18 }, 18 },
19 { 19 {
@@ -133,7 +133,7 @@ @@ -133,7 +133,7 @@
133 }); 133 });
134 }); 134 });
135 // 初始化编辑器 135 // 初始化编辑器
136 - const initEditor = (jsScript?: string) => { 136 + const initEditor = () => {
137 aceEditor.value = ace.edit(aceRef.value, { 137 aceEditor.value = ace.edit(aceRef.value, {
138 maxLines: 12, // 最大行数,超过会自动出现滚动条 138 maxLines: 12, // 最大行数,超过会自动出现滚动条
139 minLines: 12, // 最小行数,还未到最大行数时,编辑器会自动伸缩大小 139 minLines: 12, // 最小行数,还未到最大行数时,编辑器会自动伸缩大小
@@ -147,7 +147,7 @@ @@ -147,7 +147,7 @@
147 enableBasicAutocompletion: true, 147 enableBasicAutocompletion: true,
148 enableLiveAutocompletion: true, 148 enableLiveAutocompletion: true,
149 }); 149 });
150 - aceEditor.value.setValue(jsScript); 150 + aceEditor.value.setValue();
151 beautify(aceEditor.value.session); 151 beautify(aceEditor.value.session);
152 scriptForm.convertJs = aceEditor.value.getValue(); 152 scriptForm.convertJs = aceEditor.value.getValue();
153 }; 153 };
@@ -46,7 +46,7 @@ @@ -46,7 +46,7 @@
46 isText.value = data.isText; 46 isText.value = data.isText;
47 isTitle.value = data.isTitle; 47 isTitle.value = data.isTitle;
48 editData.data = data.record; 48 editData.data = data.record;
49 - converScriptRef.value?.initEditor(data.record?.configuration?.jsScript); 49 + converScriptRef.value?.initEditor();
50 setModalProps({ loading: false }); 50 setModalProps({ loading: false });
51 if (!unref(isViewDetail)) { 51 if (!unref(isViewDetail)) {
52 const title = 52 const title =
@@ -66,6 +66,8 @@ @@ -66,6 +66,8 @@
66 if (data.record) { 66 if (data.record) {
67 const res = await getScriptManageDetail(data.record); 67 const res = await getScriptManageDetail(data.record);
68 converScriptRef.value?.setFormData(res); 68 converScriptRef.value?.setFormData(res);
  69 + } else {
  70 + converScriptRef.value?.setDefaultRadio('HEX', 'true');
69 } 71 }
70 } 72 }
71 setModalProps({ title, showOkBtn: true, showCancelBtn: true, okText }); 73 setModalProps({ title, showOkBtn: true, showCancelBtn: true, okText });