6 Коммиты 4256e9ca73 ... 95677c7b63

Автор SHA1 Сообщение Дата
  IsaacNoga 95677c7b63 Merge remote-tracking branch 'origin/desarrollo' into indev месяцев назад: 10
  IsaacNoga 1846d3ecea seteador de niveles месяцев назад: 10
  Jose Cienfuegos 877c074493 Se agrego modulo nivel месяцев назад: 10
  OscarGil03 cb3c3ef394 corrección estilos wysywyg месяцев назад: 10
  OscarGil03 03267d89a4 Wysywyg condicionantes месяцев назад: 10
  OscarGil03 752afd3d1f Edición municipios месяцев назад: 11

+ 12 - 0
src/components/DefaultLayout.jsx

@@ -0,0 +1,12 @@
+import { Layout } from "antd";
+import React from "react";
+
+const DefaultLayout = ({ children }) => {
+  return (
+    <Layout style={{ backgroundColor: "white", padding: "0 24px 24px" }}>
+      {children}
+    </Layout>
+  );
+};
+
+export default DefaultLayout;

+ 3 - 1
src/components/index.js

@@ -12,6 +12,7 @@ import ViewLoading from "./ViewLoading";
 import MediaCards from "./MediaCards";
 import InputPass from "./InputPass";
 import Selector from "./Selector";
