tycoding 1 рік тому
батько
коміт
0a61306a97
52 змінених файлів з 92 додано та 924 видалено
  1. 0 16
      langchat-ui/src/components/Application/Application.vue
  2. 0 16
      langchat-ui/src/components/Application/index.ts
  3. 4 20
      langchat-ui/src/components/CheckCard/CheckCard.vue
  4. 0 16
      langchat-ui/src/components/CheckCard/index.ts
  5. 0 16
      langchat-ui/src/components/CountTo/CountTo.vue
  6. 0 16
      langchat-ui/src/components/CountTo/index.ts
  7. 0 16
      langchat-ui/src/components/Form/index.ts
  8. 21 37
      langchat-ui/src/components/Form/src/BasicForm.vue
  9. 0 16
      langchat-ui/src/components/Form/src/helper.ts
  10. 0 16
      langchat-ui/src/components/Form/src/hooks/useForm.ts
  11. 0 16
      langchat-ui/src/components/Form/src/hooks/useFormContext.ts
  12. 0 16
      langchat-ui/src/components/Form/src/hooks/useFormEvents.ts
  13. 0 16
      langchat-ui/src/components/Form/src/hooks/useFormValues.ts
  14. 0 16
      langchat-ui/src/components/Form/src/props.ts
  15. 0 16
      langchat-ui/src/components/Form/src/types/form.ts
  16. 0 16
      langchat-ui/src/components/Form/src/types/index.ts
  17. 5 21
      langchat-ui/src/components/IconPicker/index.vue
  18. 6 22
      langchat-ui/src/components/Lockscreen/Lockscreen.vue
  19. 0 16
      langchat-ui/src/components/Lockscreen/Recharge.vue
  20. 0 16
      langchat-ui/src/components/Lockscreen/index.ts
  21. 0 16
      langchat-ui/src/components/Modal/index.ts
  22. 4 20
      langchat-ui/src/components/Modal/src/basicModal.vue
  23. 0 16
      langchat-ui/src/components/Modal/src/hooks/useModal.ts
  24. 0 16
      langchat-ui/src/components/Modal/src/props.ts
  25. 0 16
      langchat-ui/src/components/Modal/src/type/index.ts
  26. 8 24
      langchat-ui/src/components/Resizer/DragRow.vue
  27. 0 16
      langchat-ui/src/components/Resizer/index.ts
  28. 1 17
      langchat-ui/src/components/SvgIcon/index.vue
  29. 0 16
      langchat-ui/src/components/Table/index.ts
  30. 8 24
      langchat-ui/src/components/Table/src/Table.vue
  31. 0 16
      langchat-ui/src/components/Table/src/componentMap.ts
  32. 5 21
      langchat-ui/src/components/Table/src/components/TableAction.vue
  33. 0 16
      langchat-ui/src/components/Table/src/components/editable/CellComponent.ts
  34. 7 23
      langchat-ui/src/components/Table/src/components/editable/EditableCell.vue
  35. 0 16
      langchat-ui/src/components/Table/src/components/editable/helper.ts
  36. 0 16
      langchat-ui/src/components/Table/src/components/editable/index.ts
  37. 11 27
      langchat-ui/src/components/Table/src/components/settings/ColumnSetting.vue
  38. 0 16
      langchat-ui/src/components/Table/src/const.ts
  39. 0 16
      langchat-ui/src/components/Table/src/hooks/useColumns.ts
  40. 0 16
      langchat-ui/src/components/Table/src/hooks/useDataSource.ts
  41. 0 16
      langchat-ui/src/components/Table/src/hooks/useLoading.ts
  42. 0 16
      langchat-ui/src/components/Table/src/hooks/usePagination.ts
  43. 0 16
      langchat-ui/src/components/Table/src/hooks/useTableContext.ts
  44. 0 16
      langchat-ui/src/components/Table/src/props.ts
  45. 0 16
      langchat-ui/src/components/Table/src/types/componentType.ts
  46. 0 16
      langchat-ui/src/components/Table/src/types/pagination.ts
  47. 0 16
      langchat-ui/src/components/Table/src/types/table.ts
  48. 0 16
      langchat-ui/src/components/Table/src/types/tableAction.ts
  49. 0 16
      langchat-ui/src/components/Upload/index.ts
  50. 12 28
      langchat-ui/src/components/Upload/src/BasicUpload.vue
  51. 0 16
      langchat-ui/src/components/Upload/src/props.ts
  52. 0 16
      langchat-ui/src/components/Upload/src/type/index.ts

+ 0 - 16
langchat-ui/src/components/Application/Application.vue

@@ -1,19 +1,3 @@
-<!--
-  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
-  -
-  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
-  - you may not use this file except in compliance with the License.
-  - You may obtain a copy of the License at
-  -
-  -     https://www.gnu.org/licenses/agpl-3.0.html
-  -
-  - Unless required by applicable law or agreed to in writing, software
-  - distributed under the License is distributed on an "AS IS" BASIS,
-  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  - See the License for the specific language governing permissions and
-  - limitations under the License.
-  -->
-
 <template>
   <n-dialog-provider>
     <n-notification-provider>

