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

修改样表系统上传

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