liujq 3 年之前
父節點
當前提交
47104509b3

文件差異過大導致無法顯示
+ 0 - 0
dist/index.html


文件差異過大導致無法顯示
+ 0 - 0
dist/static/css/app.a61aaa96.css


文件差異過大導致無法顯示
+ 0 - 0
dist/static/css/chunk-40a8a0f1.a05e49c9.css


文件差異過大導致無法顯示
+ 0 - 0
dist/static/css/chunk-54af4be2.438ed0e4.css


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/app.4f84457e.js


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/app.f57b6187.js


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/chunk-40a8a0f1.9a097ca7.js


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/chunk-54af4be2.ec9412e6.js


+ 30 - 0
src/api/other.js

@@ -121,4 +121,34 @@ export default {
   admchannelsdetail: params => { // 短视频管理 - 详情
     return getRequestNoSort('/adm/channels/detail', params, 'loading')
   },
+  admthemelist: params => { // 小程序主题 - 列表
+    return getRequest('/adm/theme/list', params)
+  },
+  admthemeedit: params => { // 小程序主题 - 编辑
+    return getRequestNoSort('/adm/theme/edit', params, 'loading')
+  },
+  admthemeadd: params => { // 小程序主题 - 添加
+    return getRequestNoSort('/adm/theme/add', params, 'loading')
+  },
+  admthemedel: params => { // 小程序主题 - 删除
+    return getRequestNoSort('/adm/theme/del', params, 'loading')
+  },
+  admthemedetail: params => { // 小程序主题 - 详情
+    return getRequestNoSort('/adm/theme/detail', params, 'loading')
+  },
+  admthemedatalist: params => { // 小程序主题 - 主题数据 - 列表
+    return getRequest('/adm/theme/data/list', params)
+  },
+  admthemedataedit: params => { // 小程序主题 - 主题数据 - 编辑
+    return getRequestNoSort('/adm/theme/data/edit', params, 'loading')
+  },
+  admthemedataadd: params => { // 小程序主题 - 主题数据 - 添加
+    return getRequestNoSort('/adm/theme/data/add', params, 'loading')
+  },
+  admthemedatadel: params => { // 小程序主题 - 主题数据 - 删除
+    return getRequestNoSort('/adm/theme/data/del', params, 'loading')
+  },
+  admthemedatadetail: params => { // 小程序主题 - 主题数据 - 详情
+    return getRequestNoSort('/adm/theme/data/detail', params, 'loading')
+  },
 }

+ 23 - 0
src/components/Common/BaseForm.vue

@@ -225,6 +225,29 @@
           <i v-else class="el-icon-plus icon" @click="focusHandle(item.key)" />
         </el-upload>
       </el-form-item>
+      <el-form-item
+        v-else-if="item.type === 'uploadIcon'"
+        :key="index"
+        :class="item.class"
+        :prop="item.key"
+        :label="isInline && noLabel ? '' : item.label"
+        :rules="item.rules === 1 ? [{ required: true, message: '请选择'+ item.label, trigger: 'blur' }] : item.rules"
+      >
+        <el-upload
+          class="img-upload"
+          :disabled="item.disabled || false"
+          :action="`${requireUrl}/adm/theme/icon/upload`"
+          :data="{logic_type: 'estate', token}"
+          name="upload"
+          :show-file-list="false"
+          :on-success="uploadSuccess"
+          :on-error="uploadError"
+          :before-upload="uploadBefore"
+        >
+          <img v-if="baseForm[item.key]" :src="baseForm[item.key]" class="img" @click="focusHandle(item.key)">
+          <i v-else class="el-icon-plus icon" @click="focusHandle(item.key)" />
+        </el-upload>
+      </el-form-item>
       <el-form-item
         v-else-if="item.type === 'upload2'"
         :key="index"

+ 114 - 0
src/views/base/components/popup/ThemeDtlEdit.vue

