Browse Source

修改样式及处理空值bug

yangg 10 months ago
parent
commit
cf60a436fc
47 changed files with 283 additions and 78 deletions
  1. 1 1
      .env.development
  2. 0 0
      dist/index.html
  3. 0 0
      dist/static/css/app.9043fc22.css
  4. 0 0
      dist/static/css/chunk-1c5bf07a.eba2c7e2.css
  5. 1 0
      dist/static/css/chunk-39f7be9b.cc8cc0e5.css
  6. 0 0
      dist/static/css/chunk-5b1b00c6.8d28e945.css
  7. 0 0
      dist/static/css/chunk-6155c71d.302b0d08.css
  8. 0 0
      dist/static/css/chunk-85e7670e.a5bdf00d.css
  9. 0 0
      dist/static/css/chunk-980050cc.ce959b8e.css
  10. 0 0
      dist/static/css/chunk-aeb9b426.7131743c.css
  11. 0 1
      dist/static/css/chunk-d90be7d8.1b9b8d87.css
  12. 0 0
      dist/static/js/app.3f12196b.js
  13. 0 0
      dist/static/js/app.806fb5ce.js
  14. 0 0
      dist/static/js/chunk-0aa2436e.6fa37c3f.js
  15. 0 0
      dist/static/js/chunk-1c5bf07a.c38585e2.js
  16. 0 0
      dist/static/js/chunk-2b49eda5.1cb3dd72.js
  17. 0 0
      dist/static/js/chunk-39f7be9b.36eca0e0.js
  18. 0 0
      dist/static/js/chunk-5b1b00c6.a0b97a22.js
  19. 0 0
      dist/static/js/chunk-5de18842.d93322ad.js
  20. 0 0
      dist/static/js/chunk-6155c71d.0287d6b6.js
  21. 0 0
      dist/static/js/chunk-6d4c5c86.84dfc822.js
  22. 0 0
      dist/static/js/chunk-795b9239.a0f3f90a.js
  23. 0 0
      dist/static/js/chunk-85e7670e.cc79b952.js
  24. 0 0
      dist/static/js/chunk-980050cc.24df6813.js
  25. 0 0
      dist/static/js/chunk-aeb9b426.5baa1efb.js
  26. 0 0
      dist/static/js/chunk-d90be7d8.d1d439fb.js
  27. 0 0
      dist/static/js/chunk-f9aa40ec.702e8cb7.js
  28. 18 0
      src/api/applet.js
  29. 10 0
      src/api/knowledge.js
  30. 1 0
      src/components/RightPanel/index.vue
  31. 1 1
      src/layout/components/Navbar.vue
  32. 1 1
      src/layout/components/Sidebar/Logo.vue
  33. 20 0
      src/layout/components/Sidebar/SidebarItem.vue
  34. 20 0
      src/layout/components/Sidebar/index.vue
  35. 2 2
      src/layout/components/TagsView/index.vue
  36. 10 2
      src/router/index.js
  37. 35 0
      src/styles/element-ui.scss
  38. 21 2
      src/styles/sidebar.scss
  39. 2 2
      src/styles/variables.scss
  40. 40 3
      src/views/applet/index.vue
  41. 1 1
      src/views/dashboard/admin/index.vue
  42. 1 1
      src/views/dashboard/editor/index.vue
  43. 1 0
      src/views/document/com/editor.vue
  44. 18 9
      src/views/document/com/menus.vue
  45. 23 18
      src/views/document/create.vue
  46. 1 1
      src/views/document/temList/components/dataList.vue
  47. 55 33
      src/views/knowledgeMenu/category/components/dataList.vue

+ 1 - 1
.env.development

@@ -2,5 +2,5 @@
 ENV = 'development'
 ENV = 'development'
 port = 8080
 port = 8080
 # base api
 # base api
-VUE_APP_BASE_API = 'http://192.168.1.178:8000'
+VUE_APP_BASE_API = 'http://120.46.190.49:8000'
 #192.168.1.178
 #192.168.1.178

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.9043fc22.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-1c5bf07a.eba2c7e2.css


+ 1 - 0
dist/static/css/chunk-39f7be9b.cc8cc0e5.css

