|
@@ -2,19 +2,19 @@
|
|
|
<div class="main animate__animated animate__backInRight" v-loading="loading">
|
|
|
<custom-search-bar :fields="fields.filter((f) => f.isSearch)" v-model="searchForm" @search="search" @reset="toReset">
|
|
|
<template #field>
|
|
|
- <el-option v-for="i in fieldList" :key="i._id" :label="i.label" :value="i.value"></el-option>
|
|
|
+ <el-option v-for="i in fieldList" :key="i.id" :label="i.label" :value="i.value"></el-option>
|
|
|
</template>
|
|
|
<template #type>
|
|
|
- <el-option v-for="i in typeList" :key="i._id" :label="i.label" :value="i.value"></el-option>
|
|
|
+ <el-option v-for="i in typeList" :key="i.id" :label="i.label" :value="i.value"></el-option>
|
|
|
</template>
|
|
|
<template #maturity>
|
|
|
- <el-option v-for="i in maturityList" :key="i._id" :label="i.label" :value="i.value"></el-option>
|
|
|
+ <el-option v-for="i in maturityList" :key="i.id" :label="i.label" :value="i.value"></el-option>
|
|
|
</template>
|
|
|
<template #skill>
|
|
|
- <el-option v-for="i in skillList" :key="i._id" :label="i.label" :value="i.value"></el-option>
|
|
|
+ <el-option v-for="i in skillList" :key="i.id" :label="i.label" :value="i.value"></el-option>
|
|
|
</template>
|
|
|
<template #cooperate>
|
|
|
- <el-option v-for="i in cooperateList" :key="i._id" :label="i.label" :value="i.value"></el-option>
|
|
|
+ <el-option v-for="i in cooperateList" :key="i.id" :label="i.label" :value="i.value"></el-option>
|
|
|
</template>
|
|
|
</custom-search-bar>
|
|
|
<custom-button-bar :fields="buttonFields" @add="toAdd"></custom-button-bar>
|
|
@@ -29,22 +29,22 @@
|
|
|
<el-col :span="24" v-if="dialog.type == '1'">
|
|
|
<custom-form v-model="form" :fields="formFields" :rules="rules" @save="toSave">
|
|
|
<template #is_use>
|
|
|
- <el-radio v-for="i in isUseList" :key="i._id" :label="i.value">{{ i.label }}</el-radio>
|
|
|
+ <el-radio v-for="i in isUseList" :key="i.id" :label="i.value">{{ i.label }}</el-radio>
|
|
|
</template>
|
|
|
<template #field>
|
|
|
- <el-option v-for="i in fieldList" :key="i._id" :label="i.label" :value="i.value"></el-option>
|
|
|
+ <el-option v-for="i in fieldList" :key="i.id" :label="i.label" :value="i.value"></el-option>
|
|
|
</template>
|
|
|
<template #type>
|
|
|
- <el-option v-for="i in typeList" :key="i._id" :label="i.label" :value="i.value"></el-option>
|
|
|
+ <el-option v-for="i in typeList" :key="i.id" :label="i.label" :value="i.value"></el-option>
|
|
|
</template>
|
|
|
<template #maturity>
|
|
|
- <el-option v-for="i in maturityList" :key="i._id" :label="i.label" :value="i.value"></el-option>
|
|
|
+ <el-option v-for="i in maturityList" :key="i.id" :label="i.label" :value="i.value"></el-option>
|
|
|
</template>
|
|
|
<template #skill>
|
|
|
- <el-option v-for="i in skillList" :key="i._id" :label="i.label" :value="i.value"></el-option>
|
|
|
+ <el-option v-for="i in skillList" :key="i.id" :label="i.label" :value="i.value"></el-option>
|
|
|
</template>
|
|
|
<template #cooperate>
|
|
|
- <el-option v-for="i in cooperateList" :key="i._id" :label="i.label" :value="i.value"></el-option>
|
|
|
+ <el-option v-for="i in cooperateList" :key="i.id" :label="i.label" :value="i.value"></el-option>
|
|
|
</template>
|
|
|
<template #area>
|
|
|
<el-cascader v-model="form.area" :props="{ value: 'label', label: 'label' }" :options="cityList" style="width: 100%" />
|
|
@@ -54,7 +54,7 @@
|
|
|
<el-col :span="24" v-if="dialog.type == '2'">
|
|
|
<custom-form v-model="examForm" :fields="examFormFields" :rules="examRules" @save="toExamSave">
|
|
|
<template #status>
|
|
|
- <el-option v-for="i in statusList" :key="i._id" :label="i.label" :value="i.value"></el-option>
|
|
|
+ <el-option v-for="i in statusList" :key="i.id" :label="i.label" :value="i.value"></el-option>
|
|
|
</template>
|
|
|
</custom-form>
|
|
|
</el-col>
|
|
@@ -192,7 +192,7 @@ const toEdit = (data) => {
|
|
|
}
|
|
|
// 删除
|
|
|
const toDelete = async (data) => {
|
|
|
- const res = await store.del(data._id)
|
|
|
+ const res = await store.del(data.id)
|
|
|
if ($checkRes(res, true)) {
|
|
|
search({ skip: 0, limit })
|
|
|
}
|
|
@@ -201,7 +201,7 @@ const toSave = async () => {
|
|
|
const data = cloneDeep(form.value)
|
|
|
const other = { status: '0' }
|
|
|
let res
|
|
|
- if (get(data, '_id')) res = await store.update({ ...data, ...other })
|
|
|
+ if (get(data, 'id')) res = await store.update({ ...data, ...other })
|
|
|
else res = await store.create({ ...data, ...other })
|
|
|
if ($checkRes(res, true)) {
|
|
|
search({ skip: 0, limit })
|
|
@@ -226,7 +226,7 @@ const toExamSave = async () => {
|
|
|
const toUse = async (data, is_use) => {
|
|
|
ElMessageBox.confirm(`确定修改【${data.name}】数据?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' })
|
|
|
.then(async () => {
|
|
|
- let res = await store.update({ _id: get(data, '_id'), is_use })
|
|
|
+ let res = await store.update({ id: get(data, 'id'), is_use })
|
|
|
if ($checkRes(res, true)) {
|
|
|
search({ skip: 0, limit })
|
|
|
}
|