@@ -0,0 +1,114 @@
+<template>
+  <div>
+    <el-dialog
+      v-loading="loading"
+      :show-close="false"
+      :close-on-click-modal="false"
+      :visible.sync="isShow"
+      :title="curObj.id ? '编辑小程序主题数据' : '新增小程序主题数据'"
+      :fullscreen="false"
+      width="760px"
+      custom-class="xl-dialog"
+      center
+    >
+      <base-form ref="ruleForm" class="lib-edit" :data="formData" :is-inline="false" label-width="110px">
+        <div slot="footer">
+          <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
+          <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
+        </div>
+      </base-form>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+export default {
+  components: { },
+  mixins,
+  props: {
+    isShow: Boolean,
+    curObj: Object
+  },
+  inject: ['parentData'],
+  data() {
+    return {
+      loading: false,
+      formData: [],
+      cObj: {},
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        if (this.curObj.id) {
+          this.$api.other.admthemedatadetail({id: this.curObj.id}).then(res => {
+            this.cObj = res || {}
+            this.getDef()
+          })
+        } else {
+          this.getDef()
+        }
+      }
+    },
+  },
+  methods: {
+    getDef (str) {
+      let params = {}
+      params = { ...this.cObj }
+      if (str === 'edit') {
+        params = {...this.$refs.ruleForm.baseForm, ...params}
+      }
+      if (!params.hide_status) params.hide_status = '1'
+      this.formData = [
+        { label: '分类', key: 'type', class: 'c-2', type: 'select', options: this.$dictData.app_theme_type, rules: 1},
+        { label: '排序', key: 'sort', class: 'c-2', rules: 1},
+        { label: '标题', key: 'title', class: 'c-2', type: 'textarea', rules: 1},
+        { label: '图片', rules: 1, key: 'icon', class: 'c-2', type: 'uploadIcon'},
+        { label: '链接', key: 'link', class: 'c-2', rules: 1},
+        { label: '状态', rules: 1, key: 'hide_status', class: 'c-2', type: 'select', options: this.$dictData.hide_status},
+        { label: '自定义值1', class: 'c-2', key: 'option1'},
+        { label: '自定义值2', class: 'c-2', key: 'option2'},
+        { label: '备注', key: 'remark' },
+      ]
+      this.setDefaultValue(params)
+    },
+    close (str) {
+      if (str === 'confirm') {
+        this.$refs['ruleForm'].$refs['baseForm'].validate((valid) => {
+          if (valid) {
+            const oldform = this.$refs.ruleForm.baseForm
+            const newForm = { ...oldform }
+            if (this.curObj.id) newForm.id = this.curObj.id
+            newForm.theme_id = this.curObj.theme_id
+            let apiStr = 'admthemedataadd'
+            if (this.curObj.id) apiStr = 'admthemedataedit'
+            this.$api.other[apiStr](newForm).then(data => {
+              this.$msgs(newForm.id ? '编辑成功' : '新增成功')
+              this.cObj = {}
+              this.$emit('close', newForm)
+            })
+          }
+        })
+      } else {
+        this.$emit('close')
+        this.cObj = {}
+        this.setDefaultValue()
+      }
+    },
+  }
+}
+</script>
+<style lang="scss" scoped>
+@import '../../../../styles/libEdit.scss';
+.lib-edit {
+  padding-top: 0;
+  padding-left: 0;
+  padding-bottom: 40px;
+  ::v-deep .el-form-item {
+    margin-bottom: 10px;
+  }
+  ::v-deep .el-date-editor.el-input {
+    width: 100%;
+  }
+}
+</style>

+ 80 - 0
src/views/base/components/popup/ThemeEdit.vue

