Commit 7a32d197ddd88f9f3a406dfba314fe080af613d4
Merge branch 'f-dev' into 'main'
fix:修复Teambition上的问题, See merge request huang/yun-teng-iot-front!240
Showing
16 changed files
with
235 additions
and
250 deletions
| @@ -21,6 +21,7 @@ enum DeviceManagerApi { | @@ -21,6 +21,7 @@ enum DeviceManagerApi { | ||
| 21 | DEVICE_ALARM_URL = '/alarm', | 21 | DEVICE_ALARM_URL = '/alarm', | 
| 22 | 22 | ||
| 23 | DEVICE_CREDENTIALS = '/device/credentials', | 23 | DEVICE_CREDENTIALS = '/device/credentials', | 
| 24 | + COMMAND_ISSUANCE = '/rpc', | ||
| 24 | } | 25 | } | 
| 25 | 26 | ||
| 26 | export const devicePage = (params: DeviceQueryParam) => { | 27 | export const devicePage = (params: DeviceQueryParam) => { | 
| @@ -207,3 +208,17 @@ export const generateSNCode = () => { | @@ -207,3 +208,17 @@ export const generateSNCode = () => { | ||
| 207 | url: '/device/sn', | 208 | url: '/device/sn', | 
| 208 | }); | 209 | }); | 
| 209 | }; | 210 | }; | 
| 211 | + | ||
| 212 | +//命令下发 | ||
| 213 | +export const commandIssuanceApi = (type, tbDeviceId, data) => { | ||
| 214 | + const T = type === 'OneWay' ? 'oneway' : 'twoway'; | ||
| 215 | + return defHttp.post( | ||
| 216 | + { | ||
| 217 | + url: DeviceManagerApi.COMMAND_ISSUANCE + '/' + T + '/' + tbDeviceId, | ||
| 218 | + data, | ||
| 219 | + }, | ||
| 220 | + { | ||
| 221 | + joinPrefix: false, | ||
| 222 | + } | ||
| 223 | + ); | ||
| 224 | +}; | 
| @@ -31,6 +31,7 @@ | @@ -31,6 +31,7 @@ | ||
| 31 | import { CreateContextOptions } from '/@/components/ContextMenu'; | 31 | import { CreateContextOptions } from '/@/components/ContextMenu'; | 
| 32 | 32 | ||
| 33 | import { CheckEvent } from './typing'; | 33 | import { CheckEvent } from './typing'; | 
| 34 | + import { LeftOutlined, RightOutlined } from '@ant-design/icons-vue'; | ||
| 34 | 35 | ||
| 35 | interface State { | 36 | interface State { | 
| 36 | expandedKeys: Keys; | 37 | expandedKeys: Keys; | 
| @@ -51,6 +52,14 @@ | @@ -51,6 +52,14 @@ | ||
| 51 | 'update:searchValue', | 52 | 'update:searchValue', | 
| 52 | ], | 53 | ], | 
| 53 | setup(props, { attrs, slots, emit, expose }) { | 54 | setup(props, { attrs, slots, emit, expose }) { | 
| 55 | + /** | ||
| 56 | + * 作者自带Tree组件 | ||
| 57 | + * 新增显示隐藏 | ||
| 58 | + * ft | ||
| 59 | + */ | ||
| 60 | + //ft | ||
| 61 | + const isFlod = ref(false); | ||
| 62 | + //ft | ||
| 54 | const state = reactive<State>({ | 63 | const state = reactive<State>({ | 
| 55 | checkStrictly: props.checkStrictly, | 64 | checkStrictly: props.checkStrictly, | 
| 56 | expandedKeys: props.expandedKeys || [], | 65 | expandedKeys: props.expandedKeys || [], | 
| @@ -205,6 +214,7 @@ | @@ -205,6 +214,7 @@ | ||
| 205 | }); | 214 | }); | 
| 206 | 215 | ||
| 207 | function handleSearch(searchValue: string) { | 216 | function handleSearch(searchValue: string) { | 
| 217 | + console.log('searchValue', searchValue); | ||
| 208 | if (searchValue !== searchText.value) searchText.value = searchValue; | 218 | if (searchValue !== searchText.value) searchText.value = searchValue; | 
| 209 | emit('update:searchValue', searchValue); | 219 | emit('update:searchValue', searchValue); | 
| 210 | if (!searchValue) { | 220 | if (!searchValue) { | 
| @@ -223,6 +233,11 @@ | @@ -223,6 +233,11 @@ | ||
| 223 | ); | 233 | ); | 
| 224 | } | 234 | } | 
| 225 | 235 | ||
| 236 | + //ft | ||
| 237 | + function handleFlodOrUnFoldFunc(v) { | ||
| 238 | + isFlod.value = v; | ||
| 239 | + } | ||
| 240 | + //ft | ||
| 226 | function handleClickNode(key: string, children: TreeItem[]) { | 241 | function handleClickNode(key: string, children: TreeItem[]) { | 
| 227 | if (!props.clickRowToExpand || !children || children.length === 0) return; | 242 | if (!props.clickRowToExpand || !children || children.length === 0) return; | 
| 228 | if (!state.expandedKeys.includes(key)) { | 243 | if (!state.expandedKeys.includes(key)) { | 
| @@ -388,9 +403,10 @@ | @@ -388,9 +403,10 @@ | ||
| 388 | const showTitle = title || toolbar || search || slots.headerTitle; | 403 | const showTitle = title || toolbar || search || slots.headerTitle; | 
| 389 | const scrollStyle: CSSProperties = { height: 'calc(100% - 38px)' }; | 404 | const scrollStyle: CSSProperties = { height: 'calc(100% - 38px)' }; | 
| 390 | return ( | 405 | return ( | 
| 391 | - <div class={[prefixCls, 'h-full', attrs.class]}> | 406 | + <div style={isFlod.value ? '' : 'width:0vw'} class={[prefixCls, 'h-full', attrs.class]}> | 
| 392 | {showTitle && ( | 407 | {showTitle && ( | 
| 393 | <TreeHeader | 408 | <TreeHeader | 
| 409 | + style={'position:relative'} | ||
| 394 | checkable={checkable} | 410 | checkable={checkable} | 
| 395 | checkAll={checkAll} | 411 | checkAll={checkAll} | 
| 396 | expandAll={expandAll} | 412 | expandAll={expandAll} | 
| @@ -416,6 +432,28 @@ | @@ -416,6 +432,28 @@ | ||
| 416 | </ScrollContainer> | 432 | </ScrollContainer> | 
| 417 | 433 | ||
| 418 | <Empty v-show={unref(getNotFound)} image={Empty.PRESENTED_IMAGE_SIMPLE} class="!mt-4" /> | 434 | <Empty v-show={unref(getNotFound)} image={Empty.PRESENTED_IMAGE_SIMPLE} class="!mt-4" /> | 
| 435 | + <span | ||
| 436 | + v-show={unref(isFlod)} | ||
| 437 | + onClick={() => handleFlodOrUnFoldFunc(false)} | ||
| 438 | + style={ | ||
| 439 | + isFlod.value | ||
| 440 | + ? 'z-index:9999;cursor:pointer;position:absolute;top:40vh;left:17.5vw' | ||
| 441 | + : 'z-index:9999;cursor:pointer;position:absolute;top:40vh;left:0.5vw' | ||
| 442 | + } | ||
| 443 | + > | ||
| 444 | + <RightOutlined /> | ||
| 445 | + </span> | ||
| 446 | + <span | ||
| 447 | + v-show={!unref(isFlod) && unref(treeDataRef).length != 0} | ||
| 448 | + onClick={() => handleFlodOrUnFoldFunc(true)} | ||
| 449 | + style={ | ||
| 450 | + isFlod.value | ||
| 451 | + ? 'z-index:9999;cursor:pointer;position:absolute;top:40vh;left:17.5vw' | ||
| 452 | + : 'z-index:9999;cursor:pointer;position:absolute;top:40vh;left:0.5vw' | ||
| 453 | + } | ||
| 454 | + > | ||
| 455 | + <LeftOutlined /> | ||
| 456 | + </span> | ||
| 419 | </div> | 457 | </div> | 
| 420 | ); | 458 | ); | 
| 421 | }; | 459 | }; | 
| @@ -6,28 +6,13 @@ | @@ -6,28 +6,13 @@ | ||
| 6 | @select="handleSelect" | 6 | @select="handleSelect" | 
| 7 | style="position: relative" | 7 | style="position: relative" | 
| 8 | ref="organizationIdTreeRef" | 8 | ref="organizationIdTreeRef" | 
| 9 | - :style="[{ width: !isFold ? '0rem' : '20rem' }]" | ||
| 10 | - :class="[!isFold ? 'w-1/4 xl:w-1/1' : 'w-1/4 xl:w-1/5']" | ||
| 11 | /> | 9 | /> | 
| 12 | - <div | ||
| 13 | - style="position: absolute; top: 1.48rem; left: 6.5rem; cursor: pointer" | ||
| 14 | - :style="[{ left: !isFold ? '0.5rem' : '6.5rem' }, { top: !isFold ? '0.8rem' : '1.48rem' }]" | ||
| 15 | - > | ||
| 16 | - <Tooltip v-if="isFold"> | ||
| 17 | - <template #title>隐藏组织</template> | ||
| 18 | - <MenuFoldOutlined @click="changeWidth(true)" /> | ||
| 19 | - </Tooltip> | ||
| 20 | - <Tooltip v-else> | ||
| 21 | - <template #title>打开组织</template> | ||
| 22 | - <MenuUnfoldOutlined @click="changeWidth(false)" /> | ||
| 23 | - </Tooltip> | ||
| 24 | - </div> | ||
| 25 | <BasicTable | 10 | <BasicTable | 
| 11 | + style="flex: auto" | ||
| 26 | @register="registerTable" | 12 | @register="registerTable" | 
| 27 | :searchInfo="searchInfo" | 13 | :searchInfo="searchInfo" | 
| 28 | class="w-3/4 xl:w-4/5" | 14 | class="w-3/4 xl:w-4/5" | 
| 29 | :clickToRowSelect="false" | 15 | :clickToRowSelect="false" | 
| 30 | - :class="[!isFold ? 'w-3/4 xl:w-7/7' : 'w-3/4 xl:w-4/5']" | ||
| 31 | > | 16 | > | 
| 32 | <template #toolbar> | 17 | <template #toolbar> | 
| 33 | <Authority value="api:yt:alarm:profile:post"> | 18 | <Authority value="api:yt:alarm:profile:post"> | 
| @@ -98,7 +83,7 @@ | @@ -98,7 +83,7 @@ | ||
| 98 | </template> | 83 | </template> | 
| 99 | 84 | ||
| 100 | <script lang="ts"> | 85 | <script lang="ts"> | 
| 101 | - import { defineComponent, reactive, h, nextTick, ref } from 'vue'; | 86 | + import { defineComponent, reactive, h, nextTick } from 'vue'; | 
| 102 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 87 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 
| 103 | import { PageWrapper } from '/@/components/Page'; | 88 | import { PageWrapper } from '/@/components/Page'; | 
| 104 | import { useDrawer } from '/@/components/Drawer'; | 89 | import { useDrawer } from '/@/components/Drawer'; | 
| @@ -106,7 +91,7 @@ | @@ -106,7 +91,7 @@ | ||
| 106 | import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree'; | 91 | import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree'; | 
| 107 | import { deleteAlarmConfig, queryAlarmConfig } from '/@/api/alarm/config/alarmConfig'; | 92 | import { deleteAlarmConfig, queryAlarmConfig } from '/@/api/alarm/config/alarmConfig'; | 
| 108 | import { searchFormSchema, columns } from './config.data'; | 93 | import { searchFormSchema, columns } from './config.data'; | 
| 109 | - import { Modal, Tooltip } from 'ant-design-vue'; | 94 | + import { Modal } from 'ant-design-vue'; | 
| 110 | import { JsonPreview } from '/@/components/CodeEditor'; | 95 | import { JsonPreview } from '/@/components/CodeEditor'; | 
| 111 | import { findDictItemByCode } from '/@/api/system/dict'; | 96 | import { findDictItemByCode } from '/@/api/system/dict'; | 
| 112 | import { alarmContactGetPage } from '/@/api/device/deviceConfigApi'; | 97 | import { alarmContactGetPage } from '/@/api/device/deviceConfigApi'; | 
| @@ -115,7 +100,6 @@ | @@ -115,7 +100,6 @@ | ||
| 115 | import { putAlarmConfigStatus } from '/@/api/alarm/config/alarmConfig'; | 100 | import { putAlarmConfigStatus } from '/@/api/alarm/config/alarmConfig'; | 
| 116 | import { useMessage } from '/@/hooks/web/useMessage'; | 101 | import { useMessage } from '/@/hooks/web/useMessage'; | 
| 117 | import { Authority } from '/@/components/Authority'; | 102 | import { Authority } from '/@/components/Authority'; | 
| 118 | - import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons-vue'; | ||
| 119 | 103 | ||
| 120 | export default defineComponent({ | 104 | export default defineComponent({ | 
| 121 | components: { | 105 | components: { | 
| @@ -126,13 +110,8 @@ | @@ -126,13 +110,8 @@ | ||
| 126 | ContactDrawer, | 110 | ContactDrawer, | 
| 127 | Switch, | 111 | Switch, | 
| 128 | Authority, | 112 | Authority, | 
| 129 | - MenuFoldOutlined, | ||
| 130 | - MenuUnfoldOutlined, | ||
| 131 | - Tooltip, | ||
| 132 | }, | 113 | }, | 
| 133 | setup() { | 114 | setup() { | 
| 134 | - const isFold = ref(true); | ||
| 135 | - | ||
| 136 | const searchInfo = reactive<Recordable>({}); | 115 | const searchInfo = reactive<Recordable>({}); | 
| 137 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); | 116 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); | 
| 138 | // 刷新 | 117 | // 刷新 | 
| @@ -260,13 +239,6 @@ | @@ -260,13 +239,6 @@ | ||
| 260 | reload(); | 239 | reload(); | 
| 261 | } | 240 | } | 
| 262 | }; | 241 | }; | 
| 263 | - const changeWidth = (e) => { | ||
| 264 | - if (e) { | ||
| 265 | - isFold.value = false; | ||
| 266 | - } else { | ||
| 267 | - isFold.value = true; | ||
| 268 | - } | ||
| 269 | - }; | ||
| 270 | return { | 242 | return { | 
| 271 | searchInfo, | 243 | searchInfo, | 
| 272 | hasBatchDelete, | 244 | hasBatchDelete, | 
| @@ -280,8 +252,6 @@ | @@ -280,8 +252,6 @@ | ||
| 280 | showAlarmContact, | 252 | showAlarmContact, | 
| 281 | showMessageMode, | 253 | showMessageMode, | 
| 282 | statusChange, | 254 | statusChange, | 
| 283 | - changeWidth, | ||
| 284 | - isFold, | ||
| 285 | }; | 255 | }; | 
| 286 | }, | 256 | }, | 
| 287 | }); | 257 | }); | 
| @@ -2,31 +2,15 @@ | @@ -2,31 +2,15 @@ | ||
| 2 | <div> | 2 | <div> | 
| 3 | <PageWrapper dense contentFullHeight contentClass="flex"> | 3 | <PageWrapper dense contentFullHeight contentClass="flex"> | 
| 4 | <OrganizationIdTree | 4 | <OrganizationIdTree | 
| 5 | - style="position: relative" | ||
| 6 | class="w-1/4 xl:w-1/5" | 5 | class="w-1/4 xl:w-1/5" | 
| 7 | - :style="[{ width: !isFold ? '0rem' : '20rem' }]" | ||
| 8 | - :class="[!isFold ? 'w-1/4 xl:w-1/1' : 'w-1/4 xl:w-1/5']" | ||
| 9 | @select="handleSelect" | 6 | @select="handleSelect" | 
| 10 | ref="organizationIdTreeRef" | 7 | ref="organizationIdTreeRef" | 
| 11 | /> | 8 | /> | 
| 12 | - <div | ||
| 13 | - style="position: absolute; top: 1.48rem; left: 6.5rem; cursor: pointer" | ||
| 14 | - :style="[{ left: !isFold ? '0.5rem' : '6.5rem' }, { top: !isFold ? '0.8rem' : '1.48rem' }]" | ||
| 15 | - > | ||
| 16 | - <Tooltip v-if="isFold"> | ||
| 17 | - <template #title>隐藏组织</template> | ||
| 18 | - <MenuFoldOutlined @click="changeWidth(true)" /> | ||
| 19 | - </Tooltip> | ||
| 20 | - <Tooltip v-else> | ||
| 21 | - <template #title>打开组织</template> | ||
| 22 | - <MenuUnfoldOutlined @click="changeWidth(false)" /> | ||
| 23 | - </Tooltip> | ||
| 24 | - </div> | ||
| 25 | <BasicTable | 9 | <BasicTable | 
| 10 | + style="flex: auto" | ||
| 26 | @register="registerTable" | 11 | @register="registerTable" | 
| 27 | :searchInfo="searchInfo" | 12 | :searchInfo="searchInfo" | 
| 28 | class="w-3/4 xl:w-4/5" | 13 | class="w-3/4 xl:w-4/5" | 
| 29 | - :class="[!isFold ? 'w-3/4 xl:w-7/7' : 'w-3/4 xl:w-4/5']" | ||
| 30 | > | 14 | > | 
| 31 | <template #toolbar> | 15 | <template #toolbar> | 
| 32 | <Authority value="api:yt:alarmContact:post"> | 16 | <Authority value="api:yt:alarmContact:post"> | 
| @@ -82,8 +66,6 @@ | @@ -82,8 +66,6 @@ | ||
| 82 | import { getAlarmContact, deleteAlarmContact } from '/@/api/alarm/contact/alarmContact'; | 66 | import { getAlarmContact, deleteAlarmContact } from '/@/api/alarm/contact/alarmContact'; | 
| 83 | import { searchFormSchema, columns } from './config.data'; | 67 | import { searchFormSchema, columns } from './config.data'; | 
| 84 | import { Authority } from '/@/components/Authority'; | 68 | import { Authority } from '/@/components/Authority'; | 
| 85 | - import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons-vue'; | ||
| 86 | - import { Tooltip } from 'ant-design-vue'; | ||
| 87 | 69 | ||
| 88 | export default defineComponent({ | 70 | export default defineComponent({ | 
| 89 | components: { | 71 | components: { | 
| @@ -93,12 +75,8 @@ | @@ -93,12 +75,8 @@ | ||
| 93 | TableAction, | 75 | TableAction, | 
| 94 | ContactDrawer, | 76 | ContactDrawer, | 
| 95 | Authority, | 77 | Authority, | 
| 96 | - MenuFoldOutlined, | ||
| 97 | - MenuUnfoldOutlined, | ||
| 98 | - Tooltip, | ||
| 99 | }, | 78 | }, | 
| 100 | setup() { | 79 | setup() { | 
| 101 | - const isFold = ref(true); | ||
| 102 | const searchInfo = reactive<Recordable>({}); | 80 | const searchInfo = reactive<Recordable>({}); | 
| 103 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); | 81 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); | 
| 104 | // 表格hooks | 82 | // 表格hooks | 
| @@ -157,13 +135,6 @@ | @@ -157,13 +135,6 @@ | ||
| 157 | searchInfo.organizationId = organizationId; | 135 | searchInfo.organizationId = organizationId; | 
| 158 | handleSuccess(); | 136 | handleSuccess(); | 
| 159 | }; | 137 | }; | 
| 160 | - const changeWidth = (e) => { | ||
| 161 | - if (e) { | ||
| 162 | - isFold.value = false; | ||
| 163 | - } else { | ||
| 164 | - isFold.value = true; | ||
| 165 | - } | ||
| 166 | - }; | ||
| 167 | return { | 138 | return { | 
| 168 | searchInfo, | 139 | searchInfo, | 
| 169 | hasBatchDelete, | 140 | hasBatchDelete, | 
| @@ -174,8 +145,6 @@ | @@ -174,8 +145,6 @@ | ||
| 174 | registerTable, | 145 | registerTable, | 
| 175 | registerDrawer, | 146 | registerDrawer, | 
| 176 | organizationIdTreeRef, | 147 | organizationIdTreeRef, | 
| 177 | - changeWidth, | ||
| 178 | - isFold, | ||
| 179 | }; | 148 | }; | 
| 180 | }, | 149 | }, | 
| 181 | }); | 150 | }); | 
| @@ -6,28 +6,13 @@ | @@ -6,28 +6,13 @@ | ||
| 6 | @select="handleSelect" | 6 | @select="handleSelect" | 
| 7 | ref="organizationIdTreeRef" | 7 | ref="organizationIdTreeRef" | 
| 8 | style="position: relative" | 8 | style="position: relative" | 
| 9 | - :style="[{ width: !isFold ? '0rem' : '20rem' }]" | ||
| 10 | - :class="[!isFold ? 'w-1/4 xl:w-1/1' : 'w-1/4 xl:w-1/5']" | ||
| 11 | /> | 9 | /> | 
| 12 | - <div | ||
| 13 | - style="position: absolute; top: 1.48rem; left: 6.5rem; cursor: pointer" | ||
| 14 | - :style="[{ left: !isFold ? '0.5rem' : '6.5rem' }, { top: !isFold ? '0.8rem' : '1.48rem' }]" | ||
| 15 | - > | ||
| 16 | - <Tooltip v-if="isFold"> | ||
| 17 | - <template #title>隐藏组织</template> | ||
| 18 | - <MenuFoldOutlined @click="changeWidth(true)" /> | ||
| 19 | - </Tooltip> | ||
| 20 | - <Tooltip v-else> | ||
| 21 | - <template #title>打开组织</template> | ||
| 22 | - <MenuUnfoldOutlined @click="changeWidth(false)" /> | ||
| 23 | - </Tooltip> | ||
| 24 | - </div> | ||
| 25 | <BasicTable | 10 | <BasicTable | 
| 11 | + style="flex: auto" | ||
| 26 | :clickToRowSelect="false" | 12 | :clickToRowSelect="false" | 
| 27 | @register="registerTable" | 13 | @register="registerTable" | 
| 28 | :searchInfo="searchInfo" | 14 | :searchInfo="searchInfo" | 
| 29 | class="w-3/4 xl:w-4/5" | 15 | class="w-3/4 xl:w-4/5" | 
| 30 | - :class="[!isFold ? 'w-3/4 xl:w-7/7' : 'w-3/4 xl:w-4/5']" | ||
| 31 | > | 16 | > | 
| 32 | <template #toolbar> | 17 | <template #toolbar> | 
| 33 | <Authority value="api:yt:video:post"> | 18 | <Authority value="api:yt:video:post"> | 
| @@ -92,7 +77,7 @@ | @@ -92,7 +77,7 @@ | ||
| 92 | </template> | 77 | </template> | 
| 93 | 78 | ||
| 94 | <script lang="ts"> | 79 | <script lang="ts"> | 
| 95 | - import { defineComponent, reactive, nextTick, ref } from 'vue'; | 80 | + import { defineComponent, reactive, nextTick } from 'vue'; | 
| 96 | import { BasicTable, useTable, TableAction, TableImg } from '/@/components/Table'; | 81 | import { BasicTable, useTable, TableAction, TableImg } from '/@/components/Table'; | 
| 97 | import { PageWrapper } from '/@/components/Page'; | 82 | import { PageWrapper } from '/@/components/Page'; | 
| 98 | import { useDrawer } from '/@/components/Drawer'; | 83 | import { useDrawer } from '/@/components/Drawer'; | 
| @@ -104,8 +89,6 @@ | @@ -104,8 +89,6 @@ | ||
| 104 | import { useModal } from '/@/components/Modal'; | 89 | import { useModal } from '/@/components/Modal'; | 
| 105 | import { Authority } from '/@/components/Authority'; | 90 | import { Authority } from '/@/components/Authority'; | 
| 106 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; | 91 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; | 
| 107 | - import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons-vue'; | ||
| 108 | - import { Tooltip } from 'ant-design-vue'; | ||
| 109 | 92 | ||
| 110 | export default defineComponent({ | 93 | export default defineComponent({ | 
| 111 | components: { | 94 | components: { | 
| @@ -117,12 +100,8 @@ | @@ -117,12 +100,8 @@ | ||
| 117 | VideoPreviewModal, | 100 | VideoPreviewModal, | 
| 118 | TableImg, | 101 | TableImg, | 
| 119 | Authority, | 102 | Authority, | 
| 120 | - MenuFoldOutlined, | ||
| 121 | - MenuUnfoldOutlined, | ||
| 122 | - Tooltip, | ||
| 123 | }, | 103 | }, | 
| 124 | setup() { | 104 | setup() { | 
| 125 | - const isFold = ref(true); | ||
| 126 | const searchInfo = reactive<Recordable>({}); | 105 | const searchInfo = reactive<Recordable>({}); | 
| 127 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); | 106 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); | 
| 128 | const [registerModal, { openModal }] = useModal(); | 107 | const [registerModal, { openModal }] = useModal(); | 
| @@ -191,13 +170,6 @@ | @@ -191,13 +170,6 @@ | ||
| 191 | record, | 170 | record, | 
| 192 | }); | 171 | }); | 
| 193 | }; | 172 | }; | 
| 194 | - const changeWidth = (e) => { | ||
| 195 | - if (e) { | ||
| 196 | - isFold.value = false; | ||
| 197 | - } else { | ||
| 198 | - isFold.value = true; | ||
| 199 | - } | ||
| 200 | - }; | ||
| 201 | return { | 173 | return { | 
| 202 | searchInfo, | 174 | searchInfo, | 
| 203 | hasBatchDelete, | 175 | hasBatchDelete, | 
| @@ -210,8 +182,6 @@ | @@ -210,8 +182,6 @@ | ||
| 210 | organizationIdTreeRef, | 182 | organizationIdTreeRef, | 
| 211 | handleViewVideo, | 183 | handleViewVideo, | 
| 212 | registerModal, | 184 | registerModal, | 
| 213 | - changeWidth, | ||
| 214 | - isFold, | ||
| 215 | }; | 185 | }; | 
| 216 | }, | 186 | }, | 
| 217 | }); | 187 | }); | 
| @@ -6,28 +6,13 @@ | @@ -6,28 +6,13 @@ | ||
| 6 | @select="handleSelect" | 6 | @select="handleSelect" | 
| 7 | ref="organizationIdTreeRef" | 7 | ref="organizationIdTreeRef" | 
| 8 | style="position: relative" | 8 | style="position: relative" | 
| 9 | - :style="[{ width: !isFold ? '0rem' : '20rem' }]" | ||
| 10 | - :class="[!isFold ? 'w-1/4 xl:w-1/1' : 'w-1/4 xl:w-1/5']" | ||
| 11 | /> | 9 | /> | 
| 12 | - <div | ||
| 13 | - style="position: absolute; top: 1.48rem; left: 6.5rem; cursor: pointer" | ||
| 14 | - :style="[{ left: !isFold ? '0.5rem' : '6.5rem' }, { top: !isFold ? '0.8rem' : '1.48rem' }]" | ||
| 15 | - > | ||
| 16 | - <Tooltip v-if="isFold"> | ||
| 17 | - <template #title>隐藏组织</template> | ||
| 18 | - <MenuFoldOutlined @click="changeWidth(true)" /> | ||
| 19 | - </Tooltip> | ||
| 20 | - <Tooltip v-else> | ||
| 21 | - <template #title>打开组织</template> | ||
| 22 | - <MenuUnfoldOutlined @click="changeWidth(false)" /> | ||
| 23 | - </Tooltip> | ||
| 24 | - </div> | ||
| 25 | <BasicTable | 10 | <BasicTable | 
| 11 | + style="flex: auto" | ||
| 26 | :clickToRowSelect="false" | 12 | :clickToRowSelect="false" | 
| 27 | @register="registerTable" | 13 | @register="registerTable" | 
| 28 | :searchInfo="searchInfo" | 14 | :searchInfo="searchInfo" | 
| 29 | class="w-3/4 xl:w-4/5" | 15 | class="w-3/4 xl:w-4/5" | 
| 30 | - :class="[!isFold ? 'w-3/4 xl:w-7/7' : 'w-3/4 xl:w-4/5']" | ||
| 31 | > | 16 | > | 
| 32 | <template #toolbar> | 17 | <template #toolbar> | 
| 33 | <Authority value="api:yt:admin:addConfiguration"> | 18 | <Authority value="api:yt:admin:addConfiguration"> | 
| @@ -85,7 +70,7 @@ | @@ -85,7 +70,7 @@ | ||
| 85 | </template> | 70 | </template> | 
| 86 | 71 | ||
| 87 | <script lang="ts"> | 72 | <script lang="ts"> | 
| 88 | - import { defineComponent, reactive, nextTick, ref } from 'vue'; | 73 | + import { defineComponent, reactive, nextTick } from 'vue'; | 
| 89 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 74 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 
| 90 | import { PageWrapper } from '/@/components/Page'; | 75 | import { PageWrapper } from '/@/components/Page'; | 
| 91 | import { useDrawer } from '/@/components/Drawer'; | 76 | import { useDrawer } from '/@/components/Drawer'; | 
| @@ -99,8 +84,6 @@ | @@ -99,8 +84,6 @@ | ||
| 99 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; | 84 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; | 
| 100 | import { getAppEnvConfig, isDevMode } from '/@/utils/env'; | 85 | import { getAppEnvConfig, isDevMode } from '/@/utils/env'; | 
| 101 | import { Authority } from '/@/components/Authority'; | 86 | import { Authority } from '/@/components/Authority'; | 
| 102 | - import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons-vue'; | ||
| 103 | - import { Tooltip } from 'ant-design-vue'; | ||
| 104 | 87 | ||
| 105 | export default defineComponent({ | 88 | export default defineComponent({ | 
| 106 | components: { | 89 | components: { | 
| @@ -110,12 +93,8 @@ | @@ -110,12 +93,8 @@ | ||
| 110 | TableAction, | 93 | TableAction, | 
| 111 | ContactDrawer, | 94 | ContactDrawer, | 
| 112 | Authority, | 95 | Authority, | 
| 113 | - MenuFoldOutlined, | ||
| 114 | - MenuUnfoldOutlined, | ||
| 115 | - Tooltip, | ||
| 116 | }, | 96 | }, | 
| 117 | setup() { | 97 | setup() { | 
| 118 | - const isFold = ref(true); | ||
| 119 | const { VITE_GLOB_CONFIGURATION } = getAppEnvConfig(); | 98 | const { VITE_GLOB_CONFIGURATION } = getAppEnvConfig(); | 
| 120 | const isDev = isDevMode(); | 99 | const isDev = isDevMode(); | 
| 121 | const searchInfo = reactive<Recordable>({}); | 100 | const searchInfo = reactive<Recordable>({}); | 
| @@ -191,13 +170,7 @@ | @@ -191,13 +170,7 @@ | ||
| 191 | `${VITE_GLOB_CONFIGURATION}/${isDev ? '?dev=1&' : '?'}configurationId=${record!.id}` | 170 | `${VITE_GLOB_CONFIGURATION}/${isDev ? '?dev=1&' : '?'}configurationId=${record!.id}` | 
| 192 | ); | 171 | ); | 
| 193 | }; | 172 | }; | 
| 194 | - const changeWidth = (e) => { | ||
| 195 | - if (e) { | ||
| 196 | - isFold.value = false; | ||
| 197 | - } else { | ||
| 198 | - isFold.value = true; | ||
| 199 | - } | ||
| 200 | - }; | 173 | + | 
| 201 | return { | 174 | return { | 
| 202 | searchInfo, | 175 | searchInfo, | 
| 203 | hasBatchDelete, | 176 | hasBatchDelete, | 
| @@ -210,8 +183,6 @@ | @@ -210,8 +183,6 @@ | ||
| 210 | registerTable, | 183 | registerTable, | 
| 211 | registerDrawer, | 184 | registerDrawer, | 
| 212 | organizationIdTreeRef, | 185 | organizationIdTreeRef, | 
| 213 | - changeWidth, | ||
| 214 | - isFold, | ||
| 215 | }; | 186 | }; | 
| 216 | }, | 187 | }, | 
| 217 | }); | 188 | }); | 
| @@ -629,3 +629,33 @@ export const TokenSchemas: FormSchema[] = [ | @@ -629,3 +629,33 @@ export const TokenSchemas: FormSchema[] = [ | ||
| 629 | }, | 629 | }, | 
| 630 | }, | 630 | }, | 
| 631 | ]; | 631 | ]; | 
| 632 | + | ||
| 633 | +export const CommandSchemas: FormSchema[] = [ | ||
| 634 | + { | ||
| 635 | + field: 'commandType', | ||
| 636 | + component: 'RadioGroup', | ||
| 637 | + label: '下发类型', | ||
| 638 | + colProps: { | ||
| 639 | + span: 8, | ||
| 640 | + }, | ||
| 641 | + defaultValue: 'OneWay', | ||
| 642 | + componentProps: { | ||
| 643 | + options: [ | ||
| 644 | + { | ||
| 645 | + label: 'OneWay', | ||
| 646 | + value: 'OneWay', | ||
| 647 | + }, | ||
| 648 | + { | ||
| 649 | + label: 'TwoWay', | ||
| 650 | + value: 'TwoWay', | ||
| 651 | + }, | ||
| 652 | + ], | ||
| 653 | + }, | ||
| 654 | + }, | ||
| 655 | + { | ||
| 656 | + field: 'commandValue', | ||
| 657 | + label: '请输入命令内容', | ||
| 658 | + slot: 'commandSlot', | ||
| 659 | + component: 'InputTextArea', | ||
| 660 | + }, | ||
| 661 | +]; | 
| @@ -15,6 +15,9 @@ | @@ -15,6 +15,9 @@ | ||
| 15 | <TabPane key="2" tab="实时数据" v-if="deviceDetail?.deviceType !== 'GATEWAY'"> | 15 | <TabPane key="2" tab="实时数据" v-if="deviceDetail?.deviceType !== 'GATEWAY'"> | 
| 16 | <RealTimeData :deviceDetail="deviceDetail" /> | 16 | <RealTimeData :deviceDetail="deviceDetail" /> | 
| 17 | </TabPane> | 17 | </TabPane> | 
| 18 | + <TabPane key="5" tab="命令下发" v-if="deviceDetail?.deviceType !== 'SENSOR'"> | ||
| 19 | + <CommandIssuance :deviceDetail="deviceDetail" /> | ||
| 20 | + </TabPane> | ||
| 18 | <TabPane key="3" tab="告警"><Alarm :id="deviceDetail.id" /></TabPane> | 21 | <TabPane key="3" tab="告警"><Alarm :id="deviceDetail.id" /></TabPane> | 
| 19 | <TabPane key="4" tab="子设备" v-if="deviceDetail?.deviceType === 'GATEWAY'"> | 22 | <TabPane key="4" tab="子设备" v-if="deviceDetail?.deviceType === 'GATEWAY'"> | 
| 20 | <ChildDevice :fromId="deviceDetail?.tbDeviceId" /> | 23 | <ChildDevice :fromId="deviceDetail?.tbDeviceId" /> | 
| @@ -31,6 +34,7 @@ | @@ -31,6 +34,7 @@ | ||
| 31 | import RealTimeData from '../tabs/RealTimeData.vue'; | 34 | import RealTimeData from '../tabs/RealTimeData.vue'; | 
| 32 | import Alarm from '../tabs/Alarm.vue'; | 35 | import Alarm from '../tabs/Alarm.vue'; | 
| 33 | import ChildDevice from '../tabs/ChildDevice.vue'; | 36 | import ChildDevice from '../tabs/ChildDevice.vue'; | 
| 37 | + import CommandIssuance from '../tabs/CommandIssuance.vue'; | ||
| 34 | import { getDeviceDetail } from '/@/api/device/deviceManager'; | 38 | import { getDeviceDetail } from '/@/api/device/deviceManager'; | 
| 35 | export default defineComponent({ | 39 | export default defineComponent({ | 
| 36 | name: 'DeviceModal', | 40 | name: 'DeviceModal', | 
| @@ -42,6 +46,7 @@ | @@ -42,6 +46,7 @@ | ||
| 42 | RealTimeData, | 46 | RealTimeData, | 
| 43 | Alarm, | 47 | Alarm, | 
| 44 | ChildDevice, | 48 | ChildDevice, | 
| 49 | + CommandIssuance, | ||
| 45 | }, | 50 | }, | 
| 46 | emits: ['reload', 'register'], | 51 | emits: ['reload', 'register'], | 
| 47 | setup() { | 52 | setup() { | 
| 1 | +<template> | ||
| 2 | + <div class="tabs-detail"> | ||
| 3 | + <div class="mt-4"> | ||
| 4 | + <BasicForm @register="registerForm"> | ||
| 5 | + <template #commandSlot> | ||
| 6 | + <div class="flex"> | ||
| 7 | + <div ref="jsoneditorRef" style="height: 100%; width: 100%"></div> | ||
| 8 | + <Tooltip title='{"method":"setGpio","params":{"pin":7,"value":1}}' class="ml-2"> | ||
| 9 | + <QuestionCircleOutlined style="font-size: 1rem" /> | ||
| 10 | + </Tooltip> | ||
| 11 | + </div> | ||
| 12 | + </template> | ||
| 13 | + </BasicForm> | ||
| 14 | + <div> | ||
| 15 | + <Button :disabled="disable" type="primary" @click="handleOk" class="mr-2">确定</Button> | ||
| 16 | + <Button type="default" @click="handleCancel" class="mr-2">重置</Button> | ||
| 17 | + </div> | ||
| 18 | + </div> | ||
| 19 | + </div> | ||
| 20 | +</template> | ||
| 21 | +<script lang="ts"> | ||
| 22 | + import { defineComponent, ref, onMounted, unref, nextTick } from 'vue'; | ||
| 23 | + import { BasicForm, useForm } from '/@/components/Form'; | ||
| 24 | + import { CommandSchemas } from '../../config/data'; | ||
| 25 | + import { commandIssuanceApi } from '/@/api/device/deviceManager'; | ||
| 26 | + import { useMessage } from '/@/hooks/web/useMessage'; | ||
| 27 | + import { Button } from '/@/components/Button'; | ||
| 28 | + import jsoneditor from 'jsoneditor'; | ||
| 29 | + import 'jsoneditor/dist/jsoneditor.min.css'; | ||
| 30 | + import { QuestionCircleOutlined } from '@ant-design/icons-vue'; | ||
| 31 | + import { Tooltip } from 'ant-design-vue'; | ||
| 32 | + | ||
| 33 | + export default defineComponent({ | ||
| 34 | + components: { BasicForm, Button, QuestionCircleOutlined, Tooltip }, | ||
| 35 | + props: { | ||
| 36 | + deviceDetail: { | ||
| 37 | + type: Object, | ||
| 38 | + required: true, | ||
| 39 | + }, | ||
| 40 | + }, | ||
| 41 | + emits: ['register'], | ||
| 42 | + setup(props) { | ||
| 43 | + const { createMessage } = useMessage(); | ||
| 44 | + const jsonData: any = ref({}); | ||
| 45 | + const disable = ref(false); | ||
| 46 | + const [registerForm, { getFieldsValue, validate, resetFields }] = useForm({ | ||
| 47 | + labelWidth: 100, | ||
| 48 | + schemas: CommandSchemas, | ||
| 49 | + labelAlign: 'right', | ||
| 50 | + showSubmitButton: false, | ||
| 51 | + showResetButton: false, | ||
| 52 | + wrapperCol: { | ||
| 53 | + span: 12, | ||
| 54 | + }, | ||
| 55 | + }); | ||
| 56 | + // json 以及初始化JSON | ||
| 57 | + const jsoneditorRef = ref(); | ||
| 58 | + const jsonValue = ref({}); | ||
| 59 | + const jsonInstance = ref(); | ||
| 60 | + onMounted(() => { | ||
| 61 | + nextTick(() => { | ||
| 62 | + let options = { | ||
| 63 | + mode: 'code', | ||
| 64 | + mainMenuBar: false, | ||
| 65 | + statusBar: false, | ||
| 66 | + }; | ||
| 67 | + let editor = new jsoneditor(jsoneditorRef.value, options); | ||
| 68 | + editor.set(jsonValue.value); | ||
| 69 | + jsonInstance.value = editor; | ||
| 70 | + }); | ||
| 71 | + }); | ||
| 72 | + | ||
| 73 | + const handleCancel = () => { | ||
| 74 | + resetFields(); | ||
| 75 | + }; | ||
| 76 | + const handleOk = async () => { | ||
| 77 | + disable.value = true; | ||
| 78 | + // 验证 | ||
| 79 | + const valid = await validate(); | ||
| 80 | + if (!valid) return; | ||
| 81 | + // 收集表单数据 | ||
| 82 | + const field = getFieldsValue(); | ||
| 83 | + jsonData.value = unref(jsonInstance).get(); | ||
| 84 | + jsonData.value.persistent = true; | ||
| 85 | + jsonData.value.additionalInfo = { | ||
| 86 | + cmdType: 'API', | ||
| 87 | + }; | ||
| 88 | + commandIssuanceApi(field.commandType, props.deviceDetail.tbDeviceId, jsonData.value) | ||
| 89 | + .then((res) => { | ||
| 90 | + if (!res) return; | ||
| 91 | + createMessage.success('命令下发成功'); | ||
| 92 | + disable.value = true; | ||
| 93 | + // 请求 | ||
| 94 | + handleCancel(); | ||
| 95 | + }) | ||
| 96 | + .catch((e) => { | ||
| 97 | + if (e?.message) { | ||
| 98 | + createMessage.error(e?.message); | ||
| 99 | + } | ||
| 100 | + }) | ||
| 101 | + .finally(() => { | ||
| 102 | + setTimeout(() => { | ||
| 103 | + disable.value = false; | ||
| 104 | + }, 300); | ||
| 105 | + }); | ||
| 106 | + }; | ||
| 107 | + return { | ||
| 108 | + registerForm, | ||
| 109 | + handleCancel, | ||
| 110 | + handleOk, | ||
| 111 | + disable, | ||
| 112 | + jsonData, | ||
| 113 | + jsoneditorRef, | ||
| 114 | + jsonValue, | ||
| 115 | + jsonInstance, | ||
| 116 | + }; | ||
| 117 | + }, | ||
| 118 | + }); | ||
| 119 | +</script> | ||
| 120 | +<style scoped> | ||
| 121 | + .jsoneditor-transform { | ||
| 122 | + background-position: -144px -96px; | ||
| 123 | + display: none !important; | ||
| 124 | + } | ||
| 125 | +</style> | 
| @@ -4,28 +4,9 @@ | @@ -4,28 +4,9 @@ | ||
| 4 | <OrganizationIdTree | 4 | <OrganizationIdTree | 
| 5 | class="w-1/6 xl:w-1/5" | 5 | class="w-1/6 xl:w-1/5" | 
| 6 | @select="handleSelect" | 6 | @select="handleSelect" | 
| 7 | - :style="[{ width: !isFold ? '0rem' : '20rem' }]" | ||
| 8 | - :class="[!isFold ? 'w-1/4 xl:w-1/1' : 'w-1/4 xl:w-1/5']" | ||
| 9 | ref="organizationIdTreeRef" | 7 | ref="organizationIdTreeRef" | 
| 10 | /> | 8 | /> | 
| 11 | - <div | ||
| 12 | - style="position: absolute; top: 1.48rem; left: 6.5rem; cursor: pointer" | ||
| 13 | - :style="[{ left: !isFold ? '0.5rem' : '6.5rem' }, { top: !isFold ? '0.8rem' : '1.48rem' }]" | ||
| 14 | - > | ||
| 15 | - <Tooltip v-if="isFold"> | ||
| 16 | - <template #title>隐藏组织</template> | ||
| 17 | - <MenuFoldOutlined @click="changeWidth(true)" /> | ||
| 18 | - </Tooltip> | ||
| 19 | - <Tooltip v-else> | ||
| 20 | - <template #title>打开组织</template> | ||
| 21 | - <MenuUnfoldOutlined @click="changeWidth(false)" /> | ||
| 22 | - </Tooltip> | ||
| 23 | - </div> | ||
| 24 | - <BasicTable | ||
| 25 | - @register="registerTable" | ||
| 26 | - class="w-5/6 xl:w-4/5" | ||
| 27 | - :class="[!isFold ? 'w-423 xl:w-423' : 'w-5/6 xl:w-4/5']" | ||
| 28 | - > | 9 | + <BasicTable style="flex: auto" @register="registerTable" class="w-5/6 xl:w-4/5"> | 
| 29 | <template #toolbar> | 10 | <template #toolbar> | 
| 30 | <Authority value="api:yt:device:post"> | 11 | <Authority value="api:yt:device:post"> | 
| 31 | <a-button type="primary" @click="handleCreate" v-if="authBtn(role)"> | 12 | <a-button type="primary" @click="handleCreate" v-if="authBtn(role)"> | 
| @@ -201,11 +182,7 @@ | @@ -201,11 +182,7 @@ | ||
| 201 | import { authBtn } from '/@/enums/roleEnum'; | 182 | import { authBtn } from '/@/enums/roleEnum'; | 
| 202 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; | 183 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; | 
| 203 | import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard'; | 184 | import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard'; | 
| 204 | - import { | ||
| 205 | - QuestionCircleOutlined, | ||
| 206 | - MenuFoldOutlined, | ||
| 207 | - MenuUnfoldOutlined, | ||
| 208 | - } from '@ant-design/icons-vue'; | 185 | + import { QuestionCircleOutlined } from '@ant-design/icons-vue'; | 
| 209 | import { Authority } from '/@/components/Authority'; | 186 | import { Authority } from '/@/components/Authority'; | 
| 210 | 187 | ||
| 211 | export default defineComponent({ | 188 | export default defineComponent({ | 
| @@ -224,12 +201,8 @@ | @@ -224,12 +201,8 @@ | ||
| 224 | QuestionCircleOutlined, | 201 | QuestionCircleOutlined, | 
| 225 | Popover, | 202 | Popover, | 
| 226 | Authority, | 203 | Authority, | 
| 227 | - MenuFoldOutlined, | ||
| 228 | - MenuUnfoldOutlined, | ||
| 229 | }, | 204 | }, | 
| 230 | setup(_) { | 205 | setup(_) { | 
| 231 | - const isFold = ref(true); | ||
| 232 | - | ||
| 233 | const { createMessage } = useMessage(); | 206 | const { createMessage } = useMessage(); | 
| 234 | const go = useGo(); | 207 | const go = useGo(); | 
| 235 | const searchInfo = reactive<Recordable>({}); | 208 | const searchInfo = reactive<Recordable>({}); | 
| @@ -341,13 +314,6 @@ | @@ -341,13 +314,6 @@ | ||
| 341 | createMessage.success('复制成功~'); | 314 | createMessage.success('复制成功~'); | 
| 342 | } | 315 | } | 
| 343 | }; | 316 | }; | 
| 344 | - const changeWidth = (e) => { | ||
| 345 | - if (e) { | ||
| 346 | - isFold.value = false; | ||
| 347 | - } else { | ||
| 348 | - isFold.value = true; | ||
| 349 | - } | ||
| 350 | - }; | ||
| 351 | 317 | ||
| 352 | return { | 318 | return { | 
| 353 | registerTable, | 319 | registerTable, | 
| @@ -372,8 +338,6 @@ | @@ -372,8 +338,6 @@ | ||
| 372 | hasBatchDelete, | 338 | hasBatchDelete, | 
| 373 | handleDeleteOrBatchDelete, | 339 | handleDeleteOrBatchDelete, | 
| 374 | handleReload, | 340 | handleReload, | 
| 375 | - changeWidth, | ||
| 376 | - isFold, | ||
| 377 | }; | 341 | }; | 
| 378 | }, | 342 | }, | 
| 379 | }); | 343 | }); | 
| @@ -105,6 +105,7 @@ | @@ -105,6 +105,7 @@ | ||
| 105 | //TODO-fengtao-设备、属性、条件筛选验证 | 105 | //TODO-fengtao-设备、属性、条件筛选验证 | 
| 106 | const validate = getFieldsValue(); | 106 | const validate = getFieldsValue(); | 
| 107 | if (validate.triggerType == undefined) return createMessage.error('请选择设备触发方式'); | 107 | if (validate.triggerType == undefined) return createMessage.error('请选择设备触发方式'); | 
| 108 | + if (validate.type1 == undefined) return createMessage.error('请选择属性触发方式'); | ||
| 108 | if (validate.device == 'PART') { | 109 | if (validate.device == 'PART') { | 
| 109 | if (validate.entityId == undefined) return createMessage.error('请选择设备'); | 110 | if (validate.entityId == undefined) return createMessage.error('请选择设备'); | 
| 110 | } | 111 | } | 
| @@ -142,6 +142,7 @@ | @@ -142,6 +142,7 @@ | ||
| 142 | let predicateIsRequired = false; | 142 | let predicateIsRequired = false; | 
| 143 | let predicateDoubleIsRequired = false; | 143 | let predicateDoubleIsRequired = false; | 
| 144 | let triggerTypeIsRequired = false; | 144 | let triggerTypeIsRequired = false; | 
| 145 | + let type1IsRequired = false; | ||
| 145 | if (clearRule) { | 146 | if (clearRule) { | 
| 146 | clearRule.some((s) => { | 147 | clearRule.some((s) => { | 
| 147 | if (s.device == 'PART') { | 148 | if (s.device == 'PART') { | 
| @@ -152,6 +153,9 @@ | @@ -152,6 +153,9 @@ | ||
| 152 | if (s.type2 == '' || s.type2 == null) { | 153 | if (s.type2 == '' || s.type2 == null) { | 
| 153 | attrIsRequired = true; | 154 | attrIsRequired = true; | 
| 154 | } | 155 | } | 
| 156 | + if (s.type1 == '' || s.type1 == null) { | ||
| 157 | + type1IsRequired = true; | ||
| 158 | + } | ||
| 155 | if (s.triggerType == '' || s.triggerType == null || s.triggerType == undefined) { | 159 | if (s.triggerType == '' || s.triggerType == null || s.triggerType == undefined) { | 
| 156 | triggerTypeIsRequired = true; | 160 | triggerTypeIsRequired = true; | 
| 157 | } | 161 | } | 
| @@ -179,6 +183,7 @@ | @@ -179,6 +183,7 @@ | ||
| 179 | if (predicateIsRequired) return createMessage.error('请填写条件筛选'); | 183 | if (predicateIsRequired) return createMessage.error('请填写条件筛选'); | 
| 180 | if (predicateDoubleIsRequired) return createMessage.error('请填写条件筛选'); | 184 | if (predicateDoubleIsRequired) return createMessage.error('请填写条件筛选'); | 
| 181 | if (triggerTypeIsRequired) return createMessage.error('请选择设备触发方式'); | 185 | if (triggerTypeIsRequired) return createMessage.error('请选择设备触发方式'); | 
| 186 | + if (type1IsRequired) return createMessage.error('请选择属性触发方式'); | ||
| 182 | //TODO-fengtao-清除告警验证 | 187 | //TODO-fengtao-清除告警验证 | 
| 183 | //TODO-fengtao-设备验证 | 188 | //TODO-fengtao-设备验证 | 
| 184 | const validate = getFieldsValue(); | 189 | const validate = getFieldsValue(); | 
| @@ -5,28 +5,12 @@ | @@ -5,28 +5,12 @@ | ||
| 5 | class="w-1/4 xl:w-1/5" | 5 | class="w-1/4 xl:w-1/5" | 
| 6 | @select="handleSelect" | 6 | @select="handleSelect" | 
| 7 | ref="organizationIdTreeRef" | 7 | ref="organizationIdTreeRef" | 
| 8 | - style="position: relative" | ||
| 9 | - :style="[{ width: !isFold ? '0rem' : '20rem' }]" | ||
| 10 | - :class="[!isFold ? 'w-1/4 xl:w-1/1' : 'w-1/4 xl:w-1/5']" | ||
| 11 | /> | 8 | /> | 
| 12 | - <div | ||
| 13 | - style="position: absolute; top: 1.48rem; left: 6.5rem; cursor: pointer" | ||
| 14 | - :style="[{ left: !isFold ? '0.5rem' : '6.5rem' }, { top: !isFold ? '0.8rem' : '1.48rem' }]" | ||
| 15 | - > | ||
| 16 | - <Tooltip v-if="isFold"> | ||
| 17 | - <template #title>隐藏组织</template> | ||
| 18 | - <MenuFoldOutlined @click="changeWidth(true)" /> | ||
| 19 | - </Tooltip> | ||
| 20 | - <Tooltip v-else> | ||
| 21 | - <template #title>打开组织</template> | ||
| 22 | - <MenuUnfoldOutlined @click="changeWidth(false)" /> | ||
| 23 | - </Tooltip> | ||
| 24 | - </div> | ||
| 25 | <BasicTable | 9 | <BasicTable | 
| 10 | + style="flex: auto" | ||
| 26 | :clickToRowSelect="false" | 11 | :clickToRowSelect="false" | 
| 27 | @register="registerTable" | 12 | @register="registerTable" | 
| 28 | class="w-3/4 xl:w-4/5" | 13 | class="w-3/4 xl:w-4/5" | 
| 29 | - :class="[!isFold ? 'w-3/4 xl:w-7/7' : 'w-3/4 xl:w-4/5']" | ||
| 30 | > | 14 | > | 
| 31 | <template #toolbar> | 15 | <template #toolbar> | 
| 32 | <Authority value="api:yt:user:post"> | 16 | <Authority value="api:yt:user:post"> | 
| @@ -101,7 +85,7 @@ | @@ -101,7 +85,7 @@ | ||
| 101 | </div> | 85 | </div> | 
| 102 | </template> | 86 | </template> | 
| 103 | <script lang="ts"> | 87 | <script lang="ts"> | 
| 104 | - import { defineComponent, reactive, nextTick, ref } from 'vue'; | 88 | + import { defineComponent, reactive, nextTick } from 'vue'; | 
| 105 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 89 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 
| 106 | import { deleteUser, getAccountList } from '/@/api/system/system'; | 90 | import { deleteUser, getAccountList } from '/@/api/system/system'; | 
| 107 | import { PageWrapper } from '/@/components/Page'; | 91 | import { PageWrapper } from '/@/components/Page'; | 
| @@ -113,8 +97,6 @@ | @@ -113,8 +97,6 @@ | ||
| 113 | import { useGo } from '/@/hooks/web/usePage'; | 97 | import { useGo } from '/@/hooks/web/usePage'; | 
| 114 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; | 98 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; | 
| 115 | import { Authority } from '/@/components/Authority'; | 99 | import { Authority } from '/@/components/Authority'; | 
| 116 | - import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons-vue'; | ||
| 117 | - import { Tooltip } from 'ant-design-vue'; | ||
| 118 | 100 | ||
| 119 | export default defineComponent({ | 101 | export default defineComponent({ | 
| 120 | name: 'AccountManagement', | 102 | name: 'AccountManagement', | 
| @@ -126,12 +108,8 @@ | @@ -126,12 +108,8 @@ | ||
| 126 | TableAction, | 108 | TableAction, | 
| 127 | Tag, | 109 | Tag, | 
| 128 | Authority, | 110 | Authority, | 
| 129 | - MenuFoldOutlined, | ||
| 130 | - MenuUnfoldOutlined, | ||
| 131 | - Tooltip, | ||
| 132 | }, | 111 | }, | 
| 133 | setup() { | 112 | setup() { | 
| 134 | - const isFold = ref(true); | ||
| 135 | const go = useGo(); | 113 | const go = useGo(); | 
| 136 | const [registerModal, { openModal }] = useModal(); | 114 | const [registerModal, { openModal }] = useModal(); | 
| 137 | let searchInfo = reactive<Recordable>({}); | 115 | let searchInfo = reactive<Recordable>({}); | 
| @@ -190,13 +168,6 @@ | @@ -190,13 +168,6 @@ | ||
| 190 | function handleView(record: Recordable) { | 168 | function handleView(record: Recordable) { | 
| 191 | go('/system/account_detail/' + record.id); | 169 | go('/system/account_detail/' + record.id); | 
| 192 | } | 170 | } | 
| 193 | - const changeWidth = (e) => { | ||
| 194 | - if (e) { | ||
| 195 | - isFold.value = false; | ||
| 196 | - } else { | ||
| 197 | - isFold.value = true; | ||
| 198 | - } | ||
| 199 | - }; | ||
| 200 | 171 | ||
| 201 | return { | 172 | return { | 
| 202 | registerTable, | 173 | registerTable, | 
| @@ -209,8 +180,6 @@ | @@ -209,8 +180,6 @@ | ||
| 209 | organizationIdTreeRef, | 180 | organizationIdTreeRef, | 
| 210 | hasBatchDelete, | 181 | hasBatchDelete, | 
| 211 | handleDeleteOrBatchDelete, | 182 | handleDeleteOrBatchDelete, | 
| 212 | - changeWidth, | ||
| 213 | - isFold, | ||
| 214 | }; | 183 | }; | 
| 215 | }, | 184 | }, | 
| 216 | }); | 185 | }); | 
| @@ -18,12 +18,6 @@ export const columns: BasicColumn[] = [ | @@ -18,12 +18,6 @@ export const columns: BasicColumn[] = [ | ||
| 18 | width: 120, | 18 | width: 120, | 
| 19 | }, | 19 | }, | 
| 20 | { | 20 | { | 
| 21 | - title: '反馈方式', | ||
| 22 | - dataIndex: 'config', | ||
| 23 | - width: 180, | ||
| 24 | - slots: { customRender: 'config' }, | ||
| 25 | - }, | ||
| 26 | - { | ||
| 27 | title: '添加时间', | 21 | title: '添加时间', | 
| 28 | dataIndex: 'createTime', | 22 | dataIndex: 'createTime', | 
| 29 | width: 180, | 23 | width: 180, | 
| @@ -63,30 +57,6 @@ export const formSchema: FormSchema[] = [ | @@ -63,30 +57,6 @@ export const formSchema: FormSchema[] = [ | ||
| 63 | }, | 57 | }, | 
| 64 | }, | 58 | }, | 
| 65 | { | 59 | { | 
| 66 | - field: 'phone', | ||
| 67 | - label: '手机', | ||
| 68 | - component: 'Input', | ||
| 69 | - componentProps: { | ||
| 70 | - disabled: true, | ||
| 71 | - }, | ||
| 72 | - }, | ||
| 73 | - { | ||
| 74 | - field: 'qq', | ||
| 75 | - label: 'QQ', | ||
| 76 | - component: 'Input', | ||
| 77 | - componentProps: { | ||
| 78 | - disabled: true, | ||
| 79 | - }, | ||
| 80 | - }, | ||
| 81 | - { | ||
| 82 | - field: 'email', | ||
| 83 | - label: '邮箱', | ||
| 84 | - component: 'Input', | ||
| 85 | - componentProps: { | ||
| 86 | - disabled: true, | ||
| 87 | - }, | ||
| 88 | - }, | ||
| 89 | - { | ||
| 90 | field: 'message', | 60 | field: 'message', | 
| 91 | label: '反馈信息', | 61 | label: '反馈信息', | 
| 92 | colProps: { span: 24 }, | 62 | colProps: { span: 24 }, | 
| @@ -13,9 +13,6 @@ | @@ -13,9 +13,6 @@ | ||
| 13 | </a-button> | 13 | </a-button> | 
| 14 | </Authority> | 14 | </Authority> | 
| 15 | </template> | 15 | </template> | 
| 16 | - <template #config="{ record }"> | ||
| 17 | - <a-button type="link" class="ml-2" @click="showData(record)"> 查看反馈方式 </a-button> | ||
| 18 | - </template> | ||
| 19 | <template #action="{ record }"> | 16 | <template #action="{ record }"> | 
| 20 | <TableAction | 17 | <TableAction | 
| 21 | :actions="[ | 18 | :actions="[ | 
| @@ -44,15 +41,13 @@ | @@ -44,15 +41,13 @@ | ||
| 44 | </template> | 41 | </template> | 
| 45 | 42 | ||
| 46 | <script lang="ts"> | 43 | <script lang="ts"> | 
| 47 | - import { defineComponent, reactive, h, nextTick } from 'vue'; | 44 | + import { defineComponent, reactive, nextTick } from 'vue'; | 
| 48 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 45 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 
| 49 | import { useDrawer } from '/@/components/Drawer'; | 46 | import { useDrawer } from '/@/components/Drawer'; | 
| 50 | import FeedbackDrawer from './FeedbackDrawer.vue'; | 47 | import FeedbackDrawer from './FeedbackDrawer.vue'; | 
| 51 | import { feedbackPage, deleteFeedbackManage } from '/@/api/feedback/feedbackManager'; | 48 | import { feedbackPage, deleteFeedbackManage } from '/@/api/feedback/feedbackManager'; | 
| 52 | import { searchFormSchema, columns } from './config.data'; | 49 | import { searchFormSchema, columns } from './config.data'; | 
| 53 | import { useModal } from '/@/components/Modal'; | 50 | import { useModal } from '/@/components/Modal'; | 
| 54 | - import { Modal } from 'ant-design-vue'; | ||
| 55 | - import { JsonPreview } from '/@/components/CodeEditor'; | ||
| 56 | import { Authority } from '/@/components/Authority'; | 51 | import { Authority } from '/@/components/Authority'; | 
| 57 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; | 52 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; | 
| 58 | 53 | ||
| @@ -130,17 +125,6 @@ | @@ -130,17 +125,6 @@ | ||
| 130 | record, | 125 | record, | 
| 131 | }); | 126 | }); | 
| 132 | }; | 127 | }; | 
| 133 | - function showData(record: Recordable) { | ||
| 134 | - if (record.contact) { | ||
| 135 | - Modal.info({ | ||
| 136 | - title: '当前反馈方式', | ||
| 137 | - width: 600, | ||
| 138 | - centered: true, | ||
| 139 | - maskClosable: true, | ||
| 140 | - content: h(JsonPreview, { data: JSON.parse(record.contact) }), | ||
| 141 | - }); | ||
| 142 | - } | ||
| 143 | - } | ||
| 144 | return { | 128 | return { | 
| 145 | searchInfo, | 129 | searchInfo, | 
| 146 | hasBatchDelete, | 130 | hasBatchDelete, | 
| @@ -152,7 +136,6 @@ | @@ -152,7 +136,6 @@ | ||
| 152 | registerDrawer, | 136 | registerDrawer, | 
| 153 | handleViewVideo, | 137 | handleViewVideo, | 
| 154 | registerModal, | 138 | registerModal, | 
| 155 | - showData, | ||
| 156 | }; | 139 | }; | 
| 157 | }, | 140 | }, | 
| 158 | }); | 141 | }); |