|
@@ -34,8 +34,12 @@
|
|
<el-input placeholder="搜索文档标题"></el-input>
|
|
<el-input placeholder="搜索文档标题"></el-input>
|
|
</div>
|
|
</div>
|
|
<div class="new-article">
|
|
<div class="new-article">
|
|
- <el-collapse v-model="activeNames" :accordion="true">
|
|
|
|
- <el-collapse-item title="最新文档" name="-1">
|
|
|
|
|
|
+ <el-collapse
|
|
|
|
+ v-model="activeNames"
|
|
|
|
+ :accordion="true"
|
|
|
|
+ @change="handleItemClick"
|
|
|
|
+ >
|
|
|
|
+ <el-collapse-item title="最新文档" name="-1" v-if="showView == 0">
|
|
<div
|
|
<div
|
|
v-for="(it, index) in articleList"
|
|
v-for="(it, index) in articleList"
|
|
draggable
|
|
draggable
|
|
@@ -73,34 +77,80 @@
|
|
</el-collapse-item>
|
|
</el-collapse-item>
|
|
</template>
|
|
</template>
|
|
</template> -->
|
|
</template> -->
|
|
- <el-collapse-item
|
|
|
|
- v-for="(item, itemIndex) in categoryList"
|
|
|
|
- :title="item.name"
|
|
|
|
- :name="item.id"
|
|
|
|
- >
|
|
|
|
- <draggable
|
|
|
|
- v-model="item.dataList"
|
|
|
|
- :options="{
|
|
|
|
- group: { name: 'itxst', pull: 'clone' },
|
|
|
|
- sort: true,
|
|
|
|
- }"
|
|
|
|
- animation="300"
|
|
|
|
|
|
+ <div v-if="showView == 1">
|
|
|
|
+ <el-collapse-item
|
|
|
|
+ v-for="(item, itemIndex) in categoryList"
|
|
|
|
+ :key="itemIndex"
|
|
|
|
+ :title="item.name"
|
|
|
|
+ :name="item.id"
|
|
>
|
|
>
|
|
- <transition-group>
|
|
|
|
- <div
|
|
|
|
- class="sub-menus"
|
|
|
|
- v-for="(it, index) in item.dataList"
|
|
|
|
- :key="index"
|
|
|
|
|
|
+ <el-collapse v-model="nestedActiveNames">
|
|
|
|
+ <el-collapse-item
|
|
|
|
+ v-for="(child, childIndex) in childrenList"
|
|
|
|
+ :key="childIndex"
|
|
|
|
+ :title="child.name"
|
|
|
|
+ :name="child.id"
|
|
>
|
|
>
|
|
- <div>{{ it.name }}</div>
|
|
|
|
- </div>
|
|
|
|
- </transition-group>
|
|
|
|
- </draggable>
|
|
|
|
- </el-collapse-item>
|
|
|
|
|
|
+ <draggable
|
|
|
|
+ v-model="child.dataList"
|
|
|
|
+ :options="{
|
|
|
|
+ group: { name: 'itxst', pull: 'clone' },
|
|
|
|
+ sort: true,
|
|
|
|
+ }"
|
|
|
|
+ animation="300"
|
|
|
|
+ >
|
|
|
|
+ <transition-group>
|
|
|
|
+ <div
|
|
|
|
+ class="sub-menus"
|
|
|
|
+ v-for="(its, index) in child.dataList"
|
|
|
|
+ :key="index"
|
|
|
|
+ >
|
|
|
|
+ <div>{{ its.name }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </transition-group>
|
|
|
|
+ </draggable>
|
|
|
|
+ </el-collapse-item>
|
|
|
|
+ </el-collapse>
|
|
|
|
+ <draggable
|
|
|
|
+ v-model="item.dataList"
|
|
|
|
+ :options="{
|
|
|
|
+ group: { name: 'itxst', pull: 'clone' },
|
|
|
|
+ sort: true,
|
|
|
|
+ }"
|
|
|
|
+ animation="300"
|
|
|
|
+ >
|
|
|
|
+ <transition-group>
|
|
|
|
+ <div
|
|
|
|
+ class="sub-menus"
|
|
|
|
+ v-for="(it, index) in item.dataList"
|
|
|
|
+ :key="index"
|
|
|
|
+ >
|
|
|
|
+ <div>{{ it.name }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </transition-group>
|
|
|
|
+ </draggable>
|
|
|
|
+ </el-collapse-item>
|
|
|
|
+ </div>
|
|
</el-collapse>
|
|
</el-collapse>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="right-sidebarew">
|
|
|
|
+ <div
|
|
|
|
+ class="sidebar-item"
|
|
|
|
+ :class="showView == 0 ? 'active-item' : ''"
|
|
|
|
+ @click="viewDocument"
|
|
|
|
+ >
|
|
|
|
+ 查看文档
|
|
|
|
+ </div>
|
|
|
|
+ <div
|
|
|
|
+ class="sidebar-item"
|
|
|
|
+ :class="showView == 1 ? 'active-item' : ''"
|
|
|
|
+ @click="viewModule"
|
|
|
|
+ >
|
|
|
|
+ 查看模块
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
|
|
<div class="editor-main">
|
|
<div class="editor-main">
|
|
<div class="menus-box">
|
|
<div class="menus-box">
|
|
@@ -139,9 +189,20 @@
|
|
>
|
|
>
|
|
<span class="name">模块管理</span>
|
|
<span class="name">模块管理</span>
|
|
</div>
|
|
</div>
|
|
- <!-- <div class="item" @click="onSetActiveIndex(9997)" :class="comIndex==9997?'active-item':''">
|
|
|
|
- <span class="name">目录</span>
|
|
|
|
- </div> -->
|
|
|
|
|
|
+ <div
|
|
|
|
+ class="item"
|
|
|
|
+ @click="onSetActiveIndex(9997)"
|
|
|
|
+ :class="comIndex == 9997 ? 'active-item' : ''"
|
|
|
|
+ >
|
|
|
|
+ <span class="name">目录信息</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div
|
|
|
|
+ class="item"
|
|
|
|
+ @click="onSetActiveIndex(9996)"
|
|
|
|
+ :class="comIndex == 9996 ? 'active-item' : ''"
|
|
|
|
+ >
|
|
|
|
+ <span class="name">属性变量</span>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<template v-if="comIndex == 9999">
|
|
<template v-if="comIndex == 9999">
|
|
@@ -155,9 +216,9 @@
|
|
@onRebuild="onRebuild"
|
|
@onRebuild="onRebuild"
|
|
></comList>
|
|
></comList>
|
|
</template>
|
|
</template>
|
|
- <!-- <template v-if="comIndex==9997">
|
|
|
|
|
|
+ <template v-if="comIndex == 9997">
|
|
<Directory :coms="coms" />
|
|
<Directory :coms="coms" />
|
|
- </template> -->
|
|
|
|
|
|
+ </template>
|
|
|
|
|
|
<template
|
|
<template
|
|
v-if="comIndex != 9999 && comIndex != 9998 && comIndex != 9997"
|
|
v-if="comIndex != 9999 && comIndex != 9998 && comIndex != 9997"
|
|
@@ -167,7 +228,7 @@
|
|
@onRefresh="initCategoryList"
|
|
@onRefresh="initCategoryList"
|
|
></Attribute>
|
|
></Attribute>
|
|
</template>
|
|
</template>
|
|
- <Directory :coms="coms" />
|
|
|
|
|
|
+ <!-- <Directory :coms="coms" /> -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -246,6 +307,7 @@ export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
activeNames: "-1",
|
|
activeNames: "-1",
|
|
|
|
+ nestedActiveNames: [],
|
|
articleList: [],
|
|
articleList: [],
|
|
categoryList: [],
|
|
categoryList: [],
|
|
//组件相关
|
|
//组件相关
|
|
@@ -276,6 +338,9 @@ export default {
|
|
userInfo: null,
|
|
userInfo: null,
|
|
articleId: 0,
|
|
articleId: 0,
|
|
loading: false, // 增加 loading 状态
|
|
loading: false, // 增加 loading 状态
|
|
|
|
+ showView: 0, //查看 文档/模块
|
|
|
|
+ childrenList: [],
|
|
|
|
+ value: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -311,17 +376,28 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
- /* 更新检索内容 */
|
|
|
|
- /* async uptadeSearch() {
|
|
|
|
- this.coms.forEach((item) => {
|
|
|
|
- item.attrs.forEach((el) => {
|
|
|
|
- if (el.type === "ai") {
|
|
|
|
- // 在这里执行下一步操作
|
|
|
|
- await this.retrieval(el);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ async handleItemClick(item) {
|
|
|
|
+ if (item == "-1") return;
|
|
|
|
+ await searchTemplateCategory({ parent_id: item }).then((res) => {
|
|
|
|
+ console.log(res.data.length==0);
|
|
|
|
+ if (res.status != 200 &&res.data.length==0) return;
|
|
|
|
+ this.childrenList = res.data;
|
|
|
|
+ for (var i = 0; i < this.childrenList.length; i++) {
|
|
|
|
+ this.childrenList[i].dataList = this.getTemplateList(
|
|
|
|
+ this.childrenList[i].id
|
|
|
|
+ );
|
|
|
|
+ }
|
|
});
|
|
});
|
|
- }, */
|
|
|
|
|
|
+ // Add your custom logic here
|
|
|
|
+ },
|
|
|
|
+ /* 切换标签 */
|
|
|
|
+ viewDocument() {
|
|
|
|
+ this.showView = 0;
|
|
|
|
+ },
|
|
|
|
+ viewModule() {
|
|
|
|
+ this.showView = 1;
|
|
|
|
+ },
|
|
|
|
+ /* 更新检索内容 */
|
|
async uptadeSearch() {
|
|
async uptadeSearch() {
|
|
for (const item of this.coms) {
|
|
for (const item of this.coms) {
|
|
for (const el of item.attrs) {
|
|
for (const el of item.attrs) {
|
|
@@ -368,7 +444,6 @@ export default {
|
|
response.data.outputs[0].outputs[0].results.message.data.text;
|
|
response.data.outputs[0].outputs[0].results.message.data.text;
|
|
// 将搜索词和生成的内容存储在 searchResult 对象中
|
|
// 将搜索词和生成的内容存储在 searchResult 对象中
|
|
el.content = resultText; // 重新赋值给原数组的对应 content
|
|
el.content = resultText; // 重新赋值给原数组的对应 content
|
|
-
|
|
|
|
}
|
|
}
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.error("Error during retrieval:", error);
|
|
console.error("Error during retrieval:", error);
|
|
@@ -395,6 +470,7 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
onOpenView(e) {
|
|
onOpenView(e) {
|
|
|
|
+ console.log(e);
|
|
this.showViewForm = true;
|
|
this.showViewForm = true;
|
|
},
|
|
},
|
|
onClose() {
|
|
onClose() {
|
|
@@ -609,6 +685,7 @@ export default {
|
|
_this.$alert("请选择插入图层");
|
|
_this.$alert("请选择插入图层");
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
+ console.log(e);
|
|
let com = _this.coms[_this.comIndex];
|
|
let com = _this.coms[_this.comIndex];
|
|
let data = {
|
|
let data = {
|
|
type: "Directory",
|
|
type: "Directory",
|
|
@@ -779,6 +856,7 @@ export default {
|
|
} else {
|
|
} else {
|
|
//仅对图表中插入有效
|
|
//仅对图表中插入有效
|
|
if (_this.comIndex >= 0) {
|
|
if (_this.comIndex >= 0) {
|
|
|
|
+ debugger;
|
|
_this.setTableData(data.id);
|
|
_this.setTableData(data.id);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -874,6 +952,7 @@ export default {
|
|
let res = await searchTemplateCategory({
|
|
let res = await searchTemplateCategory({
|
|
page: 1,
|
|
page: 1,
|
|
pageSize: 99,
|
|
pageSize: 99,
|
|
|
|
+ parent_id: 0,
|
|
status: 5,
|
|
status: 5,
|
|
});
|
|
});
|
|
if (res.status != 200) return;
|
|
if (res.status != 200) return;
|