|
|
|
@ -167,8 +167,8 @@
|
|
|
|
</el-image>
|
|
|
|
</el-image>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="解锁小程序标签" align="center" prop="modeDesc" />
|
|
|
|
<el-table-column label="解锁小程序标签" align="center" prop="lockWechatTag" />
|
|
|
|
<el-table-column label="解锁企微标签" align="center" prop="modeDesc" />
|
|
|
|
<el-table-column label="解锁企微标签" align="center" prop="lockCompanyTag" />
|
|
|
|
<el-table-column label="备注 " align="center" prop="remark" />
|
|
|
|
<el-table-column label="备注 " align="center" prop="remark" />
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
@ -199,7 +199,7 @@
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改模式列表对话框 -->
|
|
|
|
<!-- 添加或修改模式列表对话框 -->
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :before-close="closeOpen">
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
|
<el-form-item label="仪器类型" prop="instrumentType">
|
|
|
|
<el-form-item label="仪器类型" prop="instrumentType">
|
|
|
|
<el-select v-model="form.instrumentType">
|
|
|
|
<el-select v-model="form.instrumentType">
|
|
|
|
@ -217,14 +217,16 @@
|
|
|
|
<el-upload
|
|
|
|
<el-upload
|
|
|
|
:action="upload.url"
|
|
|
|
:action="upload.url"
|
|
|
|
:headers="upload.headers"
|
|
|
|
:headers="upload.headers"
|
|
|
|
|
|
|
|
:file-list="bannerList"
|
|
|
|
list-type="picture-card"
|
|
|
|
list-type="picture-card"
|
|
|
|
:on-preview="handlePreviewFile"
|
|
|
|
:on-preview="handlePreviewFile"
|
|
|
|
:on-success="handleBannerFileSuccess"
|
|
|
|
:on-success="handleBannerFileSuccess"
|
|
|
|
:on-remove="handleRemove">
|
|
|
|
:before-upload="beforeBannerUpload"
|
|
|
|
|
|
|
|
:on-remove="handleRemoveBanner">
|
|
|
|
<i class="el-icon-plus"></i>
|
|
|
|
<i class="el-icon-plus"></i>
|
|
|
|
</el-upload>
|
|
|
|
</el-upload>
|
|
|
|
<el-dialog :visible.sync="dialogVisible">
|
|
|
|
<el-dialog :visible.sync="dialogVisible">
|
|
|
|
<img width="100%" :src="form.modeBanner" alt="">
|
|
|
|
<img width="100%" :src="dialogImageUrl" alt="">
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="模式视频" prop="modeVideo">
|
|
|
|
<el-form-item label="模式视频" prop="modeVideo">
|
|
|
|
@ -241,6 +243,12 @@
|
|
|
|
<div slot="tip" class="el-upload__tip">只能上传视频文件,且不超过50M</div>
|
|
|
|
<div slot="tip" class="el-upload__tip">只能上传视频文件,且不超过50M</div>
|
|
|
|
</el-upload>
|
|
|
|
</el-upload>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="解锁小程序标签" prop="showWechatTagId" label-width="120px">
|
|
|
|
|
|
|
|
<treeselect v-model="form.lockWechatTagArray" :options="chatTagOptions" :multiple="true" :show-count="true" placeholder="请选择小程序标签" :disable-branch-nodes="true" />
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="解锁企微标签" prop="showCompanyTagId" label-width="120px">
|
|
|
|
|
|
|
|
<treeselect v-model="form.lockCompanyTagArray" :options="tagOptions" :multiple="true" :show-count="true" placeholder="请选择企微标签" :disable-branch-nodes="true" />
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" maxlength="50"></el-input>
|
|
|
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" maxlength="50"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
@ -248,7 +256,7 @@
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
<el-button @click="cancel">重 置</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@ -257,9 +265,12 @@
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import { listMode, getMode, delMode, addMode, updateMode } from "@/api/system/mode";
|
|
|
|
import { listMode, getMode, delMode, addMode, updateMode } from "@/api/system/mode";
|
|
|
|
import {getToken} from "@/utils/auth";
|
|
|
|
import {getToken} from "@/utils/auth";
|
|
|
|
|
|
|
|
import { tagTreeSelect } from "@/api/system/wechatTab";
|
|
|
|
|
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
|
|
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: "Mode",
|
|
|
|
name: "Mode",
|
|
|
|
|
|
|
|
components: { Treeselect },
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
// 遮罩层
|
|
|
|
// 遮罩层
|
|
|
|
@ -274,6 +285,8 @@ export default {
|
|
|
|
showSearch: true,
|
|
|
|
showSearch: true,
|
|
|
|
// 总条数
|
|
|
|
// 总条数
|
|
|
|
total: 0,
|
|
|
|
total: 0,
|
|
|
|
|
|
|
|
tagOptions: [],
|
|
|
|
|
|
|
|
chatTagOptions: [],
|
|
|
|
// 模式列表表格数据
|
|
|
|
// 模式列表表格数据
|
|
|
|
modeList: [],
|
|
|
|
modeList: [],
|
|
|
|
dialogImageUrl: '',
|
|
|
|
dialogImageUrl: '',
|
|
|
|
@ -340,6 +353,7 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
|
|
|
|
|
this.getDeptTree();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
/** 查询模式列表列表 */
|
|
|
|
/** 查询模式列表列表 */
|
|
|
|
@ -351,9 +365,14 @@ export default {
|
|
|
|
this.loading = false;
|
|
|
|
this.loading = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
closeOpen(){
|
|
|
|
|
|
|
|
this.fileList = [];
|
|
|
|
|
|
|
|
this.bannerList = [];
|
|
|
|
|
|
|
|
this.open = false;
|
|
|
|
|
|
|
|
},
|
|
|
|
// 取消按钮
|
|
|
|
// 取消按钮
|
|
|
|
cancel() {
|
|
|
|
cancel() {
|
|
|
|
this.open = false;
|
|
|
|
// this.open = false;
|
|
|
|
this.reset();
|
|
|
|
this.reset();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 表单重置
|
|
|
|
// 表单重置
|
|
|
|
@ -381,6 +400,8 @@ export default {
|
|
|
|
remark: null
|
|
|
|
remark: null
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.resetForm("form");
|
|
|
|
this.resetForm("form");
|
|
|
|
|
|
|
|
this.bannerList = [];
|
|
|
|
|
|
|
|
this.fileList = [];
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
handleQuery() {
|
|
|
|
handleQuery() {
|
|
|
|
@ -403,17 +424,36 @@ export default {
|
|
|
|
this.reset();
|
|
|
|
this.reset();
|
|
|
|
this.open = true;
|
|
|
|
this.open = true;
|
|
|
|
this.title = "添加模式";
|
|
|
|
this.title = "添加模式";
|
|
|
|
|
|
|
|
this.form.instrumentType = 1;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
handleUpdate(row) {
|
|
|
|
handleUpdate(row) {
|
|
|
|
this.reset();
|
|
|
|
this.reset();
|
|
|
|
const id = row.id || this.ids
|
|
|
|
const id = row.id || this.ids
|
|
|
|
|
|
|
|
this.bannerList = [];
|
|
|
|
|
|
|
|
this.fileList = [];
|
|
|
|
getMode(id).then(response => {
|
|
|
|
getMode(id).then(response => {
|
|
|
|
this.form = response.data;
|
|
|
|
this.form = response.data;
|
|
|
|
this.open = true;
|
|
|
|
this.open = true;
|
|
|
|
this.title = "修改模式";
|
|
|
|
this.title = "修改模式";
|
|
|
|
|
|
|
|
this.fileList.push({
|
|
|
|
|
|
|
|
name: this.handleFileInfo(this.form.modeVideo),
|
|
|
|
|
|
|
|
url: this.form.modeVideo
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
this.bannerList.push({
|
|
|
|
|
|
|
|
name: this.handleFileInfo(this.form.modeBanner),
|
|
|
|
|
|
|
|
url: this.form.modeBanner
|
|
|
|
|
|
|
|
})
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
handleFileInfo(url) {
|
|
|
|
|
|
|
|
if (url) {
|
|
|
|
|
|
|
|
const filePath = url.substring(0, url.lastIndexOf("/"));
|
|
|
|
|
|
|
|
// 获取文件名(包括扩展名)
|
|
|
|
|
|
|
|
const fileNameWithExtension = url.substr(filePath.length + 1);
|
|
|
|
|
|
|
|
return fileNameWithExtension
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
/** 提交按钮 */
|
|
|
|
/** 提交按钮 */
|
|
|
|
submitForm() {
|
|
|
|
submitForm() {
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
@ -444,6 +484,15 @@ export default {
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
}).catch(() => {});
|
|
|
|
}).catch(() => {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
/** 查询标签下拉树结构 */
|
|
|
|
|
|
|
|
getDeptTree() {
|
|
|
|
|
|
|
|
tagTreeSelect({type: 2}).then(response => {
|
|
|
|
|
|
|
|
this.tagOptions = response.data;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
tagTreeSelect({type: 1}).then(response => {
|
|
|
|
|
|
|
|
this.chatTagOptions = response.data;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
handleExport() {
|
|
|
|
handleExport() {
|
|
|
|
this.download('system/mode/export', {
|
|
|
|
this.download('system/mode/export', {
|
|
|
|
@ -451,7 +500,12 @@ export default {
|
|
|
|
}, `mode_${new Date().getTime()}.xlsx`)
|
|
|
|
}, `mode_${new Date().getTime()}.xlsx`)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleRemove(file, fileList) {
|
|
|
|
handleRemove(file, fileList) {
|
|
|
|
console.log(file, fileList);
|
|
|
|
console.log('调用了')
|
|
|
|
|
|
|
|
this.fileList = [];
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handleRemoveBanner(file, fileList) {
|
|
|
|
|
|
|
|
// console.log('调用了删除')
|
|
|
|
|
|
|
|
this.bannerList = [];
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handlePreview(file) {
|
|
|
|
handlePreview(file) {
|
|
|
|
console.log(file);
|
|
|
|
console.log(file);
|
|
|
|
@ -465,20 +519,28 @@ export default {
|
|
|
|
name: response.data.name,
|
|
|
|
name: response.data.name,
|
|
|
|
url: response.data.url,
|
|
|
|
url: response.data.url,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
this.form.modeVideo = response.data.url;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 封面上传成功处理
|
|
|
|
// 封面上传成功处理
|
|
|
|
handleBannerFileSuccess(response, file, fileList, item) {
|
|
|
|
handleBannerFileSuccess(response, file, fileList, item) {
|
|
|
|
console.log('上传后的结果==>',JSON.stringify(response))
|
|
|
|
console.log('上传后的结果==>',JSON.stringify(response))
|
|
|
|
if(response.code == '200') {
|
|
|
|
if(response.code == '200') {
|
|
|
|
|
|
|
|
this.bannerList = [];
|
|
|
|
this.form.modeBanner = response.data.url;
|
|
|
|
this.form.modeBanner = response.data.url;
|
|
|
|
this.bannerList.push(response.data.url);
|
|
|
|
this.bannerList.push({name:response.data.name,url:response.data.url});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handlePreviewFile(file){
|
|
|
|
handlePreviewFile(file){
|
|
|
|
this.dialogImageUrl = file.url;
|
|
|
|
this.dialogImageUrl = file.url;
|
|
|
|
this.dialogVisible = true;
|
|
|
|
this.dialogVisible = true;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
beforeBannerUpload(){
|
|
|
|
|
|
|
|
// if(this.bannerList.length == 1){
|
|
|
|
|
|
|
|
// this.$message.error('当前封面图片只支持上传一张');
|
|
|
|
|
|
|
|
// return false;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|