Просмотр исходного кода

fix: bug#5077、5062、5060、5046

xieyonghong 3 лет назад
Родитель
Сommit
cfaa99943b

+ 1 - 0
src/components/DashBoard/timePicker.tsx

@@ -72,6 +72,7 @@ export default forwardRef((props: ExtraTimePickerProps, ref) => {
         // @ts-ignore
         <DatePicker.RangePicker
           {...extraProps}
+          allowClear={false}
           showTime={props.showTime}
           value={
             value && [

+ 1 - 1
src/locales/zh-CN/pages.ts

@@ -57,7 +57,7 @@ export default {
   'pages.form.tip.max64': '最多输入64个字符',
   'pages.form.tip.id': '请输入英文或者数字或者-或者_',
   'pages.form.tooltip.id': '若不填写,系统将自动生成唯一ID',
-  'pages.form.tip.existsID': 'ID重复',
+  'pages.form.tip.existsID': '该ID已存在',
   'pages.form.tip.input.props': '请输入{name}',
   'pages.form.tip.select.props': '请选择{name}',
 

+ 2 - 1
src/pages/device/Instance/Detail/Info/index.tsx

@@ -99,7 +99,8 @@ const Info = observer(() => {
               defaultMessage: '注册时间',
             })}
           >
-            {moment(InstanceModel.detail?.registerTime).format('YYYY-MM-DD HH:mm:ss')}
+            {InstanceModel.detail?.registerTime &&
+              moment(InstanceModel.detail?.registerTime).format('YYYY-MM-DD HH:mm:ss')}
           </Descriptions.Item>
           <Descriptions.Item
             label={intl.formatMessage({

+ 3 - 1
src/pages/device/Instance/index.tsx

@@ -250,7 +250,9 @@ const Instance = () => {
       dataIndex: 'registryTime',
       width: '200px',
       valueType: 'dateTime',
-      render: (text: any) => (text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '/'),
+      render: (_: any, row) => {
+        return row.registryTime ? moment(row.registryTime).format('YYYY-MM-DD HH:mm:ss') : '/';
+      },
       sorter: true,
     },
     {

+ 1 - 1
src/pages/device/Product/service.ts

@@ -111,7 +111,7 @@ class Service extends BaseService<ProductItem> {
   public category = () =>
     request(`/${SystemConst.API_BASE}/device/category/_tree?paging=false`, {
       method: 'GET',
-      params: encodeQuery({ sorts: { id: 'desc' } }),
+      params: encodeQuery({ sorts: { sortIndex: 'asc' } }),
     });
 
   public getOrg = () =>

+ 6 - 5
src/pages/rule-engine/Scene/Save/action/device/index.tsx

@@ -25,10 +25,7 @@ enum SourceEnum {
   'relation' = 'relation',
 }
 
-const DefaultSourceOptions = [
-  { label: '固定设备', value: SourceEnum.fixed },
-  { label: '按标签', value: SourceEnum.tag },
-];
+const DefaultSourceOptions = [{ label: '固定设备', value: SourceEnum.fixed }];
 
 export enum MessageTypeEnum {
   'WRITE_PROPERTY' = 'WRITE_PROPERTY',
@@ -82,7 +79,11 @@ export default (props: DeviceProps) => {
   useEffect(() => {
     props.form?.resetFields([['actions', name, 'device', 'selector']]);
     if (props.triggerType === 'device') {
-      setSourceList([...DefaultSourceOptions, { label: '按关系', value: SourceEnum.relation }]);
+      setSourceList([
+        ...DefaultSourceOptions,
+        { label: '按关系', value: SourceEnum.relation },
+        { label: '按标签', value: SourceEnum.tag },
+      ]);
     } else {
       setSourceList(DefaultSourceOptions);
     }