|
@ -21,30 +21,31 @@
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:data="loadData"
|
|
:data="loadData"
|
|
:alert="true"
|
|
:alert="true"
|
|
:rowKey="(record) => record.id"
|
|
|
|
|
|
:rowKey="(record) => record.companyId"
|
|
>
|
|
>
|
|
<span slot="companyName" slot-scope="text">
|
|
<span slot="companyName" slot-scope="text">
|
|
<ellipsis :length="10" tooltip>{{ text }}</ellipsis>
|
|
|
|
|
|
<ellipsis :length="30" tooltip>{{ text }}</ellipsis>
|
|
</span>
|
|
</span>
|
|
<span slot="companyDescribe" slot-scope="text">
|
|
<span slot="companyDescribe" slot-scope="text">
|
|
<ellipsis :length="10" tooltip>{{ text }}</ellipsis>
|
|
|
|
|
|
<ellipsis :length="50" tooltip>{{ text }}</ellipsis>
|
|
</span>
|
|
</span>
|
|
<span slot="companyDefaultImg" slot-scope="src">
|
|
<span slot="companyDefaultImg" slot-scope="src">
|
|
<img :src="src | getImgUrl" width="60" height="45" @click="showPreviewImg(src)"/>
|
|
|
|
|
|
<img :src="src | getImgUrl" width="60" height="45" @click="showPreviewImg(src)" style="cursor: pointer;"/>
|
|
</span>
|
|
</span>
|
|
<span slot="companyExchangeImg" slot-scope="src">
|
|
<span slot="companyExchangeImg" slot-scope="src">
|
|
<img :src="src | getImgUrl" width="60" height="45" @click="showPreviewImg(src)"/>
|
|
|
|
|
|
<img :src="src | getImgUrl" width="60" height="45" @click="showPreviewImg(src)" style="cursor: pointer;"/>
|
|
</span>
|
|
</span>
|
|
<span slot="companyAssociatedCase" slot-scope="text">
|
|
<span slot="companyAssociatedCase" slot-scope="text">
|
|
<ellipsis :length="10" tooltip>{{ text }}</ellipsis>
|
|
|
|
|
|
<ellipsis :length="20" tooltip>{{ text }}</ellipsis>
|
|
</span>
|
|
</span>
|
|
<span slot="companyJumpUrl" slot-scope="text">
|
|
<span slot="companyJumpUrl" slot-scope="text">
|
|
<ellipsis :length="10" tooltip>{{ text }}</ellipsis>
|
|
|
|
|
|
<ellipsis :length="80" tooltip>{{ text }}</ellipsis>
|
|
</span>
|
|
</span>
|
|
<span slot="action" slot-scope="text, record">
|
|
<span slot="action" slot-scope="text, record">
|
|
<a-popconfirm placement="top" :title="record.companyIsLine===1? '是否确认下线该条目?':'是否确认上线该条目?'" @confirm="() => editjobStatusStatus(record.companyIsLine,record)">
|
|
<a-popconfirm placement="top" :title="record.companyIsLine===1? '是否确认下线该条目?':'是否确认上线该条目?'" @confirm="() => editjobStatusStatus(record.companyIsLine,record)">
|
|
<a>{{ statusFilter(record.companyIsLine) }}</a>
|
|
<a>{{ statusFilter(record.companyIsLine) }}</a>
|
|
</a-popconfirm>
|
|
</a-popconfirm>
|
|
|
|
<a-divider type="vertical"/>
|
|
<a v-if="hasPerm('companyCaseIndex:edit')" @click="$refs.editForm.edit(record)">编辑</a>
|
|
<a v-if="hasPerm('companyCaseIndex:edit')" @click="$refs.editForm.edit(record)">编辑</a>
|
|
<a-divider type="vertical" v-if="hasPerm('companyCaseIndex:edit') && hasPerm('companyCaseIndex:delete')"/>
|
|
<a-divider type="vertical" v-if="hasPerm('companyCaseIndex:edit') && hasPerm('companyCaseIndex:delete')"/>
|
|
<a-popconfirm v-if="hasPerm('companyCaseIndex:delete')" placement="topRight" title="是否确认删除该条目?" @confirm="() => companyCaseIndexDelete(record)">
|
|
<a-popconfirm v-if="hasPerm('companyCaseIndex:delete')" placement="topRight" title="是否确认删除该条目?" @confirm="() => companyCaseIndexDelete(record)">
|
|
@ -54,7 +55,7 @@
|
|
</s-table>
|
|
</s-table>
|
|
<add-form ref="addForm" @ok="handleOk" />
|
|
<add-form ref="addForm" @ok="handleOk" />
|
|
<edit-form ref="editForm" @ok="handleOk" />
|
|
<edit-form ref="editForm" @ok="handleOk" />
|
|
<a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">
|
|
|
|
|
|
<a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel" title="预览">
|
|
<img alt="example" style="width: 100%" :src="previewImage" />
|
|
<img alt="example" style="width: 100%" :src="previewImage" />
|
|
</a-modal>
|
|
</a-modal>
|
|
</a-card>
|
|
</a-card>
|
|
@ -64,8 +65,10 @@
|
|
import homeApi from '@/api/homeApi'
|
|
import homeApi from '@/api/homeApi'
|
|
import { setImgUrl } from '@/utils/img'
|
|
import { setImgUrl } from '@/utils/img'
|
|
import addForm from './addCompanyCaseForm'
|
|
import addForm from './addCompanyCaseForm'
|
|
import editForm from './editBannerForm'
|
|
|
|
// import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
|
|
|
|
|
|
import editForm from './editCompanyCaseForm'
|
|
|
|
|
|
|
|
const _ = require('lodash')
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'CompanyCaseIndex',
|
|
name: 'CompanyCaseIndex',
|
|
components: {
|
|
components: {
|
|
@ -115,8 +118,8 @@
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '关联案例',
|
|
title: '关联案例',
|
|
dataIndex: 'companyAssociatedCase',
|
|
|
|
scopedSlots: { customRender: 'companyAssociatedCase' }
|
|
|
|
|
|
dataIndex: 'companyAssociatedCaseShow',
|
|
|
|
scopedSlots: { customRender: 'companyAssociatedCaseShow' }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '跳转链接',
|
|
title: '跳转链接',
|
|
@ -133,7 +136,11 @@
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
return homeApi.findCompanyCaseById(Object.assign(parameter, this.queryParam)).then((res) => {
|
|
return homeApi.findCompanyCaseById(Object.assign(parameter, this.queryParam)).then((res) => {
|
|
return res.data
|
|
|
|
|
|
var data = res.data
|
|
|
|
_.each(data.rows, (item, index) => {
|
|
|
|
item.companyAssociatedCaseShow = JSON.parse(item.companyAssociatedCase).articleContentTitle || JSON.parse(item.companyAssociatedCase).articleContentClassify
|
|
|
|
})
|
|
|
|
return data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
selectedRowKeys: [],
|
|
selectedRowKeys: [],
|
|
@ -162,9 +169,9 @@
|
|
statusFilter (status) {
|
|
statusFilter (status) {
|
|
const values = this.statusDictTypeDropDown.filter(item => item.code === status)
|
|
const values = this.statusDictTypeDropDown.filter(item => item.code === status)
|
|
if (values.length > 0) {
|
|
if (values.length > 0) {
|
|
return values[0].value
|
|
|
|
|
|
return values[0].name
|
|
} else {
|
|
} else {
|
|
return 'ddd'
|
|
|
|
|
|
return '上线'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
@ -172,19 +179,27 @@
|
|
*/
|
|
*/
|
|
editjobStatusStatus (code, record) {
|
|
editjobStatusStatus (code, record) {
|
|
if (code === 1) {
|
|
if (code === 1) {
|
|
homeApi.updateIsLineCompanyCase({ id: record.id, isLine: false }).then(res => {
|
|
|
|
if (res.success) {
|
|
|
|
this.$message.success('下线成功')
|
|
|
|
this.$refs.table.refresh()
|
|
|
|
|
|
homeApi.updateIsLineCompanyCase({ id: record.companyId, isLine: 0 }).then(res => {
|
|
|
|
if (res.status === 200) {
|
|
|
|
if (res.data) {
|
|
|
|
this.$message.success('下线成功')
|
|
|
|
this.$refs.table.refresh()
|
|
|
|
} else {
|
|
|
|
this.$message.error('下线失败')
|
|
|
|
}
|
|
} else {
|
|
} else {
|
|
this.$message.error('下线失败:' + res.message)
|
|
this.$message.error('下线失败:' + res.message)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
} else if (code === 2) {
|
|
|
|
homeApi.updateIsLineCompanyCase({ id: record.id, isLine: true }).then(res => {
|
|
|
|
if (res.success) {
|
|
|
|
this.$message.success('上线成功')
|
|
|
|
this.$refs.table.refresh()
|
|
|
|
|
|
} else {
|
|
|
|
homeApi.updateIsLineCompanyCase({ id: record.companyId, isLine: 1 }).then(res => {
|
|
|
|
if (res.status === 200) {
|
|
|
|
if (res.data) {
|
|
|
|
this.$message.success('上线成功')
|
|
|
|
this.$refs.table.refresh()
|
|
|
|
} else {
|
|
|
|
this.$message.error('上线失败')
|
|
|
|
}
|
|
} else {
|
|
} else {
|
|
this.$message.error('上线失败:' + res.message)
|
|
this.$message.error('上线失败:' + res.message)
|
|
}
|
|
}
|
|
@ -192,10 +207,14 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
companyCaseIndexDelete (record) {
|
|
companyCaseIndexDelete (record) {
|
|
homeApi.deleteCompanyCase({ id: record.id }).then((res) => {
|
|
|
|
if (res.success) {
|
|
|
|
this.$message.success('删除成功')
|
|
|
|
this.$refs.table.refresh()
|
|
|
|
|
|
homeApi.deleteCompanyCase({ id: record.companyId }).then((res) => {
|
|
|
|
if (res.status === 200) {
|
|
|
|
if (res.data) {
|
|
|
|
this.$message.success('删除成功')
|
|
|
|
this.$refs.table.refresh()
|
|
|
|
} else {
|
|
|
|
this.$message.error('删除失败')
|
|
|
|
}
|
|
} else {
|
|
} else {
|
|
this.$message.error('删除失败:' + res.message)
|
|
this.$message.error('删除失败:' + res.message)
|
|
}
|
|
}
|