+ 0 - 16
langchat-ui/src/components/Application/index.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import AppProvider from './Application.vue';
 
 export { AppProvider };

+ 4 - 20
langchat-ui/src/components/CheckCard/CheckCard.vue

@@ -1,27 +1,11 @@
-<!--
-  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
-  -
-  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
-  - you may not use this file except in compliance with the License.
-  - You may obtain a copy of the License at
-  -
-  -     https://www.gnu.org/licenses/agpl-3.0.html
-  -
-  - Unless required by applicable law or agreed to in writing, software
-  - distributed under the License is distributed on an "AS IS" BASIS,
-  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  - See the License for the specific language governing permissions and
-  - limitations under the License.
-  -->
-
 <template>
   <n-space :justify="justify">
     <template v-for="item in dataSource" :key="item.key">
-      <div style="height: 96px" @click="handleChecked(item)">
+      <div @click="handleChecked(item)" style="height: 96px">
         <n-list
           :class="checked == item.key ? 'check-list-checked' : ''"
-          bordered
           class="check-list"
+          bordered
         >
           <n-list-item>
             <template #prefix>
@@ -36,7 +20,7 @@
               <template #description>{{ item.label }}</template>
             </n-thing>
             <template #suffix>
-              <n-icon :color="checked == item.key ? '#18a058' : '#eee'" size="20">
+              <n-icon size="20" :color="checked == item.key ? '#18a058' : '#eee'">
                 <CheckmarkCircle />
               </n-icon>
             </template>
@@ -108,7 +92,7 @@
     },
   });
 </script>
