CzRger 2 ヶ月 前
コミット
b4acbbcb12

+ 2 - 2
src/components/czr-ui/CzrFormColumn.vue

@@ -6,7 +6,7 @@
     <el-form-item :label="label" :label-width="labelWidthCpt" :class="{
       ['link_' + link + ($attrs.type ? '_' + $attrs.type : '')]: true,
       required: required !== false,
-      'no-label': (labelWidth == 0 || labelWidth === '0px') && !isValue(label) && !$slots.label,
+      'no-label': labelWidth === '0px' && !isValue(label) && !$slots.label,
       'is-error': !!state.errorMessage,
       [`layout-${layout || formLayout}`]: true
     }" :error="state.errorMessage" :required="required">
@@ -238,7 +238,7 @@ const props = defineProps({
   param: {},  // 绑定值
   label: {type: String, default: ''}, // 标题
   required: {default: false}, // 必填项
-  labelWidth: {type: [String, Number], default: ''},  // 标题宽度
+  labelWidth: {type: String, default: ''},  // 标题宽度
   link: {type: String, default: 'input', validator(val: string) {
       return ['cascader', 'checkbox', 'date', 'datetime', 'input', 'radio', 'select', 'switch', 'dept', 'time', 'upload', 'number', 'input-number', 'tree-select', 'rich', 'area'].includes(val)
     }

+ 2 - 2
src/layout/top-left/head/index.vue

@@ -5,8 +5,8 @@
     </div>
     <div class="title">{{titleCpt}}</div>
     <div class="menus">
-      <template v-for="item in menusCpt.children">
-        <div class="menu-item __hover" :class="{active: $route.matched.some(v => v.path === item.path)}" @click="$router.push(item.path)">
+      <template v-for="item in menusCpt.children.filter(v => !v.meta.single)">
+        <div class="menu-item __hover" :class="{active: $route.matched.some(v => v.path === item.path) || $route.meta.root === item.name}" @click="$router.push(item.path)">
           {{item.meta.title}}
         </div>
       </template>

+ 21 - 1
src/router/modules/big-model.ts

@@ -29,7 +29,27 @@ const BigModelRouter = [
     component: () => import('@/views/manage/knowledge/index.vue'),
     meta: {
       title: '知识库',
-    },
+    }
+  },
+  {
+    path: '/knowledge/:id/document',
+    name: '78430247-a531-4c8f-8a08-c88e93a836e2',
+    component: () => import('@/views/manage/knowledge/documents/index.vue'),
+    meta: {
+      title: '知识库文档',
+      single: true,
+      root: '4342bfff-1ea8-4f4c-b562-3cdc1fde116f'
+    }
+  },
+  {
+    path: '/knowledge/:id/upload',
+    name: '18e6009c-a72c-4359-864b-e7725fccca69',
+    component: () => import('@/views/manage/knowledge/upload/index.vue'),
+    meta: {
+      title: '知识库文档上传',
+      single: true,
+      root: '4342bfff-1ea8-4f4c-b562-3cdc1fde116f'
+    }
   },
   {
     path: '/center',

+ 2 - 2
src/stores/modules/dialog.ts

@@ -28,10 +28,10 @@ export const useDialogStore = defineStore('dialog', {
         newDom.style.display = 'unset'
       }
     },
-    confirm({title, content, onSubmit, onCancel = () => {}}) {
+    confirm({title = '提示', content, onSubmit, onCancel = () => {}}) {
       this.confirmParam = {
         show: true,
-        title: title || '提示',
+        title: title,
         content,
         onSubmit: onSubmit,
         onCancel: onCancel

+ 1 - 0
src/style/czr.scss

@@ -365,6 +365,7 @@
           font-weight: bold;
           font-size: 1rem;
           color: #333333;
+          line-height: 1.3rem;
         }
       }
       .__czr-confirm-foot {

+ 4 - 2
src/views/global/login/index.vue

@@ -5,7 +5,7 @@
       <div class="flex flex flex-col w-[26.5rem]">
         <div class="font-bold text-[1.88rem] text-[#373D4C]">欢迎您登录</div>
         <div class="font-bold text-[1.88rem] text-[#3363DE] mt-4">{{ titleCpt }}</div>
-        <CzrForm :label-width="0" ref="ref_form" @handleEnter="onLogin">
+        <CzrForm label-width="0px" ref="ref_form" @handleEnter="onLogin">
           <div class="w-full mt-8">
             <CzrFormColumn
               required
@@ -52,7 +52,9 @@ const onLogin = () => {
   if (!state.loading) {
     ref_form.value.submit().then(() => {
       state.loading = true
-
+      ElMessage.success('登录成功!')
+      localStorage.setItem('bm_token', 'token')
+      window.location.replace(`/${import.meta.env.VITE_BASE}/`);
     }).catch((e) => {
       ElMessage({
         message: e[0].message,

+ 29 - 22
src/views/manage/knowledge/detail.vue

@@ -3,7 +3,6 @@
     :show="show"
     :title="titleCpt"
     @onClose="$emit('update:show', false)"
-    @onSubmit="onSubmit"
     width="62.5rem"
     height="auto"
     max-height="36rem"
@@ -12,10 +11,10 @@
     :show-close="false"
   >
     <template #foot>
-      <div class="__czr-dialog-foot_submit __hover" v-if="transfer.mode === 'add'" @click="onCreate(true)">创建并导入</div>
-      <div class="__czr-dialog-foot_cancel __hover" v-if="transfer.mode === 'add'" @click="onCreate(false)">完成创建</div>
-      <div class="__czr-dialog-foot_cancel __hover" v-if="transfer.mode === 'edit'" @click="onSubmit">保存</div>
-      <div class="__czr-dialog-foot_cancel __hover">取消</div>
+      <div class="__czr-dialog-foot_submit __hover" v-if="transfer.mode === 'add'" @click="onSubmit(true)">创建并导入</div>
+      <div class="__czr-dialog-foot_cancel __hover" v-if="transfer.mode === 'add'" @click="onSubmit(false)">完成创建</div>
+      <div class="__czr-dialog-foot_submit __hover" v-if="transfer.mode === 'edit'" @click="onSubmit(false)">保存</div>
+      <div class="__czr-dialog-foot_cancel __hover" @click="$emit('update:show', false)">取消</div>
     </template>
     <div class="bm-form">
       <div class="__czr-title_1">基本信息</div>
@@ -51,9 +50,12 @@
 <script setup lang="ts">
 import {computed, getCurrentInstance, nextTick, reactive, ref, watch} from "vue";
 import {ElMessage, ElMessageBox} from "element-plus";
-import {useDictionaryStore} from "@/stores";
+import {useDialogStore, useDictionaryStore} from "@/stores";
+import {useRouter} from "vue-router";
 
+const router = useRouter()
 const DictionaryStore = useDictionaryStore();
+const DialogStore = useDialogStore();
 const emit = defineEmits(['update:show', 'refresh'])
 const {proxy} = getCurrentInstance()
 const props = defineProps({
@@ -70,7 +72,7 @@ const titleCpt = computed(() => {
   switch (props.transfer.mode) {
     case 'add': t = '创建' + t
       break
-    case 'edit': t = t + '编辑'
+    case 'edit': t = '编辑' + t
       break
     case 'view': t = '查看' + t
       break
@@ -94,19 +96,27 @@ const initDictionary = () => {
 }
 const initData = () => {
 }
-const onSubmit = () => {
+const onSubmit = (isImport) => {
   ref_form.value.submit().then(() => {
-    ElMessageBox.confirm("是否提交?", "提示", {
-      confirmButtonText: "是",
-      cancelButtonText: "否",
-      type: "warning",
-    } as any).then(() => {
-      state.loading = true
-      ElMessage.success('新增成功!')
-      emit('update:show', false)
-      emit('refresh')
-      state.loading = false
-    }).catch(() => {})
+    DialogStore.confirm({
+      content: `请确认是否${titleCpt.value}?${isImport ? '创建成功后将自动跳转至文档上传页面!' : ''}`,
+      onSubmit: () => {
+        state.loading = true
+        ElMessage.success(`${titleCpt.value}成功!`)
+        if (isImport) {
+          router.push({
+            name: '18e6009c-a72c-4359-864b-e7725fccca69',
+            params: {
+              id: '知识库ID'
+            }
+          })
+        } else {
+          emit('update:show', false)
+          emit('refresh')
+        }
+        state.loading = false
+      }
+    })
   }).catch((e) => {
     ElMessage({
       message: e[0].message,
@@ -115,9 +125,6 @@ const onSubmit = () => {
     })
   })
 }
-const onCreate = (isImport) => {
-
-}
 </script>
 
 <style lang="scss" scoped>

+ 22 - 0
src/views/manage/knowledge/documents/index.vue

@@ -0,0 +1,22 @@
+<template>
+  知识库文档
+</template>
+
+<script setup lang="ts">
+import {getCurrentInstance, onMounted, reactive, ref} from "vue";
+import {useRoute} from "vue-router";
+
+const route = useRoute();
+const emits = defineEmits([])
+const props = defineProps({})
+const {proxy}: any = getCurrentInstance()
+const state: any = reactive({
+  ID: route.params.id
+})
+onMounted(() => {
+  console.log(state.ID)
+})
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 4 - 4
src/views/manage/knowledge/index.vue

@@ -9,12 +9,12 @@
         <div class="__hover text-[0.88rem] text-[#576275] flex items-center gap-[0.3rem]" @click="state.query.form.isStar = !state.query.form.isStar">
           <SvgIcon name="star" size="15" class="mb-[2px]" :active="state.query.form.isStar"/>我的收藏
         </div>
-        <CzrForm class="bm-filter" label-width="" @handleEnter="onSearch">
+        <CzrForm class="bm-filter" label-width="0px" @handleEnter="onSearch">
           <CzrFormColumn
             width="6.68rem"
             class="__czr-table-form-column"
             :span="24"
-            :label-width="0"
+            label-width="0px"
             v-model:param="state.query.form.group"
             link="select"
             :options="DictionaryStore.knowledgeGroups.list"
@@ -24,7 +24,7 @@
             width="6.68rem"
             class="__czr-table-form-column"
             :span="24"
-            :label-width="0"
+            label-width="0px"
             v-model:param="state.query.form.tag"
             link="select"
             :options="DictionaryStore.knowledgeTags.list"
@@ -34,7 +34,7 @@
             width="15.63rem"
             class="__czr-table-form-column"
             :span="24"
-            :label-width="0"
+            label-width="0px"
             v-model:param="state.text"
             placeholder="按名称搜索"
             :prefix-icon="Search"

+ 2 - 2
src/views/manage/knowledge/tags-select.vue

@@ -23,7 +23,7 @@
           <CzrFormColumn
             class="__czr-table-form-column"
             :span="24"
-            :label-width="0"
+            label-width="0px"
             v-model:param="state.text"
             placeholder="搜索或者创建"
             :prefix-icon="Search"
@@ -79,7 +79,7 @@
         <template v-if="item.__edit">
           <div class="w-[17rem] border border-[var(--czr-border-color)] rounded">
             <CzrFormColumn
-              :label-width="0"
+              label-width="0px"
               :span="24"
               v-model:param="item.__value"
               :transparent="true"

+ 22 - 0
src/views/manage/knowledge/upload/index.vue

@@ -0,0 +1,22 @@
+<template>
+  文档上传
+</template>
+
+<script setup lang="ts">
+import {getCurrentInstance, onMounted, reactive, ref} from "vue";
+import {useRoute} from "vue-router";
+
+const route = useRoute();
+const emits = defineEmits([])
+const props = defineProps({})
+const {proxy}: any = getCurrentInstance()
+const state: any = reactive({
+  ID: route.params.id
+})
+onMounted(() => {
+  console.log(state.ID)
+})
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 1 - 1
src/views/workflow/chart/panel-index.vue

@@ -8,7 +8,7 @@
       <div class="panel-sub">
         <CzrFormColumn
           :span="24"
-          label-width="0"
+          label-width="0px"
           v-model:param="state.nodeData.subTitle"
           :transparent="true"
           placeholder="副标题..."

+ 1 - 1
src/views/workflow/instance/component/condition/condition-item.vue

@@ -22,7 +22,7 @@
           <template v-if="item.type === ConditionType.Constant">
             <CzrFormColumn
               :span="24"
-              label-width="0"
+              label-width="0px"
               :link="item.source.type === 'Number' ? 'number' : 'input'"
               v-model:param="item.target"
               :transparent="true"