From b10795e18a07b9beb72f25406f26f42491828be5 Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期二, 22 十月 2024 09:20:19 +0800 Subject: [PATCH] 测试完成 --- src/views/repositoryai/verbaltrick/particulars/index.vue | 1134 ++++++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 727 insertions(+), 407 deletions(-) diff --git a/src/views/repositoryai/verbaltrick/particulars/index.vue b/src/views/repositoryai/verbaltrick/particulars/index.vue index f1d3662..6008375 100644 --- a/src/views/repositoryai/verbaltrick/particulars/index.vue +++ b/src/views/repositoryai/verbaltrick/particulars/index.vue @@ -2,10 +2,22 @@ <div class="Questionnairemanagement"> <!-- 宸︿晶鏍� --> <div class="sidecolumn"> - <div style="height: 300px"> - <el-steps direction="vertical" :active="Editprogress"> - <el-step title="闂搴撶紪杈�"></el-step> - <el-step title="闂鎸囨爣缂栬緫"></el-step> + <div> + <el-steps finish-status="success" :active="Editprogress" simple> + <el-step> + <template slot="title"> + <span style="cursor: pointer" @click="Editprogress = 1" + >璇濇湳鍩虹淇℃伅缂栬緫</span + > + </template> + </el-step> + <el-step> + <template slot="title"> + <span style="cursor: pointer" @click="nextstep" + >璇濇湳鎸囨爣缂栬緫</span + > + </template> + </el-step> </el-steps> </div> </div> @@ -13,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" @@ -21,6 +40,28 @@ :rules="rules" label-width="100px" > + <el-row :gutter="20"> + <el-col :span="12"> + <el-form-item label="闂涓绘棬" prop="scriptTopic"> + <el-input + v-model="indexform.scriptTopic" + placeholder="璇疯緭鍏ラ棶棰樹富鏃�" + maxlength="80" + /> + </el-form-item> + </el-col> + </el-row> + <el-form-item label="闂鏂囨湰" prop="scriptContent"> + <el-input + :rows="2" + type="textarea" + id="scriptContent" + show-word-limit + placeholder="璇疯緭鍏ュ唴瀹�" + v-model.sync="indexform.scriptContent" + @focus="handleInput('scriptContent')" + /> + </el-form-item> <el-row> <el-col :span="12"> <el-form-item label="璇█" prop="deptId"> @@ -44,7 +85,7 @@ placeholder="璇烽�夋嫨鐘舵��" > <el-option - v-for="item in qyoptions" + v-for="item in usable" :key="item.value" :label="item.label" :value="item.value" @@ -60,15 +101,22 @@ <el-form-item label="闂鍒嗙被" prop="status"> <el-select v-model="indexform.assortid" - placeholder="璇烽�夋嫨鐘舵��" + filterable + placeholder="璇烽�夋嫨鍒嗙被" > - <el-option - v-for="item in questionclass" - :key="item.id" - :label="item.indexAssortName" - :value="item.id" + <el-option-group + v-for="group in questionclass" + :key="group.id" + :label="group.indexAssortName" > - </el-option> + <el-option + v-for="item in group.ivrLibaScriptAssortList" + :key="item.id" + :label="item.indexAssortName" + :value="item.id" + > + </el-option> + </el-option-group> </el-select> </el-form-item> </el-col> @@ -83,17 +131,7 @@ </el-form-item> </el-col> </el-row> - <el-row :gutter="20"> - <el-col :span="20"> - <el-form-item label="闂涓绘棬" prop="questiontitle"> - <el-input - v-model="indexform.questiontitle" - placeholder="璇疯緭鍏ラ棶棰樹富鏃�" - maxlength="80" - /> - </el-form-item> - </el-col> - </el-row> + <el-form-item label="鏍囩" prop="desc"> <div class="xinz-inf"> <el-tag @@ -112,6 +150,7 @@ @change="handleInputConfirm" filterable remote + allow-create reserve-keyword default-first-option :remote-method="remoteMethodtag" @@ -135,50 +174,58 @@ > </div> </el-form-item> - <el-form-item label="閫氱煡鍙橀噺" prop="name"> - <el-row v-for="item in variablelist"> - <el-col :span="4"> - <el-input - v-model="item.name" - placeholder="璇疯緭鍏ュ彉閲忓悕" - ></el-input> - </el-col> - <el-col :span="8" :offset="1"> - <el-input - v-model="item.value" - placeholder="璇疯緭鍏ュ彉閲忓唴瀹�" - ></el-input> - </el-col> - <el-col :span="4" :offset="1"> - <el-button - type="success" - icon="el-icon-plus" - circle - @click="addvariable(item)" - ></el-button> - <el-button - v-if="item" - type="danger" - icon="el-icon-delete" - circle - @click="delvariable(item)" - ></el-button> - </el-col> - </el-row> - </el-form-item> - - <el-row> - <el-col :span="12"> + <el-drawer + title="鍙橀噺缂栬緫" + :visible.sync="variabledeawer" + direction="ttb" + size="35%" + > + <el-form-item label="閫氱煡鍙橀噺" prop="name"> + <div style="margin-bottom: 5px" v-for="item in variablelist"> + <el-row> + <el-col :span="5"> + <el-input + v-model="item.variatename" + placeholder="璇疯緭鍏ュ彉閲忓悕" + ></el-input> + </el-col> + <el-col :span="8" :offset="1"> + <el-input + v-model="item.variate" + placeholder="璇疯緭鍏ュ彉閲忓唴瀹�" + ></el-input> + </el-col> + <el-col :span="8" :offset="1"> + <el-button + type="success" + icon="el-icon-plus" + circle + @click="addvariable(item)" + ></el-button> + <el-button + v-if="!item.default" + type="danger" + icon="el-icon-delete" + circle + @click="delvariable(item)" + ></el-button> + </el-col> + </el-row> + </div> + </el-form-item> + </el-drawer> + <!-- <el-row> + <el-col :span="6"> <el-form-item label="浠呴檺闄㈠尯" prop="region"> <el-select - v-model="indexform.courtyard" + v-model="indexform.campus" size="medium" filterable placeholder="璇烽�夋嫨" > <el-option class="indexformaa" - v-for="item in options" + v-for="item in courtyardlist" :key="item.value" :label="item.label" :value="item.value" @@ -187,203 +234,257 @@ </el-select> </el-form-item> </el-col> - <el-col :span="12"> - <el-form-item label="鍏宠仈鎸囨爣" prop="region"> + <el-col :span="6"> + <el-form-item label="閫傜敤鏂瑰紡" prop="status"> <el-select - v-model="indexform.targetid" - filterable - remote - reserve-keyword - placeholder="璇疯緭鍏ュ叧閿瘝" - :remote-method="remoteMethod" - :loading="loading" + disabled + v-model="indexform.suitway" + placeholder="璇烽�夋嫨" > <el-option - v-for="item in targetlist" - :key="item.targetid" - :label="item.targetname" - :value="item.targetid" + v-for="item in mode" + :key="item.value" + :label="item.label" + :value="item.value" > </el-option> </el-select> </el-form-item> </el-col> + </el-row> --> + <el-row> + <el-col :span="24"> + <el-form-item label="闂鍙橀噺" prop="scriptContent"> + <div style="display: flex; margin-bottom: 10px"> + <div + v-for="item in variablelist" + :class="item.default ? 'tsgname' : 'tsgnames'" + @click="tsgnameto(item)" + > + {{ item.variatename }} + </div> + <div class="tsgnamebj" @click="variabledeawer = true"> + 鍙橀噺缂栬緫 + </div> + </div> + </el-form-item> + </el-col></el-row + > + <el-row> + <el-col :span="24"> + <el-form-item label="璇煶鏂囨湰" prop="scriptContent"> + <el-input + :rows="2" + type="textarea" + id="scriptContent" + show-word-limit + placeholder="璇疯緭鍏ュ唴瀹�" + v-model.sync="indexform.ivrtext" + @focus="handleInput('scriptContent')" + /> + </el-form-item> </el-col + ></el-row> + <el-row> + <el-col :span="6"> + <el-form-item label="璇煶鏂囦欢" prop="verbaltrickyy"> + <el-upload + class="upload-demo" + :action="uploadImgUrl" + :headers="headers" + :show-file-list="false" + :on-success=" + (response, file) => handleChange(response, file, 1) + " + accept=".wav,.mp3" + :limit="1" + > + <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button> + </el-upload> + </el-form-item> + </el-col> + <el-col :span="6"> + <span style="font-size: 12px" v-if="indexform.ivrVoice">{{ + indexform.ivrVoice.substring( + indexform.ivrVoice.lastIndexOf("/") + 1 + ) + }}</span> + </el-col> + <el-col :span="6"> + <mini-audio + :audio-source=" + indexform.ivrVoice + ? indexform.ivrVoice + : 'https://example.com/example.mp3' + " + ></mini-audio> + </el-col> + </el-row> + + <el-row> + <el-col :span="24"> + <el-form-item label="鏃犲尮閰嶆枃鏈�" prop="noMatchText"> + <el-input + type="textarea" + :rows="2" + id="noMatchText" + placeholder="璇疯緭鍏ュ唴瀹�" + v-model.sync="indexform.noMatchText" + @focus="handleInput('noMatchText')" + show-word-limit + /> + </el-form-item> </el-col + ></el-row> + <el-row> + <el-col :span="6"> + <el-form-item label="鏃犲尮閰嶈闊�" prop="verbaltrickyy"> + <el-upload + class="upload-demo" + :action="uploadImgUrl" + :show-file-list="false" + :headers="headers" + :on-success=" + (response, file) => handleChange(response, file, 2) + " + accept=".wav,.mp3" + :limit="1" + > + <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button> + </el-upload> + </el-form-item> + </el-col> + <el-col :span="6"> + <span style="font-size: 12px" v-if="indexform.nomatchvoice">{{ + 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"> - <div - style="display: flex; margin-left: 100px; margin-bottom: 10px" - > - <div - v-for="item in variablelist" - class="tsgname" - @click="tsgnameto(item)" - > - {{ item.name }} - </div> - </div> - </el-col></el-row - > - <el-row> - <el-col :span="24"> - <el-form-item label="闂鏂囨湰" prop="questiontext"> + <el-form-item label="闈欓粯鏂囨湰" prop="slienceText"> <el-input type="textarea" :rows="2" + id="slienceText" placeholder="璇疯緭鍏ュ唴瀹�" - id="questiontext" - v-model.sync="indexform.questiontext" - @focus="handleInput('questiontext')" - maxlength="30" + v-model.sync="indexform.slienceText" + @focus="handleInput('slienceText')" + show-word-limit /> </el-form-item> </el-col ></el-row> <el-row> <el-col :span="6"> - <el-form-item label="闂璇煶" prop="verbaltrickyy"> + <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, 3) + " + 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="30" /> --> </el-form-item> - </el-col></el-row - > + </el-col> + <el-col :span="6"> + <span style="font-size: 12px" v-if="indexform.sliencevoice">{{ + 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"> - <el-form-item label="鏃犲尮閰嶆枃鏈�" prop="nomatchtext"> + <el-form-item label="鍚笉娓呮枃鏈�" prop="noClearlyText"> <el-input type="textarea" + id="noClearlyText" :rows="2" - id="nomatchtext" placeholder="璇疯緭鍏ュ唴瀹�" - v-model.sync="indexform.nomatchtext" - @focus="handleInput('nomatchtext')" - maxlength="30" + @focus="handleInput('noClearlyText')" + v-model.sync="indexform.noClearlyText" + show-word-limit /> </el-form-item> </el-col ></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, 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-row> - <el-col :span="24"> - <el-form-item label="鏃犲0鏂囨湰" prop="sliencetext"> - <el-input - type="textarea" - :rows="2" - id="sliencetext" - placeholder="璇疯緭鍏ュ唴瀹�" - v-model.sync="indexform.sliencetext" - @focus="handleInput('sliencetext')" - maxlength="30" - /> - </el-form-item> </el-col - ></el-row> - <el-row> + </el-col> <el-col :span="6"> - <el-form-item label="鏃犲0璇煶" prop="silentyy"> - <el-upload - class="upload-demo" - action="https://jsonplaceholder.typicode.com/posts/" - :on-change="handleChange" - :file-list="fileList" - :limit="1" - :on-exceed="handleExceed" - > - <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button> - </el-upload> - </el-form-item> - </el-col></el-row - > - <el-row> - <el-col :span="24"> - <el-form-item label="閫氱敤搴撴枃鏈�" prop="submoduletext"> - <el-input - type="textarea" - :rows="2" - id="submoduletext" - placeholder="璇疯緭鍏ュ唴瀹�" - v-model.sync="indexform.submoduletext" - @focus="handleInput('submoduletext')" - maxlength="30" - /> - </el-form-item> </el-col - ></el-row> - <el-row> + <span style="font-size: 12px" v-if="indexform.noclearlyvoice">{{ + indexform.noclearlyvoice.substring( + indexform.noclearlyvoice.lastIndexOf("/") + 1 + ) + }}</span> + </el-col> <el-col :span="6"> - <el-form-item label="閫氱敤搴撹闊�" prop="libraryy"> - <el-upload - class="upload-demo" - action="https://jsonplaceholder.typicode.com/posts/" - :on-change="handleChange" - :file-list="fileList" - :limit="1" - :on-exceed="handleExceed" - > - <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button> - </el-upload> - </el-form-item> - </el-col></el-row - > - <el-row> - <el-col :span="24"> - <el-form-item label="鍚笉娓呮枃鏈�" prop="noclearlytext"> - <el-input - type="textarea" - id="noclearlytext" - :rows="2" - placeholder="璇疯緭鍏ュ唴瀹�" - @focus="handleInput('noclearlytext')" - v-model.sync="indexform.noclearlytext" - maxlength="30" - /> - </el-form-item> </el-col - ></el-row> - <el-row> - <el-col :span="6"> - <el-form-item label="鍚笉娓呰闊�" prop="vagueyy"> - <el-upload - class="upload-demo" - action="https://jsonplaceholder.typicode.com/posts/" - :on-change="handleChange" - :file-list="fileList" - :limit="1" - :on-exceed="handleExceed" - > - <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button> - </el-upload> - </el-form-item> - </el-col></el-row - > + <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> + <el-button type="primary" @click="nextstep">涓嬩竴姝�</el-button> <el-button @click="closeFm">鍏� 闂�</el-button> + <el-button @click="Saveproblem()">淇濆瓨鏁版嵁</el-button> </div> </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" @@ -392,12 +493,21 @@ label-width="100px" > <el-row> - <el-col :span="12"> + <el-col :span="8"> <el-form-item label="鎸囨爣鍚嶇О" prop="deptId"> <el-input v-model="indexform.targetname" placeholder="璇疯緭鍏ユ寚鏍囧悕绉�" - maxlength="40" + maxlength="20" + /> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鎸囨爣鎻忚堪" prop="deptId"> + <el-input + v-model="indexform.targetdesc" + placeholder="璇疯緭鍏ユ寚鏍囨弿杩�" + maxlength="60" /> </el-form-item> </el-col> @@ -406,129 +516,182 @@ <el-row> <el-col :span="24"> <el-form-item label="鍊肩被鍨�"> - <el-radio-group v-model="indexform.isenable"> + <el-radio-group + :disabled="indexform.targetid" + v-model="indexform.valueType" + > <el-radio :label="1">閫夐」</el-radio> <el-radio :label="2">鏂囨湰</el-radio> <el-radio :label="3">鏁板��</el-radio> </el-radio-group> </el-form-item> + + <el-form-item label="棰樼洰绫诲瀷"> + <el-radio-group + @input="typeselection" + :disabled="indexform.targetid" + v-model="indexform.scriptType" + > + <el-radio :label="1">鍗曢��</el-radio> + <!-- <el-radio :label="2">澶氶��</el-radio> --> + <el-radio :label="4">闂瓟</el-radio> + </el-radio-group> + </el-form-item> </el-col></el-row > - - <el-card class="box-card" style="margin-bottom: 20px"> - <el-table - v-loading="loading" - :data="indexform.ivrLibaScriptTargetoptionList" - > - <el-table-column - label="搴忓彿" - align="center" - key="guid" - prop="guid" - width="50" + <div v-if="indexform.scriptType == 1 || indexform.scriptType == 2"> + <el-card class="box-card" style="margin-bottom: 20px"> + <Regular + :TargetoptionList="indexform.ivrLibaScriptTargetoptionList" + @addoption="addoption" + @deloption="deloption" + @syioption="syioption" + @xiayioption="xiayioption" + :intent="false" + :Verbalproblem="false" /> - <el-table-column - label="鎸囨爣閫夐」" - align="center" - key="targetvalue" - prop="targetvalue" - :show-overflow-tooltip="true" - > - <template slot-scope="scope"> + </el-card> + <el-row :gutter="20"> + <el-col :span="12"> + <el-form-item label="娴嬭瘯杈撳叆" prop="targetvalue"> <el-input - v-model="scope.row.targetvalue" - placeholder="璇疯緭鍏ュ唴瀹�" - ></el-input> - </template> - </el-table-column> - <el-table-column - label="瑙f瀽瑙勫垯" - align="center" - key="targetregex" - prop="targetregex" - width="460" - :show-overflow-tooltip="true" + v-model="indexform.content" + placeholder="璇疯緭鍏ユ祴璇曞唴瀹�" + maxlength="40" + /> + </el-form-item> + </el-col> + <el-col :span="4"> + <el-button type="success" @click="testtagerlist" + >寮�濮嬫祴璇�</el-button + > + </el-col> + </el-row> + <div style="margin-bottom: 20px"> + <el-input + type="textarea" + :rows="4" + placeholder="姝ゅ灞曠ず璇嗗埆缁撴灉" + v-model="testgovalue" > - <template slot-scope="scope"> - <el-input - v-model="scope.row.targetregex" - placeholder="璇疯緭鍏ュ唴瀹�" - ></el-input> - </template> - </el-table-column> - - <el-table-column - label="鎿嶄綔" - align="center" - width="200" - class-name="small-padding fixed-width" - > - <template slot-scope="scope"> - <el-button - @click="addoption(scope.row)" - type="success" - icon="el-icon-circle-plus-outline" - circle - ></el-button> - <el-button - type="danger" - icon="el-icon-delete" - circle - @click="deloption(scope.row)" - ></el-button> - <el-button - @click="syioption(scope.row)" - type="primary" - icon="el-icon-top" - circle - ></el-button> - <el-button - @click="xiayioption(scope.row)" - type="primary" - icon="el-icon-bottom" - circle - ></el-button> - </template> - </el-table-column> - </el-table> - </el-card> - <el-row :gutter="20"> - <el-col :span="12"> - <el-form-item label="娴嬭瘯杈撳叆" prop="targetvalue"> - <el-input - v-model="testvalue" - placeholder="璇疯緭鍏ユ祴璇曞唴瀹�" - maxlength="40" - /> - </el-form-item> - </el-col> - <el-col :span="4"> - <el-button type="success">寮�濮嬫祴璇�</el-button> - </el-col> - </el-row> + </el-input> + </div> + </div> + <div style="margin-bottom: 20px" v-else> + <el-input + type="textarea" + :rows="4" + placeholder="姝ゅ灞曠ず鏀堕泦淇℃伅" + v-model="testgovalue" + > + </el-input> + </div> </el-form> - <div style="margin-bottom: 10px"> - <el-input - type="textarea" - :rows="4" - placeholder="姝ゅ灞曠ず璇嗗埆缁撴灉" - v-model="testgovalue" - > - </el-input> - </div> + <el-button type="primary" @click="laststep()">涓婁竴姝�</el-button> <el-button type="info" @click="closeFm()">鍏抽棴</el-button> - <el-button @click="Saveproblem()">淇濆瓨鎸囨爣鏁版嵁</el-button> + <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> <script> import { listtag } from "@/api/system/label"; import { - getverbaltricklist, - verbaltrickinfo, + gettagerlist, + testtagerlist, delverbaltrickinfo, compileverbaltrick, getverbaltrick, @@ -536,36 +699,44 @@ gettargetInfolist, gettargetInfo, } 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", //鍗曢�夐閫変腑 radios: [], //澶氶�夐閫変腑 radioas: "", //濉┖棰樼瓟妗� dynamicTags: [], + dellist: [], + targetList: [], inputVisible: false, + drawer: false, inputValue: "", testvalue: "", testgovalue: "", topicobj: {}, - indexform: {}, + indexform: { + ivrLibaScriptTargetoptionList: [], + ivrLibaScriptTagList: [], + suitway: "2", + }, mode: [], questionclass: [], currentInputId: "", - + courtyardlist: [], // 鎬绘潯鏁� total: 1, - - targetlist: [ - { - value: "閫夐」1", - label: "鍥炬枃", - }, - ], rules: {}, rulesa: {}, optionstag: [], @@ -576,24 +747,23 @@ url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100", }, ], - qyoptions: [], + usable: [], options: [], variablelist: [ - + { variatename: "濮撳悕", variate: "${name}", default: 1 }, + { variatename: "鐢佃瘽", variate: "${phone}", default: 1 }, + { variatename: "鐥呮儏", variate: "${illness}", default: 1 }, ], addvalue: "娣诲姞棰樼洰", languagelist: [], //璇█鍒楄〃 + qyoptions: [], // 鏌ヨ鍙傛暟 queryParams: { pageNum: 1, pageSize: 10, - userName: undefined, - phonenumber: undefined, - status: undefined, - deptId: undefined, - IDnumber: undefined, }, + variabledeawer: false, }; }, @@ -603,28 +773,31 @@ this.mode = store.getters.mode; this.valuetype = store.getters.valuetype; this.languagelist = store.getters.languagelist; - this.qyoptions = store.getters.usable; + this.usable = store.getters.usable; + this.courtyardlist = store.getters.courtyardlist; + this.qyoptions = store.getters.askvaluetype; }, methods: { // 鑾峰彇璇︽儏鏁版嵁 getverbaltrick() { let id = this.$route.query.id; - getverbaltrick({ id: id }).then((res) => { - this.indexform = res.data; - this.indexform.assortid = parseInt(this.indexform.assortid); - this.variablelist = JSON.parse(this.indexform.parameter)?JSON.parse(this.indexform.parameter):[{name:'',value:''}]; - this.dynamicTags = this.indexform.ivrLibaScriptTagList.map( - this.processElement - ); - this.targetlist = [ - { - targetid: this.indexform.targetid, - targetname: this.indexform.targetname, - }, - ]; - console.log(this.targetlist); - }); + this.indexform.language = "鏅�氳瘽"; + this.indexform.isAvailable = "1"; + + if (id) { + getverbaltrick({ id: id }).then((res) => { + this.indexform = res.data; + + this.indexform.assortid = parseInt(this.indexform.assortid); + this.variablelist = JSON.parse(this.indexform.otherdata).length + ? JSON.parse(this.indexform.otherdata) + : this.variablelist; + this.dynamicTags = this.indexform.ivrLibaScriptTagList.map( + this.processElement + ); + }); + } // 鏍� getbaltrickclassify({}).then((res) => { this.questionclass = res.rows; @@ -634,54 +807,140 @@ // 淇濆瓨璇︾粏淇℃伅 Saveproblem() { + this.indexform.otherdata = JSON.stringify(this.variablelist); + if (this.indexform.id) { + this.indexform.ivrLibaScriptTargetoptionList = + this.indexform.ivrLibaScriptTargetoptionList.map((res) => { + if (res.isoperation != 1) { + res.isoperation = 2; + } + return res; + }); + this.indexform.isoperation = 2; - this.indexform.parameter = JSON.stringify(this.variablelist); + 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("淇敼鎴愬姛"); + this.$router.go(-1); + } else { + this.$message({ + message: "淇敼澶辫触", + type: "error", + }); } }); } else { this.indexform.isoperation = 1; + compileverbaltrick(this.indexform).then((res) => { if (res.code == 200) { this.$modal.msgSuccess("鏂板鎴愬姛"); + this.$router.go(-1); + } else { + this.$message({ + message: "鏂板澶辫触", + type: "error", + }); } }); } }, - 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; } }, - - // 涓嬩竴姝� - nextstep() { - if (this.Editprogress <= 1 && this.indexform.targetid) { - if (this.indexform.ivrLibaScriptTargetoptionList.length) { - return this.Editprogress++; - } - gettargetInfo({ targetID: this.indexform.targetid }).then((res) => { - this.indexform.isenable = res.rows[0].isenable; - this.indexform.targetname = res.rows[0].targetname; - res.rows[0].targetoptionList.forEach((item) => { + // 閫夋嫨鎸囨爣 + 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(); + }, + + // 棰樼洰绫诲瀷鏇存崲 + typeselection(row) { + if ( + (row == 1 || row == 2) && + !this.indexform.ivrLibaScriptTargetoptionList.length + ) { + this.indexform.ivrLibaScriptTargetoptionList.push({ + guid: 1, + isoperation: 1, + targetvalue: "", + targetregex: "", + targetregex2: "", + dynamiccruxs: [], + nodynamiccruxs: [], + dynamiccruxsJson: "", + nodynamiccruxsJson: "", }); + } + }, + // 涓嬩竴姝� + nextstep() { + if (this.Editprogress <= 1) { + // if (this.indexform.targetid) { return this.Editprogress++; + // } else { + // this.$message.warning("璇峰厛閫夋嫨鍏宠仈鎸囨爣"); + // } } else { - this.$message.warning("璇峰厛閫夋嫨鍏宠仈鎸囨爣"); } }, // 涓婁竴姝� @@ -707,17 +966,20 @@ }, // 鏂囦欢---------------------- // 鎺у埗鏂囦欢 - handleChange(file, fileList) { - this.fileList = fileList.slice(-3); + handleChange(response, file, additionalParam) { + console.log(response); + if (additionalParam == 1) { + this.indexform.ivrVoice = response.url; + } else if (additionalParam == 2) { + this.indexform.nomatchvoice = response.url; + console.log(this.indexform.nomatchvoice); + } 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 = { @@ -779,7 +1041,6 @@ showInput() { this.inputVisible = true; }, - // -------------------------- //娴嬭瘯琛ㄥ崟 -------------------------- gettagerlist() { gettagerlist({ targetname: this.targetname }).then((response) => { @@ -793,12 +1054,23 @@ isoperation: 1, targetvalue: "", targetregex: "", + targetregex2: "", + dynamiccruxs: [], + nodynamiccruxs: [], + dynamiccruxsJson: "", + nodynamiccruxsJson: "", }); this.sortFn(); }, - deloption() { + deloption(item) { const index = this.indexform.ivrLibaScriptTargetoptionList.indexOf(item); if (index !== -1) { + if (item.id) { + console.log(item, "chunz"); + item.isoperation = 3; + this.dellist.push(item); + } + console.log(this.dellist, "dellist"); this.indexform.ivrLibaScriptTargetoptionList.splice(index, 1); // 浠庣储寮曚綅缃垹闄や竴涓厓绱� this.sortFn(); } else { @@ -841,7 +1113,17 @@ return { guid: index + 1, targetvalue: item.targetvalue, + targetregex2: item.targetregex2, targetregex: item.targetregex, + id: item.id, + targettype: this.indexform.targettype, + isoperation: item.id ? 2 : 1, + categoryName: item.categoryName, + language: item.language, + dynamiccruxs: item.dynamiccruxs, + nodynamiccruxs: item.nodynamiccruxs, + dynamiccruxsJson: item.dynamiccruxsJson, + nodynamiccruxsJson: item.nodynamiccruxsJson, }; }); console.log(this.indexform.ivrLibaScriptTargetoptionList); @@ -852,14 +1134,14 @@ let inputValueArr = ""; let el = document.querySelector("#" + this.currentInputId); //el.selectionStart; 杩欏氨鏄綋鍓嶅厜鏍囨墍鍦ㄧ殑浣嶇疆锛堝瓧绗︿覆涓瓧绗︾殑index锛� - if (this.currentInputId == "questiontext") { - inputValueArr = this.indexform.questiontext.split(""); - } else if (this.currentInputId == "nomatchtext") { - inputValueArr = this.indexform.nomatchtext.split(""); - } else if (this.currentInputId == "sliencetext") { - inputValueArr = this.indexform.sliencetext.split(""); - } else if (this.currentInputId == "noclearlytext") { - inputValueArr = this.indexform.noclearlytext.split(""); + if (this.currentInputId == "scriptContent") { + inputValueArr = this.indexform.scriptContent.split(""); + } else if (this.currentInputId == "noMatchText") { + inputValueArr = this.indexform.noMatchText.split(""); + } else if (this.currentInputId == "slienceText") { + inputValueArr = this.indexform.slienceText.split(""); + } else if (this.currentInputId == "noClearlyText") { + inputValueArr = this.indexform.noClearlyText.split(""); } else if (this.currentInputId == "submoduletext") { inputValueArr = this.indexform.submoduletext.split(""); } else { @@ -870,18 +1152,18 @@ // 鎷垮埌閫変腑鏂囧瓧鐨勯暱搴︼紙鍚庣画鍙互鐢ㄦ潵鏇挎崲閫変腑鐨勬枃瀛楋級 let selectLength = el.selectionEnd - el.selectionStart; // 灏嗚鎻掑叆/鏇挎崲鐨勬枃瀛楁彃鍏�/鏇挎崲锛坴alue.name鏄鎻掑叆/鏇挎崲鐨勫瓧绗︿覆锛� - inputValueArr.splice(el.selectionStart, selectLength, `${row.value}`); + inputValueArr.splice(el.selectionStart, selectLength, `${row.variate}`); // 鎶婃暟缁勯噸鏂拌浆鎹负瀛楃涓插苟璧嬪�� inputValueArr = inputValueArr.join(""); console.log(inputValueArr); - if (this.currentInputId == "questiontext") { - this.indexform.questiontext = inputValueArr; - } else if (this.currentInputId == "nomatchtext") { - this.indexform.nomatchtext = inputValueArr; - } else if (this.currentInputId == "sliencetext") { - this.indexform.sliencetext = inputValueArr; - } else if (this.currentInputId == "noclearlytext") { - this.indexform.noclearlytext = inputValueArr; + if (this.currentInputId == "scriptContent") { + this.indexform.scriptContent = inputValueArr; + } else if (this.currentInputId == "noMatchText") { + this.indexform.noMatchText = inputValueArr; + } else if (this.currentInputId == "slienceText") { + this.indexform.slienceText = inputValueArr; + } else if (this.currentInputId == "noClearlyText") { + this.indexform.noClearlyText = inputValueArr; } else if (this.currentInputId == "submoduletext") { this.indexform.submoduletext = inputValueArr; } else { @@ -892,8 +1174,8 @@ // 鏂板鍙橀噺 addvariable() { this.variablelist.push({ - variable: "", - value: "", + variatename: "", + variate: "", }); }, // 鍒犻櫎鍙橀噺 @@ -917,28 +1199,20 @@ <style lang="scss" scoped> .Questionnairemanagement { - display: flex; + // display: flex; } .sidecolumn { - width: 300px; - min-height: 100vh; - text-align: center; - // display: flex; - // margin-top: 20px; margin: 20px; margin-bottom: 0; - padding: 30px; + padding: 15px; background: #edf1f7; 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); } .leftvlue { - // display: flex; - // flex: 1; - width: 80%; - margin-top: 20px; - // margin: 20px; + margin: 20px; + margin-top: 10px; padding: 30px; background: #ffff; border: 1px solid #dcdfe6; @@ -983,7 +1257,7 @@ padding-top: 0; padding-bottom: 0; } -.tsgname { +.tsgnames { width: 90px; margin-right: 10px; text-align: center; @@ -995,9 +1269,55 @@ 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; + margin-left: 15px; + text-align: center; + cursor: pointer; + height: 40px; + line-height: 40px; + background: #49dbb7; + color: #ffff; + font-size: 18px; + border-radius: 5px; +} +.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