Commit c6f015c1 by 陈羽

update: update

parent 19690151
...@@ -11,13 +11,16 @@ ...@@ -11,13 +11,16 @@
import imageEdit from '@/components/set/image-edit.vue'; import imageEdit from '@/components/set/image-edit.vue';
--> -->
<template> <template>
<el-dialog :title="!!editRow.materialId ? '编辑网页' : '新建网页'" :visible.sync="dialogVisible" width="600px" :before-close="handleClose"> <el-dialog :title="!!editRow.materialId ? '编辑小程序' : '新建小程序'" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
<div class=""> <div class="">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm"> <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="小程序" prop="appId"> <el-form-item label="小程序" prop="appId">
<el-select v-model="ruleForm.appId" placeholder="请选择小程序" @change="appsChange"> <template v-if="!!editRow.materialId">{{ ruleForm.materialDesc }}</template>
<el-option v-for="item in appList" :key="item.value" :label="item.miniprogramName" :value="item.appId"> </el-option> <template v-else>
</el-select> <el-select v-model="ruleForm.appId" placeholder="请选择小程序" @change="appsChange">
<el-option v-for="item in appList" :key="item.value" :label="item.miniprogramName" :value="item.appId"> </el-option>
</el-select>
</template>
</el-form-item> </el-form-item>
<el-form-item label="标题" prop="materialTitle"> <el-form-item label="标题" prop="materialTitle">
<limitInput :inputWidth="440" :inputValue.sync="ruleForm.materialTitle" :holder="'请输入标题'" :getByType="'word'" :maxLength="8"> </limitInput> <limitInput :inputWidth="440" :inputValue.sync="ruleForm.materialTitle" :holder="'请输入标题'" :getByType="'word'" :maxLength="8"> </limitInput>
...@@ -115,7 +118,6 @@ export default { ...@@ -115,7 +118,6 @@ export default {
appsChange(v) { appsChange(v) {
const that = this; const that = this;
const item = that.appList.filter(item => item.appId === v)[0]; const item = that.appList.filter(item => item.appId === v)[0];
console.log(item);
this.ruleForm = Object.assign({}, this.ruleForm, { this.ruleForm = Object.assign({}, this.ruleForm, {
appId: item.appId, appId: item.appId,
materialTitle: item.title, materialTitle: item.title,
...@@ -147,11 +149,10 @@ export default { ...@@ -147,11 +149,10 @@ export default {
materialType: 6, materialType: 6,
appId: that.ruleForm.appId, appId: that.ruleForm.appId,
link: that.ruleForm.link, link: that.ruleForm.link,
materialId: that.ruleForm.materialId,
materialTitle: that.ruleForm.materialTitle, materialTitle: that.ruleForm.materialTitle,
imgUrl: that.ruleForm.imgUrl imgUrl: that.ruleForm.imgUrl
}; };
console.log(data); if (that.ruleForm.materialId) data.materialId = that.ruleForm.materialId;
postRequest(that.ruleForm.materialId ? '/haoban-manage3-web/material-edit' : '/haoban-manage3-web/material-add', data) postRequest(that.ruleForm.materialId ? '/haoban-manage3-web/material-edit' : '/haoban-manage3-web/material-add', data)
.then(res => { .then(res => {
let resData = res.data; let resData = res.data;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<div class="color-606266 line-18">{{ scope.row.updateTime | timeStampToHms }}</div> <div class="color-606266 line-18">{{ scope.row.updateTime | timeStampToHms }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="scope.row.fromMaterialId == '-1'"> <template v-if="scope.row.fromMaterialId == '-1'">
<el-button type="text" @click="toEdit(scope.$index, scope.row)">编辑</el-button> <el-button type="text" @click="toEdit(scope.$index, scope.row)">编辑</el-button>
......
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