| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638 |
- <template>
- <div>
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane label="全局系统配置" name="first">
- <el-table v-loading="tableDataLoading" :data="tableData">
- <el-table-column fixed prop="type" label="编号" align="center" width="80">
- </el-table-column>
- <el-table-column prop="min" label="类型">
- </el-table-column>
- <el-table-column prop="value" label="内容" width="500">
- <template slot-scope="scope">
- <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="createAt" label="创建时间">
- </el-table-column>
- <el-table-column label="操作" prop="id" width="120">
- <template slot-scope="scope">
- <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
- @click="amend(scope.$index, scope.row)">编辑
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="服务费配置" name="fuwufei">
- <el-table v-loading="tableDataLoading" :data="tableData">
- <el-table-column fixed prop="type" label="编号" align="center" width="80">
- </el-table-column>
- <el-table-column prop="min" label="类型">
- </el-table-column>
- <el-table-column prop="value" label="内容" width="500">
- <template slot-scope="scope">
- <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="createAt" label="创建时间">
- </el-table-column>
- <el-table-column label="操作" prop="id" width="120">
- <template slot-scope="scope">
- <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
- @click="amend(scope.$index, scope.row)">编辑
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <!-- <el-tab-pane label="佣金配置" name="yongjin">
- <el-table v-loading="tableDataLoading" :data="tableData">
- <el-table-column fixed prop="type" label="编号" align="center" width="80">
- </el-table-column>
- <el-table-column prop="min" label="类型">
- </el-table-column>
- <el-table-column prop="value" label="内容" width="500">
- <template slot-scope="scope">
- <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="createAt" label="创建时间">
- </el-table-column>
- <el-table-column label="操作" prop="id" width="120">
- <template slot-scope="scope">
- <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
- @click="amend(scope.$index, scope.row)">编辑
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane> -->
- <!-- <el-tab-pane label="首页配置" name="thirdly">
- <el-table
- v-loading="tableDataLoading"
- :data="tableData">
- <el-table-column
- fixed
- prop="type"
- label="编号"
- align="center"
- width="80">
- </el-table-column>
- <el-table-column
- prop="min"
- label="类型">
- </el-table-column>
- <el-table-column
- prop="value"
- label="是否启用"
- width="500">
- </el-table-column>
- <el-table-column
- prop="createAt"
- label="创建时间">
- </el-table-column>
- <el-table-column
- label="操作"
- prop="id"
- width="120">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="primary"
- :disabled="!isAuth('allocationList:update')"
- @click="amendWhether(scope.$index, scope.row)">编辑
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- 修改弹框
- <el-dialog title="修改" :visible.sync="dialogFormVisible1" center>
- <el-form :model="form2">
- <el-form-item label="配置类型:" :label-width="formLabelWidth" >
- <el-input v-model="form2.min" style="width:65%;" readonly ></el-input>
- </el-form-item>
- <el-form-item label="是否启用:" :label-width="formLabelWidth" >
- <el-select v-model="form2.value" placeholder="请选择类型" style="width:65%;">
- <el-option v-for="item in values" :key="item.value" :label="item.label" :value="item.label">
- </el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogFormVisible1 = false">取 消</el-button>
- <el-button type="primary" @click="WhetherNoticeTo()">确 定</el-button>
- </div>
- </el-dialog>
- </el-tab-pane> -->
- <el-tab-pane label="微信配置" name="fifth">
- <el-table v-loading="tableDataLoading" :data="tableData">
- <el-table-column fixed prop="type" label="编号" align="center" width="80">
- </el-table-column>
- <el-table-column prop="min" label="类型">
- </el-table-column>
- <el-table-column prop="value" label="内容" width="500">
- <template slot-scope="scope">
- <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="createAt" label="创建时间">
- </el-table-column>
- <el-table-column label="操作" prop="id" width="120">
- <template slot-scope="scope">
- <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
- @click="amend(scope.$index, scope.row)">编辑
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="支付宝配置" name="sixth">
- <el-table v-loading="tableDataLoading" :data="tableData">
- <el-table-column fixed prop="type" label="编号" align="center" width="80">
- </el-table-column>
- <el-table-column prop="min" label="类型">
- </el-table-column>
- <el-table-column prop="value" label="内容" width="500">
- <template slot-scope="scope">
- <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="createAt" label="创建时间">
- </el-table-column>
- <el-table-column label="操作" prop="id" width="120">
- <template slot-scope="scope">
- <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
- @click="amend(scope.$index, scope.row)">编辑
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="短信配置" name="seventh">
- <el-table v-loading="tableDataLoading" :data="tableData">
- <el-table-column fixed prop="type" label="编号" align="center" width="80">
- </el-table-column>
- <el-table-column prop="min" label="类型">
- </el-table-column>
- <el-table-column prop="value" label="内容" width="500">
- <template slot-scope="scope">
- <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="createAt" label="创建时间">
- </el-table-column>
- <el-table-column label="操作" prop="id" width="120">
- <template slot-scope="scope">
- <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
- @click="amend(scope.$index, scope.row)">编辑
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="协议配置" name="xieyi">
- <el-table v-loading="tableDataLoading" :data="tableData">
- <el-table-column fixed prop="type" label="编号" align="center" width="80">
- </el-table-column>
- <el-table-column prop="min" label="类型">
- </el-table-column>
- <el-table-column prop="value" label="内容" width="500">
- <template slot-scope="scope">
- <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="createAt" label="创建时间">
- </el-table-column>
- <el-table-column label="操作" prop="id" width="120">
- <template slot-scope="scope">
- <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
- @click="amend(scope.$index, scope.row)">编辑
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="APP消息推送配置" name="app">
- <el-table v-loading="tableDataLoading" :data="tableData">
- <el-table-column fixed prop="type" label="编号" align="center" width="80">
- </el-table-column>
- <el-table-column prop="min" label="类型">
- </el-table-column>
- <el-table-column prop="value" label="内容" width="500">
- <template slot-scope="scope">
- <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="createAt" label="创建时间">
- </el-table-column>
- <el-table-column label="操作" prop="id" width="120">
- <template slot-scope="scope">
- <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
- @click="amend(scope.$index, scope.row)">编辑
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="文件上传配置" name="wenjian">
- <el-table v-loading="tableDataLoading" :data="tableData">
- <el-table-column fixed prop="type" label="编号" align="center" width="80">
- </el-table-column>
- <el-table-column prop="min" label="类型">
- </el-table-column>
- <el-table-column prop="value" label="内容" width="500">
- <template slot-scope="scope">
- <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="createAt" label="创建时间">
- </el-table-column>
- <el-table-column label="操作" prop="id" width="120">
- <template slot-scope="scope">
- <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
- @click="amend(scope.$index, scope.row)">编辑
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="会员配置" name="vip">
- <el-table v-loading="tableDataLoading" :data="tableData">
- <el-table-column fixed prop="type" label="编号" align="center" width="80">
- </el-table-column>
- <el-table-column prop="min" label="类型">
- </el-table-column>
- <el-table-column prop="value" label="内容" width="500">
- <template slot-scope="scope">
- <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="createAt" label="创建时间">
- </el-table-column>
- <el-table-column label="操作" prop="id" width="120">
- <template slot-scope="scope">
- <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
- @click="amend(scope.$index, scope.row)">编辑
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="开关配置" name="kaiguan">
- <el-table v-loading="tableDataLoading" :data="tableData">
- <el-table-column fixed prop="type" label="编号" align="center" width="80">
- </el-table-column>
- <el-table-column prop="min" label="类型" width="250">
- </el-table-column>
- <el-table-column prop="value" label="内容">
- </el-table-column>
- <el-table-column prop="createAt" label="创建时间" width="180">
- </el-table-column>
- <el-table-column label="操作" prop="id" width="120">
- <template slot-scope="scope">
- <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
- @click="amend(scope.$index, scope.row)">编辑
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="一键登录" name="login">
- <el-table v-loading="tableDataLoading" :data="tableData">
- <el-table-column fixed prop="type" label="编号" align="center" width="80">
- </el-table-column>
- <el-table-column prop="min" label="类型" width="250">
- </el-table-column>
- <el-table-column prop="value" label="内容">
- </el-table-column>
- <el-table-column prop="createAt" label="创建时间" width="180">
- </el-table-column>
- <el-table-column label="操作" prop="id" width="120">
- <template slot-scope="scope">
- <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
- @click="amend(scope.$index, scope.row)">编辑
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="图片配置" name="image">
- <el-table v-loading="tableDataLoading" :data="tableData">
- <el-table-column fixed prop="type" label="编号" align="center" width="80">
- </el-table-column>
- <el-table-column prop="min" label="类型" width="250">
- </el-table-column>
- <el-table-column prop="value" label="内容">
- <template slot-scope="scope">
- <div
- style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">
- {{scope.row.value}}
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="createAt" label="创建时间" width="180">
- </el-table-column>
- <el-table-column label="操作" prop="id" width="120">
- <template slot-scope="scope">
- <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
- @click="amend(scope.$index, scope.row)">编辑
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- </el-tabs>
- <!-- 修改弹框 -->
- <el-dialog title="修改" :visible.sync="dialogFormVisible" center>
- <el-form :model="form">
- <el-form-item label="配置类型:" :label-width="formLabelWidth">
- <el-input v-model="form.min" style="width:65%;" readonly></el-input>
- </el-form-item>
- <el-form-item label="内容:" :label-width="formLabelWidth">
- <quill-editor v-if="form.conditionFrom=='xieyi' " ref="myTextEditor" v-model="form.value" :options="quillOption"
- style="padding-bottom: 50px;height: 300px;width: 72%;display: inline-table;margin-bottom: 60px;">
- </quill-editor>
- <div v-else-if="form.conditionFrom=='kaiguan'">
- <div>
- <el-radio-group v-model="form.value">
- <el-radio label="是">是</el-radio>
- <el-radio label="否">否</el-radio>
- </el-radio-group>
- </div>
- </div>
- <div v-else-if="form.conditionFrom=='image'"
- style=" width:148px;height:148px;border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;">
- <el-upload class="avatar-uploader" v-model="form.value"
- :action="$http.adornUrl('alioss/upload')" :show-file-list="false"
- :on-success="handleAvatarSuccess">
- <img v-if="form.value" :src="form.value" class="avatar"
- style="border-radius: 6px;width: 140px;height: 140px;" />
- <i v-else class="el-icon-plus avatar-uploader-icon"></i>
- </el-upload>
- </div>
- <el-input v-else v-model="form.value" style="width:65%;"></el-input>
- <!-- <el-input v-model="form.value" style="width:65%;"></el-input> -->
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogFormVisible = false">取 消</el-button>
- <el-button type="primary" @click="amendNoticeTo()">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- quillEditor
- } from 'vue-quill-editor'
- import 'quill/dist/quill.core.css'
- import 'quill/dist/quill.snow.css'
- import 'quill/dist/quill.bubble.css'
- import quillConfig from '../mission/quill-config.js'
- export default {
- name: 'news',
- components: {
- quillEditor
- },
- data() {
- return {
- openValue: '是',
- closeValue: '否',
- limit: 10,
- page: 0,
- min: '',
- value: '',
- id: '',
- condition: 'xitong',
- activeName: 'first',
- dialogFormVisible: false,
- dialogFormVisible1: false,
- tableDataLoading: true,
- formLabelWidth: '200px',
- form: {
- id: '',
- min: '',
- value: '',
- type: '',
- },
- form2: {
- id: '',
- min: '',
- value: '',
- type: '',
- },
- values: [{
- value: 1,
- label: '是'
- },
- {
- value: 2,
- label: '否'
- }
- ],
- tableData: [],
- quillOption: quillConfig,
- checkBoxData: [] //多选框选择的值
- }
- },
- methods: {
- handleSizeChange(val) {
- this.limit = val;
- this.dataSelect();
- },
- handleCurrentChange(val) {
- this.page = val - 1;
- this.dataSelect();
- },
- handleClick(tab, event) {
- if (tab._props.label == '全局系统配置') {
- this.condition = 'xitong'
- this.dataSelect()
- }
- if (tab._props.label == '首页配置') {
- this.condition = 'shouye'
- this.dataSelect()
- }
- if (tab._props.label == '微信配置') {
- this.condition = 'weixin'
- this.dataSelect()
- }
- if (tab._props.label == '支付宝配置') {
- this.condition = 'zhifubao'
- this.dataSelect()
- }
- if (tab._props.label == '短信配置') {
- this.condition = 'duanxin'
- this.dataSelect()
- }
- if (tab._props.label == '服务系统配置') {
- this.condition = 'renwu'
- this.dataSelect()
- }
- if (tab._props.label == '协议配置') {
- this.condition = 'xieyi'
- this.dataSelect()
- }
- if (tab._props.label == 'APP消息推送配置') {
- this.condition = 'push'
- this.dataSelect()
- }
- if (tab._props.label == '文件上传配置') {
- this.condition = 'oss'
- this.dataSelect()
- }
- if (tab._props.label == '服务费配置') {
- this.condition = 'fuwufei'
- this.dataSelect()
- }
- if (tab._props.label == '佣金配置') {
- this.condition = 'yongjin'
- this.dataSelect()
- }
- if (tab._props.label == '会员配置') {
- this.condition = 'vip'
- this.dataSelect()
- }
- if (tab._props.label == '开关配置') {
- this.condition = 'kaiguan'
- this.dataSelect()
- }
- if (tab._props.label == '图片配置') {
- this.condition = 'image'
- this.dataSelect()
- }
-
-
- },
- // 修改弹框
- amend(index, rows) {
- this.dialogFormVisible = true;
- this.form.id = rows.id;
- this.form.type = rows.type
- this.form.min = rows.min;
- this.form.value = rows.value;
- this.form.max = rows.max;
- this.form.createAt = rows.createAt;
- this.form.conditionFrom = rows.conditionFrom
- },
- // 修改
- amendNoticeTo() {
- this.$http({
- url: this.$http.adornUrl('common/update'),
- method: 'post',
- data: this.$http.adornData({
- 'id': this.form.id,
- 'type': this.form.type,
- 'value': this.form.value,
- 'min': this.form.min,
- 'max': this.form.max,
- 'createAt': this.form.createAt,
- 'conditionFrom': this.form.conditionFrom
- })
- }).then(({
- data
- }) => {
- if (data && data.code === 0) {
- this.dialogFormVisible = false
- this.$message({
- message: '操作成功',
- type: 'success',
- duration: 1500,
- onClose: () => {
- this.dataSelect()
- }
- })
- } else {
- this.$message.error(data.msg)
- }
- })
- },
- // 修改首页
- amendWhether(index, rows) {
- this.dialogFormVisible1 = true;
- this.form2.id = rows.id;
- this.form2.type = rows.type
- this.form2.min = rows.min;
- this.form2.value = rows.value;
- this.form2.max = rows.max;
- this.form2.createAt = rows.createAt;
- this.form2.conditionFrom = rows.conditionFrom
- },
- WhetherNoticeTo() {
- this.$http({
- url: this.$http.adornUrl('common/update'),
- method: 'post',
- data: this.$http.adornData({
- 'id': this.form2.id,
- 'type': this.form2.type,
- 'value': this.form2.value,
- 'min': this.form2.min,
- 'max': this.form2.max,
- 'createAt': this.form2.createAt,
- 'conditionFrom': this.form2.conditionFrom
- })
- }).then(({
- data
- }) => {
- if (data && data.code === 0) {
- this.dialogFormVisible1 = false
- this.$message({
- message: '操作成功',
- type: 'success',
- duration: 1500,
- onClose: () => {
- this.dataSelect()
- }
- })
- } else {
- this.$message.error(data.msg)
- }
- })
- },
- // 获取数据列表
- dataSelect() {
- this.tableDataLoading = true
- this.$http({
- url: this.$http.adornUrl(`common/type/condition/${this.condition}`),
- method: 'get',
- params: this.$http.adornParams({})
- }).then(({
- data
- }) => {
- if (data && data.code === 0) {
- this.tableDataLoading = false
- let returnData = data.data;
- this.tableData = returnData
- }
- })
- },
- // 图标上传
- handleAvatarSuccess(file) {
- this.form.value = file.data;
- },
- beforeAvatarUpload(file) {
- console.log('file.size',file.size)
- // const isJPG = file.type === 'image/jpeg';
- const isLt2M = file.size / 1024 < 100;
-
- // if (!isJPG) {
- // this.$message.error('上传头像图片只能是 JPG 格式!');
- // }
- if (!isLt2M) {
- this.$message.error('上传头像图片大小不能超过 100KB!');
- }
- return isLt2M;
- }
- },
- mounted() {
- this.dataSelect()
- }
- }
- </script>
- <style scoped="scoped">
- .eit {
- height: 120px;
- }
- </style>
|