Selaa lähdekoodia

Merge branch 'master' of http://gitlab.smartai.com/zhupei/smartai2dian0

张涛 1 vuosi sitten
vanhempi
sitoutus
e71923f5a9

+ 31 - 0
src/api/login.js

@@ -0,0 +1,31 @@
+import request from '../base/ajax.js';
+// 登录
+export function login(data) {
+  return request({
+    url: '/api/auth/v2/login',
+    method: 'post',
+    data
+  });
+}
+// 注册
+export function register(data) {
+  return request({
+    url: '/api/auth/v2/register',
+    method: 'post',
+    data
+  });
+}
+// 获取用户信息
+export function getInfo() {
+  return request({
+    url: '/api/user/user_info',
+    method: 'get'
+  });
+}
+// 获取用户路由
+export function generateRoutes() {
+  return request({
+    url: '/api/user/user_routers',
+    method: 'get'
+  });
+}

+ 1 - 2
src/modules/Model/ModelList.vue

@@ -26,7 +26,6 @@
 </template>
 
 <script setup>
-const handleSelect = () => {};
 const handlerAddModel = () => {};
 const handlerDeleteModel = () => {};
 const showMoreModel = () => {};
@@ -38,7 +37,7 @@ const showMoreModel = () => {};
   align-items: center;
   padding: 20px 30px;
   margin-top: 10px;
