123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- <template>
- <el-dialog title="提示词设置" :visible.sync="dialogVisibleAiD" :append-to-body="true" width="650px" :before-close="handleClose"
- class="dialog_diy">
- <div style="height: 100%;padding:15px">
- <div class="ai_nav">
- <span :class="{active: type == 1}">基础创建</span>
- </div>
- <div class="ai_detail" v-if="type == 1">
- <span class="title">{{text2 ? '默认的提示词1' : '默认的提示词'}}</span>
- <textarea rows="10" class="binfo_input binfo_textarea" cols v-model="text"
- placeholder="请输入...."></textarea>
- </div>
- <div class="ai_detail" v-if="text2 && type == 1" style="margin-top: 10px;">
- <span class="title">默认的提示词2</span>
- <textarea rows="10" class="binfo_input binfo_textarea" cols v-model="text2"
- placeholder="请输入...."></textarea>
- </div>
- <div class="ai_detail" v-if="text3 && type == 1" style="margin-top: 10px;">
- <span class="title">默认的提示词3</span>
- <textarea rows="10" class="binfo_input binfo_textarea" cols v-model="text3"
- placeholder="请输入...."></textarea>
- </div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="confirm" type="primary">确 定</el-button>
- <el-button @click="close">关 闭</el-button>
- </span>
- </el-dialog>
- </template>
-
- <script>
- export default {
- props: {
- dialogVisibleAiD: {
- type: Boolean,
- default: false
- },
- aiText: {
- type: String,
- },
- aiText2: {
- type: String,
- },
- aiText3: {
- type: String,
- },
- clickType: {
- type: Number
- }
- },
- data() {
- return {
- type: 1,
- text: "",
- text2: "",
- text3: "",
- }
- },
- watch:{
- dialogVisibleAiD(newValue, oldValue) {
- if(newValue){
- this.text = JSON.parse(JSON.stringify(this.aiText))
- this.text2 = this.aiText2 ? JSON.parse(JSON.stringify(this.aiText2)) : ''
- this.text3 = this.aiText3 ? JSON.parse(JSON.stringify(this.aiText3)) : ''
- if(this.clickType == 2){
- this.confirm();
- }
- }
- },
- },
- methods: {
- handleClose(done) {
- this.close()
- done();
- },
- close() {
- this.$emit('update:dialogVisibleAiD', false)
- },
- confirm(){
- this.$emit("aiConfirm",this.text,this.text2,this.text3);
- this.$emit('update:dialogVisibleAiD', false)
- }
- },
- }
- </script>
-
- <style scoped>
- .dialog_diy>>>.el-dialog {
- height: auto;
- margin: 15vh auto 0 !important;
- }
- .dialog_diy>>>.el-dialog__header {
- background: #454545 !important;
- padding: 15px 20px;
- }
- .dialog_diy>>>.el-dialog__body {
- height: calc(100% - 124px);
- box-sizing: border-box;
- padding: 0px;
- }
- .dialog_diy>>>.el-dialog__title {
- color: #fff;
- }
- .dialog_diy>>>.el-dialog__headerbtn {
- top: 19px;
- }
- .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close {
- color: #fff;
- }
- .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close:hover {
- color: #fff;
- }
- .dialog_diy>>>.el-dialog__body,
- .dialog_diy>>>.el-dialog__footer {
- background: #fafafa;
- }
- .ai_detail > .binfo_input {
- width: 100%;
- margin: 0;
- padding: 12px 14px;
- display: block;
- min-width: 0;
- outline: none;
- box-sizing: border-box;
- background: none;
- border: none;
- border-radius: 4px;
- background: #fff;
- font-size: 16px;
- resize: none;
- font-family: "Microsoft YaHei";
- min-height: 48px;
- /* border: 1px solid #3682fc00; */
- border: 1.5px solid #cad1dc;
- }
- .ai_detail > .binfo_textarea {
- border: 1.5px solid #cad1dc;
- font-size: 16px;
- resize: none;
- /* background: #f6f6f6; */
- font-family: "Microsoft YaHei";
- }
- .ai_detail > .binfo_input:focus-visible {
- border: 1.5px solid #3681fc !important;
- }
- .ai_nav{
- font-size: 16px;
- margin-bottom: 10px;
- display: flex;
- align-items: center;
- }
- .ai_nav > span{
- cursor: pointer;
- }
- .ai_nav > span + span{
- margin-left: 15px;
- }
- .ai_nav > span.active{
- color: #3681fc;
- }
- .ai_detail{
- display: flex;
- flex-direction: column;
- }
- .ai_detail > .title{
- margin-bottom: 5px;
- }
- </style>
|