+import DefaultLayout from "./DefaultLayout";
 
 export {
   Tabla,
@@ -27,5 +28,6 @@ export {
   ViewLoading,
   MediaCards,
   InputPass,
-  ArbolPermisos
+  ArbolPermisos,
+  DefaultLayout,
 };

+ 23 - 0
src/routers/routes.jsx

@@ -30,6 +30,7 @@ import { Municipios, MunicipioDetalle } from "../views/catalogos/municipios";
 import { TipoMovilizaciones, TipoMovilizacionDetalle } from "../views/catalogos/tipoMovilizaciones";
 import { FinMovilizaciones, FinMovilizacionDetalle } from "../views/catalogos/finMovilizaciones";
 import { Condicionantes, CondicionanteDetalle } from "../views/condicionantes";
+import { Nivel, NivelDetalle} from '../views/catalogos/nivel'
 /* CATÁLOGOS */
 import { Perfil } from "../views/perfil";
 import { Modulos } from "../views/admin/permisos/modulos";
@@ -245,6 +246,28 @@ const dashboardRoutes = [
           },
           {
             layout: "dashboard",
+            path: "/nivel",
+            name: "Nivel",
+            icon: <ApartmentOutlined />,
+            sidebar: "single",
+            ver: "MENU-ADMIN",
+            routes: [
+              {
+                path: "/",
+                element: Nivel,
+              },
+              {
+                path: "/agregar",
+                element: NivelDetalle,
+              },
+              {
+                path: "/editar",
+                element: NivelDetalle,
+              },
+            ],
+          },
+          {
+            layout: "dashboard",
             path: "/tipoMovilizaciones",
             name: "Tipos de Movilización",
             icon: <ApartmentOutlined />,

+ 145 - 91
src/views/catalogos/municipios/MunicipioDetalle.jsx

@@ -1,10 +1,11 @@
-import { Form, Input, Button, Spin, Row, Col } from 'antd';
-import { useEffect, useMemo, useState } from 'react';
-import { useNavigate } from 'react-router-dom';
-import HttpService from '../../../services/httpService';
-import { useQuery, useModel } from '../../../hooks';
-import { commonRules } from '../../../constants/rules';
-import { Select } from "../../../components";
+import { Form, Input, Button, Row, Col, Select as AntSelect } from "antd";
+import { useCallback, useEffect, useMemo, useState } from "react";
+import { useNavigate } from "react-router-dom";
+import { respuestas } from "../../../utilities";
+import HttpService from "../../../services/httpService";
+import { useQuery, useModel } from "../../../hooks";
+import { commonRules } from "../../../constants/rules";
+import { DefaultLayout, Select } from "../../../components";
 
 const endpoints = {
   municipio: "municipio",
@@ -18,57 +19,55 @@ const MunicipioDetalle = () => {
   const id = query.get("id");
   const [estado, setEstado] = useState("");
   const [timer, setTimer] = useState(null);
+  const [request, setRequest] = useState({});
+  const [niveles, setNiveles] = useState([]);
 
-  const extraParams = useMemo(() => ({
-    idMunicipio: id,
-    idEstado: id,
-  }), [id]);
-
-  const estadoExtraParams = useMemo(() => {
-    let params = {};
-    if (estado !== "") {
-      params.nombre = estado;
-    }
-    return params;
-  }, [estado]);
+  const estadoExtraParams = useMemo(
+    () => ({
+      idEstado: id,
+    }),
+    [id]
+  );
 
-  const requestParams = useMemo(() => ({
-    name: endpoints.municipio,
-    id: id,
-    extraParams: extraParams,
-    expand: 'estado',
-  }), [id, extraParams]);
+  const requestParams = useMemo(
+    () => ({
+      name: endpoints.municipio,
+      expand: "estado,niveles",
+      id,
+    }),
+    [id]
+  );
 
-  const { model, modelLoading } = useModel(requestParams);
-
-  useEffect(() => {
-    if (model) {
-      form.setFieldsValue({
-        ...model,
-        idEstado: model.estado?.id,
-      });
-    }
-  }, [form, model]);
+  const { model, modelLoading } = useModel(request);
 
   const onFinish = async (values) => {
     try {
       setLoading(true);
-      const body = { ...values, id };
-      const res = await HttpService.post(`${endpoints.municipio}/guardar`, body);
+
+      let body = {
+        ...values,
+      };
+
+      if (id) {
+        body.id = id;
+      }
+
+      const res = await HttpService.post(
+        `${endpoints.municipio}/guardar`,
+        body
+      );
+      respuestas(res);
       if (res?.status === 200) {
-        navigate('/administracion/catalogos/municipios');
+        navigate("/administracion/catalogos/municipios");
       }
     } catch (error) {
       console.log(error);
+      setLoading(false);
     } finally {
       setLoading(false);
     }
   };
 
-  if (modelLoading) {
-    return <Spin size="large" style={{ display: "block", margin: "auto", marginTop: "50px" }} />;
-  }
-
   const onSearch = (value) => {
     clearTimeout(timer);
     const newTimer = setTimeout(() => {
@@ -77,57 +76,112 @@ const MunicipioDetalle = () => {
     setTimer(newTimer);
   };
 
+  const getNiveles = useCallback(async () => {
+    try {
+      const res = await HttpService.get("nivel");
+      if (res.status === 200) {
+        setNiveles(
+          res?.resultado?.map((nivel) => ({
+            value: nivel?.id,
+            label: nivel?.nombre,
+          }))
+        );
+      }
+    } catch (e) {
+      console.log(e);
+    }
+  }, []);
+
+  useEffect(() => {
+    if (id) {
+      setRequest(requestParams);
+    }
+    return () => {
+      setRequest({});
+    };
+  }, [id, requestParams]);
+
+  useEffect(() => {
+    if (model) {
+      form.setFieldsValue({
+        ...model,
+      });
+      let nivelesGuardados = [];
+      if (model?.niveles?.length > 0) {
+        nivelesGuardados = model?.niveles?.map((nivel) => nivel?.id);
+        form.setFieldValue("niveles", nivelesGuardados);
+      }
+    }
+  }, [form, model]);
+
+  useEffect(() => {
+    getNiveles();
+  }, [getNiveles]);
+
   return (
-    <Form
-      layout="vertical"
-      name="basic"
-      form={form}
-      onFinish={onFinish}
-      onFinishFailed={() => {}}
-    >
-      <Row gutter={16}>
-        <Col span={24}>
-          <h2>Información del Municipio</h2>
-        </Col>
-        <Col md={8} xs={12}>
-          <Form.Item
-            label="Nombre"
-            name="nombre"
-            rules={[commonRules.requerido]}
-          >
-            <Input />
-          </Form.Item>
-        </Col>
-        <Col md={8} xs={12}>
-          <Form.Item
-            label="Estado"
-            name="idEstado"
-            rules={[commonRules.requerido]}
-          >
-            <Select
-              modelsParams={{ name: 'estado', ordenar: 'nombre' }}
-              labelProp="nombre"
-              valueProp="id"
-              append={[model?.estado]}
-              onSearch={onSearch}
-              extraParams={estadoExtraParams}
-            />
-          </Form.Item>
-        </Col>
-        <Col span={24}>
-          <Form.Item>
-            <Button
-              type="primary"
-              htmlType="submit"
-              style={{ marginTop: "30px" }}
-              loading={loading}
+    <DefaultLayout>
+      <Form
+        layout="vertical"
+        name="basic"
+        form={form}
+        onFinish={onFinish}
+        onFinishFailed={() => {}}
+      >
+        <Row gutter={[10, 10]}>
+          <Col span={24}>
+            <h2>Información del Municipio</h2>
+          </Col>
+          <Col span={24} md={12}>
+            <Form.Item
+              label="Nombre"
+              name="nombre"
+              rules={[commonRules.requerido]}
+            >
+              <Input size="large" />
+            </Form.Item>
+          </Col>
+          <Col span={24} md={12}>
+            <Form.Item
+              label="Estado"
+              name="idEstado"
+              rules={[commonRules.requerido]}
             >
-              Guardar
-            </Button>
-          </Form.Item>
-        </Col>
-      </Row>
-    </Form>
+              <Select
+                size="large"
+                modelsParams={{ name: "estado", ordenar: "nombre" }}
+                labelProp="nombre"
+                valueProp="id"
+                append={[model?.estado]}
+                onSearch={onSearch}
+                extraParams={estadoExtraParams}
+              />
+            </Form.Item>
+          </Col>
+          <Col span={24}>
+            <Form.Item label="Estado" name="niveles">
+              <AntSelect
+                style={{ width: "100%" }}
+                options={niveles}
+                mode="multiple"
+              />
+            </Form.Item>
+          </Col>
+          <Col span={24}>
+            <Form.Item>
+              <Button
+                size="large"
+                type="primary"
+                htmlType="submit"
+                loading={loading}
+                style={{ marginTop: "30px" }}
+              >
+                Guardar
+              </Button>
+            </Form.Item>
+          </Col>
+        </Row>
+      </Form>
+    </DefaultLayout>
   );
 };
 

+ 53 - 0
src/views/catalogos/nivel/Detalle.jsx

@@ -0,0 +1,53 @@
+import { useState, useMemo, useEffect } from 'react'
+import { DefaultLayout } from '../../../components/layouts'
+import { useQuery, useModel } from '../../../hooks'
+import { Formulario } from './Formulario'
+
+const Detalle = ({ endPoint, expand, url, orden, idModelo, media }) => {
+  const q = useQuery()
+  const id = q.get('id')
+  const editando = Boolean(id)
+
+  const [request, setRequest] = useState({})
+
+  const requestParams = useMemo(() => ({
+    name: endPoint,
+    id: id,
+    ordenar: orden,
+    expand: expand,
+  }), [id])
+
+  const {
+    model,
+    modelLoading
+  } = useModel(request)
+
+  useEffect(() => {
+    setRequest(requestParams)
+    return () => {
+      setRequest({})
+    }
+  }, [requestParams])
+
+  return (
+    <DefaultLayout
+      viewLoading={{
+        text: 'Cargando ...',
+        spinning: modelLoading
+      }}
+    >
+      <Formulario
+        id={id}
+        url={url}
+        model={model}
+        idModelo={idModelo}
+        expand={expand}
+        endPoint={endPoint}
+        media={media}
+        editando={editando}
+      />
+    </DefaultLayout>
+  )
+}
+
+export default Detalle

+ 101 - 0
src/views/catalogos/nivel/Formulario.jsx

@@ -0,0 +1,101 @@
+import React, { useState } from 'react'
+import { Input, Form, Row, Col, Button } from 'antd'
+import HttpService from '../../../services/httpService'
+import { respuestas } from '../../../utilities'
+import { SaveOutlined } from '@ant-design/icons'
+import { useNavigate } from 'react-router-dom'
+
+
+export const Formulario = ({ model = null, id, alTerminar, endPoint, url, idModelo, media }) => {
+  const [form] = Form.useForm()
+  const navigate = useNavigate()
+
+  const [guardando, setGuardando] = useState(false)
+
+  const handleFinish = async (values) => {
+
+    try {
+      setGuardando(true)
+
+      let body = {
+        ...values,
+      }
+
+      if (id) {
+        body[idModelo] = id
+      }
+
+      const res = await HttpService.post(`${endPoint}/guardar`, body)
+      if (respuestas(res)) {
+        navigate(url)
+      }
+    } catch (e) {
+      console.log(e)
+    } finally {
+      setGuardando(false)
+    }
+
+  }
+
+  React.useEffect(() => {
+    if (model || model !== null) {
+      form.setFieldsValue({
+        ...model,
+      })
+    } else {
+      form.resetFields()
+    }
+  }, [form, model])
+
+  return (<Form
+      layout="vertical"
+      form={form}
+      onFinish={handleFinish}
+    >
+      <Row gutter={[10, 0]}>
+        <Col xs={24} lg={12}>
+          <Form.Item
+            label="Clave"
+            name="clave"
+            rules={[{
+              required: true,
+              message: 'Por favor ingresa una clave'
+            }]}
+          >
+            <Input/>
+          </Form.Item>
+        </Col>
+        <Col xs={24} lg={12}>
+          <Form.Item
+            label="Nombre"
+            name="nombre"
+            rules={[{
+              required: true,
+              message: 'Por favor ingresa un nombre'
+            }]}
+          >
+            <Input/>
+          </Form.Item>
+        </Col>
+      </Row>
+      <br/>
+      <Row justify="end">
+        <Col xs={24} lg={6}>
+          <Form.Item>
+            <Button
+              type="primary"
+              htmlType="submit"
+              size="large"
+              block
+              icon={<SaveOutlined/>}
+              loading={guardando}
+            >
+              Guardar
+            </Button>
+          </Form.Item>
+        </Col>
+      </Row>
+    </Form>
+  )
+
+}

+ 79 - 0
src/views/catalogos/nivel/Listado.jsx

@@ -0,0 +1,79 @@
+import React, { useState, useEffect, useMemo } from 'react'
+import { useNavigate } from 'react-router-dom'
+import { PlusOutlined } from '@ant-design/icons'
+import { SimpleTableLayout } from '../../../components/layouts'
+import { Tabla, ActionsButton } from '../../../components'
+import { eliminarRegistro, } from '../../../utilities'
+
+const Listado = ({ endPoint, columnas, idModelo, orden, expand }) => {
+
+  const tablaRef = React.useRef(null)
+
+  const navigate = useNavigate()
+
+  const [reqConvenio, setReqConvenio] = useState({})
+  const [buscar, setBuscar] = useState('')
+
+  const btnGroup = [
+    {
+      onClick: () => navigate('agregar'),
+      props: { disabled: false, type: 'primary', block: false },
+      text: 'Agregar',
+      icon: <PlusOutlined/>,
+    }
+  ]
+
+  const columns = [
+    {
+      width: '5%',
+      title: '',
+      render: (_, item) =>
+        <ActionsButton
+          data={[
+            {
+              label: 'Editar',
+              onClick: () => {
+                setReqConvenio(item)
+                navigate(`editar?id=${item[idModelo]}`)
+              }
+            },
+            {
+              label: "Eliminar",
+              onClick: () => {
+                eliminarRegistro(item?.nombre, item?.id, `${endPoint}/eliminar`, () =>
+                  tablaRef?.current?.refresh()
+                );
+              },
+              danger: true,
+            },
+          ]}
+        />
+    },
+    ...columnas
+  ]
+
+  const handleSearch = (buscar) => {
+    setBuscar(buscar)
+  }
+
+  return (
+    <SimpleTableLayout
+      onSearch={handleSearch}
+      btnGroup={
+        { btnGroup }
+      }
+    >
+      <Tabla
+        nameURL={endPoint}
+        order={orden}
+        extraParams={{buscar: buscar}}
+        columns={columns}
+        ref={tablaRef}
+        idModelo={idModelo}
+        expand={expand}
+      />
+    </SimpleTableLayout>
+  )
+}
+
+export default Listado

+ 49 - 0
src/views/catalogos/nivel/index.jsx

@@ -0,0 +1,49 @@
+import Detalle from './Detalle'
+import Listado from './Listado'
+import { Link } from 'react-router-dom'
+import React from 'react'
+
+const endPoint = 'nivel'
+const url = '/administracion/catalogos/nivel'
+const orden = 'nombre-desc'
+const idModelo = 'id'
+
+const columnas = [
+  {
+    title: 'Nombre',
+    index: 'nombre',
+    key: 'nombre',
+    dataIndex: 'nombre',
+    render: (_, item) =>
+      <Link to={`${url}/editar?id=${item[idModelo]}`} style={{ color: 'black' }}>
+        {item?.nombre}
+      </Link>
+  },
+  {
+    title: 'Clave',
+    index: 'clave',
+    key: 'clave',
+    dataIndex: 'clave',
+    render: (_, item) =>
+      <Link to={`${url}/editar?id=${item[idModelo]}`} style={{ color: 'black' }}>
+        {item?.clave}
+      </Link>
+  }, 
+]
+
+const Nivel = () => (<Listado
+  endPoint={endPoint}
+  url={url}
+  orden={orden}
+  columnas={columnas}
+  idModelo={idModelo}
+/>)
+
+const NivelDetalle = () => (<Detalle
+  endPoint={endPoint}
+  url={url}
+  orden={orden}
+  idModelo={idModelo}
+/>)
+
+export { Nivel, NivelDetalle }

+ 82 - 93
src/views/catalogos/productos/ProductoDetalle.jsx

@@ -1,85 +1,56 @@
-import { Form, Input, Button, Spin, Space, Row, Col } from 'antd'
-import { useEffect, useMemo, useState } from 'react'
-import HttpService from '../../../services/httpService'
-import { respuestas } from '../../../utilities'
-import { useNavigate } from 'react-router-dom'
-import { useQuery, useModel } from '../../../hooks'
-import { commonRules } from '../../../constants/rules'
-import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
-
-// const selectores = {
-//   consejoElectoral: {
-//     name: "v1/consejo-electoral",
-//   },
-//   distrito: {
-//     name: "v1/distrito",
-//   },
-//   estado: {
-//     name: "v1/estado",
-//   },
-//   municipio: {
-//     name: "v1/municipio",
-//   },
-//   participantePolitico: {
-//     name: "v1/participante-politico",
-//   },
-//   seccion: {
-//     name: "v1/seccion",
-//   },
-//   tipoAgenda: {
-//     name: "v1/agenda/tipo-agenda",
-//   },
-//   usuario: {
-//     name: "v1/usuario",
-//   }
-// }
+import { Form, Input, Button, Spin, Space, Row, Col } from "antd";
+import { useEffect, useMemo, useState } from "react";
+import HttpService from "../../../services/httpService";
+import { respuestas } from "../../../utilities";
+import { useNavigate } from "react-router-dom";
+import { useQuery, useModel } from "../../../hooks";
+import { commonRules } from "../../../constants/rules";
+import { MinusCircleOutlined, PlusOutlined } from "@ant-design/icons";
 
 const endpoints = {
   producto: "producto",
 };
 
 const ProductoDetalle = () => {
-  const [form] = Form.useForm()
-  const navigate = useNavigate()
-  const [loading, setLoading] = useState(false)
-  const query = useQuery()
-  const id = query.get("id")
-  const [request, setRequest] = useState({})
-
-  // const extraParams = useMemo(() => ({
-  //   idAgenda: id,
-  // }), [id])
-
-  const requestParams = useMemo(() => ({
-    name: endpoints.producto,
-    expand: 'subproductos',
-    id,
-    // extraParams
-  }), [id])
-
-
-  const { model, modelLoading } = useModel(request)
+  const [form] = Form.useForm();
+  const navigate = useNavigate();
+  const [loading, setLoading] = useState(false);
+  const query = useQuery();
+  const id = query.get("id");
+  const [request, setRequest] = useState({});
+
+  const requestParams = useMemo(
+    () => ({
+      name: endpoints.producto,
+      expand: "subproductos",
+      id,
+    }),
+    [id]
+  );
+
+  const { model, modelLoading } = useModel(request);
 
   useEffect(() => {
     if (id) {
-      setRequest(requestParams)
+      setRequest(requestParams);
     }
     return () => {
-      setRequest({})
-    }
-  }, [id, requestParams])
+      setRequest({});
+    };
+  }, [id, requestParams]);
 
   useEffect(() => {
     if (model) {
-      form.setFieldsValue({ //seteo cuando son varios
+      form.setFieldsValue({
+        //seteo cuando son varios
         ...model,
         subproductos: model.subproductos.map((subproducto, index) => ({
           ...subproducto,
-          key: index
-        }))
-      })
+          key: index,
+        })),
+      });
     }
-  }, [form, model])
+  }, [form, model]);
 
   const onFinish = async (values) => {
     try {
@@ -90,13 +61,13 @@ const ProductoDetalle = () => {
       };
 
       if (id) {
-        body.id = id
+        body.id = id;
       }
 
       const res = await HttpService.post(`${endpoints.producto}/guardar`, body);
       respuestas(res);
       if (res?.status === 200) {
-        navigate('/administracion/catalogos/productos')
+        navigate("/administracion/catalogos/productos");
       }
     } catch (error) {
       console.log(error);
@@ -104,13 +75,15 @@ const ProductoDetalle = () => {
     } finally {
       setLoading(false);
     }
-  }
+  };
 
   if (modelLoading) {
-    return <Spin
-      size="large"
-      style={{ display: "block", margin: "auto", marginTop: "50px" }}
-    />
+    return (
+      <Spin
+        size="large"
+        style={{ display: "block", margin: "auto", marginTop: "50px" }}
+      />
+    );
   }
 
   const handleKeyPress = (event) => {
@@ -126,7 +99,7 @@ const ProductoDetalle = () => {
       name="basic"
       form={form}
       onFinish={onFinish}
-      onFinishFailed={() => { }}
+      onFinishFailed={() => {}}
     >
       <Row gutter={16}>
         <Col span={24}>
@@ -136,9 +109,7 @@ const ProductoDetalle = () => {
           <Form.Item
             label="Nombre"
             name="nombre"
-            rules={[
-              commonRules.requerido,
-            ]}
+            rules={[commonRules.requerido]}
           >
             <Input />
           </Form.Item>
@@ -147,11 +118,9 @@ const ProductoDetalle = () => {
           <Form.Item
             label="ID Sagarhpa"
             name="idSagarhpa"
-            rules={[
-              commonRules.requerido,
-            ]}
+            rules={[commonRules.requerido]}
           >
-            <Input onKeyPress={handleKeyPress} maxLength={9}/>
+            <Input onKeyPress={handleKeyPress} maxLength={9} />
           </Form.Item>
         </Col>
         <Col span={24}>
@@ -162,17 +131,36 @@ const ProductoDetalle = () => {
             {(fields, { add, remove }) => (
               <>
                 {fields.map(({ key, name, ...restField }) => (
-                  <Space key={key} style={{ display: 'flex', marginBottom: 8 }} align="baseline">
-                    <Form.Item
-                      {...restField}
-                      name={[name, 'nombre']}
-                      rules={[commonRules.requerido]}
-                      style={{ width: '350px' }}
-                    >
-                      <Input placeholder="Nombre del Subproducto" />
-                    </Form.Item>
-                    <MinusCircleOutlined onClick={() => remove(name)} />
-                  </Space>
+                  <Row
+                    key={key}
+                    style={{ display: "flex", marginBottom: 12 }}
+                    align="baseline"
+                    gutter={[10, 10]}
+                  >
+                    <Col md={8} xs={24} lg={6}>
+                      <Form.Item
+                        {...restField}
+                        name={[name, "nombre"]}
+                        label="Nombre del Subproducto"
+                        rules={[commonRules.requerido]}
+                      >
+                        <Input placeholder="Nombre del Subproducto" />
+                      </Form.Item>
+                    </Col>
+                    <Col md={8} xs={24} lg={6}>
+                      <Form.Item
+                        {...restField}
+                        name={[name, "idSagarhpa"]}
+                        label="ID Subproducto"
+                        rules={[commonRules.requerido]}
+                      >
+                        <Input onKeyPress={handleKeyPress} maxLength={9} />
+                      </Form.Item>
+                    </Col>
+                    <Col md={8} xs={24} lg={6} style={{ marginTop: 35 }}>
+                      <MinusCircleOutlined onClick={() => remove(name)} />
+                    </Col>
+                  </Row>
                 ))}
                 <Form.Item>
                   <Button
@@ -187,6 +175,7 @@ const ProductoDetalle = () => {
             )}
           </Form.List>
         </Col>
+
         <Col span={24}>
           <Form.Item>
             <Button
@@ -201,7 +190,7 @@ const ProductoDetalle = () => {
         </Col>
       </Row>
     </Form>
-  )
-}
+  );
+};
 
-export default ProductoDetalle
+export default ProductoDetalle;

+ 2 - 1
src/views/condicionantes/CondicionanteDetalle.jsx

@@ -5,6 +5,7 @@ import { respuestas } from '../../utilities';
 import { useNavigate } from 'react-router-dom';
 import { useQuery, useModel } from '../../hooks';
 import { Select } from '../../components';
+import EditorTexto from "../../components/EditorTexto";
 import { DefaultLayout } from '../../components/layouts';
 
 const { Text } = Typography;
@@ -327,7 +328,7 @@ const CondicionanteDetalle = () => {
                 { required: true, message: 'La descripción es obligatoria.' }
               ]}
             >
-              <Input.TextArea rows={3} />
+              <EditorTexto altura={200} />
             </Form.Item>
           </Col>
           <Col md={12} xs={24}>

+ 5 - 5
src/views/condicionantes/Condicionantes.jsx

@@ -1,6 +1,6 @@
 import { useRef, useState, useCallback, useMemo } from "react";
-import { Form, Modal, Tooltip, notification } from "antd";
-import { DeleteOutlined, PlusOutlined } from "@ant-design/icons";
+import { Form, Tooltip } from "antd";
+import { PlusOutlined } from "@ant-design/icons";
 import { Tabla } from "../../components";
 import { SimpleTableLayout } from "../../components/layouts";
 import { ActionsButton } from "../../components";
@@ -48,8 +48,6 @@ const Condicionantes = () => {
     </Link>
   );
 
-
-
   const columns = [
     {
       title: "Acciones",
@@ -88,7 +86,9 @@ const Condicionantes = () => {
       title: "Descripción",
       key: "descripcion",
       dataIndex: "descripcion",
-      render: linkText,
+      render: (text) => (
+        <div dangerouslySetInnerHTML={{ __html: text }} />
+      ),
     },
     {
       title: "Activa",