@@ -0,0 +1 @@
+.search-list-form[data-v-1536cacc]{padding:20px}

+ 0 - 0
dist/static/css/chunk-6d4c5c86.8d28e945.css → dist/static/css/chunk-5b1b00c6.8d28e945.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-6155c71d.302b0d08.css


+ 0 - 0
dist/static/css/chunk-f9aa40ec.a5bdf00d.css → dist/static/css/chunk-85e7670e.a5bdf00d.css


+ 0 - 0
dist/static/css/chunk-795b9239.ce959b8e.css → dist/static/css/chunk-980050cc.ce959b8e.css


+ 0 - 0
dist/static/css/chunk-0aa2436e.7131743c.css → dist/static/css/chunk-aeb9b426.7131743c.css


+ 0 - 1
dist/static/css/chunk-d90be7d8.1b9b8d87.css

@@ -1 +0,0 @@
-.search-list-form[data-v-05923cdc]{padding:20px}

File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.3f12196b.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.806fb5ce.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-0aa2436e.6fa37c3f.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-1c5bf07a.c38585e2.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-2b49eda5.1cb3dd72.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-39f7be9b.36eca0e0.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-5b1b00c6.a0b97a22.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-5de18842.d93322ad.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-6155c71d.0287d6b6.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-6d4c5c86.84dfc822.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-795b9239.a0f3f90a.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-85e7670e.cc79b952.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-980050cc.24df6813.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-aeb9b426.5baa1efb.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-d90be7d8.d1d439fb.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-f9aa40ec.702e8cb7.js


+ 18 - 0
src/api/applet.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request'
+
+export function getInfoList(data) {
+    return request({
+      url: '/wechat/getInfoList',
+      method: 'post',
+      data
+    })
+  }
+  
+  /* 删除 */
+  export function deleteUserInfo(data) {
+    return request({
+      url: '/wechat/deleteUserInfo',
+      method: 'post',
+      data
+    })
+  }

+ 10 - 0
src/api/knowledge.js

@@ -109,4 +109,14 @@ export function getSuffixName(data) {
     method: 'post',
     method: 'post',
     data
     data
   })
   })
+}
+
+/* 通过id查询状态 /kbm/getRunStatus */
+
+export function getRunStatus(data) {
+  return request({
+    url: '/kbm/getRunStatus',
+    method: 'post',
+    data
+  })
 }
 }

+ 1 - 0
src/components/RightPanel/index.vue

@@ -125,6 +125,7 @@ export default {
 }
 }
 
 
 .handle-button {
 .handle-button {
+  display: none;
   width: 48px;
   width: 48px;
   height: 48px;
   height: 48px;
   position: absolute;
   position: absolute;

+ 1 - 1
src/layout/components/Navbar.vue

@@ -78,7 +78,7 @@ export default {
   overflow: hidden;
   overflow: hidden;
   position: relative;
   position: relative;
   background: #fff;
   background: #fff;
-  box-shadow: 0 1px 4px rgba(0,21,41,.08);
+/*   box-shadow: 0 1px 4px rgba(0,21,41,.08); */
 
 
   .hamburger-container {
   .hamburger-container {
     line-height: 46px;
     line-height: 46px;

+ 1 - 1
src/layout/components/Sidebar/Logo.vue

@@ -48,7 +48,7 @@ export default {
   width: 100%;
   width: 100%;
   height: 50px;
   height: 50px;
   line-height: 50px;
   line-height: 50px;
-  background: #2b2f3a;
+  background: #0c4a6e;
   text-align: center;
   text-align: center;
   overflow: hidden;
   overflow: hidden;
 
 

+ 20 - 0
src/layout/components/Sidebar/SidebarItem.vue

@@ -93,3 +93,23 @@ export default {
   }
   }
 }
 }
 </script>
 </script>
+<style scoped>
+.el-menu {
+  background-color: #0c4a6e !important;
+}
+
+.el-menu-item {
+  background-color: #0c4a6e !important;
+}
+
+.el-submenu .el-menu {
+  background-color: #0c4a6e !important;
+}
+
+.el-menu-item:hover, .el-submenu__title:hover {
+  background-color: #0c4a6e !important;
+}
+.nest-menu .el-menu-item{
+  background-color: #0c4a6e !important;
+}
+</style>

+ 20 - 0
src/layout/components/Sidebar/index.vue

@@ -52,3 +52,23 @@ export default {
   }
   }
 }
 }
 </script>
 </script>