@@ -0,0 +1,80 @@
+<template>
+<el-dialog
+  v-loading="loading"
+  :show-close="false"
+  :close-on-click-modal="false"
+  :visible.sync="isShow"
+  :title="this.curObj && this.curObj.id ? '编辑小程序主题' : '添加小程序主题'"
+  :fullscreen="false"
+  width="470px"
+  custom-class="xl-dialog"
+  center>
+  <base-form style="width:400px" :data="formData" ref="ruleForm" :isInline="false" labelWidth="120px">
+    <div slot="footer">
+      <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
+      <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
+    </div>
+  </base-form>
+</el-dialog>
+</template>
+<script>
+export default {
+  props: {
+    isShow: Boolean,
+    curObj: Object
+  },
+  mixins,
+  data() {
+    return {
+      formData: [],
+      loading: true
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        let params = {...this.curObj}
+        this.formData = [
+          {label: '主题名称', key: 'theme_name', rules: 1},
+          {label: '执行日期', label2: '开始时间', label3: '结束时间', key: 'startEndTime', type: 'datePicker', rules: 1},
+          {label: '类型说明', key: 'remark'},
+        ]
+        this.setDefaultValue(params)
+      }
+    }
+  },
+  methods: {
+    systemChange (val) {
+      // console.log(val)
+    },
+    close (str) {
+      if (str === 'confirm') {
+        this.$refs['ruleForm'].$refs['baseForm'].validate((valid) => {
+          if (valid) {
+            const oldform = this.$refs.ruleForm.baseForm
+            let params = {...oldform}
+            let str = 'admthemeadd'
+            if(this.curObj && this.curObj.id) {
+              params.id = this.curObj.id
+              str = 'admthemeedit'
+            }
+            if (params.startEndTime) {
+              params.start_at = params.startEndTime[0]
+              params.end_at = params.startEndTime[1]
+              delete params.startEndTime
+            }
+            this.$api.other[str](params).then(data => {
+              this.$msgs('保存成功!')
+              this.$emit('close', params)
+              // this.setDefaultValue()
+            })
+          }
+        })
+      } else {
+        this.$emit('close')
+        this.setDefaultValue()
+      }
+    }
+  }
+}
+</script>

+ 36 - 0
src/views/base/components/searchForm/Theme.vue

@@ -0,0 +1,36 @@
+<template>
+  <base-form slot="content" :data="searchData" ref="ruleForm">
+    <div slot="footer">
+      <el-button :loading="listLoading" icon="el-icon-search" class="xl-form-btn bgc1" @click="searchHandle">查询</el-button>
+      <!-- <el-button :loading="listLoading" class="xl-form-btn t4" @click="updateCash">更新缓存</el-button> -->
+    </div>
+  </base-form>
+</template>
+<script>
+export default {
+  props: {
+    listLoading: Boolean
+  },
+  inject: ['parentData'],
+  data () {
+    return {
+      searchData: [
+        {label: '主题名称', key: 'theme_name'},
+        {label: '备注', key: 'remark'},
+      ]
+    }
+  },
+  methods: {
+    searchHandle () {
+      const oldform = this.$refs.ruleForm.baseForm
+      let newForm = {...oldform}
+      this.$emit('change', newForm)
+    },
+    // updateCash () {
+    //   this.$store.dispatch('user/getDict').then().then(res => {
+    //     this.$msg('更新成功~')
+    //   })
+    // }
+  }
+}
+</script>

+ 33 - 0
src/views/base/components/searchForm/ThemeDtl.vue

@@ -0,0 +1,33 @@
+<template>
+  <base-form slot="content" :data="searchData" ref="ruleForm">
+    <div slot="footer">
+      <el-button :loading="listLoading" icon="el-icon-search" class="xl-form-btn bgc1" @click="searchHandle">查询小程序主题:{{this.parentData.$route.query.theme_name}}</el-button>
+    </div>
+  </base-form>
+</template>
+<script>
+export default {
+  props: {
+    listLoading: Boolean
+  },
+  inject: ['parentData'],
+  data () {
+    return {
+      searchData: [
+        {label: '标题', key: 'title'},
+        {label: '链接', key: 'link'},
+        {label: '分类', key: 'type', type: 'select', options: this.$dictData.app_theme_type},
+        {label: '状态', key: 'hide_status', type: 'select', options: this.$dictData.hide_status},
+      ]
+    }
+  },
+  methods: {
+    searchHandle () {
+      const oldform = this.$refs.ruleForm.baseForm
+      let newForm = {...oldform}
+      newForm.theme_id = this.parentData.$route.query.id
+      this.$emit('change', newForm)
+    },
+  }
+}
+</script>

