Compare commits

...

1 Commits

Author SHA1 Message Date
clay a6744646fb clay : 用户信息回显完成 2023-03-10 22:11:52 +08:00
4 changed files with 50 additions and 5 deletions

View File

@ -10,9 +10,9 @@ Vue.prototype.$axios = axios;
// 字体图标
export function getBaseUrl(){
return "http://gateway.mytwins.top"
// return "http://gateway.mytwins.top"
// return "http://192.168.101.7:8000"
// return "http://localhost:8000"
return "http://localhost:8000"
}
const service = axios.create({

View File

@ -35,6 +35,12 @@
</div>
</div>
<el-input v-model="message"/><el-button @click="chatGPT">gpt</el-button>
<div v-for="(item,index) in f=messagesList">
{{item.content}}
</div>
<!-- <test type="user" ref="orgPicker" :v-model="select" :value="select" @dengjie="dengjie"-->
<!-- @ok="selected"></test>-->
@ -73,7 +79,9 @@ export default {
selected: false,
sex: null,
type: "user"
}
},
messagesList:[],
message: "",
}
},
mounted() {
@ -85,7 +93,36 @@ export default {
}
},
methods: {
chatGPT(){
let prompt = {
role:"user",
content:this.message
}
this.messagesList.push(prompt)
axios.request({
method: "POST",
// url:"https://api.openai.com/v1/chat/completions",
url:"https://wiki.odliken.cn/v1/chat/completions",
// headers:{
// "Authorization": "Bearer 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"
// },
data:{
"model": "gpt-3.5-turbo",
"messages":this.messagesList,
"temperature": 0.9,
"max_tokens": 512,
"frequency_penalty":0,
"presence_penalty":0
}
}).then(res=>{
let data = res.data.choices
this.messagesList.push(data[0].message)
})
},
getToken() {
// let item = localStorage.getItem("token");

View File

@ -68,6 +68,7 @@ export default {
this.processDefinition = processDefinition;
//
this.$store.state.design = processDefinition;
this.$store.state.selectUserMap.clear()
this.loading = false;
}).catch(err => {
this.$message.error(err);

View File

@ -120,15 +120,22 @@ export default {
// todo
submitForm(){
let processInstance = this.$refs.processInstance;
let optionalUser = {}
this.$store.state.selectUserMap.forEach(((value, key) => {optionalUser[key] = value}))
let paramsData = {
processDefinitionId: this.selectForm.processDefinitionId,
formData: JSON.stringify(processInstance.formData),
selectUserMap: this.$store.state.selectUserMap
optionalUser
}
console.log(this.$store.state.selectUserMap,paramsData)
console.log((new Map(this.$store.state.selectUserMap)))
processInstance.validate(valid => {
if (valid) {
startProcessInstance(paramsData).then(res=>{
this.openItemDl = false
// this.openItemDl = false
this.$message.success(res.msg)
this.$refs.disposalTask.getList()
})