Merge branch 'dev' into system

This commit is contained in:
du.meimei
2025-04-23 13:10:09 +08:00
10 changed files with 59 additions and 26 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -1,7 +1,10 @@
@import 'theme'; @import 'theme';
.render-button { .render-button {
padding: 8px 21px; padding: 8px 20px;
border-radius: 8px; border-radius: 8px;
font-family: PingFangSC, PingFang SC;
font-weight: 500;
font-size: 14px;
} }
.el-button { .el-button {

View File

@@ -10,3 +10,13 @@
padding: 0 0 0 10px; padding: 0 0 0 10px;
} }
} }
.el-input--medium {
.el-input__inner {
height: 30px;
line-height: 30px;
}
.el-input__icon {
line-height: 30px;
}
}

View File

@@ -9,3 +9,8 @@ body,
.app-main { .app-main {
background: rgba(240, 244, 250, 1); background: rgba(240, 244, 250, 1);
} }
.container {
padding: 20px;
//background-image: url('../images/backimage.png');
}

View File

@@ -142,11 +142,7 @@ h3 {
margin-bottom: 10px; margin-bottom: 10px;
text-align: right; text-align: right;
} }
.container {
padding: 20px;
//margin: 15px;
//background: #fff;
}
.el-select { .el-select {
width: 100%; width: 100%;
} }

6
src/config/base-url.js Normal file
View File

@@ -0,0 +1,6 @@
// DIFY 的 base url 地址
const DIFY_URL = '/dify'
module.exports = {
DIFY_URL
}

View File