+ 100 - 0
src/views/base/theme.vue

@@ -0,0 +1,100 @@
+<template>
+  <div class="app-container">
+    <search-form
+      :listLoading="listLoading"
+      @change="searchHandle"
+      @add="openPopup"
+    />
+    <table-list
+      :operationsDefaultLength="3"
+      :listLoading="listLoading"
+      :data="tableData"
+      :columns="listConfig"
+      :currentPage="currentPage"
+      :pageSize="pageSize"
+      :totalRecords="totalRecords"
+      @currentChange="pageHandle"
+      :isAdd="true"
+      @add="openPopup"
+    />
+    <popup-edit
+      :isShow="isPopupShow"
+      :curObj="curObj"
+      @close="closePopup"
+    />
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+import SearchForm from './components/searchForm/Theme'
+import PopupEdit from './components/popup/ThemeEdit'
+import baseTable from '_m/baseTable.js'
+export default {
+  name: 'basePublicDictSys',
+  components: {
+    SearchForm,
+    PopupEdit
+  },
+  provide () {
+    return {
+      parentData: this
+    }
+  },
+  mixins: [baseTable],
+  created () {},
+  data () {
+    return {
+      apiStr: 'other.admthemelist',
+      searchForm: null,
+      isPopupShow: false,
+      // noCreated: true,
+      curObj: {}
+    }
+  },
+  mounted () {
+    this.listConfig = {
+      rows: [
+        { label: '开始时间', prop: 'start_at' },
+        { label: '结束时间', prop: 'end_at' },
+        { label: '主题名称', prop: 'theme_name' },
+        { label: '备注说明', prop: 'remark', fullShow: true },
+        { label: '更新人', prop: 'update_by' },
+        { label: '更新时间', prop: 'update_at' },
+        { label: '操作', width: 230, type: 'handle2',
+          operations: [
+            { label: '编辑', func: this.openPopup, btnType: 'primary' },
+            { label: '管理内容详情', func: this.linkDtl, btnType: 'success' },
+            { label: '删除', func: this.delHandle, btnType: 'danger', hide: 'nosys' },
+          ]
+        }
+      ]
+    }
+  },
+  methods: {
+    delHandle (row) {
+      const msgHtml = `确定要删除该主题吗?`
+      this.$msg(msgHtml, 'confirm', ()=> {
+        this.$api.other.admthemedel({
+          id: row.id,
+        }).then(data => {
+          this.$msgs(`删除成功!`)
+          this.fetchData()
+        })
+      }, null, true)
+    },
+    linkDtl (row) {
+      this.$router.push(`/base/themeDtl?theme_name=${row.theme_name}&id=${row.id}`)
+    },
+    openPopup (row) {
+      this.curObj = row
+      this.isPopupShow = true
+    },
+    closePopup (obj) {
+      this.isPopupShow = false
+      if (obj) {
+        this.fetchData()
+      }
+    }
+  }
+}
+</script>

+ 140 - 0
src/views/base/themeDtl.vue