+<style scoped>
+.el-scrollbar{
+  background-color: #0c4a6e !important;
+}
+.el-menu {
+  background-color: #0c4a6e !important;
+}
+
+.el-menu-item {
+  background-color: #0c4a6e !important;
+}
+
+.el-submenu .el-menu {
+  background-color: #0c4a6e !important;
+}
+
+.el-menu-item:hover, .el-submenu__title:hover {
+  background-color: #0c4a6e !important;
+}
+</style>

+ 2 - 2
src/layout/components/TagsView/index.vue

@@ -225,9 +225,9 @@ export default {
         margin-right: 15px;
         margin-right: 15px;
       }
       }
       &.active {
       &.active {
-        background-color: #42b983;
+        background-color: #3cbade;
         color: #fff;
         color: #fff;
-        border-color: #42b983;
+        border-color: #3cbade;
         &::before {
         &::before {
           content: '';
           content: '';
           background: #fff;
           background: #fff;

+ 10 - 2
src/router/index.js

@@ -105,6 +105,13 @@ export const constantRoutes = [
     hidden:true,
     hidden:true,
     meta: { title: '创建文档',  noCache: true }
     meta: { title: '创建文档',  noCache: true }
   },
   },
+  {
+    path: '/infoList',
+    component: () => import('@/views/knowledgeMenu/category/infoList'),
+    name: 'infoList',
+    hidden:true,
+    meta: { title: '解析块',  noCache: true }
+  },
   {
   {
     path: '/error',
     path: '/error',
     component: Layout,
     component: Layout,
@@ -295,6 +302,7 @@ export const asyncRoutes = [
       }, */
       }, */
     ]
     ]
   },
   },
+ 
   {
   {
     path: '/knowledge',
     path: '/knowledge',
     component: Layout,
     component: Layout,
@@ -318,13 +326,13 @@ export const asyncRoutes = [
         hidden:true,
         hidden:true,
         meta: { title: '知识库配置',  noCache: true ,roles: ['admin']}
         meta: { title: '知识库配置',  noCache: true ,roles: ['admin']}
       },
       },
-      {
+      /* {
         path: 'category/infoList',
         path: 'category/infoList',
         component: () => import('@/views/knowledgeMenu/category/infoList'),
         component: () => import('@/views/knowledgeMenu/category/infoList'),
         name: 'KBM_info',
         name: 'KBM_info',
         hidden:true,
         hidden:true,
         meta: { title: '解析块',  noCache: true ,roles: ['admin']}
         meta: { title: '解析块',  noCache: true ,roles: ['admin']}
-      }
+      } */
     ]
     ]
   },
   },
     {
     {

+ 35 - 0
src/styles/element-ui.scss

@@ -82,3 +82,38 @@
 .el-range-separator {
 .el-range-separator {
   box-sizing: content-box;
   box-sizing: content-box;
 }
 }
+
+.el-button{
+  background-color: #3cbade;
+}
+.el-button:hover{
+  background-color: #339ebd;
+}
+.el-button--primary{
+  background-color: #3cbade;
+}
+.el-button--primary:hover{
+  background-color: #339ebd;
+}
+
+.el-button--danger{
+  background-color: #fa5944 !important;
+}
+.el-button--danger:hover{
+  background-color: #d54c3a !important;
+}
+.el-button--success{
+  background-color: #3cbade;
+}
+.el-button--success:hover{
+  background-color: #339ebd;
+}
+
+.el-pagination.is-background .el-pager li:not(.disabled).active{
+  background-color: #339ebd !important;
+}
+
+.data-list .page-info{
+  margin-top: 40px !important;
+  justify-content: flex-end;
+}

+ 21 - 2
src/styles/sidebar.scss

@@ -66,6 +66,11 @@
       border: none;
       border: none;
       height: 100%;
       height: 100%;
       width: 100% !important;
       width: 100% !important;
+      .el-submenu{
+        .el-submenu__title{
+          background-color: $subMenuBg !important;
+        }
+      }
     }
     }
 
 
     // menu hover
     // menu hover
