gpt.js
1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-19 13:46:20
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-30 16:21:24
* @FilePath: \scrm-micro-home\src\mixins\gpt.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { mapState, mapActions } from 'vuex'
export default {
data() {
return {
t1: 0, // 主标题下标
t2: 0 // 副标题下标
}
},
computed: {
...mapState('marketing', ['keywords', 'GPTList'])
},
watch: {
GPTList: {
handler() {
this.t1 = 0
this.t2 = 0
},
deep: true
}
},
methods: {
getGPTitle(type) {
const len = this.GPTList.mainTitles.length
console.log(len)
if (type == 1) {
this.editForm.marketingTitle = this.GPTList.mainTitles[this.t1 % len].title
this.t1++
}
if (type == 2) {
this.editForm.marketingSubtitle = this.GPTList.subTitles[this.t2 % len].title
this.t2++
}
}
},
mounted() {}
}