修改专题

This commit is contained in:
lcc
2024-07-28 17:51:10 +08:00
parent b858ac3ed0
commit 3d53c51cd0
4 changed files with 160 additions and 5 deletions
@@ -20,11 +20,11 @@
<el-form-item label="类型:" prop="type">
<el-radio-group v-model="form.type" :disabled="isUpdate">
<el-radio
:label="parseInt(key)"
:label="parseInt(item.key)"
v-for="(item, key) in types"
:key="key"
>
{{ item }}
{{ item.value }}
</el-radio>
</el-radio-group>
</el-form-item>
@@ -80,7 +80,10 @@
:multiple="true"
/>
</el-form-item>
<el-form-item label="报名:" prop="showBtn">
<el-form-item
:label="moduleType === 6 ? '团员信息' : '报名:'"
prop="showBtn"
>
<el-radio-group v-model="form.showBtn">
<el-radio label="0" key="0"></el-radio>
<el-radio label="1" key="1"></el-radio>
@@ -0,0 +1,135 @@
<!-- 用户编辑弹窗 -->
<template>
<ele-modal
width="700px"
:visible="visible"
:append-to-body="true"
:close-on-click-modal="true"
custom-class="ele-dialog-form"
title="链接"
@update:visible="updateVisible"
>
<table
class="ele-table ele-table-border ele-table-medium"
style="margin-bottom: 20px"
>
<colgroup>
<col />
<col />
</colgroup>
<thead>
<tr>
<th>名称</th>
<th style="text-align: center">链接</th>
</tr>
</thead>
<tbody>
<tr>
<td>活动链接</td>
<td style="text-align: center">
<div
style="display: inline-block; margin-right: 10px"
class="ele-text-secondary"
v-html="form.url"
></div>
<el-button
v-clipboard:copy="form.url"
v-clipboard:success="onCopy"
size="small"
>
复制
</el-button>
</td>
</tr>
<tr>
<td>二维码图片</td>
<td style="text-align: center">
<ele-qr-code
:value="form.url"
:size="160"
:image-settings="image"
/>
<div class="ele-text-secondary">鼠标右建可复制保存</div>
</td>
</tr>
</tbody>
</table>
</ele-modal>
</template>
<script>
import EleQrCode from 'ele-admin/es/ele-qr-code';
export default {
components: { EleQrCode },
props: {
// 弹窗是否打开
visible: Boolean,
// 修改回显的数据
data: Object
},
data() {
const defaultForm = {
url: ''
};
return {
level: 'L',
size: 120,
margin: 0,
image: {
src: '',
width: 28,
height: 28,
x: undefined,
y: undefined,
excavate: false
},
defaultForm,
// 表单数据
form: { ...defaultForm },
// 表单验证规则
// 提交状态
loading: false
};
},
created() {
let hostname = window.location.hostname;
if (hostname == 'bo.liche.cn') {
this.image.src =
'https://qs.haodian.cn/web/images/project/Admin-ShiYu/code-logo.png';
} else if (hostname == 'dongfeng.haodian.cn') {
this.image.src =
'https://qs.haodian.cn/web/images/project/Admin-ShiYu/df-code-logo.png';
} else {
this.image.src =
'https://qs.haodian.cn/web/images/project/Admin-ShiYu/code-logo.png';
}
},
computed: {
// 是否开启响应式布局
styleResponsive() {
return this.$store.state.theme.styleResponsive;
}
},
methods: {
/* 更新visible */
updateVisible(value) {
this.$emit('update:visible', value);
},
onCopy: function () {
this.$message.success('复制成功!');
}
},
watch: {
visible(visible) {
if (visible) {
if (this.data) {
this.$util.assignObject(this.form, {
...this.data
});
}
}
}
}
};
</script>
+19 -2
View File
@@ -31,6 +31,15 @@
>
删除
</el-button>
<el-button
size="small"
type="success"
icon="el-icon-delete"
class="ele-btn-icon"
@click="showQrCode"
>
活动链接
</el-button>
</template>
<!-- 状态列 -->
<template v-slot:options="{ row }">
@@ -82,6 +91,8 @@
:module-type="current.type"
@done="reload"
/>
<!--二维码-->
<qr-code :visible.sync="showQr" :data="current" />
</div>
</template>
@@ -93,10 +104,11 @@
} from '@/api/sytopic/module';
import ModuleEdit from './components/module-edit.vue';
import ModuleOptionEdit from './components/module-option-edit.vue';
import QrCode from './components/qr-code.vue';
export default {
name: 'SyModule',
components: { ModuleEdit, ModuleOptionEdit },
components: { ModuleEdit, ModuleOptionEdit, QrCode },
data() {
return {
where: {},
@@ -163,7 +175,9 @@
topicId: '0',
title: '',
types: {},
showEditOption: false
showEditOption: false,
//是否显示二维码
showQr: false
};
},
created() {
@@ -241,6 +255,9 @@
});
})
.catch(() => {});
},
showQrCode() {
this.showQr = true;
}
},
watch: {