|
@@ -9,12 +9,12 @@
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
@click="changAddshow"
|
|
|
- >添加外框</el-button
|
|
|
+ >新增外框</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
@click="handleDowmFile(active)"
|
|
|
- >下载导入模板</el-button
|
|
|
+ >下載匯入模板</el-button
|
|
|
>
|
|
|
<el-upload class="upload-demo1" style="margin-left:10px;display: inline-block;"
|
|
|
action="/back/upload/file"
|
|
@@ -27,7 +27,7 @@
|
|
|
multiple
|
|
|
:limit="3"
|
|
|
:on-exceed="handleExceed">
|
|
|
- <el-button type="primary">导入品牌</el-button>
|
|
|
+ <el-button type="primary">導入品牌</el-button>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -39,9 +39,9 @@
|
|
|
@row-click="dataList.selectRow"
|
|
|
>
|
|
|
<el-table-column label="外框ID" width="100" prop="id"></el-table-column>
|
|
|
- <el-table-column label="外框名称" prop="outlineName"></el-table-column>
|
|
|
+ <el-table-column label="外框名稱" prop="outlineName"></el-table-column>
|
|
|
<el-table-column
|
|
|
- label="外框图片"
|
|
|
+ label="外框圖片"
|
|
|
prop="outlineImage"
|
|
|
v-slot:default="{ row }"
|
|
|
>
|
|
@@ -72,35 +72,37 @@
|
|
|
<div class="setFile">
|
|
|
<p>{{ titleObj[active] }}</p>
|
|
|
<div class="down">
|
|
|
- <p>1、下载模板,请按示例填写。</p>
|
|
|
- <el-button type="primary" @click="exporFileinfo.show = true" :icon="false" bg>下载导入模板</el-button>
|
|
|
- <p>注:导入模板中包含此场景全部热点信息</p>
|
|
|
+ <p>1、下載模板,請依範例填寫。</p>
|
|
|
+ <el-button type="primary" @click="exporFileinfo.show = true" :icon="false" bg>下載導入模板</el-button>
|
|
|
+ <p>注意:導入模板中包含此場景全部熱點信息</p>
|
|
|
</div>
|
|
|
<div class="upload">
|
|
|
- <p>2、上传并导入。</p>
|
|
|
+ <p>2、上傳並導入。</p>
|
|
|
<el-upload class="upload-demo"
|
|
|
v-model:file-list="exporFileinfo.fileList"
|
|
|
action="/back/upload/file"
|
|
|
@success="handFileSuccess1"
|
|
|
+ @exceed="handleExceed"
|
|
|
+ @remove="handleRemove"
|
|
|
:headers="{Token:user.token}"
|
|
|
multiple
|
|
|
:limit="1">
|
|
|
- <el-button type="primary">选择文件</el-button>
|
|
|
+ <el-button type="primary" @click="exporFileinfo.fileList = [];exporFileinfo.tips = '';exporFileinfo.filePath = ''">選擇文件</el-button>
|
|
|
<template v-slot:tip>
|
|
|
- <div class="el-upload__tip">{{exporFileinfo.tips || '选择文件上传,系统自动校验数据是否合规,并给出提示。'}}</div>
|
|
|
+ <div style="cloor:red;">{{exporFileinfo.tips || '選擇檔案上傳,系統自動校驗資料是否合規,並給予提示。'}}</div>
|
|
|
</template>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
<div class="down upload" v-if="exporFileinfo.filePath">
|
|
|
- <p>3、上传并导入。</p>
|
|
|
- <el-button type="primary" @click="handleUpload">上传并导入</el-button>
|
|
|
+ <p>3、上傳並導入。</p>
|
|
|
+ <el-button type="primary" @click="handleUpload">上傳並導入</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<com-dialog
|
|
|
- :title="'下载导入模板'"
|
|
|
+ :title="'下載匯入模板'"
|
|
|
width="40vw"
|
|
|
v-model:show="exporFileinfo.show"
|
|
|
@submit="submit"
|
|
@@ -157,15 +159,16 @@
|
|
|
@quit="showAddborder = false"
|
|
|
>
|
|
|
<el-form label-width="90px" :inline="true">
|
|
|
- <el-form-item label="名称:">
|
|
|
- <el-input v-model="setBorderData.outlineName" placeholder="請輸入"></el-input>
|
|
|
+ <el-form-item label="名稱:">
|
|
|
+ <el-input maxlength="30" show-word-limit v-model="setBorderData.outlineName" placeholder="請輸入"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="图片:" class="mandatory">
|
|
|
+ <el-form-item label="圖片:" class="mandatory">
|
|
|
<com-upload
|
|
|
@changeLogo="changeLogo"
|
|
|
@close="setBorderData.outlineImage = ''"
|
|
|
@update:modelValue="(val) => (setBorderData.outlineImage = val)"
|
|
|
:logo="setBorderData.outlineImage"
|
|
|
+ accept="image/png,"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -231,14 +234,17 @@ export default {
|
|
|
const headList = ref([
|
|
|
{ name: "外框设置", value: 0 },
|
|
|
// { name: "热点导出", value: 1 },
|
|
|
- { name: "瀑布流导入", value: 1 },
|
|
|
- { name: "精选推荐设置", value: 2 },
|
|
|
- { name: "品牌推荐设置", value: 3 },
|
|
|
+ { name: "瀑布流導入", value: 1 },
|
|
|
+ { name: "精選推薦設置", value: 2 },
|
|
|
+ { name: "品牌推薦設置", value: 3 },
|
|
|
+ { name: "陳列品設置", value: 4 },
|
|
|
+
|
|
|
]);
|
|
|
const titleObj = reactive({
|
|
|
- 1:'瀑布流商品导入',
|
|
|
- 2:'精选推荐设置',
|
|
|
- 3:'品牌推荐设置',
|
|
|
+ 1:'瀑布流導入',
|
|
|
+ 2:'精選推薦設置',
|
|
|
+ 3:'品牌推薦設置',
|
|
|
+ 4:'陳列品設置',
|
|
|
})
|
|
|
const setBorderData = ref({
|
|
|
outlineName:'',
|
|
@@ -399,6 +405,13 @@ export default {
|
|
|
this.handleDowmFile(this.active)
|
|
|
},
|
|
|
async setBorder(){
|
|
|
+ var char=/^[\u4e00-\u9fa5_a-zA-Z0-9]+$/;
|
|
|
+ if (this.setBorderData.outlineName && !char.test(this.setBorderData.outlineName)) {
|
|
|
+ return this.$alert('名稱僅支援中文,字母或數字!', '提示')
|
|
|
+ }
|
|
|
+ if (!this.setBorderData.outlineImage) {
|
|
|
+ return this.$alert('添加外框圖片不能為空!', '提示')
|
|
|
+ }
|
|
|
this.loading = this.$loading({
|
|
|
lock: true,
|
|
|
text: "加載中",
|
|
@@ -421,6 +434,8 @@ export default {
|
|
|
type: 'success',
|
|
|
message: '更新成功'
|
|
|
});
|
|
|
+ this.setBorderData.outlineImage = ''
|
|
|
+ this.setBorderData.outlineName = ''
|
|
|
this.showAddborder = false
|
|
|
},
|
|
|
async setView() {
|
|
@@ -464,12 +479,13 @@ export default {
|
|
|
// },
|
|
|
handleDowmFile(type = 0){
|
|
|
let filename = {
|
|
|
- 0:'外框设置模板',
|
|
|
+ 0:'外框設定模板',
|
|
|
1:'瀑布流模板',
|
|
|
- 2:'精选推荐设置模板',
|
|
|
- 3:'品牌推荐设置模板',
|
|
|
+ 2:'精選推薦設定模板',
|
|
|
+ 3:'品牌推薦設定模板',
|
|
|
+ 4:'陳列品模板',
|
|
|
}
|
|
|
- this.$alert(`是否确认${filename[type]}下载?`, "下载导入模板",{
|
|
|
+ this.$alert(`是否确认${filename[type]}下載?`, "下載匯入模板",{
|
|
|
cancelButtonText:'取消',
|
|
|
showCancelButton: true
|
|
|
}).then(async ()=>{
|
|
@@ -506,7 +522,7 @@ export default {
|
|
|
list.length = 6
|
|
|
text = list.toString() + '....'
|
|
|
}
|
|
|
- return this.$alert(`第${text}行数异常`);
|
|
|
+ return this.$alert(`第${text}行數異常`);
|
|
|
}else{//自动提交
|
|
|
await axios.post(uploadExcel, apiData)
|
|
|
this.$alert('更新成功')
|
|
@@ -525,9 +541,11 @@ export default {
|
|
|
list.length = 6
|
|
|
text = list.toString() + '....'
|
|
|
}
|
|
|
- this.exporFileinfo.tips = `第${text}行数异常`
|
|
|
+ this.exporFileinfo.tips = `第${text}行數異常`
|
|
|
+ this.exporFileinfo.fileList = []
|
|
|
return this.$alert(this.exporFileinfo.tips);
|
|
|
}else{//自动提交
|
|
|
+ this.exporFileinfo.tips = ''
|
|
|
this.exporFileinfo.filePath = file.data
|
|
|
//this.handleUpload()
|
|
|
}
|
|
@@ -536,12 +554,21 @@ export default {
|
|
|
this.exporFileinfo.filePath = ''
|
|
|
});
|
|
|
},
|
|
|
+ handleExceed(files){
|
|
|
+ console.log('files',files);
|
|
|
+ },
|
|
|
+ handleRemove(){
|
|
|
+ this.exporFileinfo.fileList = []
|
|
|
+ this.exporFileinfo.filePath = ''
|
|
|
+ },
|
|
|
async handleUpload(){
|
|
|
let apiData = {
|
|
|
filePath:this.exporFileinfo.filePath,
|
|
|
type:this.active
|
|
|
}
|
|
|
await axios.post(uploadExcel, apiData)
|
|
|
+ this.exporFileinfo.fileList = []
|
|
|
+ this.exporFileinfo.filePath = ''
|
|
|
this.$alert('更新成功')
|
|
|
|
|
|
}
|
|
@@ -558,6 +585,7 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+
|
|
|
.table-ctrl-right {
|
|
|
.search-scene {
|
|
|
margin: 0 20px 0 26px;
|