Commit e3bb6ab4 by hank

bug fix

parent 35736952
......@@ -44,7 +44,7 @@ export function templateUpdate(templateId, data) {
*/
export function templateDel(templateId) {
return request({
url: '/template/del',
url: `/template/del/${templateId}`,
method: 'get',
params: {
templateId
......
<template>
<div class="app-container">
<div class="filter-container">
<!-- <el-select v-model="listQuery.sort" style="width: 140px" class="filter-item" @change="handleFilter">
<el-option v-for="item in sortOptions" :key="item.key" :label="item.label" :value="item.key" />
</el-select> -->
</el-select>-->
</div>
<div>
<el-form
......@@ -16,10 +14,7 @@
label-width="100px"
style="width: 400px; margin-left:50px;"
>
<el-form-item
label="模板类型"
prop="typeId"
>
<el-form-item label="模板类型" prop="typeId">
<el-select
v-model="temp.typeId"
placeholder="选择模板类型"
......@@ -36,11 +31,7 @@
/>
</el-select>
</el-form-item>
<el-form-item
v-if="temp.typeId"
label="模板标签"
prop="tagIds"
>
<el-form-item v-if="temp.typeId" label="模板标签" prop="tagIds">
<el-select
v-model="temp.tagIds"
placeholder="选择模板标签"
......@@ -58,19 +49,10 @@
/>
</el-select>
</el-form-item>
<el-form-item
label="模板名称"
prop="templateName"
>
<el-input
v-model="temp.templateName"
placeholder="请输入模板名称"
/>
<el-form-item label="模板名称" prop="templateName">
<el-input v-model="temp.templateName" placeholder="请输入模板名称" />
</el-form-item>
<el-form-item
label="模板详情"
prop="templateDescribe"
>
<el-form-item label="模板详情" prop="templateDescribe">
<el-input
v-model="temp.templateDescribe"
:autosize="{ minRows: 2, maxRows: 4}"
......@@ -78,32 +60,13 @@
placeholder="请输入模板详情"
/>
</el-form-item>
<el-form-item
label="适用设备"
prop="templateEnvironment"
>
<el-select
v-model="temp.templateEnvironment"
class="filter-item"
placeholder="请选择适用设备"
>
<el-option
v-for="item in templateEnvironment"
:key="item"
:label="item"
:value="item"
/>
<el-form-item label="适用设备" prop="templateEnvironment">
<el-select v-model="temp.templateEnvironment" class="filter-item" placeholder="请选择适用设备">
<el-option v-for="item in templateEnvironment" :key="item" :label="item" :value="item" />
</el-select>
</el-form-item>
<el-form-item
label="显示方式"
prop="templateShow"
>
<el-select
v-model="temp.templateShow"
class="filter-item"
placeholder="请选择显示方式"
>
<el-form-item label="显示方式" prop="templateShow">
<el-select v-model="temp.templateShow" class="filter-item" placeholder="请选择显示方式">
<el-option
v-for="item in showStatus"
:key="item.id"
......@@ -112,37 +75,25 @@
/>
</el-select>
</el-form-item>
<el-form-item
label="显示比列"
prop="templateProportion"
>
<el-form-item label="显示比列" prop="templateProportion">
<el-input
v-model="temp.templateProportion1"
width="100"
style="width: 100px;"
placeholder=""
placeholder
/>:
<el-input
v-model="temp.templateProportion2"
width="100"
style="width: 100px;"
placeholder=""
placeholder
/>
</el-form-item>
<el-form-item
label="模板包名称"
prop="templatePackageName"
>
<el-input
v-model="temp.templatePackageName"
placeholder="请输入模板包名称"
/>
<el-form-item label="模板包名称" prop="templatePackageName">
<el-input v-model="temp.templatePackageName" placeholder="请输入模板包名称" />
</el-form-item>
<el-form-item
v-if="!templateId"
label="上传模板包"
>
<el-form-item v-if="!templateId" label="上传模板包">
<el-upload
class="upload-demo"
drag
......@@ -153,24 +104,17 @@
:action="templateUploadZipUrl"
>
<i class="el-icon-upload" />
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div
slot="tip"
class="el-upload__tip"
>只能上传zip包</div>
<div class="el-upload__text">
将文件拖到此处,或
<em>点击上传</em>
</div>
<div slot="tip" class="el-upload__tip">只能上传zip包</div>
</el-upload>
</el-form-item>
</el-form>
<div>
<el-button
style="margin-left: 10px;"
type="primary"
@click="createData"
>
保存
</el-button>
<el-button style="margin-left: 10px;" type="primary" @click="createData">保存</el-button>
</div>
</div>
</div>
</template>
......@@ -340,9 +284,14 @@ export default {
if (id) {
getDetail(this.$route.query.templateId).then(response => {
const tempData = JSON.parse(JSON.stringify(response))
tempData.templateShow = tempData.templateShow && tempData.templateShow.toUpperCase()
tempData.templateProportion1 = tempData.templateProportion && tempData.templateProportion.split('/')[0]
tempData.templateProportion2 = tempData.templateProportion && tempData.templateProportion.split('/')[1]
tempData.templateShow =
tempData.templateShow && tempData.templateShow.toUpperCase()
tempData.templateProportion1 =
tempData.templateProportion &&
tempData.templateProportion.split('/')[0]
tempData.templateProportion2 =
tempData.templateProportion &&
tempData.templateProportion.split('/')[1]
this.temp = Object.assign(this.temp, tempData)
this.getTagsList()
console.log(response)
......@@ -363,7 +312,13 @@ export default {
this.temp.resourceInfo.resourceUrl = e.resourceUrl
this.temp.templateCount = e.pictureUrl.length
this.temp.templateUrl = e.pictureUrl
.map(item => e.url + item)
.map(item => {
if (item.indexOf('http') !== -1 || item.indexOf('https') !== -1) {
return item + ''
} else {
return e.url + item + ''
}
})
.join(',')
console.log(this.temp)
}
......
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 sign in to comment