@@ -0,0 +1,140 @@
+<template>
+  <div class="app-container">
+    <search-form
+    @change="searchHandle"/>
+    <table-list
+      :listLoading="listLoading"
+      :data="tableData2"
+      :columns="listConfig"
+      :currentPage="currentPage"
+      :pageSize="pageSize"
+      :totalRecords="totalRecords"
+      @currentChange="pageHandle"
+      :isAdd="true"
+      @add="openPopup"
+    />
+    <popup-edit
+      :isShow="isPopupShow"
+      :curObj="curObj"
+      @close="closePopup"
+    />
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+import SearchForm from './components/searchForm/ThemeDtl'
+import PopupEdit from './components/popup/ThemeDtlEdit'
+import baseTable from '_m/baseTable.js'
+export default {
+  // name: 'basePublicDictSys',
+  components: {
+    SearchForm,
+    PopupEdit
+  },
+  provide () {
+    return {
+      parentData: this
+    }
+  },
+  mixins: [baseTable],
+  data () {
+    return {
+      apiStr: 'other.admthemedatalist',
+      searchForm: null,
+      isPopupShow: false,
+      noCreated: true,
+      curObj: {},
+      curId: '',
+      curType: '',
+    }
+  },
+  computed: {
+    tableData2 () {
+      let arr = [...this.tableData]
+      arr.map(item => {
+        if (Number(item.system) === 1) item.nosys = true
+      })
+      return arr
+    }
+  },
+  mounted () {
+    this.listConfig = {
+      rows: [
+        { label: '分类', prop: 'type', type: 'tag', tags: arrToObj(this.$dictData.app_theme_type) }, 
+        { label: '标题', prop: 'title' },
+        { label: '链接', prop: 'link' },
+        { label: '排序', prop: 'sort' },
+        { label: '图片', prop: 'icon', type: 'img' },
+        { label: '状态', prop: 'hide_status', type: 'tag', tags: arrToObj(this.$dictData.hide_status), tagTypeObj: {'1': 'success', '2': 'danger'} },
+        { label: '自定义值1', prop: 'option1' },
+        { label: '自定义值2', prop: 'option2' },
+        { label: '备注', prop: 'remark' },
+        { label: '更新人', prop: 'update_by' },
+        { label: '更新时间', prop: 'update_at' },
+        { label: '操作', width: 200, type: 'handle2',
+          operations: [
+            // { labelFor: 'status', disabled: true, func: this.statusHandle, hide: 'nosys',
+            //   labelConfig: {
+            //     texts: {
+            //       1: '停用',
+            //       2: '启用'
+            //     },
+            //     btnTypes: {
+            //       1: 'danger',
+            //       2: 'success'
+            //     }
+            //   }
+            // },
+            { label: '编辑', func: this.openPopup, btnType: 'primary' },
+            { label: '删除', func: this.delHandle, btnType: 'danger', hide: 'nosys' },
+          ]
+        }
+      ]
+    }
+    const query = this.$route.query
+    if (query.id) {
+      this.searchForm = {
+        theme_id: query.id
+      }
+      this.fetchData()
+    }
+  },
+  methods: {
+    delHandle (row) {
+      const msgHtml = `确定要删除此数据吗?`
+      this.$msg(msgHtml, 'confirm', ()=> {
+        this.$api.other.admthemedatadel({
+          id: row.id,
+        }).then(data => {
+          this.$msgs(`删除成功!`)
+          this.fetchData()
+        })
+      }, null, true)
+    },
+    // statusHandle (row) {
+    //   const status = Number(row.status) === 1 ? 2 : 1
+    //   const msgText = Number(row.status) === 1 ? '停用' : '启用'
+    //   this.$msg(`确定要${msgText}该字典吗?`, 'confirm', ()=> {
+    //     this.$api.other.dictupdate({
+    //       id: row.id,
+    //       status
+    //     }).then(data => {
+    //       this.$msgs(`${msgText}成功!`)
+    //       this.fetchData()
+    //     })
+    //   }, null, true)
+    // },
+    openPopup (row) {
+      this.curObj = row || {}
+      this.curObj.theme_id = this.searchForm.theme_id
+      this.isPopupShow = true
+    },
+    closePopup (obj) {
+      this.isPopupShow = false
+      if (obj) {
+        this.fetchData()
+      }
+    }
+  }
+}
+</script>

部分文件因文件數量過多而無法顯示