mirror of
http://112.124.100.131/ebiz-ai/ebiz-ai-knowledge-manage.git
synced 2025-12-11 11:56:51 +08:00
fix: 规则管理界面异常
1. 界面 “规则类型”枚举错误,“知识拆分规则”和“提示词规则”反了
This commit is contained in:
@@ -11,6 +11,10 @@ export default {
|
|||||||
return {
|
return {
|
||||||
// 表格配置项
|
// 表格配置项
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
|
ruleType: {
|
||||||
|
1: '提词规则',
|
||||||
|
2: '知识拆分规则'
|
||||||
|
},
|
||||||
total: 0,
|
total: 0,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
@@ -90,8 +94,8 @@ export default {
|
|||||||
if (this.form.query) {
|
if (this.form.query) {
|
||||||
// 过滤 ruleType
|
// 过滤 ruleType
|
||||||
const map = {
|
const map = {
|
||||||
1: '提示词规则',
|
1: '知识拆分规则',
|
||||||
2: '知识拆分规则'
|
2: '提词规则'
|
||||||
}
|
}
|
||||||
filteredData = this.tableData.filter(item => {
|
filteredData = this.tableData.filter(item => {
|
||||||
if (!this.form.ruleType) return true
|
if (!this.form.ruleType) return true
|
||||||
@@ -114,23 +118,20 @@ export default {
|
|||||||
}
|
}
|
||||||
return filteredData
|
return filteredData
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取表格数据
|
// 获取表格数据
|
||||||
getCurrentTableData() {
|
getCurrentTableData() {
|
||||||
// 需要处理 规则类型, 因为规则类型都是数字,需要转换成中文
|
// 需要处理 规则类型, 因为规则类型都是数字,需要转换成中文
|
||||||
return this.currentTableDate.map(item => ({
|
return this.currentTableDate.map(item => ({
|
||||||
...item,
|
...item,
|
||||||
ruleType: item.ruleType === 1 ? '提示词规则' : '知识拆分规则'
|
ruleType: item.ruleType === 1 ? '知识拆分规则' : '提词规则'
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
|
|
||||||
// 查询表单的 ruleTypeOptions
|
// 查询表单的 ruleTypeOptions
|
||||||
ruleTypeOptions() {
|
ruleTypeOptions() {
|
||||||
const map = {
|
|
||||||
1: '提示词规则',
|
|
||||||
2: '知识拆分规则'
|
|
||||||
}
|
|
||||||
// 去重所有 ruleType, 然后映射成 option
|
// 去重所有 ruleType, 然后映射成 option
|
||||||
return [...new Set(this.tableData.map(item => item.ruleType))].map(type => map[type])
|
return [...new Set(this.tableData.map(item => item.ruleType))].map(type => this.tableConfig.ruleType[type])
|
||||||
},
|
},
|
||||||
// 查询表单的 ruleNameOptions
|
// 查询表单的 ruleNameOptions
|
||||||
ruleNameOptions() {
|
ruleNameOptions() {
|
||||||
@@ -140,7 +141,8 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
form: {
|
form: {
|
||||||
handler() {},
|
handler() {
|
||||||
|
},
|
||||||
deep: true
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -182,7 +184,7 @@ export default {
|
|||||||
// 处理修改规则
|
// 处理修改规则
|
||||||
handleEdit(row, index) {
|
handleEdit(row, index) {
|
||||||
this.dialogOptions.title = '修改规则'
|
this.dialogOptions.title = '修改规则'
|
||||||
this.dialogOptions.currentComponent = row.ruleType === '知识拆分规则' ? 'EditPromptRule' : 'EditSplitRule'
|
this.dialogOptions.currentComponent = row.ruleType === '知识拆分规则' ? 'EditSplitRule' : 'EditPromptRule'
|
||||||
this.dialogOptions.visible = true
|
this.dialogOptions.visible = true
|
||||||
this.dialogOptions.currentRow = row
|
this.dialogOptions.currentRow = row
|
||||||
},
|
},
|
||||||
@@ -256,15 +258,9 @@ export default {
|
|||||||
<!-- 创建时间 -->
|
<!-- 创建时间 -->
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="创建时间">
|
<el-form-item label="创建时间">
|
||||||
<el-date-picker
|
<el-date-picker v-model="form.createdDate" type="daterange" unlink-panels range-separator="至"
|
||||||
v-model="form.createdDate"
|
start-placeholder="开始日期" end-placeholder="结束日期"
|
||||||
type="daterange"
|
:picker-options="form.pickerOptions">
|
||||||
unlink-panels
|
|
||||||
range-separator="至"
|
|
||||||
start-placeholder="开始日期"
|
|
||||||
end-placeholder="结束日期"
|
|
||||||
:picker-options="form.pickerOptions"
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -272,7 +268,7 @@ export default {
|
|||||||
<!-- 功能按钮组: 查询、重置、新增规则 -->
|
<!-- 功能按钮组: 查询、重置、新增规则 -->
|
||||||
<el-row class="p25">
|
<el-row class="p25">
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<!-- <el-button size="mini" type="primary" @click="handleQuery">查询</el-button>-->
|
<!-- <el-button size="mini" type="primary" @click="handleQuery">查询</el-button>-->
|
||||||
<el-button size="mini" type="info" @click="handleReset">重置</el-button>
|
<el-button size="mini" type="info" @click="handleReset">重置</el-button>
|
||||||
<el-button size="mini" type="primary" @click="handleAdd">新增规则</el-button>
|
<el-button size="mini" type="primary" @click="handleAdd">新增规则</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -282,27 +278,15 @@ export default {
|
|||||||
|
|
||||||
<!-- 下方规则列表 -->
|
<!-- 下方规则列表 -->
|
||||||
<div class="p20">
|
<div class="p20">
|
||||||
<r-table
|
<r-table :columns="tableConfig.columns" :data="getCurrentTableData" :deletion="false" :total="tableConfig.total"
|
||||||
:columns="tableConfig.columns"
|
@currentChange="handleCurrentChange" @sizeChange="handleSizeChange" />
|
||||||
:data="getCurrentTableData"
|
|
||||||
:deletion="false"
|
|
||||||
:total="tableConfig.total"
|
|
||||||
@currentChange="handleCurrentChange"
|
|
||||||
@sizeChange="handleSizeChange"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<!-- 规则详情弹窗 -->
|
<!-- 规则详情弹窗 -->
|
||||||
<el-drawer :visible.sync="dialogOptions.visible" size="50%" :title="dialogOptions.title">
|
<el-drawer :visible.sync="dialogOptions.visible" size="50%" :title="dialogOptions.title">
|
||||||
<!-- diglog 弹窗内容组件 -->
|
<!-- diglog 弹窗内容组件 -->
|
||||||
<component
|
<component class="container" v-if="dialogOptions.visible" :is="dialogOptions.currentComponent" :data="tableData"
|
||||||
class="container"
|
:columns="columns" :currentRow="dialogOptions.currentRow" />
|
||||||
v-if="dialogOptions.visible"
|
|
||||||
:is="dialogOptions.currentComponent"
|
|
||||||
:data="tableData"
|
|
||||||
:columns="columns"
|
|
||||||
:currentRow="dialogOptions.currentRow"
|
|
||||||
/>
|
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user