|
@@ -10,20 +10,20 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
const router = useRouter(); // 添加这行来获取router实例
|
|
const router = useRouter(); // 添加这行来获取router实例
|
|
const pageRequest = async (query: any) => {
|
|
const pageRequest = async (query: any) => {
|
|
// 确保查询参数正确传递
|
|
// 确保查询参数正确传递
|
|
- api.GetDocumentTree({}).then((ret: any) => {
|
|
|
|
|
|
+ /* api.GetDocumentTree({}).then((ret: any) => { */
|
|
// 构建请求参数,确保category参数被正确传递
|
|
// 构建请求参数,确保category参数被正确传递
|
|
const params = {
|
|
const params = {
|
|
...query,
|
|
...query,
|
|
tenant_id: '1',
|
|
tenant_id: '1',
|
|
// 如果 query.form 中有 category,使用它,否则使用 query.category
|
|
// 如果 query.form 中有 category,使用它,否则使用 query.category
|
|
category: (query.form && query.form.category) || query.category || '',
|
|
category: (query.form && query.form.category) || query.category || '',
|
|
- job_id: ret.data[0].id
|
|
|
|
|
|
+ job_id: 1//ret.data[0].id
|
|
};
|
|
};
|
|
|
|
|
|
console.log('Request params:', params); // 添加日志以便调试
|
|
console.log('Request params:', params); // 添加日志以便调试
|
|
|
|
|
|
return api.GetDocumentList(params);
|
|
return api.GetDocumentList(params);
|
|
- });
|
|
|
|
|
|
+ /* }); */
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
@@ -75,7 +75,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
window.dispatchEvent(event);
|
|
window.dispatchEvent(event);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- preview: {
|
|
|
|
|
|
+ /* preview: {
|
|
text: '预览',
|
|
text: '预览',
|
|
type: 'success',
|
|
type: 'success',
|
|
size: 'small',
|
|
size: 'small',
|
|
@@ -102,7 +102,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
const previewUrl = `/#/preview?url=${encodeURIComponent(filePath)}&type=${fileType}`;
|
|
const previewUrl = `/#/preview?url=${encodeURIComponent(filePath)}&type=${fileType}`;
|
|
window.open(previewUrl, '_blank');
|
|
window.open(previewUrl, '_blank');
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ }, */
|
|
edit: {
|
|
edit: {
|
|
type: 'primary',
|
|
type: 'primary',
|
|
size: 'small',
|
|
size: 'small',
|
|
@@ -130,44 +130,75 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
columnSetDisabled: true, //禁止在列设置中选择
|
|
columnSetDisabled: true, //禁止在列设置中选择
|
|
},
|
|
},
|
|
}, */
|
|
}, */
|
|
|
|
+ id: {
|
|
|
|
+ title: 'ID',
|
|
|
|
+ column: { show: true ,width:80, },
|
|
|
|
+ search: { show: false },
|
|
|
|
+ form: { show: false },
|
|
|
|
+ },
|
|
position_id: {
|
|
position_id: {
|
|
title: '职位',
|
|
title: '职位',
|
|
search: { show: true },
|
|
search: { show: true },
|
|
type: 'dict-select',
|
|
type: 'dict-select',
|
|
|
|
+ dict:dict({
|
|
|
|
+ url({form}){
|
|
|
|
+ return '/api/job/list?tenant_id=1'
|
|
|
|
+ },
|
|
|
|
+ label:'title',
|
|
|
|
+ value:'id'
|
|
|
|
+ }),
|
|
column: {
|
|
column: {
|
|
value: '1',
|
|
value: '1',
|
|
minWidth: 120,
|
|
minWidth: 120,
|
|
show: false,
|
|
show: false,
|
|
},
|
|
},
|
|
- form: { show: false },
|
|
|
|
|
|
+ form: { show: true },
|
|
},
|
|
},
|
|
question_id: {
|
|
question_id: {
|
|
- title: 'ID',
|
|
|
|
|
|
+ title: '职位问题',
|
|
search: { show: false },
|
|
search: { show: false },
|
|
|
|
+ type: 'dict-select',
|
|
|
|
+ dict:dict({
|
|
|
|
+ url: '/api/categories', // 获取数据的接口
|
|
|
|
+ // 或者使用方法
|
|
|
|
+ getData: async () => {
|
|
|
|
+ const res = await api.GetInterviewQuestions({page:1,limit:1000,tenant_id:1});
|
|
|
|
+ return res.data.items;
|
|
|
|
+ },
|
|
|
|
+ label: 'question',
|
|
|
|
+ value: 'id'
|
|
|
|
+ }),
|
|
column: {
|
|
column: {
|
|
value: '1',
|
|
value: '1',
|
|
show: false
|
|
show: false
|
|
},
|
|
},
|
|
- form: { show: false },
|
|
|
|
- },
|
|
|
|
- id: {
|
|
|
|
- title: 'ID',
|
|
|
|
- column: { show: false },
|
|
|
|
- search: { show: false },
|
|
|
|
- form: { show: false },
|
|
|
|
|
|
+ form: {
|
|
|
|
+ show: true,
|
|
|
|
+ component: {
|
|
|
|
+ props: {
|
|
|
|
+ filterable: true,
|
|
|
|
+ clearable: true,
|
|
|
|
+ placeholder: '请选择职位问题',
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
|
|
+
|
|
question: {
|
|
question: {
|
|
title: '题目内容',
|
|
title: '题目内容',
|
|
search: { show: true },
|
|
search: { show: true },
|
|
column: {
|
|
column: {
|
|
- minWidth: 120,
|
|
|
|
|
|
+
|
|
sortable: 'custom',
|
|
sortable: 'custom',
|
|
|
|
+ showOverflowTooltip: true, // 超出显示提示
|
|
|
|
+ width: 300 // 固定列宽
|
|
},
|
|
},
|
|
form: {
|
|
form: {
|
|
rules: [{ required: true, message: '题目内容必填' }],
|
|
rules: [{ required: true, message: '题目内容必填' }],
|
|
component: {
|
|
component: {
|
|
placeholder: '请输入题目内容',
|
|
placeholder: '请输入题目内容',
|
|
},
|
|
},
|
|
|
|
+ show: false
|
|
},
|
|
},
|
|
},
|
|
},
|
|
question_type: {
|
|
question_type: {
|
|
@@ -190,6 +221,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
placeholder: '请选择问题类型',
|
|
placeholder: '请选择问题类型',
|
|
},
|
|
},
|
|
helper: '选择问题的类型分类',
|
|
helper: '选择问题的类型分类',
|
|
|
|
+ show: false
|
|
},
|
|
},
|
|
},
|
|
},
|
|
question_form: {
|
|
question_form: {
|
|
@@ -225,9 +257,10 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
}
|
|
}
|
|
},
|
|
},
|
|
helper: '选择题目的形式:开放问题、单选题或多选题',
|
|
helper: '选择题目的形式:开放问题、单选题或多选题',
|
|
|
|
+ show: false
|
|
},
|
|
},
|
|
},
|
|
},
|
|
- position_types: {
|
|
|
|
|
|
+ /* position_types: {
|
|
title: '适用职位',
|
|
title: '适用职位',
|
|
search: { show: true },
|
|
search: { show: true },
|
|
type: 'dict-select',
|
|
type: 'dict-select',
|
|
@@ -242,18 +275,14 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
}),
|
|
}),
|
|
form: {
|
|
form: {
|
|
component: {
|
|
component: {
|
|
- /* name: 'el-select', */
|
|
|
|
props: {
|
|
props: {
|
|
multiple: true,
|
|
multiple: true,
|
|
filterable: true,
|
|
filterable: true,
|
|
placeholder: '请选择适用职位类型',
|
|
placeholder: '请选择适用职位类型',
|
|
- /* options: [
|
|
|
|
- { value: '0', label: '技术' },
|
|
|
|
- { value: '1', label: '管理' },
|
|
|
|
- ] */
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- helper: '选择题目适用的职位类型,可多选'
|
|
|
|
|
|
+ helper: '选择题目适用的职位类型,可多选',
|
|
|
|
+ show: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
recommended_duration: {
|
|
recommended_duration: {
|
|
@@ -271,9 +300,10 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
step: 10
|
|
step: 10
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- helper: '建议回答此题目的时长,单位为秒'
|
|
|
|
|
|
+ helper: '建议回答此题目的时长,单位为秒',
|
|
|
|
+ show: false
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ }, */
|
|
difficulty: {
|
|
difficulty: {
|
|
title: '难度等级',
|
|
title: '难度等级',
|
|
search: { show: true },
|
|
search: { show: true },
|
|
@@ -290,17 +320,21 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
}),
|
|
}),
|
|
form: {
|
|
form: {
|
|
rules: [{ required: true, message: '难度等级必填' }],
|
|
rules: [{ required: true, message: '难度等级必填' }],
|
|
- helper: '选择题目的难度级别'
|
|
|
|
|
|
+ helper: '选择题目的难度级别',
|
|
|
|
+ show: false
|
|
},
|
|
},
|
|
},
|
|
},
|
|
- is_system: {
|
|
|
|
|
|
+ /* is_system: {
|
|
title: '系统题目',
|
|
title: '系统题目',
|
|
search: { show: true },
|
|
search: { show: true },
|
|
|
|
+ dict: dict({
|
|
|
|
+ data: [
|
|
|
|
+ { value: 0, label: '停用' },
|
|
|
|
+ { value: 1, label: '启用' }
|
|
|
|
+ ]
|
|
|
|
+ }),
|
|
column: {
|
|
column: {
|
|
- width: 80,
|
|
|
|
- component: {
|
|
|
|
- name: 'el-switch'
|
|
|
|
- }
|
|
|
|
|
|
+ width: 120,
|
|
},
|
|
},
|
|
form: {
|
|
form: {
|
|
component: {
|
|
component: {
|
|
@@ -310,26 +344,16 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
inactiveText: '否'
|
|
inactiveText: '否'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- helper: '是否为系统预设题目'
|
|
|
|
|
|
+ helper: '是否为系统预设题目',
|
|
|
|
+ show: false
|
|
}
|
|
}
|
|
- },
|
|
|
|
- status: {
|
|
|
|
|
|
+ }, */
|
|
|
|
+ /* status: {
|
|
title: '状态',
|
|
title: '状态',
|
|
search: { show: true },
|
|
search: { show: true },
|
|
type: 'dict-select',
|
|
type: 'dict-select',
|
|
column: {
|
|
column: {
|
|
width: 80,
|
|
width: 80,
|
|
- /* component: {
|
|
|
|
- name: 'fs-dict-label',
|
|
|
|
- props: {
|
|
|
|
- dict: dict({
|
|
|
|
- data: [
|
|
|
|
- { value: 0, label: '停用' },
|
|
|
|
- { value: 1, label: '启用' }
|
|
|
|
- ]
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- } */
|
|
|
|
},
|
|
},
|
|
dict: dict({
|
|
dict: dict({
|
|
data: [
|
|
data: [
|
|
@@ -342,7 +366,8 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
component: {
|
|
component: {
|
|
placeholder: '请选择状态',
|
|
placeholder: '请选择状态',
|
|
},
|
|
},
|
|
- helper: '题目的启用状态'
|
|
|
|
|
|
+ helper: '题目的启用状态',
|
|
|
|
+ show: false
|
|
},
|
|
},
|
|
},
|
|
},
|
|
sort: {
|
|
sort: {
|
|
@@ -359,17 +384,18 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
max: 999
|
|
max: 999
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- helper: '题目的排序值,值越小排序越靠前'
|
|
|
|
|
|
+ helper: '题目的排序值,值越小排序越靠前',
|
|
|
|
+ show: false
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ }, */
|
|
option_items: {
|
|
option_items: {
|
|
title: '选项列表',
|
|
title: '选项列表',
|
|
search: { show: false },
|
|
search: { show: false },
|
|
column: { show: false },
|
|
column: { show: false },
|
|
form: {
|
|
form: {
|
|
- show: compute(({ form }) => {
|
|
|
|
|
|
+ /* show: compute(({ form }) => {
|
|
return form && (form.question_form === 1 || form.question_form === 2);
|
|
return form && (form.question_form === 1 || form.question_form === 2);
|
|
- }),
|
|
|
|
|
|
+ }), */
|
|
component: {
|
|
component: {
|
|
name: 'el-card',
|
|
name: 'el-card',
|
|
children: {
|
|
children: {
|
|
@@ -460,6 +486,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ show: false,
|
|
helper: compute(({ form }) => {
|
|
helper: compute(({ form }) => {
|
|
if (form.question_form === 1) {
|
|
if (form.question_form === 1) {
|
|
return '添加单选题的选项,并标记正确答案(只能有一个正确答案)';
|
|
return '添加单选题的选项,并标记正确答案(只能有一个正确答案)';
|
|
@@ -481,6 +508,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
rows: 4,
|
|
rows: 4,
|
|
placeholder: '请输入答案解析'
|
|
placeholder: '请输入答案解析'
|
|
},
|
|
},
|
|
|
|
+ show:false
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
|