From 17b041e2e7ebd5afe75403fefc57cc6a88b51dad Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期二, 06 八月 2024 13:23:58 +0800
Subject: [PATCH] 测试完成
---
src/views/repositoryai/verbaltrick/particulars/index.vue | 469 ++++++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 341 insertions(+), 128 deletions(-)
diff --git a/src/views/repositoryai/verbaltrick/particulars/index.vue b/src/views/repositoryai/verbaltrick/particulars/index.vue
index 14a7cbf..7ced909 100644
--- a/src/views/repositoryai/verbaltrick/particulars/index.vue
+++ b/src/views/repositoryai/verbaltrick/particulars/index.vue
@@ -25,7 +25,14 @@
<div class="leftvlue">
<!-- 鍩烘湰淇℃伅 -->
<div v-if="Editprogress == 1">
- <div class="leftvlue-jbxx">鍩烘湰淇℃伅</div>
+ <div class="leftvlue-jbxx">
+ 鍩烘湰淇℃伅
+ <span style="margin-left: 30px"
+ ><el-button type="success" round @click="gettargetInfo"
+ >+閫夋嫨鎸囨爣</el-button
+ ></span
+ >
+ </div>
<el-divider></el-divider>
<el-form
ref="form"
@@ -131,6 +138,7 @@
@change="handleInputConfirm"
filterable
remote
+ allow-create
reserve-keyword
default-first-option
:remote-method="remoteMethodtag"
@@ -217,8 +225,8 @@
<el-col :span="6">
<el-form-item label="閫傜敤鏂瑰紡" prop="status">
<el-select
+ disabled
v-model="indexform.suitway"
- multiple
placeholder="璇烽�夋嫨"
>
<el-option
@@ -231,28 +239,6 @@
</el-select>
</el-form-item>
</el-col>
- <el-col :span="8">
- <el-form-item label="鍏宠仈鎸囨爣" prop="region">
- <el-select
- v-model="indexform.targetid"
- filterable
- remote
- reserve-keyword
- placeholder="璇疯緭鍏ュ叧閿瘝"
- :remote-method="remoteMethod"
- @change="targetchange"
- :loading="loading"
- >
- <el-option
- v-for="item in targetlist"
- :key="item.id"
- :label="item.targetname"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
</el-row>
<el-row>
<el-col :span="24">
@@ -260,7 +246,7 @@
<div style="display: flex; margin-bottom: 10px">
<div
v-for="item in variablelist"
- class="tsgname"
+ :class="item.default ? 'tsgname' : 'tsgnames'"
@click="tsgnameto(item)"
>
{{ item.variatename }}
@@ -291,19 +277,37 @@
<el-form-item label="闂璇煶" prop="verbaltrickyy">
<el-upload
class="upload-demo"
- action="https://jsonplaceholder.typicode.com/posts/"
- :on-change="handleChange"
- :file-list="fileList"
+ :action="uploadImgUrl"
+ :headers="headers"
+ :show-file-list="false"
+ :on-success="
+ (response, file) => handleChange(response, file, 1)
+ "
+ accept=".wav,.mp3"
:limit="1"
- :on-exceed="handleExceed"
>
<el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
</el-upload>
- <!-- <el-input v-model="indexform.userName" maxlength="66"
- show-word-limit /> -->
</el-form-item>
- </el-col></el-row
- >
+ </el-col>
+ <el-col :span="6">
+ <span style="font-size: 12px">{{
+ indexform.scriptVoice.substring(
+ indexform.scriptVoice.lastIndexOf("/") + 1
+ )
+ }}</span>
+ </el-col>
+ <el-col :span="6">
+ <mini-audio
+ :audio-source="
+ indexform.scriptVoice
+ ? indexform.scriptVoice
+ : 'https://example.com/example.mp3'
+ "
+ ></mini-audio>
+ </el-col>
+ </el-row>
+
<el-row>
<el-col :span="24">
<el-form-item label="鏃犲尮閰嶆枃鏈�" prop="noMatchText">
@@ -320,20 +324,39 @@
></el-row>
<el-row>
<el-col :span="6">
- <el-form-item label="鏃犲尮閰嶈闊�" prop="matchyy">
+ <el-form-item label="鏃犲尮閰嶈闊�" prop="verbaltrickyy">
<el-upload
class="upload-demo"
- action="https://jsonplaceholder.typicode.com/posts/"
- :on-change="handleChange"
- :file-list="fileList"
+ :action="uploadImgUrl"
+ :show-file-list="false"
+ :headers="headers"
+ :on-success="
+ (response, file) => handleChange(response, file, 2)
+ "
+ accept=".wav,.mp3"
:limit="1"
- :on-exceed="handleExceed"
>
<el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
</el-upload>
</el-form-item>
- </el-col></el-row
- >
+ </el-col>
+ <el-col :span="6">
+ <span style="font-size: 12px">{{
+ indexform.nomatchvoice.substring(
+ indexform.nomatchvoice.lastIndexOf("/") + 1
+ )
+ }}</span>
+ </el-col>
+ <el-col :span="6">
+ <mini-audio
+ :audio-source="
+ indexform.nomatchvoice
+ ? indexform.nomatchvoice
+ : 'https://example.com/example.mp3'
+ "
+ ></mini-audio>
+ </el-col>
+ </el-row>
<el-row>
<el-col :span="24">
<el-form-item label="鏃犲0鏂囨湰" prop="slienceText">
@@ -350,20 +373,39 @@
></el-row>
<el-row>
<el-col :span="6">
- <el-form-item label="鏃犲0璇煶" prop="silentyy">
+ <el-form-item label="鏃犲0璇煶" prop="verbaltrickyy">
<el-upload
class="upload-demo"
- action="https://jsonplaceholder.typicode.com/posts/"
- :on-change="handleChange"
- :file-list="fileList"
+ :action="uploadImgUrl"
+ :show-file-list="false"
+ :headers="headers"
+ :on-success="
+ (response, file) => handleChange(response, file, 3)
+ "
+ accept=".wav,.mp3"
:limit="1"
- :on-exceed="handleExceed"
>
<el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
</el-upload>
</el-form-item>
- </el-col></el-row
- >
+ </el-col>
+ <el-col :span="6">
+ <span style="font-size: 12px">{{
+ indexform.sliencevoice.substring(
+ indexform.sliencevoice.lastIndexOf("/") + 1
+ )
+ }}</span>
+ </el-col>
+ <el-col :span="6">
+ <mini-audio
+ :audio-source="
+ indexform.sliencevoice
+ ? indexform.sliencevoice
+ : 'https://example.com/example.mp3'
+ "
+ ></mini-audio>
+ </el-col>
+ </el-row>
<el-row>
<el-col :span="24">
@@ -381,20 +423,39 @@
></el-row>
<el-row>
<el-col :span="6">
- <el-form-item label="鍚笉娓呰闊�" prop="vagueyy">
+ <el-form-item label="鍚笉娓呰闊�" prop="verbaltrickyy">
<el-upload
class="upload-demo"
- action="https://jsonplaceholder.typicode.com/posts/"
- :on-change="handleChange"
- :file-list="fileList"
+ :action="uploadImgUrl"
+ :show-file-list="false"
+ :headers="headers"
+ :on-success="
+ (response, file) => handleChange(response, file, 4)
+ "
+ accept=".wav,.mp3"
:limit="1"
- :on-exceed="handleExceed"
>
<el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
</el-upload>
</el-form-item>
- </el-col></el-row
- >
+ </el-col>
+ <el-col :span="6">
+ <span style="font-size: 12px">{{
+ indexform.noclearlyvoice.substring(
+ indexform.noclearlyvoice.lastIndexOf("/") + 1
+ )
+ }}</span>
+ </el-col>
+ <el-col :span="6">
+ <mini-audio
+ :audio-source="
+ indexform.noclearlyvoice
+ ? indexform.noclearlyvoice
+ : 'https://example.com/example.mp3'
+ "
+ ></mini-audio>
+ </el-col>
+ </el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="nextstep">涓嬩竴姝�</el-button>
@@ -404,7 +465,14 @@
</div>
<!-- 鎸囨爣璁剧疆 -->
<div v-if="Editprogress == 2">
- <div class="leftvlue-jbxx">鎸囨爣棰樼洰璁剧疆</div>
+ <div class="leftvlue-jbxx">
+ 鎸囨爣棰樼洰璁剧疆
+ <span style="margin-left: 30px"
+ ><el-button type="success" round @click="gettargetInfo"
+ >+閫夋嫨鎸囨爣</el-button
+ ></span
+ >
+ </div>
<el-divider></el-divider>
<el-form
ref="form"
@@ -442,6 +510,15 @@
<el-radio :label="3">鏁板��</el-radio>
</el-radio-group>
</el-form-item>
+
+ <el-form-item label="棰樼洰绫诲瀷">
+ <el-radio-group disabled v-model="indexform.scriptType">
+ <el-radio :label="1">鍗曢��</el-radio>
+ <el-radio :label="2">澶氶��</el-radio>
+ <el-radio :label="3">濉┖</el-radio>
+ <el-radio :label="4">闂瓟</el-radio>
+ </el-radio-group>
+ </el-form-item>
</el-col></el-row
>
<div v-if="indexform.valueType == 1">
@@ -453,20 +530,23 @@
@syioption="syioption"
@xiayioption="xiayioption"
:intent="false"
+ :Verbalproblem="false"
/>
</el-card>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="娴嬭瘯杈撳叆" prop="targetvalue">
<el-input
- v-model="testvalue"
+ v-model="indexform.content"
placeholder="璇疯緭鍏ユ祴璇曞唴瀹�"
maxlength="40"
/>
</el-form-item>
</el-col>
<el-col :span="4">
- <el-button type="success">寮�濮嬫祴璇�</el-button>
+ <el-button type="success" @click="testtagerlist"
+ >寮�濮嬫祴璇�</el-button
+ >
</el-col>
</el-row>
<div style="margin-bottom: 20px">
@@ -495,6 +575,97 @@
<el-button @click="Saveproblem()">淇濆瓨鏁版嵁</el-button>
</div>
</div>
+ <el-drawer
+ title="閫夋嫨鎸囨爣"
+ :visible.sync="drawer"
+ custom-class="demo-drawer"
+ size="50%"
+ >
+ <div class="preview-left">
+ <el-form
+ :model="queryParams"
+ ref="queryForm"
+ size="small"
+ :inline="true"
+ label-width="98px"
+ >
+ <el-form-item label="鏍囬" prop="userName">
+ <el-input
+ v-model="queryParams.targetname"
+ placeholder="璇疯緭鍏�"
+ clearable
+ style="width: 200px"
+ @keyup.enter.native="gettargetInfo"
+ />
+ </el-form-item>
+ <el-form-item label="鎸囨爣绫诲瀷" prop="scriptType">
+ <el-select v-model="queryParams.scriptType" placeholder="璇烽�夋嫨">
+ <el-option
+ v-for="(item, index) in qyoptions"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </el-form-item>
+
+ <el-form-item>
+ <el-button
+ type="primary"
+ icon="el-icon-search"
+ size="medium"
+ @click="gettargetInfo"
+ >鎼滅储</el-button
+ >
+ <el-button icon="el-icon-refresh" size="medium" @click="resetQuery"
+ >閲嶇疆</el-button
+ >
+ </el-form-item>
+ </el-form>
+ <el-table v-loading="loading" :data="targetList">
+ <el-table-column
+ label="鏍囬"
+ align="center"
+ key="targetname"
+ prop="targetname"
+ width="100"
+ />
+ <el-table-column
+ label="闂鍐呭"
+ align="center"
+ key="targetdesc"
+ prop="targetdesc"
+ width="200"
+ :show-overflow-tooltip="true"
+ />
+
+ <el-table-column
+ label="鎿嶄綔"
+ align="center"
+ class-name="small-padding fixed-width"
+ >
+ <template slot-scope="scope">
+ <el-button
+ size="medium"
+ type="text"
+ @click="selectlabel(scope.row)"
+ ><span class="button-textxg"
+ ><i class="el-icon-circle-plus-outline"></i>閫夋嫨</span
+ ></el-button
+ >
+ </template>
+ </el-table-column>
+ </el-table>
+ <pagination
+ v-show="total > 0"
+ :total="total"
+ :page.sync="queryParams.pageNum"
+ :limit.sync="queryParams.pageSize"
+ @pagination="gettargetInfo"
+ />
+ </div>
+ </el-drawer>
</div>
</template>
@@ -512,12 +683,17 @@
} from "@/api/AiCentre/index";
import Regular from "@/components/Regular"; //姝e垯缁勪欢
import store from "@/store";
+import { getToken } from "@/utils/auth";
export default {
name: "Verbalproblem",
components: { Regular },
data() {
return {
+ headers: {
+ Authorization: "Bearer " + getToken(),
+ },
+ uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/uploadSort",
Editprogress: 1, //缂栬緫杩涘害
loading: false, // 閬僵灞�
radio: "false", //鍗曢�夐閫変腑
@@ -525,7 +701,9 @@
radioas: "", //濉┖棰樼瓟妗�
dynamicTags: [],
dellist: [],
+ targetList: [],
inputVisible: false,
+ drawer: false,
inputValue: "",
testvalue: "",
testgovalue: "",
@@ -533,6 +711,7 @@
indexform: {
ivrLibaScriptTargetoptionList: [],
ivrLibaScriptTagList: [],
+ suitway: "2",
},
mode: [],
questionclass: [],
@@ -540,13 +719,6 @@
courtyardlist: [],
// 鎬绘潯鏁�
total: 1,
-
- targetlist: [
- {
- value: "閫夐」1",
- label: "鍥炬枃",
- },
- ],
rules: {},
rulesa: {},
optionstag: [],
@@ -567,15 +739,11 @@
addvalue: "娣诲姞棰樼洰",
languagelist: [], //璇█鍒楄〃
+ qyoptions: [],
// 鏌ヨ鍙傛暟
queryParams: {
pageNum: 1,
pageSize: 10,
- userName: undefined,
- phonenumber: undefined,
- status: undefined,
- deptId: undefined,
- IDnumber: undefined,
},
variabledeawer: false,
};
@@ -589,6 +757,7 @@
this.languagelist = store.getters.languagelist;
this.usable = store.getters.usable;
this.courtyardlist = store.getters.courtyardlist;
+ this.qyoptions = store.getters.askvaluetype;
},
methods: {
@@ -598,8 +767,7 @@
if (id) {
getverbaltrick({ id: id }).then((res) => {
this.indexform = res.data;
- if (this.indexform.suitway)
- this.indexform.suitway = this.indexform.suitway.split(",");
+
this.indexform.assortid = parseInt(this.indexform.assortid);
this.variablelist = JSON.parse(this.indexform.otherdata).length
? JSON.parse(this.indexform.otherdata)
@@ -607,18 +775,8 @@
this.dynamicTags = this.indexform.ivrLibaScriptTagList.map(
this.processElement
);
-
- // this.targetlist = [
- // {
- // id: this.indexform.targetid,
- // targetname: this.indexform.targetname,
- // },
- // ];
});
}
- gettargetInfolist({ pageSize: 100, pageNum: 1 }).then((res) => {
- this.targetlist = res.rows;
- });
// 鏍�
getbaltrickclassify({}).then((res) => {
this.questionclass = res.rows;
@@ -629,9 +787,6 @@
// 淇濆瓨璇︾粏淇℃伅
Saveproblem() {
this.indexform.otherdata = JSON.stringify(this.variablelist);
- if (this.indexform.suitway) {
- this.indexform.suitway = this.indexform.suitway.join(",");
- }
if (this.indexform.id) {
this.indexform.ivrLibaScriptTargetoptionList =
@@ -646,6 +801,11 @@
console.log(this.dellist);
this.indexform.ivrLibaScriptTargetoptionList =
this.indexform.ivrLibaScriptTargetoptionList.concat(this.dellist);
+ this.indexform.targetoptions =
+ this.indexform.ivrLibaScriptTargetoptionList
+ .filter((item) => item.isope != 3) // 杩囨护鎺� isope 涓� 3 鐨勯」
+ .map((item) => item.targetvalue)
+ .join(", ");
compileverbaltrick(this.indexform).then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess("淇敼鎴愬姛");
@@ -673,43 +833,63 @@
});
}
},
- remoteMethod(query) {
- if (query !== "") {
- this.loading = true;
- setTimeout(() => {
- this.loading = false;
- gettargetInfolist({ targetname: query }).then((res) => {
- this.targetlist = res.rows;
- });
- }, 200);
+
+ testtagerlist() {
+ if (this.indexform.content) {
+ let data = this.indexform;
+ data.targetoptionList =
+ this.indexform.ivrLibaScriptTargetoptionList.concat(this.dellist);
+ testtagerlist(data).then((res) => {
+ this.$modal.msgSuccess("娴嬭瘯鎴愬姛");
+ this.testgovalue = res.msg;
+ this.getList();
+ });
} else {
- this.targetlist = [];
+ this.$modal.msgError("璇峰~鍐欐祴璇曞唴瀹�");
+ return;
}
},
- targetchange(res) {
- console.log(res);
- gettargetInfo({ id: res }).then((res) => {
- console.log(res.rows[0]);
- this.$modal
- .confirm('鏄惁娣诲姞"' + res.rows[0].targetname + '"鎸囨爣鐨勯�夐」锛�')
- .then(() => {
- this.indexform.valueType = res.rows[0].valueType;
- this.indexform.scriptTopic = res.rows[0].targetname;
- this.indexform.targetname = res.rows[0].targetname;
- this.indexform.targetdesc = res.rows[0].targetdesc;
- this.indexform.isAvailable = "0";
- this.indexform.language = "鏅�氳瘽";
- this.indexform.isenable = res.rows[0].isenable;
- this.$forceUpdate();
- res.rows[0].targetoptionList.forEach((item) => {
- item.isoperation = 1;
- this.indexform.ivrLibaScriptTargetoptionList.push(item);
- });
- })
- .catch(() => {
- this.$modal.msgSuccess("宸插彇娑�");
+ // 閫夋嫨鎸囨爣
+ selectlabel(row) {
+ this.$modal
+ .confirm(
+ '鏄惁閫夋嫨鏍囬涓�"' + row.targetname + '"鐨勬寚鏍囧苟鏇挎崲濉厖闂淇℃伅锛�'
+ )
+ .then(() => {
+ console.log(row);
+ this.indexform.valueType = row.valueType;
+ this.indexform.scriptType = row.scriptType;
+ this.indexform.scriptTopic = row.targetname;
+ this.indexform.targetname = row.targetname;
+ this.indexform.targetid = row.id;
+ this.indexform.targetdesc = row.targetdesc;
+ this.indexform.isAvailable = "0";
+ this.indexform.language = "鏅�氳瘽";
+ this.indexform.isenable = row.isenable;
+ const labellist = row.targetoptionList;
+ labellist.forEach((item) => {
+ item.isoperation = 1;
+ this.indexform.ivrLibaScriptTargetoptionList.push(item);
});
+ this.drawer = false;
+ })
+ .catch(() => {});
+ },
+ gettargetInfo() {
+ this.queryParams.suitWay = 2;
+ gettargetInfo(this.queryParams).then((res) => {
+ console.log(res);
+ this.targetList = res.rows;
+ this.total = res.total;
+ this.drawer = true;
});
+ },
+ resetQuery() {
+ this.queryParams = {
+ pageNum: 1,
+ pageSize: 10,
+ };
+ this.gettargetInfo();
},
// 涓嬩竴姝�
@@ -746,17 +926,19 @@
},
// 鏂囦欢----------------------
// 鎺у埗鏂囦欢
- handleChange(file, fileList) {
- this.fileList = fileList.slice(-3);
+ handleChange(response, file, additionalParam) {
+ console.log(response);
+ if (additionalParam == 1) {
+ this.indexform.scriptVoice = response.url;
+ } else if (additionalParam == 2) {
+ this.indexform.nomatchvoice = response.url;
+ } else if (additionalParam == 3) {
+ this.indexform.sliencevoice = response.url;
+ } else if (additionalParam == 4) {
+ this.indexform.noclearlyvoice = response.url;
+ }
},
- // 鏂囦欢瓒呭嚭涓暟闄愬埗鏃剁殑閽╁瓙
- handleExceed(files, fileList) {
- this.$message.warning(
- `褰撳墠闄愬埗閫夋嫨 1 涓枃浠讹紝鏈閫夋嫨浜� ${files.length} 涓枃浠讹紝鍏遍�夋嫨浜� ${
- files.length + fileList.length
- } 涓枃浠禶
- );
- },
+
// 鏍囩-----------------
gettabList() {
const tagqueryParams = {
@@ -1033,7 +1215,7 @@
padding-top: 0;
padding-bottom: 0;
}
-.tsgname {
+.tsgnames {
width: 90px;
margin-right: 10px;
text-align: center;
@@ -1045,8 +1227,23 @@
font-size: 18px;
border-radius: 5px;
}
-.tsgname:hover {
+.tsgnames:hover {
background: #3366f5;
+}
+.tsgname {
+ width: 90px;
+ margin-right: 10px;
+ text-align: center;
+ cursor: pointer;
+ height: 40px;
+ line-height: 40px;
+ background: #66c18c;
+ color: #ffff;
+ font-size: 18px;
+ border-radius: 5px;
+}
+.tsgname:hover {
+ background: #20894d;
}
.tsgnamebj {
width: 90px;
@@ -1063,6 +1260,22 @@
.tsgnamebj:hover {
background: #27c449;
}
+.preview-left {
+ margin: 20px;
+ // margin: 20px;
+ padding: 30px;
+ background: #ffff;
+ border: 1px solid #dcdfe6;
+ -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
+ 0 0 6px 0 rgba(0, 0, 0, 0.04);
+ .scriptTopic-dev {
+ margin-bottom: 25px;
+ font-size: 20px !important;
+ .dev-text {
+ margin-bottom: 10px;
+ }
+ }
+}
::v-deep .addtopic-input {
input {
--
Gitblit v1.9.3