|
@@ -174,6 +174,7 @@ import { checkPersonBaseInfo } from '@/utils/check'
|
|
import dialogExtend from '@/plugins/dialogExtend'
|
|
import dialogExtend from '@/plugins/dialogExtend'
|
|
import { formatName } from '@/utils/getText'
|
|
import { formatName } from '@/utils/getText'
|
|
|
|
|
|
|
|
+const emit = defineEmits(['preview'])
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
defaultWidth: {
|
|
defaultWidth: {
|
|
type: Boolean,
|
|
type: Boolean,
|
|
@@ -191,6 +192,11 @@ const props = defineProps({
|
|
type: [String, Number],
|
|
type: [String, Number],
|
|
default: ''
|
|
default: ''
|
|
},
|
|
},
|
|
|
|
+ // 是否为推荐职位引用
|
|
|
|
+ isRecommend: {
|
|
|
|
+ type: Boolean,
|
|
|
|
+ default: false
|
|
|
|
+ }
|
|
})
|
|
})
|
|
|
|
|
|
const { t } = useI18n()
|
|
const { t } = useI18n()
|
|
@@ -259,6 +265,13 @@ const cleanedHtml = (text) => {
|
|
return cleaned
|
|
return cleaned
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// 职位详情分享图片下载文件名
|
|
|
|
+const fileName = computed(() => {
|
|
|
|
+ const { name, areaName, payFrom, payTo } = info.value
|
|
|
|
+ const salary = payFrom && payTo ? `${payFrom ? '_' + payFrom + '-' : ''}${payTo}` : '-面议'
|
|
|
|
+ return `${name}${areaName ? '_' + areaName : ''}${salary}${positionInfo.value.payName ? '-' + positionInfo.value.payName : ''}`
|
|
|
|
+})
|
|
|
|
+
|
|
const share = ref()
|
|
const share = ref()
|
|
// 生成图片
|
|
// 生成图片
|
|
const generateAndDownloadImage = async () => {
|
|
const generateAndDownloadImage = async () => {
|
|
@@ -269,6 +282,10 @@ const generateAndDownloadImage = async () => {
|
|
const image = canvas.toDataURL().replace(/^data:image\/(png|jpg);base64,/, '')
|
|
const image = canvas.toDataURL().replace(/^data:image\/(png|jpg);base64,/, '')
|
|
previewSrc.value = `data:image/png;base64,${image}`
|
|
previewSrc.value = `data:image/png;base64,${image}`
|
|
loading.value = false
|
|
loading.value = false
|
|
|
|
+ if (props.isRecommend) {
|
|
|
|
+ emit('preview', previewSrc.value, fileName.value)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
showPreview.value = true
|
|
showPreview.value = true
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.error('Error generating image:', error)
|
|
console.error('Error generating image:', error)
|
|
@@ -276,13 +293,6 @@ const generateAndDownloadImage = async () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-// 职位详情分享图片下载文件名
|
|
|
|
-const fileName = computed(() => {
|
|
|
|
- const { name, areaName, payFrom, payTo } = info.value
|
|
|
|
- const salary = payFrom && payTo ? `${payFrom ? '_' + payFrom + '-' : ''}${payTo}` : '-面议'
|
|
|
|
- return `${name}${areaName ? '_' + areaName : ''}${salary}${positionInfo.value.payName ? '-' + positionInfo.value.payName : ''}`
|
|
|
|
-})
|
|
|
|
-
|
|
|
|
// 相似职位
|
|
// 相似职位
|
|
const similarList = ref([])
|
|
const similarList = ref([])
|
|
const getSimilarPositionList = async () => {
|
|
const getSimilarPositionList = async () => {
|