wzyyy 3 лет назад
Родитель
Сommit
02141a9d11

+ 1 - 1
config/defaultSettings.ts

@@ -15,7 +15,7 @@ const Settings: LayoutSettings & {
   fixedHeader: false,
   fixSiderbar: true,
   colorWeak: false,
-  title: 'Jetlinks',
+  title: '',
   pwa: false,
   logo: '/logo.svg',
   iconfontUrl: '/icons/iconfont.js',

+ 1 - 1
src/app.tsx

@@ -200,7 +200,7 @@ export const request: RequestConfig = {
 
 // ProLayout 支持的api https://procomponents.ant.design/components/layout
 export const layout: RunTimeLayoutConfig = ({ initialState }) => {
-  console.log({ ...initialState });
+  // console.log({ ...initialState });
   return {
     navTheme: 'light',
     headerTheme: 'light',

+ 2 - 0
src/pages/link/Channel/Opcua/Access/addPoint/index.tsx

@@ -27,6 +27,7 @@ const AddPoint = (props: Props) => {
               name: name,
               deviceId: props.deviceId,
               opcUaId: props.opcUaId,
+              calculateType: 'number',
               configuration: {
                 initialValue: formData.initialValue,
                 multiple: formData.multiple,
@@ -66,6 +67,7 @@ const AddPoint = (props: Props) => {
             name: name,
             deviceId: props.deviceId,
             opcUaId: props.opcUaId,
+            calculateType: 'number',
             configuration: {
               initialValue: formData.initialValue,
               multiple: formData.multiple,

+ 11 - 2
src/pages/system/Basis/index.less

@@ -1,9 +1,18 @@
 .content {
   margin-left: 30px;
+  .text::before {
+    display: inline-block;
+    margin-right: 4px;
+    color: #ff4d4f;
+    font-size: 14px;
+    font-family: SimSun, sans-serif;
+    line-height: 1;
+    content: '*';
+  }
   :global {
     .ant-upload.ant-upload-select-picture-card {
-      width: 150px;
-      height: 150px;
+      width: 205px;
+      height: 205px;
     }
   }
 }

+ 26 - 9
src/pages/system/Basis/index.tsx

@@ -54,12 +54,19 @@ const Basis = () => {
   const detail = async (data: any) => {
     const res = await service.detail(data);
     if (res.status === 200) {
-      setImageUrl(res.result?.[0].properties.logo);
-      form.setFieldsValue(res.result?.[0].properties);
+      const basis = res.result?.filter((item: any) => item.scope === 'basis');
+      const api = res?.result.filter((item: any) => item.scope === 'api');
+      // console.log(basis?.[0])
+      setImageUrl(basis[0].properties?.logo);
+      form.setFieldsValue({
+        title: basis[0].properties.title,
+        headerTheme: basis[0].properties.headerTheme,
+        apikey: api[0].properties.api,
+      });
       setInitialState({
         ...initialState,
         settings: {
-          ...res.result?.[0].properties,
+          ...basis[0].properties,
         },
       });
     }
@@ -71,16 +78,23 @@ const Basis = () => {
         {
           scope: 'basis',
           properties: {
-            ...formData,
-            headerTheme: formData.navTheme,
+            title: formData.title,
+            headerTheme: formData.headerTheme,
+            navTheme: formData.headerTheme,
             logo: imageUrl,
           },
         },
+        {
+          scope: 'api',
+          properties: {
+            api: formData.apikey,
+          },
+        },
       ];
       const res = await service.save(item);
       if (res.status === 200) {
         message.success('保存成功');
-        detail(['basis']);
+        detail(['basis', 'api']);
       }
     } else {
       message.error('请上传图片');
@@ -89,7 +103,7 @@ const Basis = () => {
 
   useEffect(() => {
     console.log(initialState);
-    detail(['basis']);
+    detail(['basis', 'api']);
   }, []);
 
   return (
@@ -113,7 +127,7 @@ const Basis = () => {
               </Form.Item>
               <Form.Item
                 label="主题色"
-                name="navTheme"
+                name="headerTheme"
                 rules={[{ required: true, message: '请选择主题色' }]}
               >
                 <Select>
@@ -131,7 +145,10 @@ const Basis = () => {
             </Form>
           </div>
           <div className={styles.content}>
-            <div style={{ marginBottom: 8 }}>系统logo</div>
+            <div style={{ marginBottom: 8, display: 'flex' }}>
+              系统logo
+              <div className={styles.text}></div>
+            </div>
             <Upload {...uploadProps}>
               {imageUrl ? (
                 <img src={imageUrl} alt="avatar" style={{ width: '100%', height: '100%' }} />

+ 1 - 1
src/pages/user/Login/service.ts

@@ -52,7 +52,7 @@ const Service = {
       method: 'GET',
       params,
     }),
-  settingDetail: (data?: any) =>
+  settingDetail: (data: any) =>
     request(`/${SystemConst.API_BASE}/system/config/scopes`, {
       method: 'POST',
       data,