-<style lang="less" scoped>
+<style scoped lang="less">
   .check-list {
     width: 320px;
     cursor: pointer;

+ 0 - 16
langchat-ui/src/components/CheckCard/index.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import CheckCard from './CheckCard.vue';
 
 export default CheckCard;

+ 0 - 16
langchat-ui/src/components/CountTo/CountTo.vue

@@ -1,19 +1,3 @@
-<!--
-  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
-  -
-  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
-  - you may not use this file except in compliance with the License.
-  - You may obtain a copy of the License at
-  -
-  -     https://www.gnu.org/licenses/agpl-3.0.html
-  -
-  - Unless required by applicable law or agreed to in writing, software
-  - distributed under the License is distributed on an "AS IS" BASIS,
-  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  - See the License for the specific language governing permissions and
-  - limitations under the License.
-  -->
-
 <template>
   <span :style="{ color }">
     {{ value }}

+ 0 - 16
langchat-ui/src/components/CountTo/index.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import { withInstall } from '@/utils';
 import countTo from './CountTo.vue';
 

+ 0 - 16
langchat-ui/src/components/Form/index.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 export { default as BasicForm } from './src/BasicForm.vue';
 export { useForm } from './src/hooks/useForm';
 export * from './src/types/form';

+ 21 - 37
langchat-ui/src/components/Form/src/BasicForm.vue

@@ -1,31 +1,15 @@
-<!--
-  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
-  -
-  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
-  - you may not use this file except in compliance with the License.
-  - You may obtain a copy of the License at
-  -
-  -     https://www.gnu.org/licenses/agpl-3.0.html
-  -
-  - Unless required by applicable law or agreed to in writing, software
-  - distributed under the License is distributed on an "AS IS" BASIS,
-  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  - See the License for the specific language governing permissions and
-  - limitations under the License.
-  -->
-
 <template>
-  <n-form ref="formElRef" :model="formModel" v-bind="getBindValue">
+  <n-form v-bind="getBindValue" :model="formModel" ref="formElRef">
     <n-grid v-bind="getGrid">
       <template v-for="schema in getSchema">
-        <n-gi v-if="!schema.isHidden" :key="schema.field" v-bind="schema.giProps">
+        <n-gi v-bind="schema.giProps" :key="schema.field" v-if="!schema.isHidden">
           <n-form-item :label="schema.label" :path="schema.field">
             <!--标签名右侧温馨提示-->
-            <template v-if="schema.labelMessage" #label>
+            <template #label v-if="schema.labelMessage">
               {{ schema.label }}
-              <n-tooltip :style="schema.labelMessageStyle" trigger="hover">
+              <n-tooltip trigger="hover" :style="schema.labelMessageStyle">
                 <template #trigger>
-                  <n-icon class="text-gray-400 cursor-pointer" size="18">
+                  <n-icon size="18" class="text-gray-400 cursor-pointer">
                     <QuestionCircleOutlined />
                   </n-icon>
                 </template>
@@ -36,9 +20,9 @@
             <!--判断插槽-->
             <template v-if="schema.slot">
               <slot
-                :field="schema.field"
-                :model="formModel"
                 :name="schema.slot"
+                :model="formModel"
+                :field="schema.field"
                 :value="formModel[schema.field]"
               ></slot>
             </template>
@@ -50,8 +34,8 @@
                   <n-checkbox
                     v-for="item in schema.componentProps.options"
                     :key="item.value"
-                    :label="item.label"
                     :value="item.value"
+                    :label="item.label"
                   />
                 </n-space>
               </n-checkbox-group>
@@ -73,18 +57,18 @@
             </template>
             <!--动态渲染表单组件-->
             <component
-              :is="schema.component"
               v-else
+              v-bind="getComponentProps(schema)"
+              :is="schema.component"
               v-model:value="formModel[schema.field]"
               :class="{ isFull: schema.isFull != false && getProps.isFull }"
-              v-bind="getComponentProps(schema)"
             />
             <!--组件后面的内容-->
             <template v-if="schema.suffix">
               <slot
-                :field="schema.field"
-                :model="formModel"
                 :name="schema.suffix"
+                :model="formModel"
+                :field="schema.field"
                 :value="formModel[schema.field]"
               ></slot>
             </template>
@@ -94,21 +78,21 @@
 
       <!--提交 重置 展开 收起 按钮-->
       <n-gi
-        v-if="getProps.showActionButtonGroup"
-        #="{ overflow }"
         :span="isInline ? '' : 24"
         :suffix="isInline ? true : false"
+        #="{ overflow }"
+        v-if="getProps.showActionButtonGroup"
       >
         <n-space
-          :style="{ 'margin-left': `${isInline ? 12 : getProps.labelWidth}px` }"
           align="center"
           justify="end"
+          :style="{ 'margin-left': `${isInline ? 12 : getProps.labelWidth}px` }"
         >
           <n-button
             v-if="getProps.showSubmitButton"
-            :loading="loadingSub"
             v-bind="getSubmitBtnOptions"
             @click="handleSubmit"
+            :loading="loadingSub"
             >{{ getProps.submitButtonText }}</n-button
           >
           <n-button
@@ -118,17 +102,17 @@
             >{{ getProps.resetButtonText }}</n-button
           >
           <n-button
-            v-if="isInline && getProps.showAdvancedButton"
-            icon-placement="right"
-            text
             type="primary"
+            text
+            icon-placement="right"
+            v-if="isInline && getProps.showAdvancedButton"
             @click="unfoldToggle"
           >
             <template #icon>
-              <n-icon v-if="overflow" class="unfold-icon" size="14">
+              <n-icon size="14" class="unfold-icon" v-if="overflow">
                 <DownOutlined />
               </n-icon>
-              <n-icon v-else class="unfold-icon" size="14">
+              <n-icon size="14" class="unfold-icon" v-else>
                 <UpOutlined />
               </n-icon>
             </template>

+ 0 - 16
langchat-ui/src/components/Form/src/helper.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import { ComponentType } from './types/index';
 
 /**

+ 0 - 16
langchat-ui/src/components/Form/src/hooks/useForm.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import type { FormActionType, FormProps, UseFormReturnType } from '../types/form';
 import type { DynamicProps } from '/#/utils';
 

+ 0 - 16
langchat-ui/src/components/Form/src/hooks/useFormContext.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import { provide, inject } from 'vue';
 
 const key = Symbol('formElRef');

+ 0 - 16
langchat-ui/src/components/Form/src/hooks/useFormEvents.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import type { ComputedRef, Ref } from 'vue';
 import type { FormProps, FormSchema, FormActionType } from '../types/form';
 import { unref, toRaw } from 'vue';

+ 0 - 16
langchat-ui/src/components/Form/src/hooks/useFormValues.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import { isArray, isFunction, isObject, isString, isNullOrUnDef } from '@/utils/is';
 import { unref } from 'vue';
 import type { Ref, ComputedRef } from 'vue';

+ 0 - 16
langchat-ui/src/components/Form/src/props.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import type { CSSProperties, PropType } from 'vue';
 import { FormSchema } from './types/form';
 import type { GridProps, GridItemProps } from 'naive-ui/lib/grid';

+ 0 - 16
langchat-ui/src/components/Form/src/types/form.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import { ComponentType } from './index';
 import type { CSSProperties } from 'vue';
 import type { GridProps, GridItemProps } from 'naive-ui/lib/grid';

+ 0 - 16
langchat-ui/src/components/Form/src/types/index.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 export type ComponentType =
   | 'NInput'
   | 'NInputGroup'

+ 5 - 21
langchat-ui/src/components/IconPicker/index.vue

@@ -1,30 +1,14 @@
-<!--
-  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
-  -
-  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
-  - you may not use this file except in compliance with the License.
-  - You may obtain a copy of the License at
-  -
-  -     https://www.gnu.org/licenses/agpl-3.0.html
-  -
-  - Unless required by applicable law or agreed to in writing, software
-  - distributed under the License is distributed on an "AS IS" BASIS,
-  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  - See the License for the specific language governing permissions and
-  - limitations under the License.
-  -->
-
 <template>
   <n-popover placement="bottom-end" trigger="click">
     <template #trigger>
-      <n-input v-model:value="modelValue" clearable placeholder="点击选择图标" readonly>
+      <n-input v-model:value="modelValue" clearable readonly placeholder="点击选择图标">
         <template #suffix>
           <component :is="selectedIcon" class="ml-2 mr-2 cursor-pointer text-black" />
         </template>
       </n-input>
     </template>
     <template #header>
-      <n-input v-model:value="searchValue" placeholder="搜索图标" size="small" />
+      <n-input v-model:value="searchValue" size="small" placeholder="搜索图标" />
     </template>
     <div
       v-if="iconsList.length > 0"
@@ -34,19 +18,19 @@
       <span
         v-for="iconItem in iconsList"
         :key="iconItem.key"
-        class="hover:bg-gray-100 cursor-pointer text-xl p-1 flex justify-center items-center"
         @click="handleChange(iconItem)"
+        class="hover:bg-gray-100 cursor-pointer text-xl p-1 flex justify-center items-center"
       >
         <component :is="iconItem.value" />
       </span>
     </div>
     <n-pagination
+      size="small"
       v-model:page="curPage"
       :page-count="totalPages"
-      class="mt-1.5 mb-1.5"
-      size="small"
       @update:page="onUpdatePage"
       @update:page-size="onUpdatePageSize"
+      class="mt-1.5 mb-1.5"
     />
   </n-popover>
 </template>

+ 6 - 22
langchat-ui/src/components/Lockscreen/Lockscreen.vue

@@ -1,19 +1,3 @@
-<!--
-  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
-  -
-  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
-  - you may not use this file except in compliance with the License.
-  - You may obtain a copy of the License at
-  -
-  -     https://www.gnu.org/licenses/agpl-3.0.html
-  -
-  - Unless required by applicable law or agreed to in writing, software
-  - distributed under the License is distributed on an "AS IS" BASIS,
-  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  - See the License for the specific language governing permissions and
-  - limitations under the License.
-  -->
-
 <template>
   <div
     :class="{ onLockLogin: showLogin }"
@@ -36,8 +20,8 @@
       <recharge
         :battery="battery"
         :battery-status="batteryStatus"
-        :calc-charging-time="calcChargingTime"
         :calc-discharging-time="calcDischargingTime"
+        :calc-charging-time="calcChargingTime"
       />
 
       <div class="local-time">
@@ -62,21 +46,21 @@
         </n-avatar>
         <div class="username">{{ loginParams.username }}</div>
         <n-input
-          v-model:value="loginParams.password"
-          autofocus
-          placeholder="请输入登录密码"
           type="password"
+          autofocus
+          v-model:value="loginParams.password"
           @keyup.enter="onLogin"
+          placeholder="请输入登录密码"
         >
           <template #suffix>
-            <n-icon style="cursor: pointer" @click="onLogin">
+            <n-icon @click="onLogin" style="cursor: pointer">
               <LoadingOutlined v-if="loginLoading" />
               <arrow-right-outlined v-else />
             </n-icon>
           </template>
         </n-input>
 
-        <div v-if="isLoginError" class="flex w-full">
+        <div class="flex w-full" v-if="isLoginError">
           <span class="text-red-500">{{ errorMsg }}</span>
         </div>
 

+ 0 - 16
langchat-ui/src/components/Lockscreen/Recharge.vue

@@ -1,19 +1,3 @@
-<!--
-  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
-  -
-  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
-  - you may not use this file except in compliance with the License.
-  - You may obtain a copy of the License at
-  -
-  -     https://www.gnu.org/licenses/agpl-3.0.html
-  -
-  - Unless required by applicable law or agreed to in writing, software
-  - distributed under the License is distributed on an "AS IS" BASIS,
-  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  - See the License for the specific language governing permissions and
-  - limitations under the License.
-  -->
-
 <template>
   <div class="container">
     <div class="number">{{ battery.level }}%</div>

+ 0 - 16
langchat-ui/src/components/Lockscreen/index.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import LockScreen from './Lockscreen.vue';
 
 export { LockScreen };

+ 0 - 16
langchat-ui/src/components/Modal/index.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 export { default as basicModal } from './src/basicModal.vue';
 export { useModal } from './src/hooks/useModal';
 export * from './src/type';

+ 4 - 20
langchat-ui/src/components/Modal/src/basicModal.vue

@@ -1,31 +1,15 @@
-<!--
-  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
-  -
-  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
-  - you may not use this file except in compliance with the License.
-  - You may obtain a copy of the License at
-  -
-  -     https://www.gnu.org/licenses/agpl-3.0.html
-  -
-  - Unless required by applicable law or agreed to in writing, software
-  - distributed under the License is distributed on an "AS IS" BASIS,
-  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  - See the License for the specific language governing permissions and
-  - limitations under the License.
-  -->
-
 <template>
-  <n-modal id="basic-modal" v-model:show="isModal" v-bind="getBindValue" @close="onCloseModal">
+  <n-modal id="basic-modal" v-bind="getBindValue" v-model:show="isModal" @close="onCloseModal">
     <template #header>
-      <div id="basic-modal-bar" class="w-full cursor-move">{{ getBindValue.title }}</div>
+      <div class="w-full cursor-move" id="basic-modal-bar">{{ getBindValue.title }}</div>
     </template>
     <template #default>
       <slot name="default"></slot>
     </template>
-    <template v-if="!$slots.action" #action>
+    <template #action v-if="!$slots.action">
       <n-space>
         <n-button v-if="showCloseBtn" @click="closeModal">{{ subCloseText }}</n-button>
-        <n-button v-if="showSubBtn" :loading="subLoading" type="primary" @click="handleSubmit">{{
+        <n-button v-if="showSubBtn" type="primary" :loading="subLoading" @click="handleSubmit">{{
           subBtuText
         }}</n-button>
       </n-space>

+ 0 - 16
langchat-ui/src/components/Modal/src/hooks/useModal.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import { ref, unref, watch } from 'vue';
 import { isProdMode } from '@/utils/env';
 import { ModalMethods, UseModalReturnType } from '../type';

+ 0 - 16
langchat-ui/src/components/Modal/src/props.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import { NModal } from 'naive-ui';
 
 export const basicProps = {

+ 0 - 16
langchat-ui/src/components/Modal/src/type/index.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import type { DialogOptions } from 'naive-ui/lib/dialog';
 /**
  * @description: 弹窗对外暴露的方法

+ 8 - 24
langchat-ui/src/components/Resizer/DragRow.vue

@@ -1,20 +1,4 @@
-<!--
-  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
-  -
-  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
-  - you may not use this file except in compliance with the License.
-  - You may obtain a copy of the License at
-  -
-  -     https://www.gnu.org/licenses/agpl-3.0.html
-  -
-  - Unless required by applicable law or agreed to in writing, software
-  - distributed under the License is distributed on an "AS IS" BASIS,
-  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  - See the License for the specific language governing permissions and
-  - limitations under the License.
-  -->
-
-<script lang="ts" setup>
+<script setup lang="ts">
   import { ref, onMounted, onUnmounted, watch } from 'vue';
 
   const props = defineProps({
@@ -161,23 +145,23 @@
 </script>
 
 <template>
-  <div ref="dragerRef" :style="{ width: width, height: height }" class="drager_row">
-    <div :style="{ height: top + '%' }" class="drager_top">
+  <div class="drager_row" ref="dragerRef" :style="{ width: width, height: height }">
+    <div class="drager_top" :style="{ height: top + '%' }">
       <div>
         <slot name="top"></slot>
       </div>
     </div>
     <div
+      class="slider_row"
+      @touchstart.passive="mobileDragRow"
+      @mousedown="dragRow"
       :style="{
         height: sliderWidth + 'px',
         marginTop: -sliderWidth / 2 + 'px',
         marginBottom: -sliderWidth / 2 + 'px',
       }"
-      class="slider_row"
-      @mousedown="dragRow"
-      @touchstart.passive="mobileDragRow"
     ></div>
-    <div :style="`height: calc(${100 - top}% - 10px);`" class="drager_bottom">
+    <div class="drager_bottom" :style="`height: calc(${100 - top}% - 10px);`">
       <div>
         <slot name="bottom"></slot>
       </div>
@@ -185,7 +169,7 @@
   </div>
 </template>
 
-<style lang="less" scoped>
+<style scoped lang="less">
   .drager_row {
     overflow: hidden;
     box-sizing: border-box;

+ 0 - 16
langchat-ui/src/components/Resizer/index.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import DragRow from './DragRow.vue';
 
 export { DragRow };

+ 1 - 17
langchat-ui/src/components/SvgIcon/index.vue

@@ -1,20 +1,4 @@
-<!--
-  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
-  -
-  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
-  - you may not use this file except in compliance with the License.
-  - You may obtain a copy of the License at
-  -
-  -     https://www.gnu.org/licenses/agpl-3.0.html
-  -
-  - Unless required by applicable law or agreed to in writing, software
-  - distributed under the License is distributed on an "AS IS" BASIS,
-  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  - See the License for the specific language governing permissions and
-  - limitations under the License.
-  -->
-
-<script lang="ts" setup>
+<script setup lang="ts">
   import { computed, useAttrs } from 'vue';
   import { Icon } from '@iconify/vue';
 

+ 0 - 16
langchat-ui/src/components/Table/index.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 export { default as BasicTable } from './src/Table.vue';
 export { default as TableAction } from './src/components/TableAction.vue';
 export * from './src/types/table';

+ 8 - 24
langchat-ui/src/components/Table/src/Table.vue

@@ -1,19 +1,3 @@
-<!--
-  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
-  -
-  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
-  - you may not use this file except in compliance with the License.
-  - You may obtain a copy of the License at
-  -
-  -     https://www.gnu.org/licenses/agpl-3.0.html
-  -
-  - Unless required by applicable law or agreed to in writing, software
-  - distributed under the License is distributed on an "AS IS" BASIS,
-  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  - See the License for the specific language governing permissions and
-  - limitations under the License.
-  -->
-
 <template>
   <div class="table-toolbar">
     <!--顶部左侧区域-->
@@ -21,9 +5,9 @@
       <template v-if="title">
         <div class="table-toolbar-left-title">
           {{ title }}
-          <n-tooltip v-if="titleTooltip" trigger="hover">
+          <n-tooltip trigger="hover" v-if="titleTooltip">
             <template #trigger>
-              <n-icon class="ml-1 text-gray-400 cursor-pointer" size="18">
+              <n-icon size="18" class="ml-1 text-gray-400 cursor-pointer">
                 <QuestionCircleOutlined />
               </n-icon>
             </template>
@@ -66,10 +50,10 @@
         <template #trigger>
           <div class="table-toolbar-right-icon">
             <n-dropdown
-              v-model:value="tableSize"
-              :options="densityOptions"
-              trigger="click"
               @select="densitySelect"
+              trigger="click"
+              :options="densityOptions"
+              v-model:value="tableSize"
             >
               <n-icon size="18">
                 <ColumnHeightOutlined />
@@ -87,13 +71,13 @@
   <div class="s-table">
     <n-data-table
       ref="tableElRef"
-      :pagination="pagination"
-      :striped="isStriped"
       v-bind="getBindValues"
+      :striped="isStriped"
+      :pagination="pagination"
       @update:page="updatePage"
       @update:page-size="updatePageSize"
     >
-      <template v-for="item in Object.keys($slots)" :key="item" #[item]="data">
+      <template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
         <slot :name="item" v-bind="data"></slot>
       </template>
     </n-data-table>

+ 0 - 16
langchat-ui/src/components/Table/src/componentMap.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import type { Component } from 'vue';
 import {
   NInput,

+ 5 - 21
langchat-ui/src/components/Table/src/components/TableAction.vue

@@ -1,41 +1,25 @@
-<!--
-  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
-  -
-  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
-  - you may not use this file except in compliance with the License.
-  - You may obtain a copy of the License at
-  -
-  -     https://www.gnu.org/licenses/agpl-3.0.html
-  -
-  - Unless required by applicable law or agreed to in writing, software
-  - distributed under the License is distributed on an "AS IS" BASIS,
-  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  - See the License for the specific language governing permissions and
-  - limitations under the License.
-  -->
-
 <template>
   <div class="tableAction">
     <div class="flex items-center justify-center">
       <template v-for="(action, index) in getActions" :key="`${index}-${action.label}`">
-        <n-button class="mx-1" v-bind="action">
+        <n-button v-bind="action" class="mx-1">
           {{ action.label }}
-          <template v-if="action.hasOwnProperty('icon')" #icon>
+          <template #icon v-if="action.hasOwnProperty('icon')">
             <n-icon :component="action.icon" />
           </template>
         </n-button>
       </template>
       <n-dropdown
         v-if="dropDownActions && getDropdownList.length"
-        :options="getDropdownList"
         trigger="hover"
+        :options="getDropdownList"
         @select="select"
       >
         <slot name="more"></slot>
-        <n-button v-if="!$slots.more" class="mx-1" icon-placement="right" v-bind="getMoreProps">
+        <n-button v-bind="getMoreProps" class="mx-1" v-if="!$slots.more" icon-placement="right">
           <div class="flex items-center">
             <span>更多</span>
-            <n-icon class="ml-1" size="14">
+            <n-icon size="14" class="ml-1">
               <DownOutlined />
             </n-icon>
           </div>

+ 0 - 16
langchat-ui/src/components/Table/src/components/editable/CellComponent.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import type { FunctionalComponent, defineComponent } from 'vue';
 import type { ComponentType } from '../../types/componentType';
 import { componentMap } from '@/components/Table/src/componentMap';

+ 7 - 23
langchat-ui/src/components/Table/src/components/editable/EditableCell.vue

@@ -1,42 +1,26 @@
-<!--
-  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
-  -
-  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
-  - you may not use this file except in compliance with the License.
-  - You may obtain a copy of the License at
-  -
-  -     https://www.gnu.org/licenses/agpl-3.0.html
-  -
-  - Unless required by applicable law or agreed to in writing, software
-  - distributed under the License is distributed on an "AS IS" BASIS,
-  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  - See the License for the specific language governing permissions and
-  - limitations under the License.
-  -->
-
 <template>
   <div class="editable-cell">
     <div v-show="!isEdit" class="editable-cell-content" @click="handleEdit">
       {{ getValues }}
-      <n-icon v-if="!column.editRow" class="edit-icon">
+      <n-icon class="edit-icon" v-if="!column.editRow">
         <FormOutlined />
       </n-icon>
     </div>
-    <div v-show="isEdit" v-click-outside="onClickOutside" class="flex editable-cell-content">
+    <div class="flex editable-cell-content" v-show="isEdit" v-click-outside="onClickOutside">
       <div class="editable-cell-content-comp">
         <CellComponent
-          ref="elRef"
-          :class="getWrapperClass"
+          v-bind="getComponentProps"
           :component="getComponent"
           :popoverVisible="getRuleVisible"
-          :rule="getRule"
           :ruleMessage="ruleMessage"
-          v-bind="getComponentProps"
+          :rule="getRule"
+          :class="getWrapperClass"
+          ref="elRef"
           @options-change="handleOptionsChange"
           @press-enter="handleEnter"
         />
       </div>
-      <div v-if="!getRowEditable" class="editable-cell-action">
+      <div class="editable-cell-action" v-if="!getRowEditable">
         <n-icon class="mx-2 cursor-pointer">
           <CheckOutlined @click="handleSubmit" />
         </n-icon>

+ 0 - 16
langchat-ui/src/components/Table/src/components/editable/helper.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import { ComponentType } from '../../types/componentType';
 
 /**

+ 0 - 16
langchat-ui/src/components/Table/src/components/editable/index.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import type { BasicColumn } from '@/components/Table/src/types/table';
 import { h, Ref } from 'vue';
 

+ 11 - 27
langchat-ui/src/components/Table/src/components/settings/ColumnSetting.vue

@@ -1,24 +1,8 @@
-<!--
-  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
-  -
-  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
-  - you may not use this file except in compliance with the License.
-  - You may obtain a copy of the License at
-  -
-  -     https://www.gnu.org/licenses/agpl-3.0.html
-  -
-  - Unless required by applicable law or agreed to in writing, software
-  - distributed under the License is distributed on an "AS IS" BASIS,
-  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  - See the License for the specific language governing permissions and
-  - limitations under the License.
-  -->
-
 <template>
   <n-tooltip trigger="hover">
     <template #trigger>
       <div class="cursor-pointer table-toolbar-right-icon">
-        <n-popover :width="230" class="toolbar-popover" placement="bottom-end" trigger="click">
+        <n-popover trigger="click" :width="230" class="toolbar-popover" placement="bottom-end">
           <template #trigger>
             <n-icon size="18">
               <SettingOutlined />
@@ -33,7 +17,7 @@
                 <n-checkbox v-model:checked="selection" @update:checked="onSelection"
                   >勾选列</n-checkbox
                 >
-                <n-button class="mt-1" size="small" text type="info" @click="resetColumns"
+                <n-button text type="info" size="small" class="mt-1" @click="resetColumns"
                   >重置</n-button
                 >
               </n-space>
@@ -43,36 +27,36 @@
             <n-checkbox-group v-model:value="checkList" @update:value="onChange">
               <Draggable
                 v-model="columnsList"
-                :move="onMove"
                 animation="300"
-                filter=".no-draggable"
                 item-key="key"
+                filter=".no-draggable"
+                :move="onMove"
                 @end="draggableEnd"
               >
                 <template #item="{ element }">
                   <div
+                    class="table-toolbar-outer-checkbox"
                     :class="{
                       'table-toolbar-outer-checkbox-dark': getDarkTheme === true,
                       'no-draggable': element.draggable === false,
                     }"
-                    class="table-toolbar-outer-checkbox"
                   >
                     <span
-                      :class="{ 'drag-icon-hidden': element.draggable === false }"
                       class="drag-icon"
+                      :class="{ 'drag-icon-hidden': element.draggable === false }"
                     >
                       <n-icon size="18">
                         <DragOutlined />
                       </n-icon>
                     </span>
-                    <n-checkbox :label="element.title" :value="element.key" />
+                    <n-checkbox :value="element.key" :label="element.title" />
                     <div class="fixed-item">
-                      <n-tooltip placement="bottom" trigger="hover">
+                      <n-tooltip trigger="hover" placement="bottom">
                         <template #trigger>
                           <n-icon
+                            size="18"
                             :color="element.fixed === 'left' ? '#2080f0' : undefined"
                             class="cursor-pointer"
-                            size="18"
                             @click="fixedColumn(element, 'left')"
                           >
                             <VerticalRightOutlined />
@@ -81,12 +65,12 @@
                         <span>固定到左侧</span>
                       </n-tooltip>
                       <n-divider vertical />
-                      <n-tooltip placement="bottom" trigger="hover">
+                      <n-tooltip trigger="hover" placement="bottom">
                         <template #trigger>
                           <n-icon
+                            size="18"
                             :color="element.fixed === 'right' ? '#2080f0' : undefined"
                             class="cursor-pointer"
-                            size="18"
                             @click="fixedColumn(element, 'right')"
                           >
                             <VerticalLeftOutlined />

+ 0 - 16
langchat-ui/src/components/Table/src/const.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import componentSetting from '@/settings/componentSetting';
 
 const { table } = componentSetting;

+ 0 - 16
langchat-ui/src/components/Table/src/hooks/useColumns.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import { ref, Ref, ComputedRef, unref, computed, watch, toRaw, h } from 'vue';
 import type { BasicColumn, BasicTableProps } from '../types/table';
 import { isEqual, cloneDeep } from 'lodash-es';

+ 0 - 16
langchat-ui/src/components/Table/src/hooks/useDataSource.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import { computed, ComputedRef, onMounted, ref, unref, watch, watchEffect } from 'vue';
 import type { BasicTableProps } from '../types/table';
 import type { PaginationProps } from '../types/pagination';

+ 0 - 16
langchat-ui/src/components/Table/src/hooks/useLoading.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import { ref, ComputedRef, unref, computed, watch } from 'vue';
 import type { BasicTableProps } from '../types/table';
 

+ 0 - 16
langchat-ui/src/components/Table/src/hooks/usePagination.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import type { PaginationProps } from '../types/pagination';
 import type { BasicTableProps } from '../types/table';
 import { computed, unref, ref, ComputedRef, watch } from 'vue';

+ 0 - 16
langchat-ui/src/components/Table/src/hooks/useTableContext.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import type { Ref } from 'vue';
 import type { BasicTableProps, TableActionType } from '../types/table';
 import { provide, inject, ComputedRef } from 'vue';

+ 0 - 16
langchat-ui/src/components/Table/src/props.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import type { PropType } from 'vue';
 import { propTypes } from '@/utils/propTypes';
 import { BasicColumn } from './types/table';

+ 0 - 16
langchat-ui/src/components/Table/src/types/componentType.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 export type ComponentType =
   | 'NInput'
   | 'NInputNumber'

+ 0 - 16
langchat-ui/src/components/Table/src/types/pagination.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 export interface PaginationProps {
   page?: number; //受控模式下的当前页
   itemCount?: number; //总条数

+ 0 - 16
langchat-ui/src/components/Table/src/types/table.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import type { InternalRowData, TableBaseColumn } from 'naive-ui/lib/data-table/src/interface';
 import { ComponentType } from './componentType';
 export interface BasicColumn<T = InternalRowData> extends TableBaseColumn<T> {

+ 0 - 16
langchat-ui/src/components/Table/src/types/tableAction.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import { NButton } from 'naive-ui';
 import type { Component } from 'vue';
 import { PermissionsEnum } from '@/enums/permissionsEnum';

+ 0 - 16
langchat-ui/src/components/Upload/index.ts

@@ -1,17 +1 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 export { default as BasicUpload } from './src/BasicUpload.vue';

+ 12 - 28
langchat-ui/src/components/Upload/src/BasicUpload.vue

@@ -1,39 +1,23 @@
-<!--
-  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
-  -
-  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
-  - you may not use this file except in compliance with the License.
-  - You may obtain a copy of the License at
-  -
-  -     https://www.gnu.org/licenses/agpl-3.0.html
-  -
-  - Unless required by applicable law or agreed to in writing, software
-  - distributed under the License is distributed on an "AS IS" BASIS,
-  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  - See the License for the specific language governing permissions and
-  - limitations under the License.
-  -->
-
 <template>
   <div class="w-full">
     <div class="upload">
       <div class="upload-card">
         <!--图片列表-->
         <div
+          class="upload-card-item"
+          :style="getCSSProperties"
           v-for="(item, index) in imgList"
           :key="`img_${index}`"
-          :style="getCSSProperties"
-          class="upload-card-item"
         >
           <div class="upload-card-item-info">
             <div class="img-box">
               <img :src="item" />
             </div>
             <div class="img-box-actions">
-              <n-icon class="mx-2 action-icon" size="18" @click="preview(item)">
+              <n-icon size="18" class="mx-2 action-icon" @click="preview(item)">
                 <EyeOutlined />
               </n-icon>
-              <n-icon class="mx-2 action-icon" size="18" @click="remove(index)">
+              <n-icon size="18" class="mx-2 action-icon" @click="remove(index)">
                 <DeleteOutlined />
               </n-icon>
             </div>
@@ -42,18 +26,18 @@
 
         <!--上传图片-->
         <div
-          v-if="imgList.length < maxNumber"
-          :style="getCSSProperties"
           class="upload-card-item upload-card-item-select-picture"
+          :style="getCSSProperties"
+          v-if="imgList.length < maxNumber"
         >
           <n-upload
-            :file-list-style="{ display: 'none' }"
             v-bind="$props"
-            @finish="finish"
+            :file-list-style="{ display: 'none' }"
             @before-upload="beforeUpload"
+            @finish="finish"
           >
             <div class="flex flex-col justify-center">
-              <n-icon class="m-auto" size="18">
+              <n-icon size="18" class="m-auto">
                 <PlusOutlined />
               </n-icon>
               <span class="upload-title">上传图片</span>
@@ -65,7 +49,7 @@
 
     <!--上传图片-->
     <n-space>
-      <n-alert v-if="helpText" class="flex w-full" title="提示" type="info">
+      <n-alert title="提示" type="info" v-if="helpText" class="flex w-full">
         {{ helpText }}
       </n-alert>
     </n-space>
@@ -74,10 +58,10 @@
   <!--预览图片-->
   <n-modal
     v-model:show="showModal"
-    :bordered="false"
-    :style="{ width: '520px' }"
     preset="card"
     title="预览"
+    :bordered="false"
+    :style="{ width: '520px' }"
   >
     <img :src="previewUrl" />
   </n-modal>

+ 0 - 16
langchat-ui/src/components/Upload/src/props.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 import type { PropType } from 'vue';
 import { NUpload } from 'naive-ui';
 

+ 0 - 16
langchat-ui/src/components/Upload/src/type/index.ts

@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
- *
- * Licensed under the GNU Affero General Public License, Version 3 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gnu.org/licenses/agpl-3.0.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 export interface BasicProps {
   title?: string;
   dataSource: Function;