Commit a67cbec6 authored by 赵啸非's avatar 赵啸非

修改样表系统上传

parent c590cb26
......@@ -5,7 +5,7 @@ import request from '@/utils/request'
// 查看基础设置
export const getBaseSetInfo = (data) => {
return request({
url: "/sampleform/setting/info",
url: "/sampleform/hotword/list",
method: "post",
data,
});
......@@ -13,7 +13,7 @@ export const getBaseSetInfo = (data) => {
// 保存基础设置
export const saveBaseSet = (data) => {
return request({
url: "/sampleform/setting/save",
url: "/sampleform/hotword/save",
method: "post",
data,
});
......
......@@ -12,7 +12,7 @@
</div>
<!-- 标签 -->
<div class="mt20">
<template v-for="tag in baseSetInfo.hotWords">
<template v-for="tag in baseSetInfo.hotwords">
<el-tooltip
class="item"
effect="dark"
......@@ -79,13 +79,17 @@
<script>
import { getBaseSetInfo, saveBaseSet } from "@/api/baseSet";
import local from "@/utils/local";
export default {
data() {
return {
siteId: local.getLocal("sampleSiteId")
? local.getLocal("sampleSiteId")
: "",
inputVisible: false,
inputValue: "",
baseSetInfo: {
hotWords: [],
hotwords: [],
printDisplay: "",
},
};
......@@ -96,26 +100,27 @@ export default {
methods: {
// 获取基础设置
async getBaseSetInfo() {
let res = await getBaseSetInfo();
let { data, code } = res.data;
if (code === 1) {
if (data.hotWords) {
data.hotWords = data.hotWords.split(",");
this.baseSetInfo = data;
} else {
this.baseSetInfo.printDisplay = data.printDisplay;
let res = await getBaseSetInfo({
siteId: this.siteId
});
console.log("res:",res)
if (res.data.code === 1) {
console.log("len:",res.data.data.data)
if(res.data.data.data.length>0){
this.baseSetInfo.hotwords=res.data.data.data[0].hotwords.split(",")
this.baseSetInfo.printDisplay = res.data.data.data[0].printDisplay;
}
}
},
handleClose(tag) {
this.baseSetInfo.hotWords.splice(
this.baseSetInfo.hotWords.indexOf(tag),
this.baseSetInfo.hotwords.splice(
this.baseSetInfo.hotwords.indexOf(tag),
1
);
},
showInput() {
if (this.baseSetInfo.hotWords.length >= 10) {
if (this.baseSetInfo.hotwords.length >= 10) {
return;
}
this.inputVisible = true;
......@@ -127,7 +132,7 @@ export default {
handleInputConfirm() {
let inputValue = this.inputValue;
if (inputValue) {
this.baseSetInfo.hotWords.push(inputValue);
this.baseSetInfo.hotwords.push(inputValue);
}
this.inputVisible = false;
this.inputValue = "";
......@@ -136,7 +141,8 @@ export default {
async handleOk() {
let res = await saveBaseSet({
...this.baseSetInfo,
hotWords: this.baseSetInfo.hotWords.join(","),
hotwords: this.baseSetInfo.hotwords.join(","),
siteId:this.siteId
});
let { code, msg } = res.data;
if (code === 1) {
......@@ -147,7 +153,7 @@ export default {
},
// 重置
handleReset() {
this.baseSetInfo.hotWords = [];
this.baseSetInfo.hotwords = [];
this.baseSetInfo.printDisplay = "";
},
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment