| | |
| | | <el-form-item label="标签" prop="desc"> |
| | | <div class="xinz-inf"> |
| | | <el-tag |
| | | :key="tag" |
| | | :key="tag.tagname" |
| | | type="success" |
| | | v-for="tag in dynamicTags" |
| | | closable |
| | | :disable-transitions="false" |
| | | @close="handleClosetag(tag)" |
| | | > |
| | | {{ tag }} |
| | | {{ tag.tagname }} |
| | | </el-tag> |
| | | <el-select |
| | | v-model="inputValue" |
| | |
| | | ></span |
| | | > |
| | | <span style="margin-left: 30px" |
| | | >选中指标:{{ topicobj.scriptTopic }}</span |
| | | >选中指标:<el-tag type="success" effect="dark">{{ |
| | | topicobj.targetname ? topicobj.targetname : "未选择" |
| | | }}</el-tag></span |
| | | > |
| | | <span style="margin-left: 30px" |
| | | ><el-button type="success" round @click="gettargetInfo" |
| | |
| | | return { |
| | | topicobj: { |
| | | svyLibScriptOptions: [], |
| | | svyLibScriptTagList: [], |
| | | }, |
| | | headers: { |
| | | Authorization: "Bearer " + getToken(), |
| | |
| | | getIndexInArray(arr, obj) { |
| | | return arr.indexOf(obj); |
| | | }, |
| | | processElement(element) { |
| | | return { ...element, isoperation: 1 }; |
| | | }, |
| | | // 递归扁平化 |
| | | flattenArray(arr) { |
| | | let result = []; |
| | |
| | | } |
| | | getissuelist({ id: this.id }).then((res) => { |
| | | this.topicobj = res.rows[0]; |
| | | this.dynamicTags = this.topicobj.tag.split(","); |
| | | this.dynamicTags = this.topicobj.svyLibScriptTagList.map( |
| | | this.processElement |
| | | ); |
| | | this.suitwaylist = this.topicobj.suitway.split(","); |
| | | this.variablelist = JSON.parse(this.topicobj.otherdata) |
| | | ? JSON.parse(this.topicobj.otherdata) |
| | |
| | | return item; |
| | | } |
| | | ); |
| | | this.topicobj.targetoptions = this.topicobj.svyLibScriptOptions |
| | | .map((item) => item.optioncontent) |
| | | .join(", "); |
| | | this.topicobj.otherdata = JSON.stringify(this.variablelist); |
| | | this.topicobj.tag = this.dynamicTags.join(","); |
| | | this.topicobj.suitway = this.suitwaylist.join(","); |
| | | if (this.id) { |
| | | this.topicobj.isoperation = 2; |
| | |
| | | }, |
| | | Saveproblem() { |
| | | if (this.topicobj.scoretype == 1) { |
| | | console.log(321); |
| | | this.Scorejudgment(); |
| | | } else { |
| | | this.compileissue(); |
| | | } |
| | | }, |
| | | // 删除标签 |
| | | handleClose(tag) { |
| | | this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1); |
| | | }, |
| | | |
| | | // 删除选项 |
| | | deletexuanx(row) { |
| | | const index = this.getIndexInArray( |
| | |
| | | ) |
| | | .then(() => { |
| | | console.log(row); |
| | | console.log(this.topicobj); |
| | | this.topicobj.scriptTopic = row.targetname; |
| | | this.topicobj.valueType = row.valueType; |
| | | this.topicobj.scriptContent = row.targetdesc; |
| | | this.topicobj.targetid = row.id; |
| | | this.topicobj.targetname = row.targetname; |
| | | this.topicobj.isavailable = "0"; |
| | | this.topicobj.language = "普通话"; |
| | | this.topicobj.svyLibScriptOptions = []; |
| | |
| | | tagcategoryid: "0", |
| | | }; |
| | | listtag(tagqueryParams).then((response) => { |
| | | console.log(response); |
| | | console.log(response, "待选标签"); |
| | | this.optionstag = response.rows; |
| | | }); |
| | | }, |
| | | handleClosetag(tag) { |
| | | console.log(tag); |
| | | console.log(this.dynamicTags.indexOf(tag)); |
| | | const lindex = this.dynamicTags.indexOf(tag); |
| | | this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1); |
| | | this.topicobj.svyLibScriptTagList[lindex].delFlag = 1; |
| | | }, |
| | | handleInputConfirm() { |
| | | let tagvalue = {}; |
| | |
| | | }; |
| | | } |
| | | // this.dynamicTags.push(tagvalue); |
| | | this.dynamicTags.push(tagvalue.tagname); |
| | | this.topicobj.svyLibScriptTagList.push(tagvalue); |
| | | this.dynamicTags.push(tagvalue); |
| | | }); |
| | | } |
| | | this.inputVisible = false; |
| | |
| | | handleChange(item, response, file, fileList) { |
| | | console.log(response); |
| | | if (response.code == 200) { |
| | | console.log(item); |
| | | let index = this.topicobj.svyLibScriptOptions.findIndex( |
| | | (obj) => obj.id == item.id && obj.name == item.name |
| | | (obj) => obj.optioncontent == item.optioncontent |
| | | ); |
| | | console.log(index); |
| | | this.topicobj.svyLibScriptOptions[index].picturePath = response.url; |
| | | console.log(this.topicobj.svyLibScriptOptions[index]); |
| | | this.$forceUpdate(); |
| | | } else { |
| | | this.$message.error("图片插入失败"); |
| | | } |