-  background-color: #fff;
+  background-color: var(--color-bg-2);
 }
 .list-info {
   display: flex;

+ 1 - 5
src/modules/Model/TopSetting.vue

@@ -14,8 +14,4 @@
 const handleCreate = () => {};
 </script>
 <style scoped lang="scss"></style>
-<style>
-.arco-input-wrapper {
-  background-color: #fff;
-}
-</style>
+<style></style>

+ 21 - 21
src/modules/intelligent/MessageBody.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="body-container">
-    <CardItem v-for="item in mokeData" :key="item.id" :name="item.name" :imgSrc="item.imgSrc" :height="200">
+    <CardItem v-for="item in moke_data" :key="item.id" :name="item.name" :img_src="item.img_src" :height="200">
       <template #description> {{ item.desc }}> </template>
       <template #settings>
         <a-switch v-model="item.online">
@@ -8,7 +8,7 @@
           <template #unchecked> 下线 </template>
         </a-switch>
       </template>
-      <template #labels v-if="item.hasLabel">
+      <template #labels v-if="item.has_label">
         <div class="label-btn">
           <icon-subscribe />
           <div>添加标签</div>
@@ -38,78 +38,78 @@ import intelligentFrame6 from '../../assets/image/management/intelligent-frame6.
 import intelligentFrame7 from '../../assets/image/management/intelligent-frame7.png';
 import intelligentFrame8 from '../../assets/image/management/intelligent-frame8.png';
 
-const mokeData = ref([
+const moke_data = ref([
   {
     id: 1,
     name: '智能问答',
-    imgSrc: intelligentFrame1,
+    img_src: intelligentFrame1,
     desc: '极目新闻记者了解到,这些患者都有一些共同的习惯:经常把未吃完的食物放在桌上敞着',
     user: 'admin',
     online: false,
-    hasLabel: false
+    has_label: false
   },
   {
     id: 2,
     name: '智能客服',
-    imgSrc: intelligentFrame2,
+    img_src: intelligentFrame2,
     desc: '极目新闻记者了解到,这些患者都有一些共同的习惯:经常把未吃完的食物放在桌上敞着',
     user: 'admin',
     online: false,
-    hasLabel: true
+    has_label: true
   },
   {
     id: 3,
     name: '继题组卷',
-    imgSrc: intelligentFrame3,
+    img_src: intelligentFrame3,
     desc: '极目新闻记者了解到,这些患者都有一些共同的习惯:经常把未吃完的食物放在桌上敞着',
     user: 'admin',
     online: true,
-    hasLabel: false
+    has_label: false
   },
   {
     id: 4,
     name: '小数绘图',
-    imgSrc: intelligentFrame4,
+    img_src: intelligentFrame4,
     desc: '极目新闻记者了解到,这些患者都有一些共同的习惯:经常把未吃完的食物放在桌上敞着',
     user: 'admin',
     online: true,
-    hasLabel: true
+    has_label: true
   },
   {
     id: 5,
     name: '材据分析',
-    imgSrc: intelligentFrame5,
+    img_src: intelligentFrame5,
     desc: '极目新闻记者了解到,这些患者都有一些共同的习惯:经常把未吃完的食物放在桌上敞着',
     user: 'admin',
     online: true,
-    hasLabel: false
+    has_label: false
   },
   {
     id: 6,
     name: '报告自动生成 ',
-    imgSrc: intelligentFrame6,
+    img_src: intelligentFrame6,
     desc: '极目新闻记者了解到,这些患者都有一些共同的习惯:经常把未吃完的食物放在桌上敞着',
     user: 'admin',
     online: true,
-    hasLabel: false
+    has_label: false
   },
   {
     id: 7,
     name: '文档创作',
-    imgSrc: intelligentFrame7,
+    img_src: intelligentFrame7,
     desc: '极目新闻记者了解到,这些患者都有一些共同的习惯:经常把未吃完的食物放在桌上敞着',
     user: 'admin',
     online: false,
-    hasLabel: true
+    has_label: true
   },
   {
     id: 8,
     name: '设备检测',
-    imgSrc: intelligentFrame8,
+    img_src: intelligentFrame8,
     desc: '极目新闻记者了解到,这些患者都有一些共同的习惯:经常把未吃完的食物放在桌上敞着',
     user: 'admin',
     online: true,
-    hasLabel: true
+    has_label: true
   }
 ]);
 </script>
@@ -120,15 +120,15 @@ const mokeData = ref([
   flex-wrap: wrap;
   align-content: flex-start;
   gap: 20px;
-  height: calc(100% - 80px);
   overflow: auto;
+  height: calc(100% - 80px);
 }
 .label-btn {
   display: flex;
   gap: 10px;
+  padding: 8px 16px;
   background-color: var(--color-neutral-3);
   font-size: 12px;
-  padding: 8px 16px;
   cursor: pointer;
 }
 .bottom {

+ 1 - 1
src/modules/intelligent/TopSetting.vue

@@ -23,6 +23,6 @@ const handleCreate = () => {};
 <style scoped lang="scss"></style>
 <style>
 .arco-input-wrapper {
-  background-color: #fff;
+  background-color: var(--color-bg-5);
 }
 </style>

+ 11 - 11
src/modules/knowledge/MessageBody.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="body-container">
-    <CardItem v-for="item in mokeData" :key="item.name" :name="item.name" :imgSrc="item.imgSrc">
+    <CardItem v-for="item in moke_data" :key="item.name" :name="item.name" :img_src="item.img_src">
       <template #bottom>
         <div class="bottom">
           <div>{{ item.count }}文档</div>
@@ -29,52 +29,52 @@ import knowledgeFrame2 from '../../assets/image/management/knowledge-frame2.png'
 import knowledgeFrame3 from '../../assets/image/management/knowledge-frame3.png';
 import knowledgeFrame4 from '../../assets/image/management/knowledge-frame4.png';
 
-const mokeData = ref([
+const moke_data = ref([
   {
     name: '知识库1',
-    imgSrc: knowledgeFrame1,
+    img_src: knowledgeFrame1,
     count: 292,
     time: '2024:11:11 12:00:00'
   },
   {
     name: '知识库2',
-    imgSrc: knowledgeFrame2,
+    img_src: knowledgeFrame2,
     count: 292,
     time: '2024:11:11 12:00:00'
   },
   {
     name: '知识库3',
-    imgSrc: knowledgeFrame3,
+    img_src: knowledgeFrame3,
     count: 292,
     time: '2024:11:11 12:00:00'
   },
   {
     name: '知识库4',
-    imgSrc: knowledgeFrame4,
+    img_src: knowledgeFrame4,
     count: 292,
     time: '2024:11:11 12:00:00'
   },
   {
     name: '知识库5',
-    imgSrc: knowledgeFrame1,
+    img_src: knowledgeFrame1,
     count: 292,
     time: '2024:11:11 12:00:00'
   },
   {
     name: '知识库6',
-    imgSrc: knowledgeFrame2,
+    img_src: knowledgeFrame2,
     count: 292,
     time: '2024:11:11 12:00:00'
   },
   {
     name: '知识库7',
-    imgSrc: knowledgeFrame3,
+    img_src: knowledgeFrame3,
     count: 292,
     time: '2024:11:11 12:00:00'
   },
   {
     name: '知识库8',
-    imgSrc: knowledgeFrame4,
+    img_src: knowledgeFrame4,
     count: 292,
     time: '2024:11:11 12:00:00'
   }
@@ -93,8 +93,8 @@ const handleSelect = ({ value }) => {
   flex-wrap: wrap;
   align-content: flex-start;
   gap: 20px;
-  height: calc(100% - 80px);
   overflow: auto;
+  height: calc(100% - 80px);
 }
 .bottom {
   display: flex;

+ 1 - 1
src/modules/knowledge/TopSetting.vue

@@ -23,6 +23,6 @@ const handleCreate = () => {};
 <style scoped lang="scss"></style>
 <style>
 .arco-input-wrapper {
-  background-color: #fff;
+  background-color: var(--color-bg-5);
 }
 </style>

+ 18 - 17
src/modules/login/FormItem.vue

@@ -1,13 +1,13 @@
 <template>
   <div class="form-title">
-    {{ formType ? $t('login.registerModel') : $t('login.loginModel') }}
+    {{ form_type ? $t('login.registerModel') : $t('login.loginModel') }}
   </div>
   <a-form
-    ref="refForm"
+    ref="ref_form"
     :model="form"
     :rules="rules"
-    layout="validate"
     :style="{ width: 'calc(100% - 40px)' }"
+    layout="validate"
     @submit-success="handleSubmit"
   >
     <a-form-item field="username">
@@ -15,7 +15,7 @@
         <template #prefix> <icon-user /> </template>
       </a-input>
     </a-form-item>
-    <a-form-item field="email" v-if="formType">
+    <a-form-item v-if="form_type" field="email">
       <a-input v-model="form.email" :placeholder="$t('login.emailTips')">
         <template #prefix> <icon-email /> </template>
       </a-input>
@@ -33,15 +33,15 @@
       </a-input-password>
     </a-form-item>
     <a-form-item>
-      <a-button v-if="!formType" :loading="loading" class="submit-btn" type="primary" html-type="submit"
+      <a-button v-if="!form_type" class="submit-btn" type="primary" html-type="submit" :loading="loading"
         >{{ $t('login.loginBtn') }}
       </a-button>
-      <a-button v-if="formType" :loading="loading" class="submit-btn" type="primary" html-type="submit"
+      <a-button v-if="form_type" class="submit-btn" type="primary" html-type="submit" :loading="loading"
         >{{ $t('login.registerBtn') }}
       </a-button>
     </a-form-item>
   </a-form>
-  <div class="tips-register" v-if="!formType">
+  <div v-if="!form_type" class="tips-register">
     {{ $t('login.noAccount') }} <a class="reg-link" href="#" @click="changeFormType">{{ $t('login.registerBtn') }}</a>
   </div>
 </template>
@@ -55,13 +55,14 @@ import { register } from '../../base/api/login';
 import { useI18n } from 'vue-i18n';
 
 const router = useRouter();
-const { t } = useI18n();
 
 const { appContext } = getCurrentInstance();
 const userStore = useCurrentUserStore();
 
+const { t } = useI18n();
+
 const $message = appContext.config.globalProperties.$message;
-const refForm = ref();
+const ref_form = ref();
 const form = reactive({
   username: '',
   email: '', // 非必填
@@ -73,12 +74,12 @@ const rules = getLoginFormRules(t);
  * 0:登录
  * 1:注册
  */
-const formType = ref(0);
+const form_type = ref(0);
 const loading = ref(false);
 
 const handleSubmit = (data) => {
   loading.value = true;
-  if (formType.value) {
+  if (form_type.value) {
     // 注册
     toRegister();
   } else {
@@ -102,8 +103,8 @@ const toRegister = () => {
     .then((res) => {
       if (res.code == 200 && res.data.username) {
         $message.success(res.msg);
-        formType.value = 0;
-        refForm.value.resetFields();
+        form_type.value = 0;
+        ref_form.value.resetFields();
         nextTick(() => {
           form.username = res.data.username;
         });
@@ -117,23 +118,23 @@ const toRegister = () => {
 };
 const changeFormType = (e) => {
   e.preventDefault();
-  refForm.value.resetFields();
-  formType.value = 1;
+  ref_form.value.resetFields();
+  form_type.value = 1;
 };
 </script>
 <style scoped>
 .form-title {
-  font-size: 30px;
   line-height: 42px;
+  font-size: 30px;
   font-weight: 500;
 }
 .submit-btn {
   width: 100%;
   height: 54px;
   background-color: rgb(var(--arcoblue-6));
-  border-radius: 3px;
   color: var(--color-neutral-1);
   font-size: 20px;
+  border-radius: 3px;
 }
 .submit-btn:hover {
   background-color: rgba(var(--arcoblue-6), 0.8);

+ 8 - 9
src/views/manage-common/CardItem.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="card-container" :style="{ height: `${height}px` }">
     <div class="card-name">
-      <img :src="imgSrc" class="logo" />
+      <img :src="img_src" class="logo" />
       <div class="name">{{ name }}</div>
     </div>
     <div class="card-des">
@@ -24,7 +24,7 @@ const props = defineProps({
   name: {
     type: String
   },
-  imgSrc: {
+  img_src: {
     type: String
   },
   height: {
@@ -38,26 +38,25 @@ const props = defineProps({
   position: relative;
   width: calc((100vw - 160px) / 7);
   padding: 10px 20px;
-  background-color: #fff;
-  border-radius: 5px;
+  background-color: var(--color-bg-2);
 }
 .card-name .name {
+  margin-top: 10px;
   font-size: 16px;
-  color: var(--color-neutral-8);
   font-weight: bold;
-  margin-top: 10px;
+  color: var(--color-neutral-8);
 }
 .card-des {
-  margin-top: 10px;
   display: -webkit-box;
+  overflow: hidden;
+  margin-top: 10px;
   -webkit-line-clamp: 2;
   -webkit-box-orient: vertical;
-  overflow: hidden;
   text-overflow: ellipsis;
 }
 .card-label {
-  margin-top: 15px;
   width: 100%;
+  margin-top: 15px;
 }
 
 .card-bottom {

+ 1 - 1
src/views/manage-common/HeadManage.vue

@@ -17,7 +17,7 @@ const props = defineProps({
     type: String
   },
   tips: {
-    typeof: String
+    type: String
   }
 });
 </script>