@@ -77,17 +82,31 @@
     }
     }
 
 
     .is-active>.el-submenu__title {
     .is-active>.el-submenu__title {
+    
+      background-color: $subMenuBg !important;
       color: $subMenuActiveText !important;
       color: $subMenuActiveText !important;
     }
     }
 
 
     & .nest-menu .el-submenu>.el-submenu__title,
     & .nest-menu .el-submenu>.el-submenu__title,
     & .el-submenu .el-menu-item {
     & .el-submenu .el-menu-item {
+        padding-left: 60px !important;
       min-width: $sideBarWidth !important;
       min-width: $sideBarWidth !important;
       background-color: $subMenuBg !important;
       background-color: $subMenuBg !important;
-
       &:hover {
       &:hover {
         background-color: $subMenuHover !important;
         background-color: $subMenuHover !important;
       }
       }
+      &::after {
+        content: "";
+        position: absolute;
+        left: 40px;
+        top: 50%;
+        -webkit-transform: translateY(-50%);
+        transform: translateY(-50%);
+        height: 4px;
+        width: 4px;
+        border-radius: 50px;
+        background-color: #cedce4;
+      }
     }
     }
   }
   }
 
 
@@ -121,6 +140,7 @@
       overflow: hidden;
       overflow: hidden;
 
 
       &>.el-submenu__title {
       &>.el-submenu__title {
+        background-color: $subMenuBg !important;
         padding: 0 !important;
         padding: 0 !important;
 
 
         .svg-icon {
         .svg-icon {
@@ -196,7 +216,6 @@
       margin-left: -2px;
       margin-left: -2px;
     }
     }
   }
   }
