Commit 763a5927157e80af3f7bf4f4493973bd08c6212f
Merge branch 'ft_local_dev' into 'main'
pref:优化Topic内容 See merge request huang/yun-teng-iot-front!414
Showing
14 changed files
with
200 additions
and
75 deletions
@@ -96,10 +96,6 @@ export function getTenantPage(params: TenantPageRequestParams) { | @@ -96,10 +96,6 @@ export function getTenantPage(params: TenantPageRequestParams) { | ||
96 | return getPageData<TenantDTO>(params, Api.tenantPage); | 96 | return getPageData<TenantDTO>(params, Api.tenantPage); |
97 | } | 97 | } |
98 | 98 | ||
99 | -// export function getTenantAdminPage(params: TenantAdminPageRequestParams) { | ||
100 | -// return getPageData<UserDTO>(params, Api.userPage); | ||
101 | -// } | ||
102 | - | ||
103 | //分页 | 99 | //分页 |
104 | export const getTenantAdminPage = (params: TenantAdminPageRequestParams) => { | 100 | export const getTenantAdminPage = (params: TenantAdminPageRequestParams) => { |
105 | return defHttp.get<TenantAdminPageRequestParams>({ | 101 | return defHttp.get<TenantAdminPageRequestParams>({ |
@@ -40,9 +40,8 @@ export interface TenantPageRequestParams extends BaseQueryParams { | @@ -40,9 +40,8 @@ export interface TenantPageRequestParams extends BaseQueryParams { | ||
40 | 40 | ||
41 | export interface TenantAdminPageRequestParams extends BaseQueryParams { | 41 | export interface TenantAdminPageRequestParams extends BaseQueryParams { |
42 | realName?: string; | 42 | realName?: string; |
43 | - // tenantCode: string; | ||
44 | tenantId?: string; | 43 | tenantId?: string; |
45 | - // roleType?: string; | 44 | + items?: string[]; |
46 | } | 45 | } |
47 | 46 | ||
48 | export interface tenantProfileDTO { | 47 | export interface tenantProfileDTO { |
@@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
25 | > | 25 | > |
26 | <div class="change-avatar" style="text-align: center"> | 26 | <div class="change-avatar" style="text-align: center"> |
27 | <div class="mb-2" style="font-weight: 700">个人头像</div> | 27 | <div class="mb-2" style="font-weight: 700">个人头像</div> |
28 | - <div style="display: flex; align-items: center; justify-content: center; width: 35.6rem"> | 28 | + <div style="display: flex; align-items: center; justify-content: center"> |
29 | <div> | 29 | <div> |
30 | <Upload | 30 | <Upload |
31 | name="avatar" | 31 | name="avatar" |
@@ -265,7 +265,8 @@ | @@ -265,7 +265,8 @@ | ||
265 | transition: border-color 0.3s ease; | 265 | transition: border-color 0.3s ease; |
266 | } | 266 | } |
267 | } | 267 | } |
268 | + | ||
268 | .headSetPop :global(.ant-modal-header) { | 269 | .headSetPop :global(.ant-modal-header) { |
269 | - padding: 27px 0px !important; | 270 | + padding: 27px 0 !important; |
270 | } | 271 | } |
271 | </style> | 272 | </style> |
@@ -18,10 +18,7 @@ | @@ -18,10 +18,7 @@ | ||
18 | <ListItem @click="go('/notice/myNotices')" class="cursor-pointer"> | 18 | <ListItem @click="go('/notice/myNotices')" class="cursor-pointer"> |
19 | <ListItemMeta> | 19 | <ListItemMeta> |
20 | <template #avatar> | 20 | <template #avatar> |
21 | - <Avatar | ||
22 | - :src="item.sysNotice.avatar ?? defaultAvatar(item.receiverId)" | ||
23 | - size="large" | ||
24 | - /> | 21 | + <Avatar :src="item.sysNotice.avatar" size="large" /> |
25 | </template> | 22 | </template> |
26 | <template #description> | 23 | <template #description> |
27 | <span class="cursor-pointer noticeTitle">{{ item.sysNotice.title }} </span> | 24 | <span class="cursor-pointer noticeTitle">{{ item.sysNotice.title }} </span> |
@@ -92,7 +89,7 @@ | @@ -92,7 +89,7 @@ | ||
92 | ? '#e6e6e5' | 89 | ? '#e6e6e5' |
93 | : index === 2 | 90 | : index === 2 |
94 | ? '#f8c296' | 91 | ? '#f8c296' |
95 | - : '#0b55f1;', | 92 | + : '#0b55f1', |
96 | }" | 93 | }" |
97 | >{{ index + 1 }}</span | 94 | >{{ index + 1 }}</span |
98 | > | 95 | > |
@@ -169,7 +166,6 @@ | @@ -169,7 +166,6 @@ | ||
169 | import { BasicTable, useTable } from '/@/components/Table'; | 166 | import { BasicTable, useTable } from '/@/components/Table'; |
170 | import { isAdmin } from '/@/enums/roleEnum'; | 167 | import { isAdmin } from '/@/enums/roleEnum'; |
171 | import { getTenantExpireTimeList, getTenantTop10 } from '/@/api/dashboard'; | 168 | import { getTenantExpireTimeList, getTenantTop10 } from '/@/api/dashboard'; |
172 | - import headerImg from '/@/assets/images/logo.png'; | ||
173 | 169 | ||
174 | export default defineComponent({ | 170 | export default defineComponent({ |
175 | components: { | 171 | components: { |
@@ -257,11 +253,6 @@ | @@ -257,11 +253,6 @@ | ||
257 | }); | 253 | }); |
258 | 254 | ||
259 | const userStore = useUserStore(); | 255 | const userStore = useUserStore(); |
260 | - const defaultAvatar = (uid) => { | ||
261 | - if (uid === userStore.getUserInfo?.userId) { | ||
262 | - return userStore.getUserInfo?.avatar || headerImg; | ||
263 | - } | ||
264 | - }; | ||
265 | const getContacts = computed(() => { | 256 | const getContacts = computed(() => { |
266 | return userStore.enterPriseInfo?.contacts; | 257 | return userStore.enterPriseInfo?.contacts; |
267 | }); | 258 | }); |
@@ -302,7 +293,6 @@ | @@ -302,7 +293,6 @@ | ||
302 | registerTable, | 293 | registerTable, |
303 | isAdmin, | 294 | isAdmin, |
304 | Empty, | 295 | Empty, |
305 | - defaultAvatar, | ||
306 | }; | 296 | }; |
307 | }, | 297 | }, |
308 | }); | 298 | }); |
@@ -199,6 +199,7 @@ export const step2Schemas: FormSchema[] = [ | @@ -199,6 +199,7 @@ export const step2Schemas: FormSchema[] = [ | ||
199 | { | 199 | { |
200 | field: 'transportType', | 200 | field: 'transportType', |
201 | component: 'Select', | 201 | component: 'Select', |
202 | + required: true, | ||
202 | label: '接入协议', | 203 | label: '接入协议', |
203 | defaultValue: 'DEFAULT', | 204 | defaultValue: 'DEFAULT', |
204 | componentProps() { | 205 | componentProps() { |
@@ -454,13 +455,31 @@ export const topicTableColumn: BasicColumn[] = [ | @@ -454,13 +455,31 @@ export const topicTableColumn: BasicColumn[] = [ | ||
454 | width: 100, | 455 | width: 100, |
455 | }, | 456 | }, |
456 | { | 457 | { |
457 | - title: 'Topic类', | ||
458 | - dataIndex: 'class', | 458 | + title: '发布主题', |
459 | + dataIndex: 'release', | ||
459 | width: 100, | 460 | width: 100, |
460 | }, | 461 | }, |
462 | + | ||
461 | { | 463 | { |
462 | - title: '描述', | ||
463 | - dataIndex: 'description', | 464 | + title: '订阅主题', |
465 | + dataIndex: 'subscribe', | ||
464 | width: 100, | 466 | width: 100, |
465 | }, | 467 | }, |
468 | + { | ||
469 | + title: '平台', | ||
470 | + dataIndex: 'platform', | ||
471 | + width: 30, | ||
472 | + }, | ||
473 | + | ||
474 | + { | ||
475 | + title: '设备', | ||
476 | + dataIndex: 'device', | ||
477 | + width: 30, | ||
478 | + }, | ||
479 | + | ||
480 | + // { | ||
481 | + // title: '描述', | ||
482 | + // dataIndex: 'description', | ||
483 | + // width: 100, | ||
484 | + // }, | ||
466 | ]; | 485 | ]; |
1 | <script lang="ts" setup> | 1 | <script lang="ts" setup> |
2 | import { topicTableColumn } from '../device.profile.data'; | 2 | import { topicTableColumn } from '../device.profile.data'; |
3 | import { BasicTable, useTable } from '/@/components/Table'; | 3 | import { BasicTable, useTable } from '/@/components/Table'; |
4 | - import { buildUUID } from '/@/utils/uuid'; | ||
5 | 4 | ||
6 | const list = [ | 5 | const list = [ |
7 | - { function: '遥测主题', class: 'v1/devices/me/telemetry' }, | ||
8 | - { function: '属性主题', class: 'v1/devices/me/attributes' }, | ||
9 | - { function: '设备上报事件主题', class: 'v1/devices/me/attributes' }, | ||
10 | - { function: '服务控制设备(RPC)主题', class: 'v1/devices/me/attributes' }, | 6 | + { |
7 | + function: '网关/直连设备遥测', | ||
8 | + release: 'v1/devices/me/telemetry', | ||
9 | + subscribe: 'v1/devices/me/telemetry', | ||
10 | + platform: '订阅', | ||
11 | + device: '发布', | ||
12 | + }, | ||
13 | + { | ||
14 | + function: '服务端命令下发到设备端', | ||
15 | + release: 'v1/devices/me/rpc/request/$request_id', | ||
16 | + subscribe: 'v1/devices/me/rpc/request/+', | ||
17 | + platform: '发布', | ||
18 | + device: '订阅', | ||
19 | + }, | ||
20 | + { | ||
21 | + function: '设备端响应命令到服务端', | ||
22 | + release: 'v1/devices/me/rpc/response/$request_id', | ||
23 | + subscribe: 'v1/devices/me/rpc/response/+', | ||
24 | + platform: '订阅', | ||
25 | + device: '发布', | ||
26 | + }, | ||
27 | + { | ||
28 | + function: '直连设备属性上报', | ||
29 | + release: 'v1/devices/me/attributes', | ||
30 | + subscribe: 'v1/devices/me/attributes', | ||
31 | + platform: '订阅', | ||
32 | + device: '发布', | ||
33 | + }, | ||
34 | + | ||
35 | + { | ||
36 | + function: '设备端请求服务端共享属性及客户端属性', | ||
37 | + release: 'vv1/devices/me/attributes/response/$request_id', | ||
38 | + subscribe: 'v1/devices/me/attributes/response/+', | ||
39 | + platform: '订阅', | ||
40 | + device: '发布', | ||
41 | + }, | ||
42 | + { | ||
43 | + function: '服务端响应共享属性集客户端属性给设备端', | ||
44 | + release: 'v1/devices/me/attributes/response/$request_id', | ||
45 | + subscribe: 'v1/devices/me/attributes/response/+', | ||
46 | + platform: '发布', | ||
47 | + device: '订阅', | ||
48 | + }, | ||
49 | + { | ||
50 | + function: '设备端请求服务端子设备共享属性及客户端属性', | ||
51 | + release: 'v1/gateway/attributes/request', | ||
52 | + subscribe: 'v1/gateway/attributes/request', | ||
53 | + platform: '订阅', | ||
54 | + device: '发布', | ||
55 | + }, | ||
56 | + { | ||
57 | + function: '服务端响应子设备共享属性及客户端属性给设备端', | ||
58 | + release: 'v1/gateway/attributes/response', | ||
59 | + subscribe: 'v1/gateway/attributes/response', | ||
60 | + platform: '发布', | ||
61 | + device: '订阅', | ||
62 | + }, | ||
63 | + { | ||
64 | + function: '设备端上报子设备客户端属性', | ||
65 | + release: 'v1/gateway/attributes', | ||
66 | + subscribe: 'v1/gateway/attributes', | ||
67 | + platform: '订阅', | ||
68 | + device: '发布', | ||
69 | + }, | ||
70 | + { | ||
71 | + function: '网关子设备遥测', | ||
72 | + release: 'v1/gateway/telemetry', | ||
73 | + subscribe: 'v1/gateway/telemetry', | ||
74 | + platform: '订阅', | ||
75 | + device: '发布', | ||
76 | + }, | ||
11 | ]; | 77 | ]; |
12 | 78 | ||
13 | - const dataSource = Array.from({ length: 10 }, (_, index) => { | ||
14 | - const record = list[index % 4]; | ||
15 | - return { | ||
16 | - id: buildUUID(), | ||
17 | - ...record, | ||
18 | - description: record.function, | ||
19 | - }; | ||
20 | - }); | 79 | + const dataSource = list; |
21 | 80 | ||
22 | const [register] = useTable({ | 81 | const [register] = useTable({ |
23 | title: 'Topic', | 82 | title: 'Topic', |
@@ -37,11 +37,9 @@ | @@ -37,11 +37,9 @@ | ||
37 | import { SelectTypes } from 'ant-design-vue/es/select'; | 37 | import { SelectTypes } from 'ant-design-vue/es/select'; |
38 | import { Select } from 'ant-design-vue'; | 38 | import { Select } from 'ant-design-vue'; |
39 | import { useModal } from '/@/components/Modal'; | 39 | import { useModal } from '/@/components/Modal'; |
40 | - import { useMessage } from '/@/hooks/web/useMessage'; | ||
41 | import { getScriptManageMeList } from '/@/api/scriptmanage/scriptManager'; | 40 | import { getScriptManageMeList } from '/@/api/scriptmanage/scriptManager'; |
42 | import ConverScriptModal from '/@/views/scriptmanage/converscript/ConverScriptModal.vue'; | 41 | import ConverScriptModal from '/@/views/scriptmanage/converscript/ConverScriptModal.vue'; |
43 | 42 | ||
44 | - const { createMessage } = useMessage(); | ||
45 | const selectScript = reactive<Record<'script', Nullable<string>>>({ | 43 | const selectScript = reactive<Record<'script', Nullable<string>>>({ |
46 | script: null, | 44 | script: null, |
47 | }); | 45 | }); |
@@ -91,6 +89,7 @@ | @@ -91,6 +89,7 @@ | ||
91 | openModal(true, { | 89 | openModal(true, { |
92 | isUpdate: false, | 90 | isUpdate: false, |
93 | isTest: true, | 91 | isTest: true, |
92 | + record: selectScript.script, | ||
94 | isText: 'test', | 93 | isText: 'test', |
95 | isTitle: 'test', | 94 | isTitle: 'test', |
96 | }); | 95 | }); |
@@ -98,10 +97,6 @@ | @@ -98,10 +97,6 @@ | ||
98 | }; | 97 | }; |
99 | 98 | ||
100 | const getFormData = () => { | 99 | const getFormData = () => { |
101 | - if (!selectScript.script) { | ||
102 | - createMessage.error('请选择转换脚本'); | ||
103 | - throw '请选择转换脚本'; | ||
104 | - } | ||
105 | const value = { | 100 | const value = { |
106 | ...{ | 101 | ...{ |
107 | scriptId: selectScript.script, | 102 | scriptId: selectScript.script, |
@@ -29,10 +29,12 @@ | @@ -29,10 +29,12 @@ | ||
29 | } from '/@/api/stationnotification/stationnotifyApi'; | 29 | } from '/@/api/stationnotification/stationnotifyApi'; |
30 | import { useMessage } from '/@/hooks/web/useMessage'; | 30 | import { useMessage } from '/@/hooks/web/useMessage'; |
31 | import { Authority } from '/@/components/Authority'; | 31 | import { Authority } from '/@/components/Authority'; |
32 | + import { useUserStore } from '/@/store/modules/user'; | ||
33 | + import headerImg from '/@/assets/images/logo.png'; | ||
32 | 34 | ||
33 | export default defineComponent({ | 35 | export default defineComponent({ |
34 | name: 'ConfigDrawer', | 36 | name: 'ConfigDrawer', |
35 | - components: { BasicDrawer, BasicForm,Authority }, | 37 | + components: { BasicDrawer, BasicForm, Authority }, |
36 | emits: ['success', 'register'], | 38 | emits: ['success', 'register'], |
37 | setup(_, { emit }) { | 39 | setup(_, { emit }) { |
38 | const draftDisable = ref(false); | 40 | const draftDisable = ref(false); |
@@ -62,6 +64,9 @@ | @@ -62,6 +64,9 @@ | ||
62 | setFieldsValue(data.record); | 64 | setFieldsValue(data.record); |
63 | } | 65 | } |
64 | }); | 66 | }); |
67 | + const userStore = useUserStore(); | ||
68 | + const avatar = ref<string | undefined>(''); | ||
69 | + avatar.value = userStore.getUserInfo?.avatar || headerImg; | ||
65 | // 发布通知 | 70 | // 发布通知 |
66 | const handleSend = async () => { | 71 | const handleSend = async () => { |
67 | try { | 72 | try { |
@@ -75,6 +80,7 @@ | @@ -75,6 +80,7 @@ | ||
75 | ...field, | 80 | ...field, |
76 | pointId, | 81 | pointId, |
77 | id: unref(isUpdate) ? unref(noticeId) : undefined, | 82 | id: unref(isUpdate) ? unref(noticeId) : undefined, |
83 | + avatar: avatar.value, | ||
78 | }; | 84 | }; |
79 | await notifyAddLeaseApi(editNotice); | 85 | await notifyAddLeaseApi(editNotice); |
80 | emit('success'); | 86 | emit('success'); |
@@ -106,6 +112,7 @@ | @@ -106,6 +112,7 @@ | ||
106 | ...field, | 112 | ...field, |
107 | pointId, | 113 | pointId, |
108 | id: unref(noticeId), | 114 | id: unref(noticeId), |
115 | + avatar: avatar.value, | ||
109 | }; | 116 | }; |
110 | await notifyAddDraftApi(editDraft); | 117 | await notifyAddDraftApi(editDraft); |
111 | } | 118 | } |
@@ -14,7 +14,12 @@ | @@ -14,7 +14,12 @@ | ||
14 | :rules="[{ required: true, message: ifAdd ? '请输入脚本名称' : '请输入参数' }]" | 14 | :rules="[{ required: true, message: ifAdd ? '请输入脚本名称' : '请输入参数' }]" |
15 | > | 15 | > |
16 | <a-input v-if="ifAdd" v-model:value="scriptForm.name" placeholder="请输入脚本名称" /> | 16 | <a-input v-if="ifAdd" v-model:value="scriptForm.name" placeholder="请输入脚本名称" /> |
17 | - <a-input v-else v-model:value="scriptForm.params" placeholder="请输入参数" /> | 17 | + <a-input |
18 | + @change="handleInputChange" | ||
19 | + v-else | ||
20 | + v-model:value="scriptForm.params" | ||
21 | + placeholder="请输入参数" | ||
22 | + /> | ||
18 | </a-form-item> | 23 | </a-form-item> |
19 | <a-form-item | 24 | <a-form-item |
20 | label="上报数据类型" | 25 | label="上报数据类型" |
@@ -25,6 +30,15 @@ | @@ -25,6 +30,15 @@ | ||
25 | <a-radio-group v-model:value="scriptForm.dataType" :options="typeOptions" /> | 30 | <a-radio-group v-model:value="scriptForm.dataType" :options="typeOptions" /> |
26 | </a-space> | 31 | </a-space> |
27 | </a-form-item> | 32 | </a-form-item> |
33 | + <a-form-item | ||
34 | + label="保存原始数据" | ||
35 | + name="saveOriginalData" | ||
36 | + :rules="[{ required: true, message: '请选择保存原始数据' }]" | ||
37 | + > | ||
38 | + <a-space direction="vertical"> | ||
39 | + <a-radio-group v-model:value="scriptForm.saveOriginalData" :options="originalOptions" /> | ||
40 | + </a-space> | ||
41 | + </a-form-item> | ||
28 | <a-form-item label="脚本内容" :name="ifAdd ? 'convertJs' : 'script'"> | 42 | <a-form-item label="脚本内容" :name="ifAdd ? 'convertJs' : 'script'"> |
29 | <Card title="脚本内容" :bodyStyle="{ padding: 0, height: '280px' }"> | 43 | <Card title="脚本内容" :bodyStyle="{ padding: 0, height: '280px' }"> |
30 | <template #extra> | 44 | <template #extra> |
@@ -74,7 +88,8 @@ | @@ -74,7 +88,8 @@ | ||
74 | import { useMessage } from '/@/hooks/web/useMessage'; | 88 | import { useMessage } from '/@/hooks/web/useMessage'; |
75 | import { findDictItemByCode } from '/@/api/system/dict'; | 89 | import { findDictItemByCode } from '/@/api/system/dict'; |
76 | import { QuestionCircleOutlined } from '@ant-design/icons-vue'; | 90 | import { QuestionCircleOutlined } from '@ant-design/icons-vue'; |
77 | - import { defaultTitle, defaultScriptContent } from './config.data'; | 91 | + import { defaultTitle } from './config.data'; |
92 | + import { nextTick } from 'process'; | ||
78 | 93 | ||
79 | defineEmits(['register']); | 94 | defineEmits(['register']); |
80 | const props = defineProps({ | 95 | const props = defineProps({ |
@@ -88,11 +103,13 @@ | @@ -88,11 +103,13 @@ | ||
88 | params: '', | 103 | params: '', |
89 | output: '', | 104 | output: '', |
90 | dataType: 'HEX', | 105 | dataType: 'HEX', |
106 | + saveOriginalData: 'false', | ||
91 | }); | 107 | }); |
92 | const reportTypeOptions = reactive({ | 108 | const reportTypeOptions = reactive({ |
93 | typeOptions: [], | 109 | typeOptions: [], |
110 | + originalOptions: [], | ||
94 | }); | 111 | }); |
95 | - const { typeOptions } = toRefs(reportTypeOptions); | 112 | + const { typeOptions, originalOptions } = toRefs(reportTypeOptions); |
96 | const { createMessage } = useMessage(); | 113 | const { createMessage } = useMessage(); |
97 | const { clipboardRef, copiedRef } = useCopyToClipboard(); | 114 | const { clipboardRef, copiedRef } = useCopyToClipboard(); |
98 | const aceEditor = ref(); | 115 | const aceEditor = ref(); |
@@ -101,10 +118,17 @@ | @@ -101,10 +118,17 @@ | ||
101 | const res: any = await findDictItemByCode({ | 118 | const res: any = await findDictItemByCode({ |
102 | dictCode: 'report_data_type', | 119 | dictCode: 'report_data_type', |
103 | }); | 120 | }); |
121 | + const resOriginal: any = await findDictItemByCode({ | ||
122 | + dictCode: 'original_data', | ||
123 | + }); | ||
104 | reportTypeOptions.typeOptions = res.map((m) => { | 124 | reportTypeOptions.typeOptions = res.map((m) => { |
105 | return { label: m.itemText, value: m.itemValue }; | 125 | return { label: m.itemText, value: m.itemValue }; |
106 | }); | 126 | }); |
127 | + reportTypeOptions.originalOptions = resOriginal.map((m) => { | ||
128 | + return { label: m.itemText, value: m.itemValue }; | ||
129 | + }); | ||
107 | scriptForm.dataType = 'HEX'; | 130 | scriptForm.dataType = 'HEX'; |
131 | + scriptForm.saveOriginalData = 'false'; | ||
108 | }); | 132 | }); |
109 | // 初始化编辑器 | 133 | // 初始化编辑器 |
110 | const initEditor = (jsScript?: string) => { | 134 | const initEditor = (jsScript?: string) => { |
@@ -121,7 +145,7 @@ | @@ -121,7 +145,7 @@ | ||
121 | enableBasicAutocompletion: true, | 145 | enableBasicAutocompletion: true, |
122 | enableLiveAutocompletion: true, | 146 | enableLiveAutocompletion: true, |
123 | }); | 147 | }); |
124 | - aceEditor.value.setValue(jsScript ?? defaultScriptContent); | 148 | + aceEditor.value.setValue(jsScript); |
125 | beautify(aceEditor.value.session); | 149 | beautify(aceEditor.value.session); |
126 | scriptForm.convertJs = aceEditor.value.getValue(); | 150 | scriptForm.convertJs = aceEditor.value.getValue(); |
127 | }; | 151 | }; |
@@ -154,18 +178,35 @@ | @@ -154,18 +178,35 @@ | ||
154 | } | 178 | } |
155 | } | 179 | } |
156 | if (!value) return; | 180 | if (!value) return; |
181 | + if (scriptForm.params) { | ||
182 | + const trimParams = scriptForm.params.replace(/\s*/g, ''); | ||
183 | + Reflect.set(value, 'params', trimParams); | ||
184 | + } | ||
157 | return { | 185 | return { |
158 | ...value, | 186 | ...value, |
159 | ...{ convertJs: props.ifAdd ? scriptForm.convertJs : null }, | 187 | ...{ convertJs: props.ifAdd ? scriptForm.convertJs : null }, |
160 | ...{ script: !props.ifAdd ? scriptForm.script : null }, | 188 | ...{ script: !props.ifAdd ? scriptForm.script : null }, |
189 | + ...{ saveOriginalData: scriptForm.saveOriginalData === 'false' ? false : true }, | ||
161 | }; | 190 | }; |
162 | }; | 191 | }; |
192 | + const handleInputChange = (e) => { | ||
193 | + const trimParams = e.target.value.replace(/\s*/g, ''); | ||
194 | + Reflect.set(scriptForm, 'params', trimParams); | ||
195 | + }; | ||
163 | const setFormData = (v) => { | 196 | const setFormData = (v) => { |
164 | - for (let i in scriptForm) { | ||
165 | - Reflect.set(scriptForm, i, v[i]); | 197 | + if (v) { |
198 | + for (let i in scriptForm) { | ||
199 | + Reflect.set(scriptForm, i, v[i]); | ||
200 | + } | ||
201 | + nextTick(() => { | ||
202 | + setTimeout(() => { | ||
203 | + scriptForm.saveOriginalData = v.saveOriginalData === false ? 'false' : 'true'; | ||
204 | + scriptForm.dataType = v.dataType; | ||
205 | + }, 500); | ||
206 | + }); | ||
207 | + aceEditor.value.setValue(v.convertJs); | ||
208 | + handleFormat(); | ||
166 | } | 209 | } |
167 | - aceEditor.value.setValue(v.convertJs); | ||
168 | - handleFormat(); | ||
169 | }; | 210 | }; |
170 | const setScriptContentData = (v) => { | 211 | const setScriptContentData = (v) => { |
171 | aceEditor.value.setValue(v); | 212 | aceEditor.value.setValue(v); |
@@ -60,8 +60,10 @@ | @@ -60,8 +60,10 @@ | ||
60 | converScriptRef.value?.setFormData(data.record); | 60 | converScriptRef.value?.setFormData(data.record); |
61 | } | 61 | } |
62 | if (unref(isTitle) == 'test') { | 62 | if (unref(isTitle) == 'test') { |
63 | - // converScriptRef.value?.setScriptContentData(''); | ||
64 | - converScriptRef.value?.setFormData(data.record); | 63 | + if (data.record) { |
64 | + const res = await getScriptManageDetail(data.record); | ||
65 | + converScriptRef.value?.setFormData(res); | ||
66 | + } | ||
65 | } | 67 | } |
66 | setModalProps({ title, showOkBtn: true, showCancelBtn: true, okText }); | 68 | setModalProps({ title, showOkBtn: true, showCancelBtn: true, okText }); |
67 | if (!unref(isUpdate)) { | 69 | if (!unref(isUpdate)) { |
@@ -96,15 +98,15 @@ | @@ -96,15 +98,15 @@ | ||
96 | setTimeout(() => { | 98 | setTimeout(() => { |
97 | closeModal(); | 99 | closeModal(); |
98 | }, 10); | 100 | }, 10); |
101 | + emits('success', { | ||
102 | + res, | ||
103 | + text: isText.value, | ||
104 | + }); | ||
99 | } else { | 105 | } else { |
100 | if (res) { | 106 | if (res) { |
101 | converScriptRef.value?.setScriptOutputData(res?.output || res?.error); | 107 | converScriptRef.value?.setScriptOutputData(res?.output || res?.error); |
102 | } | 108 | } |
103 | } | 109 | } |
104 | - emits('success', { | ||
105 | - res, | ||
106 | - text: isText.value, | ||
107 | - }); | ||
108 | } finally { | 110 | } finally { |
109 | setModalProps({ confirmLoading: false }); | 111 | setModalProps({ confirmLoading: false }); |
110 | } | 112 | } |
1 | import { BasicColumn, FormSchema } from '/@/components/Table'; | 1 | import { BasicColumn, FormSchema } from '/@/components/Table'; |
2 | import moment from 'moment'; | 2 | import moment from 'moment'; |
3 | +import { h } from 'vue'; | ||
3 | 4 | ||
4 | // 表格配置 | 5 | // 表格配置 |
5 | export const columns: BasicColumn[] = [ | 6 | export const columns: BasicColumn[] = [ |
@@ -57,7 +58,20 @@ export const searchFormSchema: FormSchema[] = [ | @@ -57,7 +58,20 @@ export const searchFormSchema: FormSchema[] = [ | ||
57 | }, | 58 | }, |
58 | ]; | 59 | ]; |
59 | 60 | ||
60 | -export const defaultScriptContent = ` | ||
61 | - out.msg= "hello"+params; | ||
62 | - `; | ||
63 | -export const defaultTitle = '格式:' + defaultScriptContent; | 61 | +export const defaultTitle = h('div', { style: 'background:#404040' }, [ |
62 | + h('h3', { style: 'color:white' }, '示例:'), | ||
63 | + h('h3', { style: 'color:white' }, '输入参数:0103040150008D3BBB'), | ||
64 | + h('h3', { style: 'color:white' }, [ | ||
65 | + h( | ||
66 | + 'h3', | ||
67 | + { style: 'color:white' }, | ||
68 | + "脚本内容:out.humidity = (parseInt('0x'+params.substr(6, 4))*0.1).toFixed(2);" | ||
69 | + ), | ||
70 | + h( | ||
71 | + 'h3', | ||
72 | + { style: 'color:white' }, | ||
73 | + "out.temperature = (parseInt('0x'+params.substr(10, 4))*0.1).toFixed(2);" | ||
74 | + ), | ||
75 | + h('h3', { style: 'color:white' }, "输出参数:{'humidity':'33.60','temperature':'14.10'}"), | ||
76 | + ]), | ||
77 | +]); |
@@ -115,6 +115,14 @@ | @@ -115,6 +115,14 @@ | ||
115 | 115 | ||
116 | const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions, resetSelectedRowKeys } = | 116 | const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions, resetSelectedRowKeys } = |
117 | useBatchDelete(deleteScriptManage, handleSuccess, setProps); | 117 | useBatchDelete(deleteScriptManage, handleSuccess, setProps); |
118 | + selectionOptions.rowSelection.getCheckboxProps = (record: Recordable) => { | ||
119 | + // Demo:status为1的选择框禁用 | ||
120 | + if (record.status === 1) { | ||
121 | + return { disabled: true }; | ||
122 | + } else { | ||
123 | + return { disabled: false }; | ||
124 | + } | ||
125 | + }; | ||
118 | 126 | ||
119 | nextTick(() => { | 127 | nextTick(() => { |
120 | setProps(selectionOptions); | 128 | setProps(selectionOptions); |
@@ -147,7 +155,7 @@ | @@ -147,7 +155,7 @@ | ||
147 | if (record) { | 155 | if (record) { |
148 | openModal(true, { | 156 | openModal(true, { |
149 | isUpdate: false, | 157 | isUpdate: false, |
150 | - record, | 158 | + record: record.id, |
151 | isTest: true, | 159 | isTest: true, |
152 | isText: 'test', | 160 | isText: 'test', |
153 | isTitle: 'test', | 161 | isTitle: 'test', |
@@ -12,10 +12,10 @@ | @@ -12,10 +12,10 @@ | ||
12 | > | 12 | > |
13 | <div> | 13 | <div> |
14 | <a-row type="flex"> | 14 | <a-row type="flex"> |
15 | - <a-col :span="2" style="margin-left: 5rem"> | 15 | + <a-col :span="3" style=""> |
16 | <a-input v-model:value="searchInfo.jobName" placeholder="请输入任务名称" /> | 16 | <a-input v-model:value="searchInfo.jobName" placeholder="请输入任务名称" /> |
17 | </a-col> | 17 | </a-col> |
18 | - <a-col :span="4" style="margin-left: 5rem"> | 18 | + <a-col :span="4" style="margin-left: 2rem"> |
19 | <a-select | 19 | <a-select |
20 | allowClear | 20 | allowClear |
21 | v-model:value="searchInfo.jobGroup" | 21 | v-model:value="searchInfo.jobGroup" |
@@ -23,8 +23,7 @@ | @@ -23,8 +23,7 @@ | ||
23 | placeholder="请选择任务组名" | 23 | placeholder="请选择任务组名" |
24 | style="width: 200px" | 24 | style="width: 200px" |
25 | :options="optionGroup" | 25 | :options="optionGroup" |
26 | - > | ||
27 | - </a-select> | 26 | + /> |
28 | </a-col> | 27 | </a-col> |
29 | <a-col :span="4"> | 28 | <a-col :span="4"> |
30 | <a-select | 29 | <a-select |
@@ -33,8 +32,7 @@ | @@ -33,8 +32,7 @@ | ||
33 | placeholder="请选择执行状态" | 32 | placeholder="请选择执行状态" |
34 | style="width: 200px" | 33 | style="width: 200px" |
35 | :options="optionStatus" | 34 | :options="optionStatus" |
36 | - > | ||
37 | - </a-select> | 35 | + /> |
38 | </a-col> | 36 | </a-col> |
39 | <a-col :span="4"> | 37 | <a-col :span="4"> |
40 | <a-range-picker | 38 | <a-range-picker |
@@ -93,7 +93,6 @@ | @@ -93,7 +93,6 @@ | ||
93 | import TenantAdminFormDrawer from './TenantAdminFormDrawer.vue'; | 93 | import TenantAdminFormDrawer from './TenantAdminFormDrawer.vue'; |
94 | import { MessageTypeEnum, SendResetPasswordEmailMsg } from '/@/api/tenant/tenantInfo'; | 94 | import { MessageTypeEnum, SendResetPasswordEmailMsg } from '/@/api/tenant/tenantInfo'; |
95 | import { useMessage } from '/@/hooks/web/useMessage'; | 95 | import { useMessage } from '/@/hooks/web/useMessage'; |
96 | - import { RoleEnum } from '/@/enums/roleEnum'; | ||
97 | import { Authority } from '/@/components/Authority'; | 96 | import { Authority } from '/@/components/Authority'; |
98 | 97 | ||
99 | export default defineComponent({ | 98 | export default defineComponent({ |
@@ -113,17 +112,15 @@ | @@ -113,17 +112,15 @@ | ||
113 | 112 | ||
114 | const tenantId = ref(''); | 113 | const tenantId = ref(''); |
115 | async function handleCreateTenantAdmin() { | 114 | async function handleCreateTenantAdmin() { |
116 | - const { items: getPageData } = await getTenantAdminPage({ | 115 | + const { items } = await getTenantAdminPage({ |
117 | page: 1, | 116 | page: 1, |
118 | pageSize: 1000, | 117 | pageSize: 1000, |
119 | tenantId: tenantId.value, | 118 | tenantId: tenantId.value, |
120 | - roleType: RoleEnum.TENANT_ADMIN, | ||
121 | - tenantCode: '', | ||
122 | }); | 119 | }); |
123 | openTenantAdminFormDrawer(true, { | 120 | openTenantAdminFormDrawer(true, { |
124 | isUpdate: false, | 121 | isUpdate: false, |
125 | tenantId: tenantId.value, | 122 | tenantId: tenantId.value, |
126 | - judgeExistUserName: getPageData, | 123 | + judgeExistUserName: items, |
127 | }); | 124 | }); |
128 | } | 125 | } |
129 | 126 | ||
@@ -192,7 +189,6 @@ | @@ -192,7 +189,6 @@ | ||
192 | showIndexColumn: false, | 189 | showIndexColumn: false, |
193 | searchInfo: { | 190 | searchInfo: { |
194 | tenantId, | 191 | tenantId, |
195 | - // roleType: RoleEnum.TENANT_ADMIN, | ||
196 | }, | 192 | }, |
197 | actionColumn: { | 193 | actionColumn: { |
198 | width: 100, | 194 | width: 100, |