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