Commit 86b0900c4206322f7bef92e98d1d7609b44734df

Authored by loveumiko
1 parent 3aa5b0f1

fix: 修改租户配置筛选无效 tcp网关子设备命令类型选择

... ... @@ -174,8 +174,7 @@
174 174 const handleFilterOption = async (inputValue: string, option: Recordable) => {
175 175 const { filterOption, fetchSearch } = props;
176 176 if (filterOption && isFunction(filterOption)) {
177   - filterOption?.(inputValue, option);
178   - return;
  177 + return filterOption?.(inputValue, option);
179 178 }
180 179
181 180 if (fetchSearch) {
... ... @@ -189,8 +188,9 @@
189 188 @dropdownVisibleChange="handleFetch"
190 189 v-bind="attrs"
191 190 @change="handleChange"
  191 + @filterOption="handleFilterOption"
192 192 :options="getOptions"
193   - :filterOption="handleFilterOption"
  193 + optionFilterProp="label"
194 194 :showSearch="true"
195 195 v-model:value="state"
196 196 @popup-scroll="debounceHandlePopupScroll"
... ...
... ... @@ -117,7 +117,7 @@
117 117 };
118 118
119 119 const handleCheckCard = (item: ProfileRecord) => {
120   - if (item.default) return;
  120 + if (item.default || item.name == 'default') return;
121 121 item.checked = !item.checked;
122 122 };
123 123
... ...
... ... @@ -31,7 +31,6 @@ export const searchFormSchema: FormSchema[] = [
31 31 field: 'textSearch',
32 32 label: '名称',
33 33 component: 'Input',
34   -
35 34 colProps: { span: 8 },
36 35 componentProps: {
37 36 placeholder: '请输入名称',
... ...
... ... @@ -30,11 +30,6 @@
30 30 icon: 'ant-design:eye-outlined',
31 31 onClick: handleView.bind(null, record),
32 32 },
33   - // {
34   - // label: '详情',
35   - // icon: 'ant-design:field-time-outlined',
36   - // onClick: handleDetail.bind(null, record),
37   - // },
38 33 {
39 34 label: '编辑',
40 35 icon: 'clarity:note-edit-line',
... ... @@ -103,9 +98,6 @@
103 98 import { useRouter } from 'vue-router';
104 99 import { ref } from 'vue';
105 100 import { isObject } from '/@/utils/is';
106   - // import { ChainDetailDrawer } from './chainDetail/index';
107   - // import { useDrawer } from '/@/components/Drawer';
108   -
109 101 const [registerModal, { openModal }] = useModal();
110 102 const { createMessage } = useMessage();
111 103 const { hasPermission } = usePermission();
... ...
... ... @@ -153,6 +153,7 @@
153 153 title: '是否确认删除操作?',
154 154 onConfirm: handleDelete.bind(null),
155 155 },
  156 + disabled: !!getRecord.state,
156 157 },
157 158 ]"
158 159 />
... ...
... ... @@ -293,12 +293,13 @@ export const commonDataSourceSchemas = (): FormSchema[] => {
293 293 (item) => item.itemValue == CommandTypeEnum.ATTRIBUTE.toString()
294 294 );
295 295 }
296   -
297 296 // TCP网关子 --> 不能要服务命令类型
298 297 if (deviceType == 'SENSOR' && transportType == 'TCP') {
299   - return record.filter(
300   - (item) => item.itemValue == CommandTypeEnum.ATTRIBUTE.toString()
301   - );
  298 + return codeType == 'MODBUS_RTU'
  299 + ? record.filter((item) => item.itemValue == CommandTypeEnum.ATTRIBUTE.toString())
  300 + : codeType == 'CUSTOM'
  301 + ? record.filter((item) => item.itemValue == CommandTypeEnum.CUSTOM.toString())
  302 + : [];
302 303 }
303 304
304 305 if (codeType == TaskTypeEnum.MODBUS_RTU) {
... ...