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