-
   .nest-menu .el-submenu>.el-submenu__title,
   .nest-menu .el-submenu>.el-submenu__title,
   .el-menu-item {
   .el-menu-item {
     &:hover {
     &:hover {

+ 2 - 2
src/styles/variables.scss

@@ -16,8 +16,8 @@ $subMenuActiveText:#f4f4f5; // https://github.com/ElemeFE/element/issues/12951
 $menuBg:#304156;
 $menuBg:#304156;
 $menuHover:#263445;
 $menuHover:#263445;
 
 
-$subMenuBg:#1f2d3d;
-$subMenuHover:#001528;
+$subMenuBg:#0c4a6e;
+$subMenuHover:#0c4a6e;
 
 
 $sideBarWidth: 210px;
 $sideBarWidth: 210px;
 
 

+ 40 - 3
src/views/applet/index.vue

@@ -26,7 +26,9 @@
       empty-text="暂无用户信息"
       empty-text="暂无用户信息"
     >
     >
       <el-table-column prop="name" label="姓名"></el-table-column>
       <el-table-column prop="name" label="姓名"></el-table-column>
-      <el-table-column prop="age" label="年龄"></el-table-column>
+      <el-table-column prop="nikeName" label="昵称"></el-table-column>
+      <el-table-column prop="phone" label="手机号"></el-table-column>
+      <el-table-column prop="level" label="用户等级"></el-table-column>
       <el-table-column prop="status" label="状态">
       <el-table-column prop="status" label="状态">
         <template slot-scope="scope">
         <template slot-scope="scope">
           {{ scope.row.status === "1" ? "启用" : "禁用" }}
           {{ scope.row.status === "1" ? "启用" : "禁用" }}
@@ -43,6 +45,9 @@
               @click="handleToggleStatus(scope.$index, scope.row)">
               @click="handleToggleStatus(scope.$index, scope.row)">
               {{ scope.row.status === '1' ? '禁用' : '启用' }}
               {{ scope.row.status === '1' ? '禁用' : '启用' }}
             </el-button> -->
             </el-button> -->
+            <el-button size="mini" @click="handleDel(scope.$index, scope.row)"
+            >删除</el-button
+          >
         </template>
         </template>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
@@ -78,6 +83,8 @@
 </template>
 </template>
   
   
   <script>
   <script>
+   import {getInfoList,deleteUserInfo} from'@/api/applet'
+import { status } from 'nprogress';
 export default {
 export default {
   data() {
   data() {
     return {
     return {
@@ -104,6 +111,9 @@ export default {
       },
       },
     };
     };
   },
   },
+  mounted(){
+    this.search()
+  },
   methods: {
   methods: {
     async fetchData() {
     async fetchData() {
       try {
       try {
@@ -139,9 +149,9 @@ export default {
       };
       };
     },
     },
     handleEdit(index, row) {
     handleEdit(index, row) {
-      this.dialogFormVisible = true;
+      /* this.dialogFormVisible = true;
       this.editForm = { ...row };
       this.editForm = { ...row };
-      this.editIndex = index;
+      this.editIndex = index; */
     },
     },
     handleToggleStatus(index, row) {
     handleToggleStatus(index, row) {
       // 切换状态
       // 切换状态
@@ -159,6 +169,33 @@ export default {
         this.dialogFormVisible = false;
         this.dialogFormVisible = false;
       }
       }
     },
     },
+    /* 删除 */
+    handleDel(row){
+      let _this=this;
+        let par={
+          id:row.id,
+        }
+        _this.$confirm("您是否确认删除该记录?","提示",{
+          confirmButtonText: '确认',
+          cancelButtonText: '取消',
+          type: 'warning',
+        }).then((res)=>{
+          // console.log("AAA")
+          deleteUserInfo(par).then(res=>{
+               _this.search();
+             })
+        }).catch(()=>{
+        })
+    },
+    search(){
+      getInfoList().then(res=>{
+        if(res.status !==200) return
+        this.tableData=res.data.dataList
+        this.pagination.currentPage=res.data.page
+        this.pagination.pageSize=res.data.pageSize
+        this.pagination.total=res.data.totalRecord
+      })
+    }
   },
   },
 };
 };
 </script>
 </script>

+ 1 - 1
src/views/dashboard/admin/index.vue

@@ -69,7 +69,7 @@ export default {
 .dashboard-editor-container {
 .dashboard-editor-container {
   padding: 32px;
   padding: 32px;
   min-height: 100%;
   min-height: 100%;
-  background-color: rgb(240, 242, 245);
+/*   background-color: rgb(240, 242, 245); */
   position: relative;
   position: relative;
 
 
   .github-corner {
   .github-corner {

+ 1 - 1
src/views/dashboard/editor/index.vue

@@ -77,7 +77,7 @@ export default {
 .dashboard-editor-container {
 .dashboard-editor-container {
   padding: 32px;
   padding: 32px;
   min-height: 100%;
   min-height: 100%;
-  background-color: rgb(240, 242, 245);
+/*   background-color: rgb(240, 242, 245); */
   position: relative;
   position: relative;
 
 
   .github-corner {
   .github-corner {

+ 1 - 0
src/views/document/com/editor.vue

@@ -259,6 +259,7 @@ export default {
       handler(val) {
       handler(val) {
         if (val == null) return;
         if (val == null) return;
         this.comList = JSON.parse(JSON.stringify(val));
         this.comList = JSON.parse(JSON.stringify(val));
+        console.log('comList',this.comList);
       },
       },
       immediate: true, //立即执行
       immediate: true, //立即执行
       deep: true,
       deep: true,

+ 18 - 9
src/views/document/com/menus.vue

@@ -14,7 +14,11 @@
               :key="itemIndex"
               :key="itemIndex"
               class="menu"
               class="menu"
               @click="onClickMenus(item)"
               @click="onClickMenus(item)"
-              :class="{ disabled: item.key === 'article' && type === 'module' }"
+              :class="{
+                disabled:
+                  (type === 'document' && item.key !== 'ai') ||
+                  (item.key === 'article' && type === 'module'),
+              }"
             >
             >
               <div class="icon">
               <div class="icon">
                 <svg-icon
                 <svg-icon
@@ -233,14 +237,16 @@ export default {
   },
   },
   computed: {
   computed: {
     filteredMenus() {
     filteredMenus() {
-      if (this.type === 'document') {
-        return this.menus.map(group => ({
+      /* if (this.type === "document") { */
+      this.menus
+        .map((group) => ({
           ...group,
           ...group,
-          subMenus: group.subMenus.filter(item => item.key === 'ai')
-        })).filter(group => group.subMenus.length > 0);
-      }
+          subMenus: group.subMenus.filter((item) => item.key === "ai"),
+        }))
+        .filter((group) => group.subMenus.length > 0);
+      /* } */
       return this.menus;
       return this.menus;
-    }
+    },
   },
   },
   mounted() {
   mounted() {
     this.type = this.$route.query.type;
     this.type = this.$route.query.type;
@@ -296,8 +302,11 @@ export default {
       this.showVariable = false;
       this.showVariable = false;
     },
     },
     onClickMenus(e) {
     onClickMenus(e) {
-      if (e.disabled && e.disabled()) {
-        return;
+      if (
+        (this.type === "document" && e.key !== "ai") ||
+        (e.key === "article" && this.type === "module")
+      ) {
+        return; // Exit the method if the item is disabled
       }
       }
       e.type = "insert";
       e.type = "insert";
       if (e.key == "formual") {
       if (e.key == "formual") {

+ 23 - 18
src/views/document/create.vue

@@ -23,7 +23,9 @@
           type="primary"
           type="primary"
           size="mini"
           size="mini"
           @click="onSaveAs"
           @click="onSaveAs"
-          v-if="type !== 'module' && type == 'document'"
+          v-if="
+            type !== 'module' && type == 'document' && articleId == undefined
+          "
           >保存文档</el-button
           >保存文档</el-button
         ><!-- v-if="docAttr.id > 0" -->
         ><!-- v-if="docAttr.id > 0" -->
         <el-button
         <el-button
@@ -286,7 +288,7 @@
                                       group: { name: 'itxst', pull: 'clone' },
                                       group: { name: 'itxst', pull: 'clone' },
                                       sort: true,
                                       sort: true,
                                     }"
                                     }"
-                                    :disabled="type == 'module'"
+                                    :disabled="type === 'module'"
                                   >
                                   >
                                     <transition-group>
                                     <transition-group>
                                       <div
                                       <div
@@ -431,8 +433,8 @@
             @onSetActiveIndex="onSetActiveIndex"
             @onSetActiveIndex="onSetActiveIndex"
             @onInsert="onInsert"
             @onInsert="onInsert"
             @onLoadArticle="onLoadArticle"
             @onLoadArticle="onLoadArticle"
-            @onDelete="onRemove"
             @onRebuild="onRebuild"
             @onRebuild="onRebuild"
+            @onDelete="onRemove"
             @onSetComs="onSetComs"
             @onSetComs="onSetComs"
           ></editor>
           ></editor>
         </div>
         </div>
@@ -698,7 +700,7 @@ export default {
   watch: {
   watch: {
     coms: {
     coms: {
       handler(newComs, oldComs) {
       handler(newComs, oldComs) {
-        this.updateAttrs(newComs, oldComs);
+         this.updateAttrs(newComs, oldComs);
       },
       },
       immediate: true, //立即执行
       immediate: true, //立即执行
       deep: true,
       deep: true,
@@ -857,23 +859,27 @@ export default {
       // 遍历所有组件,更新匹配的属性
       // 遍历所有组件,更新匹配的属性
       this.coms.forEach((com) => {
       this.coms.forEach((com) => {
         com.attrs.forEach((attr) => {
         com.attrs.forEach((attr) => {
-          if (attr.name === attrId) {
+          // 只更新非 variableNull 类型的属性
+          if (attr.name === attrId && attr.type !== "variableNull") {
             attr.content = newContent;
             attr.content = newContent;
           }
           }
         });
         });
 
 
-        // 如果是文本区域,还需要更新内容中的占位符
-        /* if (com.type === 'TextArea') {
+        // 如果是文本区域,更新内容中的占位符
+        if (com.type === "TextArea") {
           com.content = com.content.replace(
           com.content = com.content.replace(
-            new RegExp(`{{${attrId}}}`, 'g'),
-            newContent
+            new RegExp(`{{${attrId}}}`, "g"),
+            (match) => {
+              const attr = com.attrs.find((a) => a.id === attrId);
+              if (attr && attr.type !== "variableNull") {
+                return newContent;
+              }
+              return match; // 保留 variableNull 类型的原始占位符
+            }
           );
           );
-        } */
+        }
       });
       });
 
 
-      // 可能还需要更新其他地方,比如 docAttr 等
-      // this.docAttr.content = ...
-
       // 触发视图更新
       // 触发视图更新
       this.replaceData(this.coms);
       this.replaceData(this.coms);
       this.$forceUpdate();
       this.$forceUpdate();
@@ -883,17 +889,17 @@ export default {
       for (let item of this.coms) {
       for (let item of this.coms) {
         for (let el of item.attrs) {
         for (let el of item.attrs) {
           let attrId = el.id;
           let attrId = el.id;
-          if (el.type == "formual") {
+          if (el.type === "formual") {
             try {
             try {
               let formual = await this.analysisFormual(el);
               let formual = await this.analysisFormual(el);
-
               formual = await this.getRemote(formual);
               formual = await this.getRemote(formual);
               el.content = eval(formual);
               el.content = eval(formual);
-
-              /* data = data.replace("{{" + attrId + "}}", eval(formual)); */
             } catch (error) {
             } catch (error) {
               console.error("处理公式时出错:", error);
               console.error("处理公式时出错:", error);
             }
             }
+          } else if (el.type === "variableNull") {
+            // 保留 variableNull 类型的原始内容
+            el.content = el.content || "请输入";
           }
           }
         }
         }
       }
       }
@@ -1232,7 +1238,6 @@ export default {
 
 
     onRebuild(e) {
     onRebuild(e) {
       let _this = this;
       let _this = this;
-      console.log(e);
       _this.coms = [...e];
       _this.coms = [...e];
     },
     },
     //初始化当前用户信息
     //初始化当前用户信息

+ 1 - 1
src/views/document/temList/components/dataList.vue

@@ -36,7 +36,7 @@
           <div v-if="scope.row.status == 6">停用</div>
           <div v-if="scope.row.status == 6">停用</div>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column label="操作" align="center" ><!-- :width="editWidth()" -->
+      <el-table-column label="操作" align="center" :width="editWidth()"><!-- :width="editWidth()" -->
         <template #default="scope">
         <template #default="scope">
           <div class="btns">
           <div class="btns">
             <el-button
             <el-button

+ 55 - 33
src/views/knowledgeMenu/category/components/dataList.vue

@@ -44,6 +44,7 @@
           <div v-if="scope.row.run == 3">成功</div>
           <div v-if="scope.row.run == 3">成功</div>
           <div v-if="scope.row.run == 4">失败</div>
           <div v-if="scope.row.run == 4">失败</div>
           <div v-if="scope.row.run == 5">待处理</div>
           <div v-if="scope.row.run == 5">待处理</div>
+          <div v-if="scope.row.run == 6">文件异常</div>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
       <el-table-column label="操作" align="center" width="330">
       <el-table-column label="操作" align="center" width="330">
@@ -68,21 +69,26 @@
             <el-tooltip
             <el-tooltip
               class="item"
               class="item"
               effect="dark"
               effect="dark"
-              :content="scope.row.run === 1 ? '解析中' : '解析'"
+              :content="
+                scope.row.run === 1 || scope.row.run === 5 ? '解析中' : '解析'
+              "
               placement="top"
               placement="top"
             >
             >
               <el-button
               <el-button
+                v-if="scope.row.run !== 1 && scope.row.run !== 5"
                 type="text"
                 type="text"
-                :icon="
-                  scope.row.run === 1
-                    ? 'el-icon-loading'
-                    : 'el-icon-caret-right'
-                "
+                icon="el-icon-caret-right"
                 circle
                 circle
-                v-if="allowEdit"
                 @click="analysis(scope.row)"
                 @click="analysis(scope.row)"
-                :loading="scope.row.analyzing"
-                :disabled="scope.row.run === 1"
+                style="font-size: 20px"
+              >
+              </el-button>
+              <el-button
+                v-else
+                type="text"
+                icon="el-icon-loading"
+                circle
+                :disabled="true"
                 style="font-size: 20px"
                 style="font-size: 20px"
               >
               >
               </el-button>
               </el-button>
@@ -238,6 +244,7 @@ import {
   renameFile,
   renameFile,
   analysis,
   analysis,
   batchAnalysis,
   batchAnalysis,
+  getRunStatus,
 } from "@/api/knowledge";
 } from "@/api/knowledge";
 export default {
 export default {
   props: {
   props: {
@@ -400,14 +407,22 @@ export default {
 
 
     /* 跳转页面 */
     /* 跳转页面 */
     getName(e) {
     getName(e) {
-      this.$router.push({
+      /* this.$router.push({
         path: "/knowledge/category/infoList",
         path: "/knowledge/category/infoList",
-        query: { id: e.id,type:e.type },
-      });
+        query: { id: e.id, type: e.type },
+      }); */
+      let _this = this;
+      let a = document.createElement("a");
+      a.href = `#/infoList?id=${e.id}&type=${e.type}`; // 使用 hash
+      a.target = "_blank";
+      a.click();
     },
     },
     /* 解析 */
     /* 解析 */
     analysis(row) {
     analysis(row) {
-      this.$set(row, "analyzing", true);
+      if (row.run === 1 || row.run === 5) return; // 如果已经在解析中或待处理,直接返回
+
+      this.$set(row, "run", 1); // 使用 $set 确保视图更新
+
       analysis({
       analysis({
         document_id: row.id,
         document_id: row.id,
         start_page: row.start_page || 0,
         start_page: row.start_page || 0,
@@ -416,38 +431,45 @@ export default {
       })
       })
         .then((res) => {
         .then((res) => {
           if (res.status === 200) {
           if (res.status === 200) {
-            row.run = 1; // Set status to "解析中"
             this.checkAnalysisStatus(row);
             this.checkAnalysisStatus(row);
           } else {
           } else {
             this.$message.error("解析请求失败");
             this.$message.error("解析请求失败");
+            this.$set(row, "run", 0); // 如果请求失败,重置状态
           }
           }
         })
         })
         .catch((error) => {
         .catch((error) => {
           console.error("解析错误:", error);
           console.error("解析错误:", error);
           this.$message.error("解析过程中出现错误");
           this.$message.error("解析过程中出现错误");
-        })
-        .finally(() => {
-          this.$set(row, "analyzing", false);
+          this.$set(row, "run", 0); // 如果出现错误,重置状态
         });
         });
     },
     },
     checkAnalysisStatus(row) {
     checkAnalysisStatus(row) {
       const checkStatus = () => {
       const checkStatus = () => {
-        // Replace this with an actual API call to check the status
-        // For demonstration, we're using a simulated API call
-        setTimeout(() => {
-          // Simulating a status check
-          const status = Math.random() > 0.7 ? 3 : 1;
-
-          if (status === 3) {
-            row.run = 3; // Analysis complete
-            this.$message.success("解析完成");
-          } else if (status === 1) {
-            this.checkAnalysisStatus(row); // Check again
-          } else {
-            row.run = 4; // Analysis failed
-            this.$message.error("解析失败");
-          }
-        }, 2000); // Check every 2 seconds
+        getRunStatus({ document_id: row.id })
+          .then((res) => {
+            if (res.status === 200) {
+             /*   */
+              if (res.data.run === '3') {
+                this.$set(row, "run",Number(res.data.run));
+              } else if (res.data.run === '4') {
+                this.$set(row, "run", Number(res.data.run));
+                this.$message.error("解析失败");
+              } else if (res.data.run === '1') {
+                // 如果仍在解析中,5-10秒后再次检查
+                setTimeout(() => {
+                  this.checkAnalysisStatus(row);
+                }, 5000 + Math.random() * 5000);
+              }
+            } else {
+              this.$message.error("获取解析状态失败");
+              this.$set(row, "run", 0); // 如果获取状态失败,重置状态
+            }
+          })
+          .catch((error) => {
+            console.error("获取解析状态错误:", error);
+            this.$message.error("获取解析状态时出现错误");
+            this.$set(row, "run", 0); // 如果出现错误,重置状态
+          });
       };
       };
       checkStatus();
       checkStatus();
     },
     },

Some files were not shown because too many files changed in this diff