@@ -1,5 +1,5 @@
<script> <script>
import { computed } from 'vue' import { DIFY_URL } from '@/config/base-url'
export default { export default {
name: 'workflow', name: 'workflow',
@@ -15,7 +15,7 @@ export default {
isVisible: false, isVisible: false,
// dify 的 workflow 地址格式 http://localhost:3000/dify/app/235427ea-803b-482b-bdff-dd717801ca76/workflow // dify 的 workflow 地址格式 http://localhost:3000/dify/app/235427ea-803b-482b-bdff-dd717801ca76/workflow
// app 是展示所有的内容 // app 是展示所有的内容
src: `/` src: `${DIFY_URL}/app/235427ea-803b-482b-bdff-dd717801ca76/workflow`
} }
} }
}, },
@@ -33,7 +33,7 @@ export default {
// 检测是否存在 workflow id 如果不存在则不展示内容 // 检测是否存在 workflow id 如果不存在则不展示内容
const { id, header, sidebar, publish } = this.$route.query const { id, header, sidebar, publish } = this.$route.query
if (id) { if (id) {
this.dify.src = `/app/${id}/workflow?${this.params}` this.dify.src = `${DIFY_URL}/app/${id}/workflow?${this.params}`
this.dify.isVisible = true this.dify.isVisible = true
} }
@@ -55,7 +55,7 @@ export default {
if (id) { if (id) {
console.log(`current params:`, this.dify.params) console.log(`current params:`, this.dify.params)
this.dify.src = `/app/${id}/workflow?${this.params}` this.dify.src = `${DIFY_URL}/app/${id}/workflow?${this.params}`
this.dify.isVisible = true this.dify.isVisible = true
} else { } else {
this.dify.isVisible = false this.dify.isVisible = false
@@ -63,6 +63,12 @@ export default {
}, },
deep: true deep: true
} }
},
methods: {
handleTestWorkflowClick() {
this.dify.src = `${DIFY_URL}/app/52fcac09-434c-4c3c-9728-12591593d9ac/workflow?${this.params}`
this.dify.isVisible = true
}
} }
} }
</script> </script>
@@ -71,7 +77,9 @@ export default {
<div class="container"> <div class="container">
<el-card :body-style="{ padding: 0 }" shadow="hover"> <el-card :body-style="{ padding: 0 }" shadow="hover">
<iframe v-if="dify.isVisible" ref="dify" :src="dify.src" frameborder="0" style="width: 100%; height: 85vh;" /> <iframe v-if="dify.isVisible" ref="dify" :src="dify.src" frameborder="0" style="width: 100%; height: 85vh;" />
<el-empty v-else /> <el-empty v-else>
<el-button type="a" @click="handleTestWorkflowClick">点击查看一个测试的 flow</el-button>
</el-empty>
</el-card> </el-card>
</div> </div>
</template> </template>

View File

@@ -9,7 +9,7 @@
</el-input> </el-input>
</el-col> </el-col>
<el-col :span="16" class="text-right"> <el-col :span="16" class="text-right">
<el-button class="render-button line-button" icon="el-icon-plus" @click="createdKnowLedge()">创建知识库</el-button> <el-button class="render-button line-button pv8 ph10" icon="el-icon-plus" @click="createdKnowLedge()">创建知识库</el-button>
</el-col> </el-col>
</el-row> </el-row>
@@ -20,7 +20,7 @@
易商数智知识库平台旨在为用户提供更便捷更灵敏更全面的知识存储和操作平台用户可以通过创建不同的知识库完成对系统内知识的细分和储备 易商数智知识库平台旨在为用户提供更便捷更灵敏更全面的知识存储和操作平台用户可以通过创建不同的知识库完成对系统内知识的细分和储备
</p> </p>
<p class="mt10 fs14 theme-primary-desc-text" style="line-height: 15px">同时也可以通过修改和删除操作对系统内知识体系进行修正和优化</p> <p class="mt10 fs14 theme-primary-desc-text" style="line-height: 15px">同时也可以通过修改和删除操作对系统内知识体系进行修正和优化</p>
<el-button type="primary" class="mt20 render-button" plain icon="el-icon-document-remove">操作文档</el-button> <el-button type="primary" class="mt20 render-button pv8 ph10" plain icon="el-icon-document-remove">操作文档</el-button>
</div> </div>
</div> </div>
@@ -29,7 +29,8 @@
<el-card v-for="(item, index) in datasetList" class="item datasetList" shadow="hover" :key="index" @click.native.stop="knowLedgeDetail(item)"> <el-card v-for="(item, index) in datasetList" class="item datasetList" shadow="hover" :key="index" @click.native.stop="knowLedgeDetail(item)">
<div class="dataset-header"> <div class="dataset-header">
<div class="folder-content"> <div class="folder-content">
<svg-icon iconClass="folder" className="folder"></svg-icon> <img :src="konwledgePng_1" alt="" class="folder" />
<!-- <svg-icon iconClass="folder" className="folder"></svg-icon>-->
</div> </div>
<div class="dataset-body" style="flex:1"> <div class="dataset-body" style="flex:1">
<h4 class="dataset-title">{{ item.name }}</h4> <h4 class="dataset-title">{{ item.name }}</h4>
@@ -56,11 +57,13 @@
<script> <script>
import { docManageDataset, datasetDelete } from '@/api/generatedApi/index' import { docManageDataset, datasetDelete } from '@/api/generatedApi/index'
import knowledgeForm from '@/views/knowledge/detail/components/knowledgeForm.vue' import knowledgeForm from '@/views/knowledge/detail/components/knowledgeForm.vue'
import konwledgePng_1 from '@/assets/images/konwledge/konwledge-1.png'
export default { export default {
name: 'index', name: 'index',
data() { data() {
return { return {
konwledgePng_1,
datasetList: [], datasetList: [],
nameLike: '', nameLike: '',
drawer: false, drawer: false,
@@ -146,6 +149,14 @@ export default {
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
#index-container {
background-image: url('../../assets/images/backimage.png');
background-size: 600px 300px;
background-position-x: right;
background-position-y: top;
background-repeat: no-repeat;
}
.ledge-list { .ledge-list {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@@ -234,6 +245,8 @@ export default {
padding: 20px 20px 0; padding: 20px 20px 0;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: start;
//align-items: center; //align-items: center;
.folder-content { .folder-content {
@@ -282,6 +295,7 @@ export default {
text-align: left; text-align: left;
font-style: normal; font-style: normal;
height: 35px;
margin: 0; margin: 0;
display: -webkit-box; // 支持多行省略 display: -webkit-box; // 支持多行省略
-webkit-line-clamp: 2; // 限制为两行 -webkit-line-clamp: 2; // 限制为两行

View File

@@ -1,6 +1,8 @@
'use strict' 'use strict'
const path = require('path') const path = require('path')
const defaultSettings = require('./src/assets/js/utils/settings.js') const defaultSettings = require('./src/assets/js/utils/settings.js')
const { DIFY_URL } = require('./src/config/base-url')
function resolve(dir) { function resolve(dir) {
return path.join(__dirname, dir) return path.join(__dirname, dir)
} }
@@ -34,7 +36,7 @@ module.exports = {
errors: true errors: true
}, },
proxy: { proxy: {
'/app': { [DIFY_URL]: {
target: 'http://localhost:3000', target: 'http://localhost:3000',
changeOrigin: true, changeOrigin: true,
onProxyRes: (proxyRes, req, res) => { onProxyRes: (proxyRes, req, res) => {
@@ -45,17 +47,6 @@ module.exports = {
}, },
logLevel: 'debug' logLevel: 'debug'
}, },
'/_next': {
target: 'http://localhost:3000',
changeOrigin: true,
onProxyRes: (proxyRes, req, res) => {
delete proxyRes.headers['x-frame-options']
},
pathRewrite: {
// '^/_next': '/'
},
logLevel: 'debug'
},
'/api': { '/api': {
target: process.env.VUE_APP_ADMIN, target: process.env.VUE_APP_ADMIN,
changeOrigin: true, changeOrigin: true,