From 510b43356f18aa5be351a0990c7cdc1d4478b5e7 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期三, 09 七月 2025 14:27:00 +0800
Subject: [PATCH] 测试完成
---
src/components/Regular/index.vue | 482 +++++++++++++++++++++++++++++------------------------
1 files changed, 266 insertions(+), 216 deletions(-)
diff --git a/src/components/Regular/index.vue b/src/components/Regular/index.vue
index 091e957..8985f3e 100644
--- a/src/components/Regular/index.vue
+++ b/src/components/Regular/index.vue
@@ -1,225 +1,243 @@
<template>
<div>
- <div class="topicxq" v-for="item in TargetoptionList">
- <el-row :gutter="10">
- <el-col :span="12"
- ><el-form-item label="閫夐」鍚嶇О">
- <el-input
- type="text"
- placeholder="璇疯緭鍏�"
- v-model="item.targetvalue"
- show-word-limit
- >
- </el-input> </el-form-item
- ></el-col>
- <el-col :span="12"
- ><el-form-item label="棰勮鍊�">
- <el-radio-group v-model="item.isabnormal">
- <el-radio :label="1">鏄�</el-radio>
- <el-radio :label="0">鍚�</el-radio>
- </el-radio-group>
- </el-form-item></el-col
- >
- <el-col :span="12" v-if="intent"
- ><el-form-item label="閫夐」鑺傜偣">
- <el-input
- type="text"
- placeholder="璇疯緭鍏ヨ妭鐐�"
- v-model="item.targetid"
- show-word-limit
- >
- </el-input> </el-form-item
- ></el-col>
- </el-row>
- <el-row :gutter="10" v-if="!intent">
- <el-col :span="20"
- ><el-form-item label="閫夐」璇存槑">
- <el-input
- type="text"
- placeholder="璇疯緭鍏�"
- v-model="item.optiondesc"
- show-word-limit
- >
- </el-input> </el-form-item
- ></el-col>
- </el-row>
- <el-row :gutter="10" v-if="intent">
- <el-col :span="12"
- ><el-form-item label="澶勭悊">
- <el-input
- type="text"
- placeholder="(榛樿)鏃犲0"
- v-model="item.text"
- maxlength="10"
- show-word-limit
- >
- </el-input> </el-form-item
- ></el-col>
- <el-col :span="12"
- ><el-form-item label="閫変腑璺宠浆">
- <el-input
- type="text"
- placeholder="璇疯緭鍏ラ鐩妭鐐�"
- v-model="item.nextQuestion"
- show-word-limit
- >
- </el-input> </el-form-item
- ></el-col>
- </el-row>
- <el-form-item label="鍏抽敭瀛�(鍚�)" prop="desc">
- <div class="xinz-inf">
- <el-tag
- :key="crux"
- type="success"
- v-for="crux in item.dynamiccruxs"
- closable
- effect="dark"
- :disable-transitions="false"
- @close="handleClosecrux(crux, item, 1)"
+ <div
+ class="topicxq"
+ v-for="item in TargetoptionList"
+ v-if="item.isoperation != 3"
+ >
+ <el-form :inline="true" :rules="rules" :model="item" label-width="80px">
+ <el-row :gutter="10">
+ <el-col :span="12"
+ ><el-form-item prop="targetvalue" label="閫夐」鍚嶇О">
+ <el-input
+ type="text"
+ placeholder="璇疯緭鍏ワ紙蹇呭~椤癸級"
+ v-model="item.targetvalue"
+ show-word-limit
+ >
+ </el-input> </el-form-item
+ ></el-col>
+ <el-col :span="12"
+ ><el-form-item label="寮傚父鎻愰啋">
+ <el-radio-group v-model="item.isabnormal">
+ <el-radio :label="1">鏄�</el-radio>
+ <el-radio :label="0">鍚�</el-radio>
+ </el-radio-group>
+ </el-form-item></el-col
>
- {{ crux }}
- </el-tag>
- <el-select
- v-model="inputValue"
- v-if="item.inputVisible"
- @change="handleInputConfirm(item)"
- filterable
- remote
- allow-create
- reserve-keyword
- default-first-option
- :loading="loading"
- placeholder="璇烽�夋嫨"
- >
- <el-option
- v-for="items in regular"
- :key="items.label"
- :label="items.label"
- :value="items.label"
- >
- </el-option>
- </el-select>
- <el-button
- v-else
- class="button-new-tag"
- size="small"
- @click="showInput(item)"
- >+ 鏂板</el-button
- >
- </div>
- </el-form-item>
- <el-form-item label="鍏抽敭瀛�(闈�)" prop="desc">
- <div class="xinz-inf">
- <el-tag
- :key="crux"
- type="warning"
- v-for="crux in item.nodynamiccruxs"
- closable
- effect="dark"
- :disable-transitions="false"
- @close="handleClosecrux(crux, item, 2)"
- >
- {{ crux }}
- </el-tag>
- <el-select
- v-model="inputValue"
- v-if="item.noinputVisible"
- @change="handleInputConfirm(item)"
- filterable
- remote
- allow-create
- reserve-keyword
- default-first-option
- :loading="loading"
- placeholder="璇烽�夋嫨"
- >
- <el-option
- v-for="items in noregular"
- :key="items.value"
- :label="items.label"
- :value="items.label"
- >
- </el-option>
- </el-select>
- <el-button
- v-else
- class="button-new-tag"
- size="small"
- @click="showInputno(item)"
- >+ 鏂板</el-button
- >
- </div>
- </el-form-item>
- <el-form-item label="閫夐」鏂囦欢" prop="sickness">
- <div style="width: 40vw">
- <el-upload
- class="upload-demo"
- :action="uploadImgUrl"
- :headers="headers"
- :accept="'image/*,video/*'"
- :on-success="handleChange.bind(this, item)"
- >
- <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
- </el-upload>
- <div style="margin: 20px">
- <el-image
- style="width: 100px; height: 100px"
- :src="item.picturePath"
- :preview-src-list="[...item.picturePath]"
- >
- </el-image>
- </div>
- </div>
- </el-form-item>
+ <!-- <el-col :span="12" v-if="intent"
+ ><el-form-item label="閫夐」鑺傜偣">
+ <el-input
+ type="text"
+ placeholder="璇疯緭鍏ヨ妭鐐�"
+ v-model="item.targetid"
+ show-word-limit
+ >
+ </el-input> </el-form-item
+ ></el-col> -->
+ </el-row>
+ <el-row :gutter="10" v-if="!intent">
+ <el-col :span="20"
+ ><el-form-item label="閫夐」璇存槑">
+ <el-input
+ style="width: 500px"
+ type="textarea"
+ :rows="2"
+ placeholder="璇疯緭鍏�"
+ v-model="item.optiondesc"
+ show-word-limit
+ >
+ </el-input> </el-form-item
+ ></el-col>
+ </el-row>
+ <el-form-item label="缁撴潫瀵硅瘽">
+ <el-radio-group v-model="item.isEnd">
+ <el-radio :label="1">鏄�</el-radio>
+ <el-radio :label="0">鍚�</el-radio>
+ </el-radio-group>
+ </el-form-item>
- <el-row :gutter="10">
- <el-col :span="16" v-if="intent">
- <el-form-item label="璇煶鏂囦欢">
+ <el-row :gutter="10" v-if="intent">
+ <el-col :span="12"
+ ><el-form-item label="澶勭悊">
+ <el-input
+ type="text"
+ placeholder="(榛樿)鏃犲0"
+ v-model="item.text"
+ maxlength="10"
+ show-word-limit
+ >
+ </el-input> </el-form-item
+ ></el-col>
+ <el-col :span="12" v-show="branchFlag"
+ ><el-form-item label="閫変腑璺宠浆">
+ <el-input
+ type="text"
+ @blur="$emit('branchFlagfn', item.nextQuestion)"
+ placeholder="璇疯緭鍏ラ鐩妭鐐�"
+ v-model="item.nextQuestion"
+ show-word-limit
+ >
+ </el-input> </el-form-item
+ ></el-col>
+ </el-row>
+ <el-row :gutter="10" v-if="scriptType == 1">
+ <el-form-item label="閫変腑鎻愮ず">
+ <el-input
+ style="width: 24vw"
+ type="textarea"
+ autosize
+ placeholder="璇疯緭鍏ュ唴瀹�"
+ v-model="item.prompt"
+ >
+ </el-input
+ ></el-form-item>
+ </el-row>
+ <el-row>
+ <el-form-item label="鍏抽敭瀛�(鍚�)" prop="desc" v-if="hasValue">
+ <div class="xinz-inf">
+ <el-tag
+ :key="crux"
+ type="success"
+ v-for="crux in item.dynamiccruxs"
+ closable
+ effect="dark"
+ :disable-transitions="false"
+ @close="handleClosecrux(crux, item, 1)"
+ >
+ {{ crux }}
+ </el-tag>
+ <el-select
+ v-model="inputValue"
+ v-if="item.inputVisible"
+ @change="handleInputConfirm(item)"
+ filterable
+ remote
+ allow-create
+ reserve-keyword
+ default-first-option
+ :loading="loading"
+ placeholder="璇烽�夋嫨"
+ >
+ <el-option
+ v-for="items in regular"
+ :key="items.label"
+ :label="items.label"
+ :value="items.label"
+ >
+ </el-option>
+ </el-select>
+ <el-button
+ v-else
+ class="button-new-tag"
+ size="small"
+ @click="showInput(item)"
+ >+ 鏂板</el-button
+ >
+ </div>
+ </el-form-item>
+ </el-row>
+ <el-row>
+ <el-form-item label="鍏抽敭瀛�(闈�)" prop="adesc" v-if="hasValue">
+ <div class="xinz-inf">
+ <el-tag
+ :key="crux"
+ type="warning"
+ v-for="crux in item.nodynamiccruxs"
+ closable
+ effect="dark"
+ :disable-transitions="false"
+ @close="handleClosecrux(crux, item, 2)"
+ >
+ {{ crux }}
+ </el-tag>
+ <el-select
+ v-model="inputValue"
+ v-if="item.noinputVisible"
+ @change="handleInputConfirm(item)"
+ filterable
+ remote
+ allow-create
+ reserve-keyword
+ default-first-option
+ :loading="loading"
+ placeholder="璇烽�夋嫨"
+ >
+ <el-option
+ v-for="items in noregular"
+ :key="items.value"
+ :label="items.label"
+ :value="items.label"
+ >
+ </el-option>
+ </el-select>
+ <el-button
+ v-else
+ class="button-new-tag"
+ size="small"
+ @click="showInputno(item)"
+ >+ 鏂板</el-button
+ >
+ </div>
+ </el-form-item>
+ </el-row>
+
+ <el-form-item label="閫夐」鏂囦欢" prop="sickness" v-if="Verbalproblem">
+ <div style="width: 40vw">
<el-upload
class="upload-demo"
- style="display: flex"
- action="https://jsonplaceholder.typicode.com/posts/"
- :on-change="handleChange"
- :file-list="fileList"
- :limit="1"
- :on-exceed="handleExceed"
+ :action="uploadImgUrl"
+ :headers="headers"
+ accept=".jpg,.png,image/*"
+ :on-success="handleChange.bind(this, item)"
>
<el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
</el-upload>
- </el-form-item></el-col
- >
- <el-col :span="intent ? 8 : 22">
- <div style="text-align: right; padding-right: 10px">
- <el-button
- v-if="controlsc"
- @click="$emit('addoption', item)"
- type="success"
- icon="el-icon-circle-plus-outline"
- circle
- ></el-button>
- <el-button
- type="danger"
- icon="el-icon-delete"
- circle
- @click="$emit('deloption', item)"
- ></el-button>
- <el-button
- v-if="controlsc"
- @click="$emit('syioption', item)"
- type="primary"
- icon="el-icon-top"
- circle
- ></el-button>
- <el-button
- v-if="controlsc"
- @click="$emit('xiayioption', item)"
- type="primary"
- icon="el-icon-bottom"
- circle
- ></el-button>
+ <div style="margin: 20px">
+ <el-image
+ style="width: 100px; height: 100px"
+ :src="item.picturePath"
+ :preview-src-list="[...item.picturePath]"
+ >
+ </el-image>
+ </div>
</div>
- </el-col>
- </el-row>
+ </el-form-item>
+
+ <el-row :gutter="10">
+ <el-col>
+ <div style="text-align: right; padding-right: 10px">
+ <el-button
+ v-if="controlsc || addoption"
+ @click="$emit('addoption', item)"
+ type="success"
+ icon="el-icon-circle-plus-outline"
+ circle
+ ></el-button>
+ <el-button
+ type="danger"
+ icon="el-icon-delete"
+ circle
+ @click="$emit('deloption', item)"
+ ></el-button>
+ <el-button
+ v-if="controlsc"
+ @click="$emit('syioption', item)"
+ type="primary"
+ icon="el-icon-top"
+ circle
+ ></el-button>
+ <el-button
+ v-if="controlsc"
+ @click="$emit('xiayioption', item)"
+ type="primary"
+ icon="el-icon-bottom"
+ circle
+ ></el-button>
+ </div>
+ </el-col>
+ </el-row>
+ </el-form>
</div>
</div>
</template>
@@ -252,6 +270,14 @@
noregular: [],
nodynamiccruxs: ["鍒�", "涓�"],
dynamiccruxs: ["濂�"],
+ rules: {
+ targetvalue: [
+ { required: true, message: "璇疯緭鍏ラ�夐」鍚嶇О", trigger: "blur" },
+ ],
+ isabnormal: [
+ { required: true, message: "璇疯緭鍏ラ�夐」鍚嶇О", trigger: "blur" },
+ ],
+ },
};
},
props: {
@@ -264,9 +290,29 @@
type: Boolean,
default: true,
},
+ scriptType: {
+ type: String,
+ default: "1",
+ },
+ addoption: {
+ type: Boolean,
+ default: false,
+ },
intent: {
type: Boolean,
default: true,
+ },
+ hasValue: {
+ type: Boolean,
+ default: true,
+ },
+ Verbalproblem: {
+ type: Boolean,
+ default: true,
+ },
+ branchFlag: {
+ type: Boolean,
+ default: false,
},
},
@@ -314,9 +360,9 @@
this.handleSelectionChange();
},
// 鎺у埗鏂囦欢
- handleChange(file, fileList) {
- this.fileList = fileList.slice(-3);
- },
+ // handleChange(file, fileList) {
+ // this.fileList = fileList.slice(-3);
+ // },
// 鏂囦欢瓒呭嚭涓暟闄愬埗鏃剁殑閽╁瓙
handleExceed(files, fileList) {
this.$message.warning(
@@ -392,9 +438,13 @@
},
// 閫夐」鏂囦欢涓婁紶
handleChange(item, response, file, fileList) {
+ console.log(response, "response");
+ console.log(item, "item");
+ console.log(this.TargetoptionList, "this.TargetoptionList");
let index = this.TargetoptionList.findIndex(
- (obj) => obj.id == item.id && obj.name == item.name
+ (obj) => obj.guid == item.guid
);
+ console.log(index);
this.TargetoptionList[index].picturePath = response.url;
},
},
--
Gitblit v1.9.3